@beinformed/ui 1.63.2 → 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -2419
- package/dist/Constants-BIbEko1E.d.cts +57 -0
- package/dist/Constants-BIbEko1E.d.ts +57 -0
- package/dist/FormModel-40md7nLX.d.ts +457 -0
- package/dist/FormModel-CemlQ_MU.d.cts +457 -0
- package/dist/chunk-2MCBBWEA.js +1 -0
- package/dist/chunk-2MCBBWEA.js.map +1 -0
- package/dist/chunk-52QS5IDA.js +1 -0
- package/dist/chunk-52QS5IDA.js.map +1 -0
- package/dist/chunk-73XVCQCW.js +2 -0
- package/dist/chunk-73XVCQCW.js.map +1 -0
- package/dist/chunk-77CGPEAQ.js +2 -0
- package/dist/chunk-77CGPEAQ.js.map +1 -0
- package/dist/chunk-BE2T4IDL.js +2 -0
- package/dist/chunk-BE2T4IDL.js.map +1 -0
- package/dist/chunk-BODVDNNA.js +2 -0
- package/dist/chunk-BODVDNNA.js.map +1 -0
- package/dist/chunk-CKI2GSM7.js +2 -0
- package/dist/chunk-CKI2GSM7.js.map +1 -0
- package/dist/chunk-CPYNQW3X.js +3 -0
- package/dist/chunk-CPYNQW3X.js.map +1 -0
- package/dist/chunk-ELPRKFLG.js +1 -0
- package/dist/chunk-ELPRKFLG.js.map +1 -0
- package/dist/chunk-EP2OYSVS.js +2 -0
- package/dist/chunk-EP2OYSVS.js.map +1 -0
- package/dist/chunk-FGEQKEJQ.js +2 -0
- package/dist/chunk-FGEQKEJQ.js.map +1 -0
- package/dist/chunk-L7K7QDC2.js +2 -0
- package/dist/chunk-L7K7QDC2.js.map +1 -0
- package/dist/chunk-LHZG2ET5.js +2 -0
- package/dist/chunk-LHZG2ET5.js.map +1 -0
- package/dist/chunk-LYBG43T6.js +2 -0
- package/dist/chunk-LYBG43T6.js.map +1 -0
- package/dist/chunk-MQBYZKME.js +2 -0
- package/dist/chunk-MQBYZKME.js.map +1 -0
- package/dist/chunk-SGXACUOV.js +2 -0
- package/dist/chunk-SGXACUOV.js.map +1 -0
- package/dist/chunk-VGAPPKHA.js +2 -0
- package/dist/chunk-VGAPPKHA.js.map +1 -0
- package/dist/chunk-VI6SO5NT.js +1 -0
- package/dist/chunk-VI6SO5NT.js.map +1 -0
- package/dist/chunk-VV3IT7US.js +1 -0
- package/dist/chunk-VV3IT7US.js.map +1 -0
- package/dist/chunk-WVQSFYWD.js +2 -0
- package/dist/chunk-WVQSFYWD.js.map +1 -0
- package/dist/chunk-YUOGIFZH.js +33 -0
- package/dist/chunk-YUOGIFZH.js.map +1 -0
- package/dist/constants/index.cjs +2 -0
- package/dist/constants/index.cjs.map +1 -0
- package/dist/constants/index.d.cts +28 -0
- package/dist/constants/index.d.ts +28 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/exceptions/index.cjs +2 -0
- package/dist/exceptions/index.cjs.map +1 -0
- package/dist/exceptions/index.d.cts +88 -0
- package/dist/exceptions/index.d.ts +88 -0
- package/dist/exceptions/index.js +2 -0
- package/dist/exceptions/index.js.map +1 -0
- package/dist/index-CgXDAyxM.d.ts +5242 -0
- package/dist/index-Ku2WDvSe.d.cts +5242 -0
- package/dist/index.cjs +34 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/layouthints/index.cjs +34 -0
- package/dist/layouthints/index.cjs.map +1 -0
- package/dist/layouthints/index.d.cts +322 -0
- package/dist/layouthints/index.d.ts +322 -0
- package/dist/layouthints/index.js +2 -0
- package/dist/layouthints/index.js.map +1 -0
- package/dist/models/index.cjs +34 -0
- package/dist/models/index.cjs.map +1 -0
- package/dist/models/index.d.cts +1133 -0
- package/dist/models/index.d.ts +1133 -0
- package/dist/models/index.js +2 -0
- package/dist/models/index.js.map +1 -0
- package/dist/modularui/index.cjs +34 -0
- package/dist/modularui/index.cjs.map +1 -0
- package/dist/modularui/index.d.cts +216 -0
- package/dist/modularui/index.d.ts +216 -0
- package/dist/modularui/index.js +2 -0
- package/dist/modularui/index.js.map +1 -0
- package/dist/settings/index.cjs +2 -0
- package/dist/settings/index.cjs.map +1 -0
- package/dist/settings/index.d.cts +57 -0
- package/dist/settings/index.d.ts +57 -0
- package/dist/settings/index.js +2 -0
- package/dist/settings/index.js.map +1 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +5 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.cjs +33 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +183 -0
- package/dist/utils/index.d.ts +183 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +66 -203
- package/README.md +0 -32
- package/codemods/__testfixtures__/imports.input.txt +0 -41
- package/codemods/__testfixtures__/imports.output.txt +0 -44
- package/codemods/__tests__/imports.spec.js +0 -20
- package/codemods/imports.js +0 -199
- package/esm/builder/__tests__/mergeLayoutHintConfigurations.spec.js.flow +0 -71
- package/esm/builder/index.js +0 -2
- package/esm/builder/index.js.flow +0 -2
- package/esm/builder/index.js.map +0 -1
- package/esm/builder/mergeLayoutHintConfigurations.js +0 -57
- package/esm/builder/mergeLayoutHintConfigurations.js.flow +0 -62
- package/esm/builder/mergeLayoutHintConfigurations.js.map +0 -1
- package/esm/constants/Constants.js +0 -183
- package/esm/constants/Constants.js.flow +0 -190
- package/esm/constants/Constants.js.map +0 -1
- package/esm/constants/LayoutHintConfig.js +0 -167
- package/esm/constants/LayoutHintConfig.js.flow +0 -186
- package/esm/constants/LayoutHintConfig.js.map +0 -1
- package/esm/constants/LayoutHints.js +0 -129
- package/esm/constants/LayoutHints.js.flow +0 -134
- package/esm/constants/LayoutHints.js.map +0 -1
- package/esm/constants/Settings.js +0 -198
- package/esm/constants/Settings.js.flow +0 -269
- package/esm/constants/Settings.js.map +0 -1
- package/esm/constants/index.js +0 -4
- package/esm/constants/index.js.flow +0 -4
- package/esm/constants/index.js.map +0 -1
- package/esm/exceptions/ConfigurationException.js +0 -11
- package/esm/exceptions/ConfigurationException.js.flow +0 -13
- package/esm/exceptions/ConfigurationException.js.map +0 -1
- package/esm/exceptions/FetchException.js +0 -64
- package/esm/exceptions/FetchException.js.flow +0 -101
- package/esm/exceptions/FetchException.js.map +0 -1
- package/esm/exceptions/IllegalArgumentException.js +0 -11
- package/esm/exceptions/IllegalArgumentException.js.flow +0 -12
- package/esm/exceptions/IllegalArgumentException.js.map +0 -1
- package/esm/exceptions/IllegalReturnException.js +0 -10
- package/esm/exceptions/IllegalReturnException.js.flow +0 -11
- package/esm/exceptions/IllegalReturnException.js.map +0 -1
- package/esm/exceptions/IllegalStateException.js +0 -11
- package/esm/exceptions/IllegalStateException.js.flow +0 -12
- package/esm/exceptions/IllegalStateException.js.map +0 -1
- package/esm/exceptions/JsonParseException.js +0 -11
- package/esm/exceptions/JsonParseException.js.flow +0 -12
- package/esm/exceptions/JsonParseException.js.map +0 -1
- package/esm/exceptions/MissingPropertyException.js +0 -11
- package/esm/exceptions/MissingPropertyException.js.flow +0 -13
- package/esm/exceptions/MissingPropertyException.js.map +0 -1
- package/esm/exceptions/NetworkException.js +0 -16
- package/esm/exceptions/NetworkException.js.flow +0 -20
- package/esm/exceptions/NetworkException.js.map +0 -1
- package/esm/exceptions/NotAllowedUriException.js +0 -11
- package/esm/exceptions/NotAllowedUriException.js.flow +0 -12
- package/esm/exceptions/NotAllowedUriException.js.map +0 -1
- package/esm/exceptions/NotFoundException.js +0 -19
- package/esm/exceptions/NotFoundException.js.flow +0 -20
- package/esm/exceptions/NotFoundException.js.map +0 -1
- package/esm/exceptions/ServerRequestException.js +0 -11
- package/esm/exceptions/ServerRequestException.js.flow +0 -12
- package/esm/exceptions/ServerRequestException.js.map +0 -1
- package/esm/exceptions/ThemePropertyException.js +0 -11
- package/esm/exceptions/ThemePropertyException.js.flow +0 -12
- package/esm/exceptions/ThemePropertyException.js.map +0 -1
- package/esm/exceptions/TimeoutException.js +0 -11
- package/esm/exceptions/TimeoutException.js.flow +0 -13
- package/esm/exceptions/TimeoutException.js.map +0 -1
- package/esm/exceptions/UnauthorizedException.js +0 -18
- package/esm/exceptions/UnauthorizedException.js.flow +0 -26
- package/esm/exceptions/UnauthorizedException.js.map +0 -1
- package/esm/exceptions/UnsupportedOperationException.js +0 -11
- package/esm/exceptions/UnsupportedOperationException.js.flow +0 -12
- package/esm/exceptions/UnsupportedOperationException.js.map +0 -1
- package/esm/exceptions/index.js +0 -16
- package/esm/exceptions/index.js.flow +0 -16
- package/esm/exceptions/index.js.map +0 -1
- package/esm/hooks/__tests__/UseModularUIModel.spec.js.flow +0 -193
- package/esm/hooks/__tests__/useAuthentication.spec.js.flow +0 -122
- package/esm/hooks/__tests__/useForm.spec.js.flow +0 -300
- package/esm/hooks/__tests__/useI18n.spec.js.flow +0 -30
- package/esm/hooks/__tests__/useModal.spec.js.flow +0 -67
- package/esm/hooks/__tests__/useModelCatalog.spec.js.flow +0 -180
- package/esm/hooks/__tests__/useModels.spec.js.flow +0 -138
- package/esm/hooks/__tests__/useModularUIBasic.spec.js.flow +0 -126
- package/esm/hooks/__tests__/useNotification.spec.js.flow +0 -47
- package/esm/hooks/__tests__/usePreference.spec.js.flow +0 -72
- package/esm/hooks/__tests__/useProgressIndicator.spec.js.flow +0 -67
- package/esm/hooks/index.js +0 -17
- package/esm/hooks/index.js.flow +0 -17
- package/esm/hooks/index.js.map +0 -1
- package/esm/hooks/useAllFormsOnModel.js +0 -73
- package/esm/hooks/useAllFormsOnModel.js.flow +0 -92
- package/esm/hooks/useAllFormsOnModel.js.map +0 -1
- package/esm/hooks/useAuthentication.js +0 -57
- package/esm/hooks/useAuthentication.js.flow +0 -98
- package/esm/hooks/useAuthentication.js.map +0 -1
- package/esm/hooks/useContent.js +0 -41
- package/esm/hooks/useContent.js.flow +0 -48
- package/esm/hooks/useContent.js.map +0 -1
- package/esm/hooks/useDeepCompareEffect.js +0 -24
- package/esm/hooks/useDeepCompareEffect.js.flow +0 -34
- package/esm/hooks/useDeepCompareEffect.js.map +0 -1
- package/esm/hooks/useForm.js +0 -87
- package/esm/hooks/useForm.js.flow +0 -153
- package/esm/hooks/useForm.js.map +0 -1
- package/esm/hooks/useI18n.js +0 -32
- package/esm/hooks/useI18n.js.flow +0 -46
- package/esm/hooks/useI18n.js.map +0 -1
- package/esm/hooks/useModal.js +0 -35
- package/esm/hooks/useModal.js.flow +0 -46
- package/esm/hooks/useModal.js.map +0 -1
- package/esm/hooks/useModelCatalog.js +0 -199
- package/esm/hooks/useModelCatalog.js.flow +0 -256
- package/esm/hooks/useModelCatalog.js.map +0 -1
- package/esm/hooks/useModels.js +0 -37
- package/esm/hooks/useModels.js.flow +0 -50
- package/esm/hooks/useModels.js.map +0 -1
- package/esm/hooks/useModularUI.js +0 -61
- package/esm/hooks/useModularUI.js.flow +0 -90
- package/esm/hooks/useModularUI.js.map +0 -1
- package/esm/hooks/useModularUIBasic.js +0 -73
- package/esm/hooks/useModularUIBasic.js.flow +0 -101
- package/esm/hooks/useModularUIBasic.js.map +0 -1
- package/esm/hooks/useModularUIModel.js +0 -109
- package/esm/hooks/useModularUIModel.js.flow +0 -165
- package/esm/hooks/useModularUIModel.js.map +0 -1
- package/esm/hooks/useModularUIRequest.js +0 -17
- package/esm/hooks/useModularUIRequest.js.flow +0 -25
- package/esm/hooks/useModularUIRequest.js.map +0 -1
- package/esm/hooks/useNotification.js +0 -31
- package/esm/hooks/useNotification.js.flow +0 -48
- package/esm/hooks/useNotification.js.map +0 -1
- package/esm/hooks/usePreference.js +0 -15
- package/esm/hooks/usePreference.js.flow +0 -27
- package/esm/hooks/usePreference.js.map +0 -1
- package/esm/hooks/useProgressIndicator.js +0 -16
- package/esm/hooks/useProgressIndicator.js.flow +0 -33
- package/esm/hooks/useProgressIndicator.js.map +0 -1
- package/esm/hooks/useRouter.js +0 -31
- package/esm/hooks/useRouter.js.flow +0 -64
- package/esm/hooks/useRouter.js.map +0 -1
- package/esm/i18n/Locale.js +0 -121
- package/esm/i18n/Locale.js.flow +0 -157
- package/esm/i18n/Locale.js.map +0 -1
- package/esm/i18n/Locales.js +0 -132
- package/esm/i18n/Locales.js.flow +0 -171
- package/esm/i18n/Locales.js.map +0 -1
- package/esm/i18n/Message.js +0 -44
- package/esm/i18n/Message.js.flow +0 -66
- package/esm/i18n/Message.js.map +0 -1
- package/esm/i18n/__tests__/Locale.spec.js.flow +0 -108
- package/esm/i18n/__tests__/Locales.spec.js.flow +0 -137
- package/esm/i18n/index.js +0 -5
- package/esm/i18n/index.js.flow +0 -12
- package/esm/i18n/index.js.map +0 -1
- package/esm/i18n/languages.js +0 -206
- package/esm/i18n/languages.js.flow +0 -207
- package/esm/i18n/languages.js.map +0 -1
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js +0 -98
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js.flow +0 -98
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js.map +0 -1
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js +0 -98
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js.flow +0 -98
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js.map +0 -1
- package/esm/i18n/types.js +0 -2
- package/esm/i18n/types.js.flow +0 -23
- package/esm/i18n/types.js.map +0 -1
- package/esm/i18n/withMessage.js +0 -20
- package/esm/i18n/withMessage.js.flow +0 -47
- package/esm/i18n/withMessage.js.map +0 -1
- package/esm/index.js +0 -7
- package/esm/index.js.flow +0 -7
- package/esm/index.js.map +0 -1
- package/esm/models/__tests__/resolveModel.spec.js.flow +0 -34
- package/esm/models/actions/ActionCollection.js +0 -82
- package/esm/models/actions/ActionCollection.js.flow +0 -100
- package/esm/models/actions/ActionCollection.js.map +0 -1
- package/esm/models/actions/ActionModel.js +0 -186
- package/esm/models/actions/ActionModel.js.flow +0 -207
- package/esm/models/actions/ActionModel.js.map +0 -1
- package/esm/models/actions/__mock__/action.js.flow +0 -35
- package/esm/models/actions/__tests__/ActionCollection.spec.js.flow +0 -98
- package/esm/models/actions/__tests__/ActionModel.spec.js.flow +0 -75
- package/esm/models/application/ApplicationModel.js +0 -127
- package/esm/models/application/ApplicationModel.js.flow +0 -151
- package/esm/models/application/ApplicationModel.js.map +0 -1
- package/esm/models/application/__mock__/application.js.flow +0 -14
- package/esm/models/application/__tests__/Application.spec.js.flow +0 -99
- package/esm/models/attributes/AttributeCollection.js +0 -275
- package/esm/models/attributes/AttributeCollection.js.flow +0 -306
- package/esm/models/attributes/AttributeCollection.js.map +0 -1
- package/esm/models/attributes/AttributeContent.js +0 -196
- package/esm/models/attributes/AttributeContent.js.flow +0 -233
- package/esm/models/attributes/AttributeContent.js.map +0 -1
- package/esm/models/attributes/AttributeDataHelper.js +0 -261
- package/esm/models/attributes/AttributeDataHelper.js.flow +0 -323
- package/esm/models/attributes/AttributeDataHelper.js.map +0 -1
- package/esm/models/attributes/AttributeModel.js +0 -816
- package/esm/models/attributes/AttributeModel.js.flow +0 -1007
- package/esm/models/attributes/AttributeModel.js.map +0 -1
- package/esm/models/attributes/AttributeSetModel.js +0 -97
- package/esm/models/attributes/AttributeSetModel.js.flow +0 -117
- package/esm/models/attributes/AttributeSetModel.js.map +0 -1
- package/esm/models/attributes/BooleanAttributeModel.js +0 -287
- package/esm/models/attributes/BooleanAttributeModel.js.flow +0 -319
- package/esm/models/attributes/BooleanAttributeModel.js.map +0 -1
- package/esm/models/attributes/CaptchaAttributeModel.js +0 -53
- package/esm/models/attributes/CaptchaAttributeModel.js.flow +0 -51
- package/esm/models/attributes/CaptchaAttributeModel.js.map +0 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +0 -403
- package/esm/models/attributes/ChoiceAttributeModel.js.flow +0 -499
- package/esm/models/attributes/ChoiceAttributeModel.js.map +0 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js +0 -306
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.flow +0 -372
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +0 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +0 -335
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.flow +0 -415
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +0 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js +0 -182
- package/esm/models/attributes/CompositeAttributeChildCollection.js.flow +0 -254
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +0 -1
- package/esm/models/attributes/CompositeAttributeModel.js +0 -374
- package/esm/models/attributes/CompositeAttributeModel.js.flow +0 -439
- package/esm/models/attributes/CompositeAttributeModel.js.map +0 -1
- package/esm/models/attributes/DatetimeAttributeModel.js +0 -458
- package/esm/models/attributes/DatetimeAttributeModel.js.flow +0 -566
- package/esm/models/attributes/DatetimeAttributeModel.js.map +0 -1
- package/esm/models/attributes/HelptextAttributeModel.js +0 -48
- package/esm/models/attributes/HelptextAttributeModel.js.flow +0 -54
- package/esm/models/attributes/HelptextAttributeModel.js.map +0 -1
- package/esm/models/attributes/LabelAttributeModel.js +0 -34
- package/esm/models/attributes/LabelAttributeModel.js.flow +0 -36
- package/esm/models/attributes/LabelAttributeModel.js.map +0 -1
- package/esm/models/attributes/MemoAttributeModel.js +0 -42
- package/esm/models/attributes/MemoAttributeModel.js.flow +0 -43
- package/esm/models/attributes/MemoAttributeModel.js.map +0 -1
- package/esm/models/attributes/MoneyAttributeModel.js +0 -42
- package/esm/models/attributes/MoneyAttributeModel.js.flow +0 -45
- package/esm/models/attributes/MoneyAttributeModel.js.map +0 -1
- package/esm/models/attributes/NumberAttributeModel.js +0 -193
- package/esm/models/attributes/NumberAttributeModel.js.flow +0 -255
- package/esm/models/attributes/NumberAttributeModel.js.map +0 -1
- package/esm/models/attributes/PasswordAttributeModel.js +0 -209
- package/esm/models/attributes/PasswordAttributeModel.js.flow +0 -245
- package/esm/models/attributes/PasswordAttributeModel.js.map +0 -1
- package/esm/models/attributes/StringAttributeModel.js +0 -276
- package/esm/models/attributes/StringAttributeModel.js.flow +0 -314
- package/esm/models/attributes/StringAttributeModel.js.map +0 -1
- package/esm/models/attributes/UploadAttributeModel.js +0 -215
- package/esm/models/attributes/UploadAttributeModel.js.flow +0 -261
- package/esm/models/attributes/UploadAttributeModel.js.map +0 -1
- package/esm/models/attributes/XMLAttributeModel.js +0 -46
- package/esm/models/attributes/XMLAttributeModel.js.flow +0 -51
- package/esm/models/attributes/XMLAttributeModel.js.map +0 -1
- package/esm/models/attributes/__mock__/form.js.flow +0 -6
- package/esm/models/attributes/__mock__/list.js.flow +0 -6
- package/esm/models/attributes/__tests__/AttributeCollection.spec.js.flow +0 -160
- package/esm/models/attributes/__tests__/AttributeCollectionComposite.spec.js.flow +0 -146
- package/esm/models/attributes/__tests__/AttributeContent.spec.js.flow +0 -225
- package/esm/models/attributes/__tests__/AttributeDataHelper.spec.js.flow +0 -634
- package/esm/models/attributes/__tests__/AttributeModel.spec.js.flow +0 -274
- package/esm/models/attributes/__tests__/AttributeSetModel.spec.js.flow +0 -39
- package/esm/models/attributes/__tests__/BooleanAttributeModel.spec.js.flow +0 -107
- package/esm/models/attributes/__tests__/CaptchaAttributeModel.spec.js.flow +0 -13
- package/esm/models/attributes/__tests__/ChoiceAttributeModel.spec.js.flow +0 -750
- package/esm/models/attributes/__tests__/ChoiceAttributeOptionCollection.spec.js.flow +0 -507
- package/esm/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js.flow +0 -107
- package/esm/models/attributes/__tests__/CompositeAttributeModel.spec.js.flow +0 -467
- package/esm/models/attributes/__tests__/DateAttributeModel.spec.js.flow +0 -134
- package/esm/models/attributes/__tests__/DatetimeAttributeModel.spec.js.flow +0 -206
- package/esm/models/attributes/__tests__/DatetimeAttributeModel_offset.spec.js.flow +0 -345
- package/esm/models/attributes/__tests__/HelptextAttributeModel.spec.js.flow +0 -64
- package/esm/models/attributes/__tests__/LabelAttributeModel.spec.js.flow +0 -13
- package/esm/models/attributes/__tests__/LookupAttributeModel.spec.js.flow +0 -47
- package/esm/models/attributes/__tests__/MemoAttributeModel.spec.js.flow +0 -28
- package/esm/models/attributes/__tests__/MoneyAttributeModel.spec.js.flow +0 -22
- package/esm/models/attributes/__tests__/NumberAttributeModel.spec.js.flow +0 -67
- package/esm/models/attributes/__tests__/PasswordAttributeModel.spec.js.flow +0 -49
- package/esm/models/attributes/__tests__/StringAttributeModel.spec.js.flow +0 -125
- package/esm/models/attributes/__tests__/TimeAttributeModel.spec.js.flow +0 -57
- package/esm/models/attributes/__tests__/TimestampModel.spec.js.flow +0 -43
- package/esm/models/attributes/__tests__/UploadAttributeModel.spec.js.flow +0 -67
- package/esm/models/attributes/__tests__/XMLAttributeModel.spec.js.flow +0 -17
- package/esm/models/attributes/__tests__/_createAttribute.spec.js.flow +0 -106
- package/esm/models/attributes/__tests__/createAttributeComposite.spec.js.flow +0 -151
- package/esm/models/attributes/__tests__/createAttributeDynamicSchema.spec.js.flow +0 -134
- package/esm/models/attributes/_createAttribute.js +0 -86
- package/esm/models/attributes/_createAttribute.js.flow +0 -147
- package/esm/models/attributes/_createAttribute.js.map +0 -1
- package/esm/models/attributes/input-constraints/BSNConstraint.js +0 -66
- package/esm/models/attributes/input-constraints/BSNConstraint.js.flow +0 -80
- package/esm/models/attributes/input-constraints/BSNConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/ConstraintCollection.js +0 -42
- package/esm/models/attributes/input-constraints/ConstraintCollection.js.flow +0 -65
- package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +0 -1
- package/esm/models/attributes/input-constraints/ConstraintModel.js +0 -66
- package/esm/models/attributes/input-constraints/ConstraintModel.js.flow +0 -76
- package/esm/models/attributes/input-constraints/ConstraintModel.js.map +0 -1
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js +0 -198
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.flow +0 -240
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +0 -69
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.flow +0 -72
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +0 -69
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.flow +0 -72
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js +0 -115
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.flow +0 -132
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js +0 -59
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.flow +0 -60
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js +0 -91
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js.flow +0 -101
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/IBANConstraint.js +0 -42
- package/esm/models/attributes/input-constraints/IBANConstraint.js.flow +0 -46
- package/esm/models/attributes/input-constraints/IBANConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js +0 -47
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js.flow +0 -54
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js +0 -78
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.flow +0 -84
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js +0 -170
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.flow +0 -213
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js +0 -125
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.flow +0 -153
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js +0 -119
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.flow +0 -140
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js +0 -65
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.flow +0 -68
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +0 -41
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.flow +0 -44
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +0 -57
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.flow +0 -60
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +0 -57
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.flow +0 -60
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +0 -71
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.flow +0 -74
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/RangeConstraint.js +0 -136
- package/esm/models/attributes/input-constraints/RangeConstraint.js.flow +0 -161
- package/esm/models/attributes/input-constraints/RangeConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/RegexConstraint.js +0 -60
- package/esm/models/attributes/input-constraints/RegexConstraint.js.flow +0 -72
- package/esm/models/attributes/input-constraints/RegexConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js +0 -171
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js.flow +0 -179
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/XMLConstraint.js +0 -56
- package/esm/models/attributes/input-constraints/XMLConstraint.js.flow +0 -62
- package/esm/models/attributes/input-constraints/XMLConstraint.js.map +0 -1
- package/esm/models/attributes/input-constraints/__tests__/BSNConstraint.spec.js.flow +0 -25
- package/esm/models/attributes/input-constraints/__tests__/ConstraintCollection.spec.js.flow +0 -9
- package/esm/models/attributes/input-constraints/__tests__/ConstraintModel.spec.js.flow +0 -35
- package/esm/models/attributes/input-constraints/__tests__/DateBoundaryConstraint.spec.js.flow +0 -117
- package/esm/models/attributes/input-constraints/__tests__/DateTimeDateFormatConstraint.spec.js.flow +0 -30
- package/esm/models/attributes/input-constraints/__tests__/DateTimeTimeFormatConstraint.spec.js.flow +0 -54
- package/esm/models/attributes/input-constraints/__tests__/DatetimeFormatConstraint.spec.js.flow +0 -79
- package/esm/models/attributes/input-constraints/__tests__/FileExtensionConstraint.spec.js.flow +0 -20
- package/esm/models/attributes/input-constraints/__tests__/FileSizeConstraint.spec.js.flow +0 -53
- package/esm/models/attributes/input-constraints/__tests__/IBANConstraint.spec.js.flow +0 -12
- package/esm/models/attributes/input-constraints/__tests__/MandatoryConstraint.spec.js.flow +0 -14
- package/esm/models/attributes/input-constraints/__tests__/NumberBoundaryConstraint.spec.js.flow +0 -46
- package/esm/models/attributes/input-constraints/__tests__/NumberFormatConstraint.spec.js.flow +0 -137
- package/esm/models/attributes/input-constraints/__tests__/NumberGroupingConstraint.spec.js.flow +0 -85
- package/esm/models/attributes/input-constraints/__tests__/PasswordConfirmConstraint.spec.js.flow +0 -21
- package/esm/models/attributes/input-constraints/__tests__/PasswordLowerAndUpperCaseConstraint.spec.js.flow +0 -14
- package/esm/models/attributes/input-constraints/__tests__/PasswordMinNumericCharactersConstraint.spec.js.flow +0 -11
- package/esm/models/attributes/input-constraints/__tests__/PasswordMinSpecialCharactersConstraint.spec.js.flow +0 -11
- package/esm/models/attributes/input-constraints/__tests__/PasswordThreeConsecutiveCharactersNotAllowedConstraint.spec.js.flow +0 -22
- package/esm/models/attributes/input-constraints/__tests__/RegexConstraint.spec.js.flow +0 -42
- package/esm/models/attributes/input-constraints/__tests__/StringLengthConstraint.spec.js.flow +0 -102
- package/esm/models/attributes/input-constraints/__tests__/XMLConstraint.spec.js.flow +0 -15
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js +0 -59
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.flow +0 -74
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +0 -1
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js +0 -193
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.flow +0 -246
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +0 -1
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +0 -79
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.flow +0 -101
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +0 -1
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +0 -44
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.flow +0 -67
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +0 -1
- package/esm/models/attributes/layouthint-rules/__mock__/MockedCollectionFactory.js.flow +0 -54
- package/esm/models/attributes/layouthint-rules/__tests__/BaseLayoutHintRule.spec.js.flow +0 -29
- package/esm/models/attributes/layouthint-rules/__tests__/DependentAttribute.spec.js.flow +0 -310
- package/esm/models/attributes/layouthint-rules/__tests__/LayoutHintRuleCollection.spec.js.flow +0 -58
- package/esm/models/attributes/layouthint-rules/__tests__/RemainingTotalUploadSize.spec.js.flow +0 -24
- package/esm/models/base/BaseCollection.js +0 -180
- package/esm/models/base/BaseCollection.js.flow +0 -191
- package/esm/models/base/BaseCollection.js.map +0 -1
- package/esm/models/base/BaseModel.js +0 -142
- package/esm/models/base/BaseModel.js.flow +0 -155
- package/esm/models/base/BaseModel.js.map +0 -1
- package/esm/models/base/ResourceCollection.js +0 -34
- package/esm/models/base/ResourceCollection.js.flow +0 -42
- package/esm/models/base/ResourceCollection.js.map +0 -1
- package/esm/models/base/ResourceModel.js +0 -202
- package/esm/models/base/ResourceModel.js.flow +0 -246
- package/esm/models/base/ResourceModel.js.map +0 -1
- package/esm/models/base/__tests__/BaseCollection.spec.js.flow +0 -108
- package/esm/models/base/__tests__/BaseModel.spec.js.flow +0 -85
- package/esm/models/base/__tests__/ResourceCollection.spec.js.flow +0 -51
- package/esm/models/base/__tests__/ResourceModel.spec.js.flow +0 -100
- package/esm/models/caseview/CaseViewModel.js +0 -155
- package/esm/models/caseview/CaseViewModel.js.flow +0 -188
- package/esm/models/caseview/CaseViewModel.js.map +0 -1
- package/esm/models/caseview/__mock__/caseview.js.flow +0 -14
- package/esm/models/caseview/__tests__/CaseViewModel.spec.js.flow +0 -132
- package/esm/models/concepts/BusinessScenarioModel.js +0 -115
- package/esm/models/concepts/BusinessScenarioModel.js.flow +0 -176
- package/esm/models/concepts/BusinessScenarioModel.js.map +0 -1
- package/esm/models/concepts/ConceptDetailModel.js +0 -273
- package/esm/models/concepts/ConceptDetailModel.js.flow +0 -343
- package/esm/models/concepts/ConceptDetailModel.js.map +0 -1
- package/esm/models/concepts/ConceptIndexModel.js +0 -142
- package/esm/models/concepts/ConceptIndexModel.js.flow +0 -170
- package/esm/models/concepts/ConceptIndexModel.js.map +0 -1
- package/esm/models/concepts/ConceptLinkModel.js +0 -164
- package/esm/models/concepts/ConceptLinkModel.js.flow +0 -208
- package/esm/models/concepts/ConceptLinkModel.js.map +0 -1
- package/esm/models/concepts/ConceptRelationCollection.js +0 -75
- package/esm/models/concepts/ConceptRelationCollection.js.flow +0 -95
- package/esm/models/concepts/ConceptRelationCollection.js.map +0 -1
- package/esm/models/concepts/ConceptRelationModel.js +0 -107
- package/esm/models/concepts/ConceptRelationModel.js.flow +0 -129
- package/esm/models/concepts/ConceptRelationModel.js.map +0 -1
- package/esm/models/concepts/ConceptTypeDetailModel.js +0 -121
- package/esm/models/concepts/ConceptTypeDetailModel.js.flow +0 -128
- package/esm/models/concepts/ConceptTypeDetailModel.js.map +0 -1
- package/esm/models/concepts/SourceReferenceCollection.js +0 -27
- package/esm/models/concepts/SourceReferenceCollection.js.flow +0 -32
- package/esm/models/concepts/SourceReferenceCollection.js.map +0 -1
- package/esm/models/concepts/SourceReferenceModel.js +0 -93
- package/esm/models/concepts/SourceReferenceModel.js.flow +0 -114
- package/esm/models/concepts/SourceReferenceModel.js.map +0 -1
- package/esm/models/concepts/__mock__/business_scenario.js.flow +0 -26
- package/esm/models/concepts/__mock__/conceptdetail.js.flow +0 -27
- package/esm/models/concepts/__mock__/conceptindex.js.flow +0 -15
- package/esm/models/concepts/__mock__/concepttype.js.flow +0 -13
- package/esm/models/concepts/__mock__/concepttype_hierarchy.js.flow +0 -13
- package/esm/models/concepts/__mock__/related_concepts.js.flow +0 -12
- package/esm/models/concepts/__mock__/relation_with_props_and_tf_data.js.flow +0 -27
- package/esm/models/concepts/__tests__/BusinessScenarioModel.spec.js.flow +0 -28
- package/esm/models/concepts/__tests__/ConceptDetailModel.spec.js.flow +0 -65
- package/esm/models/concepts/__tests__/ConceptIndexModel.spec.js.flow +0 -42
- package/esm/models/concepts/__tests__/ConceptLinkModel.spec.js.flow +0 -9
- package/esm/models/concepts/__tests__/ConceptRelationCollection.spec.js.flow +0 -9
- package/esm/models/concepts/__tests__/ConceptRelationModel.spec.js.flow +0 -53
- package/esm/models/concepts/__tests__/ConceptTypeDetailModel.spec.js.flow +0 -31
- package/esm/models/concepts/__tests__/RelatedConcepts.spec.js.flow +0 -58
- package/esm/models/concepts/__tests__/SourceReferenceCollection.spec.js.flow +0 -9
- package/esm/models/concepts/__tests__/SourceReferenceModel.spec.js.flow +0 -108
- package/esm/models/content/ContentIndexModel.js +0 -134
- package/esm/models/content/ContentIndexModel.js.flow +0 -160
- package/esm/models/content/ContentIndexModel.js.map +0 -1
- package/esm/models/content/ContentLinkModel.js +0 -250
- package/esm/models/content/ContentLinkModel.js.flow +0 -308
- package/esm/models/content/ContentLinkModel.js.map +0 -1
- package/esm/models/content/ContentModel.js +0 -200
- package/esm/models/content/ContentModel.js.flow +0 -226
- package/esm/models/content/ContentModel.js.map +0 -1
- package/esm/models/content/ContentTOCModel.js +0 -204
- package/esm/models/content/ContentTOCModel.js.flow +0 -233
- package/esm/models/content/ContentTOCModel.js.map +0 -1
- package/esm/models/content/ContentTypeModel.js +0 -66
- package/esm/models/content/ContentTypeModel.js.flow +0 -71
- package/esm/models/content/ContentTypeModel.js.map +0 -1
- package/esm/models/content/SectionModel.js +0 -193
- package/esm/models/content/SectionModel.js.flow +0 -236
- package/esm/models/content/SectionModel.js.map +0 -1
- package/esm/models/content/SubSectionModel.js +0 -159
- package/esm/models/content/SubSectionModel.js.flow +0 -181
- package/esm/models/content/SubSectionModel.js.map +0 -1
- package/esm/models/content/__tests__/ContentIndexModel.spec.js.flow +0 -40
- package/esm/models/content/__tests__/ContentLinkModel.spec.js.flow +0 -129
- package/esm/models/content/__tests__/ContentModel.spec.js.flow +0 -241
- package/esm/models/content/__tests__/Formalsource.spec.js.flow +0 -133
- package/esm/models/contentconfiguration/ContentConfiguration.js +0 -68
- package/esm/models/contentconfiguration/ContentConfiguration.js.flow +0 -70
- package/esm/models/contentconfiguration/ContentConfiguration.js.map +0 -1
- package/esm/models/contentconfiguration/ContentConfigurationElements.js +0 -137
- package/esm/models/contentconfiguration/ContentConfigurationElements.js.flow +0 -152
- package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +0 -1
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js +0 -43
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.flow +0 -45
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +0 -1
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js +0 -48
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.flow +0 -60
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +0 -1
- package/esm/models/contentconfiguration/ContentConfigurationResults.js +0 -97
- package/esm/models/contentconfiguration/ContentConfigurationResults.js.flow +0 -105
- package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +0 -1
- package/esm/models/contentconfiguration/__tests__/ContentConfigurationElements.spec.js.flow +0 -29
- package/esm/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js.flow +0 -101
- package/esm/models/detail/DetailModel.js +0 -211
- package/esm/models/detail/DetailModel.js.flow +0 -241
- package/esm/models/detail/DetailModel.js.map +0 -1
- package/esm/models/detail/__tests__/DetailModel.spec.js.flow +0 -41
- package/esm/models/error/ErrorCollection.js +0 -104
- package/esm/models/error/ErrorCollection.js.flow +0 -127
- package/esm/models/error/ErrorCollection.js.map +0 -1
- package/esm/models/error/ErrorModel.js +0 -75
- package/esm/models/error/ErrorModel.js.flow +0 -83
- package/esm/models/error/ErrorModel.js.map +0 -1
- package/esm/models/error/ErrorResponse.js +0 -300
- package/esm/models/error/ErrorResponse.js.flow +0 -343
- package/esm/models/error/ErrorResponse.js.map +0 -1
- package/esm/models/error/__tests__/ErrorCollection.spec.js.flow +0 -41
- package/esm/models/error/__tests__/ErrorModel.spec.js.flow +0 -24
- package/esm/models/filters/AssignmentFilterModel.js +0 -153
- package/esm/models/filters/AssignmentFilterModel.js.flow +0 -195
- package/esm/models/filters/AssignmentFilterModel.js.map +0 -1
- package/esm/models/filters/BaseFilterModel.js +0 -203
- package/esm/models/filters/BaseFilterModel.js.flow +0 -236
- package/esm/models/filters/BaseFilterModel.js.map +0 -1
- package/esm/models/filters/ConceptIndexFilterModel.js +0 -29
- package/esm/models/filters/ConceptIndexFilterModel.js.flow +0 -40
- package/esm/models/filters/ConceptIndexFilterModel.js.map +0 -1
- package/esm/models/filters/FilterCollection.js +0 -147
- package/esm/models/filters/FilterCollection.js.flow +0 -192
- package/esm/models/filters/FilterCollection.js.map +0 -1
- package/esm/models/filters/FilterModel.js +0 -6
- package/esm/models/filters/FilterModel.js.flow +0 -6
- package/esm/models/filters/FilterModel.js.map +0 -1
- package/esm/models/filters/RangeFilterModel.js +0 -36
- package/esm/models/filters/RangeFilterModel.js.flow +0 -36
- package/esm/models/filters/RangeFilterModel.js.map +0 -1
- package/esm/models/filters/StringFilterModel.js +0 -140
- package/esm/models/filters/StringFilterModel.js.flow +0 -159
- package/esm/models/filters/StringFilterModel.js.map +0 -1
- package/esm/models/filters/__tests__/AssignmentFilterModel.spec.js.flow +0 -140
- package/esm/models/filters/__tests__/FilterCollection.spec.js.flow +0 -68
- package/esm/models/filters/__tests__/FilterModel.spec.js.flow +0 -65
- package/esm/models/filters/__tests__/RangeFilterModel.spec.js.flow +0 -55
- package/esm/models/filters/__tests__/ZipcodeFilter.spec.js.flow +0 -145
- package/esm/models/form/FormModel.js +0 -1031
- package/esm/models/form/FormModel.js.flow +0 -1280
- package/esm/models/form/FormModel.js.map +0 -1
- package/esm/models/form/FormObjectModel.js +0 -469
- package/esm/models/form/FormObjectModel.js.flow +0 -590
- package/esm/models/form/FormObjectModel.js.map +0 -1
- package/esm/models/form/__mock__/form.js.flow +0 -17
- package/esm/models/form/__tests__/FormModel.getters.spec.js.flow +0 -149
- package/esm/models/form/__tests__/FormModel.instrument.spec.js.flow +0 -202
- package/esm/models/form/__tests__/FormModel.repeating.spec.js.flow +0 -65
- package/esm/models/form/__tests__/FormModel.selfhref.spec.js.flow +0 -84
- package/esm/models/form/__tests__/FormModel.spec.js.flow +0 -752
- package/esm/models/form/__tests__/FormModel.unknown-repeat.spec.js.flow +0 -52
- package/esm/models/form/__tests__/FormObjectModel.spec.js.flow +0 -180
- package/esm/models/form/__tests__/FormResultData.spec.js.flow +0 -86
- package/esm/models/form/__tests__/FormValidation.spec.js.flow +0 -79
- package/esm/models/form/__tests__/FormWithContent.spec.js.flow +0 -71
- package/esm/models/grouping/GroupingModel.js +0 -182
- package/esm/models/grouping/GroupingModel.js.flow +0 -232
- package/esm/models/grouping/GroupingModel.js.map +0 -1
- package/esm/models/grouping/__tests__/GroupingModel.spec.js.flow +0 -80
- package/esm/models/href/Href.js +0 -490
- package/esm/models/href/Href.js.flow +0 -564
- package/esm/models/href/Href.js.map +0 -1
- package/esm/models/href/ListHref.js +0 -127
- package/esm/models/href/ListHref.js.flow +0 -146
- package/esm/models/href/ListHref.js.map +0 -1
- package/esm/models/href/__tests__/Href.spec.js.flow +0 -184
- package/esm/models/href/__tests__/ListHref.spec.js.flow +0 -61
- package/esm/models/index.js +0 -96
- package/esm/models/index.js.flow +0 -177
- package/esm/models/index.js.map +0 -1
- package/esm/models/layouthint/LayoutHintCollection.js +0 -111
- package/esm/models/layouthint/LayoutHintCollection.js.flow +0 -116
- package/esm/models/layouthint/LayoutHintCollection.js.map +0 -1
- package/esm/models/layouthint/__tests__/LayoutHintCollection.spec.js.flow +0 -89
- package/esm/models/links/LinkCollection.js +0 -163
- package/esm/models/links/LinkCollection.js.flow +0 -169
- package/esm/models/links/LinkCollection.js.map +0 -1
- package/esm/models/links/LinkModel.js +0 -210
- package/esm/models/links/LinkModel.js.flow +0 -229
- package/esm/models/links/LinkModel.js.map +0 -1
- package/esm/models/links/__tests__/LinkCollection.spec.js.flow +0 -426
- package/esm/models/links/__tests__/LinkModel.spec.js.flow +0 -103
- package/esm/models/links/__tests__/normalizeLinkJSON.spec.js.flow +0 -212
- package/esm/models/links/normalizeLinkJSON.js +0 -101
- package/esm/models/links/normalizeLinkJSON.js.flow +0 -121
- package/esm/models/links/normalizeLinkJSON.js.map +0 -1
- package/esm/models/list/ListDetailModel.js +0 -259
- package/esm/models/list/ListDetailModel.js.flow +0 -330
- package/esm/models/list/ListDetailModel.js.map +0 -1
- package/esm/models/list/ListHeaderModel.js +0 -87
- package/esm/models/list/ListHeaderModel.js.flow +0 -96
- package/esm/models/list/ListHeaderModel.js.map +0 -1
- package/esm/models/list/ListItemCollection.js +0 -60
- package/esm/models/list/ListItemCollection.js.flow +0 -80
- package/esm/models/list/ListItemCollection.js.map +0 -1
- package/esm/models/list/ListItemModel.js +0 -87
- package/esm/models/list/ListItemModel.js.flow +0 -111
- package/esm/models/list/ListItemModel.js.map +0 -1
- package/esm/models/list/ListModel.js +0 -378
- package/esm/models/list/ListModel.js.flow +0 -438
- package/esm/models/list/ListModel.js.map +0 -1
- package/esm/models/list/__mock__/caselist.js.flow +0 -14
- package/esm/models/list/__tests__/ListDetailModel.hierarchy.spec.js.flow +0 -88
- package/esm/models/list/__tests__/ListDetailModel.spec.js.flow +0 -96
- package/esm/models/list/__tests__/ListItemCollection.spec.js.flow +0 -22
- package/esm/models/list/__tests__/ListModel.spec.js.flow +0 -152
- package/esm/models/list/__tests__/ListResultDetail.spec.js.flow +0 -37
- package/esm/models/lookup/LookupOptionCollection.js +0 -38
- package/esm/models/lookup/LookupOptionCollection.js.flow +0 -54
- package/esm/models/lookup/LookupOptionCollection.js.map +0 -1
- package/esm/models/lookup/LookupOptionsModel.js +0 -63
- package/esm/models/lookup/LookupOptionsModel.js.flow +0 -81
- package/esm/models/lookup/LookupOptionsModel.js.map +0 -1
- package/esm/models/lookup/__tests__/LookupOptionCollection.spec.js.flow +0 -80
- package/esm/models/lookup/__tests__/LookupOptionsModel.spec.js.flow +0 -82
- package/esm/models/modelcatalog/ModelCatalogModel.js +0 -61
- package/esm/models/modelcatalog/ModelCatalogModel.js.flow +0 -73
- package/esm/models/modelcatalog/ModelCatalogModel.js.map +0 -1
- package/esm/models/modelcatalog/ModelCategoryCollection.js +0 -16
- package/esm/models/modelcatalog/ModelCategoryCollection.js.flow +0 -22
- package/esm/models/modelcatalog/ModelCategoryCollection.js.map +0 -1
- package/esm/models/modelcatalog/ModelCategoryModel.js +0 -53
- package/esm/models/modelcatalog/ModelCategoryModel.js.flow +0 -63
- package/esm/models/modelcatalog/ModelCategoryModel.js.map +0 -1
- package/esm/models/modelcatalog/__mock__/modelcatalog.js.flow +0 -14
- package/esm/models/modelcatalog/__tests__/ModelCatalogModel.spec.js.flow +0 -49
- package/esm/models/paging/PagesizeModel.js +0 -42
- package/esm/models/paging/PagesizeModel.js.flow +0 -44
- package/esm/models/paging/PagesizeModel.js.map +0 -1
- package/esm/models/paging/PagingModel.js +0 -88
- package/esm/models/paging/PagingModel.js.flow +0 -94
- package/esm/models/paging/PagingModel.js.map +0 -1
- package/esm/models/paging/__tests__/PageSizeModel.spec.js.flow +0 -31
- package/esm/models/paging/__tests__/PagingModel.spec.js.flow +0 -40
- package/esm/models/panels/GroupingPanelModel.js +0 -135
- package/esm/models/panels/GroupingPanelModel.js.flow +0 -164
- package/esm/models/panels/GroupingPanelModel.js.map +0 -1
- package/esm/models/panels/__tests__/GroupingPanelModel.spec.js.flow +0 -142
- package/esm/models/parameter/Parameter.js +0 -102
- package/esm/models/parameter/Parameter.js.flow +0 -117
- package/esm/models/parameter/Parameter.js.map +0 -1
- package/esm/models/parameter/__tests__/Parameter.spec.js.flow +0 -125
- package/esm/models/process/ProcessStatusSettingsModel.js +0 -77
- package/esm/models/process/ProcessStatusSettingsModel.js.flow +0 -88
- package/esm/models/process/ProcessStatusSettingsModel.js.map +0 -1
- package/esm/models/process/__tests__/ProcessStatusSettingsModel.spec.js.flow +0 -52
- package/esm/models/resolveModel.js +0 -50
- package/esm/models/resolveModel.js.flow +0 -92
- package/esm/models/resolveModel.js.map +0 -1
- package/esm/models/search/CaseSearchModel.js +0 -39
- package/esm/models/search/CaseSearchModel.js.flow +0 -46
- package/esm/models/search/CaseSearchModel.js.map +0 -1
- package/esm/models/search/__tests__/CaseSearchModel.spec.js.flow +0 -10
- package/esm/models/sorting/SortOptionModel.js +0 -100
- package/esm/models/sorting/SortOptionModel.js.flow +0 -107
- package/esm/models/sorting/SortOptionModel.js.map +0 -1
- package/esm/models/sorting/SortingModel.js +0 -106
- package/esm/models/sorting/SortingModel.js.flow +0 -128
- package/esm/models/sorting/SortingModel.js.map +0 -1
- package/esm/models/sorting/__tests__/SortingModel.spec.js.flow +0 -96
- package/esm/models/tab/TabModel.js +0 -135
- package/esm/models/tab/TabModel.js.flow +0 -160
- package/esm/models/tab/TabModel.js.map +0 -1
- package/esm/models/tab/__mock__/tab.js.flow +0 -14
- package/esm/models/tab/__mock__/tabPerson.js.flow +0 -14
- package/esm/models/tab/__tests__/TabModel.spec.js.flow +0 -72
- package/esm/models/taskgroup/TaskGroupCollection.js +0 -13
- package/esm/models/taskgroup/TaskGroupCollection.js.flow +0 -16
- package/esm/models/taskgroup/TaskGroupCollection.js.map +0 -1
- package/esm/models/taskgroup/TaskGroupModel.js +0 -79
- package/esm/models/taskgroup/TaskGroupModel.js.flow +0 -102
- package/esm/models/taskgroup/TaskGroupModel.js.map +0 -1
- package/esm/models/taskgroup/__mock__/taskgroup.js.flow +0 -14
- package/esm/models/taskgroup/__tests__/TaskGroupModel.spec.js.flow +0 -26
- package/esm/models/types.js +0 -2
- package/esm/models/types.js.flow +0 -275
- package/esm/models/types.js.map +0 -1
- package/esm/models/user/UserModel.js +0 -51
- package/esm/models/user/UserModel.js.flow +0 -57
- package/esm/models/user/UserModel.js.map +0 -1
- package/esm/models/user/UserProfileModel.js +0 -47
- package/esm/models/user/UserProfileModel.js.flow +0 -54
- package/esm/models/user/UserProfileModel.js.map +0 -1
- package/esm/models/user/UserServicesModel.js +0 -119
- package/esm/models/user/UserServicesModel.js.flow +0 -136
- package/esm/models/user/UserServicesModel.js.map +0 -1
- package/esm/models/user/__tests__/UserModel.spec.js.flow +0 -43
- package/esm/models/user/__tests__/UserProfileModel.spec.js.flow +0 -45
- package/esm/models/user/__tests__/UserServicesModel.spec.js.flow +0 -55
- package/esm/modularui/Authenticate.js +0 -177
- package/esm/modularui/Authenticate.js.flow +0 -195
- package/esm/modularui/Authenticate.js.map +0 -1
- package/esm/modularui/CaptchaRequest.js +0 -64
- package/esm/modularui/CaptchaRequest.js.flow +0 -104
- package/esm/modularui/CaptchaRequest.js.map +0 -1
- package/esm/modularui/ModularUIError.js +0 -23
- package/esm/modularui/ModularUIError.js.flow +0 -25
- package/esm/modularui/ModularUIError.js.map +0 -1
- package/esm/modularui/ModularUIRequest.js +0 -712
- package/esm/modularui/ModularUIRequest.js.flow +0 -872
- package/esm/modularui/ModularUIRequest.js.map +0 -1
- package/esm/modularui/ModularUIResponse.js +0 -140
- package/esm/modularui/ModularUIResponse.js.flow +0 -160
- package/esm/modularui/ModularUIResponse.js.map +0 -1
- package/esm/modularui/UploadRequest.js +0 -97
- package/esm/modularui/UploadRequest.js.flow +0 -151
- package/esm/modularui/UploadRequest.js.map +0 -1
- package/esm/modularui/__tests__/CustomContextPath.spec.js.flow +0 -61
- package/esm/modularui/__tests__/ModularUIError.spec.js.flow +0 -22
- package/esm/modularui/__tests__/ModularUIRequest.spec.js.flow +0 -495
- package/esm/modularui/index.js +0 -6
- package/esm/modularui/index.js.flow +0 -6
- package/esm/modularui/index.js.map +0 -1
- package/esm/modularui/types.js +0 -2
- package/esm/modularui/types.js.flow +0 -4
- package/esm/modularui/types.js.map +0 -1
- package/esm/react/ErrorBoundary.js +0 -49
- package/esm/react/ErrorBoundary.js.flow +0 -61
- package/esm/react/ErrorBoundary.js.map +0 -1
- package/esm/react/ErrorBoundaryFallback.js +0 -34
- package/esm/react/ErrorBoundaryFallback.js.flow +0 -46
- package/esm/react/ErrorBoundaryFallback.js.map +0 -1
- package/esm/react/index.js +0 -3
- package/esm/react/index.js.flow +0 -3
- package/esm/react/index.js.map +0 -1
- package/esm/react/utils.js +0 -24
- package/esm/react/utils.js.flow +0 -33
- package/esm/react/utils.js.map +0 -1
- package/esm/react-client/Init.js +0 -36
- package/esm/react-client/Init.js.flow +0 -46
- package/esm/react-client/Init.js.map +0 -1
- package/esm/react-client/client.js +0 -224
- package/esm/react-client/client.js.flow +0 -309
- package/esm/react-client/client.js.map +0 -1
- package/esm/react-client/contextPath.js +0 -22
- package/esm/react-client/contextPath.js.flow +0 -30
- package/esm/react-client/contextPath.js.map +0 -1
- package/esm/react-client/index.js +0 -4
- package/esm/react-client/index.js.flow +0 -4
- package/esm/react-client/index.js.map +0 -1
- package/esm/react-client/rehydrate.js +0 -67
- package/esm/react-client/rehydrate.js.flow +0 -94
- package/esm/react-client/rehydrate.js.map +0 -1
- package/esm/react-server/__tests__/htmlpage.spec.js.flow +0 -75
- package/esm/react-server/__tests__/requestInformation.spec.js.flow +0 -266
- package/esm/react-server/__tests__/serverUtil.spec.js.flow +0 -183
- package/esm/react-server/contextPath.js +0 -6
- package/esm/react-server/contextPath.js.flow +0 -8
- package/esm/react-server/contextPath.js.map +0 -1
- package/esm/react-server/createSSRComplete.js +0 -54
- package/esm/react-server/createSSRComplete.js.flow +0 -63
- package/esm/react-server/createSSRComplete.js.map +0 -1
- package/esm/react-server/htmlpage.js +0 -47
- package/esm/react-server/htmlpage.js.flow +0 -55
- package/esm/react-server/htmlpage.js.map +0 -1
- package/esm/react-server/index.js +0 -9
- package/esm/react-server/index.js.flow +0 -13
- package/esm/react-server/index.js.map +0 -1
- package/esm/react-server/renderSSRComplete.js +0 -84
- package/esm/react-server/renderSSRComplete.js.flow +0 -111
- package/esm/react-server/renderSSRComplete.js.map +0 -1
- package/esm/react-server/renderSSRMinimal.js +0 -40
- package/esm/react-server/renderSSRMinimal.js.flow +0 -54
- package/esm/react-server/renderSSRMinimal.js.map +0 -1
- package/esm/react-server/requestInformation.js +0 -53
- package/esm/react-server/requestInformation.js.flow +0 -68
- package/esm/react-server/requestInformation.js.map +0 -1
- package/esm/react-server/serverNoSSR.js +0 -56
- package/esm/react-server/serverNoSSR.js.flow +0 -87
- package/esm/react-server/serverNoSSR.js.map +0 -1
- package/esm/react-server/serverSSR.js +0 -44
- package/esm/react-server/serverSSR.js.flow +0 -70
- package/esm/react-server/serverSSR.js.map +0 -1
- package/esm/react-server/serverUtil.js +0 -201
- package/esm/react-server/serverUtil.js.flow +0 -279
- package/esm/react-server/serverUtil.js.map +0 -1
- package/esm/react-theme/ThemeProvider.js +0 -26
- package/esm/react-theme/ThemeProvider.js.flow +0 -25
- package/esm/react-theme/ThemeProvider.js.map +0 -1
- package/esm/react-theme/__tests__/ThemeProvider.spec.js.flow +0 -84
- package/esm/react-theme/__tests__/createTheme.spec.js.flow +0 -172
- package/esm/react-theme/createTheme.js +0 -108
- package/esm/react-theme/createTheme.js.flow +0 -118
- package/esm/react-theme/createTheme.js.map +0 -1
- package/esm/react-theme/index.js +0 -10
- package/esm/react-theme/index.js.flow +0 -15
- package/esm/react-theme/index.js.map +0 -1
- package/esm/react-theme/types.js +0 -2
- package/esm/react-theme/types.js.flow +0 -16
- package/esm/react-theme/types.js.map +0 -1
- package/esm/react-theme/useTheme.js +0 -9
- package/esm/react-theme/useTheme.js.flow +0 -13
- package/esm/react-theme/useTheme.js.map +0 -1
- package/esm/react-theme/utils/__tests__/background.spec.js.flow +0 -30
- package/esm/react-theme/utils/__tests__/colors.spec.js.flow +0 -30
- package/esm/react-theme/utils/__tests__/contrast.spec.js.flow +0 -44
- package/esm/react-theme/utils/__tests__/corners.spec.js.flow +0 -27
- package/esm/react-theme/utils/__tests__/spacers.spec.js.flow +0 -44
- package/esm/react-theme/utils/__tests__/themeProps.spec.js.flow +0 -72
- package/esm/react-theme/utils/background.js +0 -15
- package/esm/react-theme/utils/background.js.flow +0 -20
- package/esm/react-theme/utils/background.js.map +0 -1
- package/esm/react-theme/utils/colors.js +0 -37
- package/esm/react-theme/utils/colors.js.flow +0 -47
- package/esm/react-theme/utils/colors.js.map +0 -1
- package/esm/react-theme/utils/contrast.js +0 -86
- package/esm/react-theme/utils/contrast.js.flow +0 -117
- package/esm/react-theme/utils/contrast.js.map +0 -1
- package/esm/react-theme/utils/corners.js +0 -28
- package/esm/react-theme/utils/corners.js.flow +0 -37
- package/esm/react-theme/utils/corners.js.map +0 -1
- package/esm/react-theme/utils/spacers.js +0 -81
- package/esm/react-theme/utils/spacers.js.flow +0 -65
- package/esm/react-theme/utils/spacers.js.map +0 -1
- package/esm/react-theme/utils/themeProps.js +0 -64
- package/esm/react-theme/utils/themeProps.js.flow +0 -90
- package/esm/react-theme/utils/themeProps.js.map +0 -1
- package/esm/redux/_i18n/I18nActions.js +0 -28
- package/esm/redux/_i18n/I18nActions.js.flow +0 -38
- package/esm/redux/_i18n/I18nActions.js.map +0 -1
- package/esm/redux/_i18n/I18nReducer.js +0 -78
- package/esm/redux/_i18n/I18nReducer.js.flow +0 -91
- package/esm/redux/_i18n/I18nReducer.js.map +0 -1
- package/esm/redux/_i18n/__tests__/actions.spec.js.flow +0 -37
- package/esm/redux/_i18n/__tests__/reducer.spec.js.flow +0 -29
- package/esm/redux/_i18n/index.js +0 -3
- package/esm/redux/_i18n/index.js.flow +0 -6
- package/esm/redux/_i18n/index.js.map +0 -1
- package/esm/redux/_i18n/types.js +0 -2
- package/esm/redux/_i18n/types.js.flow +0 -20
- package/esm/redux/_i18n/types.js.map +0 -1
- package/esm/redux/_modularui/ModularUIActions.js +0 -168
- package/esm/redux/_modularui/ModularUIActions.js.flow +0 -227
- package/esm/redux/_modularui/ModularUIActions.js.map +0 -1
- package/esm/redux/_modularui/ModularUIConnector.js +0 -116
- package/esm/redux/_modularui/ModularUIConnector.js.flow +0 -155
- package/esm/redux/_modularui/ModularUIConnector.js.map +0 -1
- package/esm/redux/_modularui/ModularUIMiddleware.js +0 -99
- package/esm/redux/_modularui/ModularUIMiddleware.js.flow +0 -182
- package/esm/redux/_modularui/ModularUIMiddleware.js.map +0 -1
- package/esm/redux/_modularui/ModularUIReducer.js +0 -151
- package/esm/redux/_modularui/ModularUIReducer.js.flow +0 -169
- package/esm/redux/_modularui/ModularUIReducer.js.map +0 -1
- package/esm/redux/_modularui/ModularUISelectors.js +0 -252
- package/esm/redux/_modularui/ModularUISelectors.js.flow +0 -322
- package/esm/redux/_modularui/ModularUISelectors.js.map +0 -1
- package/esm/redux/_modularui/ModularUIUtils.js +0 -75
- package/esm/redux/_modularui/ModularUIUtils.js.flow +0 -96
- package/esm/redux/_modularui/ModularUIUtils.js.map +0 -1
- package/esm/redux/_modularui/__tests__/actions.spec.js.flow +0 -159
- package/esm/redux/_modularui/__tests__/reducer.spec.js.flow +0 -134
- package/esm/redux/_modularui/__tests__/selectors.spec.js.flow +0 -153
- package/esm/redux/_modularui/index.js +0 -8
- package/esm/redux/_modularui/index.js.flow +0 -11
- package/esm/redux/_modularui/index.js.map +0 -1
- package/esm/redux/_modularui/types.js +0 -2
- package/esm/redux/_modularui/types.js.flow +0 -121
- package/esm/redux/_modularui/types.js.map +0 -1
- package/esm/redux/_modularui/withModularUI.js +0 -34
- package/esm/redux/_modularui/withModularUI.js.flow +0 -85
- package/esm/redux/_modularui/withModularUI.js.map +0 -1
- package/esm/redux/_router/RouterActions.js +0 -55
- package/esm/redux/_router/RouterActions.js.flow +0 -75
- package/esm/redux/_router/RouterActions.js.map +0 -1
- package/esm/redux/_router/RouterConnectors.js +0 -37
- package/esm/redux/_router/RouterConnectors.js.flow +0 -97
- package/esm/redux/_router/RouterConnectors.js.map +0 -1
- package/esm/redux/_router/RouterMiddleware.js +0 -31
- package/esm/redux/_router/RouterMiddleware.js.flow +0 -37
- package/esm/redux/_router/RouterMiddleware.js.map +0 -1
- package/esm/redux/_router/RouterReducer.js +0 -15
- package/esm/redux/_router/RouterReducer.js.flow +0 -21
- package/esm/redux/_router/RouterReducer.js.map +0 -1
- package/esm/redux/_router/__tests__/actions.spec.js.flow +0 -109
- package/esm/redux/_router/__tests__/hooks.spec.js.flow +0 -98
- package/esm/redux/_router/__tests__/middleware.spec.js.flow +0 -62
- package/esm/redux/_router/__tests__/reducer.spec.js.flow +0 -26
- package/esm/redux/_router/index.js +0 -5
- package/esm/redux/_router/index.js.flow +0 -8
- package/esm/redux/_router/index.js.map +0 -1
- package/esm/redux/_router/types.js +0 -2
- package/esm/redux/_router/types.js.flow +0 -43
- package/esm/redux/_router/types.js.map +0 -1
- package/esm/redux/actions/Application.js +0 -30
- package/esm/redux/actions/Application.js.flow +0 -45
- package/esm/redux/actions/Application.js.map +0 -1
- package/esm/redux/actions/Authorization.js +0 -47
- package/esm/redux/actions/Authorization.js.flow +0 -65
- package/esm/redux/actions/Authorization.js.map +0 -1
- package/esm/redux/actions/Error.js +0 -65
- package/esm/redux/actions/Error.js.flow +0 -95
- package/esm/redux/actions/Error.js.map +0 -1
- package/esm/redux/actions/Form.js +0 -30
- package/esm/redux/actions/Form.js.flow +0 -42
- package/esm/redux/actions/Form.js.map +0 -1
- package/esm/redux/actions/FormAttributeSet.js +0 -62
- package/esm/redux/actions/FormAttributeSet.js.flow +0 -98
- package/esm/redux/actions/FormAttributeSet.js.map +0 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js +0 -26
- package/esm/redux/actions/FormAttributeSetRepeatable.js.flow +0 -45
- package/esm/redux/actions/FormAttributeSetRepeatable.js.map +0 -1
- package/esm/redux/actions/FormAutosave.js +0 -52
- package/esm/redux/actions/FormAutosave.js.flow +0 -73
- package/esm/redux/actions/FormAutosave.js.map +0 -1
- package/esm/redux/actions/FormAutosubmit.js +0 -30
- package/esm/redux/actions/FormAutosubmit.js.flow +0 -43
- package/esm/redux/actions/FormAutosubmit.js.map +0 -1
- package/esm/redux/actions/FormAutoupdate.js +0 -29
- package/esm/redux/actions/FormAutoupdate.js.flow +0 -47
- package/esm/redux/actions/FormAutoupdate.js.map +0 -1
- package/esm/redux/actions/FormValidations.js +0 -43
- package/esm/redux/actions/FormValidations.js.flow +0 -71
- package/esm/redux/actions/FormValidations.js.map +0 -1
- package/esm/redux/actions/Modals.js +0 -14
- package/esm/redux/actions/Modals.js.flow +0 -16
- package/esm/redux/actions/Modals.js.map +0 -1
- package/esm/redux/actions/ModelCatalog.js +0 -8
- package/esm/redux/actions/ModelCatalog.js.flow +0 -12
- package/esm/redux/actions/ModelCatalog.js.map +0 -1
- package/esm/redux/actions/Notification.js +0 -66
- package/esm/redux/actions/Notification.js.flow +0 -101
- package/esm/redux/actions/Notification.js.map +0 -1
- package/esm/redux/actions/Preferences.js +0 -115
- package/esm/redux/actions/Preferences.js.flow +0 -173
- package/esm/redux/actions/Preferences.js.map +0 -1
- package/esm/redux/actions/ProgressIndicator.js +0 -32
- package/esm/redux/actions/ProgressIndicator.js.flow +0 -39
- package/esm/redux/actions/ProgressIndicator.js.map +0 -1
- package/esm/redux/actions/SignIn.js +0 -77
- package/esm/redux/actions/SignIn.js.flow +0 -102
- package/esm/redux/actions/SignIn.js.map +0 -1
- package/esm/redux/actions/SignOut.js +0 -21
- package/esm/redux/actions/SignOut.js.flow +0 -29
- package/esm/redux/actions/SignOut.js.map +0 -1
- package/esm/redux/actions/__tests__/Application.spec.js.flow +0 -52
- package/esm/redux/actions/__tests__/Authorization.spec.js.flow +0 -121
- package/esm/redux/actions/__tests__/CustomErrorResponseHandler.spec.js.flow +0 -72
- package/esm/redux/actions/__tests__/Error-server.spec.js.flow +0 -134
- package/esm/redux/actions/__tests__/Error.spec.js.flow +0 -116
- package/esm/redux/actions/__tests__/Form.spec.js.flow +0 -39
- package/esm/redux/actions/__tests__/Modals.spec.js.flow +0 -34
- package/esm/redux/actions/__tests__/Notification.spec.js.flow +0 -94
- package/esm/redux/actions/__tests__/Preferences.spec.js.flow +0 -71
- package/esm/redux/actions/__tests__/ProgressIndicator.spec.js.flow +0 -53
- package/esm/redux/actions/index.js +0 -17
- package/esm/redux/actions/index.js.flow +0 -17
- package/esm/redux/actions/index.js.map +0 -1
- package/esm/redux/connectors/Application.js +0 -7
- package/esm/redux/connectors/Application.js.flow +0 -14
- package/esm/redux/connectors/Application.js.map +0 -1
- package/esm/redux/connectors/Breadcrumb.js +0 -10
- package/esm/redux/connectors/Breadcrumb.js.flow +0 -28
- package/esm/redux/connectors/Breadcrumb.js.map +0 -1
- package/esm/redux/connectors/CaseView.js +0 -12
- package/esm/redux/connectors/CaseView.js.flow +0 -14
- package/esm/redux/connectors/CaseView.js.map +0 -1
- package/esm/redux/connectors/ConceptDetail.js +0 -13
- package/esm/redux/connectors/ConceptDetail.js.flow +0 -12
- package/esm/redux/connectors/ConceptDetail.js.map +0 -1
- package/esm/redux/connectors/ContentBrowser.js +0 -12
- package/esm/redux/connectors/ContentBrowser.js.flow +0 -14
- package/esm/redux/connectors/ContentBrowser.js.map +0 -1
- package/esm/redux/connectors/ContentDetail.js +0 -13
- package/esm/redux/connectors/ContentDetail.js.flow +0 -13
- package/esm/redux/connectors/ContentDetail.js.map +0 -1
- package/esm/redux/connectors/ContentDetailSection.js +0 -15
- package/esm/redux/connectors/ContentDetailSection.js.flow +0 -17
- package/esm/redux/connectors/ContentDetailSection.js.map +0 -1
- package/esm/redux/connectors/Form.js +0 -36
- package/esm/redux/connectors/Form.js.flow +0 -83
- package/esm/redux/connectors/Form.js.map +0 -1
- package/esm/redux/connectors/FormAttributeSet.js +0 -21
- package/esm/redux/connectors/FormAttributeSet.js.flow +0 -85
- package/esm/redux/connectors/FormAttributeSet.js.map +0 -1
- package/esm/redux/connectors/ListDetail.js +0 -14
- package/esm/redux/connectors/ListDetail.js.flow +0 -16
- package/esm/redux/connectors/ListDetail.js.map +0 -1
- package/esm/redux/connectors/Modal.js +0 -20
- package/esm/redux/connectors/Modal.js.flow +0 -47
- package/esm/redux/connectors/Modal.js.map +0 -1
- package/esm/redux/connectors/ModelCatalog.js +0 -12
- package/esm/redux/connectors/ModelCatalog.js.flow +0 -14
- package/esm/redux/connectors/ModelCatalog.js.map +0 -1
- package/esm/redux/connectors/Notification.js +0 -16
- package/esm/redux/connectors/Notification.js.flow +0 -47
- package/esm/redux/connectors/Notification.js.map +0 -1
- package/esm/redux/connectors/PanelRenderer.js +0 -22
- package/esm/redux/connectors/PanelRenderer.js.flow +0 -29
- package/esm/redux/connectors/PanelRenderer.js.map +0 -1
- package/esm/redux/connectors/Preferences.js +0 -22
- package/esm/redux/connectors/Preferences.js.flow +0 -53
- package/esm/redux/connectors/Preferences.js.map +0 -1
- package/esm/redux/connectors/Progress.js +0 -13
- package/esm/redux/connectors/Progress.js.flow +0 -35
- package/esm/redux/connectors/Progress.js.map +0 -1
- package/esm/redux/connectors/ProgressIndicator.js +0 -13
- package/esm/redux/connectors/ProgressIndicator.js.flow +0 -35
- package/esm/redux/connectors/ProgressIndicator.js.map +0 -1
- package/esm/redux/connectors/QuickSearch.js +0 -20
- package/esm/redux/connectors/QuickSearch.js.flow +0 -36
- package/esm/redux/connectors/QuickSearch.js.map +0 -1
- package/esm/redux/connectors/SignIn.js +0 -18
- package/esm/redux/connectors/SignIn.js.flow +0 -47
- package/esm/redux/connectors/SignIn.js.map +0 -1
- package/esm/redux/connectors/SignOut.js +0 -14
- package/esm/redux/connectors/SignOut.js.flow +0 -38
- package/esm/redux/connectors/SignOut.js.map +0 -1
- package/esm/redux/connectors/Tab.js +0 -12
- package/esm/redux/connectors/Tab.js.flow +0 -14
- package/esm/redux/connectors/Tab.js.map +0 -1
- package/esm/redux/connectors/index.js +0 -22
- package/esm/redux/connectors/index.js.flow +0 -22
- package/esm/redux/connectors/index.js.map +0 -1
- package/esm/redux/index.js +0 -24
- package/esm/redux/index.js.flow +0 -27
- package/esm/redux/index.js.map +0 -1
- package/esm/redux/reducers/AuthReducer.js +0 -53
- package/esm/redux/reducers/AuthReducer.js.flow +0 -56
- package/esm/redux/reducers/AuthReducer.js.map +0 -1
- package/esm/redux/reducers/ErrorReducer.js +0 -16
- package/esm/redux/reducers/ErrorReducer.js.flow +0 -22
- package/esm/redux/reducers/ErrorReducer.js.map +0 -1
- package/esm/redux/reducers/ModalsReducer.js +0 -51
- package/esm/redux/reducers/ModalsReducer.js.flow +0 -58
- package/esm/redux/reducers/ModalsReducer.js.map +0 -1
- package/esm/redux/reducers/ModelCatalogReducer.js +0 -27
- package/esm/redux/reducers/ModelCatalogReducer.js.flow +0 -34
- package/esm/redux/reducers/ModelCatalogReducer.js.map +0 -1
- package/esm/redux/reducers/NotificationReducer.js +0 -37
- package/esm/redux/reducers/NotificationReducer.js.flow +0 -45
- package/esm/redux/reducers/NotificationReducer.js.map +0 -1
- package/esm/redux/reducers/PreferencesReducer.js +0 -24
- package/esm/redux/reducers/PreferencesReducer.js.flow +0 -31
- package/esm/redux/reducers/PreferencesReducer.js.map +0 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js +0 -49
- package/esm/redux/reducers/ProgressIndicatorReducer.js.flow +0 -60
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +0 -1
- package/esm/redux/reducers/__tests__/AuthReducer.spec.js.flow +0 -95
- package/esm/redux/reducers/__tests__/ErrorReducer.spec.js.flow +0 -17
- package/esm/redux/reducers/__tests__/ModalsReducer.spec.js.flow +0 -34
- package/esm/redux/reducers/__tests__/ModelCatalogReducer.spec.js.flow +0 -23
- package/esm/redux/reducers/__tests__/NotificationReducer.spec.js.flow +0 -53
- package/esm/redux/reducers/__tests__/PreferencesReducer.spec.js.flow +0 -31
- package/esm/redux/reducers/__tests__/ProgressIndicatorReducer.spec.js.flow +0 -82
- package/esm/redux/reducers/createReducer.js +0 -25
- package/esm/redux/reducers/createReducer.js.flow +0 -55
- package/esm/redux/reducers/createReducer.js.map +0 -1
- package/esm/redux/reducers/index.js +0 -9
- package/esm/redux/reducers/index.js.flow +0 -10
- package/esm/redux/reducers/index.js.map +0 -1
- package/esm/redux/selectors/i18n.js +0 -12
- package/esm/redux/selectors/i18n.js.flow +0 -15
- package/esm/redux/selectors/i18n.js.map +0 -1
- package/esm/redux/selectors/index.js +0 -3
- package/esm/redux/selectors/index.js.flow +0 -3
- package/esm/redux/selectors/index.js.map +0 -1
- package/esm/redux/selectors/modelcatalog.js +0 -7
- package/esm/redux/selectors/modelcatalog.js.flow +0 -11
- package/esm/redux/selectors/modelcatalog.js.map +0 -1
- package/esm/redux/store/__tests__/beforeRenderHooks.spec.js.flow +0 -13
- package/esm/redux/store/beforeRenderHooks.js +0 -17
- package/esm/redux/store/beforeRenderHooks.js.flow +0 -26
- package/esm/redux/store/beforeRenderHooks.js.map +0 -1
- package/esm/redux/store/configureStore.js +0 -30
- package/esm/redux/store/configureStore.js.flow +0 -59
- package/esm/redux/store/configureStore.js.map +0 -1
- package/esm/redux/types.js +0 -2
- package/esm/redux/types.js.flow +0 -241
- package/esm/redux/types.js.map +0 -1
- package/esm/utils/browser/Cache.js +0 -144
- package/esm/utils/browser/Cache.js.flow +0 -157
- package/esm/utils/browser/Cache.js.map +0 -1
- package/esm/utils/browser/Cookies.js +0 -28
- package/esm/utils/browser/Cookies.js.flow +0 -44
- package/esm/utils/browser/Cookies.js.map +0 -1
- package/esm/utils/browser/__tests__/Cookies.spec.js.flow +0 -51
- package/esm/utils/datetime/DateTimeUtil.js +0 -643
- package/esm/utils/datetime/DateTimeUtil.js.flow +0 -858
- package/esm/utils/datetime/DateTimeUtil.js.map +0 -1
- package/esm/utils/datetime/__tests__/DateTime.spec.js.flow +0 -873
- package/esm/utils/datetime/__tests__/DateTimeFormat.spec.js.flow +0 -146
- package/esm/utils/fetch/__mocks__/universalFetch.js.flow +0 -38
- package/esm/utils/fetch/__tests__/xhr.spec.js.flow +0 -281
- package/esm/utils/fetch/serverFetch.js +0 -25
- package/esm/utils/fetch/serverFetch.js.flow +0 -33
- package/esm/utils/fetch/serverFetch.js.map +0 -1
- package/esm/utils/fetch/types.js +0 -2
- package/esm/utils/fetch/types.js.flow +0 -46
- package/esm/utils/fetch/types.js.map +0 -1
- package/esm/utils/fetch/universalFetch.js +0 -87
- package/esm/utils/fetch/universalFetch.js.flow +0 -106
- package/esm/utils/fetch/universalFetch.js.map +0 -1
- package/esm/utils/fetch/xhr.js +0 -351
- package/esm/utils/fetch/xhr.js.flow +0 -409
- package/esm/utils/fetch/xhr.js.map +0 -1
- package/esm/utils/helpers/__tests__/checkResource.spec.js.flow +0 -60
- package/esm/utils/helpers/__tests__/createHash.spec.js.flow +0 -11
- package/esm/utils/helpers/__tests__/createHref.spec.js.flow +0 -39
- package/esm/utils/helpers/__tests__/objects.spec.js.flow +0 -50
- package/esm/utils/helpers/__tests__/sanitizeHTML.spec.js.flow +0 -69
- package/esm/utils/helpers/checkResource.js +0 -38
- package/esm/utils/helpers/checkResource.js.flow +0 -43
- package/esm/utils/helpers/checkResource.js.map +0 -1
- package/esm/utils/helpers/createHash.js +0 -22
- package/esm/utils/helpers/createHash.js.flow +0 -28
- package/esm/utils/helpers/createHash.js.map +0 -1
- package/esm/utils/helpers/createHref.js +0 -91
- package/esm/utils/helpers/createHref.js.flow +0 -117
- package/esm/utils/helpers/createHref.js.map +0 -1
- package/esm/utils/helpers/createUUID.js +0 -12
- package/esm/utils/helpers/createUUID.js.flow +0 -13
- package/esm/utils/helpers/createUUID.js.map +0 -1
- package/esm/utils/helpers/index.js +0 -9
- package/esm/utils/helpers/index.js.flow +0 -9
- package/esm/utils/helpers/index.js.map +0 -1
- package/esm/utils/helpers/objects.js +0 -28
- package/esm/utils/helpers/objects.js.flow +0 -33
- package/esm/utils/helpers/objects.js.map +0 -1
- package/esm/utils/helpers/repositoryResource.js +0 -19
- package/esm/utils/helpers/repositoryResource.js.flow +0 -22
- package/esm/utils/helpers/repositoryResource.js.map +0 -1
- package/esm/utils/helpers/sanitizeHtml.js +0 -38
- package/esm/utils/helpers/sanitizeHtml.js.flow +0 -55
- package/esm/utils/helpers/sanitizeHtml.js.map +0 -1
- package/esm/utils/helpers/text.js +0 -17
- package/esm/utils/helpers/text.js.flow +0 -23
- package/esm/utils/helpers/text.js.map +0 -1
- package/esm/utils/index.js +0 -19
- package/esm/utils/index.js.flow +0 -22
- package/esm/utils/index.js.map +0 -1
- package/esm/utils/number/DecimalFormat.js +0 -326
- package/esm/utils/number/DecimalFormat.js.flow +0 -410
- package/esm/utils/number/DecimalFormat.js.map +0 -1
- package/esm/utils/number/__tests__/formatValue.spec.js.flow +0 -36
- package/esm/utils/number/__tests__/parseNumbers.spec.js.flow +0 -50
- package/esm/utils/number/formatValue.js +0 -41
- package/esm/utils/number/formatValue.js.flow +0 -60
- package/esm/utils/number/formatValue.js.map +0 -1
- package/esm/utils/number/parseNumbers.js +0 -63
- package/esm/utils/number/parseNumbers.js.flow +0 -94
- package/esm/utils/number/parseNumbers.js.map +0 -1
- package/lib/builder/index.js +0 -18
- package/lib/builder/index.js.map +0 -1
- package/lib/builder/mergeLayoutHintConfigurations.js +0 -60
- package/lib/builder/mergeLayoutHintConfigurations.js.map +0 -1
- package/lib/constants/Constants.js +0 -189
- package/lib/constants/Constants.js.map +0 -1
- package/lib/constants/LayoutHintConfig.js +0 -173
- package/lib/constants/LayoutHintConfig.js.map +0 -1
- package/lib/constants/LayoutHints.js +0 -135
- package/lib/constants/LayoutHints.js.map +0 -1
- package/lib/constants/Settings.js +0 -225
- package/lib/constants/Settings.js.map +0 -1
- package/lib/constants/index.js +0 -40
- package/lib/constants/index.js.map +0 -1
- package/lib/exceptions/ConfigurationException.js +0 -17
- package/lib/exceptions/ConfigurationException.js.map +0 -1
- package/lib/exceptions/FetchException.js +0 -72
- package/lib/exceptions/FetchException.js.map +0 -1
- package/lib/exceptions/IllegalArgumentException.js +0 -17
- package/lib/exceptions/IllegalArgumentException.js.map +0 -1
- package/lib/exceptions/IllegalReturnException.js +0 -16
- package/lib/exceptions/IllegalReturnException.js.map +0 -1
- package/lib/exceptions/IllegalStateException.js +0 -17
- package/lib/exceptions/IllegalStateException.js.map +0 -1
- package/lib/exceptions/JsonParseException.js +0 -17
- package/lib/exceptions/JsonParseException.js.map +0 -1
- package/lib/exceptions/MissingPropertyException.js +0 -17
- package/lib/exceptions/MissingPropertyException.js.map +0 -1
- package/lib/exceptions/NetworkException.js +0 -23
- package/lib/exceptions/NetworkException.js.map +0 -1
- package/lib/exceptions/NotAllowedUriException.js +0 -17
- package/lib/exceptions/NotAllowedUriException.js.map +0 -1
- package/lib/exceptions/NotFoundException.js +0 -26
- package/lib/exceptions/NotFoundException.js.map +0 -1
- package/lib/exceptions/ServerRequestException.js +0 -17
- package/lib/exceptions/ServerRequestException.js.map +0 -1
- package/lib/exceptions/ThemePropertyException.js +0 -17
- package/lib/exceptions/ThemePropertyException.js.map +0 -1
- package/lib/exceptions/TimeoutException.js +0 -17
- package/lib/exceptions/TimeoutException.js.map +0 -1
- package/lib/exceptions/UnauthorizedException.js +0 -25
- package/lib/exceptions/UnauthorizedException.js.map +0 -1
- package/lib/exceptions/UnsupportedOperationException.js +0 -17
- package/lib/exceptions/UnsupportedOperationException.js.map +0 -1
- package/lib/exceptions/index.js +0 -112
- package/lib/exceptions/index.js.map +0 -1
- package/lib/hooks/index.js +0 -183
- package/lib/hooks/index.js.map +0 -1
- package/lib/hooks/useAllFormsOnModel.js +0 -81
- package/lib/hooks/useAllFormsOnModel.js.map +0 -1
- package/lib/hooks/useAuthentication.js +0 -66
- package/lib/hooks/useAuthentication.js.map +0 -1
- package/lib/hooks/useContent.js +0 -49
- package/lib/hooks/useContent.js.map +0 -1
- package/lib/hooks/useDeepCompareEffect.js +0 -34
- package/lib/hooks/useDeepCompareEffect.js.map +0 -1
- package/lib/hooks/useForm.js +0 -98
- package/lib/hooks/useForm.js.map +0 -1
- package/lib/hooks/useI18n.js +0 -42
- package/lib/hooks/useI18n.js.map +0 -1
- package/lib/hooks/useModal.js +0 -43
- package/lib/hooks/useModal.js.map +0 -1
- package/lib/hooks/useModelCatalog.js +0 -218
- package/lib/hooks/useModelCatalog.js.map +0 -1
- package/lib/hooks/useModels.js +0 -45
- package/lib/hooks/useModels.js.map +0 -1
- package/lib/hooks/useModularUI.js +0 -69
- package/lib/hooks/useModularUI.js.map +0 -1
- package/lib/hooks/useModularUIBasic.js +0 -81
- package/lib/hooks/useModularUIBasic.js.map +0 -1
- package/lib/hooks/useModularUIModel.js +0 -128
- package/lib/hooks/useModularUIModel.js.map +0 -1
- package/lib/hooks/useModularUIRequest.js +0 -25
- package/lib/hooks/useModularUIRequest.js.map +0 -1
- package/lib/hooks/useNotification.js +0 -39
- package/lib/hooks/useNotification.js.map +0 -1
- package/lib/hooks/usePreference.js +0 -23
- package/lib/hooks/usePreference.js.map +0 -1
- package/lib/hooks/useProgressIndicator.js +0 -23
- package/lib/hooks/useProgressIndicator.js.map +0 -1
- package/lib/hooks/useRouter.js +0 -42
- package/lib/hooks/useRouter.js.map +0 -1
- package/lib/i18n/Locale.js +0 -128
- package/lib/i18n/Locale.js.map +0 -1
- package/lib/i18n/Locales.js +0 -140
- package/lib/i18n/Locales.js.map +0 -1
- package/lib/i18n/Message.js +0 -50
- package/lib/i18n/Message.js.map +0 -1
- package/lib/i18n/index.js +0 -56
- package/lib/i18n/index.js.map +0 -1
- package/lib/i18n/languages.js +0 -212
- package/lib/i18n/languages.js.map +0 -1
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js +0 -104
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js.map +0 -1
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js +0 -104
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js.map +0 -1
- package/lib/i18n/types.js +0 -2
- package/lib/i18n/types.js.map +0 -1
- package/lib/i18n/withMessage.js +0 -27
- package/lib/i18n/withMessage.js.map +0 -1
- package/lib/index.js +0 -73
- package/lib/index.js.map +0 -1
- package/lib/models/actions/ActionCollection.js +0 -90
- package/lib/models/actions/ActionCollection.js.map +0 -1
- package/lib/models/actions/ActionModel.js +0 -194
- package/lib/models/actions/ActionModel.js.map +0 -1
- package/lib/models/application/ApplicationModel.js +0 -135
- package/lib/models/application/ApplicationModel.js.map +0 -1
- package/lib/models/attributes/AttributeCollection.js +0 -282
- package/lib/models/attributes/AttributeCollection.js.map +0 -1
- package/lib/models/attributes/AttributeContent.js +0 -203
- package/lib/models/attributes/AttributeContent.js.map +0 -1
- package/lib/models/attributes/AttributeDataHelper.js +0 -267
- package/lib/models/attributes/AttributeDataHelper.js.map +0 -1
- package/lib/models/attributes/AttributeModel.js +0 -824
- package/lib/models/attributes/AttributeModel.js.map +0 -1
- package/lib/models/attributes/AttributeSetModel.js +0 -105
- package/lib/models/attributes/AttributeSetModel.js.map +0 -1
- package/lib/models/attributes/BooleanAttributeModel.js +0 -295
- package/lib/models/attributes/BooleanAttributeModel.js.map +0 -1
- package/lib/models/attributes/CaptchaAttributeModel.js +0 -60
- package/lib/models/attributes/CaptchaAttributeModel.js.map +0 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +0 -411
- package/lib/models/attributes/ChoiceAttributeModel.js.map +0 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +0 -313
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +0 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +0 -342
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +0 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js +0 -189
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +0 -1
- package/lib/models/attributes/CompositeAttributeModel.js +0 -381
- package/lib/models/attributes/CompositeAttributeModel.js.map +0 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +0 -465
- package/lib/models/attributes/DatetimeAttributeModel.js.map +0 -1
- package/lib/models/attributes/HelptextAttributeModel.js +0 -55
- package/lib/models/attributes/HelptextAttributeModel.js.map +0 -1
- package/lib/models/attributes/LabelAttributeModel.js +0 -41
- package/lib/models/attributes/LabelAttributeModel.js.map +0 -1
- package/lib/models/attributes/MemoAttributeModel.js +0 -49
- package/lib/models/attributes/MemoAttributeModel.js.map +0 -1
- package/lib/models/attributes/MoneyAttributeModel.js +0 -49
- package/lib/models/attributes/MoneyAttributeModel.js.map +0 -1
- package/lib/models/attributes/NumberAttributeModel.js +0 -201
- package/lib/models/attributes/NumberAttributeModel.js.map +0 -1
- package/lib/models/attributes/PasswordAttributeModel.js +0 -217
- package/lib/models/attributes/PasswordAttributeModel.js.map +0 -1
- package/lib/models/attributes/StringAttributeModel.js +0 -284
- package/lib/models/attributes/StringAttributeModel.js.map +0 -1
- package/lib/models/attributes/UploadAttributeModel.js +0 -223
- package/lib/models/attributes/UploadAttributeModel.js.map +0 -1
- package/lib/models/attributes/XMLAttributeModel.js +0 -53
- package/lib/models/attributes/XMLAttributeModel.js.map +0 -1
- package/lib/models/attributes/_createAttribute.js +0 -93
- package/lib/models/attributes/_createAttribute.js.map +0 -1
- package/lib/models/attributes/input-constraints/BSNConstraint.js +0 -72
- package/lib/models/attributes/input-constraints/BSNConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js +0 -50
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +0 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js +0 -74
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +0 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js +0 -205
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +0 -76
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +0 -76
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js +0 -122
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js +0 -66
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js +0 -98
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js +0 -49
- package/lib/models/attributes/input-constraints/IBANConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js +0 -53
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js +0 -85
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js +0 -177
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js +0 -132
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js +0 -126
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js +0 -72
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +0 -47
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +0 -64
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +0 -64
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +0 -78
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/RangeConstraint.js +0 -143
- package/lib/models/attributes/input-constraints/RangeConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/RegexConstraint.js +0 -67
- package/lib/models/attributes/input-constraints/RegexConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js +0 -178
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +0 -1
- package/lib/models/attributes/input-constraints/XMLConstraint.js +0 -62
- package/lib/models/attributes/input-constraints/XMLConstraint.js.map +0 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js +0 -66
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +0 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js +0 -200
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +0 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +0 -88
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +0 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +0 -51
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +0 -1
- package/lib/models/base/BaseCollection.js +0 -186
- package/lib/models/base/BaseCollection.js.map +0 -1
- package/lib/models/base/BaseModel.js +0 -149
- package/lib/models/base/BaseModel.js.map +0 -1
- package/lib/models/base/ResourceCollection.js +0 -41
- package/lib/models/base/ResourceCollection.js.map +0 -1
- package/lib/models/base/ResourceModel.js +0 -209
- package/lib/models/base/ResourceModel.js.map +0 -1
- package/lib/models/caseview/CaseViewModel.js +0 -163
- package/lib/models/caseview/CaseViewModel.js.map +0 -1
- package/lib/models/concepts/BusinessScenarioModel.js +0 -122
- package/lib/models/concepts/BusinessScenarioModel.js.map +0 -1
- package/lib/models/concepts/ConceptDetailModel.js +0 -281
- package/lib/models/concepts/ConceptDetailModel.js.map +0 -1
- package/lib/models/concepts/ConceptIndexModel.js +0 -150
- package/lib/models/concepts/ConceptIndexModel.js.map +0 -1
- package/lib/models/concepts/ConceptLinkModel.js +0 -172
- package/lib/models/concepts/ConceptLinkModel.js.map +0 -1
- package/lib/models/concepts/ConceptRelationCollection.js +0 -82
- package/lib/models/concepts/ConceptRelationCollection.js.map +0 -1
- package/lib/models/concepts/ConceptRelationModel.js +0 -115
- package/lib/models/concepts/ConceptRelationModel.js.map +0 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js +0 -128
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +0 -1
- package/lib/models/concepts/SourceReferenceCollection.js +0 -35
- package/lib/models/concepts/SourceReferenceCollection.js.map +0 -1
- package/lib/models/concepts/SourceReferenceModel.js +0 -100
- package/lib/models/concepts/SourceReferenceModel.js.map +0 -1
- package/lib/models/content/ContentIndexModel.js +0 -142
- package/lib/models/content/ContentIndexModel.js.map +0 -1
- package/lib/models/content/ContentLinkModel.js +0 -258
- package/lib/models/content/ContentLinkModel.js.map +0 -1
- package/lib/models/content/ContentModel.js +0 -207
- package/lib/models/content/ContentModel.js.map +0 -1
- package/lib/models/content/ContentTOCModel.js +0 -212
- package/lib/models/content/ContentTOCModel.js.map +0 -1
- package/lib/models/content/ContentTypeModel.js +0 -74
- package/lib/models/content/ContentTypeModel.js.map +0 -1
- package/lib/models/content/SectionModel.js +0 -200
- package/lib/models/content/SectionModel.js.map +0 -1
- package/lib/models/content/SubSectionModel.js +0 -167
- package/lib/models/content/SubSectionModel.js.map +0 -1
- package/lib/models/contentconfiguration/ContentConfiguration.js +0 -75
- package/lib/models/contentconfiguration/ContentConfiguration.js.map +0 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js +0 -143
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +0 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js +0 -49
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +0 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js +0 -54
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +0 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js +0 -103
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +0 -1
- package/lib/models/detail/DetailModel.js +0 -219
- package/lib/models/detail/DetailModel.js.map +0 -1
- package/lib/models/error/ErrorCollection.js +0 -111
- package/lib/models/error/ErrorCollection.js.map +0 -1
- package/lib/models/error/ErrorModel.js +0 -81
- package/lib/models/error/ErrorModel.js.map +0 -1
- package/lib/models/error/ErrorResponse.js +0 -304
- package/lib/models/error/ErrorResponse.js.map +0 -1
- package/lib/models/filters/AssignmentFilterModel.js +0 -161
- package/lib/models/filters/AssignmentFilterModel.js.map +0 -1
- package/lib/models/filters/BaseFilterModel.js +0 -210
- package/lib/models/filters/BaseFilterModel.js.map +0 -1
- package/lib/models/filters/ConceptIndexFilterModel.js +0 -37
- package/lib/models/filters/ConceptIndexFilterModel.js.map +0 -1
- package/lib/models/filters/FilterCollection.js +0 -155
- package/lib/models/filters/FilterCollection.js.map +0 -1
- package/lib/models/filters/FilterModel.js +0 -13
- package/lib/models/filters/FilterModel.js.map +0 -1
- package/lib/models/filters/RangeFilterModel.js +0 -44
- package/lib/models/filters/RangeFilterModel.js.map +0 -1
- package/lib/models/filters/StringFilterModel.js +0 -147
- package/lib/models/filters/StringFilterModel.js.map +0 -1
- package/lib/models/form/FormModel.js +0 -1038
- package/lib/models/form/FormModel.js.map +0 -1
- package/lib/models/form/FormObjectModel.js +0 -477
- package/lib/models/form/FormObjectModel.js.map +0 -1
- package/lib/models/grouping/GroupingModel.js +0 -191
- package/lib/models/grouping/GroupingModel.js.map +0 -1
- package/lib/models/href/Href.js +0 -497
- package/lib/models/href/Href.js.map +0 -1
- package/lib/models/href/ListHref.js +0 -135
- package/lib/models/href/ListHref.js.map +0 -1
- package/lib/models/index.js +0 -686
- package/lib/models/index.js.map +0 -1
- package/lib/models/layouthint/LayoutHintCollection.js +0 -118
- package/lib/models/layouthint/LayoutHintCollection.js.map +0 -1
- package/lib/models/links/LinkCollection.js +0 -171
- package/lib/models/links/LinkCollection.js.map +0 -1
- package/lib/models/links/LinkModel.js +0 -216
- package/lib/models/links/LinkModel.js.map +0 -1
- package/lib/models/links/normalizeLinkJSON.js +0 -107
- package/lib/models/links/normalizeLinkJSON.js.map +0 -1
- package/lib/models/list/ListDetailModel.js +0 -267
- package/lib/models/list/ListDetailModel.js.map +0 -1
- package/lib/models/list/ListHeaderModel.js +0 -95
- package/lib/models/list/ListHeaderModel.js.map +0 -1
- package/lib/models/list/ListItemCollection.js +0 -67
- package/lib/models/list/ListItemCollection.js.map +0 -1
- package/lib/models/list/ListItemModel.js +0 -95
- package/lib/models/list/ListItemModel.js.map +0 -1
- package/lib/models/list/ListModel.js +0 -386
- package/lib/models/list/ListModel.js.map +0 -1
- package/lib/models/lookup/LookupOptionCollection.js +0 -45
- package/lib/models/lookup/LookupOptionCollection.js.map +0 -1
- package/lib/models/lookup/LookupOptionsModel.js +0 -71
- package/lib/models/lookup/LookupOptionsModel.js.map +0 -1
- package/lib/models/modelcatalog/ModelCatalogModel.js +0 -69
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +0 -1
- package/lib/models/modelcatalog/ModelCategoryCollection.js +0 -24
- package/lib/models/modelcatalog/ModelCategoryCollection.js.map +0 -1
- package/lib/models/modelcatalog/ModelCategoryModel.js +0 -60
- package/lib/models/modelcatalog/ModelCategoryModel.js.map +0 -1
- package/lib/models/paging/PagesizeModel.js +0 -50
- package/lib/models/paging/PagesizeModel.js.map +0 -1
- package/lib/models/paging/PagingModel.js +0 -95
- package/lib/models/paging/PagingModel.js.map +0 -1
- package/lib/models/panels/GroupingPanelModel.js +0 -143
- package/lib/models/panels/GroupingPanelModel.js.map +0 -1
- package/lib/models/parameter/Parameter.js +0 -108
- package/lib/models/parameter/Parameter.js.map +0 -1
- package/lib/models/process/ProcessStatusSettingsModel.js +0 -85
- package/lib/models/process/ProcessStatusSettingsModel.js.map +0 -1
- package/lib/models/resolveModel.js +0 -57
- package/lib/models/resolveModel.js.map +0 -1
- package/lib/models/search/CaseSearchModel.js +0 -47
- package/lib/models/search/CaseSearchModel.js.map +0 -1
- package/lib/models/sorting/SortOptionModel.js +0 -106
- package/lib/models/sorting/SortOptionModel.js.map +0 -1
- package/lib/models/sorting/SortingModel.js +0 -112
- package/lib/models/sorting/SortingModel.js.map +0 -1
- package/lib/models/tab/TabModel.js +0 -143
- package/lib/models/tab/TabModel.js.map +0 -1
- package/lib/models/taskgroup/TaskGroupCollection.js +0 -21
- package/lib/models/taskgroup/TaskGroupCollection.js.map +0 -1
- package/lib/models/taskgroup/TaskGroupModel.js +0 -87
- package/lib/models/taskgroup/TaskGroupModel.js.map +0 -1
- package/lib/models/types.js +0 -2
- package/lib/models/types.js.map +0 -1
- package/lib/models/user/UserModel.js +0 -59
- package/lib/models/user/UserModel.js.map +0 -1
- package/lib/models/user/UserProfileModel.js +0 -55
- package/lib/models/user/UserProfileModel.js.map +0 -1
- package/lib/models/user/UserServicesModel.js +0 -126
- package/lib/models/user/UserServicesModel.js.map +0 -1
- package/lib/modularui/Authenticate.js +0 -183
- package/lib/modularui/Authenticate.js.map +0 -1
- package/lib/modularui/CaptchaRequest.js +0 -71
- package/lib/modularui/CaptchaRequest.js.map +0 -1
- package/lib/modularui/ModularUIError.js +0 -30
- package/lib/modularui/ModularUIError.js.map +0 -1
- package/lib/modularui/ModularUIRequest.js +0 -719
- package/lib/modularui/ModularUIRequest.js.map +0 -1
- package/lib/modularui/ModularUIResponse.js +0 -147
- package/lib/modularui/ModularUIResponse.js.map +0 -1
- package/lib/modularui/UploadRequest.js +0 -104
- package/lib/modularui/UploadRequest.js.map +0 -1
- package/lib/modularui/index.js +0 -42
- package/lib/modularui/index.js.map +0 -1
- package/lib/modularui/types.js +0 -2
- package/lib/modularui/types.js.map +0 -1
- package/lib/react/ErrorBoundary.js +0 -56
- package/lib/react/ErrorBoundary.js.map +0 -1
- package/lib/react/ErrorBoundaryFallback.js +0 -41
- package/lib/react/ErrorBoundaryFallback.js.map +0 -1
- package/lib/react/index.js +0 -29
- package/lib/react/index.js.map +0 -1
- package/lib/react/utils.js +0 -32
- package/lib/react/utils.js.map +0 -1
- package/lib/react-client/Init.js +0 -44
- package/lib/react-client/Init.js.map +0 -1
- package/lib/react-client/client.js +0 -236
- package/lib/react-client/client.js.map +0 -1
- package/lib/react-client/contextPath.js +0 -26
- package/lib/react-client/contextPath.js.map +0 -1
- package/lib/react-client/index.js +0 -40
- package/lib/react-client/index.js.map +0 -1
- package/lib/react-client/rehydrate.js +0 -73
- package/lib/react-client/rehydrate.js.map +0 -1
- package/lib/react-server/contextPath.js +0 -10
- package/lib/react-server/contextPath.js.map +0 -1
- package/lib/react-server/createSSRComplete.js +0 -61
- package/lib/react-server/createSSRComplete.js.map +0 -1
- package/lib/react-server/htmlpage.js +0 -54
- package/lib/react-server/htmlpage.js.map +0 -1
- package/lib/react-server/index.js +0 -82
- package/lib/react-server/index.js.map +0 -1
- package/lib/react-server/renderSSRComplete.js +0 -91
- package/lib/react-server/renderSSRComplete.js.map +0 -1
- package/lib/react-server/renderSSRMinimal.js +0 -47
- package/lib/react-server/renderSSRMinimal.js.map +0 -1
- package/lib/react-server/requestInformation.js +0 -64
- package/lib/react-server/requestInformation.js.map +0 -1
- package/lib/react-server/serverNoSSR.js +0 -63
- package/lib/react-server/serverNoSSR.js.map +0 -1
- package/lib/react-server/serverSSR.js +0 -51
- package/lib/react-server/serverSSR.js.map +0 -1
- package/lib/react-server/serverUtil.js +0 -217
- package/lib/react-server/serverUtil.js.map +0 -1
- package/lib/react-theme/ThemeProvider.js +0 -33
- package/lib/react-theme/ThemeProvider.js.map +0 -1
- package/lib/react-theme/createTheme.js +0 -115
- package/lib/react-theme/createTheme.js.map +0 -1
- package/lib/react-theme/index.js +0 -110
- package/lib/react-theme/index.js.map +0 -1
- package/lib/react-theme/types.js +0 -2
- package/lib/react-theme/types.js.map +0 -1
- package/lib/react-theme/useTheme.js +0 -15
- package/lib/react-theme/useTheme.js.map +0 -1
- package/lib/react-theme/utils/background.js +0 -21
- package/lib/react-theme/utils/background.js.map +0 -1
- package/lib/react-theme/utils/colors.js +0 -45
- package/lib/react-theme/utils/colors.js.map +0 -1
- package/lib/react-theme/utils/contrast.js +0 -95
- package/lib/react-theme/utils/contrast.js.map +0 -1
- package/lib/react-theme/utils/corners.js +0 -34
- package/lib/react-theme/utils/corners.js.map +0 -1
- package/lib/react-theme/utils/spacers.js +0 -89
- package/lib/react-theme/utils/spacers.js.map +0 -1
- package/lib/react-theme/utils/themeProps.js +0 -75
- package/lib/react-theme/utils/themeProps.js.map +0 -1
- package/lib/redux/_i18n/I18nActions.js +0 -37
- package/lib/redux/_i18n/I18nActions.js.map +0 -1
- package/lib/redux/_i18n/I18nReducer.js +0 -86
- package/lib/redux/_i18n/I18nReducer.js.map +0 -1
- package/lib/redux/_i18n/index.js +0 -29
- package/lib/redux/_i18n/index.js.map +0 -1
- package/lib/redux/_i18n/types.js +0 -2
- package/lib/redux/_i18n/types.js.map +0 -1
- package/lib/redux/_modularui/ModularUIActions.js +0 -185
- package/lib/redux/_modularui/ModularUIActions.js.map +0 -1
- package/lib/redux/_modularui/ModularUIConnector.js +0 -123
- package/lib/redux/_modularui/ModularUIConnector.js.map +0 -1
- package/lib/redux/_modularui/ModularUIMiddleware.js +0 -107
- package/lib/redux/_modularui/ModularUIMiddleware.js.map +0 -1
- package/lib/redux/_modularui/ModularUIReducer.js +0 -159
- package/lib/redux/_modularui/ModularUIReducer.js.map +0 -1
- package/lib/redux/_modularui/ModularUISelectors.js +0 -270
- package/lib/redux/_modularui/ModularUISelectors.js.map +0 -1
- package/lib/redux/_modularui/ModularUIUtils.js +0 -85
- package/lib/redux/_modularui/ModularUIUtils.js.map +0 -1
- package/lib/redux/_modularui/index.js +0 -86
- package/lib/redux/_modularui/index.js.map +0 -1
- package/lib/redux/_modularui/types.js +0 -2
- package/lib/redux/_modularui/types.js.map +0 -1
- package/lib/redux/_modularui/withModularUI.js +0 -41
- package/lib/redux/_modularui/withModularUI.js.map +0 -1
- package/lib/redux/_router/RouterActions.js +0 -67
- package/lib/redux/_router/RouterActions.js.map +0 -1
- package/lib/redux/_router/RouterConnectors.js +0 -42
- package/lib/redux/_router/RouterConnectors.js.map +0 -1
- package/lib/redux/_router/RouterMiddleware.js +0 -38
- package/lib/redux/_router/RouterMiddleware.js.map +0 -1
- package/lib/redux/_router/RouterReducer.js +0 -22
- package/lib/redux/_router/RouterReducer.js.map +0 -1
- package/lib/redux/_router/index.js +0 -51
- package/lib/redux/_router/index.js.map +0 -1
- package/lib/redux/_router/types.js +0 -2
- package/lib/redux/_router/types.js.map +0 -1
- package/lib/redux/actions/Application.js +0 -38
- package/lib/redux/actions/Application.js.map +0 -1
- package/lib/redux/actions/Authorization.js +0 -55
- package/lib/redux/actions/Authorization.js.map +0 -1
- package/lib/redux/actions/Error.js +0 -74
- package/lib/redux/actions/Error.js.map +0 -1
- package/lib/redux/actions/Form.js +0 -39
- package/lib/redux/actions/Form.js.map +0 -1
- package/lib/redux/actions/FormAttributeSet.js +0 -69
- package/lib/redux/actions/FormAttributeSet.js.map +0 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js +0 -35
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +0 -1
- package/lib/redux/actions/FormAutosave.js +0 -60
- package/lib/redux/actions/FormAutosave.js.map +0 -1
- package/lib/redux/actions/FormAutosubmit.js +0 -38
- package/lib/redux/actions/FormAutosubmit.js.map +0 -1
- package/lib/redux/actions/FormAutoupdate.js +0 -37
- package/lib/redux/actions/FormAutoupdate.js.map +0 -1
- package/lib/redux/actions/FormValidations.js +0 -51
- package/lib/redux/actions/FormValidations.js.map +0 -1
- package/lib/redux/actions/Modals.js +0 -22
- package/lib/redux/actions/Modals.js.map +0 -1
- package/lib/redux/actions/ModelCatalog.js +0 -15
- package/lib/redux/actions/ModelCatalog.js.map +0 -1
- package/lib/redux/actions/Notification.js +0 -76
- package/lib/redux/actions/Notification.js.map +0 -1
- package/lib/redux/actions/Preferences.js +0 -128
- package/lib/redux/actions/Preferences.js.map +0 -1
- package/lib/redux/actions/ProgressIndicator.js +0 -42
- package/lib/redux/actions/ProgressIndicator.js.map +0 -1
- package/lib/redux/actions/SignIn.js +0 -90
- package/lib/redux/actions/SignIn.js.map +0 -1
- package/lib/redux/actions/SignOut.js +0 -30
- package/lib/redux/actions/SignOut.js.map +0 -1
- package/lib/redux/actions/index.js +0 -183
- package/lib/redux/actions/index.js.map +0 -1
- package/lib/redux/connectors/Application.js +0 -14
- package/lib/redux/connectors/Application.js.map +0 -1
- package/lib/redux/connectors/Breadcrumb.js +0 -16
- package/lib/redux/connectors/Breadcrumb.js.map +0 -1
- package/lib/redux/connectors/CaseView.js +0 -19
- package/lib/redux/connectors/CaseView.js.map +0 -1
- package/lib/redux/connectors/ConceptDetail.js +0 -20
- package/lib/redux/connectors/ConceptDetail.js.map +0 -1
- package/lib/redux/connectors/ContentBrowser.js +0 -19
- package/lib/redux/connectors/ContentBrowser.js.map +0 -1
- package/lib/redux/connectors/ContentDetail.js +0 -20
- package/lib/redux/connectors/ContentDetail.js.map +0 -1
- package/lib/redux/connectors/ContentDetailSection.js +0 -22
- package/lib/redux/connectors/ContentDetailSection.js.map +0 -1
- package/lib/redux/connectors/Form.js +0 -43
- package/lib/redux/connectors/Form.js.map +0 -1
- package/lib/redux/connectors/FormAttributeSet.js +0 -27
- package/lib/redux/connectors/FormAttributeSet.js.map +0 -1
- package/lib/redux/connectors/ListDetail.js +0 -21
- package/lib/redux/connectors/ListDetail.js.map +0 -1
- package/lib/redux/connectors/Modal.js +0 -27
- package/lib/redux/connectors/Modal.js.map +0 -1
- package/lib/redux/connectors/ModelCatalog.js +0 -19
- package/lib/redux/connectors/ModelCatalog.js.map +0 -1
- package/lib/redux/connectors/Notification.js +0 -22
- package/lib/redux/connectors/Notification.js.map +0 -1
- package/lib/redux/connectors/PanelRenderer.js +0 -29
- package/lib/redux/connectors/PanelRenderer.js.map +0 -1
- package/lib/redux/connectors/Preferences.js +0 -29
- package/lib/redux/connectors/Preferences.js.map +0 -1
- package/lib/redux/connectors/Progress.js +0 -19
- package/lib/redux/connectors/Progress.js.map +0 -1
- package/lib/redux/connectors/ProgressIndicator.js +0 -19
- package/lib/redux/connectors/ProgressIndicator.js.map +0 -1
- package/lib/redux/connectors/QuickSearch.js +0 -27
- package/lib/redux/connectors/QuickSearch.js.map +0 -1
- package/lib/redux/connectors/SignIn.js +0 -24
- package/lib/redux/connectors/SignIn.js.map +0 -1
- package/lib/redux/connectors/SignOut.js +0 -20
- package/lib/redux/connectors/SignOut.js.map +0 -1
- package/lib/redux/connectors/Tab.js +0 -19
- package/lib/redux/connectors/Tab.js.map +0 -1
- package/lib/redux/connectors/index.js +0 -153
- package/lib/redux/connectors/index.js.map +0 -1
- package/lib/redux/index.js +0 -102
- package/lib/redux/index.js.map +0 -1
- package/lib/redux/reducers/AuthReducer.js +0 -59
- package/lib/redux/reducers/AuthReducer.js.map +0 -1
- package/lib/redux/reducers/ErrorReducer.js +0 -22
- package/lib/redux/reducers/ErrorReducer.js.map +0 -1
- package/lib/redux/reducers/ModalsReducer.js +0 -58
- package/lib/redux/reducers/ModalsReducer.js.map +0 -1
- package/lib/redux/reducers/ModelCatalogReducer.js +0 -34
- package/lib/redux/reducers/ModelCatalogReducer.js.map +0 -1
- package/lib/redux/reducers/NotificationReducer.js +0 -43
- package/lib/redux/reducers/NotificationReducer.js.map +0 -1
- package/lib/redux/reducers/PreferencesReducer.js +0 -30
- package/lib/redux/reducers/PreferencesReducer.js.map +0 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js +0 -55
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +0 -1
- package/lib/redux/reducers/createReducer.js +0 -33
- package/lib/redux/reducers/createReducer.js.map +0 -1
- package/lib/redux/reducers/index.js +0 -78
- package/lib/redux/reducers/index.js.map +0 -1
- package/lib/redux/selectors/i18n.js +0 -20
- package/lib/redux/selectors/i18n.js.map +0 -1
- package/lib/redux/selectors/index.js +0 -29
- package/lib/redux/selectors/index.js.map +0 -1
- package/lib/redux/selectors/modelcatalog.js +0 -14
- package/lib/redux/selectors/modelcatalog.js.map +0 -1
- package/lib/redux/store/beforeRenderHooks.js +0 -24
- package/lib/redux/store/beforeRenderHooks.js.map +0 -1
- package/lib/redux/store/configureStore.js +0 -37
- package/lib/redux/store/configureStore.js.map +0 -1
- package/lib/redux/types.js +0 -2
- package/lib/redux/types.js.map +0 -1
- package/lib/utils/browser/Cache.js +0 -151
- package/lib/utils/browser/Cache.js.map +0 -1
- package/lib/utils/browser/Cookies.js +0 -38
- package/lib/utils/browser/Cookies.js.map +0 -1
- package/lib/utils/datetime/DateTimeUtil.js +0 -649
- package/lib/utils/datetime/DateTimeUtil.js.map +0 -1
- package/lib/utils/fetch/serverFetch.js +0 -32
- package/lib/utils/fetch/serverFetch.js.map +0 -1
- package/lib/utils/fetch/types.js +0 -2
- package/lib/utils/fetch/types.js.map +0 -1
- package/lib/utils/fetch/universalFetch.js +0 -94
- package/lib/utils/fetch/universalFetch.js.map +0 -1
- package/lib/utils/fetch/xhr.js +0 -358
- package/lib/utils/fetch/xhr.js.map +0 -1
- package/lib/utils/helpers/checkResource.js +0 -46
- package/lib/utils/helpers/checkResource.js.map +0 -1
- package/lib/utils/helpers/createHash.js +0 -30
- package/lib/utils/helpers/createHash.js.map +0 -1
- package/lib/utils/helpers/createHref.js +0 -101
- package/lib/utils/helpers/createHref.js.map +0 -1
- package/lib/utils/helpers/createUUID.js +0 -18
- package/lib/utils/helpers/createUUID.js.map +0 -1
- package/lib/utils/helpers/index.js +0 -102
- package/lib/utils/helpers/index.js.map +0 -1
- package/lib/utils/helpers/objects.js +0 -36
- package/lib/utils/helpers/objects.js.map +0 -1
- package/lib/utils/helpers/repositoryResource.js +0 -26
- package/lib/utils/helpers/repositoryResource.js.map +0 -1
- package/lib/utils/helpers/sanitizeHtml.js +0 -44
- package/lib/utils/helpers/sanitizeHtml.js.map +0 -1
- package/lib/utils/helpers/text.js +0 -23
- package/lib/utils/helpers/text.js.map +0 -1
- package/lib/utils/index.js +0 -106
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/number/DecimalFormat.js +0 -333
- package/lib/utils/number/DecimalFormat.js.map +0 -1
- package/lib/utils/number/formatValue.js +0 -47
- package/lib/utils/number/formatValue.js.map +0 -1
- package/lib/utils/number/parseNumbers.js +0 -70
- package/lib/utils/number/parseNumbers.js.map +0 -1
- package/src/builder/__tests__/LayoutHintConfig.json +0 -20
- package/src/builder/__tests__/mergeLayoutHintConfigurations.spec.js +0 -71
- package/src/builder/__tests__/subdir/LayoutHintConfig.json +0 -20
- package/src/builder/index.js +0 -2
- package/src/builder/mergeLayoutHintConfigurations.js +0 -62
- package/src/constants/Constants.js +0 -190
- package/src/constants/LayoutHintConfig.js +0 -186
- package/src/constants/LayoutHints.js +0 -134
- package/src/constants/Settings.js +0 -269
- package/src/constants/index.js +0 -4
- package/src/exceptions/ConfigurationException.js +0 -13
- package/src/exceptions/FetchException.js +0 -101
- package/src/exceptions/IllegalArgumentException.js +0 -12
- package/src/exceptions/IllegalReturnException.js +0 -11
- package/src/exceptions/IllegalStateException.js +0 -12
- package/src/exceptions/JsonParseException.js +0 -12
- package/src/exceptions/MissingPropertyException.js +0 -13
- package/src/exceptions/NetworkException.js +0 -20
- package/src/exceptions/NotAllowedUriException.js +0 -12
- package/src/exceptions/NotFoundException.js +0 -20
- package/src/exceptions/ServerRequestException.js +0 -12
- package/src/exceptions/ThemePropertyException.js +0 -12
- package/src/exceptions/TimeoutException.js +0 -13
- package/src/exceptions/UnauthorizedException.js +0 -26
- package/src/exceptions/UnsupportedOperationException.js +0 -12
- package/src/exceptions/index.js +0 -16
- package/src/hooks/__tests__/UseModularUIModel.spec.js +0 -193
- package/src/hooks/__tests__/useAuthentication.spec.js +0 -122
- package/src/hooks/__tests__/useForm.spec.js +0 -300
- package/src/hooks/__tests__/useI18n.spec.js +0 -30
- package/src/hooks/__tests__/useModal.spec.js +0 -67
- package/src/hooks/__tests__/useModelCatalog.spec.js +0 -180
- package/src/hooks/__tests__/useModels.spec.js +0 -138
- package/src/hooks/__tests__/useModularUIBasic.spec.js +0 -126
- package/src/hooks/__tests__/useNotification.spec.js +0 -47
- package/src/hooks/__tests__/usePreference.spec.js +0 -72
- package/src/hooks/__tests__/useProgressIndicator.spec.js +0 -67
- package/src/hooks/index.js +0 -17
- package/src/hooks/useAllFormsOnModel.js +0 -92
- package/src/hooks/useAuthentication.js +0 -98
- package/src/hooks/useContent.js +0 -48
- package/src/hooks/useDeepCompareEffect.js +0 -34
- package/src/hooks/useForm.js +0 -153
- package/src/hooks/useI18n.js +0 -46
- package/src/hooks/useModal.js +0 -46
- package/src/hooks/useModelCatalog.js +0 -256
- package/src/hooks/useModels.js +0 -50
- package/src/hooks/useModularUI.js +0 -90
- package/src/hooks/useModularUIBasic.js +0 -101
- package/src/hooks/useModularUIModel.js +0 -165
- package/src/hooks/useModularUIRequest.js +0 -25
- package/src/hooks/useNotification.js +0 -48
- package/src/hooks/usePreference.js +0 -27
- package/src/hooks/useProgressIndicator.js +0 -33
- package/src/hooks/useRouter.js +0 -64
- package/src/i18n/Locale.js +0 -157
- package/src/i18n/Locales.js +0 -171
- package/src/i18n/Message.js +0 -66
- package/src/i18n/__tests__/Locale.spec.js +0 -108
- package/src/i18n/__tests__/Locales.spec.js +0 -137
- package/src/i18n/index.js +0 -12
- package/src/i18n/languages.js +0 -207
- package/src/i18n/translations/beinformed_error_messages_en.nl.js +0 -98
- package/src/i18n/translations/beinformed_error_messages_nl.nl.js +0 -98
- package/src/i18n/types.js +0 -23
- package/src/i18n/withMessage.js +0 -47
- package/src/index.js +0 -7
- package/src/models/__tests__/resolveModel.spec.js +0 -34
- package/src/models/actions/ActionCollection.js +0 -100
- package/src/models/actions/ActionModel.js +0 -207
- package/src/models/actions/__mock__/action.js +0 -35
- package/src/models/actions/__tests__/ActionCollection.spec.js +0 -98
- package/src/models/actions/__tests__/ActionModel.spec.js +0 -75
- package/src/models/application/ApplicationModel.js +0 -151
- package/src/models/application/__mock__/application.js +0 -14
- package/src/models/application/__mock__/contributions.json +0 -312
- package/src/models/application/__mock__/data.json +0 -263
- package/src/models/application/__tests__/Application.spec.js +0 -99
- package/src/models/application/__tests__/webapp.json +0 -42
- package/src/models/application/__tests__/webappContributions.json +0 -43
- package/src/models/attributes/AttributeCollection.js +0 -306
- package/src/models/attributes/AttributeContent.js +0 -233
- package/src/models/attributes/AttributeDataHelper.js +0 -323
- package/src/models/attributes/AttributeModel.js +0 -1007
- package/src/models/attributes/AttributeSetModel.js +0 -117
- package/src/models/attributes/BooleanAttributeModel.js +0 -319
- package/src/models/attributes/CaptchaAttributeModel.js +0 -51
- package/src/models/attributes/ChoiceAttributeModel.js +0 -499
- package/src/models/attributes/ChoiceAttributeOptionCollection.js +0 -372
- package/src/models/attributes/ChoiceAttributeOptionModel.js +0 -415
- package/src/models/attributes/CompositeAttributeChildCollection.js +0 -254
- package/src/models/attributes/CompositeAttributeModel.js +0 -439
- package/src/models/attributes/DatetimeAttributeModel.js +0 -566
- package/src/models/attributes/HelptextAttributeModel.js +0 -54
- package/src/models/attributes/LabelAttributeModel.js +0 -36
- package/src/models/attributes/MemoAttributeModel.js +0 -43
- package/src/models/attributes/MoneyAttributeModel.js +0 -45
- package/src/models/attributes/NumberAttributeModel.js +0 -255
- package/src/models/attributes/PasswordAttributeModel.js +0 -245
- package/src/models/attributes/StringAttributeModel.js +0 -314
- package/src/models/attributes/UploadAttributeModel.js +0 -261
- package/src/models/attributes/XMLAttributeModel.js +0 -51
- package/src/models/attributes/__mock__/_ActionFieldsContributions.json +0 -12
- package/src/models/attributes/__mock__/_ActionFieldsData.json +0 -7
- package/src/models/attributes/__mock__/_FormCollectionContribution.json +0 -419
- package/src/models/attributes/__mock__/_FormCollectionData.json +0 -122
- package/src/models/attributes/__mock__/_InstrumentQuestionContributions.json +0 -178
- package/src/models/attributes/__mock__/_ListAttributeContributions.json +0 -82
- package/src/models/attributes/__mock__/_ListAttributeData.json +0 -70
- package/src/models/attributes/__mock__/_ListDetailContributions.json +0 -75
- package/src/models/attributes/__mock__/_ListDetailData.json +0 -38
- package/src/models/attributes/__mock__/_TreeFormAttributeContribution.json +0 -117
- package/src/models/attributes/__mock__/_TreeFormAttributeData.json +0 -27
- package/src/models/attributes/__mock__/form.contributions.json +0 -410
- package/src/models/attributes/__mock__/form.data.json +0 -113
- package/src/models/attributes/__mock__/form.js +0 -6
- package/src/models/attributes/__mock__/list.contributions.json +0 -110
- package/src/models/attributes/__mock__/list.data.json +0 -84
- package/src/models/attributes/__mock__/list.js +0 -6
- package/src/models/attributes/__tests__/AttributeCollection.spec.js +0 -160
- package/src/models/attributes/__tests__/AttributeCollectionComposite.spec.js +0 -146
- package/src/models/attributes/__tests__/AttributeContent.spec.js +0 -225
- package/src/models/attributes/__tests__/AttributeDataHelper.spec.js +0 -634
- package/src/models/attributes/__tests__/AttributeModel.spec.js +0 -274
- package/src/models/attributes/__tests__/AttributeSetModel.spec.js +0 -39
- package/src/models/attributes/__tests__/BooleanAttributeModel.spec.js +0 -107
- package/src/models/attributes/__tests__/CaptchaAttributeModel.spec.js +0 -13
- package/src/models/attributes/__tests__/ChoiceAttributeModel.spec.js +0 -750
- package/src/models/attributes/__tests__/ChoiceAttributeOptionCollection.spec.js +0 -507
- package/src/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js +0 -107
- package/src/models/attributes/__tests__/CompositeAttributeModel.spec.js +0 -467
- package/src/models/attributes/__tests__/DateAttributeModel.spec.js +0 -134
- package/src/models/attributes/__tests__/DatetimeAttributeModel.spec.js +0 -206
- package/src/models/attributes/__tests__/DatetimeAttributeModel_offset.spec.js +0 -345
- package/src/models/attributes/__tests__/HelptextAttributeModel.spec.js +0 -64
- package/src/models/attributes/__tests__/LabelAttributeModel.spec.js +0 -13
- package/src/models/attributes/__tests__/LookupAttributeModel.spec.js +0 -47
- package/src/models/attributes/__tests__/MemoAttributeModel.spec.js +0 -28
- package/src/models/attributes/__tests__/MoneyAttributeModel.spec.js +0 -22
- package/src/models/attributes/__tests__/NumberAttributeModel.spec.js +0 -67
- package/src/models/attributes/__tests__/PasswordAttributeModel.spec.js +0 -49
- package/src/models/attributes/__tests__/StringAttributeModel.spec.js +0 -125
- package/src/models/attributes/__tests__/TimeAttributeModel.spec.js +0 -57
- package/src/models/attributes/__tests__/TimestampModel.spec.js +0 -43
- package/src/models/attributes/__tests__/UploadAttributeModel.spec.js +0 -67
- package/src/models/attributes/__tests__/XMLAttributeModel.spec.js +0 -17
- package/src/models/attributes/__tests__/_createAttribute.spec.js +0 -106
- package/src/models/attributes/__tests__/createAttributeComposite.spec.js +0 -151
- package/src/models/attributes/__tests__/createAttributeDynamicSchema.spec.js +0 -134
- package/src/models/attributes/_createAttribute.js +0 -147
- package/src/models/attributes/input-constraints/BSNConstraint.js +0 -80
- package/src/models/attributes/input-constraints/ConstraintCollection.js +0 -65
- package/src/models/attributes/input-constraints/ConstraintModel.js +0 -76
- package/src/models/attributes/input-constraints/DateBoundaryConstraint.js +0 -240
- package/src/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +0 -72
- package/src/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +0 -72
- package/src/models/attributes/input-constraints/DatetimeFormatConstraint.js +0 -132
- package/src/models/attributes/input-constraints/FileExtensionConstraint.js +0 -60
- package/src/models/attributes/input-constraints/FileSizeConstraint.js +0 -101
- package/src/models/attributes/input-constraints/IBANConstraint.js +0 -46
- package/src/models/attributes/input-constraints/MandatoryConstraint.js +0 -54
- package/src/models/attributes/input-constraints/MandatoryRangeConstraint.js +0 -84
- package/src/models/attributes/input-constraints/NumberBoundaryConstraint.js +0 -213
- package/src/models/attributes/input-constraints/NumberFormatConstraint.js +0 -153
- package/src/models/attributes/input-constraints/NumberGroupingConstraint.js +0 -140
- package/src/models/attributes/input-constraints/PasswordConfirmConstraint.js +0 -68
- package/src/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +0 -44
- package/src/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +0 -60
- package/src/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +0 -60
- package/src/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +0 -74
- package/src/models/attributes/input-constraints/RangeConstraint.js +0 -161
- package/src/models/attributes/input-constraints/RegexConstraint.js +0 -72
- package/src/models/attributes/input-constraints/StringLengthConstraint.js +0 -179
- package/src/models/attributes/input-constraints/XMLConstraint.js +0 -62
- package/src/models/attributes/input-constraints/__tests__/BSNConstraint.spec.js +0 -25
- package/src/models/attributes/input-constraints/__tests__/ConstraintCollection.spec.js +0 -9
- package/src/models/attributes/input-constraints/__tests__/ConstraintModel.spec.js +0 -35
- package/src/models/attributes/input-constraints/__tests__/DateBoundaryConstraint.spec.js +0 -117
- package/src/models/attributes/input-constraints/__tests__/DateTimeDateFormatConstraint.spec.js +0 -30
- package/src/models/attributes/input-constraints/__tests__/DateTimeTimeFormatConstraint.spec.js +0 -54
- package/src/models/attributes/input-constraints/__tests__/DatetimeFormatConstraint.spec.js +0 -79
- package/src/models/attributes/input-constraints/__tests__/FileExtensionConstraint.spec.js +0 -20
- package/src/models/attributes/input-constraints/__tests__/FileSizeConstraint.spec.js +0 -53
- package/src/models/attributes/input-constraints/__tests__/IBANConstraint.spec.js +0 -12
- package/src/models/attributes/input-constraints/__tests__/MandatoryConstraint.spec.js +0 -14
- package/src/models/attributes/input-constraints/__tests__/NumberBoundaryConstraint.spec.js +0 -46
- package/src/models/attributes/input-constraints/__tests__/NumberFormatConstraint.spec.js +0 -137
- package/src/models/attributes/input-constraints/__tests__/NumberGroupingConstraint.spec.js +0 -85
- package/src/models/attributes/input-constraints/__tests__/PasswordConfirmConstraint.spec.js +0 -21
- package/src/models/attributes/input-constraints/__tests__/PasswordLowerAndUpperCaseConstraint.spec.js +0 -14
- package/src/models/attributes/input-constraints/__tests__/PasswordMinNumericCharactersConstraint.spec.js +0 -11
- package/src/models/attributes/input-constraints/__tests__/PasswordMinSpecialCharactersConstraint.spec.js +0 -11
- package/src/models/attributes/input-constraints/__tests__/PasswordThreeConsecutiveCharactersNotAllowedConstraint.spec.js +0 -22
- package/src/models/attributes/input-constraints/__tests__/RegexConstraint.spec.js +0 -42
- package/src/models/attributes/input-constraints/__tests__/StringLengthConstraint.spec.js +0 -102
- package/src/models/attributes/input-constraints/__tests__/XMLConstraint.spec.js +0 -15
- package/src/models/attributes/layouthint-rules/BaseLayoutHintRule.js +0 -74
- package/src/models/attributes/layouthint-rules/DependentAttribute.js +0 -246
- package/src/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +0 -101
- package/src/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +0 -67
- package/src/models/attributes/layouthint-rules/__mock__/MockedCollectionFactory.js +0 -54
- package/src/models/attributes/layouthint-rules/__tests__/BaseLayoutHintRule.spec.js +0 -29
- package/src/models/attributes/layouthint-rules/__tests__/DependentAttribute.spec.js +0 -310
- package/src/models/attributes/layouthint-rules/__tests__/LayoutHintRuleCollection.spec.js +0 -58
- package/src/models/attributes/layouthint-rules/__tests__/RemainingTotalUploadSize.spec.js +0 -24
- package/src/models/base/BaseCollection.js +0 -191
- package/src/models/base/BaseModel.js +0 -155
- package/src/models/base/ResourceCollection.js +0 -42
- package/src/models/base/ResourceModel.js +0 -246
- package/src/models/base/__tests__/BaseCollection.spec.js +0 -108
- package/src/models/base/__tests__/BaseModel.spec.js +0 -85
- package/src/models/base/__tests__/ResourceCollection.spec.js +0 -51
- package/src/models/base/__tests__/ResourceModel.spec.js +0 -100
- package/src/models/base/__tests__/webapp.json +0 -52
- package/src/models/caseview/CaseViewModel.js +0 -188
- package/src/models/caseview/__mock__/caseview.js +0 -14
- package/src/models/caseview/__mock__/contributions.json +0 -146
- package/src/models/caseview/__mock__/data.json +0 -21
- package/src/models/caseview/__tests__/CaseViewModel.spec.js +0 -132
- package/src/models/caseview/__tests__/caseview.json +0 -49
- package/src/models/caseview/__tests__/caseviewContributions.json +0 -118
- package/src/models/caseview/__tests__/caseview_local_taskgroup.json +0 -57
- package/src/models/concepts/BusinessScenarioModel.js +0 -176
- package/src/models/concepts/ConceptDetailModel.js +0 -343
- package/src/models/concepts/ConceptIndexModel.js +0 -170
- package/src/models/concepts/ConceptLinkModel.js +0 -208
- package/src/models/concepts/ConceptRelationCollection.js +0 -95
- package/src/models/concepts/ConceptRelationModel.js +0 -129
- package/src/models/concepts/ConceptTypeDetailModel.js +0 -128
- package/src/models/concepts/SourceReferenceCollection.js +0 -32
- package/src/models/concepts/SourceReferenceModel.js +0 -114
- package/src/models/concepts/__mock__/business_scenario.js +0 -26
- package/src/models/concepts/__mock__/business_scenario_data.json +0 -234
- package/src/models/concepts/__mock__/business_scenario_step.json +0 -64
- package/src/models/concepts/__mock__/conceptdetail.js +0 -27
- package/src/models/concepts/__mock__/conceptdetail_contributions.json +0 -156
- package/src/models/concepts/__mock__/conceptdetail_data.json +0 -164
- package/src/models/concepts/__mock__/conceptindex.js +0 -15
- package/src/models/concepts/__mock__/conceptindex_contributions.json +0 -86
- package/src/models/concepts/__mock__/conceptindex_data.json +0 -329
- package/src/models/concepts/__mock__/concepttype.js +0 -13
- package/src/models/concepts/__mock__/concepttype_Calculation.json +0 -75
- package/src/models/concepts/__mock__/concepttype_contributions.json +0 -139
- package/src/models/concepts/__mock__/concepttype_data.json +0 -32
- package/src/models/concepts/__mock__/concepttype_hierarchy.js +0 -13
- package/src/models/concepts/__mock__/concepttype_hierarchy.json +0 -32
- package/src/models/concepts/__mock__/related_concepts.js +0 -12
- package/src/models/concepts/__mock__/related_concepts_contributions.json +0 -41
- package/src/models/concepts/__mock__/related_concepts_data.json +0 -2408
- package/src/models/concepts/__mock__/relation_with_props_and_tf_data.js +0 -27
- package/src/models/concepts/__mock__/relation_with_props_and_tf_data.json +0 -67
- package/src/models/concepts/__tests__/BusinessScenarioModel.spec.js +0 -28
- package/src/models/concepts/__tests__/ConceptDetailModel.spec.js +0 -65
- package/src/models/concepts/__tests__/ConceptIndexModel.spec.js +0 -42
- package/src/models/concepts/__tests__/ConceptLinkModel.spec.js +0 -9
- package/src/models/concepts/__tests__/ConceptRelationCollection.spec.js +0 -9
- package/src/models/concepts/__tests__/ConceptRelationModel.spec.js +0 -53
- package/src/models/concepts/__tests__/ConceptTypeDetailModel.spec.js +0 -31
- package/src/models/concepts/__tests__/RelatedConcepts.spec.js +0 -58
- package/src/models/concepts/__tests__/SourceReferenceCollection.spec.js +0 -9
- package/src/models/concepts/__tests__/SourceReferenceModel.spec.js +0 -108
- package/src/models/content/ContentIndexModel.js +0 -160
- package/src/models/content/ContentLinkModel.js +0 -308
- package/src/models/content/ContentModel.js +0 -226
- package/src/models/content/ContentTOCModel.js +0 -233
- package/src/models/content/ContentTypeModel.js +0 -71
- package/src/models/content/SectionModel.js +0 -236
- package/src/models/content/SubSectionModel.js +0 -181
- package/src/models/content/__tests__/ContentIndexModel.spec.js +0 -40
- package/src/models/content/__tests__/ContentLinkModel.spec.js +0 -129
- package/src/models/content/__tests__/ContentModel.spec.js +0 -241
- package/src/models/content/__tests__/Formalsource.spec.js +0 -133
- package/src/models/content/__tests__/content-index-contributions.json +0 -50
- package/src/models/content/__tests__/content-index.json +0 -164
- package/src/models/content/__tests__/content-with-childsections.json +0 -105
- package/src/models/content/__tests__/content-with-sections.json +0 -105
- package/src/models/content/__tests__/content-with-subsections.json +0 -119
- package/src/models/content/__tests__/content-with-subsections2.json +0 -79
- package/src/models/content/__tests__/content.json +0 -31
- package/src/models/content/__tests__/contributions.json +0 -84
- package/src/models/content/__tests__/formalsource-complete.json +0 -235
- package/src/models/content/__tests__/formalsource-contributions.json +0 -110
- package/src/models/content/__tests__/formalsource-section-contributions.json +0 -84
- package/src/models/content/__tests__/formalsource-section.json +0 -60
- package/src/models/content/__tests__/formalsource-toc.json +0 -122
- package/src/models/contentconfiguration/ContentConfiguration.js +0 -70
- package/src/models/contentconfiguration/ContentConfigurationElements.js +0 -152
- package/src/models/contentconfiguration/ContentConfigurationEndResults.js +0 -45
- package/src/models/contentconfiguration/ContentConfigurationQuestions.js +0 -60
- package/src/models/contentconfiguration/ContentConfigurationResults.js +0 -105
- package/src/models/contentconfiguration/__tests__/ContentConfigurationElements.spec.js +0 -29
- package/src/models/contentconfiguration/__tests__/ContentConfigurationResults.spec.js +0 -101
- package/src/models/detail/DetailModel.js +0 -241
- package/src/models/detail/__tests__/DetailModel.spec.js +0 -41
- package/src/models/detail/__tests__/detail.json +0 -37
- package/src/models/detail/__tests__/detailContributions.json +0 -124
- package/src/models/error/ErrorCollection.js +0 -127
- package/src/models/error/ErrorModel.js +0 -83
- package/src/models/error/ErrorResponse.js +0 -343
- package/src/models/error/__tests__/ErrorCollection.spec.js +0 -41
- package/src/models/error/__tests__/ErrorModel.spec.js +0 -24
- package/src/models/filters/AssignmentFilterModel.js +0 -195
- package/src/models/filters/BaseFilterModel.js +0 -236
- package/src/models/filters/ConceptIndexFilterModel.js +0 -40
- package/src/models/filters/FilterCollection.js +0 -192
- package/src/models/filters/FilterModel.js +0 -6
- package/src/models/filters/RangeFilterModel.js +0 -36
- package/src/models/filters/StringFilterModel.js +0 -159
- package/src/models/filters/__tests__/AssignmentFilterModel.spec.js +0 -140
- package/src/models/filters/__tests__/FilterCollection.spec.js +0 -68
- package/src/models/filters/__tests__/FilterModel.spec.js +0 -65
- package/src/models/filters/__tests__/RangeFilterModel.spec.js +0 -55
- package/src/models/filters/__tests__/ZipcodeFilter.spec.js +0 -145
- package/src/models/filters/__tests__/filters.json +0 -91
- package/src/models/filters/__tests__/filtersContributions.json +0 -110
- package/src/models/form/FormModel.js +0 -1280
- package/src/models/form/FormObjectModel.js +0 -590
- package/src/models/form/__mock__/contributions.json +0 -525
- package/src/models/form/__mock__/data.json +0 -78
- package/src/models/form/__mock__/form.js +0 -17
- package/src/models/form/__tests__/FormContributions.json +0 -495
- package/src/models/form/__tests__/FormContributionsUnknownRepeat.json +0 -67
- package/src/models/form/__tests__/FormInstrumentContributions.json +0 -183
- package/src/models/form/__tests__/FormModel.getters.spec.js +0 -149
- package/src/models/form/__tests__/FormModel.instrument.spec.js +0 -202
- package/src/models/form/__tests__/FormModel.repeating.spec.js +0 -65
- package/src/models/form/__tests__/FormModel.selfhref.spec.js +0 -84
- package/src/models/form/__tests__/FormModel.spec.js +0 -752
- package/src/models/form/__tests__/FormModel.unknown-repeat.spec.js +0 -52
- package/src/models/form/__tests__/FormObjectModel.spec.js +0 -180
- package/src/models/form/__tests__/FormResultData.spec.js +0 -86
- package/src/models/form/__tests__/FormValidation.spec.js +0 -79
- package/src/models/form/__tests__/FormValidationContributions.json +0 -45
- package/src/models/form/__tests__/FormValidationDataInitial.json +0 -33
- package/src/models/form/__tests__/FormValidationDataUpdate1.json +0 -25
- package/src/models/form/__tests__/FormValidationDataUpdate2.json +0 -33
- package/src/models/form/__tests__/FormWithContent.spec.js +0 -71
- package/src/models/form/__tests__/FormWithContentContributions.json +0 -242
- package/src/models/form/__tests__/FormWithContentData.json +0 -244
- package/src/models/grouping/GroupingModel.js +0 -232
- package/src/models/grouping/__tests__/GroupingModel.spec.js +0 -80
- package/src/models/href/Href.js +0 -564
- package/src/models/href/ListHref.js +0 -146
- package/src/models/href/__tests__/Href.spec.js +0 -184
- package/src/models/href/__tests__/ListHref.spec.js +0 -61
- package/src/models/href/__tests__/list.json +0 -2417
- package/src/models/href/__tests__/listContributions.json +0 -330
- package/src/models/index.js +0 -177
- package/src/models/layouthint/LayoutHintCollection.js +0 -116
- package/src/models/layouthint/__tests__/LayoutHintCollection.spec.js +0 -89
- package/src/models/links/LinkCollection.js +0 -169
- package/src/models/links/LinkModel.js +0 -229
- package/src/models/links/__tests__/LinkCollection.spec.js +0 -426
- package/src/models/links/__tests__/LinkModel.spec.js +0 -103
- package/src/models/links/__tests__/normalizeLinkJSON.spec.js +0 -212
- package/src/models/links/normalizeLinkJSON.js +0 -121
- package/src/models/list/ListDetailModel.js +0 -330
- package/src/models/list/ListHeaderModel.js +0 -96
- package/src/models/list/ListItemCollection.js +0 -80
- package/src/models/list/ListItemModel.js +0 -111
- package/src/models/list/ListModel.js +0 -438
- package/src/models/list/__mock__/caselist.contributions.json +0 -372
- package/src/models/list/__mock__/caselist.data.json +0 -519
- package/src/models/list/__mock__/caselist.js +0 -14
- package/src/models/list/__tests__/ListDetailModel.hierarchy.spec.js +0 -88
- package/src/models/list/__tests__/ListDetailModel.spec.js +0 -96
- package/src/models/list/__tests__/ListItemCollection.spec.js +0 -22
- package/src/models/list/__tests__/ListModel.spec.js +0 -152
- package/src/models/list/__tests__/ListResultDetail.spec.js +0 -37
- package/src/models/list/__tests__/caselist-34.contributions.json +0 -146
- package/src/models/list/__tests__/caselist-34.data.json +0 -21
- package/src/models/list/__tests__/hierarchy.json +0 -185
- package/src/models/list/__tests__/hierarchyContributions.json +0 -582
- package/src/models/list/__tests__/instrument-detail-contributions.json +0 -761
- package/src/models/list/__tests__/instrument-detail-data.json +0 -66
- package/src/models/list/__tests__/list.json +0 -2426
- package/src/models/list/__tests__/listContributions.json +0 -349
- package/src/models/list/__tests__/related-contributions.json +0 -42
- package/src/models/list/__tests__/related-data.json +0 -32
- package/src/models/lookup/LookupOptionCollection.js +0 -54
- package/src/models/lookup/LookupOptionsModel.js +0 -81
- package/src/models/lookup/__tests__/LookupOptionCollection.spec.js +0 -80
- package/src/models/lookup/__tests__/LookupOptionsModel.spec.js +0 -82
- package/src/models/lookup/__tests__/_LookupOptionsContributions.json +0 -29
- package/src/models/lookup/__tests__/_LookupOptionsData.json +0 -34
- package/src/models/lookup/__tests__/_LookupOptionsListContributions.json +0 -129
- package/src/models/lookup/__tests__/_LookupOptionsListData.json +0 -134
- package/src/models/lookup/__tests__/_TaxonomyAttributeData.json +0 -42
- package/src/models/modelcatalog/ModelCatalogModel.js +0 -73
- package/src/models/modelcatalog/ModelCategoryCollection.js +0 -22
- package/src/models/modelcatalog/ModelCategoryModel.js +0 -63
- package/src/models/modelcatalog/__mock__/contributions.json +0 -6
- package/src/models/modelcatalog/__mock__/data.json +0 -29
- package/src/models/modelcatalog/__mock__/modelcatalog.js +0 -14
- package/src/models/modelcatalog/__tests__/ModelCatalogModel.spec.js +0 -49
- package/src/models/paging/PagesizeModel.js +0 -44
- package/src/models/paging/PagingModel.js +0 -94
- package/src/models/paging/__tests__/PageSizeModel.spec.js +0 -31
- package/src/models/paging/__tests__/PagingModel.spec.js +0 -40
- package/src/models/paging/__tests__/list.json +0 -8
- package/src/models/paging/__tests__/listContributions.json +0 -7
- package/src/models/panels/GroupingPanelModel.js +0 -164
- package/src/models/panels/__tests__/GroupingPanelModel.spec.js +0 -142
- package/src/models/panels/__tests__/groupingPanel.json +0 -49
- package/src/models/panels/__tests__/groupingPanelContributions.json +0 -59
- package/src/models/parameter/Parameter.js +0 -117
- package/src/models/parameter/__tests__/Parameter.spec.js +0 -125
- package/src/models/process/ProcessStatusSettingsModel.js +0 -88
- package/src/models/process/__tests__/ProcessStatusSettingsModel.spec.js +0 -52
- package/src/models/resolveModel.js +0 -92
- package/src/models/search/CaseSearchModel.js +0 -46
- package/src/models/search/__tests__/CaseSearchModel.spec.js +0 -10
- package/src/models/sorting/SortOptionModel.js +0 -107
- package/src/models/sorting/SortingModel.js +0 -128
- package/src/models/sorting/__tests__/SortingModel.spec.js +0 -96
- package/src/models/tab/TabModel.js +0 -160
- package/src/models/tab/__mock__/contributions.json +0 -77
- package/src/models/tab/__mock__/data.json +0 -20
- package/src/models/tab/__mock__/personContributions.json +0 -35
- package/src/models/tab/__mock__/personData.json +0 -21
- package/src/models/tab/__mock__/tab.js +0 -14
- package/src/models/tab/__mock__/tabPerson.js +0 -14
- package/src/models/tab/__tests__/TabModel.spec.js +0 -72
- package/src/models/tab/__tests__/tab.json +0 -37
- package/src/models/tab/__tests__/tabContributions.json +0 -39
- package/src/models/taskgroup/TaskGroupCollection.js +0 -16
- package/src/models/taskgroup/TaskGroupModel.js +0 -102
- package/src/models/taskgroup/__mock__/contributions.json +0 -18
- package/src/models/taskgroup/__mock__/data.json +0 -21
- package/src/models/taskgroup/__mock__/taskgroup.js +0 -14
- package/src/models/taskgroup/__tests__/TaskGroupModel.spec.js +0 -26
- package/src/models/taskgroup/__tests__/taskgroup.json +0 -25
- package/src/models/taskgroup/__tests__/taskgroupContributions.json +0 -23
- package/src/models/types.js +0 -275
- package/src/models/user/UserModel.js +0 -57
- package/src/models/user/UserProfileModel.js +0 -54
- package/src/models/user/UserServicesModel.js +0 -136
- package/src/models/user/__mock__/contributions.json +0 -148
- package/src/models/user/__mock__/data.json +0 -22
- package/src/models/user/__tests__/UserModel.spec.js +0 -43
- package/src/models/user/__tests__/UserProfileModel.spec.js +0 -45
- package/src/models/user/__tests__/UserServicesModel.spec.js +0 -55
- package/src/modularui/Authenticate.js +0 -195
- package/src/modularui/CaptchaRequest.js +0 -104
- package/src/modularui/ModularUIError.js +0 -25
- package/src/modularui/ModularUIRequest.js +0 -872
- package/src/modularui/ModularUIResponse.js +0 -160
- package/src/modularui/UploadRequest.js +0 -151
- package/src/modularui/__tests__/CustomContextPath.spec.js +0 -61
- package/src/modularui/__tests__/ModularUIError.spec.js +0 -22
- package/src/modularui/__tests__/ModularUIRequest.spec.js +0 -495
- package/src/modularui/__tests__/contributions.json +0 -312
- package/src/modularui/__tests__/data.json +0 -263
- package/src/modularui/index.js +0 -6
- package/src/modularui/types.js +0 -4
- package/src/react/ErrorBoundary.js +0 -61
- package/src/react/ErrorBoundaryFallback.js +0 -46
- package/src/react/index.js +0 -3
- package/src/react/utils.js +0 -33
- package/src/react-client/Init.js +0 -46
- package/src/react-client/client.js +0 -309
- package/src/react-client/contextPath.js +0 -30
- package/src/react-client/index.js +0 -4
- package/src/react-client/rehydrate.js +0 -94
- package/src/react-server/__tests__/htmlpage.spec.js +0 -75
- package/src/react-server/__tests__/requestInformation.spec.js +0 -266
- package/src/react-server/__tests__/serverUtil.spec.js +0 -183
- package/src/react-server/contextPath.js +0 -8
- package/src/react-server/createSSRComplete.js +0 -63
- package/src/react-server/htmlpage.js +0 -55
- package/src/react-server/index.js +0 -13
- package/src/react-server/renderSSRComplete.js +0 -111
- package/src/react-server/renderSSRMinimal.js +0 -54
- package/src/react-server/requestInformation.js +0 -68
- package/src/react-server/serverNoSSR.js +0 -87
- package/src/react-server/serverSSR.js +0 -70
- package/src/react-server/serverUtil.js +0 -279
- package/src/react-theme/ThemeProvider.js +0 -25
- package/src/react-theme/__tests__/ThemeProvider.spec.js +0 -84
- package/src/react-theme/__tests__/createTheme.spec.js +0 -172
- package/src/react-theme/createTheme.js +0 -118
- package/src/react-theme/index.js +0 -15
- package/src/react-theme/types.js +0 -16
- package/src/react-theme/useTheme.js +0 -13
- package/src/react-theme/utils/__tests__/background.spec.js +0 -30
- package/src/react-theme/utils/__tests__/colors.spec.js +0 -30
- package/src/react-theme/utils/__tests__/contrast.spec.js +0 -44
- package/src/react-theme/utils/__tests__/corners.spec.js +0 -27
- package/src/react-theme/utils/__tests__/spacers.spec.js +0 -44
- package/src/react-theme/utils/__tests__/themeProps.spec.js +0 -72
- package/src/react-theme/utils/background.js +0 -20
- package/src/react-theme/utils/colors.js +0 -47
- package/src/react-theme/utils/contrast.js +0 -117
- package/src/react-theme/utils/corners.js +0 -37
- package/src/react-theme/utils/spacers.js +0 -65
- package/src/react-theme/utils/themeProps.js +0 -90
- package/src/redux/_i18n/I18nActions.js +0 -38
- package/src/redux/_i18n/I18nReducer.js +0 -91
- package/src/redux/_i18n/__tests__/actions.spec.js +0 -37
- package/src/redux/_i18n/__tests__/reducer.spec.js +0 -29
- package/src/redux/_i18n/index.js +0 -6
- package/src/redux/_i18n/types.js +0 -20
- package/src/redux/_modularui/ModularUIActions.js +0 -227
- package/src/redux/_modularui/ModularUIConnector.js +0 -155
- package/src/redux/_modularui/ModularUIMiddleware.js +0 -182
- package/src/redux/_modularui/ModularUIReducer.js +0 -169
- package/src/redux/_modularui/ModularUISelectors.js +0 -322
- package/src/redux/_modularui/ModularUIUtils.js +0 -96
- package/src/redux/_modularui/__tests__/actions.spec.js +0 -159
- package/src/redux/_modularui/__tests__/reducer.spec.js +0 -134
- package/src/redux/_modularui/__tests__/selectors.spec.js +0 -153
- package/src/redux/_modularui/index.js +0 -11
- package/src/redux/_modularui/types.js +0 -121
- package/src/redux/_modularui/withModularUI.js +0 -85
- package/src/redux/_router/RouterActions.js +0 -75
- package/src/redux/_router/RouterConnectors.js +0 -97
- package/src/redux/_router/RouterMiddleware.js +0 -37
- package/src/redux/_router/RouterReducer.js +0 -21
- package/src/redux/_router/__tests__/actions.spec.js +0 -109
- package/src/redux/_router/__tests__/hooks.spec.js +0 -98
- package/src/redux/_router/__tests__/middleware.spec.js +0 -62
- package/src/redux/_router/__tests__/reducer.spec.js +0 -26
- package/src/redux/_router/index.js +0 -8
- package/src/redux/_router/types.js +0 -43
- package/src/redux/actions/Application.js +0 -45
- package/src/redux/actions/Authorization.js +0 -65
- package/src/redux/actions/Error.js +0 -95
- package/src/redux/actions/Form.js +0 -42
- package/src/redux/actions/FormAttributeSet.js +0 -98
- package/src/redux/actions/FormAttributeSetRepeatable.js +0 -45
- package/src/redux/actions/FormAutosave.js +0 -73
- package/src/redux/actions/FormAutosubmit.js +0 -43
- package/src/redux/actions/FormAutoupdate.js +0 -47
- package/src/redux/actions/FormValidations.js +0 -71
- package/src/redux/actions/Modals.js +0 -16
- package/src/redux/actions/ModelCatalog.js +0 -12
- package/src/redux/actions/Notification.js +0 -101
- package/src/redux/actions/Preferences.js +0 -173
- package/src/redux/actions/ProgressIndicator.js +0 -39
- package/src/redux/actions/SignIn.js +0 -102
- package/src/redux/actions/SignOut.js +0 -29
- package/src/redux/actions/__tests__/Application.spec.js +0 -52
- package/src/redux/actions/__tests__/Authorization.spec.js +0 -121
- package/src/redux/actions/__tests__/CustomErrorResponseHandler.spec.js +0 -72
- package/src/redux/actions/__tests__/Error-server.spec.js +0 -134
- package/src/redux/actions/__tests__/Error.spec.js +0 -116
- package/src/redux/actions/__tests__/Form.spec.js +0 -39
- package/src/redux/actions/__tests__/Modals.spec.js +0 -34
- package/src/redux/actions/__tests__/Notification.spec.js +0 -94
- package/src/redux/actions/__tests__/Preferences.spec.js +0 -71
- package/src/redux/actions/__tests__/ProgressIndicator.spec.js +0 -53
- package/src/redux/actions/index.js +0 -17
- package/src/redux/connectors/Application.js +0 -14
- package/src/redux/connectors/Breadcrumb.js +0 -28
- package/src/redux/connectors/CaseView.js +0 -14
- package/src/redux/connectors/ConceptDetail.js +0 -12
- package/src/redux/connectors/ContentBrowser.js +0 -14
- package/src/redux/connectors/ContentDetail.js +0 -13
- package/src/redux/connectors/ContentDetailSection.js +0 -17
- package/src/redux/connectors/Form.js +0 -83
- package/src/redux/connectors/FormAttributeSet.js +0 -85
- package/src/redux/connectors/ListDetail.js +0 -16
- package/src/redux/connectors/Modal.js +0 -47
- package/src/redux/connectors/ModelCatalog.js +0 -14
- package/src/redux/connectors/Notification.js +0 -47
- package/src/redux/connectors/PanelRenderer.js +0 -29
- package/src/redux/connectors/Preferences.js +0 -53
- package/src/redux/connectors/Progress.js +0 -35
- package/src/redux/connectors/ProgressIndicator.js +0 -35
- package/src/redux/connectors/QuickSearch.js +0 -36
- package/src/redux/connectors/SignIn.js +0 -47
- package/src/redux/connectors/SignOut.js +0 -38
- package/src/redux/connectors/Tab.js +0 -14
- package/src/redux/connectors/index.js +0 -22
- package/src/redux/index.js +0 -27
- package/src/redux/reducers/AuthReducer.js +0 -56
- package/src/redux/reducers/ErrorReducer.js +0 -22
- package/src/redux/reducers/ModalsReducer.js +0 -58
- package/src/redux/reducers/ModelCatalogReducer.js +0 -34
- package/src/redux/reducers/NotificationReducer.js +0 -45
- package/src/redux/reducers/PreferencesReducer.js +0 -31
- package/src/redux/reducers/ProgressIndicatorReducer.js +0 -60
- package/src/redux/reducers/__tests__/AuthReducer.spec.js +0 -95
- package/src/redux/reducers/__tests__/ErrorReducer.spec.js +0 -17
- package/src/redux/reducers/__tests__/ModalsReducer.spec.js +0 -34
- package/src/redux/reducers/__tests__/ModelCatalogReducer.spec.js +0 -23
- package/src/redux/reducers/__tests__/NotificationReducer.spec.js +0 -53
- package/src/redux/reducers/__tests__/PreferencesReducer.spec.js +0 -31
- package/src/redux/reducers/__tests__/ProgressIndicatorReducer.spec.js +0 -82
- package/src/redux/reducers/createReducer.js +0 -55
- package/src/redux/reducers/index.js +0 -10
- package/src/redux/selectors/i18n.js +0 -15
- package/src/redux/selectors/index.js +0 -3
- package/src/redux/selectors/modelcatalog.js +0 -11
- package/src/redux/store/__tests__/beforeRenderHooks.spec.js +0 -13
- package/src/redux/store/beforeRenderHooks.js +0 -26
- package/src/redux/store/configureStore.js +0 -59
- package/src/redux/types.js +0 -241
- package/src/utils/browser/Cache.js +0 -157
- package/src/utils/browser/Cookies.js +0 -44
- package/src/utils/browser/__tests__/Cookies.spec.js +0 -51
- package/src/utils/datetime/DateTimeUtil.js +0 -858
- package/src/utils/datetime/__tests__/DateTime.spec.js +0 -873
- package/src/utils/datetime/__tests__/DateTimeFormat.spec.js +0 -146
- package/src/utils/fetch/__mocks__/applicationContributions.json +0 -323
- package/src/utils/fetch/__mocks__/applicationData.json +0 -216
- package/src/utils/fetch/__mocks__/formContributions.json +0 -527
- package/src/utils/fetch/__mocks__/formData.json +0 -21
- package/src/utils/fetch/__mocks__/universalFetch.js +0 -38
- package/src/utils/fetch/__tests__/xhr.spec.js +0 -281
- package/src/utils/fetch/serverFetch.js +0 -33
- package/src/utils/fetch/types.js +0 -46
- package/src/utils/fetch/universalFetch.js +0 -106
- package/src/utils/fetch/xhr.js +0 -409
- package/src/utils/helpers/__tests__/checkResource.spec.js +0 -60
- package/src/utils/helpers/__tests__/createHash.spec.js +0 -11
- package/src/utils/helpers/__tests__/createHref.spec.js +0 -39
- package/src/utils/helpers/__tests__/objects.spec.js +0 -50
- package/src/utils/helpers/__tests__/sanitizeHTML.spec.js +0 -69
- package/src/utils/helpers/checkResource.js +0 -43
- package/src/utils/helpers/createHash.js +0 -28
- package/src/utils/helpers/createHref.js +0 -117
- package/src/utils/helpers/createUUID.js +0 -13
- package/src/utils/helpers/index.js +0 -9
- package/src/utils/helpers/objects.js +0 -33
- package/src/utils/helpers/repositoryResource.js +0 -22
- package/src/utils/helpers/sanitizeHtml.js +0 -55
- package/src/utils/helpers/text.js +0 -23
- package/src/utils/index.js +0 -22
- package/src/utils/number/DecimalFormat.js +0 -410
- package/src/utils/number/__tests__/formatValue.spec.js +0 -36
- package/src/utils/number/__tests__/parseNumbers.spec.js +0 -50
- package/src/utils/number/formatValue.js +0 -60
- package/src/utils/number/parseNumbers.js +0 -94
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseHas.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKey.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isFunction.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_coreJsData.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isMasked.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toSource.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsNative.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getValue.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getNative.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeCreate.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashClear.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashDelete.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashGet.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashHas.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashSet.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Hash.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/eq.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_ListCache.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Map.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKeyable.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getMapData.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_memoizeCapped.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stringToPath.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseToString.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toString.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_castPath.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsArguments.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArguments.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIndex.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isLength.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toKey.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hasPath.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/has.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_overArg.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getPrototype.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isPlainObject.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayPush.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isFlattenable.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseFlatten.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/flattenDeep.js","../../src/modularui/index.ts","../../src/constants/Constants.ts","../../src/exceptions/UnauthorizedException.ts","../../src/constants/Paths.ts","../../src/settings/Settings.ts","../../src/exceptions/IllegalStateException.ts","../../src/settings/Paths.ts","../../src/utils/fetch/universalFetch.ts","../../src/utils/storage/Cache.ts","../../src/exceptions/FetchException.ts","../../src/utils/fetch/graalFetch.ts","../../src/utils/fetch/xhr.ts","../../src/exceptions/IllegalArgumentException.ts","../../src/exceptions/JsonParseException.ts","../../src/exceptions/NetworkException.ts","../../src/exceptions/NotFoundException.ts","../../src/exceptions/TimeoutException.ts","../../src/modularui/Authenticate.ts","../../src/modularui/CaptchaRequest.ts","../../src/modularui/ModularUIError.ts","../../src/modularui/ModularUIRequest.ts","../../src/layouthints/LayoutHintProcessor.ts","../../src/layouthints/LayoutHintConfig.ts","../../src/layouthints/LayoutHints.ts","../../src/modularui/ModularUIResponse.ts","../../src/models/base/BaseCollection.ts","../../src/models/base/BaseModel.ts","../../src/models/layouthint/LayoutHintCollection.ts","../../src/models/href/Href.ts","../../src/models/parameter/Parameter.ts","../../src/models/parameter/ParameterCollection.ts","../../src/utils/datetime/DateTimeUtil.ts","../../src/utils/storage/Cookies.ts","../../src/models/process/ProcessStatusSettingsModel.ts","../../src/models/links/LinkModel.ts","../../src/models/links/normalizeLinkJSON.ts","../../src/models/links/LinkCollection.ts","../../src/models/base/ResourceModel.ts","../../src/models/attributes/AttributeFactory.ts","../../src/models/contentconfiguration/ContentConfigurationElements.ts","../../src/models/base/ResourceCollection.ts","../../src/models/concepts/ConceptTypeDetailModel.ts","../../src/models/concepts/ConceptLinkModel.ts","../../src/models/concepts/ConceptRelationModel.ts","../../src/models/concepts/ConceptRelationCollection.ts","../../src/utils/helpers/createHash.ts","../../src/models/content/ContentTypeModel.ts","../../src/models/content/ContentLinkModel.ts","../../src/models/concepts/SourceReferenceModel.ts","../../src/models/concepts/SourceReferenceCollection.ts","../../src/models/concepts/ConceptDetailModel.ts","../../src/models/error/ErrorModel.ts","../../src/models/error/ErrorCollection.ts","../../src/models/attributes/AttributeContent.ts","../../src/utils/helpers/text.ts","../../src/models/content/SubSectionModel.ts","../../src/models/content/SectionModel.ts","../../src/models/attributes/input-constraints/GenericConstraintModel.ts","../../src/models/attributes/input-constraints/ConstraintCollection.ts","../../src/models/attributes/input-constraints/MandatoryConstraint.ts","../../src/models/attributes/input-constraints/StringLengthConstraint.ts","../../src/models/attributes/BaseAttributeModel.ts","../../src/models/list/ListHeaderModel.ts","../../src/models/attributes/AttributeCollection.ts","../../src/exceptions/ConfigurationException.ts","../../src/models/attributes/CompositeAttributeChildCollection.ts","../../src/models/attributes/CompositeAttributeModel.ts","../../src/models/attributes/ChoiceAttributeOptionModel.ts","../../src/models/attributes/ChoiceAttributeOptionCollection.ts","../../src/models/attributes/ChoiceAttributeModel.ts","../../src/models/attributes/BooleanAttributeModel.ts","../../src/models/attributes/CaptchaAttributeModel.ts","../../src/models/attributes/input-constraints/DateBoundaryConstraint.ts","../../src/models/attributes/input-constraints/DateTimeDateFormatConstraint.ts","../../src/models/attributes/input-constraints/DatetimeFormatConstraint.ts","../../src/models/attributes/input-constraints/DateTimeTimeFormatConstraint.ts","../../src/models/attributes/DatetimeAttributeModel.ts","../../src/models/attributes/HelptextAttributeModel.ts","../../src/models/attributes/LabelAttributeModel.ts","../../src/models/attributes/layouthint-rules/BaseLayoutHintRule.ts","../../src/models/attributes/layouthint-rules/DependentAttribute.ts","../../src/models/attributes/input-constraints/FileExtensionConstraint.ts","../../src/models/attributes/input-constraints/FileSizeConstraint.ts","../../src/models/attributes/UploadAttributeModel.ts","../../src/models/attributes/layouthint-rules/RemainingTotalUploadSize.ts","../../src/models/attributes/layouthint-rules/LayoutHintRuleCollection.ts","../../src/models/attributes/input-constraints/BSNConstraint.ts","../../src/models/attributes/input-constraints/IBANConstraint.ts","../../src/models/attributes/input-constraints/RegexConstraint.ts","../../src/models/attributes/StringAttributeModel.ts","../../src/models/attributes/MemoAttributeModel.ts","../../src/models/attributes/NumberAttributeModel.ts","../../src/utils/number/NumberUtil.ts","../../src/utils/number/DecimalFormat.ts","../../src/models/attributes/input-constraints/NumberBoundaryConstraint.ts","../../src/models/attributes/input-constraints/NumberFormatConstraint.ts","../../src/models/attributes/input-constraints/NumberGroupingConstraint.ts","../../src/models/attributes/MoneyAttributeModel.ts","../../src/models/attributes/input-constraints/PasswordConfirmConstraint.ts","../../src/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.ts","../../src/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.ts","../../src/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.ts","../../src/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.ts","../../src/models/attributes/PasswordAttributeModel.ts","../../src/models/attributes/input-constraints/XMLConstraint.ts","../../src/models/attributes/XMLAttributeModel.ts","../../src/models/attributes/input-constraints/MandatoryRangeConstraint.ts","../../src/models/attributes/input-constraints/RangeConstraint.ts","../../src/models/attributes/RangeAttributeModel.ts","../../src/models/filters/BaseFilterModel.ts","../../src/models/filters/AssignmentFilterModel.ts","../../src/models/filters/ConceptIndexFilterModel.ts","../../src/models/filters/RangeFilterModel.ts","../../src/models/filters/StringFilterModel.ts","../../src/models/filters/FilterFactory.ts","../../src/models/filters/FilterCollection.ts","../../src/models/content/ContentModel.ts","../../src/models/error/ErrorResponse.ts","../../src/models/form/FormModel.ts","../../src/models/attributes/AttributeSetModel.ts","../../src/models/form/FormObjectModel.ts","../../src/models/contentconfiguration/ContentConfiguration.ts","../../src/models/contentconfiguration/ContentConfigurationResults.ts","../../src/models/contentconfiguration/ContentConfigurationEndResults.ts","../../src/models/contentconfiguration/ContentConfigurationQuestions.ts","../../src/models/resolveModel.ts","../../src/exceptions/NotAllowedUriException.ts","../../src/models/user/UserModel.ts","../../src/models/user/UserServicesModel.ts","../../src/models/application/ApplicationModel.ts","../../src/models/actions/ActionModel.ts","../../src/models/actions/ActionCollection.ts","../../src/models/detail/DetailModel.ts","../../src/models/taskgroup/TaskGroupCollection.ts","../../src/models/taskgroup/TaskGroupModel.ts","../../src/models/caseview/CaseViewModel.ts","../../src/models/concepts/ConceptLinkCollection.ts","../../src/models/concepts/ConceptIndexModel.ts","../../src/models/content/ContentLinkCollection.ts","../../src/models/content/ContentIndexModel.ts","../../src/models/content/ContentTOCModel.ts","../../src/models/list/detail/ListDetailModel.ts","../../src/models/list/grouping/GroupingModel.ts","../../src/models/list/ListHref.ts","../../src/models/list/ListItemModel.ts","../../src/models/list/ListItemCollection.ts","../../src/models/list/paging/PagingModel.ts","../../src/models/list/paging/PagesizeModel.ts","../../src/models/list/sorting/SortOptionModel.ts","../../src/models/list/sorting/SortingModel.ts","../../src/models/list/ListModel.ts","../../src/models/lookup/LookupOptionCollection.ts","../../src/models/lookup/LookupOptionsModel.ts","../../src/models/modelcatalog/ModelCategoryModel.ts","../../src/models/modelcatalog/ModelCategoryCollection.ts","../../src/models/modelcatalog/ModelCatalogModel.ts","../../src/models/panels/GroupingPanelModel.ts","../../src/models/search/CaseSearchModel.ts","../../src/models/tab/TabModel.ts","../../src/models/user/UserProfileModel.ts"],"sourcesContent":["/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseHas = require('./_baseHas'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","/**\n * @license\n * Lodash <https://lodash.com/>\n * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n 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',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** 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/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n 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 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '<p>' + func(text) + '</p>';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '<p>fred, barney, & pebbles</p>'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('<body>');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<b><%- value %></b>');\n * compiled({ 'value': '<script>' });\n * // => '<b><script></b>'\n *\n * // Use the \"evaluate\" delimiter to execute JavaScript and generate HTML.\n * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');\n * compiled({ 'users': ['fred', 'barney'] });\n * // => '<li>fred</li><li>barney</li>'\n *\n * // Use the internal `print` function in \"evaluate\" delimiters.\n * var compiled = _.template('<% print(\"hello \" + user); %>!');\n * compiled({ 'user': 'barney' });\n * // => 'hello barney!'\n *\n * // Use the ES template literal delimiter as an \"interpolate\" delimiter.\n * // Disable support by replacing the \"interpolate\" delimiter.\n * var compiled = _.template('hello ${ user }!');\n * compiled({ 'user': 'pebbles' });\n * // => 'hello pebbles!'\n *\n * // Use backslashes to treat delimiters as plain text.\n * var compiled = _.template('<%= \"\\\\<%- value %\\\\>\" %>');\n * compiled({ 'value': 'ignored' });\n * // => '<%- value %>'\n *\n * // Use the `imports` option to import `jQuery` as `jq`.\n * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';\n * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });\n * compiled({ 'users': ['fred', 'barney'] });\n * // => '<li>fred</li><li>barney</li>'\n *\n * // Use the `sourceURL` option to specify a custom sourceURL for the template.\n * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });\n * compiled(data);\n * // => Find the source of \"greeting.jst\" under the Sources tab or Resources panel of the web inspector.\n *\n * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.\n * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });\n * compiled.source;\n * // => function(data) {\n * // var __t, __p = '';\n * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';\n * // return __p;\n * // }\n *\n * // Use custom template delimiters.\n * _.templateSettings.interpolate = /{{([\\s\\S]+?)}}/g;\n * var compiled = _.template('hello {{ user }}!');\n * compiled({ 'user': 'mustache' });\n * // => 'hello mustache!'\n *\n * // Use the `source` property to inline compiled templates for meaningful\n * // line numbers in error messages and stack traces.\n * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\\\n * var JST = {\\\n * \"main\": ' + _.template(mainText).source + '\\\n * };\\\n * ');\n */\n function template(string, options, guard) {\n // Based on John Resig's `tmpl` implementation\n // (http://ejohn.org/blog/javascript-micro-templating/)\n // and Laura Doktorova's doT.js (https://github.com/olado/doT).\n var settings = lodash.templateSettings;\n\n if (guard && isIterateeCall(string, options, guard)) {\n options = undefined;\n }\n string = toString(string);\n options = assignInWith({}, options, settings, customDefaultsAssignIn);\n\n var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),\n importsKeys = keys(imports),\n importsValues = baseValues(imports, importsKeys);\n\n var isEscaping,\n isEvaluating,\n index = 0,\n interpolate = options.interpolate || reNoMatch,\n source = \"__p += '\";\n\n // Compile the regexp to match each delimiter.\n var reDelimiters = RegExp(\n (options.escape || reNoMatch).source + '|' +\n interpolate.source + '|' +\n (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +\n (options.evaluate || reNoMatch).source + '|$'\n , 'g');\n\n // Use a sourceURL for easier debugging.\n // The sourceURL gets injected into the source that's eval-ed, so be careful\n // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in\n // and escape the comment, thus injecting code that gets evaled.\n var sourceURL = '//# sourceURL=' +\n (hasOwnProperty.call(options, 'sourceURL')\n ? (options.sourceURL + '').replace(/\\s/g, ' ')\n : ('lodash.templateSources[' + (++templateCounter) + ']')\n ) + '\\n';\n\n string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {\n interpolateValue || (interpolateValue = esTemplateValue);\n\n // Escape characters that can't be included in string literals.\n source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);\n\n // Replace delimiters with snippets.\n if (escapeValue) {\n isEscaping = true;\n source += \"' +\\n__e(\" + escapeValue + \") +\\n'\";\n }\n if (evaluateValue) {\n isEvaluating = true;\n source += \"';\\n\" + evaluateValue + \";\\n__p += '\";\n }\n if (interpolateValue) {\n source += \"' +\\n((__t = (\" + interpolateValue + \")) == null ? '' : __t) +\\n'\";\n }\n index = offset + match.length;\n\n // The JS engine embedded in Adobe products needs `match` returned in\n // order to produce the correct `offset` value.\n return match;\n });\n\n source += \"';\\n\";\n\n // If `variable` is not specified wrap a with-statement around the generated\n // code to add the data object to the top of the scope chain.\n var variable = hasOwnProperty.call(options, 'variable') && options.variable;\n if (!variable) {\n source = 'with (obj) {\\n' + source + '\\n}\\n';\n }\n // Throw an error if a forbidden character was found in `variable`, to prevent\n // potential command injection attacks.\n else if (reForbiddenIdentifierChars.test(variable)) {\n throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);\n }\n\n // Cleanup code by stripping empty strings.\n source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)\n .replace(reEmptyStringMiddle, '$1')\n .replace(reEmptyStringTrailing, '$1;');\n\n // Frame code as the function body.\n source = 'function(' + (variable || 'obj') + ') {\\n' +\n (variable\n ? ''\n : 'obj || (obj = {});\\n'\n ) +\n \"var __t, __p = ''\" +\n (isEscaping\n ? ', __e = _.escape'\n : ''\n ) +\n (isEvaluating\n ? ', __j = Array.prototype.join;\\n' +\n \"function print() { __p += __j.call(arguments, '') }\\n\"\n : ';\\n'\n ) +\n source +\n 'return __p\\n}';\n\n var result = attempt(function() {\n return Function(importsKeys, sourceURL + 'return ' + source)\n .apply(undefined, importsValues);\n });\n\n // Provide the compiled function's source by its `toString` method or\n // the `source` property as a convenience for inlining compiled templates.\n result.source = source;\n if (isError(result)) {\n throw result;\n }\n return result;\n }\n\n /**\n * Converts `string`, as a whole, to lower case just like\n * [String#toLowerCase](https://mdn.io/toLowerCase).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.toLower('--Foo-Bar--');\n * // => '--foo-bar--'\n *\n * _.toLower('fooBar');\n * // => 'foobar'\n *\n * _.toLower('__FOO_BAR__');\n * // => '__foo_bar__'\n */\n function toLower(value) {\n return toString(value).toLowerCase();\n }\n\n /**\n * Converts `string`, as a whole, to upper case just like\n * [String#toUpperCase](https://mdn.io/toUpperCase).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the upper cased string.\n * @example\n *\n * _.toUpper('--foo-bar--');\n * // => '--FOO-BAR--'\n *\n * _.toUpper('fooBar');\n * // => 'FOOBAR'\n *\n * _.toUpper('__foo_bar__');\n * // => '__FOO_BAR__'\n */\n function toUpper(value) {\n return toString(value).toUpperCase();\n }\n\n /**\n * Removes leading and trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trim(' abc ');\n * // => 'abc'\n *\n * _.trim('-_-abc-_-', '_-');\n * // => 'abc'\n *\n * _.map([' foo ', ' bar '], _.trim);\n * // => ['foo', 'bar']\n */\n function trim(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return baseTrim(string);\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n chrSymbols = stringToArray(chars),\n start = charsStartIndex(strSymbols, chrSymbols),\n end = charsEndIndex(strSymbols, chrSymbols) + 1;\n\n return castSlice(strSymbols, start, end).join('');\n }\n\n /**\n * Removes trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trimEnd(' abc ');\n * // => ' abc'\n *\n * _.trimEnd('-_-abc-_-', '_-');\n * // => '-_-abc'\n */\n function trimEnd(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.slice(0, trimmedEndIndex(string) + 1);\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;\n\n return castSlice(strSymbols, 0, end).join('');\n }\n\n /**\n * Removes leading whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trimStart(' abc ');\n * // => 'abc '\n *\n * _.trimStart('-_-abc-_-', '_-');\n * // => 'abc-_-'\n */\n function trimStart(string, chars, guard) {\n string = toString(string);\n if (string && (guard || chars === undefined)) {\n return string.replace(reTrimStart, '');\n }\n if (!string || !(chars = baseToString(chars))) {\n return string;\n }\n var strSymbols = stringToArray(string),\n start = charsStartIndex(strSymbols, stringToArray(chars));\n\n return castSlice(strSymbols, start).join('');\n }\n\n /**\n * Truncates `string` if it's longer than the given maximum string length.\n * The last characters of the truncated string are replaced with the omission\n * string which defaults to \"...\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to truncate.\n * @param {Object} [options={}] The options object.\n * @param {number} [options.length=30] The maximum string length.\n * @param {string} [options.omission='...'] The string to indicate text is omitted.\n * @param {RegExp|string} [options.separator] The separator pattern to truncate to.\n * @returns {string} Returns the truncated string.\n * @example\n *\n * _.truncate('hi-diddly-ho there, neighborino');\n * // => 'hi-diddly-ho there, neighbo...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'length': 24,\n * 'separator': ' '\n * });\n * // => 'hi-diddly-ho there,...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'length': 24,\n * 'separator': /,? +/\n * });\n * // => 'hi-diddly-ho there...'\n *\n * _.truncate('hi-diddly-ho there, neighborino', {\n * 'omission': ' [...]'\n * });\n * // => 'hi-diddly-ho there, neig [...]'\n */\n function truncate(string, options) {\n var length = DEFAULT_TRUNC_LENGTH,\n omission = DEFAULT_TRUNC_OMISSION;\n\n if (isObject(options)) {\n var separator = 'separator' in options ? options.separator : separator;\n length = 'length' in options ? toInteger(options.length) : length;\n omission = 'omission' in options ? baseToString(options.omission) : omission;\n }\n string = toString(string);\n\n var strLength = string.length;\n if (hasUnicode(string)) {\n var strSymbols = stringToArray(string);\n strLength = strSymbols.length;\n }\n if (length >= strLength) {\n return string;\n }\n var end = length - stringSize(omission);\n if (end < 1) {\n return omission;\n }\n var result = strSymbols\n ? castSlice(strSymbols, 0, end).join('')\n : string.slice(0, end);\n\n if (separator === undefined) {\n return result + omission;\n }\n if (strSymbols) {\n end += (result.length - end);\n }\n if (isRegExp(separator)) {\n if (string.slice(end).search(separator)) {\n var match,\n substring = result;\n\n if (!separator.global) {\n separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');\n }\n separator.lastIndex = 0;\n while ((match = separator.exec(substring))) {\n var newEnd = match.index;\n }\n result = result.slice(0, newEnd === undefined ? end : newEnd);\n }\n } else if (string.indexOf(baseToString(separator), end) != end) {\n var index = result.lastIndexOf(separator);\n if (index > -1) {\n result = result.slice(0, index);\n }\n }\n return result + omission;\n }\n\n /**\n * The inverse of `_.escape`; this method converts the HTML entities\n * `&`, `<`, `>`, `"`, and `'` in `string` to\n * their corresponding characters.\n *\n * **Note:** No other HTML entities are unescaped. To unescape additional\n * HTML entities use a third-party library like [_he_](https://mths.be/he).\n *\n * @static\n * @memberOf _\n * @since 0.6.0\n * @category String\n * @param {string} [string=''] The string to unescape.\n * @returns {string} Returns the unescaped string.\n * @example\n *\n * _.unescape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function unescape(string) {\n string = toString(string);\n return (string && reHasEscapedHtml.test(string))\n ? string.replace(reEscapedHtml, unescapeHtmlChar)\n : string;\n }\n\n /**\n * Converts `string`, as space separated words, to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the upper cased string.\n * @example\n *\n * _.upperCase('--foo-bar');\n * // => 'FOO BAR'\n *\n * _.upperCase('fooBar');\n * // => 'FOO BAR'\n *\n * _.upperCase('__foo_bar__');\n * // => 'FOO BAR'\n */\n var upperCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toUpperCase();\n });\n\n /**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\n var upperFirst = createCaseFirst('toUpperCase');\n\n /**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\n function words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Attempts to invoke `func`, returning either the result or the caught error\n * object. Any additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Function} func The function to attempt.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {*} Returns the `func` result or error object.\n * @example\n *\n * // Avoid throwing errors for invalid selectors.\n * var elements = _.attempt(function(selector) {\n * return document.querySelectorAll(selector);\n * }, '>_>');\n *\n * if (_.isError(elements)) {\n * elements = [];\n * }\n */\n var attempt = baseRest(function(func, args) {\n try {\n return apply(func, undefined, args);\n } catch (e) {\n return isError(e) ? e : new Error(e);\n }\n });\n\n /**\n * Binds methods of an object to the object itself, overwriting the existing\n * method.\n *\n * **Note:** This method doesn't set the \"length\" property of bound functions.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Object} object The object to bind and assign the bound methods to.\n * @param {...(string|string[])} methodNames The object method names to bind.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var view = {\n * 'label': 'docs',\n * 'click': function() {\n * console.log('clicked ' + this.label);\n * }\n * };\n *\n * _.bindAll(view, ['click']);\n * jQuery(element).on('click', view.click);\n * // => Logs 'clicked docs' when clicked.\n */\n var bindAll = flatRest(function(object, methodNames) {\n arrayEach(methodNames, function(key) {\n key = toKey(key);\n baseAssignValue(object, key, bind(object[key], object));\n });\n return object;\n });\n\n /**\n * Creates a function that iterates over `pairs` and invokes the corresponding\n * function of the first predicate to return truthy. The predicate-function\n * pairs are invoked with the `this` binding and arguments of the created\n * function.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Array} pairs The predicate-function pairs.\n * @returns {Function} Returns the new composite function.\n * @example\n *\n * var func = _.cond([\n * [_.matches({ 'a': 1 }), _.constant('matches A')],\n * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],\n * [_.stubTrue, _.constant('no match')]\n * ]);\n *\n * func({ 'a': 1, 'b': 2 });\n * // => 'matches A'\n *\n * func({ 'a': 0, 'b': 1 });\n * // => 'matches B'\n *\n * func({ 'a': '1', 'b': '2' });\n * // => 'no match'\n */\n function cond(pairs) {\n var length = pairs == null ? 0 : pairs.length,\n toIteratee = getIteratee();\n\n pairs = !length ? [] : arrayMap(pairs, function(pair) {\n if (typeof pair[1] != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return [toIteratee(pair[0]), pair[1]];\n });\n\n return baseRest(function(args) {\n var index = -1;\n while (++index < length) {\n var pair = pairs[index];\n if (apply(pair[0], this, args)) {\n return apply(pair[1], this, args);\n }\n }\n });\n }\n\n /**\n * Creates a function that invokes the predicate properties of `source` with\n * the corresponding property values of a given object, returning `true` if\n * all predicates return truthy, else `false`.\n *\n * **Note:** The created function is equivalent to `_.conformsTo` with\n * `source` partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 2, 'b': 1 },\n * { 'a': 1, 'b': 2 }\n * ];\n *\n * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));\n * // => [{ 'a': 1, 'b': 2 }]\n */\n function conforms(source) {\n return baseConforms(baseClone(source, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\n function constant(value) {\n return function() {\n return value;\n };\n }\n\n /**\n * Checks `value` to determine whether a default value should be returned in\n * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,\n * or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Util\n * @param {*} value The value to check.\n * @param {*} defaultValue The default value.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * _.defaultTo(1, 10);\n * // => 1\n *\n * _.defaultTo(undefined, 10);\n * // => 10\n */\n function defaultTo(value, defaultValue) {\n return (value == null || value !== value) ? defaultValue : value;\n }\n\n /**\n * Creates a function that returns the result of invoking the given functions\n * with the `this` binding of the created function, where each successive\n * invocation is supplied the return value of the previous.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flowRight\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flow([_.add, square]);\n * addSquare(1, 2);\n * // => 9\n */\n var flow = createFlow();\n\n /**\n * This method is like `_.flow` except that it creates a function that\n * invokes the given functions from right to left.\n *\n * @static\n * @since 3.0.0\n * @memberOf _\n * @category Util\n * @param {...(Function|Function[])} [funcs] The functions to invoke.\n * @returns {Function} Returns the new composite function.\n * @see _.flow\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var addSquare = _.flowRight([square, _.add]);\n * addSquare(1, 2);\n * // => 9\n */\n var flowRight = createFlow(true);\n\n /**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\n function identity(value) {\n return value;\n }\n\n /**\n * Creates a function that invokes `func` with the arguments of the created\n * function. If `func` is a property name, the created function returns the\n * property value for a given element. If `func` is an array or object, the\n * created function returns `true` for elements that contain the equivalent\n * source properties, otherwise it returns `false`.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Util\n * @param {*} [func=_.identity] The value to convert to a callback.\n * @returns {Function} Returns the callback.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));\n * // => [{ 'user': 'barney', 'age': 36, 'active': true }]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, _.iteratee(['user', 'fred']));\n * // => [{ 'user': 'fred', 'age': 40 }]\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, _.iteratee('user'));\n * // => ['barney', 'fred']\n *\n * // Create custom iteratee shorthands.\n * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {\n * return !_.isRegExp(func) ? iteratee(func) : function(string) {\n * return func.test(string);\n * };\n * });\n *\n * _.filter(['abc', 'def'], /ef/);\n * // => ['def']\n */\n function iteratee(func) {\n return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that performs a partial deep comparison between a given\n * object and `source`, returning `true` if the given object has equivalent\n * property values, else `false`.\n *\n * **Note:** The created function is equivalent to `_.isMatch` with `source`\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * **Note:** Multiple values can be checked by combining several matchers\n * using `_.overSome`\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));\n * // => [{ 'a': 4, 'b': 5, 'c': 6 }]\n *\n * // Checking for several possible values\n * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));\n * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]\n */\n function matches(source) {\n return baseMatches(baseClone(source, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that performs a partial deep comparison between the\n * value at `path` of a given object to `srcValue`, returning `true` if the\n * object value is equivalent, else `false`.\n *\n * **Note:** Partial comparisons will match empty array and empty object\n * `srcValue` values against any array or object value, respectively. See\n * `_.isEqual` for a list of supported value comparisons.\n *\n * **Note:** Multiple values can be checked by combining several matchers\n * using `_.overSome`\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n * @example\n *\n * var objects = [\n * { 'a': 1, 'b': 2, 'c': 3 },\n * { 'a': 4, 'b': 5, 'c': 6 }\n * ];\n *\n * _.find(objects, _.matchesProperty('a', 4));\n * // => { 'a': 4, 'b': 5, 'c': 6 }\n *\n * // Checking for several possible values\n * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));\n * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]\n */\n function matchesProperty(path, srcValue) {\n return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));\n }\n\n /**\n * Creates a function that invokes the method at `path` of a given object.\n * Any additional arguments are provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': _.constant(2) } },\n * { 'a': { 'b': _.constant(1) } }\n * ];\n *\n * _.map(objects, _.method('a.b'));\n * // => [2, 1]\n *\n * _.map(objects, _.method(['a', 'b']));\n * // => [2, 1]\n */\n var method = baseRest(function(path, args) {\n return function(object) {\n return baseInvoke(object, path, args);\n };\n });\n\n /**\n * The opposite of `_.method`; this method creates a function that invokes\n * the method at a given path of `object`. Any additional arguments are\n * provided to the invoked method.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Util\n * @param {Object} object The object to query.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {Function} Returns the new invoker function.\n * @example\n *\n * var array = _.times(3, _.constant),\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.methodOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.methodOf(object));\n * // => [2, 0]\n */\n var methodOf = baseRest(function(object, args) {\n return function(path) {\n return baseInvoke(object, path, args);\n };\n });\n\n /**\n * Adds all own enumerable string keyed function properties of a source\n * object to the destination object. If `object` is a function, then methods\n * are added to its prototype as well.\n *\n * **Note:** Use `_.runInContext` to create a pristine `lodash` function to\n * avoid conflicts caused by modifying the original.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {Function|Object} [object=lodash] The destination object.\n * @param {Object} source The object of functions to add.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.chain=true] Specify whether mixins are chainable.\n * @returns {Function|Object} Returns `object`.\n * @example\n *\n * function vowels(string) {\n * return _.filter(string, function(v) {\n * return /[aeiou]/i.test(v);\n * });\n * }\n *\n * _.mixin({ 'vowels': vowels });\n * _.vowels('fred');\n * // => ['e']\n *\n * _('fred').vowels().value();\n * // => ['e']\n *\n * _.mixin({ 'vowels': vowels }, { 'chain': false });\n * _('fred').vowels();\n * // => ['e']\n */\n function mixin(object, source, options) {\n var props = keys(source),\n methodNames = baseFunctions(source, props);\n\n if (options == null &&\n !(isObject(source) && (methodNames.length || !props.length))) {\n options = source;\n source = object;\n object = this;\n methodNames = baseFunctions(source, keys(source));\n }\n var chain = !(isObject(options) && 'chain' in options) || !!options.chain,\n isFunc = isFunction(object);\n\n arrayEach(methodNames, function(methodName) {\n var func = source[methodName];\n object[methodName] = func;\n if (isFunc) {\n object.prototype[methodName] = function() {\n var chainAll = this.__chain__;\n if (chain || chainAll) {\n var result = object(this.__wrapped__),\n actions = result.__actions__ = copyArray(this.__actions__);\n\n actions.push({ 'func': func, 'args': arguments, 'thisArg': object });\n result.__chain__ = chainAll;\n return result;\n }\n return func.apply(object, arrayPush([this.value()], arguments));\n };\n }\n });\n\n return object;\n }\n\n /**\n * Reverts the `_` variable to its previous value and returns a reference to\n * the `lodash` function.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @returns {Function} Returns the `lodash` function.\n * @example\n *\n * var lodash = _.noConflict();\n */\n function noConflict() {\n if (root._ === this) {\n root._ = oldDash;\n }\n return this;\n }\n\n /**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\n function noop() {\n // No operation performed.\n }\n\n /**\n * Creates a function that gets the argument at index `n`. If `n` is negative,\n * the nth argument from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [n=0] The index of the argument to return.\n * @returns {Function} Returns the new pass-thru function.\n * @example\n *\n * var func = _.nthArg(1);\n * func('a', 'b', 'c', 'd');\n * // => 'b'\n *\n * var func = _.nthArg(-2);\n * func('a', 'b', 'c', 'd');\n * // => 'c'\n */\n function nthArg(n) {\n n = toInteger(n);\n return baseRest(function(args) {\n return baseNth(args, n);\n });\n }\n\n /**\n * Creates a function that invokes `iteratees` with the arguments it receives\n * and returns their results.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to invoke.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.over([Math.max, Math.min]);\n *\n * func(1, 2, 3, 4);\n * // => [4, 1]\n */\n var over = createOver(arrayMap);\n\n /**\n * Creates a function that checks if **all** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * Following shorthands are possible for providing predicates.\n * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.\n * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overEvery([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => false\n *\n * func(NaN);\n * // => false\n */\n var overEvery = createOver(arrayEvery);\n\n /**\n * Creates a function that checks if **any** of the `predicates` return\n * truthy when invoked with the arguments it receives.\n *\n * Following shorthands are possible for providing predicates.\n * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.\n * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {...(Function|Function[])} [predicates=[_.identity]]\n * The predicates to check.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var func = _.overSome([Boolean, isFinite]);\n *\n * func('1');\n * // => true\n *\n * func(null);\n * // => true\n *\n * func(NaN);\n * // => false\n *\n * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])\n * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])\n */\n var overSome = createOver(arraySome);\n\n /**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\n function property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n }\n\n /**\n * The opposite of `_.property`; this method creates a function that returns\n * the value at a given path of `object`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Util\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var array = [0, 1, 2],\n * object = { 'a': array, 'b': array, 'c': array };\n *\n * _.map(['a[2]', 'c[0]'], _.propertyOf(object));\n * // => [2, 0]\n *\n * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));\n * // => [2, 0]\n */\n function propertyOf(object) {\n return function(path) {\n return object == null ? undefined : baseGet(object, path);\n };\n }\n\n /**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\n var range = createRange();\n\n /**\n * This method is like `_.range` except that it populates values in\n * descending order.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.range\n * @example\n *\n * _.rangeRight(4);\n * // => [3, 2, 1, 0]\n *\n * _.rangeRight(-4);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 5);\n * // => [4, 3, 2, 1]\n *\n * _.rangeRight(0, 20, 5);\n * // => [15, 10, 5, 0]\n *\n * _.rangeRight(0, -4, -1);\n * // => [-3, -2, -1, 0]\n *\n * _.rangeRight(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.rangeRight(0);\n * // => []\n */\n var rangeRight = createRange(true);\n\n /**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\n function stubArray() {\n return [];\n }\n\n /**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\n function stubFalse() {\n return false;\n }\n\n /**\n * This method returns a new empty object.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Object} Returns the new empty object.\n * @example\n *\n * var objects = _.times(2, _.stubObject);\n *\n * console.log(objects);\n * // => [{}, {}]\n *\n * console.log(objects[0] === objects[1]);\n * // => false\n */\n function stubObject() {\n return {};\n }\n\n /**\n * This method returns an empty string.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {string} Returns the empty string.\n * @example\n *\n * _.times(2, _.stubString);\n * // => ['', '']\n */\n function stubString() {\n return '';\n }\n\n /**\n * This method returns `true`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `true`.\n * @example\n *\n * _.times(2, _.stubTrue);\n * // => [true, true]\n */\n function stubTrue() {\n return true;\n }\n\n /**\n * Invokes the iteratee `n` times, returning an array of the results of\n * each invocation. The iteratee is invoked with one argument; (index).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.times(3, String);\n * // => ['0', '1', '2']\n *\n * _.times(4, _.constant(0));\n * // => [0, 0, 0, 0]\n */\n function times(n, iteratee) {\n n = toInteger(n);\n if (n < 1 || n > MAX_SAFE_INTEGER) {\n return [];\n }\n var index = MAX_ARRAY_LENGTH,\n length = nativeMin(n, MAX_ARRAY_LENGTH);\n\n iteratee = getIteratee(iteratee);\n n -= MAX_ARRAY_LENGTH;\n\n var result = baseTimes(length, iteratee);\n while (++index < n) {\n iteratee(index);\n }\n return result;\n }\n\n /**\n * Converts `value` to a property path array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {*} value The value to convert.\n * @returns {Array} Returns the new property path array.\n * @example\n *\n * _.toPath('a.b.c');\n * // => ['a', 'b', 'c']\n *\n * _.toPath('a[0].b.c');\n * // => ['a', '0', 'b', 'c']\n */\n function toPath(value) {\n if (isArray(value)) {\n return arrayMap(value, toKey);\n }\n return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));\n }\n\n /**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\n function uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Adds two numbers.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {number} augend The first number in an addition.\n * @param {number} addend The second number in an addition.\n * @returns {number} Returns the total.\n * @example\n *\n * _.add(6, 4);\n * // => 10\n */\n var add = createMathOperation(function(augend, addend) {\n return augend + addend;\n }, 0);\n\n /**\n * Computes `number` rounded up to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round up.\n * @param {number} [precision=0] The precision to round up to.\n * @returns {number} Returns the rounded up number.\n * @example\n *\n * _.ceil(4.006);\n * // => 5\n *\n * _.ceil(6.004, 2);\n * // => 6.01\n *\n * _.ceil(6040, -2);\n * // => 6100\n */\n var ceil = createRound('ceil');\n\n /**\n * Divide two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {number} dividend The first number in a division.\n * @param {number} divisor The second number in a division.\n * @returns {number} Returns the quotient.\n * @example\n *\n * _.divide(6, 4);\n * // => 1.5\n */\n var divide = createMathOperation(function(dividend, divisor) {\n return dividend / divisor;\n }, 1);\n\n /**\n * Computes `number` rounded down to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round down.\n * @param {number} [precision=0] The precision to round down to.\n * @returns {number} Returns the rounded down number.\n * @example\n *\n * _.floor(4.006);\n * // => 4\n *\n * _.floor(0.046, 2);\n * // => 0.04\n *\n * _.floor(4060, -2);\n * // => 4000\n */\n var floor = createRound('floor');\n\n /**\n * Computes the maximum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * _.max([4, 2, 8, 6]);\n * // => 8\n *\n * _.max([]);\n * // => undefined\n */\n function max(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseGt)\n : undefined;\n }\n\n /**\n * This method is like `_.max` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * the value is ranked. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * _.maxBy(objects, function(o) { return o.n; });\n * // => { 'n': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.maxBy(objects, 'n');\n * // => { 'n': 2 }\n */\n function maxBy(array, iteratee) {\n return (array && array.length)\n ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)\n : undefined;\n }\n\n /**\n * Computes the mean of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the mean.\n * @example\n *\n * _.mean([4, 2, 8, 6]);\n * // => 5\n */\n function mean(array) {\n return baseMean(array, identity);\n }\n\n /**\n * This method is like `_.mean` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the value to be averaged.\n * The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the mean.\n * @example\n *\n * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n *\n * _.meanBy(objects, function(o) { return o.n; });\n * // => 5\n *\n * // The `_.property` iteratee shorthand.\n * _.meanBy(objects, 'n');\n * // => 5\n */\n function meanBy(array, iteratee) {\n return baseMean(array, getIteratee(iteratee, 2));\n }\n\n /**\n * Computes the minimum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * _.min([4, 2, 8, 6]);\n * // => 2\n *\n * _.min([]);\n * // => undefined\n */\n function min(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseLt)\n : undefined;\n }\n\n /**\n * This method is like `_.min` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * the value is ranked. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * _.minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * // The `_.property` iteratee shorthand.\n * _.minBy(objects, 'n');\n * // => { 'n': 1 }\n */\n function minBy(array, iteratee) {\n return (array && array.length)\n ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)\n : undefined;\n }\n\n /**\n * Multiply two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Math\n * @param {number} multiplier The first number in a multiplication.\n * @param {number} multiplicand The second number in a multiplication.\n * @returns {number} Returns the product.\n * @example\n *\n * _.multiply(6, 4);\n * // => 24\n */\n var multiply = createMathOperation(function(multiplier, multiplicand) {\n return multiplier * multiplicand;\n }, 1);\n\n /**\n * Computes `number` rounded to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round.\n * @param {number} [precision=0] The precision to round to.\n * @returns {number} Returns the rounded number.\n * @example\n *\n * _.round(4.006);\n * // => 4\n *\n * _.round(4.006, 2);\n * // => 4.01\n *\n * _.round(4060, -2);\n * // => 4100\n */\n var round = createRound('round');\n\n /**\n * Subtract two numbers.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {number} minuend The first number in a subtraction.\n * @param {number} subtrahend The second number in a subtraction.\n * @returns {number} Returns the difference.\n * @example\n *\n * _.subtract(6, 4);\n * // => 2\n */\n var subtract = createMathOperation(function(minuend, subtrahend) {\n return minuend - subtrahend;\n }, 0);\n\n /**\n * Computes the sum of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the sum.\n * @example\n *\n * _.sum([4, 2, 8, 6]);\n * // => 20\n */\n function sum(array) {\n return (array && array.length)\n ? baseSum(array, identity)\n : 0;\n }\n\n /**\n * This method is like `_.sum` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the value to be summed.\n * The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the sum.\n * @example\n *\n * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n *\n * _.sumBy(objects, function(o) { return o.n; });\n * // => 20\n *\n * // The `_.property` iteratee shorthand.\n * _.sumBy(objects, 'n');\n * // => 20\n */\n function sumBy(array, iteratee) {\n return (array && array.length)\n ? baseSum(array, getIteratee(iteratee, 2))\n : 0;\n }\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return wrapped values in chain sequences.\n lodash.after = after;\n lodash.ary = ary;\n lodash.assign = assign;\n lodash.assignIn = assignIn;\n lodash.assignInWith = assignInWith;\n lodash.assignWith = assignWith;\n lodash.at = at;\n lodash.before = before;\n lodash.bind = bind;\n lodash.bindAll = bindAll;\n lodash.bindKey = bindKey;\n lodash.castArray = castArray;\n lodash.chain = chain;\n lodash.chunk = chunk;\n lodash.compact = compact;\n lodash.concat = concat;\n lodash.cond = cond;\n lodash.conforms = conforms;\n lodash.constant = constant;\n lodash.countBy = countBy;\n lodash.create = create;\n lodash.curry = curry;\n lodash.curryRight = curryRight;\n lodash.debounce = debounce;\n lodash.defaults = defaults;\n lodash.defaultsDeep = defaultsDeep;\n lodash.defer = defer;\n lodash.delay = delay;\n lodash.difference = difference;\n lodash.differenceBy = differenceBy;\n lodash.differenceWith = differenceWith;\n lodash.drop = drop;\n lodash.dropRight = dropRight;\n lodash.dropRightWhile = dropRightWhile;\n lodash.dropWhile = dropWhile;\n lodash.fill = fill;\n lodash.filter = filter;\n lodash.flatMap = flatMap;\n lodash.flatMapDeep = flatMapDeep;\n lodash.flatMapDepth = flatMapDepth;\n lodash.flatten = flatten;\n lodash.flattenDeep = flattenDeep;\n lodash.flattenDepth = flattenDepth;\n lodash.flip = flip;\n lodash.flow = flow;\n lodash.flowRight = flowRight;\n lodash.fromPairs = fromPairs;\n lodash.functions = functions;\n lodash.functionsIn = functionsIn;\n lodash.groupBy = groupBy;\n lodash.initial = initial;\n lodash.intersection = intersection;\n lodash.intersectionBy = intersectionBy;\n lodash.intersectionWith = intersectionWith;\n lodash.invert = invert;\n lodash.invertBy = invertBy;\n lodash.invokeMap = invokeMap;\n lodash.iteratee = iteratee;\n lodash.keyBy = keyBy;\n lodash.keys = keys;\n lodash.keysIn = keysIn;\n lodash.map = map;\n lodash.mapKeys = mapKeys;\n lodash.mapValues = mapValues;\n lodash.matches = matches;\n lodash.matchesProperty = matchesProperty;\n lodash.memoize = memoize;\n lodash.merge = merge;\n lodash.mergeWith = mergeWith;\n lodash.method = method;\n lodash.methodOf = methodOf;\n lodash.mixin = mixin;\n lodash.negate = negate;\n lodash.nthArg = nthArg;\n lodash.omit = omit;\n lodash.omitBy = omitBy;\n lodash.once = once;\n lodash.orderBy = orderBy;\n lodash.over = over;\n lodash.overArgs = overArgs;\n lodash.overEvery = overEvery;\n lodash.overSome = overSome;\n lodash.partial = partial;\n lodash.partialRight = partialRight;\n lodash.partition = partition;\n lodash.pick = pick;\n lodash.pickBy = pickBy;\n lodash.property = property;\n lodash.propertyOf = propertyOf;\n lodash.pull = pull;\n lodash.pullAll = pullAll;\n lodash.pullAllBy = pullAllBy;\n lodash.pullAllWith = pullAllWith;\n lodash.pullAt = pullAt;\n lodash.range = range;\n lodash.rangeRight = rangeRight;\n lodash.rearg = rearg;\n lodash.reject = reject;\n lodash.remove = remove;\n lodash.rest = rest;\n lodash.reverse = reverse;\n lodash.sampleSize = sampleSize;\n lodash.set = set;\n lodash.setWith = setWith;\n lodash.shuffle = shuffle;\n lodash.slice = slice;\n lodash.sortBy = sortBy;\n lodash.sortedUniq = sortedUniq;\n lodash.sortedUniqBy = sortedUniqBy;\n lodash.split = split;\n lodash.spread = spread;\n lodash.tail = tail;\n lodash.take = take;\n lodash.takeRight = takeRight;\n lodash.takeRightWhile = takeRightWhile;\n lodash.takeWhile = takeWhile;\n lodash.tap = tap;\n lodash.throttle = throttle;\n lodash.thru = thru;\n lodash.toArray = toArray;\n lodash.toPairs = toPairs;\n lodash.toPairsIn = toPairsIn;\n lodash.toPath = toPath;\n lodash.toPlainObject = toPlainObject;\n lodash.transform = transform;\n lodash.unary = unary;\n lodash.union = union;\n lodash.unionBy = unionBy;\n lodash.unionWith = unionWith;\n lodash.uniq = uniq;\n lodash.uniqBy = uniqBy;\n lodash.uniqWith = uniqWith;\n lodash.unset = unset;\n lodash.unzip = unzip;\n lodash.unzipWith = unzipWith;\n lodash.update = update;\n lodash.updateWith = updateWith;\n lodash.values = values;\n lodash.valuesIn = valuesIn;\n lodash.without = without;\n lodash.words = words;\n lodash.wrap = wrap;\n lodash.xor = xor;\n lodash.xorBy = xorBy;\n lodash.xorWith = xorWith;\n lodash.zip = zip;\n lodash.zipObject = zipObject;\n lodash.zipObjectDeep = zipObjectDeep;\n lodash.zipWith = zipWith;\n\n // Add aliases.\n lodash.entries = toPairs;\n lodash.entriesIn = toPairsIn;\n lodash.extend = assignIn;\n lodash.extendWith = assignInWith;\n\n // Add methods to `lodash.prototype`.\n mixin(lodash, lodash);\n\n /*------------------------------------------------------------------------*/\n\n // Add methods that return unwrapped values in chain sequences.\n lodash.add = add;\n lodash.attempt = attempt;\n lodash.camelCase = camelCase;\n lodash.capitalize = capitalize;\n lodash.ceil = ceil;\n lodash.clamp = clamp;\n lodash.clone = clone;\n lodash.cloneDeep = cloneDeep;\n lodash.cloneDeepWith = cloneDeepWith;\n lodash.cloneWith = cloneWith;\n lodash.conformsTo = conformsTo;\n lodash.deburr = deburr;\n lodash.defaultTo = defaultTo;\n lodash.divide = divide;\n lodash.endsWith = endsWith;\n lodash.eq = eq;\n lodash.escape = escape;\n lodash.escapeRegExp = escapeRegExp;\n lodash.every = every;\n lodash.find = find;\n lodash.findIndex = findIndex;\n lodash.findKey = findKey;\n lodash.findLast = findLast;\n lodash.findLastIndex = findLastIndex;\n lodash.findLastKey = findLastKey;\n lodash.floor = floor;\n lodash.forEach = forEach;\n lodash.forEachRight = forEachRight;\n lodash.forIn = forIn;\n lodash.forInRight = forInRight;\n lodash.forOwn = forOwn;\n lodash.forOwnRight = forOwnRight;\n lodash.get = get;\n lodash.gt = gt;\n lodash.gte = gte;\n lodash.has = has;\n lodash.hasIn = hasIn;\n lodash.head = head;\n lodash.identity = identity;\n lodash.includes = includes;\n lodash.indexOf = indexOf;\n lodash.inRange = inRange;\n lodash.invoke = invoke;\n lodash.isArguments = isArguments;\n lodash.isArray = isArray;\n lodash.isArrayBuffer = isArrayBuffer;\n lodash.isArrayLike = isArrayLike;\n lodash.isArrayLikeObject = isArrayLikeObject;\n lodash.isBoolean = isBoolean;\n lodash.isBuffer = isBuffer;\n lodash.isDate = isDate;\n lodash.isElement = isElement;\n lodash.isEmpty = isEmpty;\n lodash.isEqual = isEqual;\n lodash.isEqualWith = isEqualWith;\n lodash.isError = isError;\n lodash.isFinite = isFinite;\n lodash.isFunction = isFunction;\n lodash.isInteger = isInteger;\n lodash.isLength = isLength;\n lodash.isMap = isMap;\n lodash.isMatch = isMatch;\n lodash.isMatchWith = isMatchWith;\n lodash.isNaN = isNaN;\n lodash.isNative = isNative;\n lodash.isNil = isNil;\n lodash.isNull = isNull;\n lodash.isNumber = isNumber;\n lodash.isObject = isObject;\n lodash.isObjectLike = isObjectLike;\n lodash.isPlainObject = isPlainObject;\n lodash.isRegExp = isRegExp;\n lodash.isSafeInteger = isSafeInteger;\n lodash.isSet = isSet;\n lodash.isString = isString;\n lodash.isSymbol = isSymbol;\n lodash.isTypedArray = isTypedArray;\n lodash.isUndefined = isUndefined;\n lodash.isWeakMap = isWeakMap;\n lodash.isWeakSet = isWeakSet;\n lodash.join = join;\n lodash.kebabCase = kebabCase;\n lodash.last = last;\n lodash.lastIndexOf = lastIndexOf;\n lodash.lowerCase = lowerCase;\n lodash.lowerFirst = lowerFirst;\n lodash.lt = lt;\n lodash.lte = lte;\n lodash.max = max;\n lodash.maxBy = maxBy;\n lodash.mean = mean;\n lodash.meanBy = meanBy;\n lodash.min = min;\n lodash.minBy = minBy;\n lodash.stubArray = stubArray;\n lodash.stubFalse = stubFalse;\n lodash.stubObject = stubObject;\n lodash.stubString = stubString;\n lodash.stubTrue = stubTrue;\n lodash.multiply = multiply;\n lodash.nth = nth;\n lodash.noConflict = noConflict;\n lodash.noop = noop;\n lodash.now = now;\n lodash.pad = pad;\n lodash.padEnd = padEnd;\n lodash.padStart = padStart;\n lodash.parseInt = parseInt;\n lodash.random = random;\n lodash.reduce = reduce;\n lodash.reduceRight = reduceRight;\n lodash.repeat = repeat;\n lodash.replace = replace;\n lodash.result = result;\n lodash.round = round;\n lodash.runInContext = runInContext;\n lodash.sample = sample;\n lodash.size = size;\n lodash.snakeCase = snakeCase;\n lodash.some = some;\n lodash.sortedIndex = sortedIndex;\n lodash.sortedIndexBy = sortedIndexBy;\n lodash.sortedIndexOf = sortedIndexOf;\n lodash.sortedLastIndex = sortedLastIndex;\n lodash.sortedLastIndexBy = sortedLastIndexBy;\n lodash.sortedLastIndexOf = sortedLastIndexOf;\n lodash.startCase = startCase;\n lodash.startsWith = startsWith;\n lodash.subtract = subtract;\n lodash.sum = sum;\n lodash.sumBy = sumBy;\n lodash.template = template;\n lodash.times = times;\n lodash.toFinite = toFinite;\n lodash.toInteger = toInteger;\n lodash.toLength = toLength;\n lodash.toLower = toLower;\n lodash.toNumber = toNumber;\n lodash.toSafeInteger = toSafeInteger;\n lodash.toString = toString;\n lodash.toUpper = toUpper;\n lodash.trim = trim;\n lodash.trimEnd = trimEnd;\n lodash.trimStart = trimStart;\n lodash.truncate = truncate;\n lodash.unescape = unescape;\n lodash.uniqueId = uniqueId;\n lodash.upperCase = upperCase;\n lodash.upperFirst = upperFirst;\n\n // Add aliases.\n lodash.each = forEach;\n lodash.eachRight = forEachRight;\n lodash.first = head;\n\n mixin(lodash, (function() {\n var source = {};\n baseForOwn(lodash, function(func, methodName) {\n if (!hasOwnProperty.call(lodash.prototype, methodName)) {\n source[methodName] = func;\n }\n });\n return source;\n }()), { 'chain': false });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The semantic version number.\n *\n * @static\n * @memberOf _\n * @type {string}\n */\n lodash.VERSION = VERSION;\n\n // Assign default placeholders.\n arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {\n lodash[methodName].placeholder = lodash;\n });\n\n // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.\n arrayEach(['drop', 'take'], function(methodName, index) {\n LazyWrapper.prototype[methodName] = function(n) {\n n = n === undefined ? 1 : nativeMax(toInteger(n), 0);\n\n var result = (this.__filtered__ && !index)\n ? new LazyWrapper(this)\n : this.clone();\n\n if (result.__filtered__) {\n result.__takeCount__ = nativeMin(n, result.__takeCount__);\n } else {\n result.__views__.push({\n 'size': nativeMin(n, MAX_ARRAY_LENGTH),\n 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')\n });\n }\n return result;\n };\n\n LazyWrapper.prototype[methodName + 'Right'] = function(n) {\n return this.reverse()[methodName](n).reverse();\n };\n });\n\n // Add `LazyWrapper` methods that accept an `iteratee` value.\n arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {\n var type = index + 1,\n isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;\n\n LazyWrapper.prototype[methodName] = function(iteratee) {\n var result = this.clone();\n result.__iteratees__.push({\n 'iteratee': getIteratee(iteratee, 3),\n 'type': type\n });\n result.__filtered__ = result.__filtered__ || isFilter;\n return result;\n };\n });\n\n // Add `LazyWrapper` methods for `_.head` and `_.last`.\n arrayEach(['head', 'last'], function(methodName, index) {\n var takeName = 'take' + (index ? 'Right' : '');\n\n LazyWrapper.prototype[methodName] = function() {\n return this[takeName](1).value()[0];\n };\n });\n\n // Add `LazyWrapper` methods for `_.initial` and `_.tail`.\n arrayEach(['initial', 'tail'], function(methodName, index) {\n var dropName = 'drop' + (index ? '' : 'Right');\n\n LazyWrapper.prototype[methodName] = function() {\n return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);\n };\n });\n\n LazyWrapper.prototype.compact = function() {\n return this.filter(identity);\n };\n\n LazyWrapper.prototype.find = function(predicate) {\n return this.filter(predicate).head();\n };\n\n LazyWrapper.prototype.findLast = function(predicate) {\n return this.reverse().find(predicate);\n };\n\n LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {\n if (typeof path == 'function') {\n return new LazyWrapper(this);\n }\n return this.map(function(value) {\n return baseInvoke(value, path, args);\n });\n });\n\n LazyWrapper.prototype.reject = function(predicate) {\n return this.filter(negate(getIteratee(predicate)));\n };\n\n LazyWrapper.prototype.slice = function(start, end) {\n start = toInteger(start);\n\n var result = this;\n if (result.__filtered__ && (start > 0 || end < 0)) {\n return new LazyWrapper(result);\n }\n if (start < 0) {\n result = result.takeRight(-start);\n } else if (start) {\n result = result.drop(start);\n }\n if (end !== undefined) {\n end = toInteger(end);\n result = end < 0 ? result.dropRight(-end) : result.take(end - start);\n }\n return result;\n };\n\n LazyWrapper.prototype.takeRightWhile = function(predicate) {\n return this.reverse().takeWhile(predicate).reverse();\n };\n\n LazyWrapper.prototype.toArray = function() {\n return this.take(MAX_ARRAY_LENGTH);\n };\n\n // Add `LazyWrapper` methods to `lodash.prototype`.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),\n isTaker = /^(?:head|last)$/.test(methodName),\n lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],\n retUnwrapped = isTaker || /^find/.test(methodName);\n\n if (!lodashFunc) {\n return;\n }\n lodash.prototype[methodName] = function() {\n var value = this.__wrapped__,\n args = isTaker ? [1] : arguments,\n isLazy = value instanceof LazyWrapper,\n iteratee = args[0],\n useLazy = isLazy || isArray(value);\n\n var interceptor = function(value) {\n var result = lodashFunc.apply(lodash, arrayPush([value], args));\n return (isTaker && chainAll) ? result[0] : result;\n };\n\n if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {\n // Avoid lazy use if the iteratee has a \"length\" value other than `1`.\n isLazy = useLazy = false;\n }\n var chainAll = this.__chain__,\n isHybrid = !!this.__actions__.length,\n isUnwrapped = retUnwrapped && !chainAll,\n onlyLazy = isLazy && !isHybrid;\n\n if (!retUnwrapped && useLazy) {\n value = onlyLazy ? value : new LazyWrapper(this);\n var result = func.apply(value, args);\n result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });\n return new LodashWrapper(result, chainAll);\n }\n if (isUnwrapped && onlyLazy) {\n return func.apply(this, args);\n }\n result = this.thru(interceptor);\n return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;\n };\n });\n\n // Add `Array` methods to `lodash.prototype`.\n arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {\n var func = arrayProto[methodName],\n chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',\n retUnwrapped = /^(?:pop|shift)$/.test(methodName);\n\n lodash.prototype[methodName] = function() {\n var args = arguments;\n if (retUnwrapped && !this.__chain__) {\n var value = this.value();\n return func.apply(isArray(value) ? value : [], args);\n }\n return this[chainName](function(value) {\n return func.apply(isArray(value) ? value : [], args);\n });\n };\n });\n\n // Map minified method names to their real names.\n baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n var lodashFunc = lodash[methodName];\n if (lodashFunc) {\n var key = lodashFunc.name + '';\n if (!hasOwnProperty.call(realNames, key)) {\n realNames[key] = [];\n }\n realNames[key].push({ 'name': methodName, 'func': lodashFunc });\n }\n });\n\n realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{\n 'name': 'wrapper',\n 'func': undefined\n }];\n\n // Add methods to `LazyWrapper`.\n LazyWrapper.prototype.clone = lazyClone;\n LazyWrapper.prototype.reverse = lazyReverse;\n LazyWrapper.prototype.value = lazyValue;\n\n // Add chain sequence methods to the `lodash` wrapper.\n lodash.prototype.at = wrapperAt;\n lodash.prototype.chain = wrapperChain;\n lodash.prototype.commit = wrapperCommit;\n lodash.prototype.next = wrapperNext;\n lodash.prototype.plant = wrapperPlant;\n lodash.prototype.reverse = wrapperReverse;\n lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;\n\n // Add lazy aliases.\n lodash.prototype.first = lodash.prototype.head;\n\n if (symIterator) {\n lodash.prototype[symIterator] = wrapperToIterator;\n }\n return lodash;\n });\n\n /*--------------------------------------------------------------------------*/\n\n // Export lodash.\n var _ = runInContext();\n\n // Some AMD build optimizers, like r.js, check for condition patterns like:\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\n // Expose Lodash on the global object to prevent errors when Lodash is\n // loaded by a script tag in the presence of an AMD loader.\n // See http://requirejs.org/docs/errors.html#mismatch for more details.\n // Use `_.noConflict` to remove Lodash from the global object.\n root._ = _;\n\n // Define as an anonymous module so, through path mapping, it can be\n // referenced as the \"underscore\" module.\n define(function() {\n return _;\n });\n }\n // Check for `exports` after `define` in case a build optimizer adds it.\n else if (freeModule) {\n // Export for Node.js.\n (freeModule.exports = _)._ = _;\n // Export for CommonJS support.\n freeExports._ = _;\n }\n else {\n // Export to the global object.\n root._ = _;\n }\n}.call(this));\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","var baseFlatten = require('./_baseFlatten');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\nfunction flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n}\n\nmodule.exports = flattenDeep;\n","// Generated by createIndex.js - Do not edit manually!\n// This file is automatically updated when the script runs.\n\nexport * from \"./Authenticate\";\nexport * from \"./CaptchaRequest\";\nexport * from \"./ModularUIError\";\nexport * from \"./ModularUIRequest\";\nexport * from \"./ModularUIResponse\";\nexport * from \"./UploadRequest\";\n\nexport type * from \"./types\";\n","export const IS_GRAALJS = typeof Graal !== \"undefined\";\nexport const IS_SERVER = IS_GRAALJS;\n\nexport enum HTTP_METHODS {\n GET = \"GET\",\n POST = \"POST\",\n}\n\n/**\n * Separator for parameters of a list, makes it possible to render multiple lists on a page in a non-js environment\n */\nexport const PARAMETER_SEPARATOR = \"~\";\n\n/**\n * Timeversion filter name\n */\nexport const TIMEVERSION_FILTER_NAME = \"entryDate\";\n\nexport const ISO_DATE_FORMAT = \"yyyy-MM-dd\";\nexport const ISO_DATETIME_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss\";\nexport const ISO_TIME_FORMAT = \"HH:mm:ss\";\nexport const ISO_TIMESTAMP_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSS\";\n\n/**\n * Offset format is appended to iso datetime and timestamp when isIncludeTimeOffsetInDateTimes = true\n */\nexport const DATETIME_OFFSET_FORMAT = \"xxx\";\n\n/**\n * week starts on monday by default\n */\nexport const DEFAULT_WEEK_STARTS_ON = 1;\n\n/**\n * first week indicated by the 1st of january\n */\nexport const DEFAULT_FIRST_WEEK_CONTAINS_DATE = 1;\n\n/**\n * ATTRIBUTE WIDTH\n */\nexport enum ATTRIBUTE_WIDTH {\n EXTRA_SMALL = \"EXTRA_SMALL\",\n SMALL = \"SMALL\",\n MEDIUM = \"MEDIUM\",\n LARGE = \"LARGE\",\n EXTRA_LARGE = \"EXTRA_LARGE\",\n}\n\nexport enum INTERNAL_LOGIN_TYPE {\n JAAS = \"JAAS\",\n PAC4J_FORM = \"PAC4J_FORM\",\n PAC4J_BASIC = \"PAC4J_BASIC\",\n}\n\nexport const LOGIN_TYPE = \"security.clients\";\nexport const LOGIN_PATH_SETTING = \"FormClient.login_url\";\nexport const LOGIN_USERNAME_SETTING = \"FormClient.username_field_name\";\nexport const LOGIN_PASSWORD_SETTING = \"FormClient.password_field_name\";\nexport const LOGOUT_PATH_SETTING = \"FormClient.logout_url\";\n\nexport const DEFAULT_AUTHENTICATION_TYPE = {\n name: \"Form based authentication\",\n authentication: \"DefaultFormClient\",\n isPrimary: true,\n};\n","import type { ModularUIErrorJSON } from \"./types\";\n\nexport class UnauthorizedException extends Error {\n id: string;\n status: number;\n response: ModularUIErrorJSON | undefined;\n\n constructor(\n url: string,\n method: string,\n errorResponse: ModularUIErrorJSON | undefined,\n ) {\n super(`Cannot request resource ${url} with method ${method}`);\n\n this.name = \"UnauthorizedException\";\n this.id = \"UnauthorizedException\";\n this.status = 401;\n this.response = errorResponse;\n }\n}\n","/**\n * path to contentconfiguration service\n */\nexport const CONTENT_PATH = `/content`;\n\n/**\n * Upload Path\n */\nexport const UPLOAD_PATH = `/uploadFile`;\n\n/**\n * Captcha Path\n */\nexport const CAPTCHA_PATH = `/captchaServices`;\n\n/**\n * Path to change password page / component\n */\nexport const CHANGEPASSWORD_PATH = \"/change-password\";\n\n/**\n * Path to user profile page / component\n */\nexport const USERPROFILE_PATH = \"/user\";\n\n/**\n * Path to resources in the Be Informed repository\n */\nexport const RESOURCE_PATH = \"/resource\";\n","import has from \"lodash/has\";\nimport isPlainObject from \"lodash/isPlainObject\";\n\nimport {\n INTERNAL_LOGIN_TYPE,\n LOGIN_PASSWORD_SETTING,\n LOGIN_PATH_SETTING,\n LOGIN_TYPE,\n LOGIN_USERNAME_SETTING,\n LOGOUT_PATH_SETTING,\n} from \"../constants/Constants\";\nimport { IllegalStateException } from \"../exceptions/IllegalStateException\";\n\nimport type { Setting } from \"./types\";\n\nexport const ALL_CONTENT_IN_DATA_SETTING = \"hasAllContentInData\";\nexport const INCLUDE_TIME_OFFSET = \"isIncludeTimeOffsetInDateTimes\";\n\nconst defaultSettings: Record<string, Setting> = {\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n HIDE_WHEN_EMPTY_IGNORE_TASKS: false,\n\n SHOW_AVATARS: true,\n\n COMPLETE_SOURCE: false,\n};\n\nlet settings = defaultSettings;\n\nexport const setSettings = (config: Record<string, Setting>) => {\n if (isPlainObject(config)) {\n settings = Object.assign(settings, config);\n }\n};\n\nexport const getSetting = (key: string, defaultValue?: Setting): Setting => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`,\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\nexport const getStringSetting = (\n key: string,\n defaultValue?: string,\n): string => {\n const stringSetting = getSetting(key, defaultValue);\n if (typeof stringSetting === \"string\") {\n return stringSetting;\n }\n throw new IllegalStateException(\n `Expected the value of ${key} to be a string, but was ${typeof stringSetting}`,\n );\n};\n\nexport const getNumberSetting = (\n key: string,\n defaultValue?: number,\n): number => {\n const numberSetting = getSetting(key, defaultValue);\n if (typeof numberSetting === \"number\") {\n return numberSetting;\n }\n throw new IllegalStateException(\n `Expected the value of ${key} to be a number, but was ${typeof numberSetting}`,\n );\n};\n\nexport const getBooleanSetting = (\n key: string,\n defaultValue?: boolean,\n): boolean => {\n const booleanSetting = getSetting(key, defaultValue);\n if (typeof booleanSetting === \"boolean\") {\n return booleanSetting;\n }\n throw new IllegalStateException(\n `Expected the value of ${key} to be a boolean, but was ${typeof booleanSetting}`,\n );\n};\n\nexport const setSetting = (key: string, value: Setting) => {\n settings[key] = value;\n};\n\nexport const allSettings = (): Record<string, Setting> => settings;\n\n/**\n * Indicates if contributions must be cached\n */\nexport const cacheContributions = () =>\n getBooleanSetting(\"CACHE_CONTRIBUTIONS\", true);\n\n/**\n * Indicates if content is provided through the data service\n */\nexport const hasAllContentInData = (): boolean =>\n getBooleanSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\nexport const isIncludeTimeOffsetInDateTimes = (): boolean =>\n getSetting(INCLUDE_TIME_OFFSET, false) as boolean;\n\nexport const getEnabledLocales = () => {\n const setting = getSetting(\"ENABLED_LOCALES\", [\"en\"]);\n if (Array.isArray(setting)) {\n return setting;\n }\n return [\"en\"];\n};\n\n/**\n * Login type, only available when pac4j is configured\n *\n * Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS\n */\nexport const loginType = () =>\n getStringSetting(LOGIN_TYPE, INTERNAL_LOGIN_TYPE.PAC4J_FORM);\n\nexport const loginPath = (clientName = \"FormClient\") =>\n getStringSetting(LOGIN_PATH_SETTING, `/callback?client_name=${clientName}`);\nexport const loginUsernameField = () =>\n getStringSetting(LOGIN_USERNAME_SETTING, \"j_username\");\nexport const loginPasswordField = () =>\n getStringSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\nexport const logoutPath = () =>\n getStringSetting(LOGOUT_PATH_SETTING, \"/logout\");\n\nexport const LOGIN_PATH: string = loginPath();\nexport const LOGOUT_PATH: string = logoutPath();\n","import { immerable } from \"immer\";\n\nexport class IllegalStateException extends Error {\n [immerable] = true;\n constructor(message: string) {\n super(message);\n this.name = \"IllegalStateException\";\n }\n}\n","import { CAPTCHA_PATH, CONTENT_PATH, UPLOAD_PATH } from \"../constants/Paths\";\nimport { getStringSetting } from \"./Settings\";\n\nexport const getContextPath = () =>\n getStringSetting(\"CONTEXT_PATH\", \"/BeInformed\");\n\n/**\n * Base path for modular ui requests\n */\nexport const getContextPathModularUI = () =>\n getStringSetting(\"CONTEXT_PATH_MODULARUI\", getContextPath());\n\n/**\n * Base path for server resources (cookies, js scripts, etc)\n */\nexport const getContextPathServer = () =>\n getStringSetting(\"CONTEXT_PATH_SERVER\", getContextPath());\n\n/**\n * Path to contentconfiguration service\n */\nexport const getContentPath = (\n contextPath: string = getContextPathModularUI(),\n origin = \"\",\n): string => `${origin}${contextPath}${CONTENT_PATH}`;\n\n/**\n * Path to upload service\n */\nexport const getUploadPath = (\n contextPath: string = getContextPathModularUI(),\n origin = \"\",\n): string => `${origin}${contextPath}${UPLOAD_PATH}`;\n\n/**\n * Path to captcha service\n */\nexport const getCaptchaPath = (\n contextPath: string = getContextPathModularUI(),\n origin = \"\",\n): string => `${origin}${contextPath}${CAPTCHA_PATH}`;\n","import { isPlainObject } from \"lodash\";\n\nimport { IS_GRAALJS } from \"../../constants/Constants\";\nimport { cacheContributions } from \"../../settings/Settings\";\nimport { Cache } from \"../storage/Cache\";\nimport { graalFetch } from \"./graalFetch\";\nimport { xhr } from \"./xhr\";\n\nimport type { RequestOptions } from \"./types\";\n\ntype CachedResponse = unknown;\n\nconst IS_FETCHING = \"is-fetching\";\n\n/**\n * Checks each x ms if a cache item is set after fetching the item.\n */\nconst waitForCachedItem = (cacheKey: string) => {\n let TIMEOUT = 3000;\n const CHECK_TIMEOUT = 100;\n\n return new Promise<CachedResponse>((resolve, reject) => {\n const check = () => {\n if (Cache.getItem(cacheKey) !== IS_FETCHING) {\n const cachedItem = Cache.getItem(cacheKey);\n if (cachedItem != null) {\n resolve(cachedItem);\n } else {\n reject(new Error(\"Empty cached item\"));\n }\n } else if (TIMEOUT <= 0) {\n reject(new Error(\"Empty cached item\"));\n } else {\n TIMEOUT = TIMEOUT - CHECK_TIMEOUT;\n setTimeout(check, CHECK_TIMEOUT);\n }\n };\n\n setTimeout(check, CHECK_TIMEOUT);\n });\n};\n\nconst browserFetch = (args: RequestOptions) => {\n if (cacheContributions() && args.cache) {\n const cacheKey = Cache.createResourceKey(args);\n\n if (Cache.hasItem(cacheKey)) {\n const cacheItem = Cache.getItem(cacheKey);\n\n if (cacheItem != null) {\n if (cacheItem === IS_FETCHING) {\n return waitForCachedItem(cacheKey);\n } else if (isPlainObject(cacheItem)) {\n return Promise.resolve(cacheItem);\n }\n }\n }\n\n Cache.addItem(cacheKey, IS_FETCHING);\n }\n\n return xhr(args).then((response) => {\n if (cacheContributions() && args.cache) {\n if (typeof response === \"string\" || typeof response === \"object\") {\n const cacheKey = Cache.createResourceKey(args);\n Cache.addItem(cacheKey, response);\n }\n }\n\n return response;\n });\n};\n\n/**\n * Request data from server, uses server datafetcher or xhr in browser.\n */\nexport const universalFetch = (args: RequestOptions) => {\n // Set locale as Accept-Language header\n if (args.locale) {\n args.headers = {\n ...args.headers,\n \"Accept-Language\": args.locale,\n };\n }\n\n if (args.includeContext) {\n args.url = `${args.url}?includeContext=true`;\n }\n\n // server side no access to the browser cache apis, no cache available\n if (IS_GRAALJS) {\n return graalFetch(args);\n }\n\n return browserFetch(args);\n};\n","import type { RequestOptions } from \"../fetch/types\";\n\nconst RESOURCE_CACHE_PREFIX = \"res:\";\n\n/**\n * Manage the browser cache\n */\nclass Cache {\n private _cache: Storage | undefined;\n private static instance: Cache = new Cache();\n\n private constructor() {\n if (typeof sessionStorage !== \"undefined\") {\n this._cache = sessionStorage;\n }\n }\n\n static getInstance(): Cache {\n return Cache.instance;\n }\n\n /**\n * Create a key that can be used to cache resources, needs the request arguments and uses url, params and header of the request args\n * to create a key that is unique for time versions and locale\n */\n createResourceKey(requestArgs: RequestOptions) {\n let resourceKey = requestArgs.url;\n\n if (requestArgs.params) {\n resourceKey += `|${requestArgs.params}`;\n }\n\n if (requestArgs.locale) {\n resourceKey += `|${requestArgs.locale}`;\n }\n\n return `${RESOURCE_CACHE_PREFIX}${resourceKey}`;\n }\n\n /**\n * Get a cached item by it's key\n */\n getItem(key: string): unknown {\n const cache = this._cache;\n\n if (!cache) {\n return null;\n }\n\n const cacheItem = cache.getItem(key);\n\n if (!cacheItem) {\n return null;\n }\n\n try {\n return JSON.parse(cacheItem);\n } catch (_error) {\n return this._cache?.getItem(key);\n }\n }\n\n /**\n * Check if the item with key exists in the browser cache\n */\n hasItem(key: string) {\n return this.getItem(key) !== null;\n }\n\n /**\n * Add an item to the cache\n */\n addItem(key: string, value: string | object | boolean | null) {\n const stringValue =\n typeof value === \"string\" ? value : JSON.stringify(value);\n\n this._cache?.setItem(key, stringValue);\n }\n\n setItem(key: string, value: string | object | boolean | null) {\n this.addItem(key, value);\n }\n\n removeItem(key: string) {\n this._cache?.removeItem(key);\n }\n\n /**\n * Clear complete cache storage\n */\n clear(pattern?: string) {\n if (!this._cache) {\n return;\n }\n\n if (pattern) {\n Object.keys(this._cache)\n .filter((k) => (pattern ? new RegExp(pattern).test(k) : true))\n .forEach((k) => this._cache?.removeItem(k));\n } else {\n this._cache.clear();\n }\n }\n\n /**\n * Session storage is not available between different tabs in the same window,\n * this load method copies sessionStorage from other tabs into this tab using localStorage\n * see https://blog.guya.net/2015/06/12/sharing-sessionstorage-between-tabs-for-secure-multi-tab-authentication/\n */\n loadOtherBrowserTabs(callback: () => void) {\n window.addEventListener(\"storage\", (e) => {\n this.sendSessionStorage(e);\n this.receiveSessionStorage(e, callback);\n });\n\n if (this._cache?.length === 0) {\n // trigger retrieval of sessionstorage on other tabs\n localStorage.setItem(\"getSessionStorage\", Date.now().toString());\n }\n }\n\n sendSessionStorage(e: StorageEvent) {\n if (e.key === \"getSessionStorage\") {\n localStorage.setItem(\"sessionStorage\", JSON.stringify(this._cache));\n localStorage.removeItem(\"sessionStorage\");\n }\n }\n\n receiveSessionStorage(e: StorageEvent, callback: () => void) {\n if (e.key === \"sessionStorage\" && !this.getItem(\"sessionStorageCopied\")) {\n // receive sessionstorage from other tabs\n const newData = e.newValue ? JSON.parse(e.newValue) : {};\n Object.entries(newData)\n .filter(([key]) => !this.hasItem(key))\n .forEach(([key, value]) => {\n if (typeof value === \"string\" || typeof value === \"object\") {\n this.addItem(key, value);\n }\n });\n\n this.setItem(\"sessionStorageCopied\", Date.now().toString());\n\n return callback();\n }\n\n return null;\n }\n}\n\nconst cacheInstance = Cache.getInstance();\nexport { cacheInstance as Cache };\n\nexport type CacheType = Cache;\n","import has from \"lodash/has\";\n\nimport { HTTP_METHODS } from \"../constants/Constants\";\n\nimport type { MessageParameters } from \"../types/types\";\nimport type { RequestOptions } from \"../utils/fetch/types\";\nimport type { ModularUIErrorJSON } from \"./types\";\n\nconst CLIENT_ERROR_CODE = 400;\n\nexport class FetchException extends Error {\n id: string;\n request: XMLHttpRequest | undefined;\n requestOptions: RequestOptions | undefined;\n status: number;\n response: ModularUIErrorJSON | undefined;\n properties: MessageParameters;\n parameters: MessageParameters | undefined;\n\n constructor(\n errorResponse: ModularUIErrorJSON | undefined,\n failedRequest?: XMLHttpRequest,\n requestOptions?: RequestOptions,\n ) {\n const errorInfo = getErrorInfo(errorResponse, requestOptions);\n super(errorInfo.id);\n\n this.name = errorInfo.id;\n this.id = errorInfo.id;\n this.request = failedRequest;\n this.requestOptions = requestOptions;\n\n this.status =\n failedRequest && failedRequest.status\n ? failedRequest.status\n : CLIENT_ERROR_CODE;\n\n this.response = errorResponse;\n this.properties = errorInfo.properties ?? {};\n this.parameters = errorInfo.param;\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, FetchException);\n }\n }\n}\n\nconst getErrorInfo = (\n errorResponse: ModularUIErrorJSON | undefined,\n requestOptions: RequestOptions | undefined,\n) => {\n const defaultErrorInfo = {\n id: \"Error.CannotRequestResource\",\n defaultMessage: `Cannot request resource ${\n requestOptions?.url ?? \"\"\n } with method ${requestOptions?.method ?? HTTP_METHODS.GET}`,\n properties: {},\n param: undefined,\n };\n\n if (!errorResponse) {\n return defaultErrorInfo;\n }\n\n if (has(errorResponse, \"error\")) {\n return {\n ...defaultErrorInfo,\n ...errorResponse.error,\n };\n }\n\n const [key] = Object.keys(errorResponse);\n if (has(errorResponse[key], \"errors\")) {\n return {\n ...defaultErrorInfo,\n ...errorResponse[key].errors,\n };\n }\n\n return defaultErrorInfo;\n};\n","import { FetchException } from \"../../exceptions/FetchException\";\nimport { getContextPath } from \"../../settings/Paths\";\n\nimport type { RequestOptions } from \"./types\";\n\n/**\n * Fetch data from server (expects graaljs).\n */\nexport const graalFetch = (args: RequestOptions): Promise<unknown> => {\n // remove contextPath of url, when the request is internal the context path is not needed\n const urlNoBase = args.url.includes(\"http\")\n ? args.url\n : args.url.replace(getContextPath(), \"\");\n const params = args.params\n ? args.params.replace(\"includeContext=true\", \"\")\n : \"\";\n const url = params === \"\" ? urlNoBase : `${urlNoBase}?${params}`;\n\n const data = dataFetcher.fetch(url, args);\n\n try {\n const jsonData = JSON.parse(data);\n\n if (jsonData.error) {\n return Promise.reject(new FetchException(jsonData, undefined, args));\n }\n\n return Promise.resolve(jsonData);\n } catch (error) {\n return Promise.reject(error);\n }\n};\n","import { has, isPlainObject } from \"lodash\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\nimport { FetchException } from \"../../exceptions/FetchException\";\nimport { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport { JsonParseException } from \"../../exceptions/JsonParseException\";\nimport { NetworkException } from \"../../exceptions/NetworkException\";\nimport { NotFoundException } from \"../../exceptions/NotFoundException\";\nimport { TimeoutException } from \"../../exceptions/TimeoutException\";\nimport { UnauthorizedException } from \"../../exceptions/UnauthorizedException\";\nimport { getNumberSetting, getSetting } from \"../../settings/Settings\";\nimport { Cache } from \"../storage/Cache\";\n\nimport type { ModularUIErrorJSON } from \"../../exceptions/types\";\nimport type { RequestOptions } from \"./types\";\n\ntype RejectFunction = (reason?: unknown) => void;\ntype ResolveFunction<R = unknown> = (value: R | PromiseLike<R>) => void;\n\nconst NETWORK_ERROR_CODE = 0;\nconst SUCCESS_CODE = 200;\nconst CLIENT_ERROR_CODE = 400;\nconst UNAUTHORIZED_CODE = 401;\nconst REDIRECTION_CODE = 300;\nconst NOT_FOUND_CODE = 404;\n\nconst JSON_TYPE = \"application/json\";\n\nclass XHR<R = unknown> {\n private _options: RequestOptions;\n private _attempts = 0;\n\n private _xmlhttp: XMLHttpRequest = new XMLHttpRequest();\n\n constructor(options: RequestOptions) {\n this._options = options;\n }\n\n get xmlhttp() {\n return this._xmlhttp;\n }\n\n set xmlhttp(xmlhttp: XMLHttpRequest) {\n this._xmlhttp = xmlhttp;\n }\n\n get options() {\n return this._options;\n }\n\n set options(options: RequestOptions) {\n this._options = options;\n }\n\n get attempts() {\n return this._attempts;\n }\n\n set attempts(attempts: number) {\n this._attempts = attempts;\n }\n\n /**\n * Create and fix url when params or both querystring and params exist.\n */\n get url() {\n const { url } = this.options;\n if (this.params !== \"\") {\n if (url.includes(\"?\")) {\n const aUrl = url.split(\"?\");\n\n return `${aUrl[0]}?${aUrl[1]}&${this.params}`;\n }\n\n return `${url}?${this.params}`;\n }\n\n return url;\n }\n\n get params() {\n return this.options.params || \"\";\n }\n\n get data() {\n return this.options.data || null;\n }\n\n get method(): HTTP_METHODS {\n return this.options.method || HTTP_METHODS.GET;\n }\n\n get timeout() {\n return this.options.timeout || getNumberSetting(\"XHR_TIMEOUT_MS\", 300000);\n }\n\n get responseType(): XMLHttpRequestResponseType {\n return this.options.responseType || \"json\";\n }\n\n private get events(): Record<string, () => undefined> {\n return this.options.events || {};\n }\n\n private getBaseLocale() {\n if (typeof navigator !== \"undefined\" && navigator.language) {\n return navigator.language.split(\"-\")[0] || \"en\";\n }\n\n return \"en\";\n }\n\n get headers(): Record<string, string> {\n const baseHeaders = {\n Accept: JSON_TYPE,\n \"Content-Type\": JSON_TYPE,\n\n // needed for csrf, see: https://plaza.beinformed.com/amdoc/csrf-protection-in-modular-ui-services-40054554.html\n \"X-Requested-With\": \"XMLHttpRequest\",\n\n \"Accept-Language\": this.getBaseLocale(),\n };\n\n if (this.options.headers) {\n return {\n ...baseHeaders,\n ...this.options.headers,\n };\n }\n\n return baseHeaders;\n }\n\n timeoutHandler(reject: RejectFunction) {\n return reject(new TimeoutException(this.url, this.method));\n }\n\n errorHandler(reject: RejectFunction, responseJSON?: ModularUIErrorJSON) {\n const { status } = this.xmlhttp;\n const { isReload } = this.options;\n\n if (status === NETWORK_ERROR_CODE) {\n return reject(new NetworkException(this.url, this.method));\n }\n\n if (status === NOT_FOUND_CODE) {\n return reject(new NotFoundException(this.url, this.method, isReload));\n }\n\n if (status === UNAUTHORIZED_CODE) {\n return reject(\n new UnauthorizedException(this.url, this.method, responseJSON),\n );\n }\n\n return reject(new FetchException(responseJSON, this.xmlhttp, this.options));\n }\n\n getResponse(): R {\n const { responseType, response } = this.xmlhttp;\n\n if (\n (responseType === \"\" || responseType === \"text\") &&\n this.getResponseHeader(\"Content-Type\") === JSON_TYPE\n ) {\n if (isPlainObject(response)) {\n return response;\n }\n\n try {\n return JSON.parse(response);\n } catch (error) {\n throw new JsonParseException(error as SyntaxError);\n }\n }\n\n return response;\n }\n\n responseHandler(resolve: ResolveFunction<R>, reject: RejectFunction) {\n const { status } = this.xmlhttp;\n\n let response = null;\n try {\n response = this.getResponse();\n } catch (error) {\n return reject(error);\n }\n\n if (\n (status >= SUCCESS_CODE && status < REDIRECTION_CODE) ||\n (status === CLIENT_ERROR_CODE && has(response, \"formresponse\"))\n ) {\n return resolve(response);\n }\n\n return this.errorHandler(reject, response as ModularUIErrorJSON);\n }\n\n setEventListeners(resolve: ResolveFunction<R>, reject: RejectFunction) {\n const progressEvent = this.options.onProgress;\n if (progressEvent) {\n [\"load\", \"loadend\", \"loadstart\", \"progress\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, (event) =>\n progressEvent(event as ProgressEvent<XMLHttpRequest>),\n );\n });\n }\n\n [\"abort\", \"error\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, () => this.errorHandler(reject));\n });\n\n this.xmlhttp.addEventListener(\"timeout\", () => this.timeoutHandler(reject));\n\n this.xmlhttp.addEventListener(\"load\", () =>\n this.responseHandler(resolve, reject),\n );\n\n // Set custom events\n Object.keys(this.events).forEach((eventName) => {\n this.xmlhttp.addEventListener(eventName, this.events[eventName]);\n });\n }\n\n openConnection() {\n this.xmlhttp.open(this.method, this.url, true);\n }\n\n setBasicAuthentication() {\n if (Cache.hasItem(\"basic\")) {\n const basicToken = Cache.getItem(\"basic\");\n if (typeof basicToken === \"string\") {\n this.xmlhttp.setRequestHeader(\"Authorization\", `Basic ${basicToken}`);\n }\n }\n }\n\n getResponseHeader(headerName: string) {\n return this.xmlhttp.getResponseHeader(headerName);\n }\n\n setCustomHeaders() {\n const allHeaders = this.headers;\n\n Object.keys(allHeaders).forEach((headerName) => {\n this.xmlhttp.setRequestHeader(headerName, allHeaders[headerName]);\n });\n }\n\n setOtherOptions() {\n if (\n this.options.withCredentials ||\n getSetting(\"XHR_ALWAYS_WITH_CREDENTIALS\", Cache.hasItem(\"basic\"))\n ) {\n this.xmlhttp.withCredentials = true;\n }\n this.xmlhttp.responseType = this.responseType;\n this.xmlhttp.timeout = this.timeout;\n }\n\n sendData() {\n if (this.data == null) {\n this.xmlhttp.send();\n } else {\n const stringData =\n typeof this.data === \"object\" ? JSON.stringify(this.data) : this.data;\n this.xmlhttp.send(stringData);\n }\n }\n\n handleXMLHttpRequest(): Promise<R> {\n return new Promise((resolve, reject) => {\n this.setEventListeners(resolve, reject);\n\n this.openConnection();\n\n this.setBasicAuthentication();\n\n this.setCustomHeaders();\n\n this.setOtherOptions();\n\n this.sendData();\n });\n }\n\n async fetch(): Promise<R> {\n try {\n return await this.handleXMLHttpRequest();\n } catch (err) {\n if (err instanceof NetworkException && this.attempts < 2) {\n this.attempts += 1;\n return this.fetch();\n }\n\n throw err;\n }\n }\n}\n\nconst validateInputArguments = (args: RequestOptions) => {\n if (args == null) {\n throw new IllegalArgumentException(\n \"Missing request options, expecting an object as argument for xhr\",\n );\n }\n\n if (!isPlainObject(args)) {\n throw new IllegalArgumentException(\n `Expecting an object as argument for xhr, but received: ${args.toString()}`,\n );\n }\n\n if (!has(args, \"url\")) {\n throw new IllegalArgumentException(\n `No url property found in arguments of xhr, received: ${JSON.stringify(\n args,\n )}`,\n );\n }\n\n return true;\n};\n\nexport const xhr = <R = unknown>(args: RequestOptions): Promise<R> => {\n validateInputArguments(args);\n\n return new XHR<R>(args).fetch();\n};\n","export class IllegalArgumentException extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"IllegalArgumentException\";\n }\n}\n","export class JsonParseException extends Error {\n constructor(error: SyntaxError | string) {\n super(error instanceof SyntaxError ? error.message : error);\n\n this.name = \"JsonParseException\";\n }\n}\n","export class NetworkException extends Error {\n id: string;\n status: number;\n\n constructor(url: string, method: string) {\n super(\n `An unexpected network error occurred, cannot request resource ${url} with method ${method}`,\n );\n\n this.name = \"NetworkException\";\n this.id = \"NetworkException\";\n this.status = 0;\n }\n}\n","export class NotFoundException extends Error {\n id: string;\n status: number;\n isReload: boolean;\n\n constructor(url: string, method: string, isReload = false) {\n super(`Resource ${url} with method ${method} not found`);\n\n this.name = \"NotFoundException\";\n this.id = \"NotFoundException\";\n this.status = 404;\n this.isReload = isReload;\n }\n}\n","export class TimeoutException extends Error {\n constructor(url: string, method: string) {\n super(`Timeout occurred in connection to ${url} with method ${method}.`);\n\n this.name = \"TimeoutException\";\n }\n}\n","import { HTTP_METHODS, INTERNAL_LOGIN_TYPE } from \"../constants/Constants\";\nimport { UnauthorizedException } from \"../exceptions/UnauthorizedException\";\nimport { getContextPath } from \"../settings/Paths\";\nimport {\n loginPasswordField,\n loginPath,\n loginType,\n loginUsernameField,\n logoutPath,\n} from \"../settings/Settings\";\nimport { universalFetch } from \"../utils/fetch/universalFetch\";\nimport { Cache } from \"../utils/storage/Cache\";\n\nexport class Authenticate {\n private _isBasicAuthentication: boolean;\n private _authenticationType: INTERNAL_LOGIN_TYPE;\n\n constructor() {\n this._isBasicAuthentication = false;\n this._authenticationType = this.getAuthenticationType();\n }\n\n getAuthenticationType() {\n const type = loginType();\n\n const enumType =\n INTERNAL_LOGIN_TYPE[type as keyof typeof INTERNAL_LOGIN_TYPE];\n\n if (!enumType || enumType === INTERNAL_LOGIN_TYPE.JAAS) {\n return INTERNAL_LOGIN_TYPE.JAAS;\n }\n\n if (\n enumType === INTERNAL_LOGIN_TYPE.PAC4J_FORM ||\n type.includes(\"FormClient\")\n ) {\n return INTERNAL_LOGIN_TYPE.PAC4J_FORM;\n } else if (\n enumType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC ||\n type.includes(\"BasicClient\")\n ) {\n return INTERNAL_LOGIN_TYPE.PAC4J_BASIC;\n }\n\n throw new Error(`Unsupported login type found: ${type}`);\n }\n\n get authenticationType() {\n return this._authenticationType;\n }\n\n set authenticationType(authenticationType: INTERNAL_LOGIN_TYPE) {\n this._authenticationType = authenticationType;\n }\n\n get isBasicAuthentication() {\n return (\n this._isBasicAuthentication ||\n this.authenticationType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC\n );\n }\n\n set isBasicAuthentication(isBasicAuthentication: boolean) {\n this._isBasicAuthentication = isBasicAuthentication;\n }\n\n requestLogin() {\n return universalFetch({\n url: `${getContextPath()}/login`,\n method: HTTP_METHODS.GET,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n });\n }\n\n initLogin(initLogin: boolean) {\n if (this.isBasicAuthentication || !initLogin) {\n return Promise.resolve(true);\n }\n\n return this.requestLogin().catch((error) => {\n // when an unauthorizedexception is received on a request to the login service,\n // this indicates a basic authorization scenario\n // in case of form based authentication other exceptions are thrown\n if (error instanceof UnauthorizedException) {\n this.isBasicAuthentication = true;\n }\n\n return Promise.resolve({});\n });\n }\n\n login(username: string, password: string) {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return this.doFormLogin(username, password);\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n return this.doBasicAuthentication(username, password);\n default:\n return this.doJaasAuthentication(username, password);\n }\n }\n\n getFormLoginUrl() {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n return `${getContextPath()}${loginPath(\"DirectBasicAuthClient\")}`;\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getContextPath()}${loginPath(\"FormClient\")}`;\n default:\n return `${getContextPath()}/j_security_check`;\n }\n }\n\n getFormLoginData(username: string, password: string) {\n const encodedUsername = encodeURIComponent(username);\n const encodedPassword = encodeURIComponent(password);\n\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${loginUsernameField()}=${encodedUsername}&${loginPasswordField()}=${encodedPassword}`;\n default:\n return `j_username=${encodedUsername}&j_password=${encodedPassword}`;\n }\n }\n\n doFormLogin(username: string, password: string) {\n return universalFetch({\n url: this.getFormLoginUrl(),\n method: HTTP_METHODS.POST,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n data: this.getFormLoginData(username, password),\n });\n }\n\n doBasicAuthentication(username: string, password: string) {\n Cache.addItem(\"basic\", btoa(`${username}:${password}`));\n return this.requestLogin();\n }\n\n doJaasAuthentication(username: string, password: string) {\n return this.initLogin(true).then(() => {\n if (this.isBasicAuthentication) {\n Cache.removeItem(\"basic-ok\");\n return this.doBasicAuthentication(username, password).then(() => {\n Cache.addItem(\"basic-ok\", true);\n });\n }\n return this.doFormLogin(username, password);\n });\n }\n\n getLogoutUrl() {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getContextPath()}${logoutPath()}`;\n default:\n return `${getContextPath()}/Logoff`;\n }\n }\n\n logout() {\n return universalFetch({\n url: this.getLogoutUrl(),\n }).then((response) => {\n // clear cache because of cached contributions\n Cache.clear();\n return response;\n });\n }\n}\n","import { HTTP_METHODS } from \"../constants/Constants\";\nimport { getCaptchaPath, getContextPathModularUI } from \"../settings/Paths\";\nimport { xhr } from \"../utils/fetch/xhr\";\n\ninterface CaptchaInitialResponse {\n tokenId: string;\n image: string;\n}\n\ninterface CaptchaValidResponse {\n valid: boolean;\n}\n\ninterface CaptchaInvalidResponse {\n tokenId: string;\n image: string;\n valid: boolean;\n error: { id: string };\n}\n\ntype PossibleCaptchaResponse =\n | CaptchaInitialResponse\n | CaptchaValidResponse\n | CaptchaInvalidResponse;\n\ninterface CaptchaRequestOptions {\n origin?: string;\n contextPath?: string;\n}\n\nexport class CaptchaRequest {\n private _tokenId: string | undefined;\n private _image: string | undefined;\n private _origin = \"\";\n private _contextPath: string = getContextPathModularUI();\n\n CaptchaRequest(options?: CaptchaRequestOptions) {\n this._origin = options?.origin || \"\";\n this._contextPath = options?.contextPath || getContextPathModularUI();\n }\n\n captchaResponse(response: PossibleCaptchaResponse) {\n this._tokenId = \"tokenId\" in response ? response.tokenId : this._tokenId;\n this._image = \"image\" in response ? response.image : this._image;\n\n return {\n tokenId: this._tokenId,\n image: this._image,\n valid: \"valid\" in response ? response.valid : false,\n error: \"error\" in response ? response.error : null,\n };\n }\n\n /**\n * Initiate the captcha request\n */\n init() {\n return xhr<CaptchaInitialResponse>({\n url: getCaptchaPath(this._contextPath, this._origin),\n }).then((response) => this.captchaResponse(response));\n }\n\n /**\n * Answer the captcha\n */\n send(answer?: string) {\n return xhr<CaptchaValidResponse | CaptchaInvalidResponse>({\n url: getCaptchaPath(this._contextPath, this._origin),\n method: HTTP_METHODS.POST,\n data: {\n tokenId: this._tokenId ?? \"\",\n answer: answer ?? \"\",\n },\n })\n .then((response) => this.captchaResponse(response))\n .catch((error) => this.captchaResponse(error.response));\n }\n\n /**\n * Reset the captcha and receive a new token and image\n */\n refresh() {\n return this.init();\n }\n}\n\nexport default CaptchaRequest;\n","import type { Href } from \"../models/href/Href\";\n\nexport class ModularUIError extends Error {\n response: object;\n href: Href | string | undefined;\n\n constructor(message: string, response: object, href?: string | Href) {\n super(message);\n\n this.response = response;\n this.href = href;\n\n // Without passing ModularUIError to captureStackTrace, the ModularUIError\n // frame would show up in the .stack property. By passing\n // the constructor, we omit that frame, and retain all frames below it.\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ModularUIError);\n }\n }\n\n get resource() {\n return this.href;\n }\n}\n","import deepmerge from \"deepmerge\";\nimport { klona } from \"klona/full\";\nimport { isPlainObject } from \"lodash\";\n\nimport { HTTP_METHODS, TIMEVERSION_FILTER_NAME } from \"../constants/Constants\";\nimport { IllegalArgumentException } from \"../exceptions/IllegalArgumentException\";\nimport { IllegalStateException } from \"../exceptions/IllegalStateException\";\nimport { LayoutHintProcessor } from \"../layouthints/LayoutHintProcessor\";\nimport { ResourceModel } from \"../models/base/ResourceModel\";\nimport { ContentModel } from \"../models/content/ContentModel\";\nimport { SectionModel } from \"../models/content/SectionModel\";\nimport { ErrorResponse } from \"../models/error/ErrorResponse\";\nimport { FormModel } from \"../models/form/FormModel\";\nimport { Href } from \"../models/href/Href\";\nimport { resolveModel } from \"../models/resolveModel\";\nimport { getContextPathModularUI } from \"../settings/Paths\";\nimport { getBooleanSetting } from \"../settings/Settings\";\nimport { universalFetch } from \"../utils/fetch/universalFetch\";\nimport { ModularUIError } from \"./ModularUIError\";\nimport { ModularUIResponse } from \"./ModularUIResponse\";\n\nimport type { FormData } from \"../models/form/types\";\nimport type {\n ModularUIModel,\n ModularUIModelWithChildModels,\n} from \"../models/types\";\nimport type { Contributions, Data, DefaultLinksData } from \"../types/types\";\nimport type {\n ModularUIRequestOptions,\n ProgressHandler,\n} from \"../utils/fetch/types\";\nimport type { ModularUISpecificErrorResponse, TargetModel } from \"./types\";\n\n/**\n * Helper for fetching data and contributions from the Be Informed modular ui\n * and merge it into a target or resolvable model.\n *\n * @example\n * const model = new ModularUIRequest(\"url-to-request\").fetch();\n * const post = new ModularUIRequest(\"url-to-request\", { method: \"POST\"}).fetch();\n */\nexport class ModularUIRequest {\n private _response: ModularUIResponse = new ModularUIResponse();\n\n private _href: Href;\n private _options: ModularUIRequestOptions;\n private _targetModel: TargetModel | undefined;\n private _forceTargetModel = false;\n private _contributionsHref: Href | string | undefined;\n private _locale = \"en\";\n private _method: HTTP_METHODS = HTTP_METHODS.GET;\n\n private _progressEvent: ProgressHandler | undefined;\n\n private _origin = \"\";\n private _contextPath: string = getContextPathModularUI();\n\n private _layoutHintProcessor: LayoutHintProcessor;\n\n constructor(href: Href | string, options: ModularUIRequestOptions = {}) {\n if (!href) {\n throw new IllegalArgumentException(\n \"You must pass a href to the resource that is requested\",\n );\n }\n\n this._href = typeof href === \"string\" ? new Href(href) : href;\n this._options = options;\n\n this._layoutHintProcessor = new LayoutHintProcessor(\n this._origin,\n this._contextPath,\n this.options,\n );\n\n this._response = new ModularUIResponse();\n this._response.requestHref = this.href;\n\n this.locale = this.getRequestLocale(options.locale);\n\n // copy request parameters to response, to be able to use them in the models\n // self links are missing the request parameters\n this._response.parameters = this.href.parameters.all;\n\n this.contextPath = options.contextPath || this.href.contextPath;\n this.origin = options.origin || this.href.origin;\n\n this._targetModel = options.targetModel;\n this.method = options.method || this.href.method;\n }\n\n /**\n * Retrieve the preferred language for this request, falls back to the browser language or english\n */\n getRequestLocale(optionLocale: string | undefined) {\n if (optionLocale) {\n return optionLocale;\n }\n\n if (typeof navigator !== \"undefined\" && navigator?.language) {\n return navigator.language.split(\"-\")[0] || \"en\";\n }\n\n return \"en\";\n }\n\n get origin() {\n return this._origin;\n }\n\n set origin(origin: string | undefined) {\n this._origin = origin ?? \"\";\n this._response.origin = origin ?? \"\";\n this._layoutHintProcessor.setOrigin(this._origin);\n }\n\n get contextPath() {\n return this._contextPath;\n }\n\n set contextPath(contextPath: string | undefined) {\n const path = contextPath ?? getContextPathModularUI();\n this._contextPath = path;\n this._response.contextPath = path;\n this._layoutHintProcessor.setContextPath(path);\n }\n\n get contributionsHref() {\n return this._contributionsHref;\n }\n\n set contributionsHref(contributionsHref: string | Href | undefined) {\n this._contributionsHref = contributionsHref;\n }\n\n set locale(locale: string) {\n this._locale = locale;\n this._response.locale = locale;\n this._layoutHintProcessor.setRequestOptions(this.options);\n }\n\n get locale() {\n return this._locale;\n }\n\n get response() {\n return this._response;\n }\n\n set href(href: Href) {\n this._href = href;\n }\n\n get href() {\n return this._href;\n }\n\n set method(method: HTTP_METHODS) {\n this._method = method;\n }\n\n get method() {\n return this._method;\n }\n\n get options() {\n return {\n ...this._options,\n locale: this.locale,\n method: this.method,\n };\n }\n\n set options(options: ModularUIRequestOptions) {\n this._options = options;\n this._layoutHintProcessor.setRequestOptions(options);\n }\n\n get requestOptions() {\n const {\n targetModel,\n forceTargetModel,\n updateHandler,\n childmodels,\n isValidationRequest,\n removeOnUnmount,\n ...requestOptions\n } = this.options;\n\n return requestOptions;\n }\n\n get withChildModels() {\n return (\n !(\"childmodels\" in this.options) || this.options.childmodels === true\n );\n }\n\n set targetModel(targetModel: TargetModel | undefined) {\n this._targetModel = targetModel;\n }\n\n get targetModel() {\n return this._targetModel;\n }\n\n set forceTargetModel(forceTargetModel: boolean) {\n this._forceTargetModel = forceTargetModel ?? false;\n }\n\n get forceTargetModel() {\n return this._forceTargetModel;\n }\n\n private resolveModel() {\n let availableModels;\n if (this.targetModel) {\n availableModels = Array.isArray(this.targetModel)\n ? [...this.targetModel]\n : [this.targetModel];\n\n if (this.forceTargetModel) {\n return availableModels[0];\n }\n }\n\n const Model = resolveModel(this.response, availableModels);\n\n if (Model && typeof Model.isApplicableModel === \"function\") {\n return Model;\n }\n\n if (availableModels) {\n const availableModelTypes = availableModels.map((model) => model.type);\n throw new IllegalStateException(\n `Can not find a model for url: '${this.href.toString()}', resourcetype: '${this.response?.resourcetype}', available: [${availableModelTypes}]`,\n );\n }\n\n throw new IllegalStateException(\n `no javascript model is applicable for received request of ${this.href.toString()}, with response: ${JSON.stringify(\n this.response,\n )}`,\n );\n }\n\n private createModel() {\n const Model = this.resolveModel();\n return new Model(this.response);\n }\n\n private processContributionsService(contributions: unknown) {\n if (!isPlainObject(contributions)) {\n throw new IllegalArgumentException(\n \"Missing contributions data or contributions is not JSON\",\n );\n }\n\n if (typeof contributions === \"object\" && contributions != null) {\n const record = contributions as Record<string, Contributions>;\n const [key] = Object.keys(record);\n const contributionsBody = record[key];\n if (key === \"error\") {\n this.handleContributionsError(contributionsBody);\n }\n if (typeof contributionsBody === \"object\" && contributionsBody != null) {\n // The key of the data service is different from the contributions service for forms\n if (!(this.response.key in contributionsBody)) {\n this.response.key = key;\n }\n\n this.response.contributions = contributionsBody;\n }\n }\n }\n\n private handleContributionsError(error: ModularUISpecificErrorResponse) {\n const errorMessage = error.properties?.message ?? \"Error in contribution\";\n throw new ModularUIError(errorMessage, error, this.contributionsHref);\n }\n\n private handleDataError(error: ModularUISpecificErrorResponse | string) {\n if (typeof error === \"object\" && error.properties) {\n const errorMessage = error.properties?.message ?? \"Error in data\";\n throw new ModularUIError(\n errorMessage,\n error,\n this.href.absolutepath.toString(),\n );\n }\n\n throw new IllegalArgumentException(JSON.stringify(error));\n }\n\n private handleData(key: string, data: Data | undefined) {\n this.response.key = key;\n this.response.data = data;\n\n const links = data?._links as DefaultLinksData | undefined;\n\n if (!links) {\n throw new IllegalArgumentException(\n `No _links object found in the data of ${this.href.toString()}`,\n );\n }\n\n if (links?.contributions) {\n this.contributionsHref = links.contributions.href;\n } else if (Array.isArray(links) && links[0].contributions) {\n this.contributionsHref = links[0].contributions.href;\n } else {\n throw new IllegalArgumentException(\n `Contributions link not found for data with key ${key}`,\n );\n }\n }\n\n private processDataService(data: unknown) {\n if (typeof data !== \"object\" || data === null) {\n throw new IllegalArgumentException(\"Missing data or data is not JSON\");\n }\n\n const record = data as Record<string, Data>;\n const [key] = Object.keys(record);\n const dataBody = record[key];\n\n if (key === \"error\") {\n this.handleDataError(dataBody);\n } else {\n const [key] = Object.keys(data);\n this.handleData(key, dataBody);\n }\n }\n\n private fetchContributionsService() {\n if (!this.contributionsHref) {\n throw new IllegalStateException(\"Missing a contributions href\");\n }\n\n return universalFetch({\n url: `${this.origin}${this.contextPath}${this.contributionsHref}`,\n cache: true,\n locale: this.options.locale,\n });\n }\n\n private fetchDataService() {\n return universalFetch({\n ...this.requestOptions,\n url: `${this.origin}${this.contextPath}${this.href.path}`,\n params: this.href.getQuerystringForModularUI(),\n locale: this.options.locale,\n onProgress: this.onProgress,\n });\n }\n\n set onProgress(progressEvent: ProgressHandler | undefined) {\n this._progressEvent = progressEvent;\n }\n\n get onProgress() {\n return this._progressEvent;\n }\n\n /**\n * Combine previous send request data with new validation data to create a complete request object\n * The received model is new FormModel containing ONLY the current question, not the previously entered questions\n * to create a complete request we append the originally send form objects\n */\n private getDynamicValidationData(model: ModularUIModel) {\n const prevData =\n typeof this.options.data === \"string\"\n ? JSON.parse(this.options.data)\n : this.options.data;\n\n if (model instanceof FormModel) {\n const newData = JSON.parse(model.validationData);\n return JSON.stringify(deepmerge(prevData || {}, newData));\n }\n\n return JSON.stringify(prevData) ?? \"{}\";\n }\n\n /**\n * First load of dynamic values when a form is loaded\n */\n private async loadDynamicValidations(model: ModularUIModel) {\n if (\n !this.options.isValidationRequest &&\n getBooleanSetting(\"USE_INSTANT_SERVER_VALIDATION\") &&\n model instanceof FormModel &&\n model.currentFormObject &&\n model.currentFormObject.hasDynamicValidations\n ) {\n const validationHref = this.href.setParameter(\"commit\", \"false\");\n const data = await universalFetch({\n ...this.requestOptions,\n url: `${this.origin}${this.contextPath}${this.href.path}`,\n params: validationHref.getQuerystringForModularUI(),\n data: this.getDynamicValidationData(model),\n });\n\n if (data == null || typeof data !== \"object\") {\n return model;\n }\n\n const formResponse = data as Record<string, FormData>;\n const [key] = Object.keys(formResponse);\n return model.updateValidations(formResponse[key]);\n }\n\n return model;\n }\n\n private fetchFromCache() {\n this.options = {\n ...this.options,\n cache: true,\n };\n\n return this.fetch();\n }\n\n private fetchChildModels(model: ModularUIModel) {\n const childModelLinks = (\n model as ModularUIModelWithChildModels\n ).getInitialChildModelLinks();\n\n const childModelRequests: Promise<ModularUIModel>[] = childModelLinks.map(\n (childModelLink) => {\n const request = new ModularUIRequest(childModelLink.href, {\n locale: this.locale,\n });\n\n if (childModelLink.targetModel) {\n request.targetModel = childModelLink.targetModel;\n }\n\n if (childModelLink.isCacheable) {\n return request.fetchFromCache();\n }\n\n return request.fetch();\n },\n );\n\n return Promise.allSettled(childModelRequests).then((childModels) => {\n const resolvedChildModels: ModularUIModelWithChildModels[] = [];\n const errorChildModels: ErrorResponse[] = [];\n\n childModels.forEach((childModel) => {\n if (childModel.status === \"rejected\") {\n const { reason } = childModel;\n if (reason.name !== \"Error.ChangePasswordRequired\") {\n console.debug(\n \"Unexpected error when retrieving child model:\",\n reason,\n );\n }\n errorChildModels.push(\n new ErrorResponse(reason, \"\", {\n origin: this.origin,\n contextPath: this.contextPath,\n }),\n );\n } else {\n resolvedChildModels.push(\n childModel.value as ModularUIModelWithChildModels,\n );\n }\n });\n\n if (model instanceof ResourceModel) {\n model.addChildModels(resolvedChildModels, errorChildModels);\n }\n\n return model;\n });\n }\n\n fetchContent(withChildSections: boolean) {\n return this.fetchFromCache().then((model) => {\n if (\n withChildSections &&\n model instanceof ContentModel &&\n model.childSectionLinks.length > 0\n ) {\n return this.fetchContentChildSections(model);\n }\n\n return Promise.resolve(model);\n });\n }\n\n /**\n * Recursively return child sections defined on the content model\n */\n fetchContentChildSections(contentModel: ContentModel): Promise<ContentModel> {\n const newContentModel = klona(contentModel);\n\n return Promise.all(\n contentModel.childSectionLinks.map((childSectionLink) => {\n const contentHrefWithEntryDate = childSectionLink.selfhref.addParameter(\n TIMEVERSION_FILTER_NAME,\n contentModel.entryDate,\n );\n\n const request = new ModularUIRequest(contentHrefWithEntryDate, {\n locale: this.locale,\n });\n\n return request.fetchContent(true);\n }),\n ).then((sectionModels) => {\n newContentModel.childSections = sectionModels.filter(\n (sectionModel) => sectionModel instanceof SectionModel,\n );\n\n return newContentModel;\n });\n }\n\n async fetch() {\n const data = await this.fetchDataService();\n if (data == null) {\n throw new Error(`No data received for ${this.href.toString()}`);\n }\n\n this.processDataService(data);\n\n const contributions = await this.fetchContributionsService();\n if (contributions == null) {\n throw new Error(\n `No contributions data received for ${this.contributionsHref}`,\n );\n }\n\n this.processContributionsService(contributions);\n\n await this._layoutHintProcessor.processAsyncLayoutHints(this.response);\n\n const model = this.createModel();\n\n const validatedModel = await this.loadDynamicValidations(model);\n if (this.withChildModels) {\n return await this.fetchChildModels(validatedModel);\n }\n return validatedModel;\n }\n\n /**\n * Make a post request with optionally data to send\n * @param data\n */\n post(data: string) {\n this.method = HTTP_METHODS.POST;\n this.options = {\n ...this.options,\n data,\n };\n\n return this.fetch();\n }\n\n /**\n * Make a POST request using the form, an updated form is returned (merge of old and new form)\n * @param form\n * @returns {Promise<FormModel>}\n */\n postForm(form: FormModel) {\n this.method = HTTP_METHODS.POST;\n this.options = {\n ...this.options,\n data: form.formdata,\n };\n\n return this.fetch().then((response) => {\n if (response instanceof FormModel) {\n return form.update(response);\n }\n return Promise.resolve(form);\n });\n }\n\n /**\n * Simplified synchronous version of fetch (returns the model, not a Promise)\n * This can be used on the server to retrieve a model. It only loads the request url and it's child models\n */\n fetchSync() {\n const options = { headers: { \"Accept-Language\": this.locale } };\n\n const dataString = dataFetcher.fetch(this.href.toString(), options);\n if (dataString == null) {\n throw new Error(`No data received for ${this.href.toString()}`);\n }\n\n this.processDataService(JSON.parse(dataString));\n\n if (this.contributionsHref == null) {\n throw new Error(`No constributions received for ${this.href.toString()}`);\n }\n\n const contributionsString = dataFetcher.fetch(\n this.contributionsHref.toString(),\n options,\n );\n if (contributionsString == null) {\n throw new Error(\n `No constributions received for ${this.contributionsHref.toString()}`,\n );\n }\n this.processContributionsService(JSON.parse(contributionsString));\n\n const model: ResourceModel = this.createModel();\n\n const childModelLinks = model.getInitialChildModelLinks();\n\n const childModels = childModelLinks.map((childModelLink) => {\n return new ModularUIRequest(childModelLink.href, {\n locale: this.locale,\n }).fetchSync();\n });\n if (model instanceof ResourceModel) {\n model.addChildModels(childModels, []);\n }\n\n return model;\n }\n}\n","import { isPlainObject } from \"lodash\"; // Assuming lodash is installed\n\nimport { HIDE_WHEN_EMPTY } from \"../layouthints/LayoutHints\";\nimport { getBooleanSetting } from \"../settings/Settings\";\nimport { universalFetch } from \"../utils/fetch/universalFetch\";\n\nimport type {\n ApplicationLinksContributions,\n ApplicationLinksData,\n} from \"../models/application/types\";\nimport type { CaseViewLinksContributions } from \"../models/caseview/types\";\nimport type { LinkContributions, LinkData } from \"../models/links/types\";\nimport type { ListData } from \"../models/list/types\";\nimport type { TabLinksContributions, TabLinksData } from \"../models/tab/types\";\nimport type { ModularUIResponse } from \"../modularui/ModularUIResponse\"; // Adjust path if needed\nimport type { ModularUIRequestOptions } from \"../utils/fetch/types\";\n\n/**\n * Handles the processing of asynchronous layout hints, specifically the \"hide-when-empty\" hint.\n * It filters links in the ModularUIResponse based on the emptiness of their linked resources.\n */\nexport class LayoutHintProcessor {\n private _origin: string;\n private _contextPath: string;\n private _requestOptions: ModularUIRequestOptions; // To pass fetch options\n\n constructor(\n origin: string,\n contextPath: string,\n requestOptions: ModularUIRequestOptions,\n ) {\n this._origin = origin;\n this._contextPath = contextPath;\n this._requestOptions = requestOptions;\n }\n\n setOrigin(origin: string) {\n this._origin = origin;\n }\n\n setContextPath(contextPath: string) {\n this._contextPath = contextPath;\n }\n\n setRequestOptions(requestOptions: ModularUIRequestOptions) {\n this._requestOptions = requestOptions;\n }\n\n /**\n * Orchestrates the process of applying \"hide-when-empty\" layout hints\n * across application, tab, and panel links.\n */\n public async processAsyncLayoutHints(response: ModularUIResponse) {\n if (getBooleanSetting(\"ALLOW_HIDE_WHEN_EMPTY_ON_TABS\")) {\n await this.processApplicationLinks(response);\n await this.processTabLinks(response);\n }\n await this.processPanelLinks(response);\n }\n\n /**\n * Hides application links that contain a 'hide-when-empty' layout hint\n * and whose linked resources are empty. This method handles the nested\n * structure of application tab links.\n */\n private async processApplicationLinks(response: ModularUIResponse) {\n const contributionLinks = response.contributions?._links;\n const dataLinks = response.data?._links;\n\n if (\n typeof contributionLinks === \"object\" &&\n typeof dataLinks === \"object\" &&\n contributionLinks != null &&\n dataLinks != null\n ) {\n if (\"tab\" in contributionLinks && \"tab\" in dataLinks) {\n const contributionLinksRecord =\n contributionLinks as ApplicationLinksContributions;\n const dataTabLinksRecord = dataLinks as ApplicationLinksData;\n\n // Use Promise.all to process all tab links concurrently\n await Promise.all(\n contributionLinksRecord.tab.map(async (contributionTabLink) => {\n if (\"components\" in contributionTabLink) {\n const dataTabLinks = dataTabLinksRecord.tab.find(\n (dataLink) => dataLink.name === contributionTabLink.name,\n );\n\n if (typeof dataTabLinks?.components === \"object\") {\n const newLinks = await this.processLinks(\n dataTabLinks.components,\n contributionTabLink.components,\n );\n\n // Update the response data with the filtered links\n if (Array.isArray(newLinks)) {\n this.replaceApplicationLinks(\n response,\n contributionTabLink.name,\n newLinks,\n );\n }\n }\n }\n }),\n );\n }\n }\n }\n\n /**\n * Replaces the components array for a specific tab within the application's\n * data links after applying layout hint filtering.\n * @param response\n * @param tabName The name of the tab to update.\n * @param newLinks The new array of filtered LinkData for the tab's components.\n */\n private replaceApplicationLinks(\n response: ModularUIResponse,\n tabName: string,\n newLinks: LinkData[],\n ) {\n const links = response.data?._links as ApplicationLinksData;\n if (links && Array.isArray(links.tab)) {\n links.tab = links.tab.map((tabLink) => {\n if (tabLink.name === tabName) {\n return { ...tabLink, components: newLinks };\n }\n return tabLink;\n });\n }\n }\n\n /**\n * Hides tab component links that have a 'hide-when-empty' layout hint\n * and whose linked resources are empty.\n */\n private async processTabLinks(response: ModularUIResponse) {\n const contributionLinks = response.contributions?._links;\n\n if (!contributionLinks) {\n return;\n }\n\n const contributionLinksRecord = contributionLinks as TabLinksContributions;\n if (\"component\" in contributionLinksRecord) {\n const dataLinksRecord = response.data?._links as TabLinksData;\n if (Array.isArray(dataLinksRecord?.component)) {\n const newLinks = await this.processLinks(\n dataLinksRecord.component,\n contributionLinksRecord.component,\n );\n if (Array.isArray(newLinks)) {\n dataLinksRecord.component = newLinks;\n }\n }\n }\n }\n\n /**\n * Hides panel links that have a 'hide-when-empty' layout hint\n * and whose linked resources are empty.\n */\n private async processPanelLinks(response: ModularUIResponse) {\n const contributionLinks = response.contributions\n ?._links as CaseViewLinksContributions;\n\n if (!response.data || !contributionLinks) {\n return;\n }\n\n if (typeof contributionLinks.panel !== \"undefined\") {\n const links = response.data._links as Record<string, LinkData>;\n const newLinks = await this.processLinks(links, contributionLinks.panel);\n\n if (response.data) {\n response.data._links = newLinks;\n }\n }\n }\n\n /**\n * Transforms an array or record of LinkData into a record keyed by 'name'.\n * This facilitates easier lookup during processing.\n * @param dataLinks The links from the data service.\n * @returns A record mapping link names to their LinkData.\n */\n private dataLinksPerName(\n dataLinks: LinkData[] | Record<string, LinkData> | undefined,\n ) {\n const links: Record<string, LinkData> = {};\n if (Array.isArray(dataLinks)) {\n for (const dataLink of dataLinks) {\n if (dataLink.name) {\n links[dataLink.name] = dataLink;\n }\n }\n return links;\n }\n return dataLinks || links;\n }\n\n /**\n * Core logic for filtering links based on the \"hide-when-empty\" hint.\n * It fetches the linked resources and removes the link if the resource is empty\n * and the hint is present.\n * @param dataLinks The links from the data service.\n * @param contributionLinks The corresponding links from the contributions service.\n * @returns A promise that resolves to the filtered links.\n */\n private async processLinks(\n dataLinks: LinkData[] | Record<string, LinkData> | undefined,\n contributionLinks: LinkContributions[],\n ): Promise<LinkData[] | Record<string, LinkData>> {\n const linksPerName = this.dataLinksPerName(dataLinks);\n const hideWhenEmptyLinks = contributionLinks.filter((contributionLink) =>\n contributionLink.layouthint?.includes(HIDE_WHEN_EMPTY),\n );\n\n const isHiddenListChecks: Promise<string>[] = [];\n\n for (const contributionLink of hideWhenEmptyLinks) {\n const dataLink = linksPerName?.[contributionLink.name];\n if (dataLink?.href) {\n isHiddenListChecks.push(\n this.isHiddenList(contributionLink.name, dataLink.href),\n );\n }\n }\n\n const hiddenLinks: string[] = await Promise.all(isHiddenListChecks);\n\n if (Array.isArray(dataLinks)) {\n return dataLinks.filter(\n (dataLink) => !hiddenLinks.includes(dataLink.name),\n );\n }\n\n const newDataLinks: Record<string, LinkData> = {};\n for (const dataLinkKey in linksPerName) {\n if (dataLinkKey in linksPerName && !hiddenLinks.includes(dataLinkKey)) {\n const linkPerName = linksPerName[dataLinkKey];\n if (linkPerName) {\n newDataLinks[dataLinkKey] = linkPerName;\n }\n }\n }\n return newDataLinks;\n }\n\n /**\n * Checks if a linked list resource should be hidden based on its content\n * and the \"hide-when-empty\" layout hint settings.\n * @param name The name of the link/list.\n * @param href The URL of the linked list resource.\n * @returns The name of the link if it should be hidden, otherwise an empty string.\n */\n private async isHiddenList(name: string, href: string): Promise<string> {\n const HIDE_WHEN_EMPTY_IGNORE_TASKS = getBooleanSetting(\n \"HIDE_WHEN_EMPTY_IGNORE_TASKS\",\n false,\n );\n\n try {\n const response = await universalFetch({\n ...this._requestOptions, // Pass all relevant fetch options\n url: `${this._origin}${this._contextPath}${href}`,\n });\n\n if (isPlainObject(response)) {\n const responseRecord = response as Record<string, ListData>;\n const [key] = Object.keys(responseRecord);\n const { _embedded, actions } = responseRecord[key];\n\n const noListItems =\n _embedded === null ||\n (Array.isArray(_embedded) && _embedded.length === 0);\n const noActions = actions == null || HIDE_WHEN_EMPTY_IGNORE_TASKS;\n\n const isHidden = noListItems && noActions;\n if (isHidden) {\n return name;\n }\n }\n return \"\"; // Not hidden if response is not an object or parsing fails\n } catch (_error) {\n return \"\";\n }\n }\n}\n","export const LayoutHintConfiguration = {\n MANDATORY: {\n hint: \"mandatory\",\n description: {\n NL: \"Geeft aan of een attribuut verplicht is. Dient samen met de dependency hint gebruikt te worden.\",\n EN: \"Indicates a mandatory attribute.\\nShould be used together with the dependency hint.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n DEPENDENT_ATTRIBUTE_CONTROL: {\n hint: \"dependent-control:${unique-control-id}\",\n description: {\n NL: \"Geeft aan dat dit het attribuut is waar attributen van afhankelijk zijn. Het unique-control-id is een uniek id dat kan worden gebruikt in the hint voor de show|hide actie op het afhankelijke attribuut.\",\n EN: \"Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\",\n },\n link: \"\",\n component: [\"attribute/boolean\", \"attribute/choice\"],\n },\n DEPENDENT_ATTRIBUTE_ACTION: {\n hint: \"dependent-attribute:(show|hide) when dependent-control:${unique-control-id} (equals|includes|notEquals|notIncludes) [${codemaps}]\",\n description: {\n NL: \"Toon of verberg een attribute dat afhankelijk is van de geselecteerde opties van een keuze attribute\",\n EN: \"To show or hide an attribute dependent on options of the choice control codemap that are selected or not selected.\",\n },\n link: \"\",\n component: [\"attribute\"],\n },\n SHOW_ONE_RESULT_AS_DETAIL: {\n hint: \"show-one-result-as-detail\",\n description: {\n NL: \"Een lijst met maar één item mag direct als detail getoond worden.\",\n EN: \"A list with only one detail must be shown as a detail.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n HIDE_WHEN_EMPTY: {\n hint: \"hide-when-empty\",\n description: {\n NL: \"Een lijst zonder lijst-items en lijst-taken dient niet getoond worden.\",\n EN: \"A list without list-items and list-tasks should not be shown.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n INITIAL_FILTER: {\n hint: \"initial-filter:${filter-name}=${initial-value}\",\n description: {\n NL: \"Laad de lijst met een standaardwaarde voor een filter, er is geen controle op het bestaan van het filter. Als het filter niet is geconfigureerd, treedt er een fout op. Houd er rekening mee dat filters hoofdlettergevoelig zijn.\",\n EN: \"Load the list with a default value for a filter, there is no check for the existence of the filter. If the filter is not configured, an error occurs. Keep in mind that filters are case sensitive.\",\n },\n link: \"\",\n component: [\"list\"],\n },\n CONFIRM_PASSWORD: {\n hint: \"confirm-password\",\n description: {\n NL: \"Wachtwoord attribuut moet bevestigd worden dmv een tweede wachtwoord attribuut.\",\n EN: \"Password attribute must be confirmed using a second password attribute.\",\n },\n link: \"\",\n component: [\"attribute/password\"],\n },\n TITLE: {\n hint: \"title\",\n description: {\n NL: \"Markeert een attribuut als een titel attribuut\",\n EN: \"Marks an attribute as a title attribute\",\n },\n link: \"\",\n component: [\n \"caseview_table\",\n \"codemap\",\n \"list/appointment_table\",\n \"list/assignment_table\",\n \"list/caseproperties_table\",\n \"list/document_table\",\n \"list/timelimit_table\",\n \"list/eventhistory_table\",\n \"list/note_table\",\n \"list/record_table\",\n \"list/case_table\",\n \"list/casesearch_table\",\n \"list/datastore_table\",\n \"list/datastoreview_table\",\n \"list/instrumentresult_table\",\n \"list/event_table\",\n \"list/user_table\",\n \"list/organization_table\",\n ],\n },\n INITIAL_TOTAL_FILESIZE: {\n hint: \"initial-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de reeds gebruikte file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n MAX_TOTAL_FILESIZE: {\n hint: \"max-total-file-size\",\n description: {\n NL: \"Wordt gebruikt in samenwerking met een upload attribuut, deze hint moet worden gezet op een readonly attribuut dat de maximaal toegestane file grootte bevat.\",\n EN: \"Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\",\n },\n link: \"\",\n component: [\"attribute/number\"],\n },\n CREATE_ACTION: {\n hint: \"create\",\n description: {\n NL: \"Markeer taak als creëer taak.\",\n EN: \"Mark task as create task\",\n },\n component: [\"form\"],\n },\n UPDATE_ACTION: {\n hint: \"update\",\n description: {\n NL: \"Markeer taak als bewerk taak.\",\n EN: \"Mark task as update task\",\n },\n component: [\"form\"],\n },\n DELETE_ACTION: {\n hint: \"delete\",\n description: {\n NL: \"Markeer taak als verwijder taak.\",\n EN: \"Mark task as delete task\",\n },\n component: [\"form\"],\n },\n SORT_OPTIONS: {\n hint: \"sort-options\",\n description: {\n NL: \"Sorteer opties alfabetisch\",\n EN: \"Sort options alphabetically\",\n },\n component: [\"attribute/choice\"],\n },\n CASEVIEW_LINK: {\n hint: \"case-view-link\",\n description: {\n NL: \"Markeer een case id reference attribute als de referentie naar de case view. Vervangt de self link van een lijst item\",\n EN: \"Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\",\n },\n component: [\"attribute/reference\", \"list/datastore_table\"],\n },\n DISABLED: {\n hint: \"disabled\",\n description: {\n NL: \"Geeft aan of een attribuut uitgeschakeld is.\",\n EN: \"Indicates a disabled attribute.\",\n },\n component: [\"attribute\"],\n },\n HIDE_IN_USER_INTERFACE: {\n hint: \"hide-in-user-interface\",\n description: {\n NL: \"Verberg een tab in de user interface.\",\n EN: \"Hide a tab in the user interface.\",\n },\n component: [\"tab\", \"list\", \"groupingpanel\"],\n },\n AVATAR: {\n hint: \"avatar\",\n description: {\n NL: \"Geef het attribuut weer als de avatar van de gebruiker.\",\n EN: \"Render the attribute as the user's avatar.\",\n },\n link: \"\",\n component: [\"attribute/upload\", \"list/user_table\"],\n },\n AVATAR_IN_TITLE: {\n hint: \"avatar-in-title\",\n description: {\n NL: \"Geeft aan dat de avatarafbeelding in de titel wordt opgenomen. De avatarafbeelding wordt vóór het titel attribuut weergegeven in de lijstweergave en de snelle lijst quick view.\",\n EN: \"Indicates that the avatar image will be included in the title. The avatar image is shown in front of the title attribute in the list view and list quick view.\",\n },\n link: \"\",\n component: [\"list/user_table\"],\n },\n};\n","import { LayoutHintConfiguration } from \"./LayoutHintConfig\";\n\n// Define a type for the keys of LayoutHintConfiguration\ntype LayoutHintKey = keyof typeof LayoutHintConfiguration;\n\n/**\n * Retrieve layout hint by id from the layout hint configuration\n */\nexport const getHint = (hint: string) => {\n // Check if hint is a valid key\n if (hint in LayoutHintConfiguration) {\n return LayoutHintConfiguration[hint as LayoutHintKey].hint;\n }\n\n return \"\";\n};\n\n/**\n * Layout-hint: Indicates a mandatory attribute. Should be used together with the dependency hint.\n */\nexport const MANDATORY = getHint(\"MANDATORY\");\n\n/**\n * Layout-hint: Indicates a disabled attribute.\n * @constant\n */\nexport const DISABLED = getHint(\"DISABLED\");\n\n/*\n * --------------------------------\n * SELECT DEPENDENT ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\n */\nexport const DEPENDENT_ATTRIBUTE_CONTROL = \"dependent-control\";\n\nexport const DEPENDENT_ATTRIBUTE = \"dependent-attribute:\";\n\n/*\n * --------------------------------\n * ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Password attribute must be confirmed using a second password attribute.\n */\nexport const CONFIRM_PASSWORD = getHint(\"CONFIRM_PASSWORD\");\n/**\n * Layout-hint: Sort options alphabetically\n */\nexport const SORT_OPTIONS = getHint(\"SORT_OPTIONS\");\n/**\n * Layout-hint: Marks an attribute as a title attribute\n */\nexport const TITLE = getHint(\"TITLE\");\n\n/*\n * --------------------------------\n * FORM\n * --------------------------------\n */\n/**\n * Layout-hint: Mark task as delete task\n */\nexport const DELETE_ACTION = getHint(\"DELETE_ACTION\");\n/**\n * Layout-hint: Mark task as update task\n */\nexport const UPDATE_ACTION = getHint(\"UPDATE_ACTION\");\n/**\n * Layout-hint: Mark task as create task\n */\nexport const CREATE_ACTION = getHint(\"CREATE_ACTION\");\n\n/*\n * --------------------------------\n * UPLOAD TOTAL FILE SIZE\n * --------------------------------\n */\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\n */\nexport const INITIAL_TOTAL_FILESIZE = getHint(\"INITIAL_TOTAL_FILESIZE\");\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\n */\nexport const MAX_TOTAL_FILESIZE = getHint(\"MAX_TOTAL_FILESIZE\");\n\n/*\n * --------------------------------\n * LISTS\n * --------------------------------\n */\n/**\n * Layout-hint: A list with only one detail must be shown as a detail\n */\nexport const SHOW_ONE_RESULT_AS_DETAIL = getHint(\"SHOW_ONE_RESULT_AS_DETAIL\");\n/**\n * Layout-hint: A list without list-items and list-tasks should not be shown.\n */\nexport const HIDE_WHEN_EMPTY = getHint(\"HIDE_WHEN_EMPTY\");\n/**\n * Layout-hint: Sets a default value on a filter\n */\nexport const INITIAL_FILTER = \"initial-filter:\";\n/**\n * Layout-hint: Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\n */\nexport const CASEVIEW_LINK = getHint(\"CASEVIEW_LINK\");\n\n/**\n * Layout-hint: Set on configuration of instruments to show content in a popover on a label\n */\nexport const RENDER_SECTION_LABEL = \"render-section-label\";\n\n/**\n * Layout-hint: Hide a link to a component\n */\nexport const HIDE_IN_USER_INTERFACE = getHint(\"HIDE_IN_USER_INTERFACE\");\n\nexport const getLayoutHintConfiguration = (): object => LayoutHintConfiguration;\n\n/**\n * Layout-hint: Marks an attribute as an avatar for the title attribute.\n */\nexport const AVATAR_IN_TITLE = getHint(\"AVATAR_IN_TITLE\");\n\nexport const AVATAR = getHint(\"AVATAR\");\n","import { immerable } from \"immer\";\nimport has from \"lodash/has\";\n\nimport { getContextPathModularUI } from \"../settings/Paths\";\n\nimport type { Href } from \"../models/href/Href\";\nimport type { Parameter } from \"../models/parameter/Parameter\";\nimport type { ModelOptions } from \"../models/types\";\nimport type { Contributions, Data } from \"../types/types\";\n\n/**\n * Class contains the combined responses of data and contribution services of the Be Informed Modular UI.\n */\nexport class ModularUIResponse {\n [immerable] = true;\n\n private _key: string;\n private _data?: Data;\n private _contributions?: Contributions;\n private _locale = \"en\";\n private _parameters: Parameter[] | undefined;\n private _origin: string | undefined;\n private _contextPath: string | undefined = getContextPathModularUI();\n private _requestHref: Href | undefined;\n\n constructor(\n key?: string,\n data?: Data,\n contributions?: Contributions,\n locale?: string,\n ) {\n this._key = key ?? \"unknown\";\n this._data = data;\n this._contributions = contributions;\n this._locale = locale ?? \"en\";\n }\n\n static create(input: {\n key: string;\n data: Record<string, Data>;\n contributions: Record<string, Contributions>;\n origin?: string | undefined;\n contextPath?: string | undefined;\n }) {\n const response = new ModularUIResponse();\n\n if (has(input, \"data\") && has(input, \"contributions\")) {\n const [dataKey] = Object.keys(input.data);\n const [contributionsKey] = Object.keys(input.contributions);\n\n response.key = input.key ?? contributionsKey;\n response.data = input.data?.[dataKey];\n response.contributions = input.contributions?.[contributionsKey];\n response.origin = input.origin;\n response.contextPath = input.contextPath;\n }\n\n return response;\n }\n\n get resourcetype() {\n const resourcetype = this.contributions?.resourcetype;\n if (typeof resourcetype === \"string\") {\n return resourcetype;\n }\n return \"\";\n }\n\n get modelOptions(): ModelOptions {\n return {\n origin: this.origin,\n contextPath: this.contextPath,\n };\n }\n\n set origin(origin: string | undefined) {\n this._origin = origin ?? \"\";\n }\n\n get origin() {\n return this._origin;\n }\n\n set contextPath(contextPath: string | undefined) {\n this._contextPath = contextPath ?? getContextPathModularUI();\n }\n\n get contextPath() {\n return this._contextPath;\n }\n\n set locale(locale: string) {\n this._locale = locale;\n }\n\n get locale() {\n return this._locale;\n }\n\n set key(key: string) {\n this._key = key;\n }\n\n get key() {\n return this._key;\n }\n\n set data(data: Data | undefined) {\n this._data = data;\n }\n\n get data() {\n return this._data;\n }\n\n set contributions(contributions: Contributions | undefined) {\n this._contributions = contributions;\n }\n\n get contributions() {\n return this._contributions;\n }\n\n set parameters(parameters: Parameter[] | undefined) {\n this._parameters = parameters;\n }\n\n get parameters() {\n return this._parameters;\n }\n\n set requestHref(requestHref: Href | undefined) {\n this._requestHref = requestHref;\n }\n\n get requestHref() {\n return this._requestHref;\n }\n\n static rehydrate(data: {\n key: string;\n locale: string;\n data: Data;\n contributions: Contributions;\n origin?: string;\n contextPath?: string;\n }) {\n const modelData = new ModularUIResponse();\n\n modelData.origin = data.origin;\n modelData.contextPath = data.contextPath;\n modelData.locale = data.locale;\n modelData.key = data.key;\n modelData.data = data.data;\n modelData.contributions = data.contributions;\n\n return modelData;\n }\n}\n","import { immerable } from \"immer\";\n\nexport abstract class BaseCollection<T> {\n [immerable] = true;\n\n private _collection: T[];\n\n constructor(collection: T[] = []) {\n this._collection = collection;\n }\n\n get collection() {\n return this._collection;\n }\n\n set collection(collection: T[]) {\n this._collection = collection;\n }\n\n /**\n * Retrieve all items in collection\n */\n get all() {\n return this.collection;\n }\n\n /**\n * Add an other collection, array of items or single item to this collection;\n */\n add(items: BaseCollection<T> | T[] | T) {\n if (items instanceof BaseCollection) {\n this.collection = [...this.collection, ...items.all];\n } else if (Array.isArray(items)) {\n this.collection = [...this.collection, ...items];\n } else {\n this.collection = [...this.collection, items];\n }\n }\n\n /**\n * Remove an item from the collection by it's index.\n */\n removeByIndex(itemIndex: number) {\n if (itemIndex > -1) {\n this.collection = [\n ...this.collection.slice(0, itemIndex),\n ...this.collection.slice(itemIndex + 1),\n ];\n }\n }\n\n /**\n * Indicates if the collection has items\n */\n hasItems() {\n return this.length > 0;\n }\n\n /**\n * Indicates if collection is empty\n */\n isEmpty() {\n return !this.hasItems();\n }\n\n /**\n * Get the size of this collection\n */\n get length() {\n return this.collection.length;\n }\n\n /**\n * Get the size of this collection\n */\n get size() {\n return this.length;\n }\n\n /**\n * Return first item in collection\n */\n get first() {\n return this.collection[0];\n }\n\n /**\n * Return last item in collection\n */\n get last() {\n return this.collection[this.collection.length - 1];\n }\n\n /**\n * Return item by index\n */\n get(index: number) {\n return this.collection[index];\n }\n\n /**\n * Find an item, @see {Array#find}\n */\n find(\n callbackfn: (value: T, index: number, obj: T[]) => unknown,\n thisArg?: unknown,\n ) {\n return this.collection.find(callbackfn, thisArg);\n }\n\n /**\n * Filter collection by function\n */\n filter(\n callbackfn: (value: T, index: number, array: T[]) => unknown,\n thisArg?: unknown,\n ) {\n return this.collection.filter(callbackfn, thisArg);\n }\n\n /**\n * Check if at least one item occurs\n */\n some(\n callbackfn: (value: T, index: number, array: T[]) => unknown,\n thisArg?: unknown,\n ) {\n return this.collection.some(callbackfn, thisArg);\n }\n\n every(\n callbackfn: (value: T, index: number, array: T[]) => unknown,\n thisArg?: unknown,\n ) {\n return this.collection.every(callbackfn, thisArg);\n }\n\n map<U>(\n callbackfn: (value: T, index: number, array: T[]) => U,\n thisArg?: unknown,\n ) {\n return this.collection.map(callbackfn, thisArg);\n }\n\n forEach(\n callbackfn: (value: T, index: number, array: T[]) => void,\n thisArg?: unknown,\n ) {\n this.collection.forEach(callbackfn, thisArg);\n }\n\n sort(compareFn?: (a: T, b: T) => number) {\n return this.collection.sort(compareFn);\n }\n\n /**\n * Retrieve an alphabetically sorted array of items\n */\n get sorted() {\n return this.collection.sort();\n }\n\n clear() {\n this.collection = [];\n }\n}\n","import { immerable } from \"immer\";\nimport { klona } from \"klona/full\";\nimport { get } from \"lodash\";\n\nimport { getContextPathModularUI } from \"../../settings/Paths\";\nimport { LayoutHintCollection } from \"../layouthint/LayoutHintCollection\";\n\nimport type { Contributions, Data } from \"../../types/types\";\nimport type { ModelOptions } from \"../types\";\n\n/**\n * Base model, this is the foundation of a model,\n * it contains data that is needed for all models like, data, contributions and layout hint\n *\n * Extend this for non modular ui resources, for modular ui resource start with the resourceModel\n */\nexport abstract class BaseModel<\n D extends Data = Data,\n C extends Contributions = Contributions,\n> {\n static [immerable] = true;\n\n private _data: D;\n private readonly _contributions: C;\n private readonly _layouthint: LayoutHintCollection;\n private _modelOptions: ModelOptions;\n\n constructor(\n data?: D,\n contributions?: C,\n options: ModelOptions = {\n origin: \"\",\n contextPath: getContextPathModularUI(),\n },\n ) {\n if (typeof data === \"object\" && data != null) {\n this._data = data;\n } else {\n this._data = {} as D;\n }\n\n if (typeof contributions === \"object\" && contributions != null) {\n this._contributions = contributions;\n } else {\n this._contributions = {} as C;\n }\n\n this._modelOptions = options;\n\n const hints = this.getContributionAsArray<string>(\"layouthint\", []);\n this._layouthint = new LayoutHintCollection(hints);\n }\n\n get data() {\n return this._data;\n }\n\n protected replaceData(data: D) {\n this._data = data;\n }\n\n get contributions() {\n return this._contributions;\n }\n\n get modelOptions() {\n return this._modelOptions;\n }\n\n get origin() {\n return this._modelOptions.origin;\n }\n\n get contextPath() {\n return this._modelOptions.contextPath;\n }\n\n get layouthint() {\n return this._layouthint;\n }\n\n /**\n * Retrieve property from the data object of the model, mostly used internal\n */\n protected getData<T>(propName: string, defaultValue?: T) {\n if (defaultValue) {\n return get<D, string, T>(this.data, propName, defaultValue);\n }\n return get<D, string>(this.data, propName);\n }\n\n protected getDataAsString<T extends string | undefined>(\n propName: string,\n defaultValue?: T,\n ): T extends string ? string : undefined {\n const dataAsString = this.getData<string>(propName, defaultValue);\n\n if (typeof dataAsString === \"string\") {\n return dataAsString as T extends string ? string : undefined;\n }\n\n return defaultValue as T extends string ? string : undefined;\n }\n\n protected getDataAsNumber<T extends number | undefined>(\n propName: string,\n defaultValue?: T,\n ): T extends number ? number : undefined {\n const dataAsNumber = this.getData<number>(propName, defaultValue);\n\n if (typeof dataAsNumber === \"number\") {\n return dataAsNumber as T extends number ? number : undefined;\n }\n\n return defaultValue as T extends number ? number : undefined;\n }\n\n protected getDataAsBoolean<T extends boolean | undefined>(\n propName: string,\n defaultValue?: T,\n ): T extends boolean ? boolean : undefined {\n const dataAsBoolean = this.getData<boolean>(propName, defaultValue);\n\n if (typeof dataAsBoolean === \"boolean\") {\n return dataAsBoolean as T extends boolean ? boolean : undefined;\n }\n\n return defaultValue as T extends boolean ? boolean : undefined;\n }\n\n protected getDataAsArray<T>(\n propName: string,\n defaultValue?: T[],\n ): T[] | undefined {\n const dataAsArray = this.getData<T[]>(propName, defaultValue);\n if (Array.isArray(dataAsArray)) {\n return dataAsArray;\n }\n return defaultValue;\n }\n\n protected getDataAsObject<T extends object | undefined>(\n propName: string,\n defaultValue?: T,\n ): T extends object ? object : undefined {\n const dataAsObject = this.getData<T>(propName, defaultValue);\n\n if (typeof dataAsObject === \"object\") {\n return dataAsObject as T extends object ? T : undefined;\n }\n\n return defaultValue as T extends object ? T : undefined;\n }\n\n protected getContribution(propName: string, defaultValue?: unknown) {\n return get(this.contributions, propName, defaultValue);\n }\n\n protected getContributionAsArray<T>(\n propName: string,\n defaultValue: T[],\n ): T[] {\n const contributionAsArray = this.getContribution(propName, defaultValue);\n if (Array.isArray(contributionAsArray)) {\n return contributionAsArray;\n }\n return defaultValue;\n }\n\n protected getContributionAsObject<T extends object | undefined>(\n propName: string,\n defaultValue?: T,\n ): T extends object ? T : undefined {\n const contributionAObject = this.getContribution(propName, defaultValue);\n\n if (typeof contributionAObject === \"object\") {\n return contributionAObject as T extends object ? T : undefined;\n }\n\n return defaultValue as T extends object ? T : undefined;\n }\n\n protected getContributionAsString<T extends string | undefined>(\n propName: string,\n defaultValue?: T,\n ): T extends string ? string : undefined {\n const contributionAsString = this.getContribution(propName, defaultValue);\n\n if (typeof contributionAsString === \"string\") {\n return contributionAsString as T extends string ? string : undefined;\n }\n\n return defaultValue as T extends string ? string : undefined;\n }\n\n protected getContributionAsBoolean<T extends boolean | undefined>(\n propName: string,\n defaultValue?: T,\n ): T extends boolean ? boolean : undefined {\n const contributionAsBoolean = this.getContribution(propName, defaultValue);\n\n if (typeof contributionAsBoolean === \"boolean\") {\n return contributionAsBoolean as T extends boolean ? boolean : undefined;\n }\n\n return defaultValue as T extends boolean ? boolean : undefined;\n }\n\n protected getContributionAsNumber<T extends number | undefined>(\n propName: string,\n defaultValue?: T,\n ): T extends number ? number : undefined {\n const contributionAsNumber = this.getContribution(propName, defaultValue);\n\n if (typeof contributionAsNumber === \"number\") {\n return contributionAsNumber as T extends number ? number : undefined;\n }\n\n return defaultValue as T extends number ? number : undefined;\n }\n\n hasData() {\n return Object.keys(this.data).length > 0;\n }\n\n public clone(): this {\n return klona(this) as this;\n }\n}\n","import { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport { BaseCollection } from \"../base/BaseCollection\";\n\nexport class LayoutHintCollection extends BaseCollection<string> {\n constructor(layouthint: string[] = []) {\n super(layouthint);\n\n if (!Array.isArray(layouthint)) {\n throw new IllegalArgumentException(`${layouthint} is not an Array`);\n }\n }\n\n get layouthint() {\n return this.collection;\n }\n\n /**\n * Checks if a specific layouthint exists in the component configuration\n * This method matches all exact matches and hints starting with. For example\n * when calling layouth.has(\"hide\"), this will return true for both \"hide\" and \"hide-when-empty\".<br>\n * If only exact matches are required, use the method {@link LayoutHintCollection#hasExact}.\n */\n has(...hints: string[]) {\n const hintArray = hints.length > 0 ? [...hints] : [];\n\n return hintArray\n .flat()\n .some(\n (hint) =>\n this.layouthint.includes(hint) ||\n this.layouthint.some((hint2) => hint2.startsWith(hint)),\n );\n }\n\n /**\n * Checks if a specific layouthint exists in the component configuration,\n * only checks on exact matches.<br>\n * If layouthints that start with the given hint should also match, use {@link LayoutHintCollection#has}.\n */\n hasExact(...hints: string[]) {\n const hintArray = hints.length > 0 ? [...hints] : [];\n return hintArray.flat().some((hint) => this.layouthint.includes(hint));\n }\n\n /**\n * Retrieve the first layouthint starting with hint\n */\n getByLayoutHint(\n hint: ((value: string, index: number, obj: string[]) => boolean) | string,\n ) {\n let foundHint = null;\n\n if (typeof hint === \"function\") {\n foundHint = this.layouthint.find(hint);\n }\n\n if (typeof hint === \"string\") {\n foundHint = this.layouthint.find((hint2) =>\n hint2.startsWith(hint.toString()),\n );\n }\n\n return foundHint || null;\n }\n\n /**\n * Get the value of a specific hint\n * Format: hint=value\n */\n getLayoutHintValue(hint: string) {\n const checkHint = hint.endsWith(\":\")\n ? hint.substr(0, hint.length - 1)\n : hint;\n\n const match = this.getByLayoutHint((hint2: string) => {\n return (\n hint2.startsWith(`${checkHint}=`) || hint2.startsWith(`${checkHint}:`)\n );\n });\n\n if (!match) {\n return null;\n }\n\n return match.substr(checkHint.length + 1);\n }\n\n /**\n * Get an array of multiple values from a specific hint\n * Format: hint=value1;value2;value3\n */\n getLayoutHintValues(hint: string) {\n if (!this.has(hint)) {\n return null;\n }\n\n const value = this.getLayoutHintValue(hint);\n\n if (!value) {\n return [];\n }\n\n return value.split(\";\");\n }\n}\n","import { immerable } from \"immer\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\nimport { getContentPath, getContextPathModularUI } from \"../../settings/Paths\";\nimport { Parameter } from \"../parameter/Parameter\";\nimport { ParameterCollection } from \"../parameter/ParameterCollection\";\n\nimport type { HistoryLocation } from \"../../types/types\";\nimport type { MaybeAttributeValue } from \"../attributes/types\";\nimport type { ModelOptions } from \"../types\";\n\nexport class Href<S = unknown> {\n [immerable] = true;\n\n private _origin = \"\";\n private _contextPath: string = getContextPathModularUI();\n private _path = \"\";\n private _hash = \"\";\n private _parameters: ParameterCollection = new ParameterCollection();\n private _resourcetype: string;\n private _method: HTTP_METHODS = HTTP_METHODS.GET;\n private _state?: S;\n private _referenceHash: number | undefined;\n\n constructor(\n href?: Href<S> | string | HistoryLocation,\n resourcetype?: string,\n modelOptions?: ModelOptions,\n ) {\n this._resourcetype = resourcetype ?? \"\";\n\n if (typeof href === \"string\") {\n this.initializeFromString(href);\n } else if (href instanceof Href) {\n this.initializeFromHref(href);\n } else if (href) {\n this.initializeFromLocation(href);\n }\n\n if (typeof modelOptions?.origin === \"string\") {\n this.origin = modelOptions.origin;\n }\n\n if (typeof modelOptions?.contextPath === \"string\") {\n this.contextPath = modelOptions.contextPath;\n }\n }\n\n private initializeFromString(href: string) {\n this._path = Href.getPathFromString(href);\n this._parameters = ParameterCollection.fromUrl(href);\n this._hash = Href.getHashFromString(href);\n }\n\n private initializeFromHref(href: Href<S>) {\n this._origin = href.origin;\n this._contextPath = href.contextPath;\n this._path = href.path;\n this._parameters = href.parameters;\n this._hash = href.hash;\n this._state = href.state;\n }\n\n private initializeFromLocation(location: HistoryLocation) {\n this._path = location.pathname ?? \"\";\n this._parameters = ParameterCollection.fromSearch(location.search);\n this._hash = location.hash ?? \"\";\n\n this.initializeStateFromLocation(location);\n }\n\n private initializeStateFromLocation(location: HistoryLocation) {\n if (location.state instanceof Object) {\n this._state = location.state as S;\n this._origin =\n \"origin\" in location.state && typeof location.state.origin === \"string\"\n ? location.state.origin\n : \"\";\n this._contextPath =\n \"contextPath\" in location.state &&\n typeof location.state.contextPath === \"string\"\n ? location.state.contextPath\n : \"\";\n }\n }\n\n get key() {\n return Math.random().toString(36).substring(2, 10);\n }\n\n get origin() {\n return this._origin;\n }\n\n set origin(origin: string) {\n this._origin = origin;\n }\n\n get contextPath() {\n return this._contextPath;\n }\n\n set contextPath(contextPath: string) {\n this._contextPath = contextPath;\n }\n\n get path() {\n return this._path || \"\";\n }\n\n /**\n * Set the path of the Href, the part before the querystring question mark\n */\n set path(path: string) {\n this._path = path;\n }\n\n get parameters() {\n return this._parameters;\n }\n\n set parameters(parameters) {\n this._parameters = parameters;\n }\n\n get hash() {\n return this._hash;\n }\n\n set hash(hash) {\n this._hash = hash;\n }\n\n get state() {\n return this._state;\n }\n\n set state(state) {\n this._state = state;\n }\n\n setState(state: S): Href {\n this.state = state;\n return this;\n }\n\n /**\n * Get request method\n */\n get method(): HTTP_METHODS {\n return this._method;\n }\n\n /**\n * Set request method\n */\n set method(method: HTTP_METHODS) {\n this._method = method || HTTP_METHODS.GET;\n }\n\n /**\n * Set resourctype\n */\n set resourcetype(resourcetype: string) {\n this._resourcetype = resourcetype;\n }\n\n /**\n * Retrieve resourceType\n */\n get resourcetype() {\n return this._resourcetype;\n }\n\n get isChangePassword() {\n return this.path.includes(\"/change-password\");\n }\n\n /**\n * Check if url is relative (not checking for absolute urls with same domain)\n */\n get isExternal() {\n return Href.checkAbsoluteUrl(this.path);\n }\n\n /**\n * Add a querystring parameter to the parameter collection of this Href, skips parameters that have a value of null\n */\n addParameter(\n name: string,\n value?: MaybeAttributeValue,\n prefix?: string | null,\n ): Href {\n if (value !== null) {\n this.parameters.removeParameter(name, prefix);\n this.parameters.add(new Parameter(prefix, name, value));\n }\n\n return this;\n }\n\n /**\n * Adds or overwrites a parameter when it exists and value is not null.\n * Removes the parameter when the value is null\n */\n setParameter(\n name: string,\n value?: MaybeAttributeValue,\n prefix?: string | null,\n ): Href {\n if (value != null) {\n this.addParameter(name, value, prefix);\n } else {\n this.parameters.removeParameter(name, prefix);\n }\n return this;\n }\n\n removeParameter(\n name: string,\n prefix?: string | null,\n value?: MaybeAttributeValue,\n ): Href {\n this.parameters.removeParameter(name, prefix, value);\n return this;\n }\n\n /**\n * Retrieve a parameter by it's name and (optionally) prefix\n */\n getParameter(name: string, prefix?: string | null) {\n return this.parameters.find(\n (param) => param.prefix === prefix && param.name === name,\n );\n }\n\n hasParameter(name: string, prefix?: string) {\n return this.getParameter(name, prefix) !== undefined;\n }\n\n /**\n * Get the parameters as a querystring, e.g. param1=value1¶m2=value2, optionally with prefix\n */\n getQuerystring(withPrefix = false) {\n return this.parameters.asQuerystring(withPrefix);\n }\n\n /**\n * Retrieve a querystring that only contains parameter that can be send to the modular ui, parameters are filtered by prefix\n */\n getQuerystringForModularUI(prefix = \"\") {\n return this.parameters.asQueryStringForModularUI(prefix);\n }\n\n /**\n * Retrieve all parameters from the parameter collection in a querystring style name1=value1&name2=value2, without the prefix\n */\n get querystring(): string {\n return this.parameters.asQuerystring(false);\n }\n\n /**\n * Retrieve the path combined with the base path (context-path) of the application, e.g. /BeInformed\n */\n get absolutepath(): string {\n if (this.isExternal) {\n return this.path;\n }\n return this.origin + this.contextPath + this.path;\n }\n\n /**\n * Retrieves the combination of the path and the querystring\n */\n get href() {\n return this.querystring.length > 0\n ? [this.path, this.querystring].join(\"?\")\n : this.path;\n }\n\n /**\n * Getting the URL including the base path, querystring is prefixed\n */\n get absolutehref() {\n const querystring = this.getQuerystring(false);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Getting the URL including the base path, the querystring is prefixed\n */\n get absolutehrefPrefixedQuerystring(): string {\n const querystring = this.getQuerystring(true);\n\n return querystring.length > 0\n ? [this.absolutepath, querystring].join(\"?\")\n : this.absolutepath;\n }\n\n /**\n * Checks if the URL starts within the given href\n */\n startsWith(href: Href | string) {\n const thisPath = `${this.path}/`;\n const otherPath = href instanceof Href ? `${href.path}/` : href;\n\n return thisPath.startsWith(otherPath);\n }\n\n /**\n * Checks if the given Href equals this Href\n */\n equals(href: Href | string | undefined) {\n if (href instanceof Href) {\n return this.path === href.path;\n }\n\n return this.path === href;\n }\n\n equalsWithParameters(other: Href | string | null) {\n if (other == null) {\n return false;\n }\n\n const href = other instanceof Href ? other : new Href(other);\n\n if (!this.equals(href)) {\n return false;\n }\n\n if (this.parameters.length !== href.parameters.length) {\n return false;\n }\n\n if (this.parameters.length === 0 && href.parameters.length === 0) {\n return true;\n }\n\n const thisParams = this.parameters.map((param) => param.toString());\n\n return href.parameters.every((param) => {\n return thisParams.includes(param.toString());\n });\n }\n\n /**\n * Indicates if the link is a contentconfiguration link\n */\n get isContent() {\n return this.absolutepath.startsWith(getContentPath());\n }\n\n getReferenceHash() {\n return this._referenceHash;\n }\n\n setReferenceHash(referenceHash: number | undefined) {\n this._referenceHash = referenceHash;\n }\n\n /**\n * Returns a complete url from the Href\n */\n toString(): string {\n return this.href;\n }\n\n toLocation(): HistoryLocation {\n const state = this.state instanceof Object ? this.state : {};\n\n return {\n key: this.key,\n pathname: this.path,\n search: this.querystring.length > 0 ? `?${this.querystring}` : \"\",\n hash: this.hash.length > 0 ? `#${this.hash}` : \"\",\n state: {\n origin: this.origin,\n contextPath: this.contextPath,\n ...state,\n },\n };\n }\n\n /**\n * Retrieve the relative path part of a href string, e.g. https://www.beinformed.com/BeInformed/tab/view?q=url => /tab/view\n */\n static getPathFromString(href: string) {\n return href.split(\"#\")[0].split(\"?\")[0];\n }\n\n static getHashFromString(href: string) {\n return href.includes(\"#\") ? href.substring(href.indexOf(\"#\") + 1) : \"\";\n }\n\n /**\n * check if the path is referencing a camel route\n */\n static isCamelRoute(path: string) {\n return (\n path.startsWith(\"/restServices\") && !path.startsWith(\"/restServices/ui\")\n );\n }\n\n static checkAbsoluteUrl(href: string) {\n const checkAbsolute = new RegExp(\"^(?:[a-z]+:)?//\", \"i\");\n return checkAbsolute.test(href);\n }\n}\n","import { immerable } from \"immer\";\n\nimport { PARAMETER_SEPARATOR } from \"../../constants/Constants\";\nimport { getSetting } from \"../../settings/Settings\";\n\nimport type { AttributeValue, MaybeAttributeValue } from \"../attributes/types\";\n\nexport class Parameter {\n [immerable] = true;\n\n private _prefix?: string | null | undefined;\n private _name: string;\n private _value?: MaybeAttributeValue;\n private _isModUIParameter = false;\n\n constructor(\n prefix?: string | null,\n name?: string,\n value?: MaybeAttributeValue,\n ) {\n this._prefix = prefix;\n this._name = name ?? \"\";\n if (value !== null) {\n this._value =\n typeof value === \"string\" ? decodeURIComponent(value) : value;\n }\n\n if (name) {\n this.setIsModUIParameter(name);\n }\n }\n\n /**\n * Getting prefix\n */\n get prefix() {\n return this._prefix;\n }\n\n /**\n * Getting name\n */\n get name() {\n return this._name;\n }\n\n /**\n * Getting value\n */\n get value() {\n return this._value;\n }\n\n static fromString(parameter: string) {\n if (parameter == null || parameter === \"\" || !parameter.includes(\"=\")) {\n return new Parameter();\n }\n\n // parameter has the structure prefix~name=value\n const param = parameter.split(\"=\");\n return Parameter.fromURLSearchParam(param[0], param[1]);\n }\n\n static fromURLSearchParam(key: string, value: string) {\n if (key.includes(PARAMETER_SEPARATOR)) {\n const prefix = key.substring(0, key.indexOf(\"~\"));\n const name = key.substring(key.indexOf(\"~\") + 1);\n\n return new Parameter(prefix, name, value);\n }\n\n return new Parameter(undefined, key, value);\n }\n\n /**\n * Convert parameter to string\n */\n toString(withPrefix = true) {\n if (!this.name) {\n return \"\";\n }\n\n const value = this.value == null ? \"\" : this.value;\n\n return withPrefix && this.prefix\n ? `${this.prefix}${PARAMETER_SEPARATOR}${this.name}=${value}`\n : `${this.name}=${value}`;\n }\n\n toQuerystring(withPrefix = true) {\n const value =\n this.value == null ? \"\" : this.paramValueToQuerystring(this.value);\n\n return withPrefix && this.prefix\n ? `${this.prefix}${PARAMETER_SEPARATOR}${this.name}=${value}`\n : `${this.name}=${value}`;\n }\n\n private paramValueToQuerystring(value: AttributeValue): string {\n if (\n typeof value === \"number\" ||\n typeof value === \"string\" ||\n typeof value === \"boolean\"\n ) {\n return encodeURIComponent(value);\n }\n\n if (Array.isArray(value)) {\n return value\n .filter((val) => val != null)\n .map((val) => this.paramValueToQuerystring(val))\n .join(\",\");\n }\n\n return JSON.stringify(value);\n }\n\n /**\n * Indicates if parameter is expected by the Be Informed modular UI\n */\n get isModUIParameter() {\n return this._isModUIParameter;\n }\n\n setIsModUIParameter(name: string) {\n const uiParameterSetting = getSetting(\"UI_PARAMETERS\", []);\n if (Array.isArray(uiParameterSetting)) {\n this._isModUIParameter = !uiParameterSetting.includes(name);\n }\n }\n}\n","import { BaseCollection } from \"../base/BaseCollection\";\nimport { Parameter } from \"./Parameter\";\n\nimport type { MaybeAttributeValue } from \"../attributes/types\";\n\nexport class ParameterCollection extends BaseCollection<Parameter> {\n static fromSearch(search: string | undefined) {\n const parameterCollection = new ParameterCollection();\n\n const params: URLSearchParams = new URLSearchParams(search);\n\n params.forEach((value, key) => {\n parameterCollection.add(Parameter.fromURLSearchParam(key, value));\n });\n\n return parameterCollection;\n }\n\n static fromUrl(url: string) {\n const parameterCollection = new ParameterCollection();\n\n if (url.includes(\"?\")) {\n url\n .split(\"?\")[1]\n .split(\"&\")\n .forEach((param) => {\n parameterCollection.add(Parameter.fromString(param));\n });\n }\n\n return parameterCollection;\n }\n\n /**\n * Get the parameters as a querystring, e.g. param1=value1¶m2=value2, optionally with prefix\n */\n asQuerystring(withPrefix = false) {\n return this.collection\n .filter((param) => param.value != null && param.value !== \"\")\n .map((param) => param.toQuerystring(withPrefix))\n .join(\"&\");\n }\n\n /**\n * Retrieve a querystring that only contains parameter that can be send to the modular ui, parameters are filtered by prefix\n */\n asQueryStringForModularUI(prefix = \"\") {\n return this.collection\n .filter(\n (param) =>\n param.isModUIParameter &&\n (!prefix || !param.prefix || param.prefix === prefix) &&\n param.value != null,\n )\n .map((param) => param.toQuerystring(false))\n .join(\"&\");\n }\n\n /**\n * Remove a parameter from the parameter collection\n */\n removeParameter(\n name: string,\n prefix?: string | null,\n value?: MaybeAttributeValue,\n ) {\n if (value !== undefined) {\n // remove a specific value from the parameter\n const valueToRemove = value;\n\n this.collection = this.collection.map((param) => {\n if (param.prefix === prefix && param.name === name) {\n let newValue;\n if (typeof param.value === \"string\") {\n newValue = param.value\n .split(\",\")\n .filter((val) => val !== valueToRemove)\n .join(\",\");\n } else {\n newValue = param.value === value ? null : value;\n }\n return new Parameter(param.prefix, param.name, newValue);\n }\n\n return param;\n });\n } else {\n this.collection = this.collection.filter(\n (param) => param.prefix !== prefix || param.name !== name,\n );\n }\n\n return this;\n }\n}\n","import { tz } from \"@date-fns/tz/tz\";\nimport { add } from \"date-fns/add\";\nimport { endOfMonth } from \"date-fns/endOfMonth\";\nimport { format } from \"date-fns/format\";\nimport { getDay } from \"date-fns/getDay\";\nimport { getHours } from \"date-fns/getHours\";\nimport { getMinutes } from \"date-fns/getMinutes\";\nimport { getWeek } from \"date-fns/getWeek\";\nimport { isAfter } from \"date-fns/isAfter\";\nimport { isBefore } from \"date-fns/isBefore\";\nimport { isSameDay } from \"date-fns/isSameDay\";\nimport { isValid } from \"date-fns/isValid\";\nimport { enGB, nl } from \"date-fns/locale\";\nimport { parse } from \"date-fns/parse\";\nimport { set } from \"date-fns/set\";\nimport { startOfMonth } from \"date-fns/startOfMonth\";\nimport { startOfWeek } from \"date-fns/startOfWeek\";\nimport { sub } from \"date-fns/sub\";\nimport soft from \"timezone-soft\";\n\nimport {\n DATETIME_OFFSET_FORMAT,\n DEFAULT_FIRST_WEEK_CONTAINS_DATE,\n DEFAULT_WEEK_STARTS_ON,\n IS_GRAALJS,\n ISO_DATE_FORMAT,\n ISO_DATETIME_FORMAT,\n ISO_TIME_FORMAT,\n ISO_TIMESTAMP_FORMAT,\n} from \"../../constants/Constants\";\nimport {\n getEnabledLocales,\n getNumberSetting,\n isIncludeTimeOffsetInDateTimes,\n} from \"../../settings/Settings\";\nimport { getCookie } from \"../storage/Cookies\";\n\nimport type {\n ContextOptions,\n DateValues,\n Duration,\n FirstWeekContainsDate,\n SetOptions,\n} from \"date-fns\";\nimport type { TimeZoneInfo } from \"timezone-soft\";\n\ninterface OffsetInfoInput extends TimeZoneInfo {\n offset: number;\n}\n\nexport interface OffsetInfo {\n abbr: string;\n label: string;\n value: string;\n}\n\nexport class BaseDateTimeUtil {\n private _isoFormat: string;\n private _doOffsets: boolean;\n\n private _timeZone: string =\n typeof Intl === \"undefined\"\n ? \"Etc/UTC\"\n : Intl.DateTimeFormat().resolvedOptions().timeZone || \"Etc/UTC\";\n\n constructor(isoFormat: string, doOffsets = false) {\n this._isoFormat = isoFormat;\n this._doOffsets = doOffsets;\n }\n\n /**\n * Indicates if offsets and timezones are relevant\n */\n get doOffsets() {\n return this._doOffsets ? isIncludeTimeOffsetInDateTimes() : false;\n }\n\n /**\n * Returns the options defined in settings\n */\n getOptions(): {\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n firstWeekContainsDate?: FirstWeekContainsDate;\n } {\n // indicates on what day the week starts\n const weekStartsOn = getNumberSetting(\n \"CALENDAR_WEEK_STARTS_ON\",\n DEFAULT_WEEK_STARTS_ON,\n );\n\n // indicates which date indicates the first week of the year\n const firstWeekContainsDate = getNumberSetting(\n \"CALENDAR_FIRST_WEEK_CONTAINS_DATE\",\n DEFAULT_FIRST_WEEK_CONTAINS_DATE,\n );\n\n return {\n weekStartsOn:\n weekStartsOn > -1 && weekStartsOn < 7\n ? (weekStartsOn as 0 | 1 | 2 | 3 | 4 | 5 | 6)\n : undefined,\n firstWeekContainsDate:\n firstWeekContainsDate === 1 || firstWeekContainsDate === 4\n ? (firstWeekContainsDate as FirstWeekContainsDate)\n : undefined,\n };\n }\n\n getIsoFormat() {\n if (this.doOffsets) {\n return this._isoFormat + DATETIME_OFFSET_FORMAT;\n }\n return this._isoFormat;\n }\n\n convertFormat(javaFormat?: string) {\n if (!javaFormat) {\n return this.getIsoFormat();\n }\n\n const javaToUTS35Map: Record<string, string> = {\n ZZZ: \"xxx\",\n ZZ: \"xx\",\n Z: \"x\",\n };\n\n // Replace Java pattern tokens with UTS #35 tokens\n let uts35Format = javaFormat;\n\n // Sort keys by length (descending) to handle multi-character tokens first\n const sortedKeys = Object.keys(javaToUTS35Map).sort(\n (a, b) => b.length - a.length,\n );\n\n for (const javaToken of sortedKeys) {\n const uts35Token = javaToUTS35Map[javaToken];\n const regex = new RegExp(javaToken, \"g\"); // Match all occurrences\n uts35Format = uts35Format.replace(regex, uts35Token);\n }\n\n return uts35Format;\n }\n\n getLocale() {\n const defaultLocale = getEnabledLocales()[0];\n const locale = getCookie(\"locale\") ?? defaultLocale ?? \"en\";\n\n if (locale === \"nl\") {\n return nl;\n }\n\n return enGB;\n }\n\n toDate(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n if (date instanceof Date) {\n return date;\n }\n\n const { weekStartsOn, firstWeekContainsDate } = this.getOptions();\n\n return parse(date, inputFormat, new Date(), {\n in: this.getDateFnsContext(),\n weekStartsOn,\n firstWeekContainsDate,\n });\n }\n\n toFormat(\n date: string | Date,\n targetFormat: string,\n inputFormat: string = this.getIsoFormat(),\n ) {\n const { weekStartsOn } = this.getOptions();\n\n const parsedDate = this.toDate(date, inputFormat);\n\n if (isValid(parsedDate)) {\n return format(parsedDate, targetFormat, {\n in: this.getDateFnsContext(),\n weekStartsOn,\n locale: this.getLocale(),\n });\n }\n\n return \"Invalid Date\";\n }\n\n toISO(date: string | Date, sourceFormat: string = this.getIsoFormat()) {\n return this.toFormat(date, this.getIsoFormat(), sourceFormat);\n }\n\n now() {\n return this.toISO(new Date());\n }\n\n //////////// VALIDATION\n\n hasFormat(date: string, sourceFormat: string) {\n const parsedDate = this.toDate(date, sourceFormat);\n\n const formattedValue = this.toFormat(parsedDate, sourceFormat);\n if (formattedValue === \"Invalid Date\") {\n return false;\n }\n\n const isOutsideRange =\n isBefore(parsedDate, new Date(1000, 1, 1)) ||\n isAfter(parsedDate, new Date(9999, 11, 31));\n if (isOutsideRange) {\n return false;\n }\n\n return (\n formattedValue.replace(/0/gu, \"\").toUpperCase() ===\n date.replace(/0/gu, \"\").toUpperCase()\n );\n }\n\n isValid(\n date: string | Date | null | void,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!date) {\n return false;\n }\n\n const parsedDate = this.toDate(date, inputFormat);\n return isValid(parsedDate);\n }\n\n isAfter(\n inputDate: string | Date,\n afterISODate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!afterISODate) {\n return false;\n }\n return isAfter(\n this.toDate(inputDate, inputFormat),\n this.toDate(afterISODate),\n );\n }\n\n isSameOrAfter(\n inputDate: string | Date,\n afterISODate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!afterISODate) {\n return false;\n }\n return (\n this.isAfter(inputDate, afterISODate, inputFormat) ||\n this.isSame(inputDate, afterISODate, inputFormat)\n );\n }\n\n isBefore(\n inputDate: string | Date,\n beforeISODate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!beforeISODate) {\n return false;\n }\n\n return isBefore(\n this.toDate(inputDate, inputFormat),\n this.toDate(beforeISODate),\n );\n }\n\n isSameOrBefore(\n inputDate: string | Date,\n beforeISODate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!beforeISODate) {\n return false;\n }\n\n return (\n this.isBefore(inputDate, beforeISODate, inputFormat) ||\n this.isSame(inputDate, beforeISODate, inputFormat)\n );\n }\n\n isSame(\n inputDate: string | Date,\n compareDate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!compareDate) {\n return false;\n }\n\n return (\n this.toDate(inputDate, inputFormat).getTime() ===\n this.toDate(compareDate).getTime()\n );\n }\n\n isSameDay(\n inputDate: string | Date,\n compareDate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (!compareDate) {\n return false;\n }\n\n return isSameDay(\n this.toDate(inputDate, inputFormat),\n this.toDate(compareDate, inputFormat),\n );\n }\n\n isOther(\n inputDate: string | Date,\n compareDate?: string | Date,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return !this.isSame(inputDate, compareDate, inputFormat);\n }\n\n isWeekend(inputDate: string | Date) {\n const SATURDAY_NUMBER = 6;\n const SUNDAY_NUMBER = 0;\n const weekDay = getDay(this.toDate(inputDate));\n\n return weekDay === SATURDAY_NUMBER || weekDay === SUNDAY_NUMBER;\n }\n\n /**\n * Checks if a given local date and time is ambiguous in the specified timezone.\n * Ambiguity happens during the end of daylight saving time (DST) transitions.\n */\n isAmbiguous(\n inputDate?: string | Date | null,\n inputFormat: string = this.getIsoFormat(),\n ) {\n if (inputDate == null || typeof Intl === \"undefined\") {\n return false;\n }\n\n const dateTime = this.toDate(inputDate, inputFormat);\n if (!isValid(dateTime)) {\n return false;\n }\n\n const t = [60, -60, 30, -30];\n const a = t.map((x) => {\n const newDate = add(dateTime, { minutes: x });\n return format(newDate, \"HH:mm\");\n });\n const time = format(dateTime, \"HH:mm\");\n return a.indexOf(time) > -1;\n }\n\n //////////// CALCULATIONS\n\n private calculate(\n date: string | Date,\n calculationFn: (\n date: Date,\n duration: Duration,\n options: ContextOptions<Date>,\n ) => Date,\n property: string,\n value: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n const parsedDate = this.toDate(date, inputFormat);\n return this.toISO(\n calculationFn(\n parsedDate,\n { [property]: value },\n {\n in: this.getDateFnsContext(),\n },\n ),\n );\n }\n\n addSeconds(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"seconds\", amount, inputFormat);\n }\n\n addMinutes(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"minutes\", amount, inputFormat);\n }\n\n addHours(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"hours\", amount, inputFormat);\n }\n\n addDays(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"days\", amount, inputFormat);\n }\n\n addWeeks(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"weeks\", amount, inputFormat);\n }\n\n addMonths(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"months\", amount, inputFormat);\n }\n\n addYears(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, add, \"years\", amount, inputFormat);\n }\n\n subtractSeconds(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"seconds\", amount, inputFormat);\n }\n\n subtractMinutes(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"minutes\", amount, inputFormat);\n }\n\n subtractHours(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"hours\", amount, inputFormat);\n }\n\n subtractDays(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"days\", amount, inputFormat);\n }\n\n subtractWeeks(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"weeks\", amount, inputFormat);\n }\n\n subtractMonths(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"months\", amount, inputFormat);\n }\n\n subtractYears(\n date: string,\n amount: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.calculate(date, sub, \"years\", amount, inputFormat);\n }\n\n //////////// GETTERS\n\n private get(\n date: string | Date,\n method: (date: Date, options: ContextOptions<Date>) => Date,\n inputFormat: string = this.getIsoFormat(),\n options: object = {},\n ) {\n const parsedDate = this.toDate(date, inputFormat);\n return this.toISO(\n method(parsedDate, {\n in: this.getDateFnsContext(),\n ...options,\n }),\n );\n }\n\n startOfMonth(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n return this.get(date, startOfMonth, inputFormat);\n }\n\n endOfMonth(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n return this.get(date, endOfMonth, inputFormat);\n }\n\n startOfWeek(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n const { weekStartsOn } = this.getOptions();\n return this.get(date, startOfWeek, inputFormat, {\n weekStartsOn,\n });\n }\n\n getHours(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n const parsedDate = this.toDate(date, inputFormat);\n return getHours(parsedDate, { in: this.getDateFnsContext() });\n }\n\n getMinutes(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n const parsedDate = this.toDate(date, inputFormat);\n return getMinutes(parsedDate, { in: this.getDateFnsContext() });\n }\n\n getWeek(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n const { weekStartsOn, firstWeekContainsDate } = this.getOptions();\n const parsedDate = this.toDate(date, inputFormat);\n return getWeek(parsedDate, {\n in: this.getDateFnsContext(),\n weekStartsOn,\n firstWeekContainsDate,\n });\n }\n\n //////////// SETTERS\n\n private set(\n date: string | Date,\n property: string,\n value: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n const parsedDate = this.toDate(date, inputFormat);\n return this.toISO(set(parsedDate, { [property]: value } as DateValues));\n }\n\n setYear(\n date: string | Date,\n year: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"year\", year, inputFormat);\n }\n\n setMonth(\n date: string | Date,\n month: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"month\", month, inputFormat);\n }\n\n setDay(\n date: string | Date,\n day: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"date\", day, inputFormat);\n }\n\n setHour(\n date: string | Date,\n hour: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"hours\", hour, inputFormat);\n }\n\n setMinute(\n date: string | Date,\n minute: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"minutes\", minute, inputFormat);\n }\n\n setSecond(\n date: string | Date,\n second: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"seconds\", second, inputFormat);\n }\n\n setMilliseconds(\n date: string | Date,\n millisecond: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n return this.set(date, \"milliseconds\", millisecond, inputFormat);\n }\n\n setTime(\n date: string,\n hours: number,\n minutes: number,\n seconds: number,\n milliseconds: number,\n inputFormat: string = this.getIsoFormat(),\n ) {\n const parsedDate = this.toDate(date, inputFormat);\n return this.toISO(\n set(\n parsedDate,\n { hours, minutes, seconds, milliseconds } as DateValues,\n {\n in: this.getDateFnsContext(),\n } as SetOptions,\n ),\n );\n }\n\n //////////// Timezone related\n\n getTimeZone() {\n return this._timeZone;\n }\n\n setTimeZone(timeZone: string) {\n this._timeZone = timeZone;\n }\n\n getDateFnsContext() {\n if (this.doOffsets && !IS_GRAALJS) {\n return tz(this.getTimeZone());\n }\n return undefined;\n }\n\n //////////// Offsets\n\n getOffset(date: string | Date, inputFormat: string = this.getIsoFormat()) {\n const parsedDate = this.toDate(date, inputFormat);\n if (isValid(parsedDate)) {\n const dateOffset = this.toFormat(parsedDate, DATETIME_OFFSET_FORMAT);\n const offsets = this.getTimezoneOffsets();\n if (\n typeof offsets.daylight !== \"undefined\" &&\n offsets.daylight.value === dateOffset\n ) {\n return offsets.daylight;\n } else if (\n typeof offsets.standard !== \"undefined\" &&\n offsets.standard.value === dateOffset\n ) {\n return offsets.standard;\n }\n }\n return null;\n }\n\n private createOffsetObject(info: OffsetInfoInput) {\n const sign = info.offset < 0 ? \"-\" : \"+\";\n const absOffset = Math.abs(info.offset);\n const hours = Math.trunc(absOffset);\n const minutes = Math.round((absOffset % 1) * 60);\n\n const offsetString = `${sign}${String(hours + (minutes === 60 ? 1 : 0)).padStart(2, \"0\")}:${String(minutes % 60).padStart(2, \"0\")}`;\n\n return {\n label: info.name,\n abbr: info.abbr,\n value: offsetString,\n };\n }\n\n getTimezoneOffsets(): {\n standard?: OffsetInfo;\n daylight?: OffsetInfo;\n } {\n const timezone = soft(this.getTimeZone());\n\n if (timezone.length === 0) {\n return {\n standard: {\n label: \"Etc/UTC\",\n abbr: \"Etc/UTC\",\n value: \"+00:00\",\n },\n };\n }\n\n const { daylight, standard } = timezone[0];\n\n if (daylight) {\n return {\n daylight: this.createOffsetObject(daylight as OffsetInfoInput),\n standard: this.createOffsetObject(standard as OffsetInfoInput),\n };\n }\n\n return { standard: this.createOffsetObject(standard as OffsetInfoInput) };\n }\n}\n\n/**\n * DateUtil\n */\nconst DateUtil = new BaseDateTimeUtil(ISO_DATE_FORMAT);\n\n/**\n * DateTimeUtil\n */\nconst DateTimeUtil = new BaseDateTimeUtil(ISO_DATETIME_FORMAT, true);\n\n/**\n * TimeUtil\n */\nconst TimeUtil = new BaseDateTimeUtil(ISO_TIME_FORMAT);\n\n/**\n * TimestampUtil\n */\nconst TimestampUtil = new BaseDateTimeUtil(ISO_TIMESTAMP_FORMAT, true);\n\nexport { DateUtil, DateTimeUtil, TimeUtil, TimestampUtil };\n","import Cookies from \"js-cookie\";\n\nimport { getContextPathServer } from \"../../settings/Paths\";\n\ninterface CookieOptions {\n days?: number;\n sameSite?: \"None\" | \"Lax\" | \"Strict\";\n secure?: boolean;\n}\n\nexport const getCookie = (name: string) => {\n return Cookies.get(name);\n};\n\nexport const setCookie = (\n name: string,\n value: string,\n options?: CookieOptions,\n) => {\n const attributes = {\n path: getContextPathServer(),\n expires: options?.days,\n sameSite: options?.sameSite ?? \"Strict\",\n secure: options?.secure,\n };\n\n Cookies.set(name, value, attributes);\n};\n\nexport const clearCookie = (name: string) => {\n Cookies.remove(name, { path: getContextPathServer() });\n};\n","import { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { LinkCollection } from \"../links/LinkCollection\";\n\nimport type { ISO_DATE } from \"../../types/types\";\nimport type {\n ProcessStatusSettingsContributions,\n ProcessStatusSettingsData,\n} from \"./types\";\n\nexport class ProcessStatusSettingsModel extends BaseModel<\n ProcessStatusSettingsData,\n ProcessStatusSettingsContributions\n> {\n get concequenceType() {\n return this.getContributionAsString(\"consequenceType\", \"\").toLowerCase();\n }\n\n get transition() {\n return this.getContributionAsString(\"transition\", \"\").toLowerCase();\n }\n\n get isApplicable() {\n return this.getDataAsBoolean(\"applicable\", false);\n }\n\n get isCompleted() {\n return this.getDataAsBoolean(\"completed\", false);\n }\n\n get isNeeded() {\n const needed = this.getDataAsString(\"needed\", \"unknown\");\n\n if (needed === \"unknown\") {\n // if the value in the data is unknown, this should also return null;\n return null;\n }\n\n return needed === \"true\";\n }\n\n get state() {\n return this.getDataAsString(\"state\", \"\");\n }\n\n get canComplete(): boolean | null {\n return this.getDataAsBoolean(\"canComplete\", true);\n }\n\n get links(): LinkCollection {\n return LinkCollection.create(\n this.contributions,\n null,\n \"process-status\",\n this.modelOptions,\n );\n }\n\n get referenceDate(): ISO_DATE {\n return DateUtil.now();\n }\n\n /**\n * Retrieve concept link of attribute when available\n */\n get conceptLink() {\n const conceptLink = this.links.getLinkByKey(\"concept\");\n if (conceptLink) {\n conceptLink.href = conceptLink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this.referenceDate,\n );\n\n conceptLink.isCacheable = true;\n }\n\n return conceptLink;\n }\n}\n","import { INITIAL_FILTER } from \"../../layouthints/LayoutHints\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { Href } from \"../href/Href\";\nimport { Parameter } from \"../parameter/Parameter\";\nimport { ProcessStatusSettingsModel } from \"../process/ProcessStatusSettingsModel\";\nimport { LinkCollection } from \"./LinkCollection\";\n\nimport type { TargetModel } from \"../../modularui/types\";\nimport type { ModelOptions } from \"../types\";\nimport type { NormalizedLinkContributions, NormalizedLinkData } from \"./types\";\n\nexport class LinkModel extends BaseModel<\n NormalizedLinkData,\n NormalizedLinkContributions\n> {\n private _href: Href;\n private _icon?: string;\n private _targetModel?: TargetModel | undefined;\n private _isCacheable = false;\n\n constructor(\n data?: NormalizedLinkData,\n contributions?: NormalizedLinkContributions,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n this._href = this.createHref();\n }\n\n static create(\n name: string,\n href: string | Href,\n label: string,\n modelOptions?: ModelOptions,\n ) {\n return new LinkModel(\n { name, href: href.toString() },\n { name, label },\n modelOptions,\n );\n }\n\n private createHref() {\n const href = new Href(\n this.getDataAsString(\"href\", \"\"),\n this.resourcetype,\n this.modelOptions,\n );\n this.handleInitialFilters(href);\n return href;\n }\n\n /**\n * Handle initial filter hints\n * @private\n */\n private handleInitialFilters(href: Href) {\n if (this.layouthint.has(INITIAL_FILTER)) {\n const filters: Record<string, string[]> = {};\n const hintStart = INITIAL_FILTER.length;\n for (const hint of this.layouthint.filter((hint) =>\n hint.startsWith(INITIAL_FILTER),\n )) {\n const param = hint.substring(hintStart);\n const p = Parameter.fromString(param);\n if (p.name) {\n if (!filters[p.name]) {\n filters[p.name] = [];\n }\n\n if (typeof p.value === \"string\") {\n filters[p.name].push(p.value);\n }\n }\n }\n\n Object.keys(filters).forEach((key) => {\n const value = filters[key].join(\",\");\n href.addParameter(key, value);\n });\n }\n }\n\n /**\n * Getting the key/name of this link\n */\n get key() {\n return this.getDataAsString(\"name\", \"\");\n }\n\n /**\n * Getting the label of the link\n */\n get label() {\n return this.getContributionAsString(\"label\", this.key);\n }\n\n /**\n * Getting the type of the link\n */\n get resourcetype() {\n return this.getContributionAsString(\"resourcetype\", \"\");\n }\n\n /**\n * Getting link group\n */\n get group() {\n return this.getContributionAsString(\n \"group\",\n this.getDataAsString(\"group\", \"\"),\n );\n }\n\n get href() {\n return this._href;\n }\n\n set href(href: Href) {\n this._href = href;\n }\n\n /**\n * retrieve sublinks of this link\n */\n get links() {\n if (\"components\" in this.data && \"components\" in this.contributions) {\n return new LinkCollection(\n { components: this.data.components },\n { components: this.contributions.components },\n );\n }\n\n return new LinkCollection();\n }\n\n /**\n * Check if the href startswith the URI of the given href\n */\n isActive(link: LinkModel) {\n return link.href.startsWith(this.href);\n }\n\n /**\n * Setter for icon of LinkModel\n */\n set icon(icon) {\n this._icon = icon;\n }\n\n /**\n * Retrieve icon of LinkModel\n */\n get icon() {\n return this._icon;\n }\n\n get targetModel() {\n return this._targetModel;\n }\n\n set targetModel(targetModel) {\n this._targetModel = targetModel;\n }\n\n get isCacheable() {\n return this._isCacheable;\n }\n\n set isCacheable(isCacheable) {\n this._isCacheable = isCacheable;\n }\n\n get filterName() {\n const filter = this.getDataAsObject(\"filter\");\n if (filter && \"name\" in filter && typeof filter.name === \"string\") {\n return filter.name;\n }\n return undefined;\n }\n\n get hasProcessStatusSettings() {\n return (\n \"processStatus\" in this.data && \"processStatus\" in this.contributions\n );\n }\n\n get processStatus() {\n if (this.hasProcessStatusSettings) {\n return new ProcessStatusSettingsModel(\n this.data.processStatus,\n this.contributions.processStatus,\n );\n }\n return undefined;\n }\n}\n","import type { NormalizedLinkContributions, NormalizedLinkData } from \"./types\";\n\ntype LinksData = Record<\n string,\n { href: string } | { href?: string; name: string }[]\n>;\n\ntype LinksContribution = Record<\n string,\n | {\n href?: string;\n label?: string;\n resourcetype?: string;\n layouthint?: string[];\n }\n | {\n href?: string;\n name: string;\n label: string;\n resourcetype?: string;\n layouthint?: string[];\n }[]\n>;\n\ninterface NormalizedLink {\n data: NormalizedLinkData;\n contributions: NormalizedLinkContributions;\n}\n\nexport const normalizeLinkJSON = (\n data?: object,\n contribution?: object,\n): NormalizedLink[] => {\n if (!data && !contribution) {\n return [];\n }\n\n const links = [];\n\n if (data) {\n const linksData = data as LinksData;\n for (const key of Object.keys(linksData)) {\n const linkData = linksData[key];\n if (Array.isArray(linkData)) {\n // group of links\n for (const link of linkData) {\n links.push({\n data: {\n group: key,\n ...link,\n },\n contributions: { name: link.name },\n });\n }\n } else {\n // single link\n links.push({\n data: {\n name: key,\n group: key,\n ...linkData,\n },\n contributions: { name: key },\n });\n }\n }\n }\n\n if (contribution) {\n const linksContribution = contribution as LinksContribution;\n for (const key of Object.keys(linksContribution)) {\n const linkContribution = linksContribution[key];\n if (Array.isArray(linkContribution)) {\n for (const link of linkContribution) {\n const idx: number = links.findIndex(\n (l) => l.data?.name === link.name,\n );\n if (idx > -1) {\n links[idx] = {\n ...links[idx],\n contributions: { ...link, group: key },\n };\n }\n }\n } else {\n const idx: number = links.findIndex((l) => l.data?.name === key);\n if (idx > -1) {\n links[idx] = {\n ...links[idx],\n contributions: { name: key, ...linkContribution },\n };\n } else if (\"href\" in linkContribution) {\n links.push({\n data: { name: key, href: linkContribution.href },\n contributions: { name: key },\n });\n }\n }\n }\n }\n\n return links;\n};\n","import { HIDE_IN_USER_INTERFACE } from \"../../layouthints/LayoutHints\";\nimport { BaseCollection } from \"../base/BaseCollection\";\nimport { LinkModel } from \"./LinkModel\";\nimport { normalizeLinkJSON } from \"./normalizeLinkJSON\";\n\nimport type { Contributions, Data } from \"../../types/types\";\nimport type { Href } from \"../href/Href\";\nimport type { ModelOptions } from \"../types\";\n\nexport class LinkCollection extends BaseCollection<LinkModel> {\n constructor(\n data?: Record<string, unknown>,\n contributions?: Record<string, unknown>,\n modelOptions?: ModelOptions,\n ) {\n super();\n\n const links = normalizeLinkJSON(data, contributions);\n\n this.collection = links\n .filter(\n (link) =>\n !link.contributions.layouthint?.includes(HIDE_IN_USER_INTERFACE),\n )\n .map(\n (link) => new LinkModel(link.data, link.contributions, modelOptions),\n );\n }\n\n static create(\n data: Data,\n contributions?: Contributions | null,\n selflinkResourceType?: string,\n modelOptions?: ModelOptions,\n ) {\n const linksData = \"_links\" in data ? data._links : null;\n const linksContributions =\n typeof contributions === \"object\" &&\n contributions !== null &&\n \"_links\" in contributions &&\n typeof contributions._links === \"object\"\n ? { ...contributions._links }\n : {};\n\n return new LinkCollection(\n Array.isArray(linksData) ? linksData[0] : linksData,\n {\n self: {\n resourcetype: selflinkResourceType,\n },\n ...linksContributions,\n },\n modelOptions,\n );\n }\n\n get links() {\n return this.collection;\n }\n\n set links(links: LinkModel[]) {\n this.collection = links;\n }\n\n /**\n * Get a link by it's key, handy for getting the self link\n */\n getLinkByKey(key: string) {\n return this.find((link) => link.key === key);\n }\n\n /**\n * Indicate if a link by key exists\n */\n hasLinkByKey(key: string) {\n return this.all.some((link) => link.key === key);\n }\n\n /**\n * Get a link by it's Href\n */\n getLinkByHref(href: Href | string) {\n return this.find((link) => link.href.equals(href));\n }\n\n /**\n * Getting the links by group key. For instance getting all 'tab' links of the web application.\n * Returns a new LinkCollection\n */\n getLinksByGroup(...args: string[]) {\n const groupsToFind = args.length > 0 ? [...args] : [];\n const groupLinks = this.filter((link) => groupsToFind.includes(link.group));\n\n const linkCollection = new LinkCollection();\n linkCollection.links = groupLinks;\n return linkCollection;\n }\n\n /**\n * Retrieve links by resource type\n * Returns a new LinkCollection\n */\n getLinkByResourceType(resourceType: string) {\n const linkCollection = new LinkCollection();\n\n linkCollection.collection = this.filter(\n (link) => link.resourcetype === resourceType,\n );\n\n return linkCollection;\n }\n\n /**\n * Retrieve links including a layout hint\n * Returns a new LinkCollection\n */\n getLinksByLayoutHint(hint: string) {\n const newCollection = new LinkCollection();\n\n newCollection.collection = this.filter((link) => link.layouthint.has(hint));\n\n return newCollection;\n }\n\n /**\n * Indicates if a link with layout hint exists\n */\n hasLinksByLayoutHint(hint: string) {\n return this.some((link) => link.layouthint.has(hint));\n }\n\n /**\n * Get all link Href's in this LinkCollection as an array\n */\n toHrefArray() {\n return this.map((link) => link.href);\n }\n\n /**\n * Check if link exists in collection\n */\n hasLink(link: LinkModel) {\n return this.some((l) => l.href.equals(link.href));\n }\n\n /**\n * Updates this LinkCollection with a new link, when the link to update does not exist, it is added to the collection\n * This mutates the current LinkCollection\n */\n update(newLink: LinkModel) {\n const oldIndex = this.links.findIndex((link) => link.key === newLink.key);\n\n if (oldIndex === -1) {\n this.collection = [...this.collection, newLink];\n\n return this;\n }\n\n this.collection = [\n ...this.links.slice(0, oldIndex),\n newLink,\n ...this.links.slice(oldIndex + 1),\n ];\n\n return this;\n }\n\n /**\n * Retrieve a path pattern from all links in the collection,\n * that can be used in a React Router route to match against an URL to determine of the route matches that URL\n */\n get routePath(): string {\n if (this.length === 0) {\n // when a react router route has no path it matches on all url, this is to prevent this behavior\n return \"__NON_EXISTING_ROUTE__\";\n }\n\n const path = this.map((link) => link.href.path).join(\"|\");\n return this.length > 1 ? `(${path})` : path;\n }\n}\n","import { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport { IllegalStateException } from \"../../exceptions/IllegalStateException\";\nimport { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport { LinkCollection } from \"../links/LinkCollection\";\nimport { BaseModel } from \"./BaseModel\";\n\nimport type { Contributions, ResourceData } from \"../../types/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { LinkModel } from \"../links/LinkModel\";\nimport type {\n ModelWithChildModels,\n ModularUIModel,\n ModularUIModelWithChildModels,\n} from \"../types\";\n\nexport abstract class ResourceModel<\n D extends ResourceData = ResourceData,\n C extends Contributions = Contributions,\n >\n extends BaseModel<D, C>\n implements ModularUIModel, ModelWithChildModels\n{\n private _key: string;\n private readonly _locale: string;\n private _lastServerUpdate: number;\n private readonly _links: LinkCollection;\n private _childModels: ModelWithChildModels[] = [];\n private _modularuiResponse: ModularUIResponse;\n private _connectKey: string | undefined;\n\n constructor(modularuiResponse: ModularUIResponse = new ModularUIResponse()) {\n super(\n modularuiResponse.data as D,\n modularuiResponse.contributions as C,\n modularuiResponse.modelOptions,\n );\n\n this._modularuiResponse = modularuiResponse;\n\n this._key = modularuiResponse.key;\n this._locale = modularuiResponse.locale;\n\n this._lastServerUpdate = Date.now();\n this._links = LinkCollection.create(\n this.data,\n this.contributions,\n this.resourcetype,\n this.modelOptions,\n );\n }\n\n get modularuiResponse() {\n return this._modularuiResponse;\n }\n\n set connectKey(key: string | undefined) {\n this._connectKey = key;\n }\n\n get connectKey() {\n return this._connectKey;\n }\n\n /**\n * Indicates the type of model\n */\n abstract get type(): string;\n\n /**\n * Property to render name of a model, is original name before compilation, transpilation, minification, etc\n */\n static get modelName(): string {\n throw new IllegalStateException(`No modelName set on the resource model`);\n }\n\n /**\n * Returns true when the model is supported based on configuration found in contributions\n */\n static isApplicableModel(data?: ModularUIResponse) {\n if (!(data instanceof ModularUIResponse)) {\n throw new IllegalArgumentException(\n \"Given argument for isApplicableModel is not a ModularUIResponse\",\n );\n }\n\n throw new Error(\n `No isApplicableModel condition set on model: ${this.modelName}`,\n );\n }\n\n get lastServerUpdate() {\n return this._lastServerUpdate;\n }\n\n set lastServerUpdate(lastServerUpdate) {\n this._lastServerUpdate = lastServerUpdate;\n }\n\n get locale() {\n return this._locale;\n }\n\n /**\n * Retrieve key\n */\n get key() {\n return this._key;\n }\n\n set key(key: string) {\n this._key = key;\n }\n\n /**\n * Retrieve type of resource\n */\n get resourcetype() {\n return this.getContributionAsString(\"resourcetype\", \"unknown\");\n }\n\n get label() {\n return this.getContributionAsString(\"label\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links() {\n return this._links;\n }\n\n get selflink() {\n const selflink = this.links.getLinkByKey(\"self\");\n if (selflink == undefined) {\n throw new IllegalStateException(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n return selflink;\n }\n\n /**\n * Return the href of the self link of this resource\n */\n get selfhref() {\n return this.selflink?.href;\n }\n\n // Below methods are used when a resource is requested using the ModularUIRequest, it retrieves any child models and adds them to this resource\n\n /**\n * Add links to expand on initialization of this model\n */\n getInitialChildModelLinks(): LinkModel[] {\n return [];\n }\n\n /**\n * Retrieve links of expanded child models\n */\n get childModels() {\n return this._childModels;\n }\n\n /**\n * Add child models to this model\n */\n addChildModels(\n models: ModularUIModelWithChildModels[] = [],\n errors: ErrorResponse[] = [],\n ) {\n const flattenModels = models?.flat();\n const flattenErrors = errors?.flat();\n\n this._childModels = flattenModels;\n\n this.setChildModels(flattenModels, flattenErrors);\n return this;\n }\n\n /**\n * Template to set expanded child models\n * Use this hook to separate the retrieved child models into the correct models.\n * @abstract\n */\n setChildModels(models: ModelWithChildModels[], errors: ErrorResponse[]) {\n if (!models && !errors) {\n throw new IllegalArgumentException(\"No models send to setChildModels\");\n }\n }\n}\n","import { pick } from \"lodash\";\nimport isPlainObject from \"lodash/isPlainObject\";\n\nimport { BooleanAttributeModel } from \"./BooleanAttributeModel\";\nimport { CaptchaAttributeModel } from \"./CaptchaAttributeModel\";\nimport { ChoiceAttributeModel } from \"./ChoiceAttributeModel\";\nimport { CompositeAttributeModel } from \"./CompositeAttributeModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { DatetimeAttributeModel } from \"./DatetimeAttributeModel\";\nimport { HelptextAttributeModel } from \"./HelptextAttributeModel\";\nimport { LabelAttributeModel } from \"./LabelAttributeModel\";\nimport { LayoutHintRuleCollection } from \"./layouthint-rules/LayoutHintRuleCollection\";\nimport { MemoAttributeModel } from \"./MemoAttributeModel\";\nimport { MoneyAttributeModel } from \"./MoneyAttributeModel\";\nimport { NumberAttributeModel } from \"./NumberAttributeModel\";\nimport { PasswordAttributeModel } from \"./PasswordAttributeModel\";\nimport { RangeAttributeModel } from \"./RangeAttributeModel\";\nimport { StringAttributeModel } from \"./StringAttributeModel\";\nimport { UploadAttributeModel } from \"./UploadAttributeModel\";\nimport { XMLAttributeModel } from \"./XMLAttributeModel\";\n\nimport type { Data, ErrorMessage } from \"../../types/types\";\nimport type { ActionFieldData } from \"../actions/types\";\nimport type { DetailData } from \"../detail/types\";\nimport type { FilterData } from \"../filters/types\";\nimport type { AnchorElementData } from \"../form/types\";\nimport type { ListDetailAttributeData } from \"../list/types\";\nimport type { ModelOptions } from \"../types\";\nimport type { UserData } from \"../user/types\";\nimport type {\n AnonymousDynamicSchema,\n AttributeContributions,\n AttributeData,\n AttributeModel,\n AttributeModularUIData,\n AttributeValue,\n ChildrenKey,\n CompositeDynamicSchema,\n DynamicSchema,\n MaybeAttributeValue,\n NamedDynamicSchema,\n} from \"./types\";\n\ntype BaseAttributeModelConstructor = new (\n attributeData: AttributeData,\n contributions: AttributeContributions,\n modelOptions?: ModelOptions,\n) => AttributeModel;\n\nexport class AttributeFactory {\n static get ATTRIBUTE_MODELS() {\n return [\n ChoiceAttributeModel,\n BooleanAttributeModel,\n HelptextAttributeModel,\n LabelAttributeModel,\n XMLAttributeModel,\n MemoAttributeModel,\n StringAttributeModel,\n DatetimeAttributeModel,\n MoneyAttributeModel,\n NumberAttributeModel,\n PasswordAttributeModel,\n UploadAttributeModel,\n CompositeAttributeModel,\n RangeAttributeModel,\n CaptchaAttributeModel,\n ];\n }\n\n static createAttribute<T extends AttributeModel = AttributeModel>(\n key: string,\n data: AttributeModularUIData,\n contributions: AttributeContributions,\n modelOptions?: ModelOptions,\n ): T {\n const Model = this.getAttributeModel(contributions);\n\n if (!Model) {\n throw new Error(\n \"Could not find model for contributions: \" + contributions,\n );\n }\n\n const children = contributions.children as Record<\n string,\n AttributeContributions\n >[];\n\n const attributeData = new AttributeDataMapper(\n key,\n data,\n Array.isArray(children)\n ? AttributeDataMapper.getChildrenKeys(children)\n : [],\n ).getData();\n\n const attribute = new Model(attributeData, contributions, modelOptions);\n\n LayoutHintRuleCollection.setLayoutHintRules(attribute);\n\n return attribute as T;\n }\n\n static getAttributeModel(\n contributions: AttributeContributions,\n ): BaseAttributeModelConstructor | undefined {\n return this.ATTRIBUTE_MODELS.find((model) =>\n model.isApplicableModel(contributions),\n ) as BaseAttributeModelConstructor | undefined;\n }\n}\n\nexport class AttributeDataMapper {\n private _key: string;\n private _data:\n | Data\n | AnchorElementData\n | FilterData\n | ListDetailAttributeData\n | UserData\n | DetailData\n | ActionFieldData;\n private _value: MaybeAttributeValue;\n private _links: Record<string, { href: string }>;\n private _children: AttributeData[] | AttributeData[][];\n\n constructor(\n key: string,\n data: AttributeModularUIData,\n childrenKeys: ChildrenKey[],\n ) {\n this._key = key;\n this._data = this.getAttributeData(key, data);\n this._value = this.getValue();\n this._links = this.getLinks();\n this._children = this.createChildren(data, childrenKeys);\n }\n\n private get key() {\n return this._key;\n }\n\n private get data() {\n return this._data;\n }\n\n get value() {\n return this._value;\n }\n\n get links() {\n return this._links;\n }\n\n get children() {\n return this._children;\n }\n\n private getAttributeData(key: string, data: AttributeModularUIData) {\n if (Array.isArray(data)) {\n return (\n data.find((attr) => {\n return (\n (\"elementid\" in attr && attr.elementid === key) ||\n (\"name\" in attr && attr.name === key) ||\n (\"param\" in attr && attr.param === key)\n );\n }) || ({} as AnchorElementData)\n );\n }\n return data;\n }\n\n private getValue() {\n let value;\n\n if (this.key in this.data) {\n value = this.data[this.key];\n } else if (\"values\" in this.data) {\n value = this.data.values;\n } else if (\"value\" in this.data) {\n value = this.data.value;\n } else if (\"suggestions\" in this.data) {\n value = this.data.suggestions;\n } else if (\"suggestion\" in this.data) {\n value = this.data.suggestion;\n } else if (\"options\" in this.data && Array.isArray(this.data.options)) {\n value = this.data.options\n .filter((option) => option.selected)\n .map((option) => option.code || option.key);\n }\n\n return value as MaybeAttributeValue;\n }\n\n private getDynamicschemaFromData() {\n if (\"dynamicschema\" in this.data) {\n const { dynamicschema } = this.data;\n if (Array.isArray(dynamicschema)) {\n return dynamicschema as AnonymousDynamicSchema | CompositeDynamicSchema;\n }\n return dynamicschema as NamedDynamicSchema;\n }\n return null;\n }\n\n /**\n * retrieve the dynamischema by the dynamischemaId\n * mentioned in the contributions of the attribute\n */\n private getDynamicSchema() {\n const dynamicschema = this.getDynamicschemaFromData();\n if (!dynamicschema) {\n return undefined;\n }\n\n if (Array.isArray(dynamicschema)) {\n return dynamicschema;\n }\n\n const dynamicschemaId = this.getDynamicSchemaId();\n if (typeof dynamicschemaId === \"string\") {\n if (\n dynamicschemaId in dynamicschema &&\n Array.isArray(dynamicschema[dynamicschemaId])\n ) {\n return dynamicschema[dynamicschemaId].map((attrDS) => {\n if (\"elements\" in attrDS) {\n return {\n ...attrDS,\n elements: {\n ...attrDS.elements,\n dynamicschema,\n },\n };\n }\n return attrDS;\n });\n }\n }\n\n return undefined;\n }\n\n private getDynamicSchemaId() {\n if (\n typeof this.data.dynamicschemaId === \"string\" ||\n typeof this.data.dynamicschemaId === \"number\"\n ) {\n return this.data.dynamicschemaId;\n }\n return this.key;\n }\n\n private getStatic() {\n return typeof this.data.static === \"boolean\" ? this.data.static : false;\n }\n\n private getLinks() {\n return pick(this.data._links, [\n \"concept\",\n \"download\",\n \"lookupOptions\",\n \"lookupList\",\n ]);\n }\n\n private getOptions() {\n return this.data.options;\n }\n\n private getMessage() {\n return this.data.message as ErrorMessage | undefined;\n }\n\n private isResult() {\n if (typeof this.data.isResult === \"boolean\") {\n return this.data.isResult;\n }\n return false;\n }\n\n private getReferenceDate() {\n if (typeof this.data.referenceDate === \"string\") {\n return this.data.referenceDate;\n }\n return undefined;\n }\n\n private getContent() {\n if (\"content\" in this.data) {\n const pickedContent = pick(this.data.content, [\n \"header\",\n \"label\",\n \"elements\",\n \"layouthint\",\n \"text\",\n ]);\n\n if (Object.keys(pickedContent).length > 0) {\n return pickedContent;\n }\n }\n return null;\n }\n\n getData(): AttributeData {\n return {\n key: this.key,\n value: this.value,\n static: this.getStatic(),\n _links: this.links,\n dynamicschema: this.getDynamicSchema(),\n dynamicschemaId: this.getDynamicSchemaId(),\n options: this.getOptions(),\n message: this.getMessage(),\n isResult: this.isResult(),\n referenceDate: this.getReferenceDate(),\n content: this.getContent(),\n children: this.children,\n };\n }\n\n static getChildrenKeys(\n children: Record<string, AttributeContributions>[],\n ): ChildrenKey[] {\n return children.map((child) => {\n const [childKey] = Object.keys(child);\n\n const isComposite =\n child[childKey].type === ATTRIBUTE_TYPE.RANGE ||\n child[childKey].type === ATTRIBUTE_TYPE.COMPOSITE;\n\n const dynamicschemaId = child[childKey].dynamicschemaId as\n | string\n | number;\n const childChildren = (\n isComposite ? child[childKey]?.children : []\n ) as Record<string, AttributeContributions>[];\n\n return {\n key: childKey,\n dynamicschemaId,\n children: this.getChildrenKeys(childChildren),\n };\n });\n }\n\n createChildren(data: AttributeModularUIData, childrenKeys: ChildrenKey[]) {\n // Check if the original data explicitly contains the key and is explicitly null.\n const keyExplicitlyNull = this.value === null;\n if (keyExplicitlyNull) {\n // Handling for when the value is explicitly null: set childData to null.\n return childrenKeys.map((keyObject: ChildrenKey) => {\n return this.createChild(data, { [keyObject.key]: null }, keyObject);\n });\n }\n\n const values = this.value;\n if (Array.isArray(values)) {\n return values.map((value) => {\n return childrenKeys.map((keyObject) => {\n const childData = this.childData(\n value as Record<string, AttributeValue>,\n this.key,\n keyObject.key,\n );\n return this.createChild(data, childData, keyObject);\n });\n });\n }\n\n return childrenKeys.map((keyObject) => {\n const childData = this.childData(data, this.key, keyObject.key);\n return this.createChild(data, childData, keyObject);\n });\n }\n\n private getDataContent(\n content: Record<string, AttributeData> | undefined,\n childKey: string,\n ) {\n if (content && childKey in content) {\n return content[childKey];\n }\n return undefined;\n }\n\n childData(data: AttributeModularUIData, parentKey: string, childKey: string) {\n if (Array.isArray(data)) {\n if (Array.isArray(this.data.elements)) {\n return this.data.elements.find(\n (element) => element.elementid === childKey,\n );\n }\n } else if (parentKey in data && isPlainObject(data[parentKey])) {\n const parentData = data[parentKey] as AttributeData;\n const dataContent = this.getDataContent(\n data.content as Record<string, AttributeData> | undefined,\n childKey,\n );\n return { ...parentData, content: dataContent };\n } else if (childKey in data && isPlainObject(data[childKey])) {\n return data[childKey];\n }\n\n if (isPlainObject(data)) {\n return data;\n }\n return {};\n }\n\n createChild(\n data: AttributeModularUIData,\n childData: AttributeModularUIData,\n keyObject: ChildrenKey,\n ) {\n const dynamicschema =\n \"dynamicschema\" in data\n ? (data.dynamicschema as DynamicSchema)\n : undefined;\n\n let dynamicschemaId = null;\n if (keyObject.dynamicschemaId) {\n dynamicschemaId = keyObject.dynamicschemaId;\n } else if (keyObject.key && typeof data === \"object\") {\n if (\"key\" in data && typeof data.key === \"string\") {\n dynamicschemaId = `${data.key}.${keyObject.key}`;\n }\n }\n\n return new AttributeDataMapper(\n keyObject.key,\n {\n ...childData,\n dynamicschema,\n dynamicschemaId,\n },\n keyObject.children,\n ).getData();\n }\n}\n","import { hasAllContentInData } from \"../../settings/Settings\";\nimport { LayoutHintCollection } from \"../layouthint/LayoutHintCollection\";\n\nimport type { ConceptDetailModel } from \"../concepts/ConceptDetailModel\";\nimport type { ConfigurationElements } from \"./types\";\n\nexport class ContentConfigurationElements {\n private _configuration: ConfigurationElements;\n private _hasConfiguration = false;\n\n constructor(configuration?: ConfigurationElements) {\n this._hasConfiguration = Array.isArray(configuration);\n this._configuration = configuration ?? [];\n }\n\n includeLayoutHints(hints: string[]) {\n const contentIncludeLayoutHint = this._configuration.filter(\n (configElement) => {\n const [key] = Object.keys(configElement);\n const config = configElement[key];\n\n if (!config.layouthint) {\n return false;\n }\n\n return config.layouthint.some((hint) => hints.includes(hint));\n },\n );\n\n return new ContentConfigurationElements(contentIncludeLayoutHint);\n }\n\n excludeLayoutHints(hints: string[]) {\n const contentExcludeLayoutHint = this._configuration.filter(\n (configElement) => {\n const [key] = Object.keys(configElement);\n const config = configElement[key];\n\n if (!config.layouthint) {\n return true;\n }\n\n return !config.layouthint.some((hint) => hints.includes(hint));\n },\n );\n\n return new ContentConfigurationElements(contentExcludeLayoutHint);\n }\n\n get config() {\n return this._configuration.map((elementConfig) => {\n const [key] = Object.keys(elementConfig);\n const config = elementConfig[key];\n\n let types: string[] = [];\n if (\"labelTypes\" in config) {\n types = config.labelTypes;\n } else if (\"propertyTypes\" in config) {\n types = config.propertyTypes;\n } else if (\"sectionReferenceTypes\" in config) {\n types = config.sectionReferenceTypes;\n } else if (\"textFragmentTypes\" in config) {\n types = config.textFragmentTypes;\n }\n\n return {\n type: key,\n label: config.label,\n types,\n layouthint: new LayoutHintCollection(config.layouthint),\n icon: \"icon\" in config ? config.icon : \"\",\n };\n });\n }\n\n hasConfig() {\n return this._hasConfiguration;\n }\n\n hasContent() {\n return this.config.some(\n (configElement) => configElement.type === \"configElement\",\n );\n }\n\n /**\n * Retrieve if the configuration has an element that has a specific layouthint,\n * makes it easy to indicate that the content needs to be presented in a certain way.\n */\n hasLayoutHint(hint: string) {\n return this.config.some((configElement) =>\n configElement.layouthint.has(hint),\n );\n }\n\n /**\n * Returns config elements by given types\n */\n byTypes(types: string[] = []) {\n if (!types || types.length === 0) {\n return this.config;\n }\n\n return this.config.filter((config) => types.includes(config.type));\n }\n\n /**\n * Get label config elements\n */\n get labelConfig() {\n return this.config.filter((config) => config.type === \"labelElement\");\n }\n\n /**\n * Get all section reference types\n */\n getAllSectionReferenceTypes() {\n return this.config\n .filter((item) => item.type === \"contentElement\")\n .flatMap((item) => item.types);\n }\n\n /**\n * Retrieve all content element configuration by content type\n */\n getContentElementConfigBySectionReferenceType(type: string) {\n return this.config.filter(\n (config) =>\n config.type === \"contentElement\" && config.types.includes(type),\n );\n }\n\n /**\n * Retrieve the first permitted label to render when a concept and contentConfiguration is available\n * Be aware that permission could be in place for labels from a concept.\n */\n getContentConfiguredLabel(concept?: ConceptDetailModel, defaultLabel = \"\") {\n const configuredLabelProperties =\n this.labelConfig.length > 0 ? this.labelConfig[0].types : [];\n\n if (concept && configuredLabelProperties.length > 0) {\n const configuredLabels = concept\n .getLabelElementByIds(configuredLabelProperties)\n .filter(\n (configuredLabel) =>\n configuredLabel.value && configuredLabel.value !== \"\",\n );\n\n if (configuredLabels.length > 0) {\n const contentConfiguredLabels = configuredLabelProperties\n .filter((configuredLabelProperty) => {\n configuredLabels.some(\n (configuredLabel) =>\n configuredLabelProperty === configuredLabel._id,\n );\n return false;\n })\n .map((configuredLabelProperty) => {\n const found = configuredLabels.find(\n (configuredLabel) =>\n configuredLabel._id === configuredLabelProperty,\n );\n return found;\n });\n\n if (\n contentConfiguredLabels.length > 0 &&\n contentConfiguredLabels[0] !== undefined\n ) {\n return contentConfiguredLabels[0].value;\n }\n }\n }\n\n return defaultLabel;\n }\n\n /**\n * Indicates if content comes from the data service\n */\n get hasContentFromData() {\n return hasAllContentInData();\n }\n}\n","import { BaseCollection } from \"./BaseCollection\";\n\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { LinkModel } from \"../links/LinkModel\";\nimport type { ModelWithChildModels } from \"../types\";\n\n/**\n * The ResourceCollection makes it possible to add child models to a collection of models\n * These child models are fetched using the ModularUI util\n */\nexport abstract class ResourceCollection<T extends ModelWithChildModels>\n extends BaseCollection<T>\n implements ModelWithChildModels\n{\n /**\n * Retrieve all child model links and flatten it into an array with single entries, removing all undefined items\n */\n getInitialChildModelLinks() {\n const initialChildModelLinks: LinkModel[] = [];\n\n this.collection.forEach((item: T) => {\n if (typeof item?.getInitialChildModelLinks === \"function\") {\n initialChildModelLinks.push(...item.getInitialChildModelLinks());\n }\n });\n\n return initialChildModelLinks;\n }\n\n /**\n * Pass through models for setchildmodels to items of this collection\n */\n setChildModels(models: ModelWithChildModels[], errors: ErrorResponse[]) {\n this.collection.forEach((item) => {\n if (typeof item[\"setChildModels\"] === \"function\") {\n item.setChildModels(models, errors);\n }\n });\n }\n}\n","import { ResourceModel } from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type {\n ConceptTypeDetailData,\n LabelType,\n PropertyType,\n SectionReferenceType,\n TextFragmentType,\n} from \"./types\";\n\n/**\n * Model for concept type details, available through modelcatalog\n */\nexport class ConceptTypeDetailModel extends ResourceModel<ConceptTypeDetailData> {\n get type(): string {\n return \"ConceptTypeDetail\";\n }\n\n static override get modelName(): string {\n return \"ConceptTypeDetailModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"ConceptTypeDetail\";\n }\n\n override get key() {\n return this.getDataAsString(\"_id\", \"concepttype\");\n }\n\n /**\n * Get concept type label\n */\n override get label() {\n return this.getDataAsString(\"label\", \"\");\n }\n\n get isCoreTaxonomy() {\n return this.getDataAsBoolean(\"coreTaxonomy\", false);\n }\n\n /**\n * Get concept type icon\n */\n get icon() {\n return this.getDataAsString(\"icon\", \"\");\n }\n\n /**\n * Get concept type text color\n */\n get textColor() {\n return this.getDataAsString(\"textColor\", \"#000\");\n }\n\n /**\n * Get concept type background color\n */\n get backgroundColor() {\n return this.getDataAsString(\"backgroundColor\", \"#fff\");\n }\n\n /**\n * Get concept line color\n */\n get borderColor() {\n return this.getDataAsString(\"lineColor\", \"#000\");\n }\n\n /**\n * Get label types\n */\n get labelTypes(): LabelType[] {\n return this.getDataAsArray<LabelType>(\"labelTypes\") || [];\n }\n\n /**\n * Get propertyTypes\n */\n get propertyTypes(): PropertyType[] {\n return this.getDataAsArray(\"propertyTypes\") || [];\n }\n\n /**\n * Get textFragmentTypes\n */\n get textFragmentTypes(): TextFragmentType[] {\n return this.getDataAsArray(\"textFragmentTypes\") || [];\n }\n\n /**\n * Get sectionReferenceTypes\n */\n get sectionReferenceTypes(): SectionReferenceType[] {\n return this.getDataAsArray(\"sectionReferenceTypes\") || [];\n }\n\n isOfConceptType(conceptTypeHref: string) {\n return this.selfhref?.equals(conceptTypeHref);\n }\n}\n","import { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { LinkCollection } from \"../links/LinkCollection\";\nimport { LinkModel } from \"../links/LinkModel\";\nimport { ConceptTypeDetailModel } from \"./ConceptTypeDetailModel\";\n\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelOptions, ModelWithChildModels } from \"../types\";\nimport type { ConceptLinkData } from \"./types\";\n\nexport class ConceptLinkModel\n extends BaseModel<ConceptLinkData>\n implements ModelWithChildModels\n{\n private _entryDate: ISO_DATE | undefined;\n private _links: LinkCollection;\n private _conceptType: ConceptTypeDetailModel | undefined;\n\n constructor(\n data?: ConceptLinkData,\n entryDate?: ISO_DATE,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\n this._entryDate = entryDate;\n this._links = LinkCollection.create(\n data ?? {},\n null,\n \"concept\",\n this.modelOptions,\n );\n }\n\n get type() {\n return \"ConceptLinkModel\";\n }\n\n getInitialChildModelLinks() {\n if (this.conceptTypeLink) {\n this.conceptTypeLink.isCacheable = true;\n return [this.conceptTypeLink];\n }\n\n return [];\n }\n\n setChildModels(models: ModelWithChildModels[], _errors: ErrorResponse[]) {\n if (this.conceptTypeLink) {\n const href = this.conceptTypeLink.href;\n const conceptTypeModel = models.find((model) => {\n if (model instanceof ConceptTypeDetailModel) {\n return model.selfhref?.equalsWithParameters(href);\n }\n return false;\n });\n this.conceptType = conceptTypeModel as ConceptTypeDetailModel | undefined;\n }\n }\n\n /**\n * Retrieve concept type\n */\n get conceptType() {\n return this._conceptType;\n }\n\n /**\n * Set concept type\n */\n set conceptType(conceptType: ConceptTypeDetailModel | undefined) {\n this._conceptType = conceptType;\n }\n\n /**\n * Retrieve key\n */\n get key() {\n return this.getDataAsString(\"_id\", \"\");\n }\n\n /**\n * Retrieve label\n */\n get label() {\n const label = this.getDataAsString(\"label\");\n\n if (label) {\n return label;\n }\n\n return this.getDataAsString(\"conceptLabel\", \"\");\n }\n\n /**\n * Getting the links of the resource\n */\n get links() {\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink() {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink === null) {\n throw new Error(\n `Could not find self link for ${\n this.key === null ? \"unknown\" : this.key\n }`,\n );\n }\n\n return selflink;\n }\n\n /**\n * Self href of concept\n */\n get selfhref() {\n if (this._entryDate) {\n return this.selflink?.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this._entryDate,\n );\n }\n\n return this.selflink?.href;\n }\n\n get conceptTypeLink() {\n return this.links.getLinkByKey(\"concepttype\");\n }\n\n /**\n * Concept type href of concept\n */\n get concepttypeHref() {\n return this.conceptTypeLink?.href ?? null;\n }\n\n get taxonomyType() {\n return \"default\";\n }\n\n get modelCategory() {\n return this.getDataAsString(\"modelCategory\");\n }\n\n get sectionId() {\n return this.data.section?._id;\n }\n\n get fragment() {\n return this.data.section?.fragment;\n }\n\n asLinkModel() {\n const link = LinkModel.create(this.key, \"\", this.label, this.modelOptions);\n if (this.selfhref) {\n link.href = this.selfhref;\n }\n return link;\n }\n}\n","import { BaseModel } from \"../base/BaseModel\";\nimport { ConceptLinkModel } from \"./ConceptLinkModel\";\n\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { Href } from \"../href/Href\";\nimport type { ModelOptions, ModelWithChildModels } from \"../types\";\nimport type {\n RelationData,\n RelationDirection,\n RelationTypeType,\n} from \"./types\";\n\nexport class ConceptRelationModel\n extends BaseModel<RelationData>\n implements ModelWithChildModels\n{\n private _concept: ConceptLinkModel;\n\n constructor(\n relation: RelationData,\n entryDate?: ISO_DATE,\n modelOptions?: ModelOptions,\n ) {\n super(relation, undefined, modelOptions);\n\n this._concept = new ConceptLinkModel(\n relation?.concept,\n entryDate,\n this.modelOptions,\n );\n }\n\n get selfhref(): Href | undefined {\n throw new Error(\"Method not implemented.\");\n }\n\n getInitialChildModelLinks() {\n return this.concept.getInitialChildModelLinks();\n }\n\n setChildModels(models: ModelWithChildModels[], errors: ErrorResponse[]) {\n this.concept.setChildModels(models, errors);\n }\n\n get type() {\n return this.getDataAsString(\"relationType\", \"\");\n }\n\n /**\n * Get key of relation\n */\n get key() {\n return this.type;\n }\n\n /**\n * Get Label of relation\n */\n get label() {\n return this.getDataAsString(\"relationLabel\");\n }\n\n /**\n * Get direction of relation\n */\n get direction() {\n return this.getDataAsString(\"relationDirection\") as RelationDirection;\n }\n\n /**\n * Get type of relation type,\n */\n get relationTypeType() {\n return this.getDataAsString(\"relationTypeType\", \"None\") as RelationTypeType;\n }\n\n get condition() {\n return this.getDataAsString(\"relationCondition\");\n }\n\n get properties() {\n return this.getDataAsArray(\"properties\");\n }\n\n /**\n * Get Text fragments\n */\n get textfragments() {\n return this.getDataAsArray(\"textFragments\");\n }\n\n /**\n * Get other concept\n */\n get concept() {\n return this._concept;\n }\n\n /**\n * Set concept information\n */\n set concept(concept) {\n this._concept = concept;\n }\n}\n","import { getContextPathModularUI } from \"../../settings/Paths\";\nimport { ResourceCollection } from \"../base/ResourceCollection\";\nimport { ConceptRelationModel } from \"./ConceptRelationModel\";\n\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { ModelOptions } from \"../types\";\nimport type { RelationData } from \"./types\";\n\nexport class ConceptRelationCollection extends ResourceCollection<ConceptRelationModel> {\n private _entryDate: ISO_DATE | undefined;\n private _modelOptions: ModelOptions;\n\n constructor(\n relations: (RelationData | ConceptRelationModel)[] | RelationData,\n entryDate: ISO_DATE | undefined,\n modelOptions?: ModelOptions,\n ) {\n super();\n\n this._entryDate = entryDate;\n this._modelOptions = modelOptions || {\n origin: \"\",\n contextPath: getContextPathModularUI(),\n };\n\n if (relations) {\n this.createCollection(relations, entryDate);\n }\n }\n\n private createCollection(\n relations: (RelationData | ConceptRelationModel)[] | RelationData,\n entryDate: ISO_DATE | undefined,\n ) {\n if (Array.isArray(relations)) {\n relations.forEach((relation) => {\n if (relation instanceof ConceptRelationModel) {\n this.add(relation);\n } else {\n this.add(\n new ConceptRelationModel(relation, entryDate, this._modelOptions),\n );\n }\n });\n } else {\n this.add(\n new ConceptRelationModel(relations, entryDate, this._modelOptions),\n );\n }\n }\n\n /**\n * Get unique list of relation types\n */\n get types() {\n return this.collection\n .filter(\n (relation, pos, arr) =>\n arr.findIndex((item) => item.key === relation.key) === pos,\n )\n .map((relation) => ({\n key: relation.key,\n label: relation.label,\n }));\n }\n\n /**\n * Get relation by its type\n */\n byType(type: string) {\n return new ConceptRelationCollection(\n this.filter((relation) => relation.key === type),\n this._entryDate,\n this._modelOptions,\n );\n }\n\n get incoming(): ConceptRelationCollection {\n return new ConceptRelationCollection(\n this.filter((relation) => relation.direction === \"incoming\"),\n this._entryDate,\n this._modelOptions,\n );\n }\n\n get outgoing(): ConceptRelationCollection {\n return new ConceptRelationCollection(\n this.filter((relation) => relation.direction === \"outgoing\"),\n this._entryDate,\n this._modelOptions,\n );\n }\n\n hasIncoming() {\n return this.incoming.length > 0;\n }\n\n hasOutgoing() {\n return this.outgoing.length > 0;\n }\n}\n","import hash from \"hash-it\";\n\nimport type { SectionFragment } from \"../../models/concepts/types\";\nimport type { Href } from \"../../models/href/Href\";\n\n/**\n * https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n */\nexport const createHash = (str: string) => {\n return hash(str);\n};\n\nexport const createHashFromHref = (\n href: Href | undefined,\n fragment?: SectionFragment,\n) => {\n if (href == null) {\n return 0;\n }\n\n const hrefString = href.hash\n ? [href.toString(), href.hash].join(\"#\")\n : href.toString();\n\n if (fragment) {\n return hash({ hrefString, fragment });\n }\n\n return hash(hrefString);\n};\n","import { ResourceModel } from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ContentTypeContributions, ContentTypeData } from \"./types\";\n\nexport class ContentTypeModel extends ResourceModel<\n ContentTypeData,\n ContentTypeContributions\n> {\n get type() {\n return \"ContentType\";\n }\n\n static override get modelName() {\n return \"ContentTypeModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"ContentTypeDetail\";\n }\n\n override get label() {\n return this.getDataAsString(\"label\", \"\");\n }\n\n get icon() {\n return this.iconLarge;\n }\n\n get iconSmall() {\n return this.getDataAsString(\"iconSmall\");\n }\n\n get iconMedium() {\n return this.getDataAsString(\"iconMedium\");\n }\n\n get iconLarge() {\n return this.getDataAsString(\"iconLarge\");\n }\n\n get description() {\n return this.getDataAsString(\"description\");\n }\n}\n","import { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\nimport { getSetting } from \"../../settings/Settings\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { Href } from \"../href/Href\";\nimport { LinkCollection } from \"../links/LinkCollection\";\nimport { ContentTypeModel } from \"./ContentTypeModel\";\n\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { LinkModel } from \"../links/LinkModel\";\nimport type {\n ModelOptions,\n ModelWithChildModels,\n ModularUIModel,\n} from \"../types\";\nimport type { ContentLinkData } from \"./types\";\n\n/**\n * Link to a concept\n */\nexport class ContentLinkModel\n extends BaseModel<ContentLinkData>\n implements ModelWithChildModels\n{\n private _links: LinkCollection;\n private _entryDate: ISO_DATE | undefined;\n private _contentType: ContentTypeModel | undefined;\n private _items: ContentLinkModel[];\n\n constructor(\n data: ContentLinkData,\n entryDate?: ISO_DATE,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\n\n this._entryDate = entryDate;\n this._links = LinkCollection.create(\n this.data,\n this.contributions,\n \"content\",\n this.modelOptions,\n );\n this._items = [];\n }\n\n get type() {\n return \"ContentLinkModel\";\n }\n\n getInitialChildModelLinks(): LinkModel[] {\n if (this.contentTypeLink) {\n this.contentTypeLink.isCacheable = true;\n return [this.contentTypeLink];\n }\n\n return [];\n }\n\n setChildModels(models: ModelWithChildModels[], _errors: ErrorResponse[]) {\n if (this.contentTypeLink) {\n const href = this.contentTypeLink.href;\n this.contentType = models.find((model): model is ContentTypeModel => {\n if (model instanceof ContentTypeModel) {\n return model.selfhref?.equalsWithParameters(href);\n }\n return false;\n });\n }\n }\n\n /**\n * Retrieve content type\n */\n get contentType() {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ModularUIModel | undefined) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : undefined;\n }\n\n set entryDate(entryDate: ISO_DATE) {\n this._entryDate = entryDate;\n }\n\n /**\n * Retrieve key\n */\n get key() {\n return this.getDataAsString(\"_id\", \"\");\n }\n\n /**\n * Retrieve label\n */\n get label() {\n return this.getDataAsString(\"label\", \"\");\n }\n\n /**\n * Retrieve the label of the source a link to a section belongs to\n */\n get sourceLabel() {\n return this.getDataAsString(\"sourceLabel\");\n }\n\n get abbreviation() {\n return (\n this.getDataAsString(\"abbreviation\") ||\n this.getDataAsString(\"sourceAbbreviation\")\n );\n }\n\n get section() {\n return this.data.section;\n }\n\n /**\n * Encode the content-identifier of the path to the content resource.\n * This makes it a single uri part, which can be used on routes to make nested routes\n */\n get encodedHref() {\n const startURI = \"/content/\";\n const selfHref = new Href(this.selfhref.path, \"\", this.modelOptions);\n const href = selfHref.path;\n\n const sourceId = this.section\n ? href.substring(startURI.length, href.lastIndexOf(\"/\"))\n : href.substring(startURI.length);\n\n if (this.section != null) {\n const encodedSection = encodeURIComponent(this.section);\n selfHref.path = `${startURI}${encodeURIComponent(sourceId)}/${encodedSection}`;\n } else {\n selfHref.path = `${startURI}${encodeURIComponent(sourceId)}`;\n }\n\n if (this._entryDate !== null) {\n selfHref.addParameter(TIMEVERSION_FILTER_NAME, this._entryDate);\n }\n\n return selfHref;\n }\n\n /**\n * Getting the links of the resource\n */\n get links() {\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink() {\n let selflink = this.links.getLinkByKey(\"self\");\n\n if (getSetting(\"COMPLETE_SOURCE\", false)) {\n if (this.links.hasLinkByKey(\"content\")) {\n selflink = this.links.getLinkByKey(\"content\");\n }\n\n if (\n this.section != null &&\n selflink &&\n !selflink.href.path.endsWith(encodeURIComponent(this.section))\n ) {\n selflink.href.addParameter(\"complete\", \"true\");\n selflink.href.hash = this.section || \"\";\n }\n }\n\n if (!selflink) {\n throw new Error(\n `Could not find self link for '${this.key || \"unknown\"}'`,\n );\n }\n\n if (!selflink.href.state) {\n selflink.href.state = {\n fragment: this.fragment,\n };\n } else {\n // @ts-expect-error not sure how to define state here\n selflink.href.state.fragment = this.fragment;\n }\n\n return selflink;\n }\n\n get contentHref(): Href {\n let href = this.data._links.self.href;\n if (this.data._links.content) {\n href = this.data._links.content.href;\n } else if (this.section) {\n const section = encodeURIComponent(this.section);\n if (href.endsWith(section)) {\n href = href.substring(0, href.lastIndexOf(\"/\" + section));\n }\n }\n\n return new Href(href)\n .addParameter(\"complete\", \"true\")\n .addParameter(TIMEVERSION_FILTER_NAME, this._entryDate);\n }\n\n get sectionHref(): Href | null {\n const section = this.section;\n if (section) {\n const contentHref = this.contentHref;\n const sectionHref = new Href(\n contentHref.path + \"/\" + encodeURIComponent(this.section),\n );\n return sectionHref.addParameter(TIMEVERSION_FILTER_NAME, this._entryDate);\n }\n return null;\n }\n\n /**\n * Self href of concept\n */\n get selfhref() {\n if (this._entryDate) {\n return this.selflink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this._entryDate,\n );\n }\n\n return this.selflink.href;\n }\n\n get subSectionID() {\n return this.selfhref.hash;\n }\n\n get contentTypeLink() {\n return this.links.getLinkByKey(\"contenttype\");\n }\n\n /**\n * Concept type href of concept\n */\n get contentTypeHref() {\n return this.contentTypeLink?.href;\n }\n\n get fragment() {\n return this.data.sectionFragment;\n }\n\n /**\n * Children of link model in TOC\n */\n set items(items: ContentLinkModel[]) {\n this._items = items;\n }\n\n get items() {\n return this._items;\n }\n}\n","import { createHashFromHref } from \"../../utils/helpers/createHash\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { ContentLinkModel } from \"../content/ContentLinkModel\";\nimport { LinkCollection } from \"../links/LinkCollection\";\n\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { SectionFragment, SourceReferenceData } from \"./types\";\n\nexport class SourceReferenceModel extends BaseModel<SourceReferenceData> {\n private _entryDate: ISO_DATE | undefined;\n private _links: LinkCollection;\n\n constructor(sourceReference?: SourceReferenceData, entryDate?: ISO_DATE) {\n super(sourceReference);\n\n this._links = LinkCollection.create(\n this.data,\n null,\n \"concept\",\n this.modelOptions,\n );\n this._entryDate = entryDate;\n }\n\n get links() {\n return this._links;\n }\n\n get link() {\n const selfhref = this.selfhref?.path;\n const content = this.links.getLinkByKey(\"content\")?.href.path;\n\n if (selfhref && content) {\n return new ContentLinkModel(\n {\n ...this.data,\n label: this.label,\n section: this.sectionId,\n sectionFragment: this.fragment,\n },\n this._entryDate,\n this.modelOptions,\n );\n }\n\n return;\n }\n\n get selflink() {\n return this.links.getLinkByKey(\"self\");\n }\n\n get selfhref() {\n return this.selflink?.href;\n }\n\n get type() {\n return this.getDataAsString(\"type\", \"\");\n }\n\n get label() {\n return this.getDataAsString(\"label\");\n }\n\n get sourceLabel() {\n return this.getDataAsString(\"sourceLabel\");\n }\n\n get sourceAbbreviation() {\n return this.getDataAsString(\"sourceAbbreviation\");\n }\n\n get referenceHash() {\n if (this.selfhref) {\n return createHashFromHref(this.selfhref);\n }\n return;\n }\n\n get sectionId() {\n return this.getDataAsString(\"sectionId\");\n }\n\n get fragment() {\n return this.getDataAsObject(\"sectionFragment\") as SectionFragment;\n }\n}\n","import { BaseCollection } from \"../base/BaseCollection\";\nimport { SourceReferenceModel } from \"./SourceReferenceModel\";\n\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { SourceReferenceData } from \"./types\";\n\nexport class SourceReferenceCollection extends BaseCollection<SourceReferenceModel> {\n constructor(sourceReference?: SourceReferenceData[], entryDate?: ISO_DATE) {\n super();\n\n this.collection = this.createSourceReferences(\n sourceReference || [],\n entryDate,\n );\n }\n\n private createSourceReferences(\n sourceReference: SourceReferenceData[],\n entryDate?: ISO_DATE,\n ) {\n return sourceReference.map(\n (sourceReference) => new SourceReferenceModel(sourceReference, entryDate),\n );\n }\n\n byTypes(types: string) {\n return this.filter((sourceRef) => types.includes(sourceRef.type));\n }\n}\n","import { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { ConceptRelationCollection } from \"./ConceptRelationCollection\";\nimport { ConceptTypeDetailModel } from \"./ConceptTypeDetailModel\";\nimport { SourceReferenceCollection } from \"./SourceReferenceCollection\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type {\n ConceptDetailData,\n LabelData,\n PropertyData,\n SourceReferenceData,\n TaxonomyType,\n TextFragmentData,\n} from \"./types\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport class ConceptDetailModel extends ResourceModel<ConceptDetailData> {\n private _conceptType: ConceptTypeDetailModel | undefined;\n private _relations: ConceptRelationCollection;\n private _sourceReferences: SourceReferenceCollection | undefined;\n\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate,\n this.modelOptions,\n );\n }\n\n get type() {\n return \"ConceptDetail\";\n }\n\n static override get modelName() {\n return \"ConceptDetailModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"ConceptDetail\";\n }\n\n override getInitialChildModelLinks() {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n errors: ErrorResponse[],\n ) {\n const conceptTypeModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel,\n );\n\n if (conceptTypeModel instanceof ConceptTypeDetailModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models, errors);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n override get key() {\n return this.getDataAsString(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n override get selfhref() {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Available diagrams for the concept, most of the time just one\n */\n get diagramLinks() {\n return this.links.getLinksByGroup(\"diagram\");\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType() {\n return this._conceptType;\n }\n\n set conceptType(conceptType) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n override get label() {\n return this.getDataAsString(\"conceptLabel\", \"\");\n }\n\n /**\n * Get model category of the concept\n */\n get modelCategory() {\n return this.getDataAsString(\"modelCategory\", \"\");\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType() {\n return this.getDataAsString(\"taxonomyType\") as TaxonomyType | undefined;\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection() {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula() {\n return this.getDataAsString(\"formula\");\n }\n\n /**\n * Get additional labels of concept\n */\n get labels() {\n if (this.conceptType?.labelTypes) {\n const labels = this.getDataAsArray(\"labels\", []) as LabelData[];\n\n return this.conceptType.labelTypes.map((labelType) => {\n const labelData = labels.find((l) => l.type === labelType._id);\n\n return {\n ...labelType,\n ...labelData,\n };\n });\n }\n\n return [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: string[]) {\n return this.labels.filter((label) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties() {\n if (this.conceptType?.propertyTypes) {\n const properties = this.getDataAsArray(\n \"properties\",\n [],\n ) as PropertyData[];\n\n return this.conceptType.propertyTypes.map((propertyType) => {\n const setting = properties.find(\n (property) => property.type === propertyType._id,\n );\n\n return {\n ...propertyType,\n ...setting,\n };\n });\n }\n\n return [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: string[]) {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id),\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments() {\n const textFragments = this.getDataAsArray(\n \"textFragments\",\n [],\n ) as TextFragmentData[];\n\n const configuredTextFragments = textFragments.map((textFragment) => {\n const textFragmentConfig = this.conceptType?.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id,\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n });\n\n const notConfiguredTextFragments = this.conceptType?.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n return !textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id,\n );\n })\n : [];\n\n return [...configuredTextFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: string[]) {\n return this.textfragments.filter(\n (textfragment) =>\n \"type\" in textfragment &&\n typeof textfragment.type === \"string\" &&\n keys.includes(textfragment.type),\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(availableLocales: string[] = []) {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate,\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n getSourceReferencesForCurrentLanguage(availableLocales: string[]) {\n const sourceReferences = this.getDataAsArray(\n \"sourceReferences\",\n [],\n ) as SourceReferenceData[];\n if (sourceReferences.length === 0) {\n return [];\n }\n\n const LANGUAGE_POSTFIX_LENGTH = 3;\n const availableLanguagesInSourceReferences = sourceReferences.map(\n (sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n ),\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (availableLanguagesInSourceReferences.includes(currentLanguagePostfix)) {\n // return all sourceReferences that end with language that is selected\n return sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix),\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`,\n );\n\n // return all sourceReferences that do not end with language postfix\n return sourceReferences.filter((sourceReference) => {\n const lang = sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH,\n );\n return !availableLanguages.includes(lang);\n });\n }\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate() {\n return this.getDataAsString(\n `filter.${TIMEVERSION_FILTER_NAME}.value`,\n ) as ISO_DATE;\n }\n\n /**\n * Indicates if the given concept type id or href exists in the hierarchy of concept types for this concept\n */\n isOfConceptType(conceptTypeId: string) {\n return this.conceptType?.isOfConceptType(conceptTypeId) ?? false;\n }\n}\n","import { immerable } from \"immer\";\n\nimport { LayoutHintCollection } from \"../layouthint/LayoutHintCollection\";\n\nimport type { MessageParameters } from \"../../types/types\";\n\nexport class ErrorModel {\n [immerable] = true;\n\n private _id: string;\n private _defaultMessage: string | undefined;\n private _parameters: MessageParameters | undefined;\n private _isClientConstraint: boolean;\n private _layouthint: LayoutHintCollection;\n\n constructor(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n isClientConstraint = false,\n layouthint: string[] | LayoutHintCollection = new LayoutHintCollection(),\n ) {\n this._id = id;\n this._parameters = parameters;\n this._defaultMessage = defaultMessage;\n this._isClientConstraint = isClientConstraint;\n this._layouthint = Array.isArray(layouthint)\n ? new LayoutHintCollection(layouthint)\n : layouthint;\n }\n\n /**\n * Get id of error\n */\n get id(): string {\n return this._id;\n }\n\n get defaultMessage() {\n return this._defaultMessage;\n }\n\n get parameters() {\n return this._parameters;\n }\n\n get isClientConstraint() {\n return this._isClientConstraint ?? false;\n }\n\n get layouthint() {\n return this._layouthint;\n }\n\n get isMandatoryConstraint() {\n return this.id === \"Constraint.Mandatory\";\n }\n\n /**\n * Returns a message object from the error\n */\n getMessage() {\n return {\n id: this.id,\n defaultMessage: this.defaultMessage ?? \"\",\n parameters: this.parameters ?? {},\n };\n }\n}\n","import { BaseCollection } from \"../base/BaseCollection\";\nimport { ErrorModel } from \"./ErrorModel\";\n\nimport type { MessageParameters } from \"../../types/types\";\nimport type { ConstraintModel } from \"../attributes/types\";\nimport type { LayoutHintCollection } from \"../layouthint/LayoutHintCollection\";\n\nexport enum ErrorCollectionType {\n FORM,\n FORMOBJECT,\n ATTRIBUTE,\n COMPOSITE_CHILDREN,\n}\n\nexport class ErrorCollection extends BaseCollection<ErrorModel> {\n private _type: string | ErrorCollectionType | undefined;\n\n constructor(\n type?: string | ErrorCollectionType,\n errorCollection?: ErrorCollection,\n ) {\n super();\n\n this._type = type;\n this.collection = [];\n\n if (errorCollection) {\n this.collection = [...errorCollection.collection];\n }\n }\n\n get type(): string | ErrorCollectionType | undefined {\n return this._type;\n }\n\n get serverErrors() {\n return this.collection.filter((error) => !error.isClientConstraint);\n }\n\n findById(id: string) {\n return this.collection.findIndex((item) => item.id === id);\n }\n\n /**\n * Add an error to the collection\n */\n addError(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n layouthint?: string[] | LayoutHintCollection,\n ) {\n const itemIdx = this.findById(id);\n\n if (itemIdx > -1) {\n this.removeByIndex(itemIdx);\n }\n\n this.add(new ErrorModel(id, defaultMessage, parameters, false, layouthint));\n }\n\n removeError(id: string) {\n const itemIdx = this.findById(id);\n this.removeByIndex(itemIdx);\n }\n\n /**\n * Add a server error to the collection\n */\n addServerError(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n layouthint?: string[] | LayoutHintCollection,\n ) {\n if (parameters) {\n this.addError(id, defaultMessage, parameters, layouthint);\n } else {\n this.addError(id, defaultMessage, undefined, layouthint);\n }\n }\n\n removeServerError(id: string) {\n this.removeError(id);\n }\n\n removeServerErrors() {\n this.serverErrors.forEach((error) => {\n this.removeError(error.id);\n });\n }\n\n addErrors(errors: ErrorModel[]) {\n this.collection = [...this.collection, ...errors];\n }\n\n /**\n * Add constraints to error collection\n */\n addConstraints(constraints: ConstraintModel[]) {\n this.collection = [\n ...this.collection,\n ...constraints.map(\n (constraint) =>\n new ErrorModel(\n constraint.id,\n constraint.defaultMessage,\n constraint.parameters as MessageParameters,\n true,\n ),\n ),\n ];\n }\n\n /**\n * Indicates if a mandatory constraint is available and if it is in error.\n * Rationale: When a mandatory constraint is in error other constraint probably don't mather because there is no value to check\n */\n hasMandatoryError() {\n return this.collection.some((error) => error.isMandatoryConstraint);\n }\n}\n","import { immerable } from \"immer\";\n\nimport { hasAllContentInData } from \"../../settings/Settings\";\nimport { retrieveText } from \"../../utils/helpers/text\";\nimport { SectionModel } from \"../content/SectionModel\";\nimport { LayoutHintCollection } from \"../layouthint/LayoutHintCollection\";\n\nimport type {\n AttributeContentElement,\n AttributePropertyElement,\n AttributeTextFragmentElement,\n ContentData,\n} from \"./types\";\n\ninterface MappedContentElement {\n contentElement: {\n label: string;\n layouthint: LayoutHintCollection;\n sections: SectionModel[];\n };\n}\n\nexport class AttributeContent {\n [immerable] = true;\n private _content: ContentData | undefined;\n\n constructor(content?: ContentData) {\n this._content = content;\n }\n\n static create(content: unknown) {\n if (\n typeof content === \"object\" &&\n content !== null &&\n \"elements\" in content &&\n Array.isArray(content.elements)\n ) {\n return new AttributeContent(content as ContentData);\n }\n return new AttributeContent();\n }\n\n get fromData() {\n return hasAllContentInData();\n }\n\n get header() {\n let headerLabel = null;\n let headerDescription = null;\n\n const label = this._content?.header?.label;\n if (label) {\n headerLabel = label;\n }\n\n const description = this._content?.header?.description;\n if (description) {\n if (typeof description === \"object\" && \"message\" in description) {\n headerDescription = description.message;\n } else if (typeof description === \"string\") {\n headerDescription = description;\n }\n }\n\n return { label: headerLabel, description: headerDescription };\n }\n\n mapToPropertyElement(element: AttributePropertyElement) {\n const contentElement = element.propertyElement;\n return {\n propertyElement: {\n label: contentElement.label,\n layouthint: new LayoutHintCollection(contentElement.layouthint),\n properties:\n \"properties\" in contentElement ? contentElement.properties : [],\n },\n };\n }\n\n mapToTextFragmentElement(element: AttributeTextFragmentElement) {\n const contentElement = element.textFragmentElement;\n return {\n textFragmentElement: {\n label: contentElement.label,\n layouthint: new LayoutHintCollection(contentElement.layouthint),\n textfragments:\n \"textfragments\" in contentElement\n ? contentElement.textfragments.map((textfragment) => {\n return typeof textfragment === \"object\"\n ? {\n ...textfragment,\n text: retrieveText(textfragment.text) || \"\",\n }\n : textfragment;\n })\n : [],\n },\n };\n }\n\n mapToContentElement(element: AttributeContentElement) {\n const contentElement = element.contentElement;\n return {\n contentElement: {\n label: contentElement.label,\n layouthint: new LayoutHintCollection(contentElement.layouthint),\n sections:\n \"sections\" in contentElement\n ? contentElement.sections.map(\n (section) => new SectionModel(section),\n )\n : [],\n },\n };\n }\n\n get elements() {\n if (Array.isArray(this._content?.elements)) {\n return this._content.elements\n .filter((element) => element != undefined)\n .map((element) => {\n const key = Object.keys(element)[0];\n switch (key) {\n case \"propertyElement\":\n return this.mapToPropertyElement(\n element as AttributePropertyElement,\n );\n case \"textFragmentElement\":\n return this.mapToTextFragmentElement(\n element as AttributeTextFragmentElement,\n );\n case \"contentElement\":\n return this.mapToContentElement(\n element as AttributeContentElement,\n );\n default:\n return element;\n }\n });\n }\n return [];\n }\n\n get label() {\n return this._content?.label;\n }\n\n get properties() {\n return this.elements\n .filter((element) => {\n const key = Object.keys(element)[0];\n return key === \"propertyElement\";\n })\n .map((element) => {\n const { propertyElement } = element as AttributePropertyElement;\n if (\"properties\" in propertyElement) {\n return propertyElement.properties;\n }\n return [];\n })\n .flat();\n }\n\n /**\n * Get concept properties by property element label\n */\n getConceptPropertiesByLabels(labels: string[] | string) {\n return this.elements\n .filter((element) => {\n const key = Object.keys(element)[0];\n return key === \"propertyElement\";\n })\n .map((element) => (element as AttributePropertyElement).propertyElement)\n .filter((element) => {\n if (Array.isArray(labels)) {\n return labels.includes(element.label);\n }\n return labels === element.label;\n })\n .map((element) => (\"properties\" in element ? element.properties : []))\n .flat();\n }\n\n get textfragments() {\n return this.elements\n .filter((element) => {\n const key = Object.keys(element)[0];\n return key === \"textFragmentElement\";\n })\n .map((element) => {\n const { textFragmentElement } = element as AttributeTextFragmentElement;\n if (\"textfragments\" in textFragmentElement) {\n return textFragmentElement.textfragments;\n }\n return [];\n })\n .flat();\n }\n\n /**\n * Get concept text fragments by text fragment element label\n */\n getTextFragmentsByLabels(labels: string[] | string) {\n return this.elements\n .filter((element) => {\n const key = Object.keys(element)[0];\n return key === \"textFragmentElement\";\n })\n .map(\n (element) =>\n (element as AttributeTextFragmentElement).textFragmentElement,\n )\n .filter((element) => {\n if (Array.isArray(labels)) {\n return labels.includes(element.label);\n }\n return labels === element.label;\n })\n .map((element) =>\n \"textfragments\" in element ? element.textfragments : [],\n )\n .flat();\n }\n\n get sections() {\n return this.elements\n .filter((element) => {\n const key = Object.keys(element)[0];\n return key === \"contentElement\";\n })\n .map(\n (element) => (element as MappedContentElement).contentElement.sections,\n )\n .flat();\n }\n\n getSectionsByType(types: string[] | string) {\n return this.sections.filter((section) => {\n const sectionType = section.type;\n if (!sectionType) {\n return false;\n }\n return Array.isArray(types)\n ? types.includes(sectionType)\n : types === sectionType;\n });\n }\n\n /**\n * Get concept text fragments by text fragment element label\n */\n getSectionsByLabels(labels: string[] | string) {\n return this.elements\n .filter((element) => {\n const key = Object.keys(element)[0];\n return key === \"contentElement\";\n })\n .map((element) => (element as MappedContentElement).contentElement)\n .filter((element) => {\n if (Array.isArray(labels)) {\n return labels.includes(element.label);\n }\n return labels === element.label;\n })\n .map((element) => element.sections)\n .flat();\n }\n\n getReferredSections() {\n const referredSections = [];\n\n for (const section of this.sections) {\n referredSections.push(...section.getReferredSections());\n }\n\n return referredSections;\n }\n}\n","import type { ErrorMessage, TextWithPlaceholders } from \"../../types/types\";\n\n/**\n * Handles text that is in the ApplicationMessage form\n */\nexport const retrieveText = (\n text: string | undefined | ErrorMessage | TextWithPlaceholders,\n) => {\n if (typeof text === \"string\") {\n return text;\n }\n\n if (\n typeof text === \"object\" &&\n \"message\" in text &&\n typeof text.message === \"string\"\n ) {\n return text.message;\n }\n\n return;\n};\n","import { createHashFromHref } from \"../../utils/helpers/createHash\";\nimport { retrieveText } from \"../../utils/helpers/text\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { LinkCollection } from \"../links/LinkCollection\";\n\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { ModelOptions } from \"../types\";\nimport type { SubSectionData } from \"./types\";\n\n/**\n * Link to a concept\n */\nexport class SubSectionModel extends BaseModel<SubSectionData> {\n private _entryDate: ISO_DATE | undefined;\n private _links: LinkCollection;\n\n constructor(\n data: SubSectionData,\n entryDate: ISO_DATE | undefined,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\n\n this._entryDate = entryDate;\n this._links = LinkCollection.create(\n this.data,\n this.contributions,\n \"subsection\",\n this.modelOptions,\n );\n }\n\n get referred() {\n return this.getDataAsBoolean(\"referred\", false);\n }\n\n get id() {\n if (\"id\" in this.data) {\n return this.getDataAsString(\"id\");\n }\n return this.getDataAsString(\"_id\");\n }\n\n /**\n * Retrieve key of subsection\n */\n get key() {\n return this.id;\n }\n\n /**\n * Retrieve html body\n */\n get body() {\n return retrieveText(this.data.body);\n }\n\n /**\n * Retrieve number of section\n */\n get number() {\n return this.getDataAsString(\"number\");\n }\n\n /**\n * Retrieve label of section\n */\n get label() {\n return this.getDataAsString(\"label\", \"\");\n }\n\n /**\n * Get sub sections\n */\n get subSections() {\n return this.data.subSections\n ? this.data.subSections.map(\n (subSection) =>\n new SubSectionModel(subSection, this.entryDate, this.modelOptions),\n )\n : [];\n }\n\n /**\n * Retrieve links of section\n */\n get links() {\n return this._links;\n }\n\n /**\n * Get self link of model\n */\n get selflink() {\n return this.links.getLinkByKey(\"self\");\n }\n\n /**\n * Return default self link of resource\n */\n get selfhref() {\n return this.selflink?.href;\n }\n\n get entryDate() {\n return this._entryDate;\n }\n\n get relatedConceptsHrefs() {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref() {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n\n if (href.hash.includes(\"/relatedConcepts\")) {\n const firstPart = href.path.substring(0, href.path.lastIndexOf(\"/\"));\n href.path = firstPart + \"/\" + href.hash;\n href.hash = href.hash.includes(\"#\")\n ? href.hash.substring(href.hash.indexOf(\"#\"))\n : \"\";\n }\n\n href.addParameter(\"entryDate\", this.entryDate);\n href.setReferenceHash(this.referenceHash);\n\n return href;\n }\n\n return undefined;\n }\n\n get referenceHash() {\n return createHashFromHref(this.selfhref);\n }\n\n getReferredSections(): SubSectionModel[] {\n const sections = [];\n\n for (const subSection of this.subSections) {\n if (subSection.referred) {\n sections.push(subSection);\n }\n\n const referredChilds = subSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n return sections;\n }\n}\n","import { createHashFromHref } from \"../../utils/helpers/createHash\";\nimport { retrieveText } from \"../../utils/helpers/text\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { LinkModel } from \"../links/LinkModel\";\nimport { ContentLinkModel } from \"./ContentLinkModel\";\nimport { SubSectionModel } from \"./SubSectionModel\";\n\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { ModelOptions } from \"../types\";\nimport type { SectionData } from \"./types\";\n\nexport class SectionModel extends BaseModel<SectionData> {\n private _entryDate: ISO_DATE | undefined;\n private _selflink: LinkModel | undefined;\n private _childSections: SectionModel[];\n\n constructor(\n data: SectionData,\n entryDate?: ISO_DATE,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\n\n this._entryDate = entryDate;\n this._selflink = this.createSelfLink();\n this._childSections = this.createChildSections();\n }\n\n get referred() {\n return this.getDataAsBoolean(\"referred\", false);\n }\n\n get selflink() {\n return this._selflink;\n }\n\n createSelfLink() {\n const selflink = this.getDataAsString(\"_links.self.href\");\n if (typeof selflink !== \"undefined\") {\n return LinkModel.create(\n this.key || \"unknown\",\n selflink,\n this.label,\n this.modelOptions,\n );\n }\n return;\n }\n\n get selfhref() {\n return this.selflink?.href;\n }\n\n get entryDate() {\n return this._entryDate;\n }\n\n get type() {\n return this.getDataAsString(\"type\");\n }\n\n get sourceLabel() {\n return this.getDataAsString(\"sourceLabel\");\n }\n\n get id() {\n const id = this.getDataAsString(\"id\");\n if (id) {\n return id;\n }\n return this.getDataAsString(\"_id\", \"unknown\");\n }\n\n get key() {\n return this.id;\n }\n\n /**\n * Get content label\n */\n get label() {\n return this.getDataAsString(\"label\", \"\");\n }\n\n /**\n * Retrieve number of section\n */\n get number() {\n return this.getDataAsString(\"number\");\n }\n\n /**\n * Get content body\n */\n get body() {\n const body = this.data.body;\n\n if (body) {\n return retrieveText(body as string);\n }\n\n return;\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): ContentLinkModel[] {\n let sections: SectionData[] = [];\n if (this.data.childSections) {\n sections = this.data.childSections as SectionData[];\n } else if (this.data.sections) {\n sections = this.data.sections;\n }\n\n return sections.map((section) => {\n const id = section.id || section._id;\n const _links = section._links as {\n self: { href: string };\n contenttype: { href: string };\n };\n\n return new ContentLinkModel(\n {\n section: id as string,\n _id: id as string,\n label: section.label,\n sourceLabel: section.sourceLabel as string,\n _links,\n },\n this.entryDate,\n this.modelOptions,\n );\n });\n }\n\n get selfContentLink() {\n const _links = this.data._links as {\n self: { href: string };\n contenttype: { href: string };\n };\n\n return new ContentLinkModel(\n {\n section: this.id,\n _id: this.id,\n label: this.label,\n sourceLabel: this.sourceLabel,\n _links,\n },\n this.entryDate,\n this.modelOptions,\n );\n }\n\n private createChildSections() {\n let sections: SectionData[] = [];\n if (this.data.childSections) {\n sections = this.data.childSections as SectionData[];\n } else if (this.data.sections) {\n sections = this.data.sections;\n }\n\n return sections\n .filter((childSection) => \"body\" in childSection)\n .map(\n (childSection) =>\n new SectionModel(childSection, this.entryDate, this.modelOptions),\n );\n }\n\n /**\n * Get tree of child sections\n */\n get childSections() {\n return this._childSections;\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: SectionModel[]) {\n this._childSections = sections || [];\n }\n\n get sections() {\n if (this.data.sections) {\n return this.data.sections.map(\n (section) =>\n new SectionModel(section, this.entryDate, this.modelOptions),\n );\n }\n return [];\n }\n\n /**\n * Get sub sections\n */\n get subSections() {\n return Array.isArray(this.data.subSections)\n ? this.data.subSections.map(\n (subSection) =>\n new SubSectionModel(subSection, this.entryDate, this.modelOptions),\n )\n : [];\n }\n\n get referenceHash() {\n return createHashFromHref(this.selfhref);\n }\n\n getReferredSections(): (SubSectionModel | SectionModel)[] {\n const sections = [];\n\n for (const subSection of this.subSections) {\n if (subSection.referred) {\n sections.push(subSection);\n }\n\n const referredChilds = subSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n for (const childSection of this.childSections) {\n if (childSection.referred) {\n sections.push(childSection);\n }\n\n const referredChilds = childSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n return sections;\n }\n}\n","import { getBooleanSetting } from \"../../../settings/Settings\";\n\nimport type { ConstraintModel, MaybeAttributeValue } from \"../types\";\n\nexport class GenericConstraintModel implements ConstraintModel {\n private _id: string;\n private _validateMethod:\n | ((value: MaybeAttributeValue) => boolean)\n | undefined;\n private _defaultMessage: string | undefined;\n private _parameters: object | undefined;\n private _useClientsideValidation: boolean;\n\n constructor(\n id: string,\n validateMethod?: ((value: MaybeAttributeValue) => boolean) | undefined,\n defaultMessage?: string,\n parameters?: object,\n useClientsideValidation: boolean = getBooleanSetting(\n \"USE_CLIENTSIDE_VALIDATION\",\n ),\n ) {\n this._id = id;\n this._validateMethod = validateMethod;\n this._defaultMessage = defaultMessage;\n this._parameters = parameters;\n this._useClientsideValidation = useClientsideValidation;\n }\n\n /**\n * Retreive type of constraint\n */\n get id() {\n return this._id;\n }\n\n get defaultMessage() {\n return this._defaultMessage || \"Missing default message\";\n }\n\n /**\n * Returns available data for constraint\n */\n get parameters() {\n return this._parameters;\n }\n\n /**\n * Inidicates if validation message is present\n */\n hasValidation() {\n return this._validateMethod != null;\n }\n\n /**\n * Validate constraint with value\n */\n validate(value: MaybeAttributeValue) {\n const validateMethod = this._validateMethod;\n\n if (this._useClientsideValidation && validateMethod) {\n return validateMethod(value);\n }\n\n return true;\n }\n\n get isMandatoryConstraint() {\n return this._id === \"mandatory\" || this._id === \"Constraint.Mandatory\";\n }\n}\n","import { getBooleanSetting } from \"../../../settings/Settings\";\nimport { BaseCollection } from \"../../base/BaseCollection\";\nimport { GenericConstraintModel } from \"./GenericConstraintModel\";\n\nimport type { ConstraintModel, MaybeAttributeValue } from \"../types\";\n\n/**\n * Attribute constraints\n */\nexport class ConstraintCollection extends BaseCollection<ConstraintModel> {\n addConstraint(\n id: string,\n validateMethod: ((value: MaybeAttributeValue) => boolean) | undefined,\n defaultMessage: string,\n data: object = {},\n useClientsideValidation: boolean = getBooleanSetting(\n \"USE_CLIENTSIDE_VALIDATION\",\n ),\n ) {\n this.add(\n new GenericConstraintModel(\n id,\n validateMethod,\n defaultMessage,\n data,\n useClientsideValidation,\n ),\n );\n }\n\n /**\n * Validate if complete collection is valid\n */\n validate(value: MaybeAttributeValue) {\n return (\n this.isEmpty() ||\n this.collection.every((constraint) => constraint.validate(value))\n );\n }\n\n /**\n * Indicates if a mandatory constraint exists in the collection\n */\n hasMandatoryConstraint() {\n return this.collection.some(\n (constraint) => constraint.isMandatoryConstraint,\n );\n }\n\n /**\n * Retrieve all invalid constraints\n */\n invalidConstraints(value: MaybeAttributeValue) {\n if (value === \"\" && !this.hasMandatoryConstraint()) {\n return [];\n }\n\n return this.collection.filter((constraint) => !constraint.validate(value));\n }\n}\n","import type { ConstraintModel, MaybeAttributeValue } from \"../types\";\n\nexport class MandatoryConstraint implements ConstraintModel {\n get id() {\n return \"Constraint.Mandatory\";\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage() {\n return \"Field is mandatory\";\n }\n\n get parameters() {\n return {};\n }\n\n validate(value: MaybeAttributeValue) {\n if (value == null) {\n return false;\n }\n\n if (typeof value !== \"string\") {\n throw new TypeError(\n `isNotEmptyString: Not comparing to string: ${typeof value}`,\n );\n }\n\n return value !== \"\";\n }\n\n get isMandatoryConstraint() {\n return true;\n }\n}\n","import type { ConstraintModel } from \"../types\";\n\nconst INVALID_LENGTH_ID = \"Constraint.InvalidLengthExact\";\nconst INVALID_LENGTH_BETWEEN_ID = \"Constraint.InvalidLengthBetween\";\nconst INVALID_LENGTH_TOO_SHORT_ID = \"Constraint.InvalidLengthTooShort\";\nconst INVALID_LENGTH_TOO_LONG_ID = \"Constraint.InvalidLengthTooLong\";\n\nexport class StringLengthConstraint implements ConstraintModel {\n private _minLength: number | null | undefined;\n private _maxLength: number | null | undefined;\n\n constructor(minLength?: number | null, maxLength?: number | null) {\n this._minLength = minLength;\n this._maxLength = maxLength;\n }\n\n get id(): string {\n if (this.minLength && this.maxLength && this.minLength === this.maxLength) {\n return INVALID_LENGTH_ID;\n } else if (this.minLength && this.maxLength) {\n return INVALID_LENGTH_BETWEEN_ID;\n } else if (this.minLength) {\n return INVALID_LENGTH_TOO_SHORT_ID;\n } else if (this.maxLength) {\n return INVALID_LENGTH_TOO_LONG_ID;\n }\n\n return \"Constraint.NoLengthConstraint\";\n }\n\n get minLength() {\n return this._minLength;\n }\n\n get maxLength() {\n return this._maxLength;\n }\n\n hasValidation() {\n return true;\n }\n\n isExactLength(value: string) {\n if (typeof value !== \"string\") {\n throw new TypeError(\"isExactLength: Not comparing to string\");\n }\n\n if (this.minLength == undefined) {\n throw new Error(\"isExactLength: Min and max length not set\");\n }\n\n return value.length === this.minLength;\n }\n\n isBetween(value: string) {\n if (typeof value !== \"string\") {\n throw new TypeError(\"isBetween: Not comparing to string\");\n }\n\n if (this.minLength == undefined || this.maxLength == undefined) {\n throw new Error(\"isBetween: Min or max length not set\");\n }\n\n return this.isLongEnough(value) && this.isSmallEnough(value);\n }\n\n isLongEnough(value: string) {\n if (typeof value !== \"string\") {\n throw new TypeError(\"isLongEnough: Not comparing to string\");\n }\n\n if (!this.minLength) {\n throw new Error(\"isLongEnough: Min length not set\");\n }\n\n return value.length >= this.minLength;\n }\n\n isSmallEnough(value: string) {\n if (typeof value !== \"string\") {\n throw new TypeError(\"isSmallEnough: Not comparing to string\");\n }\n\n if (!this.maxLength) {\n throw new Error(\"isSmallEnough: Max length not set\");\n }\n\n return value.length <= this.maxLength;\n }\n\n get defaultMessage() {\n switch (this.id) {\n case INVALID_LENGTH_ID:\n return \"Length must be precisely ${length} characters\"; // NOSONAR\n case INVALID_LENGTH_BETWEEN_ID:\n return \"Length must be between ${min-length} and ${max-length} characters\"; // NOSONAR\n case INVALID_LENGTH_TOO_SHORT_ID:\n return \"The length of the value must be larger than ${min-length}\"; // NOSONAR\n case INVALID_LENGTH_TOO_LONG_ID:\n return \"The length of the value must be smaller than ${max-length}\"; // NOSONAR\n default:\n return \"\";\n }\n }\n\n get parameters() {\n switch (this.id) {\n case INVALID_LENGTH_ID:\n return {\n length: this.minLength,\n };\n case INVALID_LENGTH_BETWEEN_ID:\n return {\n \"min-length\": this.minLength,\n \"max-length\": this.maxLength,\n };\n case INVALID_LENGTH_TOO_SHORT_ID:\n return {\n \"min-length\": this.minLength,\n };\n case INVALID_LENGTH_TOO_LONG_ID:\n return {\n \"max-length\": this.maxLength,\n };\n default:\n return {};\n }\n }\n\n validate(value: string) {\n switch (this.id) {\n case INVALID_LENGTH_ID:\n return this.isExactLength(value);\n case INVALID_LENGTH_BETWEEN_ID:\n return this.isBetween(value);\n case INVALID_LENGTH_TOO_SHORT_ID:\n return this.isLongEnough(value);\n case INVALID_LENGTH_TOO_LONG_ID:\n return this.isSmallEnough(value);\n default:\n return true;\n }\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import {\n ATTRIBUTE_WIDTH,\n TIMEVERSION_FILTER_NAME,\n} from \"../../constants/Constants\";\nimport { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport { DISABLED, MANDATORY } from \"../../layouthints/LayoutHints\";\nimport {\n getBooleanSetting,\n hasAllContentInData,\n} from \"../../settings/Settings\";\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { ConceptDetailModel } from \"../concepts/ConceptDetailModel\";\nimport { ErrorCollection, ErrorCollectionType } from \"../error/ErrorCollection\";\nimport { LinkCollection } from \"../links/LinkCollection\";\nimport { AttributeContent } from \"./AttributeContent\";\nimport { ConstraintCollection } from \"./input-constraints/ConstraintCollection\";\nimport { MandatoryConstraint } from \"./input-constraints/MandatoryConstraint\";\nimport { StringLengthConstraint } from \"./input-constraints/StringLengthConstraint\";\n\nimport type {\n ErrorMessage,\n ISO_DATE,\n MessageParameters,\n} from \"../../types/types\";\nimport type { ContentConfiguration } from \"../contentconfiguration/ContentConfiguration\";\nimport type { ContentConfigurationElements } from \"../contentconfiguration/ContentConfigurationElements\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ErrorObjectData } from \"../form/types\";\nimport type { ModelOptions, ModelWithChildModels } from \"../types\";\nimport type { AttributeCollection } from \"./AttributeCollection\";\nimport type { ATTRIBUTE_TYPE } from \"./constants\";\nimport type { LayoutHintRuleCollection } from \"./layouthint-rules/LayoutHintRuleCollection\";\nimport type {\n AttributeContributions,\n AttributeData,\n AttributeModel,\n BaseAttributeContributions,\n ContentData,\n MaybeAttributeValue,\n} from \"./types\";\n\nexport abstract class BaseAttributeModel<\n C extends BaseAttributeContributions = BaseAttributeContributions,\n> extends BaseModel<AttributeData, C> {\n private _label: string;\n private _links: LinkCollection;\n private _parentKey: string | undefined;\n\n private _hasContentConfiguration = false;\n private _content: AttributeContent | undefined;\n\n private _concept: ConceptDetailModel | undefined;\n protected attributeReferenceDate: ISO_DATE;\n\n protected _lastModification = 0;\n\n private _initvalue: MaybeAttributeValue;\n private _value: MaybeAttributeValue;\n protected _inputvalue: MaybeAttributeValue;\n private _previouslyValidatedValue: MaybeAttributeValue;\n\n protected attributeErrors: ErrorCollection;\n private _serverConstraints: ConstraintCollection = new ConstraintCollection();\n private _useClientsideValidation: boolean = getBooleanSetting(\n \"USE_CLIENTSIDE_VALIDATION\",\n true,\n );\n protected _isValid = true;\n\n private _mandatory: boolean;\n private _readonly = false;\n private _disabled = false;\n protected _isResult: boolean;\n\n private _isHidden = false;\n private _isEditable = false;\n\n private _layoutHintRules?: LayoutHintRuleCollection;\n\n private _placeholder: string | undefined;\n\n constructor(\n data?: AttributeData,\n contributions?: C,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions as C, modelOptions);\n\n this.attributeReferenceDate = this.getDataAsString(\n \"referenceDate\",\n DateUtil.now(),\n );\n this._links = LinkCollection.create(\n this.data,\n this.contributions,\n \"attribute\",\n this.modelOptions,\n );\n\n this._content = this.createAttributeContent();\n this._label = this.createLabel();\n this._placeholder = this.getContributionAsString(\"placeholder\");\n\n this._initvalue = this.data.value;\n this._inputvalue = this.getInitialInputValue(this.data.value);\n this._value = this.data.value;\n\n this._isResult = this.getDataAsBoolean(\"isResult\", false);\n this._mandatory =\n this.layouthint.has(MANDATORY) ||\n this.getContributionAsBoolean(\"mandatory\", false);\n this._disabled = this.layouthint.has(DISABLED);\n\n this.attributeErrors = this.createErrorCollection(this.data.message);\n }\n\n /**\n * Abstract reset method which should be implemented on each attribute that has this attribute as a base class.\n * @abstract\n */\n abstract reset(): void;\n\n /**\n * Update method which should be implemented on each attribute that has this attribute as a base class.\n */\n abstract update(\n value: MaybeAttributeValue,\n changedAttribute?: AttributeModel,\n ): this;\n\n /**\n * updateByAttribute method which should be implemented on each attribute that has this attribute as a base class.\n */\n abstract updateByAttribute(otherAttribute: AttributeModel): void;\n\n private createLabel() {\n if (this.hasContentFromData() && this.content?.label) {\n this._label = this.content.label;\n }\n return this.getContributionAsString(\"label\", \"\");\n }\n\n private createErrorCollection(message: ErrorMessage | undefined) {\n const errorCollection = new ErrorCollection(ErrorCollectionType.ATTRIBUTE);\n if (typeof message === \"object\" && message != null) {\n errorCollection.addServerError(\n message.id,\n message.message,\n message.properties,\n message.layouthint,\n );\n }\n return errorCollection;\n }\n\n static isApplicableModel(contributions: AttributeContributions) {\n if (typeof contributions !== \"object\") {\n throw new IllegalArgumentException(\n \"Given argument for isApplicableModel is not a contributions object\",\n );\n }\n\n throw new Error(\"isApplicableModel must be implemented on an attribute\");\n }\n\n get key() {\n return this.getDataAsString(\"key\", \"unknown\");\n }\n\n get parentKey() {\n return this._parentKey || \"\";\n }\n\n set parentKey(parentKey) {\n this._parentKey = parentKey;\n }\n\n /**\n * Getting the attribute name\n */\n get name() {\n return this.key;\n }\n\n /**\n * Getting the type of the attribute\n */\n abstract get type(): ATTRIBUTE_TYPE;\n\n /**\n * Getting the label of the attribute\n */\n get label(): string {\n return this._label;\n }\n\n /**\n * Set the label of this attribute\n */\n set label(label: string) {\n this._label = label;\n }\n\n /**\n * Get placeholder text\n */\n get placeholder() {\n return this._placeholder;\n }\n\n /**\n * Set placeholder text\n */\n set placeholder(placeholder) {\n this._placeholder = placeholder;\n }\n\n /**\n * Indicate if attribute is editable\n */\n get isEditable() {\n return this._isEditable;\n }\n\n set isEditable(isEditable: boolean) {\n this._isEditable = isEditable;\n }\n\n /**\n * Indicates if the attribute is visible\n */\n get isVisible() {\n return !this._isHidden;\n }\n\n get isHidden() {\n return this._isHidden;\n }\n\n set isHidden(isHidden: boolean) {\n this._isHidden = isHidden;\n }\n\n /**\n * Explicitly toggle visibility of this attribute\n */\n show() {\n this.isHidden = false;\n }\n\n /**\n * Explicitly toggle visibility of this attribute\n */\n hide() {\n this.isHidden = true;\n }\n\n /**\n * LINKS\n */\n\n get links() {\n return this._links;\n }\n\n get downloadLink() {\n const downloadLink = this.links.getLinksByGroup(\"download\").first;\n\n if (downloadLink && downloadLink.key === this.key) {\n return downloadLink;\n }\n\n return undefined;\n }\n\n /**\n * CONCEPTS\n */\n\n getInitialChildModelLinks() {\n if (\n !this.hasContentFromData() &&\n this.hasContentConfiguration() &&\n this.conceptLink\n ) {\n return [this.conceptLink];\n }\n return [];\n }\n\n setChildModels(models: ModelWithChildModels[], _errors: ErrorResponse[]) {\n const conceptHref = this.conceptLink?.href;\n if (conceptHref) {\n const concept = models.find((model) => {\n if (model instanceof ConceptDetailModel) {\n return model.selfhref.equalsWithParameters(conceptHref);\n }\n return false;\n });\n\n this.concept = concept as ConceptDetailModel | undefined;\n }\n }\n\n /**\n * Retrieve concept link of attribute when available\n */\n get conceptLink() {\n const conceptLink = this.links.getLinkByKey(\"concept\");\n\n if (conceptLink) {\n conceptLink.href = conceptLink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this.referenceDate,\n );\n\n conceptLink.isCacheable = true;\n }\n\n return conceptLink;\n }\n\n /**\n * Get concept information\n */\n get concept() {\n return this._concept;\n }\n\n /**\n * Set the concept\n */\n set concept(concept: ConceptDetailModel | undefined) {\n this._concept = concept;\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n * to get information in correct time version\n */\n get referenceDate() {\n return this.attributeReferenceDate;\n }\n\n /**\n * Set reference date for concepts and content\n */\n set referenceDate(date: ISO_DATE) {\n this.attributeReferenceDate = date;\n }\n\n /**\n * CONTENT\n */\n\n /**\n * Indicates if content comes from the data service\n */\n hasContentFromData() {\n return hasAllContentInData();\n }\n\n setHasContentConfiguration(hasContentConfiguration: boolean) {\n this._hasContentConfiguration = hasContentConfiguration;\n }\n\n hasContentConfiguration() {\n return this._hasContentConfiguration;\n }\n\n private createAttributeContent() {\n if (\"content\" in this.data) {\n return new AttributeContent(this.data.content as ContentData);\n }\n return undefined;\n }\n\n get content() {\n return this._content;\n }\n\n indicateContentConfiguration(contentConfiguration: ContentConfiguration) {\n if (contentConfiguration) {\n const hasQuestionConfig = contentConfiguration.questions?.hasConfig();\n\n const hasEndResultConfig =\n contentConfiguration.isConfiguredEndResultAttribute(this.key);\n const hasIntermediateResultConfig =\n contentConfiguration.isConfiguredIntermediateResultAttribute(this.key);\n\n this.setHasContentConfiguration(\n hasQuestionConfig || hasEndResultConfig || hasIntermediateResultConfig,\n );\n }\n }\n\n /**\n * Retrieve the first permitted label to render when a concept and contentConfiguration is available\n * Be aware that permission could be in place for labels from a concept.\n */\n getContentConfiguredLabel(\n contentConfiguration: ContentConfigurationElements,\n ) {\n if (this.hasContentFromData()) {\n return this.content?.label ?? this.label;\n }\n\n return contentConfiguration.getContentConfiguredLabel(\n this.concept,\n this.label,\n );\n }\n\n /**\n * Visualization\n */\n get defaultAlignment(): \"left\" | \"center\" | \"right\" {\n return \"left\";\n }\n\n /**\n * Handles layout hint align-left, align-center and align-right\n */\n get alignment(): \"left\" | \"center\" | \"right\" {\n const alignmentHints = this.layouthint.getByLayoutHint(\"align-\");\n\n // return alignment based on layouthint or the default alignment for the attribute\n const alignment = alignmentHints\n ? alignmentHints.substring(\"align-\".length)\n : this.defaultAlignment;\n\n if (\n alignment === \"left\" ||\n alignment === \"center\" ||\n alignment === \"right\"\n ) {\n return alignment;\n }\n\n return this.defaultAlignment;\n }\n\n /**\n * Readonly attribute width indicates the proposed width of this attribute\n */\n get readonlyWidth(): ATTRIBUTE_WIDTH {\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n\n /**\n * LAYOUT HINT RULES\n */\n\n get layoutHintRules(): LayoutHintRuleCollection | undefined {\n return this._layoutHintRules;\n }\n\n set layoutHintRules(rules: LayoutHintRuleCollection) {\n this._layoutHintRules = rules;\n }\n\n processLayoutHintRules(attributes: AttributeCollection) {\n if (this.layoutHintRules) {\n this.layoutHintRules.process<C>(this, attributes);\n }\n }\n\n /**\n * VALUES\n */\n\n get lastModification() {\n return this._lastModification;\n }\n\n set lastModification(lastModification: number) {\n this._lastModification = lastModification;\n }\n\n /**\n * Set last modification to current timestamp\n */\n updateLastModification() {\n this.lastModification = Date.now();\n }\n\n /**\n * Inidicates if attribute is changed since a given timestamp (Date.now)\n */\n isChangedSince(timestamp: number) {\n return this.lastModification > timestamp;\n }\n\n /**\n * Retrieve initial input value\n */\n getInitialInputValue(value: MaybeAttributeValue) {\n return value;\n }\n\n /**\n * Initial value received from the modular ui service\n */\n get initvalue() {\n return this.getInitValue();\n }\n\n getInitValue() {\n return this._initvalue;\n }\n\n setInitValue(initvalue: MaybeAttributeValue) {\n this._initvalue = initvalue;\n }\n\n hasValue() {\n return this._value != null && this._value !== \"\";\n }\n\n getValue() {\n return this.hasValue() ? this._value : null;\n }\n\n setValue(value: MaybeAttributeValue) {\n this._value = value;\n }\n\n get value() {\n return this.getValue();\n }\n\n /**\n * Setting a value in the element\n */\n set value(value) {\n this.updateLastModification();\n\n this._value = value;\n }\n\n /**\n * Retrieve input value\n */\n getInputValue() {\n const inputvalue = this._inputvalue;\n return inputvalue ? inputvalue.toString() : \"\";\n }\n\n setInputvalue(inputvalue: MaybeAttributeValue) {\n this._inputvalue = inputvalue;\n }\n\n /**\n * Returns the value as entered by the user. This can differ from the internal iso value that is stored\n */\n get inputvalue() {\n return this.getInputValue();\n }\n\n /**\n * Sets the input value to the value entered by the user\n */\n set inputvalue(value: MaybeAttributeValue) {\n this._inputvalue = value;\n this.value = value;\n\n this.validate(value);\n }\n\n formatValue(value: MaybeAttributeValue) {\n return JSON.stringify(value);\n }\n\n /**\n * Getting the readonly value, iso value converted for human reading\n */\n get readonlyvalue() {\n return this.value ? this.value.toString() : \"\";\n }\n\n /**\n * Value that is used when retrieving an error collection of this attribute\n * Mostly this is the input value, but sometimes a different value is needed,\n * for example iban and postcode need to validate length without spaces\n */\n get validateValue() {\n return this.inputvalue;\n }\n\n /**\n * VALIDATE\n */\n\n /**\n * Getting mandatory status of attribute\n */\n get mandatory() {\n return this._mandatory || false;\n }\n\n /**\n * Set mandatory status of attribute\n */\n set mandatory(mandatory: boolean) {\n if (mandatory !== this._mandatory) {\n this._previouslyValidatedValue = null;\n }\n this._mandatory = mandatory;\n }\n\n get configuredMandatory() {\n return (\n this.layouthint.has(MANDATORY) ??\n this.getContributionAsBoolean(\"mandatory\")\n );\n }\n\n get readonly() {\n return (\n this._readonly ||\n this.getContributionAsBoolean(\"readonly\") === true ||\n this.getDataAsBoolean(\"static\") === true ||\n this.isResult\n );\n }\n\n set readonly(readonly: boolean) {\n this._readonly = readonly;\n }\n\n get disabled() {\n return this._disabled;\n }\n\n set disabled(disabled: boolean) {\n this._disabled = disabled;\n }\n\n get isResult() {\n return this._isResult;\n }\n\n set isResult(isResult: boolean) {\n this._isResult = isResult;\n }\n\n /**\n * Getting the display and input format of an attribute\n */\n get format() {\n return this.getContributionAsString(\"format\");\n }\n\n get formatLabel() {\n return this.format;\n }\n\n /**\n * Get minimum string length\n */\n get minLength() {\n return this.getContributionAsNumber(\"minLength\");\n }\n\n /**\n * Get maximum string length\n */\n get maxLength() {\n return this.getContributionAsNumber(\"maxLength\");\n }\n\n get operator() {\n return this.getContributionAsString(\"operator\", \"\");\n }\n\n /**\n * Get assistant message\n */\n get assistantMessage() {\n return this.getContributionAsString(\"assistant\");\n }\n\n /**\n * Get valid status\n */\n get isValid() {\n return this.validate(this.validateValue);\n }\n\n getIsValid() {\n return this._isValid;\n }\n\n setIsValid(isValid: boolean) {\n this._isValid = isValid;\n }\n\n getServerConstraints() {\n return this._serverConstraints;\n }\n\n /**\n * Retrieve applicable constraint for this attribute\n */\n get constraintCollection(): ConstraintCollection {\n const constraints = new ConstraintCollection();\n\n constraints.add(this._serverConstraints);\n\n // Mandatory constraint\n if (this.mandatory) {\n constraints.add(new MandatoryConstraint());\n }\n\n if (this.minLength || this.maxLength) {\n constraints.add(\n new StringLengthConstraint(this.minLength, this.maxLength),\n );\n }\n\n constraints.add(this.addConstraints());\n\n return constraints;\n }\n\n /**\n * Template method for class extending this model to add extra constraints\n * @abstract\n */\n addConstraints(): ConstraintCollection {\n return new ConstraintCollection();\n }\n\n /**\n * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION\n */\n setUseClientsideValidation(enabled: boolean) {\n this._useClientsideValidation = enabled;\n }\n\n /**\n * Indicates if client side validation is enabled\n */\n useClientsideValidation() {\n return this._useClientsideValidation ?? true;\n }\n\n /**\n * Validate input on client side constraint\n */\n validate(value: MaybeAttributeValue) {\n // when client side validation is disabled, this attribute is always valid\n if (!this.useClientsideValidation()) {\n return true;\n }\n\n if (this.isOptionalAndEmpty(value)) {\n this._isValid = true;\n } else if (this.getPreviouslyValidatedValue() !== value) {\n this._isValid = this.constraintCollection.validate(value);\n }\n this.setPreviouslyValidatedValue(value);\n\n return this._isValid;\n }\n\n setPreviouslyValidatedValue(previouslyValidatedValue: MaybeAttributeValue) {\n this._previouslyValidatedValue = previouslyValidatedValue;\n }\n\n getPreviouslyValidatedValue() {\n return this._previouslyValidatedValue;\n }\n\n /**\n * Indicates if attribute is optional and empty\n */\n isOptionalAndEmpty(value: MaybeAttributeValue) {\n if (value === undefined) {\n throw new IllegalArgumentException(\n \"isOptionalAndEmpty method needs value argument\",\n );\n }\n\n return !this.mandatory && value === \"\";\n }\n\n /**\n * Retrieve error messages of this attribute\n */\n get errorCollection() {\n const collection = new ErrorCollection(\n ErrorCollectionType.ATTRIBUTE,\n this.attributeErrors,\n );\n\n collection.addConstraints(\n this.constraintCollection.invalidConstraints(this.validateValue),\n );\n\n return collection;\n }\n\n /**\n * Check if attribute is in error\n */\n inError() {\n return !this._isValid && this.isChangedSince(0);\n }\n\n /**\n * Reset static error messages on attribute\n */\n resetErrors() {\n this.attributeErrors.clear();\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: ErrorObjectData) {\n this.attributeErrors.addServerError(\n error.id,\n error.message,\n error.properties,\n error.layouthint,\n );\n }\n\n removeServerError(id: string) {\n this.attributeErrors.removeServerError(id);\n }\n\n hasServerErrors() {\n return this.errorCollection.serverErrors.length > 0;\n }\n\n hasErrors() {\n return this.errorCollection.hasItems();\n }\n\n /**\n * Registers a missing error that was received from the server\n */\n addMissingError(_receivedAttribute?: AttributeModel) {\n this.attributeErrors.addServerError(\"Constraint.Missing\");\n }\n\n removeMissingError() {\n this.removeServerError(\"Constraint.Missing\");\n }\n\n addServerConstraint(\n id: string,\n defaultMessage?: string,\n parameters?: MessageParameters,\n ) {\n this._serverConstraints.addConstraint(\n id,\n undefined,\n defaultMessage || \"\",\n parameters,\n this.useClientsideValidation(),\n );\n }\n\n formatParameters(parameters?: MessageParameters) {\n if (!parameters) {\n return {};\n }\n\n const params: Record<string, string | number> = {};\n\n Object.keys(parameters).forEach((paramKey: string) => {\n const paramValue = parameters[paramKey];\n if (paramKey.endsWith(\"-number\") || paramKey.endsWith(\"-date\")) {\n params[paramKey] = this.formatValue(paramValue);\n } else {\n params[paramKey] = paramValue;\n }\n });\n\n return params;\n }\n\n get hasDynamicValidationData() {\n return true;\n }\n\n updateValidations(errors: ErrorObjectData[]) {\n if (\n errors.some((error) => error.id === \"Constraint.Mandatory\") ||\n this.layouthint.has(MANDATORY)\n ) {\n this.mandatory = true;\n } else if (!this.hasValue()) {\n this.mandatory = false;\n }\n\n this._serverConstraints = new ConstraintCollection();\n this.resetErrors();\n\n errors\n .filter(\n (error) => error.id !== \"Constraint.Mandatory\" || !this.hasValue(),\n )\n .forEach((error) => {\n if (this.hasValue()) {\n this.attributeErrors.addServerError(\n error.id,\n error.message,\n this.formatParameters(error.properties),\n error.layouthint,\n );\n } else {\n this.addServerConstraint(\n error.id,\n error.message,\n this.formatParameters(error.properties),\n );\n }\n });\n }\n\n /**\n * Mutate\n */\n /**\n * Merge old attribute with the attribute from the server.\n * Readonly attributes always need to show the value from the server\n */\n mergeAttribute(oldAttribute: AttributeModel) {\n this.concept = oldAttribute.concept;\n\n if (\n !oldAttribute.readonly &&\n oldAttribute.isValid &&\n oldAttribute.inputvalue !== null\n ) {\n this.update(oldAttribute.inputvalue);\n }\n }\n\n /**\n * FORMDATA\n */\n\n /**\n * Getting data ready to be send to the modular ui\n * Returns null when the attribute should not be send to the server\n */\n getFormData() {\n if (this.inError()) {\n return null;\n }\n\n return {\n [this.name]: this.value,\n };\n }\n\n get formdata() {\n return this.getFormData();\n }\n\n getEmptyFormData() {\n return { [this.name]: null };\n }\n\n /**\n * OTHER\n */\n equals(otherAttribute: AttributeModel) {\n return (\n this.key === otherAttribute.key &&\n this.parentKey === otherAttribute.parentKey\n );\n }\n}\n","import { immerable } from \"immer\";\n\nimport { ATTRIBUTE_WIDTH } from \"../../constants/Constants\";\nimport { AttributeFactory } from \"../attributes/AttributeFactory\";\nimport { LayoutHintCollection } from \"../layouthint/LayoutHintCollection\";\n\nimport type { AttributeContributions } from \"../attributes/types\";\nimport type { SortingModel } from \"./sorting/SortingModel\";\nimport type { SortOptionModel } from \"./sorting/SortOptionModel\";\n\n/**\n * One header item of the list\n */\nexport class ListHeaderModel {\n [immerable] = true;\n private _key: string;\n private _header: {\n label: string;\n type: string;\n layouthint?: string[];\n };\n private _sortOption: SortOptionModel | undefined;\n private _readonlyWidth: ATTRIBUTE_WIDTH;\n\n /**\n * constructor\n */\n constructor(\n header: Record<string, AttributeContributions>,\n sorting?: SortingModel,\n ) {\n const [headerKey] = Object.keys(header);\n\n const attribute = AttributeFactory.createAttribute(\n headerKey,\n { elementid: headerKey },\n header[headerKey],\n );\n this._readonlyWidth = attribute.readonlyWidth;\n this._key = headerKey;\n this._header = header[headerKey];\n this._sortOption = sorting?.find(\n (sortOption) => sortOption.key === headerKey,\n );\n }\n\n get key() {\n return this._key;\n }\n\n /**\n * Getting the label of this header item\n */\n get label() {\n return this._header.label;\n }\n\n /**\n * Getting the type of this header item. For instance string, date, etc.\n */\n get type() {\n return this._header.type;\n }\n\n /**\n * Getting the layout hints of this header item\n */\n get layouthint() {\n return new LayoutHintCollection(this._header.layouthint);\n }\n\n /**\n * Get alignment of header label\n */\n get alignment() {\n const alignment = this.layouthint.getByLayoutHint(\"align-\");\n return alignment === null ? \"left\" : alignment.substring(\"align-\".length);\n }\n\n get readonlyWidth(): ATTRIBUTE_WIDTH {\n return this._readonlyWidth ?? ATTRIBUTE_WIDTH.MEDIUM;\n }\n\n equals(listHeader: ListHeaderModel) {\n return listHeader.key === this.key;\n }\n\n get sortOption() {\n return this._sortOption;\n }\n\n hasSorting() {\n return this.sortOption != null;\n }\n}\n","import has from \"lodash/has\";\n\nimport { ConfigurationException } from \"../../exceptions/ConfigurationException\";\nimport { ResourceCollection } from \"../base/ResourceCollection\";\nimport { AttributeFactory } from \"./AttributeFactory\";\nimport { ChoiceAttributeModel } from \"./ChoiceAttributeModel\";\nimport { CompositeAttributeModel } from \"./CompositeAttributeModel\";\n\nimport type { ContentConfiguration } from \"../contentconfiguration/ContentConfiguration\";\nimport type { ErrorObjectData } from \"../form/types\";\nimport type { ModelOptions } from \"../types\";\nimport type {\n AttributeCollectionContributions,\n AttributeModel,\n AttributeModularUIData,\n} from \"./types\";\n\ninterface AttributeCollectionOptions extends ModelOptions {\n isReadonly: boolean;\n}\n\nexport class AttributeCollection extends ResourceCollection<AttributeModel> {\n constructor(\n data: AttributeModularUIData = { elementid: \"none\" },\n contributions: AttributeCollectionContributions = [],\n modelOptions?: AttributeCollectionOptions,\n ) {\n super();\n\n contributions.forEach((contribution) => {\n const [key, contributionValue] = Object.entries(contribution)[0];\n\n const attribute = AttributeFactory.createAttribute(\n key,\n data,\n contributionValue,\n {\n origin: modelOptions?.origin,\n contextPath: modelOptions?.contextPath,\n },\n );\n\n if (attribute !== null) {\n // when readonly is not explicitly set in the contributions, follow argument\n if (modelOptions?.isReadonly && !has(contributionValue, \"readonly\")) {\n attribute.readonly = true;\n }\n\n this.collection.push(attribute);\n }\n });\n\n this.processLayoutHintRules();\n }\n\n /**\n * Retrieve all attributes in this collection<br>\n * This getter processes layout hints, this is different from the standard {@link BaseCollection#all} property\n */\n get attributes() {\n this.processLayoutHintRules();\n return this.all;\n }\n\n /**\n * Replace attributes with a new array of attributes\n */\n set attributes(attributes: AttributeModel[]) {\n this.collection = attributes;\n }\n\n processLayoutHintRules() {\n this.all.forEach((attribute) => {\n attribute.processLayoutHintRules(this);\n });\n }\n\n /**\n * Retrieve only visible attributes from the collection\n */\n get visible() {\n return this.attributes.filter((attribute) => !attribute.isHidden);\n }\n\n get questions() {\n return this.visible.filter((attribute) => !attribute.isResult);\n }\n\n get results() {\n return this.visible.filter((attribute) => attribute.isResult);\n }\n\n getAttributeByAttribute(attribute: AttributeModel) {\n return this.find((attr) => {\n if (attr.equals(attribute)) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByAttribute(attr);\n }\n return false;\n });\n }\n\n /**\n * Get a single attribute by it's key\n */\n getAttributeByKey(key: string) {\n return this.find((attribute) => {\n if (attribute.key === key) {\n return true;\n } else if (attribute instanceof CompositeAttributeModel) {\n return attribute.getChildByKey(key);\n }\n return false;\n });\n }\n\n /**\n * Indicates if attribute with key exists in collection\n */\n hasAttributeByKey(key: string) {\n return this.getAttributeByKey(key) != null;\n }\n\n /**\n * Getting the first attribute having the supplied layout hint\n */\n getAttributeByLayoutHint(...hints: string[]) {\n return this.find((attribute) => attribute.layouthint.has(...hints));\n }\n\n /**\n * Getting a choice attribute by layouthint, returns undefined when not found or not a choice attribute\n */\n getChoiceAttributeByLayoutHint(layoutHint: string) {\n const attribute = this.getAttributeByLayoutHint(layoutHint);\n if (attribute instanceof ChoiceAttributeModel) {\n return attribute;\n }\n return undefined;\n }\n\n /**\n * Getting all attributes having the supplied layout hint\n */\n getAttributesByLayoutHint(...hints: string[]) {\n return this.filter((attribute) => attribute.layouthint.has(...hints));\n }\n\n /**\n * Replace an attribute instance in the collection with a new attribute instance\n */\n replace(oldAttribute: AttributeModel, newAttribute: AttributeModel) {\n this.replaceByKey(oldAttribute.key, newAttribute);\n }\n\n /**\n * Replace an attribute by the key of the attribute\n */\n replaceByKey(key: string, newAttribute: AttributeModel) {\n this.forEach((attribute, index) => {\n if (attribute.key === key) {\n this.collection[index] = newAttribute;\n }\n });\n }\n\n /**\n * Set reference date by replacing an old attribute with a new attribute with a reference Date\n * Date is a string in ISO format yyyy-MM-dd\n */\n setReferenceDate(date: string) {\n this.forEach((attribute) => {\n attribute.referenceDate = date;\n });\n }\n\n hasServerErrors() {\n return this.collection.some((attribute) => attribute.hasServerErrors());\n }\n\n addServerError(error: ErrorObjectData) {\n const elementid = error?.anchor?.elementid;\n\n if (elementid) {\n const attribute = this.getAttributeByKey(elementid);\n if (attribute) {\n attribute.addServerError(error);\n } else {\n throw new ConfigurationException(\n `Could not add error to missing attribute with id ${elementid}`,\n );\n }\n }\n }\n\n hasErrors() {\n return this.visible.some((attribute) => attribute.hasErrors());\n }\n\n updateValidations(errors: ErrorObjectData[]) {\n this.all\n .filter((attribute) => attribute.hasDynamicValidationData)\n .forEach((attribute) => {\n const attributeErrors = errors.filter(\n (error) => error.anchor?.elementid === attribute.key,\n );\n attribute.updateValidations(attributeErrors);\n\n if (attribute instanceof CompositeAttributeModel) {\n const compositeChildErrors = errors.filter((error) => {\n const elementId = error.anchor?.elementid;\n return elementId && elementId.startsWith(`${attribute.key}.`);\n });\n\n attribute.children.updateValidations(\n `${attribute.key}.`,\n compositeChildErrors,\n );\n }\n });\n\n return this;\n }\n\n indicateContentConfiguration(contentConfiguration: ContentConfiguration) {\n if (contentConfiguration) {\n this.all.forEach((attribute) => {\n attribute.indicateContentConfiguration(contentConfiguration);\n });\n }\n }\n\n /**\n * Generate formdata object for current collection based on formdata of attributes\n * Skip attributes that are readonly, the confirmation password or null\n */\n get formdata() {\n return this.getFormData(false);\n }\n\n getFormData(validationData = false) {\n const attributesFormData = this.attributes\n .filter(\n (attribute) =>\n attribute.formdata !== null &&\n !attribute.readonly &&\n (!validationData || attribute.hasDynamicValidationData),\n )\n .map((attribute) => {\n // make attribute empty when it is not (or no longer) visible\n if (attribute.isVisible) {\n return attribute.formdata;\n }\n\n return attribute.getEmptyFormData();\n });\n\n let data = {};\n attributesFormData.forEach((attributeFormData) => {\n data = {\n ...data,\n ...attributeFormData,\n };\n });\n\n return data;\n }\n}\n","/**\n * ConfigurationException\n */\nexport class ConfigurationException extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ConfigurationException\";\n }\n}\n","import { ResourceCollection } from \"../base/ResourceCollection\";\nimport { ErrorCollection, ErrorCollectionType } from \"../error/ErrorCollection\";\nimport { AttributeFactory } from \"./AttributeFactory\";\nimport { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { CompositeAttributeModel } from \"./CompositeAttributeModel\";\n\nimport type { ErrorObjectData } from \"../form/types\";\nimport type { ModelOptions, ModelWithChildModels } from \"../types\";\nimport type { AttributeModel, MaybeAttributeValue } from \"./types\";\n\nexport class CompositeAttributeChildCollection\n extends ResourceCollection<AttributeModel | CompositeAttributeChildCollection>\n implements ModelWithChildModels\n{\n get type() {\n return \"composite-collection\";\n }\n\n get selfhref() {\n return undefined;\n }\n\n static create(\n data: object,\n contributions: object,\n modelOptions?: ModelOptions,\n ) {\n if (\n \"children\" in data &&\n \"children\" in contributions &&\n Array.isArray(contributions.children) &&\n Array.isArray(data.children)\n ) {\n // a composite with multiple data elements and one contributions element\n // multiple 'composites' are returned\n const isMultipleTableRows = Array.isArray(data.children[0]);\n if (isMultipleTableRows) {\n return CompositeAttributeChildCollection.createMultiData(\n data,\n contributions,\n modelOptions,\n );\n }\n\n return CompositeAttributeChildCollection.createStandard(\n data,\n contributions,\n modelOptions,\n );\n }\n\n return new CompositeAttributeChildCollection();\n }\n\n static createStandard(\n data: object,\n contributions: object,\n modelOptions?: ModelOptions,\n ) {\n const compositeChildCollection = new CompositeAttributeChildCollection();\n\n if (\n \"children\" in contributions &&\n \"children\" in data &&\n Array.isArray(contributions.children) &&\n Array.isArray(data.children)\n ) {\n compositeChildCollection.collection = contributions.children\n .map((contribution) => {\n const [key] = Object.keys(contribution);\n\n const attributeData = Array.isArray(data.children)\n ? data.children.find((attr) => attr.key === key)\n : {};\n\n const attributeContribution = contribution[key];\n\n if (\n \"type\" in contributions &&\n typeof contributions.type === \"string\" &&\n contributions.type.includes(\"range\") &&\n !attributeContribution.type\n ) {\n attributeContribution.type = contributions.type.replace(\n \"range\",\n \"\",\n );\n }\n\n const attribute = AttributeFactory.createAttribute(\n key,\n {\n ...attributeData,\n dynamicschema: attributeData?.dynamicschema,\n },\n {\n ...attributeContribution,\n readonly:\n attributeContribution.readonly ?? \"readonly\" in contributions,\n },\n modelOptions,\n );\n\n if (attribute && \"key\" in data && typeof data.key === \"string\") {\n attribute.parentKey = data.key;\n }\n\n return attribute;\n })\n .filter((attribute) => attribute !== null);\n }\n\n return compositeChildCollection;\n }\n\n /*\n * Creates a composite for each child data element using the same contributions\n */\n static createMultiData(\n data: object,\n contributions: object,\n modelOptions?: ModelOptions,\n ) {\n const compositeChildCollection = new CompositeAttributeChildCollection();\n\n if (\"children\" in data && Array.isArray(data.children)) {\n compositeChildCollection.collection = data.children.map((childData) =>\n CompositeAttributeChildCollection.create(\n {\n ...data,\n children: childData,\n },\n contributions,\n modelOptions,\n ),\n );\n }\n\n return compositeChildCollection;\n }\n\n /**\n * Get input value of contributions\n */\n getInputValue(): string {\n return this.collection.map((child) => child.inputvalue).join(\",\");\n }\n\n get inputvalue() {\n return this.getInputValue();\n }\n\n /**\n * Validate input\n */\n validate() {\n return this.collection.every((child) => child.isValid);\n }\n\n /**\n * Retrieve error messages of this attribute\n */\n get errorCollection() {\n return new ErrorCollection(ErrorCollectionType.COMPOSITE_CHILDREN);\n }\n\n hasServerErrors(): boolean {\n return (\n this.errorCollection.serverErrors.length > 0 ||\n this.collection.some((child) => child.hasServerErrors())\n );\n }\n\n hasErrors(): boolean {\n return (\n this.errorCollection.hasItems() ??\n this.collection.some((child) => child.hasErrors())\n );\n }\n\n isValid() {\n return !this.hasErrors();\n }\n\n /**\n * Reset attribute to empty string\n */\n reset() {\n this.collection.forEach((child) => {\n child.reset();\n });\n }\n\n get initvalue(): MaybeAttributeValue | Record<string, MaybeAttributeValue> {\n const childrenObject: Record<string, MaybeAttributeValue> = {};\n const childrenArray: MaybeAttributeValue[] = [];\n\n for (const child of this.collection) {\n if (child instanceof CompositeAttributeChildCollection) {\n childrenArray.push(child.initvalue as MaybeAttributeValue);\n } else if (child.initvalue !== null) {\n childrenObject[child.key] = child.initvalue;\n }\n }\n\n if (\n childrenArray.length === 0 &&\n Object.keys(childrenObject).length === 0\n ) {\n return undefined;\n }\n\n if (childrenArray.length > 0) {\n return childrenArray;\n }\n\n return childrenObject;\n }\n\n get value(): unknown[] | Record<string, unknown> | undefined {\n if (this.first instanceof CompositeAttributeChildCollection) {\n return this.collection.map((collection) => collection.value);\n }\n\n let children: Record<string, unknown> = {};\n\n this.collection.forEach((attribute) => {\n if (attribute instanceof CompositeAttributeChildCollection) {\n return attribute.value;\n } else {\n if (attribute.formdata !== null && !attribute.readonly) {\n children = {\n ...children,\n ...attribute.formdata,\n };\n }\n return;\n }\n });\n\n if (Object.keys(children).length === 0) {\n return undefined;\n }\n\n return children;\n }\n\n get readonlyvalue(): string {\n if (this.first instanceof CompositeAttributeChildCollection) {\n return this.collection\n .map((collection) => collection.readonlyvalue)\n .join(\" | \");\n }\n\n return this.collection\n .filter((child) => child.value !== null)\n .map((child) => child.readonlyvalue)\n .join(\", \");\n }\n\n updateValidations(prefix: string, errors: ErrorObjectData[]) {\n this.collection.forEach((child) => {\n if (child instanceof CompositeAttributeChildCollection) {\n child.updateValidations(prefix, errors);\n } else {\n const attributeErrors = errors.filter(\n (error) => error.anchor?.elementid === `${prefix}${child.key}`,\n );\n\n child.updateValidations(attributeErrors);\n }\n });\n }\n\n setUseClientsideValidation(enabled: boolean) {\n this.collection.forEach((child) => {\n child.setUseClientsideValidation(enabled);\n });\n }\n\n hasValue(): boolean {\n return this.collection.some((child) => child.hasValue());\n }\n\n getChildByAttribute(attribute: AttributeModel) {\n return this.collection.find((child) => {\n if (child instanceof BaseAttributeModel && child.equals(attribute)) {\n return true;\n } else if (child instanceof CompositeAttributeModel) {\n return child.getChildByAttribute(attribute);\n }\n\n return false;\n });\n }\n\n getChildByKey(key: string) {\n return this.collection.find((child) => {\n if (child instanceof BaseAttributeModel && child.key === key) {\n return true;\n } else if (child instanceof CompositeAttributeModel) {\n return child.getChildByKey(key);\n }\n\n return false;\n });\n }\n}\n","import { ATTRIBUTE_WIDTH } from \"../../constants/Constants\";\nimport { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { CompositeAttributeChildCollection } from \"./CompositeAttributeChildCollection\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { ConstraintCollection } from \"./input-constraints/ConstraintCollection\";\n\nimport type { ContentConfiguration } from \"../contentconfiguration/ContentConfiguration\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelOptions, ModelWithChildModels } from \"../types\";\nimport type {\n AttributeContributions,\n AttributeData,\n AttributeModel,\n CompositeAttributeContributions,\n MaybeAttributeValue,\n} from \"./types\";\n\nexport class CompositeAttributeModel<\n C extends CompositeAttributeContributions = CompositeAttributeContributions,\n> extends BaseAttributeModel<CompositeAttributeContributions> {\n private _children: CompositeAttributeChildCollection;\n\n constructor(\n data?: AttributeData,\n contributions?: C,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n this._children = CompositeAttributeChildCollection.create(\n data ?? {},\n contributions ?? {},\n modelOptions,\n );\n\n this.setChildrenOptionality();\n }\n\n static override isApplicableModel(contributions: AttributeContributions) {\n return (\n contributions.type === ATTRIBUTE_TYPE.COMPOSITE ||\n (contributions.type === ATTRIBUTE_TYPE.ARRAY &&\n \"children\" in contributions)\n );\n }\n\n override getInitialChildModelLinks() {\n return this.children.getInitialChildModelLinks();\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n errors: ErrorResponse[],\n ) {\n this.children.setChildModels(models, errors);\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.COMPOSITE;\n }\n\n get children() {\n return this._children;\n }\n\n set children(children: CompositeAttributeChildCollection) {\n this._children = children;\n }\n\n get start() {\n return this.children.all[0];\n }\n\n get end() {\n return this.children.all[this.children.size - 1];\n }\n\n /**\n * Get input value of attribute\n */\n override getInputValue() {\n return this.children.getInputValue();\n }\n\n /**\n * Check if at least one child has value\n */\n override hasValue(): boolean {\n return this.children.some((child) => child.hasValue());\n }\n\n override get constraintCollection() {\n const constraints = new ConstraintCollection();\n\n constraints.add(this.getServerConstraints());\n constraints.add(this.addConstraints());\n\n return constraints;\n }\n\n /**\n * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION\n */\n override setUseClientsideValidation(enabled: boolean) {\n super.setUseClientsideValidation(enabled);\n\n this.children.all.forEach((child) =>\n child.setUseClientsideValidation(enabled),\n );\n }\n\n /**\n * Validate input\n */\n override validate(value: MaybeAttributeValue) {\n // when client side validation is disabled, this attribute is always valid\n if (!this.useClientsideValidation()) {\n return true;\n }\n\n this._isValid = this.children.validate();\n\n if (this._isValid) {\n this._isValid = this.constraintCollection.validate(value);\n }\n\n return this._isValid;\n }\n\n /**\n * Indicates if attribute input is valid\n */\n override get isValid() {\n return this.validate(\"\");\n }\n\n override hasServerErrors(): boolean {\n return (\n this.errorCollection.serverErrors.length > 0 ||\n this.children.some((child) => child.hasServerErrors())\n );\n }\n\n override hasErrors(): boolean {\n return (\n this.errorCollection.hasItems() ??\n this.children.some((child) => child.hasErrors())\n );\n }\n\n /**\n * Reset attribute to empty string\n */\n override reset() {\n this.children.reset();\n }\n\n getChildByAttribute(attribute: AttributeModel): AttributeModel | undefined {\n return this.children.find((child): boolean => {\n if (child instanceof CompositeAttributeChildCollection) {\n return false;\n }\n return child.equals(attribute);\n }) as AttributeModel;\n }\n\n getChildByKey(key: string) {\n return this.children.find((child): boolean => {\n if (child instanceof BaseAttributeModel && child.key === key) {\n return true;\n } else if (\n child instanceof CompositeAttributeModel ||\n child instanceof CompositeAttributeChildCollection\n ) {\n return child.getChildByKey(key) !== undefined;\n }\n\n return false;\n });\n }\n\n override mergeAttribute(oldAttribute: AttributeModel) {\n this.concept = oldAttribute.concept;\n\n this.children.forEach((child) => {\n if (\n oldAttribute instanceof CompositeAttributeModel &&\n child instanceof BaseAttributeModel\n ) {\n const withChildAttribute = oldAttribute.getChildByKey(child.key);\n if (withChildAttribute) {\n child.mergeAttribute(withChildAttribute as AttributeModel);\n }\n }\n });\n }\n\n override update(\n value: MaybeAttributeValue,\n changedAttribute?: AttributeModel,\n ) {\n if (!changedAttribute) {\n throw new IllegalArgumentException(\n \"Composite attribute needs changed attribute on update call\",\n );\n }\n\n this.updateLastModification();\n\n this.children.forEach((child) => {\n if (child instanceof CompositeAttributeModel) {\n child.update(value, changedAttribute);\n } else if (\n child instanceof BaseAttributeModel &&\n child.equals(changedAttribute)\n ) {\n child.update(value);\n }\n });\n\n this.setChildrenOptionality();\n\n this.validate(value as string);\n\n return this;\n }\n\n override updateByAttribute(otherAttribute: AttributeModel) {\n if (otherAttribute instanceof CompositeAttributeModel) {\n otherAttribute.children.forEach((otherChild) => {\n if (!(otherChild instanceof CompositeAttributeChildCollection)) {\n const child = this.getChildByAttribute(otherChild);\n if (child) {\n child.updateByAttribute(otherChild);\n }\n }\n });\n } else {\n console.error(\n `update of composite attribute with ${otherAttribute.type} not supported`,\n );\n }\n }\n\n setChildrenOptionality() {\n const childrenAreOptional =\n !this.mandatory && this.children.every((child) => child.value === null);\n\n this.children.forEach((child) => {\n if (child instanceof BaseAttributeModel) {\n child.mandatory =\n childrenAreOptional || !child.configuredMandatory\n ? false\n : child.configuredMandatory;\n }\n });\n }\n\n override get readonly() {\n return (\n super.readonly ??\n this.children.every(\n (child) => child instanceof BaseAttributeModel && child.readonly,\n )\n );\n }\n\n override set readonly(readonly: boolean) {\n super.readonly = readonly;\n }\n\n override get readonlyvalue() {\n return this.children.readonlyvalue;\n }\n\n override get initvalue() {\n return this.children.initvalue;\n }\n\n override getFormData() {\n return { [this.name]: this.value };\n }\n\n override getValue(): MaybeAttributeValue {\n return this.children.value as MaybeAttributeValue;\n }\n\n getChildrenIds() {\n const values = this.data.value;\n if (Array.isArray(values)) {\n return values.map((val) => {\n if (typeof val === \"object\" && val != null && \"_id\" in val) {\n return val._id;\n }\n return undefined;\n });\n } else if (values != null) {\n if (typeof values === \"object\" && \"_id\" in values) {\n return [values._id];\n }\n }\n return [];\n }\n\n override get isResult() {\n return this._isResult;\n }\n\n override set isResult(isResult: boolean) {\n this._isResult = isResult;\n\n this.children.forEach((child) => {\n if (!(child instanceof CompositeAttributeChildCollection)) {\n child.isResult = isResult;\n }\n });\n }\n\n override indicateContentConfiguration(\n contentConfiguration: ContentConfiguration,\n ) {\n if (contentConfiguration) {\n this.children.forEach((child) => {\n if (!(child instanceof CompositeAttributeChildCollection)) {\n child.indicateContentConfiguration(contentConfiguration);\n }\n });\n }\n }\n\n override equals(otherAttribute: AttributeModel): boolean {\n return (\n (this.key === otherAttribute.key &&\n this.parentKey === otherAttribute.parentKey) ||\n this.children.some(\n (child) =>\n child instanceof BaseAttributeModel && child.equals(otherAttribute),\n )\n );\n }\n\n override get readonlyWidth(): ATTRIBUTE_WIDTH {\n if (this.type === \"composite\") {\n return ATTRIBUTE_WIDTH.LARGE;\n }\n\n // range\n const type =\n this.start instanceof BaseAttributeModel ? this.start.type : \"\";\n switch (type) {\n case \"datetime\":\n return ATTRIBUTE_WIDTH.LARGE;\n case \"timestamp\":\n return ATTRIBUTE_WIDTH.EXTRA_LARGE;\n default:\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n }\n}\n","import { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\nimport { TITLE } from \"../../layouthints/LayoutHints\";\nimport { hasAllContentInData } from \"../../settings/Settings\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { ConceptDetailModel } from \"../concepts/ConceptDetailModel\";\nimport { LinkCollection } from \"../links/LinkCollection\";\nimport { AttributeCollection } from \"./AttributeCollection\";\nimport { AttributeContent } from \"./AttributeContent\";\nimport { ChoiceAttributeOptionCollection } from \"./ChoiceAttributeOptionCollection\";\n\nimport type { Contributions, ISO_DATE } from \"../../types/types\";\nimport type { ContentConfigurationElements } from \"../contentconfiguration/ContentConfigurationElements\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ListItemModel } from \"../list/ListItemModel\";\nimport type { ModelOptions, ModelWithChildModels } from \"../types\";\n\nexport interface ChoiceAttributeOptionModelOptions extends ModelOptions {\n referenceDate: ISO_DATE;\n}\n\nexport class ChoiceAttributeOptionModel\n extends BaseModel\n implements ModelWithChildModels\n{\n private _code: string;\n private _isSelected: boolean;\n\n private _concept: ConceptDetailModel | undefined;\n private _referenceDate: ISO_DATE;\n\n private _level: number;\n\n private _attributeCollection: AttributeCollection;\n private _children: ChoiceAttributeOptionCollection;\n\n private _links: LinkCollection;\n\n private _content: AttributeContent;\n private _isUser = false;\n\n constructor(\n selectedValues: string[] = [],\n option: Contributions = {},\n modelOptions?: ChoiceAttributeOptionModelOptions,\n ) {\n super({}, option);\n\n this._code = this.getContributionAsString(\n \"code\",\n this.getContributionAsString(\"key\", \"\"),\n );\n this._isSelected = selectedValues.includes(this.code);\n this._referenceDate =\n modelOptions?.referenceDate || new Date().toISOString().split(\"T\")[0];\n\n this._level = 0;\n this._attributeCollection = this.createAttributeCollection(modelOptions);\n this._children = this.addChildren(selectedValues, option, modelOptions);\n this._links = new LinkCollection(\n this.contributions._links as Record<string, unknown>,\n {},\n { origin: modelOptions?.origin, contextPath: modelOptions?.contextPath },\n );\n this._content = this.createContent();\n this._isUser = \"optionType\" in option && option.optionType === \"user\";\n }\n\n get type() {\n return \"option\";\n }\n\n static createFromListItemModel(listitem: ListItemModel) {\n const option = new ChoiceAttributeOptionModel();\n option.code = listitem.id?.toString() ?? \"\";\n // TODO: how to handle this\n // option.attributeCollection = listitem.attributeCollection.clone();\n // option.links = listitem.links.clone();\n return option;\n }\n\n /**\n * Indicates that this a choice attribute option model, used when adding options to a choice attribute\n * @returns {boolean}\n */\n get isChoiceAttributeOptionModel() {\n return true;\n }\n\n getInitialChildModelLinks() {\n const initialLinks = [];\n\n if (!this.hasContentFromData() && this.conceptLink) {\n initialLinks.push(this.conceptLink);\n }\n\n if (this.children) {\n initialLinks.push(...this.children.getInitialChildModelLinks());\n }\n\n return initialLinks;\n }\n\n setChildModels(models: ModelWithChildModels[], errors: ErrorResponse[] = []) {\n const conceptHref = this.conceptLink?.href;\n if (conceptHref) {\n const concept = models.find((model) => {\n if (model instanceof ConceptDetailModel) {\n return model.selfhref.equalsWithParameters(conceptHref);\n }\n return false;\n });\n\n this.concept = concept as ConceptDetailModel | undefined;\n }\n\n if (this.children) {\n this.children.setChildModels(models, errors);\n }\n }\n\n /**\n * Get code of option\n */\n get code() {\n return this._code;\n }\n\n set code(code: string) {\n this._code = code;\n }\n\n equals(model: ChoiceAttributeOptionModel) {\n return this.code.toString() === model.code.toString();\n }\n\n createAttributeCollection(modelOptions?: ChoiceAttributeOptionModelOptions) {\n const contributions = this.getContributionAsArray(\n \"elementsContributions\",\n [],\n );\n const data = this.getContributionAsObject(\"elements\", {}) as Record<\n string,\n unknown\n >;\n return new AttributeCollection(data, contributions, {\n origin: modelOptions?.origin,\n contextPath: modelOptions?.contextPath,\n isReadonly: true,\n });\n }\n\n /**\n * Retrieve attributes for Composite codemaps (e.g. table and case list codemaps)\n */\n get attributeCollection() {\n return this._attributeCollection;\n }\n\n set attributeCollection(attributeCollection: AttributeCollection) {\n this._attributeCollection = attributeCollection;\n }\n\n /**\n * Get label of option for simple codemaps (e.g. static codemap)\n */\n get label(): string {\n const contributionsLabel = this.getContributionAsString(\"label\");\n if (contributionsLabel) {\n return contributionsLabel;\n }\n\n if (this.attributeCollection.hasItems()) {\n const title = this.attributeCollection.getAttributeByLayoutHint(TITLE);\n\n if (title) {\n return title.readonlyvalue;\n }\n\n if (this.attributeCollection.first) {\n return this.attributeCollection.first.readonlyvalue;\n }\n }\n\n return \"\";\n }\n\n /**\n * Retrieve the first permitted label to render when a concept and contentConfiguration is available\n * Be aware that permission could be in place for labels from a concept.\n */\n getContentConfiguredLabel(\n contentConfiguration?: ContentConfigurationElements,\n ) {\n if (this.hasContentFromData()) {\n return this.content?.label || this.label;\n }\n\n if (contentConfiguration) {\n return contentConfiguration.getContentConfiguredLabel(\n this.concept,\n this.label,\n );\n }\n\n return undefined;\n }\n\n /**\n * Indicates if content comes from the data service\n */\n hasContentFromData() {\n return hasAllContentInData();\n }\n\n get content() {\n return this._content;\n }\n\n addChildren(\n selectedValues: string[] = [],\n option: object = {},\n modelOptions?: ChoiceAttributeOptionModelOptions,\n ) {\n // When contributions contain elements this is a list not nested options\n if (\"elements\" in option) {\n return new ChoiceAttributeOptionCollection();\n }\n\n const children = \"children\" in option ? option.children : [];\n\n return ChoiceAttributeOptionCollection.create(\n {\n value: selectedValues,\n },\n { options: children ?? [] },\n modelOptions,\n );\n }\n\n get children() {\n return this._children;\n }\n\n createContent() {\n return AttributeContent.create(this.getContributionAsObject(\"content\"));\n }\n\n /**\n * Indicates if option is selected\n */\n get selected() {\n return this._isSelected;\n }\n\n /**\n * Set selected property of option\n */\n set selected(selected: boolean) {\n this._isSelected = selected;\n }\n\n /**\n * Retrieve count of filter for option\n */\n get count() {\n return this.getContributionAsNumber(\"count\");\n }\n\n /**\n * Retrieve links of attribute\n */\n get links() {\n return this._links;\n }\n\n set links(links: LinkCollection) {\n this._links = links;\n }\n\n get selfhref() {\n return this.links.getLinkByKey(\"self\")?.href;\n }\n\n /**\n * referenceDate received from attribute\n */\n get referenceDate() {\n return this._referenceDate;\n }\n\n /**\n */\n set referenceDate(date: ISO_DATE) {\n this._referenceDate = date;\n }\n\n /**\n * Retrieve concept link of attribute when available\n */\n get conceptLink() {\n const conceptLink = this.links.getLinkByKey(\"concept\");\n\n if (conceptLink) {\n conceptLink.href = conceptLink.href.addParameter(\n TIMEVERSION_FILTER_NAME,\n this.referenceDate,\n );\n\n conceptLink.isCacheable = true;\n }\n\n return conceptLink;\n }\n\n /**\n * Get concept information\n */\n get concept() {\n return this._concept;\n }\n\n /**\n * Set the concept\n */\n set concept(concept) {\n this._concept = concept;\n }\n\n /**\n * Get level of option, used in tree view choice attributes (taxonomy)\n */\n get level() {\n return this._level;\n }\n\n /**\n * Set level of option\n */\n set level(level: number) {\n this._level = level;\n }\n\n get isBooleanType() {\n return this.getContributionAsBoolean(\"isBooleanType\", false);\n }\n\n get hasAlternativeLabel() {\n return this.getContributionAsBoolean(\"hasAlternativeLabel\", false);\n }\n\n get isUser() {\n return this._isUser;\n }\n\n mergeOption(withOption: ChoiceAttributeOptionModel) {\n this.concept = withOption.concept;\n\n if (this.children != null && withOption.children != null) {\n this.children.mergeOptions(withOption.children);\n }\n }\n}\n","import { getContextPathModularUI } from \"../../settings/Paths\";\nimport { ResourceCollection } from \"../base/ResourceCollection\";\nimport { ListHeaderModel } from \"../list/ListHeaderModel\";\nimport { ChoiceAttributeOptionModel } from \"./ChoiceAttributeOptionModel\";\n\nimport type { Contributions, ISO_DATE } from \"../../types/types\";\nimport type { ChoiceAttributeOptionModelOptions } from \"./ChoiceAttributeOptionModel\";\nimport type { AttributeContributions, MaybeAttributeValue } from \"./types\";\n\nexport class ChoiceAttributeOptionCollection extends ResourceCollection<ChoiceAttributeOptionModel> {\n private _modelOptions: ChoiceAttributeOptionModelOptions;\n private _headers: ListHeaderModel[] = [];\n private _sortOptions = false;\n\n constructor(modelOptions?: ChoiceAttributeOptionModelOptions) {\n super();\n this._modelOptions = modelOptions || {\n origin: \"\",\n contextPath: getContextPathModularUI(),\n referenceDate: new Date().toISOString().split(\"T\")[0],\n };\n }\n\n set sortOptions(sortOptions: boolean) {\n this._sortOptions = sortOptions;\n\n this.collection.forEach((option) => {\n if (option.children) {\n option.children.sortOptions = sortOptions;\n }\n });\n }\n\n get sortOptions() {\n return this._sortOptions;\n }\n\n static create(\n data: object = {},\n contributions: object = {},\n modelOptions?: ChoiceAttributeOptionModelOptions,\n ): ChoiceAttributeOptionCollection {\n const collection = new ChoiceAttributeOptionCollection(modelOptions);\n\n if (\"type\" in contributions && contributions.type === \"boolean\") {\n const value = \"value\" in data ? data.value : undefined;\n collection.addBooleanOptions(value as MaybeAttributeValue, contributions);\n } else if (\"dynamicschema\" in data && data.dynamicschema != null) {\n collection.addDynamicSchema(data, contributions);\n } else if (\"options\" in contributions && contributions.options != null) {\n collection.addOptions(data, contributions);\n }\n\n if (\"children\" in contributions && Array.isArray(contributions.children)) {\n collection.addHeaders(contributions.children);\n }\n\n return collection;\n }\n\n /**\n * Retrieve all items in collection\n */\n override get all() {\n return this.sortOptions\n ? this.collection.sort((a, b) => a.label.localeCompare(b.label))\n : this.collection;\n }\n\n private getSelectedOptions(data: object) {\n const selectedOptions = [];\n\n if (\"options\" in data && Array.isArray(data.options)) {\n selectedOptions.push(\n ...data.options\n .filter((option) => option.selected)\n .map((option) => option.key),\n );\n } else if (\"value\" in data) {\n if (\"value\" in data && Array.isArray(data.value)) {\n selectedOptions.push(...data.value);\n } else if (typeof data.value === \"boolean\") {\n selectedOptions.push(data.value.toString());\n } else {\n selectedOptions.push(data.value);\n }\n }\n\n return selectedOptions;\n }\n\n private getOptionCount(code: string, options: object[]) {\n if (Array.isArray(options)) {\n const foundOption = options.find(\n (option) => \"key\" in option && option.key === code,\n );\n if (foundOption) {\n return \"count\" in foundOption && typeof foundOption.count === \"number\"\n ? foundOption.count\n : undefined;\n }\n }\n\n return undefined;\n }\n\n /**\n */\n addOptions(\n data: object,\n contributions: object,\n ): ChoiceAttributeOptionCollection {\n const selectedValues = this.getSelectedOptions(data);\n\n if (\"options\" in contributions && Array.isArray(contributions.options)) {\n const options =\n \"options\" in data && Array.isArray(data.options) ? data.options : [];\n\n contributions.options.forEach((optionContributions) => {\n const optionCode = optionContributions.code || optionContributions.key;\n const optionType =\n \"optionType\" in contributions ? contributions.optionType : \"generic\";\n\n this.addOption(selectedValues, {\n ...optionContributions,\n count: this.getOptionCount(optionCode, options),\n optionType: optionType,\n });\n });\n }\n\n return this;\n }\n\n /**\n * Create options based on data and dynamischema\n */\n addDynamicSchema(\n data: object,\n contributions: object,\n ): ChoiceAttributeOptionCollection {\n const selectedValues = this.getSelectedOptions(data);\n\n if (\"dynamicschema\" in data && Array.isArray(data.dynamicschema)) {\n const options =\n \"options\" in data && Array.isArray(data.options) ? data.options : [];\n const children =\n \"children\" in contributions ? contributions.children : undefined;\n const optionType =\n \"optionType\" in contributions ? contributions.optionType : \"generic\";\n\n data.dynamicschema.forEach((optionDynamicschema) => {\n this.addOption(selectedValues, {\n ...optionDynamicschema,\n count: this.getOptionCount(optionDynamicschema.code, options),\n optionType,\n elementsContributions: children,\n });\n });\n }\n\n return this;\n }\n\n addBooleanOption(\n code: \"true\" | \"false\",\n defaultLabel: string,\n data: string | string[],\n options: object[] = [],\n ) {\n const foundOption = options.find(\n (option) => \"code\" in option && option.code === code,\n );\n\n const label =\n foundOption && \"label\" in foundOption ? foundOption.label : defaultLabel;\n\n this.addOption(data, {\n code,\n label,\n isBooleanType: true,\n hasAlternativeLabel: foundOption != null,\n });\n }\n\n /**\n * Create two static options for true and false,\n * there might be alternative labels configured for each option value\n */\n addBooleanOptions(value: MaybeAttributeValue, contributions: Contributions) {\n const optionValue = value == null ? [] : [value.toString()];\n\n const options =\n \"options\" in contributions && Array.isArray(contributions.options)\n ? contributions.options\n : [];\n\n this.addBooleanOption(\"true\", \"Yes\", optionValue, options);\n this.addBooleanOption(\"false\", \"No\", optionValue, options);\n\n return this;\n }\n\n /**\n */\n addOption(\n data: string | string[],\n contributions: Record<string, unknown>,\n ): ChoiceAttributeOptionCollection {\n const optionModel = new ChoiceAttributeOptionModel(\n Array.isArray(data) ? data : [data],\n contributions,\n this._modelOptions,\n );\n\n this.add(optionModel);\n\n return this;\n }\n\n getOptionByCode(code: string) {\n return this.collection.find((option) => option.code === code);\n }\n\n hasOptionByCode(code: string) {\n return this.collection.some((option) => option.code === code);\n }\n\n /**\n * Get all options that have selected property true\n */\n get selected() {\n const selectedOptions: ChoiceAttributeOptionModel[] = [];\n\n this.collection.forEach((option: ChoiceAttributeOptionModel) => {\n if (option.selected && option.selected === true) {\n selectedOptions.push(option);\n }\n\n if (option.children) {\n selectedOptions.push(...option.children.selected);\n }\n });\n\n return selectedOptions;\n }\n\n /**\n * Deselect all options\n */\n deselectAll() {\n this.collection = this.collection.map((option) => {\n option.selected = false;\n\n if (option.children) {\n option.children.deselectAll();\n }\n\n return option;\n });\n }\n\n /**\n * Select an option by it's code\n */\n select(optionCode: string) {\n this.toggle(optionCode, \"select\");\n }\n\n /**\n * Deselect an option by it's code\n */\n deselect(optionCode: string) {\n this.toggle(optionCode, \"deselect\");\n }\n\n /**\n * Toggle an option by it's code\n */\n toggle(optionCode: string, action: \"select\" | \"deselect\") {\n this.collection = this.collection.map((option) => {\n if (option.code === optionCode) {\n option.selected = action === \"select\";\n } else if (option.children) {\n option.children.toggle(optionCode, action);\n }\n\n return option;\n });\n }\n\n setReferenceDate(date: ISO_DATE) {\n return this.collection.map((option) => {\n option.referenceDate = date;\n if (option.children) {\n option.children.referenceDate = date;\n }\n\n return option;\n });\n }\n\n set referenceDate(date: ISO_DATE) {\n this.collection = this.setReferenceDate(date);\n }\n\n addHeaders(headers: Record<string, unknown>[]) {\n this._headers = headers.map(\n (child) =>\n new ListHeaderModel(child as Record<string, AttributeContributions>),\n );\n }\n\n get headers() {\n if (this._headers) {\n return this._headers;\n }\n\n return [];\n }\n\n /**\n */\n mergeOptions(\n withOptions: ChoiceAttributeOptionCollection,\n addNotExistingOptions = false,\n removeNotExistingOptions = false,\n ) {\n const newCollection: ChoiceAttributeOptionModel[] = [];\n\n this.collection.forEach((option) => {\n const foundOption = withOptions.find(\n (withOption) => withOption.code === option.code,\n );\n if (foundOption) {\n option.mergeOption(foundOption);\n newCollection.push(option);\n } else if (!removeNotExistingOptions) {\n newCollection.push(option);\n }\n });\n\n if (addNotExistingOptions) {\n this.collection = [\n ...newCollection,\n ...withOptions.filter(\n (option) => !this.collection.some((opt) => opt.code === option.code),\n ),\n ];\n } else {\n this.collection = newCollection;\n }\n }\n\n override some(\n callbackfn: (\n value: ChoiceAttributeOptionModel,\n index: number,\n array: ChoiceAttributeOptionModel[],\n ) => boolean,\n thisArg?: never,\n ): boolean {\n return this.collection.some((option, optionIndex, collectionArray) => {\n const result = callbackfn(option, optionIndex, collectionArray);\n if (!result && option.children) {\n return option.children.some(callbackfn, thisArg);\n }\n return result;\n });\n }\n}\n","import { ATTRIBUTE_WIDTH } from \"../../constants/Constants\";\nimport {\n RENDER_SECTION_LABEL,\n SORT_OPTIONS,\n} from \"../../layouthints/LayoutHints\";\nimport { ConceptDetailModel } from \"../concepts/ConceptDetailModel\";\nimport { ContentConfigurationElements } from \"../contentconfiguration/ContentConfigurationElements\";\nimport { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { ChoiceAttributeOptionCollection } from \"./ChoiceAttributeOptionCollection\";\nimport { ChoiceAttributeOptionModel } from \"./ChoiceAttributeOptionModel\";\nimport { CompositeAttributeModel } from \"./CompositeAttributeModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\n\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ErrorObjectData } from \"../form/types\";\nimport type { ModelOptions, ModelWithChildModels } from \"../types\";\nimport type {\n AttributeContributions,\n AttributeData,\n AttributeModel,\n ChoiceAttributeContributions,\n MaybeAttributeValue,\n} from \"./types\";\n\nexport enum CHOICETYPE {\n CHECKBOX = \"checkbox\",\n RADIOBUTTON = \"radiobutton\",\n COMBOBOX = \"combobox\",\n LIST = \"list\",\n LISTVIEW = \"listview\",\n TABLE = \"table\",\n LONGLIST = \"longlist\",\n TOGGLE = \"toggle\",\n}\n\n/**\n * Model for a choice attribute\n */\nexport class ChoiceAttributeModel<\n C extends ChoiceAttributeContributions = ChoiceAttributeContributions,\n> extends BaseAttributeModel<C> {\n private _options: ChoiceAttributeOptionCollection;\n\n constructor(\n attribute?: AttributeData,\n attributeContributions?: C,\n modelOptions?: ModelOptions,\n ) {\n super(attribute, attributeContributions, modelOptions);\n\n this.attributeReferenceDate = this.getDataAsString(\n \"referenceDate\",\n new Date().toISOString().split(\"T\")[0],\n );\n this._options = ChoiceAttributeOptionCollection.create(\n attribute,\n attributeContributions,\n { ...modelOptions, referenceDate: this.referenceDate },\n );\n\n if (this.layouthint.has(SORT_OPTIONS)) {\n this._options.sortOptions = true;\n }\n }\n\n static override isApplicableModel(contributions: AttributeContributions) {\n let type = \"\";\n if (\"type\" in contributions && typeof contributions.type === \"string\") {\n type = contributions.type;\n }\n\n if (type === \"choice\" || type === \"array\") {\n return true;\n }\n\n if (type !== \"composite\" && type !== \"boolean\") {\n return \"enumerated\" in contributions || \"options\" in contributions;\n }\n\n return false;\n }\n\n override get type() {\n const optionMode = this.getContributionAsString(\"optionMode\", \"\");\n const hasLookupLink = this.lookupLink || this.lookupListLink;\n\n if (\n optionMode === \"lookup\" ||\n (optionMode === \"dynamicWithThreshold\" && hasLookupLink)\n ) {\n return ATTRIBUTE_TYPE.LOOKUP;\n }\n\n return ATTRIBUTE_TYPE.CHOICE;\n }\n\n override getInitialChildModelLinks() {\n const links = [];\n\n if (this.hasContentConfiguration()) {\n if (!this.hasContentFromData() && this.conceptLink) {\n links.push(this.conceptLink);\n }\n\n links.push(...this.options.getInitialChildModelLinks());\n }\n\n return links;\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n errors: ErrorResponse[],\n ) {\n const conceptLinkHref = this.conceptLink?.href;\n if (conceptLinkHref) {\n const model = models.find((model) => {\n if (model instanceof ConceptDetailModel) {\n return model.selfhref?.equalsWithParameters(conceptLinkHref);\n }\n return false;\n });\n this.concept = model as ConceptDetailModel | undefined;\n }\n this.options.setChildModels(models, errors);\n }\n\n get optionType() {\n return this.contributions?.optionType ?? \"generic\";\n }\n\n get isUser() {\n return this.optionType === \"user\";\n }\n\n /**\n * Retrieve lookup service link\n */\n get lookupLink() {\n return this.links.getLinkByKey(\"lookupOptions\");\n }\n\n /**\n * Retrieve lookup service as list link\n */\n get lookupListLink() {\n return this.links.getLinkByKey(\"lookupList\");\n }\n\n get lookupListLabel() {\n return this.contributions.lookupList?.label ?? \"\";\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n */\n override get referenceDate(): ISO_DATE {\n return this.attributeReferenceDate;\n }\n\n /**\n * Set reference date for concepts and content\n */\n override set referenceDate(date: string) {\n this.attributeReferenceDate = date;\n this.options.referenceDate = date;\n }\n\n /**\n * Retrieve available choice options\n */\n get options() {\n return this._options;\n }\n\n /**\n * Getting all enabled options\n */\n get selected() {\n return this.options.selected.map(\n (option: ChoiceAttributeOptionModel) => option.code,\n );\n }\n\n /**\n * Flatten options and filter out the options that are not selected\n */\n override get readonlyvalue() {\n return this.options.selected.map((option) => option.label).join(\", \");\n }\n\n override get initvalue() {\n const initvalue = this.getInitValue();\n if (Array.isArray(initvalue) && initvalue.length !== 0) {\n return initvalue;\n }\n return initvalue;\n }\n\n /**\n * Retrieve list of selected options, joined with comma\n */\n override getValue() {\n return this.options.selected.length > 0\n ? this.options.selected.map((option) => option.code).join(\",\")\n : null;\n }\n\n override hasValue() {\n return this.options.selected.length > 0;\n }\n\n /**\n * Get input value of attribute\n */\n override getInputValue() {\n return this.selected.join(\",\");\n }\n\n /**\n * Setting an option selected or unselected based on the current state\n */\n toggleOption(code: string) {\n if (this.selected.includes(code)) {\n this.disableOption(code);\n } else {\n this.enableOption(code);\n }\n }\n\n /**\n * Enable a option\n */\n enableOption(code: string) {\n if (!this.isMultiple) {\n this.options.deselectAll();\n }\n\n this.options.select(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Disable a option\n */\n disableOption(code: string) {\n this.options.deselect(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Add a new option to the collection of lookup options\n */\n addOption(option: Record<string, unknown>) {\n if (!this.isMultiple) {\n this.options.deselectAll();\n }\n\n const code =\n \"code\" in option && typeof option.code === \"string\" ? option.code : \"\";\n\n if (this.options.find((opt) => opt.code === code) === undefined) {\n this.options.addOption(code, option);\n }\n }\n\n /**\n * Getting the type of choice filter. For instance checkbox, radiobutton, combobox.\n */\n get choicetype() {\n return (\n [\n CHOICETYPE.CHECKBOX,\n CHOICETYPE.RADIOBUTTON,\n CHOICETYPE.COMBOBOX,\n CHOICETYPE.LIST,\n CHOICETYPE.LISTVIEW,\n CHOICETYPE.TABLE,\n CHOICETYPE.LONGLIST,\n CHOICETYPE.TOGGLE,\n ].find((hint) => this.layouthint.has(hint)) ?? CHOICETYPE.CHECKBOX\n );\n }\n\n /**\n * Can multiple options be selected\n */\n get isMultiple() {\n return (\n this.getContributionAsBoolean(\"multiplechoice\") ??\n this.choicetype === CHOICETYPE.CHECKBOX\n );\n }\n\n /**\n * Check if options need to be rendered as tree\n */\n get isTree() {\n return this.getContributionAsArray(\"options\", []).some(\n (option) => \"children\" in option,\n );\n }\n\n /**\n * Reset choice attribute to unselected list\n */\n reset() {\n this.options.deselectAll();\n }\n\n override mergeAttribute(\n oldAttribute: AttributeModel,\n addNotExistingOptions = false,\n removeNotExistingOptions = false,\n ) {\n // when attribute is readonly, don't merge the options no modifications necessary\n if (!this.readonly && oldAttribute instanceof ChoiceAttributeModel) {\n this.concept = oldAttribute.concept;\n this.options.mergeOptions(\n oldAttribute.options,\n addNotExistingOptions ?? this.type === \"lookup\",\n removeNotExistingOptions,\n );\n this.options.deselectAll();\n\n if (oldAttribute.isValid && oldAttribute.inputvalue !== null) {\n this.update(oldAttribute.inputvalue);\n }\n }\n }\n\n /**\n * Update attribute by name and value\n */\n update(value: MaybeAttributeValue) {\n if (this.readonly) {\n return this;\n }\n\n this.updateLastModification();\n\n let values;\n\n if (Array.isArray(value)) {\n values = value;\n } else if (typeof value === \"string\" && this.isMultiple) {\n values = value.split(\",\");\n } else {\n values = [value];\n }\n values.forEach((val) => {\n if (val instanceof ChoiceAttributeOptionModel) {\n // option does not exist in existing options, add it. This can happen when lookup list has other options then lookup options\n if (!this.options.some((option) => option.equals(val))) {\n this.options.add(val);\n }\n\n this.toggleOption(val.code);\n } else if (\n typeof val === \"string\" &&\n this.options.some((option) => option.code.toString() === val)\n ) {\n this.toggleOption(val);\n }\n });\n\n return this;\n }\n\n updateByAttribute(otherAttribute: AttributeModel) {\n this.reset();\n if (\n otherAttribute instanceof ChoiceAttributeModel ||\n otherAttribute instanceof CompositeAttributeModel\n ) {\n let otherValue;\n if (otherAttribute instanceof ChoiceAttributeModel) {\n otherValue = otherAttribute.options.selected;\n } else if (otherAttribute instanceof CompositeAttributeModel) {\n otherValue = otherAttribute.getChildrenIds();\n }\n if (otherValue != null) {\n this.update(otherValue as MaybeAttributeValue);\n }\n } else {\n console.error(\n `update of choice attribute with ${otherAttribute.type} not supported`,\n );\n }\n }\n\n /**\n * Registers a missing error that was received from the server\n */\n override addMissingError(receivedAttribute?: AttributeModel) {\n if (this.isChangedSince(0)) {\n this.attributeErrors.addServerError(\"Constraint.Missing\");\n }\n // update choice options\n if (receivedAttribute instanceof ChoiceAttributeModel) {\n this.mergeAttribute(receivedAttribute, true, true);\n }\n }\n\n override setHasContentConfiguration(hasContentConfiguration: boolean) {\n super.setHasContentConfiguration(\n this.contentConfiguration != undefined || hasContentConfiguration,\n );\n }\n\n /**\n * Get content configuration configured on the attribute.\n * Only applicable for taxonomy element and knowledge codemaps,\n * content configuration for instrument questions is available on the form object\n */\n get contentConfiguration() {\n if (!this.contributions.content?.optionElements) {\n return undefined;\n }\n\n // Add RENDER_SECTION_LABEL to all content configuration to make sure the label of a section is always rendered on taxonomy and knowlege codemaps\n const optionElementConfig = this.contributions.content.optionElements.map(\n (optionElement) => {\n if (\"contentElement\" in optionElement) {\n return {\n contentElement: {\n layouthint: [RENDER_SECTION_LABEL],\n ...optionElement.contentElement,\n },\n };\n }\n\n return optionElement;\n },\n );\n\n return new ContentConfigurationElements(optionElementConfig);\n }\n\n /**\n * Get placeholder text\n */\n override get placeholder() {\n return this.getContributionAsString(\"placeholder\", \"\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n override addServerError(error: ErrorObjectData) {\n const { id, message, properties, layouthint } = error;\n\n const ANSWER_OPTION_KEY = \"answer-option-key\";\n\n if (properties && ANSWER_OPTION_KEY in properties) {\n const optionKey = properties[ANSWER_OPTION_KEY];\n const foundOption = this.options.find(\n (option) => option.code === optionKey,\n );\n if (foundOption) {\n properties[ANSWER_OPTION_KEY] =\n foundOption.getContentConfiguredLabel(\n this.contentConfiguration ?? undefined,\n ) ?? \"\";\n }\n }\n\n this.attributeErrors.addServerError(id, message, properties, layouthint);\n }\n\n override get readonlyWidth(): ATTRIBUTE_WIDTH {\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n","import { ATTRIBUTE_WIDTH } from \"../../constants/Constants\";\nimport { RENDER_SECTION_LABEL } from \"../../layouthints/LayoutHints\";\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\nimport { ContentConfigurationElements } from \"../contentconfiguration/ContentConfigurationElements\";\nimport { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { CHOICETYPE } from \"./ChoiceAttributeModel\";\nimport { ChoiceAttributeOptionCollection } from \"./ChoiceAttributeOptionCollection\";\nimport { ChoiceAttributeOptionModel } from \"./ChoiceAttributeOptionModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\n\nimport type { Contributions, ISO_DATE } from \"../../types/types\";\nimport type { ModelOptions } from \"../types\";\nimport type {\n AttributeData,\n AttributeModel,\n BooleanAttributeContributions,\n MaybeAttributeValue,\n} from \"./types\";\n\nexport class BooleanAttributeModel extends BaseAttributeModel<BooleanAttributeContributions> {\n private _referenceDate: ISO_DATE;\n private _options: ChoiceAttributeOptionCollection;\n\n constructor(\n data?: AttributeData,\n contributions?: BooleanAttributeContributions,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n this._referenceDate = this.getDataAsString(\n \"referenceDate\",\n DateUtil.now(),\n ) as ISO_DATE;\n this._options = ChoiceAttributeOptionCollection.create(\n data,\n contributions,\n { ...modelOptions, referenceDate: this.referenceDate },\n );\n }\n\n static override isApplicableModel(contributions: Contributions) {\n return \"type\" in contributions && contributions.type === \"boolean\";\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.BOOLEAN;\n }\n\n /**\n * Retrieve reference date of attribute which can be used as entryDate for content\n */\n override get referenceDate() {\n return this._referenceDate as ISO_DATE;\n }\n\n /**\n * Set reference date for concepts and content\n */\n override set referenceDate(date: ISO_DATE) {\n this._referenceDate = date;\n\n this.options.referenceDate = date;\n }\n\n /**\n * Getting the type of choice filter. For instance checkbox, radiobutton, combobox.\n */\n get choicetype(): CHOICETYPE {\n return (\n [\n CHOICETYPE.CHECKBOX,\n CHOICETYPE.RADIOBUTTON,\n CHOICETYPE.COMBOBOX,\n CHOICETYPE.TOGGLE,\n ].find((hint) => this.layouthint.has(hint)) ?? CHOICETYPE.RADIOBUTTON\n );\n }\n\n /**\n * Can multiple options be selected\n */\n get isMultiple() {\n return false;\n }\n\n /**\n * Check if options need to be rendered as tree\n */\n get isTree() {\n return false;\n }\n\n override setHasContentConfiguration(hasContentConfiguration: boolean) {\n super.setHasContentConfiguration(\n this.contentConfiguration !== null || hasContentConfiguration,\n );\n }\n\n /**\n * Get content configuration configured on the attribute.\n * Only applicable for taxonomy element and knowledge codemaps,\n * content configuration for instrument questions is available on the form object\n */\n get contentConfiguration() {\n if (\n \"content\" in this.contributions &&\n typeof this.contributions.content === \"object\" &&\n this.contributions.content !== null &&\n \"optionElements\" in this.contributions.content &&\n Array.isArray(this.contributions.content.optionElements)\n ) {\n // Add RENDER_SECTION_LABEL to all content configuration to make sure the label of a section is always rendered on taxonomy and knowlege codemaps\n const optionElementConfig = this.contributions.content.optionElements.map(\n (optionElement) => {\n if (\"contentElement\" in optionElement) {\n return {\n contentElement: {\n ...optionElement.contentElement,\n layouthint: [RENDER_SECTION_LABEL],\n },\n };\n }\n\n return optionElement;\n },\n );\n\n return new ContentConfigurationElements(optionElementConfig);\n }\n return null;\n }\n\n /**\n * Retrieve available choice options\n */\n get options() {\n return this._options;\n }\n\n /**\n * Getting all enabled options\n */\n get selected() {\n return this.options.selected.map((option) => option.code);\n }\n\n /**\n * Flatten options and filter out the options that are not selected\n */\n override get readonlyvalue() {\n return this.options.selected.map((option) => option.label).join(\", \");\n }\n\n override get initvalue() {\n const initvalue = this.getInitValue();\n if (Array.isArray(initvalue) && initvalue.length !== 0) {\n return initvalue;\n }\n return initvalue;\n }\n\n /**\n * Retrieve list of selected options, joined with comma\n */\n override getValue() {\n const selected = this.options.selected;\n return selected.length > 0 ? selected[0].code : null;\n }\n\n override hasValue(): boolean {\n return this.options.selected.length > 0;\n }\n\n /**\n * Get input value of attribute\n */\n override getInputValue() {\n return this.selected.join(\",\");\n }\n\n /**\n * Setting an option selected or unselected based on the current state\n */\n toggleOption(code: string) {\n if (this.selected.includes(code)) {\n this.disableOption(code);\n } else {\n this.enableOption(code);\n }\n }\n\n /**\n * Enable a option\n */\n enableOption(code: string) {\n this.options.deselectAll();\n this.options.select(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Disable a option\n */\n disableOption(code: string) {\n this.options.deselect(code);\n this.inputvalue = this.getInputValue();\n }\n\n /**\n * Reset boolean attribute to unselected list\n */\n reset() {\n this.options.deselectAll();\n }\n\n /**\n */\n override mergeAttribute(oldAttribute: AttributeModel) {\n // when attribute is readonly, don't merge the options no modifications necessary\n if (!this.readonly && oldAttribute instanceof BooleanAttributeModel) {\n this.concept = oldAttribute.concept;\n this.options.deselectAll();\n\n if (oldAttribute.isValid && oldAttribute.inputvalue !== null) {\n this.update(oldAttribute.inputvalue);\n }\n }\n }\n\n /**\n * Update attribute by name and value\n */\n override update(value: MaybeAttributeValue) {\n if (this.readonly) {\n return this;\n }\n\n this.updateLastModification();\n\n let values;\n\n if (Array.isArray(value)) {\n values = value;\n } else if (typeof value === \"string\" && this.isMultiple) {\n values = value.split(\",\");\n } else if (typeof value === \"string\") {\n values = [value === \"true\" ? \"true\" : \"false\"];\n } else {\n values = [JSON.stringify(value)];\n }\n\n values.forEach((val) => {\n if (val instanceof ChoiceAttributeOptionModel) {\n this.toggleOption(val.code);\n } else if (\n typeof val === \"string\" &&\n this.options.some((option) => option.code.toString() === val)\n ) {\n this.toggleOption(val);\n }\n });\n\n return this;\n }\n\n updateByAttribute(otherAttribute: AttributeModel) {\n this.reset();\n if (otherAttribute instanceof BooleanAttributeModel) {\n this.update(otherAttribute.value);\n } else {\n console.error(\n `update of boolean attribute with ${otherAttribute.type} not supported`,\n );\n }\n }\n\n override getFormData() {\n if (this.inError()) {\n return null;\n }\n\n if (!this.hasValue()) {\n // no value for checkbox and toggle is same as a false value\n if (this.choicetype === \"checkbox\" || this.choicetype === \"toggle\") {\n return { [this.name]: false };\n }\n\n return { [this.name]: null };\n }\n\n return { [this.name]: this.value === \"true\" };\n }\n\n override get readonlyWidth() {\n if (this.options.some((option) => option.hasAlternativeLabel)) {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n return ATTRIBUTE_WIDTH.EXTRA_SMALL;\n }\n}\n","import { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\n\nimport type {\n AttributeContributions,\n AttributeModel,\n CaptchaAttributeContributions,\n MaybeAttributeValue,\n} from \"./types\";\n\nexport class CaptchaAttributeModel extends BaseAttributeModel<CaptchaAttributeContributions> {\n private _answer = \"\";\n\n static override isApplicableModel(contributions: AttributeContributions) {\n return contributions.type === ATTRIBUTE_TYPE.CAPTCHA;\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.CAPTCHA;\n }\n\n /**\n * Update the attribute by name and value\n */\n update(value: MaybeAttributeValue) {\n this.updateLastModification();\n this.inputvalue = value;\n\n return this;\n }\n\n override updateByAttribute(_otherAttribute: AttributeModel) {\n // not supported\n }\n\n setAnswer(answer: string) {\n this._answer = answer;\n }\n\n /**\n * Retrieve the given answer for the captcha\n * The value of this attribute is the token id of the captcha\n */\n getAnswer() {\n return this._answer;\n }\n\n override get hasDynamicValidationData() {\n return false;\n }\n\n reset() {\n this._answer = \"\";\n this.inputvalue = \"\";\n }\n}\n","import { IllegalStateException } from \"../../../exceptions/IllegalStateException\";\nimport {\n DateTimeUtil,\n DateUtil,\n TimestampUtil,\n TimeUtil,\n} from \"../../../utils/datetime/DateTimeUtil\";\n\nimport type { ConstraintModel, MaybeAttributeValue } from \"../types\";\n\nconst INEXACT_DATE_ID = \"Constraint.Date.InexactDate\";\nconst OUT_OF_RANGE_ID = \"Constraint.Date.OutOfRange\";\nconst BELOW_MINIMUM_ID = \"Constraint.Date.BelowMinimum\";\nconst ABOVE_MAXIMUM_ID = \"Constraint.Date.AboveMaximum\";\n\nexport class DateBoundaryConstraint implements ConstraintModel {\n private _type: string;\n private _format: string;\n private _minDate: string | null;\n private _maxDate: string | null;\n\n constructor(\n type: string,\n minDate: string | null = null,\n maxDate: string | null = null,\n format = \"yyyy-MM-dd\",\n ) {\n this._type = type;\n this._format = format;\n this._minDate = minDate;\n this._maxDate = maxDate;\n }\n\n get type(): string {\n return this._type;\n }\n\n get id(): string {\n if (\n this.minDate !== null &&\n this.maxDate !== null &&\n this.minDate === this.maxDate\n ) {\n return INEXACT_DATE_ID;\n } else if (this.minDate !== null && this.maxDate !== null) {\n return OUT_OF_RANGE_ID;\n } else if (this.minDate !== null) {\n return BELOW_MINIMUM_ID;\n } else if (this.maxDate !== null) {\n return ABOVE_MAXIMUM_ID;\n }\n\n return \"Constraint.Date.NoBoundaryConstraint\";\n }\n\n get format(): string {\n return this._format;\n }\n\n get minDate(): string | null {\n return this._minDate;\n }\n\n get maxDate(): string | null {\n return this._maxDate;\n }\n\n get defaultMessage(): string {\n switch (this.id) {\n case INEXACT_DATE_ID:\n return \"Date must be precisely ${min-date}\"; // NOSONAR\n case OUT_OF_RANGE_ID:\n return \"Must be between ${min-date} and ${max-date}\"; // NOSONAR\n case BELOW_MINIMUM_ID:\n return \"Must be on or after ${min-date}\"; // NOSONAR\n case ABOVE_MAXIMUM_ID:\n return \"Must be on or before ${max-date}\"; // NOSONAR\n default:\n return \"\";\n }\n }\n\n get parameters(): { \"max-date\": string | null; \"min-date\": string | null } {\n return {\n \"min-date\": this.minDate\n ? this.formatUtil.toFormat(this.minDate, this.format)\n : null,\n \"max-date\": this.maxDate\n ? this.formatUtil.toFormat(this.maxDate, this.format)\n : null,\n };\n }\n\n hasValidation() {\n return true;\n }\n\n isExactDate(value: string) {\n if (this.minDate === null) {\n throw new IllegalStateException(\"isExactDate: Min and max date not set\");\n }\n\n return this.formatUtil.isSame(value, this.minDate, this.format);\n }\n\n isBetweenDates(value: string) {\n if (this.minDate === null || this.maxDate === null) {\n throw new IllegalStateException(\"isBetweenDate: Min or max date not set\");\n }\n\n return (\n this.isSameOrAfterMinDate(value) && this.isSameOrBeforeMaxDate(value)\n );\n }\n\n isSameOrAfterMinDate(value: string) {\n if (this.minDate == null) {\n throw new IllegalStateException(\"isSameOrAfterMinDate: Min date not set\");\n }\n\n return this.formatUtil.isSameOrAfter(value, this.minDate, this.format);\n }\n\n isSameOrBeforeMaxDate(value: string) {\n if (this.maxDate == null) {\n throw new IllegalStateException(\n \"isSameOrBeforeMaxDate: Max date not set\",\n );\n }\n\n return this.formatUtil.isSameOrBefore(value, this.maxDate, this.format);\n }\n\n get formatUtil():\n | typeof TimeUtil\n | typeof TimestampUtil\n | typeof DateTimeUtil\n | typeof DateUtil {\n switch (this.type) {\n case \"time\":\n return TimeUtil;\n case \"timestamp\":\n return TimestampUtil;\n case \"datetime\":\n return DateTimeUtil;\n default:\n return DateUtil;\n }\n }\n\n validate(value: MaybeAttributeValue) {\n if (typeof value !== \"string\") {\n throw new TypeError(\"isNotEmptyString: Not comparing to string\");\n }\n\n switch (this.id) {\n case INEXACT_DATE_ID:\n return this.isExactDate(value);\n case OUT_OF_RANGE_ID:\n return this.isBetweenDates(value);\n case BELOW_MINIMUM_ID:\n return this.isSameOrAfterMinDate(value);\n case ABOVE_MAXIMUM_ID:\n return this.isSameOrBeforeMaxDate(value);\n default:\n return true;\n }\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { DateUtil } from \"../../../utils/datetime/DateTimeUtil\";\n\nimport type { ConstraintModel } from \"../types\";\n\nexport class DateTimeDateFormatConstraint implements ConstraintModel {\n private _format: string;\n private _formatLabel: string;\n\n constructor(format: string, formatLabel: string) {\n this._format = format;\n this._formatLabel = formatLabel;\n }\n\n get id(): string {\n return \"Constraint.DateFormat.InvalidFormat\";\n }\n\n get format(): string {\n return this._format;\n }\n\n get formatLabel(): string {\n return this._formatLabel;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Date must be entered in the format ${format}\"; // NOSONAR\n }\n\n get parameters(): { format: string } {\n return { format: this.formatLabel };\n }\n\n validate(value: string) {\n if (!value) {\n return false;\n }\n\n return DateUtil.hasFormat(value, this.format);\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { DATETIME_OFFSET_FORMAT } from \"../../../constants/Constants\";\nimport { isIncludeTimeOffsetInDateTimes } from \"../../../settings/Settings\";\nimport {\n DateTimeUtil,\n TimestampUtil,\n} from \"../../../utils/datetime/DateTimeUtil\";\n\nimport type { ConstraintModel } from \"../types\";\n\nexport class DatetimeFormatConstraint implements ConstraintModel {\n private _type: string;\n private _format: string;\n private _formatLabel: string;\n private _formatNoOffset: string;\n private _id = \"Constraint.DateTime.MissingValue\";\n\n constructor(type: string, format: string, formatLabel: string) {\n this._type = type;\n this._format = format;\n this._formatNoOffset = format.replace(DATETIME_OFFSET_FORMAT, \"\").trim();\n this._formatLabel = formatLabel;\n }\n\n get type(): string {\n return this._type;\n }\n\n get id(): string {\n return this._id;\n }\n\n get format(): string {\n return this._format;\n }\n\n get formatLabel(): string {\n return this._formatLabel;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Date and time should both be entered\";\n }\n\n get parameters(): { format: string } {\n return { format: this.formatLabel };\n }\n\n get formatUtil(): typeof TimestampUtil | typeof DateTimeUtil {\n if (this.type === \"timestamp\") {\n return TimestampUtil;\n }\n\n return DateTimeUtil;\n }\n\n validate(value: string) {\n if (!value) {\n return false;\n }\n\n if (this.formatUtil.hasFormat(value, this.format)) {\n return true;\n }\n\n if (isIncludeTimeOffsetInDateTimes()) {\n const hasDateTime = this.formatUtil.hasFormat(\n value,\n this._formatNoOffset,\n );\n if (!hasDateTime) {\n this._id = \"Constraint.DateTime.MissingValue\";\n return false;\n } else if (!new RegExp(\"[+-](0[0-9]|1[0-4]):[0-5][0-9]\").test(value)) {\n this._id = \"Constraint.DateTime.MissingOffset\";\n return false;\n }\n }\n\n return false;\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { TimeUtil } from \"../../../utils/datetime/DateTimeUtil\";\n\nimport type { ConstraintModel } from \"../types\";\n\nexport class DateTimeTimeFormatConstraint implements ConstraintModel {\n private _format: string;\n private _formatLabel: string;\n\n constructor(format: string, formatLabel: string) {\n this._format = format;\n this._formatLabel = formatLabel;\n }\n\n get id(): string {\n return \"Constraint.TimeFormat.InvalidFormat\";\n }\n\n get format(): string {\n return this._format;\n }\n\n get formatLabel(): string {\n return this._formatLabel;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Time must be entered in the format ${format}\"; // NOSONAR\n }\n\n get parameters(): { format: string } {\n return { format: this.formatLabel };\n }\n\n validate(value: string) {\n if (!value) {\n return false;\n }\n\n return TimeUtil.hasFormat(value, this.format);\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import {\n ATTRIBUTE_WIDTH,\n DATETIME_OFFSET_FORMAT,\n ISO_DATE_FORMAT,\n} from \"../../constants/Constants\";\nimport { isIncludeTimeOffsetInDateTimes } from \"../../settings/Settings\";\nimport {\n DateTimeUtil,\n DateUtil,\n TimestampUtil,\n TimeUtil,\n} from \"../../utils/datetime/DateTimeUtil\";\nimport { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { ConstraintCollection } from \"./input-constraints/ConstraintCollection\";\nimport { DateBoundaryConstraint } from \"./input-constraints/DateBoundaryConstraint\";\nimport { DateTimeDateFormatConstraint } from \"./input-constraints/DateTimeDateFormatConstraint\";\nimport { DatetimeFormatConstraint } from \"./input-constraints/DatetimeFormatConstraint\";\nimport { DateTimeTimeFormatConstraint } from \"./input-constraints/DateTimeTimeFormatConstraint\";\n\nimport type { OffsetInfo } from \"../../utils/datetime/DateTimeUtil\";\nimport type { ErrorObjectData } from \"../form/types\";\nimport type { ModelOptions } from \"../types\";\nimport type {\n AttributeContributions,\n AttributeData,\n AttributeModel,\n DatetimeAttributeContributions,\n MaybeAttributeValue,\n} from \"./types\";\n\nexport class DatetimeAttributeModel<\n C extends DatetimeAttributeContributions = DatetimeAttributeContributions,\n> extends BaseAttributeModel<C> {\n private _dateInputFormat: string;\n\n constructor(\n attribute?: AttributeData,\n attributeContributions?: C,\n modelOptions?: ModelOptions,\n ) {\n super(attribute, attributeContributions, modelOptions);\n this._inputvalue = \"\";\n this._dateInputFormat = \"\";\n this.updateInitValue();\n }\n\n override get type() {\n return this.getContributionAsString(\"type\", \"date\") as ATTRIBUTE_TYPE;\n }\n\n static override isApplicableModel(contributions: AttributeContributions) {\n return (\n contributions.type === ATTRIBUTE_TYPE.DATE ||\n contributions.type === ATTRIBUTE_TYPE.TIME ||\n contributions.type === ATTRIBUTE_TYPE.DATETIME ||\n contributions.type === ATTRIBUTE_TYPE.TIMESTAMP\n );\n }\n\n get formatUtil() {\n switch (this.type) {\n case \"time\":\n return TimeUtil;\n case \"timestamp\":\n return TimestampUtil;\n case \"datetime\":\n return DateTimeUtil;\n default:\n return DateUtil;\n }\n }\n\n override getInitValue() {\n let value = this.getDataAsString(\"value\");\n if (value) {\n if (this.type === \"time\" && value.length === 5) {\n value = `${value}:00`;\n }\n\n // handle old datetime values, which contained ms\n if (this.type === \"datetime\" && value.includes(\".\")) {\n value = TimestampUtil.toFormat(value, DateTimeUtil.getIsoFormat());\n } else {\n value = this.formatUtil.toISO(value);\n }\n\n if (this.hasTime) {\n value = this.getTimeValue(value);\n }\n }\n\n return value;\n }\n\n getTimeValue(value: string): string {\n let timeValue = value;\n if (!this.timeInputFormat.toLowerCase().includes(\"h\")) {\n timeValue = this.formatUtil.setHour(value, 0);\n }\n if (!this.timeInputFormat.includes(\"m\")) {\n timeValue = this.formatUtil.setMinute(value, 0);\n }\n if (!this.timeInputFormat.includes(\"s\")) {\n timeValue = this.formatUtil.setSecond(value, 0);\n }\n if (this.type === \"timestamp\" && !this.timeInputFormat.includes(\"S\")) {\n timeValue = this.formatUtil.setMilliseconds(value, 0);\n }\n\n if (isIncludeTimeOffsetInDateTimes()) {\n // https://github.com/date-fns/date-fns/issues/3579\n const oldOffset = this.formatUtil.toFormat(value, DATETIME_OFFSET_FORMAT);\n const newOffset = this.formatUtil.toFormat(\n timeValue,\n DATETIME_OFFSET_FORMAT,\n );\n timeValue = timeValue.replace(newOffset, oldOffset);\n }\n return timeValue;\n }\n\n /**\n * Set time in the correct value based on available elements in the time format\n */\n updateInitValue() {\n const value = this.getInitValue();\n if (value != null) {\n this.setInitValue(value);\n const formattedValue = this.getInitialInputValue(value);\n this._inputvalue = formattedValue;\n this.setValue(value);\n }\n }\n\n /**\n * Get initial user input value\n */\n override getInitialInputValue(value?: string) {\n if (!(typeof value === \"string\")) {\n return \"\";\n }\n\n let initValue = value;\n if (this.type === \"time\" && value.length === 5) {\n initValue = `${value}:00`;\n }\n\n return this.formatUtil.toFormat(initValue, this.inputFormat);\n }\n\n override getInputValue(): string {\n return this._inputvalue ? this._inputvalue.toString() : \"\";\n }\n\n /**\n * Sets the input value to the value entered by the user\n */\n\n override get inputvalue(): string {\n return this.getInputValue();\n }\n\n override set inputvalue(value: string) {\n this.validate(value);\n this._inputvalue = value;\n this.value =\n value !== null && value !== \"\"\n ? this.formatUtil.toISO(value, this.inputFormat)\n : null;\n }\n\n reset() {\n this.inputvalue = \"\";\n }\n\n /**\n * Get date format\n */\n override get format() {\n const format = this.getContributionAsString(\"format\", \"\");\n return this.formatUtil.convertFormat(format);\n }\n\n override get formatLabel() {\n switch (this.type) {\n case \"date\":\n return this.dateInputFormat.toLowerCase();\n case \"time\":\n return this.timeInputFormat.toLowerCase();\n default:\n return this.format.toLowerCase();\n }\n }\n\n get hasDate() {\n return (\n this.type === \"date\" ||\n this.type === \"datetime\" ||\n this.type === \"timestamp\"\n );\n }\n\n get hasTime() {\n return (\n this.type === \"time\" ||\n this.type === \"datetime\" ||\n this.type === \"timestamp\"\n );\n }\n\n get inputFormatWithoutOffset(): string {\n if (this.hasDate && this.hasTime) {\n return `${this.dateInputFormat} ${this.timeInputFormat}`.trim();\n }\n\n if (this.hasDate) {\n return this.dateInputFormat;\n }\n\n if (this.hasTime) {\n return this.timeInputFormat;\n }\n\n return \"\";\n }\n\n get inputFormat() {\n if (\n isIncludeTimeOffsetInDateTimes() &&\n this.dateInputFormat !== \"\" &&\n this.timeInputFormat !== \"\"\n ) {\n return `${this.inputFormatWithoutOffset} ${DATETIME_OFFSET_FORMAT}`;\n }\n\n return this.inputFormatWithoutOffset;\n }\n\n extractDateInputFormat(): string {\n const dateEraChars = new Set(\"yMLdQDEewGu\");\n const timeOffsetChars = new Set(\"HhaKmsSZzXxO\");\n\n const format = this.format;\n let inputFormat = \"\";\n\n let isInQuotes = false;\n let keep = false;\n\n for (let i = 0; i < format.length; i++) {\n const prevChar = i > 0 ? format[i - 1] : \"\";\n const nextChar = i < format.length ? format[i + 1] : \"\";\n const char = format[i];\n\n if (char === \"'\") {\n isInQuotes = prevChar === \"'\" || nextChar === \"'\" || !isInQuotes;\n } else if (!isInQuotes && dateEraChars.has(char)) {\n keep = true;\n } else if (!isInQuotes && timeOffsetChars.has(char)) {\n keep = false;\n }\n\n if (keep) {\n inputFormat += char;\n }\n }\n\n return inputFormat.trim();\n }\n\n get dateInputFormat() {\n if (!this.hasDate) {\n return \"\";\n }\n\n if (!this._dateInputFormat) {\n this._dateInputFormat = this.extractDateInputFormat();\n }\n\n return this._dateInputFormat;\n }\n\n get dateReadonlyFormat() {\n if (!this.hasDate) {\n return \"\";\n }\n\n return this.hasTime\n ? this.format.replace(this.timeInputFormat, \"\").trim()\n : this.format;\n }\n\n /**\n * return attribute placeholder or return formatlabel without time input format from contributions\n */\n override get placeholder() {\n if (super.placeholder) {\n return super.placeholder;\n }\n\n const formatLabel = this.getContributionAsString(\"formatlabel\");\n if (this.hasDate && this.hasTime && formatLabel?.includes(\" \")) {\n // return first part of formatlabel to keep placeholder matching date input\n return formatLabel.split(\" \")[0];\n }\n\n return formatLabel;\n }\n\n /**\n * Creates an iso time format based on the elements present in the attribute format\n */\n createTimeInputFormat() {\n if (!this.hasTime) {\n return \"\";\n }\n\n const format = this.format;\n\n const timeFormatParts = [];\n if (format.includes(\"H\")) {\n timeFormatParts.push(\"HH\");\n } else if (format.includes(\"h\")) {\n timeFormatParts.push(\"hh\");\n }\n if (format.includes(\"m\")) {\n timeFormatParts.push(\"mm\");\n }\n if (format.includes(\"s\")) {\n timeFormatParts.push(\"ss\");\n }\n\n let timeFormat = timeFormatParts.join(\":\");\n if (format.includes(\"S\")) {\n timeFormat = `${timeFormat}.SSS`;\n }\n if (format.includes(\"a\")) {\n return `${timeFormat} a`;\n }\n\n return timeFormat;\n }\n\n get timeInputFormat() {\n return this.createTimeInputFormat();\n }\n\n get timeReadonlyFormat() {\n return this.createTimeInputFormat();\n }\n\n get dateInputValue() {\n return typeof this.value === \"string\" && this.dateInputFormat !== \"\"\n ? this.formatUtil.toFormat(this.value, this.dateInputFormat)\n : \"\";\n }\n\n get timeInputValue() {\n return typeof this.value === \"string\" && this.timeInputFormat !== \"\"\n ? this.formatUtil.toFormat(this.value, this.timeInputFormat)\n : \"\";\n }\n\n /**\n * format value in readonly rendering\n */\n override formatValue(value: string) {\n if (typeof value !== \"string\") {\n return \"\";\n }\n\n if (value === \"\") {\n return \"\";\n }\n\n // when the value is exactly an iso date, render as date\n if (\n (this.type === \"datetime\" || this.type === \"timestamp\") &&\n DateUtil.hasFormat(value, ISO_DATE_FORMAT)\n ) {\n return DateUtil.toFormat(value, this.dateReadonlyFormat);\n }\n\n if (this.type === \"date\") {\n return this.formatUtil.toFormat(value, this.dateReadonlyFormat);\n }\n\n return this.formatUtil.toFormat(value, this.format);\n }\n\n /**\n * Retrieve readonly value, the date in the configurated format\n */\n override get readonlyvalue() {\n if (typeof this.value === \"string\") {\n return this.formatValue(this.value);\n }\n\n return \"\";\n }\n\n get isAmbiguous() {\n if (typeof this.value === \"string\") {\n return this.formatUtil.isAmbiguous(this.value);\n }\n return false;\n }\n\n get offset(): OffsetInfo | null {\n if (typeof this.value === \"string\") {\n return this.formatUtil.getOffset(this.value);\n }\n return null;\n }\n\n /**\n * Get minimum date\n */\n get mindate() {\n return this.getContributionAsString(\"mindate\");\n }\n\n /**\n * Get maximum date\n */\n get maxdate() {\n return this.getContributionAsString(\"maxdate\");\n }\n\n /**\n * Registers an error that was received from a server response\n */\n override addServerError(error: ErrorObjectData) {\n const { id, message, properties, layouthint } = error;\n if (properties && \"format\" in properties && this.formatLabel) {\n properties.format = this.formatLabel;\n }\n\n this.attributeErrors.addServerError(id, message, properties, layouthint);\n }\n\n getFormatConstraint() {\n switch (this.type) {\n case \"date\":\n return new DateTimeDateFormatConstraint(\n this.dateInputFormat,\n this.formatLabel,\n );\n case \"time\":\n return new DateTimeTimeFormatConstraint(\n this.timeInputFormat,\n this.formatLabel,\n );\n default:\n return new DatetimeFormatConstraint(\n this.type,\n this.inputFormat,\n this.formatLabel,\n );\n }\n }\n\n /**\n * Add Date constraints for attribute\n */\n override addConstraints() {\n const constraints = new ConstraintCollection();\n\n constraints.add(this.getFormatConstraint());\n\n if (this.mindate || this.maxdate) {\n constraints.add(\n new DateBoundaryConstraint(\n this.type,\n this.mindate,\n this.maxdate,\n this.inputFormat,\n ),\n );\n }\n\n return constraints;\n }\n\n override get readonlyWidth(): ATTRIBUTE_WIDTH {\n if (this.type === \"date\" || this.type === \"time\") {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n\n update(value: MaybeAttributeValue) {\n if (this.inputvalue === value) {\n return this;\n }\n\n this.updateLastModification();\n this.inputvalue = value as string;\n\n return this;\n }\n\n updateByAttribute(otherAttribute: AttributeModel) {\n this.reset();\n if (otherAttribute instanceof DatetimeAttributeModel) {\n const otherValue = otherAttribute.value as string;\n if (otherValue != null) {\n const inputValue = this.formatUtil.toFormat(\n otherValue,\n this.inputFormat,\n );\n this.update(inputValue);\n }\n } else {\n console.error(\n `update of datetime attribute with ${otherAttribute.type} not supported`,\n );\n }\n }\n}\n","import { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\n\nimport type {\n AttributeContributions,\n AttributeModel,\n MaybeAttributeValue,\n StringAttributeContributions,\n} from \"./types\";\n\ninterface DataContent {\n text?: {\n message?: string;\n };\n}\ntype ContributionText =\n | string\n | {\n message?: string;\n };\n\nexport class HelptextAttributeModel extends BaseAttributeModel<StringAttributeContributions> {\n static override isApplicableModel(contributions: AttributeContributions) {\n return (\n // @ts-expect-error kept for backwards compatibility\n contributions.type === ATTRIBUTE_TYPE.HELPTEXT ||\n (\"readonly\" in contributions && \"text\" in contributions)\n );\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.HELPTEXT;\n }\n\n /**\n * Get helptext text\n */\n get text() {\n const dataContent = this.getData(\"content\") as DataContent;\n const message = dataContent?.text?.message;\n if (message) {\n return message;\n }\n\n const contributionText = this.getContribution(\"text\") as ContributionText;\n if (contributionText != null) {\n return typeof contributionText === \"string\"\n ? contributionText\n : contributionText.message;\n }\n\n return null;\n }\n\n update(_value: MaybeAttributeValue) {\n return this;\n }\n\n override updateByAttribute(_otherAttribute: AttributeModel) {\n // not supported\n }\n\n override getFormData() {\n return null;\n }\n\n reset() {\n // nothing to reset\n }\n}\n","import { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\n\nimport type {\n AttributeContributions,\n AttributeModel,\n MaybeAttributeValue,\n StringAttributeContributions,\n} from \"./types\";\n\nexport class LabelAttributeModel extends BaseAttributeModel<StringAttributeContributions> {\n static override isApplicableModel(contributions: AttributeContributions) {\n if (\n \"layouthint\" in contributions &&\n Array.isArray(contributions.layouthint)\n ) {\n return contributions.layouthint.includes(\"label\");\n }\n\n return false;\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.LABEL;\n }\n\n update(_value: MaybeAttributeValue) {\n return this;\n }\n\n override updateByAttribute(_otherAttribute: AttributeModel) {\n // not supported\n }\n\n override getFormData() {\n return null;\n }\n\n reset() {\n // nothing to reset\n }\n}\n","import { immerable } from \"immer\";\n\nimport { IllegalStateException } from \"../../../exceptions/IllegalStateException\";\n\nimport type { AttributeCollection } from \"../AttributeCollection\";\nimport type { BaseAttributeModel } from \"../BaseAttributeModel\";\nimport type {\n AttributeModel,\n BaseAttributeContributions,\n LayoutHintRule,\n} from \"../types\";\n\n/**\n * Abstract class for layout hint rules\n */\nexport abstract class BaseLayoutHintRule implements LayoutHintRule {\n [immerable] = true;\n\n /**\n * Indicates if the rule implements the isApplicableForHint method\n * @type {boolean}\n * @default false\n */\n static checkHintApplicability = false;\n\n /**\n * Indicates if the rule instance is applicable for a specific attribute<br>\n */\n static isApplicableForAttribute(_attribute: AttributeModel) {\n return true;\n }\n\n /**\n * Indicates if the rule instance is applicable for a specific hint<br>\n * Is required when checkHintApplicability is true\n */\n static isApplicableForHint(_hint: string): boolean {\n throw new IllegalStateException(\n `Missing isApplicableForHint implementation on layout hint rule`,\n );\n }\n\n /**\n * Initialize the rule when isApplicableForAttribute is true and checkHintApplicability is false\n */\n static initAttribute(_attribute?: AttributeModel): LayoutHintRule {\n throw new IllegalStateException(\n `Missing initAttribute implementation on layout hint rule`,\n );\n }\n\n /**\n * Initialize the rule when isApplicableForAttribute and isApplicableForHint are both true,\n * it receives the hint. Allows a rule to be instantiated multiple times for an attribute,\n * but once for each hint entry\n */\n static initHint(_hint: string): LayoutHintRule {\n throw new IllegalStateException(\n `Missing initHint implementation on layout hint rule`,\n );\n }\n\n /**\n * Abstract method, implements process of layout hint rule,\n * use this to enhance the applicable attribute or the attribute collection\n */\n abstract process<C extends BaseAttributeContributions>(\n attribute: BaseAttributeModel<C>,\n attributes: AttributeCollection,\n ): void;\n}\n","import { ConfigurationException } from \"../../../exceptions/ConfigurationException\";\nimport {\n DEPENDENT_ATTRIBUTE,\n DEPENDENT_ATTRIBUTE_CONTROL,\n} from \"../../../layouthints/LayoutHints\";\nimport { BaseLayoutHintRule } from \"./BaseLayoutHintRule\";\n\nimport type { AttributeCollection } from \"../AttributeCollection\";\nimport type { BaseAttributeModel } from \"../BaseAttributeModel\";\nimport type { BooleanAttributeModel } from \"../BooleanAttributeModel\";\nimport type { ChoiceAttributeModel } from \"../ChoiceAttributeModel\";\nimport type { AttributeModel, BaseAttributeContributions } from \"../types\";\n\ntype EnumerateAttributeModel = BooleanAttributeModel | ChoiceAttributeModel;\n\nconst EQUALS = \"equals\";\nconst INCLUDES = \"includes\";\nconst NOT_EQUALS = \"notEquals\";\nconst NOT_INCLUDES = \"notIncludes\";\nconst NOT_IS_EMPTY = \"notIsEmpty\";\nconst IS_EMPTY = \"isEmpty\";\n\nconst SHOW = \"show\";\nconst HIDE = \"hide\";\n\n/**\n * Depending attributes hint logic\n */\nexport class DependentAttribute extends BaseLayoutHintRule {\n private _action = \"\";\n private _control = \"\";\n private _operator = \"\";\n private _options: string[] = [];\n\n static override checkHintApplicability = true;\n\n static override isApplicableForHint(hint: string) {\n const regex = new RegExp(\n `^${DEPENDENT_ATTRIBUTE}\\\\s?(${SHOW}|${HIDE})`,\n \"i\",\n );\n\n return regex.test(hint);\n }\n\n /**\n * Used on initHint to create an instance of this rule\n */\n static getRuleInstance(): DependentAttribute {\n return new DependentAttribute();\n }\n\n static override initHint(hint: string) {\n const rule = this.getRuleInstance();\n\n const OPERATORS = `${EQUALS}|${INCLUDES}|${NOT_EQUALS}|${NOT_INCLUDES}|${NOT_IS_EMPTY}|${IS_EMPTY}`;\n const regex = new RegExp(\n `${DEPENDENT_ATTRIBUTE}\\\\s?(\\\\S*)\\\\swhen ${DEPENDENT_ATTRIBUTE_CONTROL}:\\\\s?(.*?)\\\\s*(${OPERATORS})\\\\s(.*)`,\n \"i\",\n );\n const isEmpyNotIsEmptRegex = new RegExp(\n `${DEPENDENT_ATTRIBUTE}\\\\s?(\\\\S*)\\\\swhen ${DEPENDENT_ATTRIBUTE_CONTROL}:\\\\s?(.*?)\\\\s*(${OPERATORS})`,\n \"i\",\n );\n\n const result = hint.match(regex)\n ? hint.match(regex)\n : hint.match(isEmpyNotIsEmptRegex);\n\n if (result) {\n rule.action = result[1];\n rule.control = result[2];\n rule.operator = result[3];\n rule.options = !result[4] ? \"\" : result[4];\n } else {\n throw new ConfigurationException(\n `No dependent information found on layout hint: ${hint}`,\n );\n }\n\n return rule;\n }\n\n get action(): string | undefined {\n return this._action;\n }\n\n set action(action: string) {\n this._action = action;\n }\n\n get control(): string | undefined {\n return this._control;\n }\n\n set control(control: string) {\n this._control = control;\n }\n\n get operator(): string | undefined {\n return this._operator;\n }\n\n set operator(operator: string) {\n this._operator = operator;\n }\n\n get options(): string[] {\n return this._options;\n }\n\n set options(options: string) {\n this._options = options.split(\"|\").map((option) => option.trim());\n }\n\n processEqualsOptions(controlAttribute: AttributeModel) {\n if (\n \"selected\" in controlAttribute &&\n Array.isArray(controlAttribute.selected)\n ) {\n const selected = controlAttribute.selected;\n return this.options.every((option) => selected.includes(option));\n }\n\n throw new ConfigurationException(\n \"Dependent control in combination with equals operator must be a choice, string or number attribute\",\n );\n }\n\n processIncludesOptions(controlAttribute: EnumerateAttributeModel) {\n if (controlAttribute.type === \"choice\") {\n return this.options.some((option) =>\n controlAttribute.selected.includes(option),\n );\n }\n\n throw new ConfigurationException(\n \"Dependent control in combination with includes operator must be a choice attribute\",\n );\n }\n\n handleOperator(controlAttribute: EnumerateAttributeModel) {\n switch (this.operator) {\n case EQUALS:\n return this.processEqualsOptions(controlAttribute);\n case INCLUDES:\n return this.processIncludesOptions(controlAttribute);\n case NOT_EQUALS:\n return !this.processEqualsOptions(controlAttribute);\n case NOT_INCLUDES:\n return !this.processIncludesOptions(controlAttribute);\n case NOT_IS_EMPTY:\n return controlAttribute?.selected.length !== 0;\n case IS_EMPTY:\n return controlAttribute?.selected.length === 0;\n default:\n throw new ConfigurationException(\n `Unsupported operator for dependent question: ${this.operator}`,\n );\n }\n }\n\n getControlAttribute(\n attributes: AttributeCollection,\n ): EnumerateAttributeModel | null {\n const attribute = attributes.getAttributeByLayoutHint(\n `${DEPENDENT_ATTRIBUTE_CONTROL}:${this.control}`,\n `${DEPENDENT_ATTRIBUTE_CONTROL}: ${this.control}`,\n );\n\n if (\n typeof attribute !== \"undefined\" &&\n attribute != null &&\n \"selected\" in attribute &&\n Array.isArray(attribute.selected)\n ) {\n return attribute as EnumerateAttributeModel;\n }\n\n return null;\n }\n\n process<C extends BaseAttributeContributions>(\n attribute: BaseAttributeModel<C>,\n attributes: AttributeCollection,\n ) {\n const controlAttribute = this.getControlAttribute(attributes);\n if (!controlAttribute) {\n return;\n }\n\n controlAttribute.processLayoutHintRules(attributes);\n if (controlAttribute.isHidden) {\n attribute.hide();\n return;\n }\n\n const result = this.handleOperator(controlAttribute);\n if (this.action === SHOW) {\n attribute.isHidden = !result;\n } else if (this.action === HIDE) {\n attribute.isHidden = result;\n } else {\n throw new ConfigurationException(\n `Unsupported action ${this.action} for dependent question on attribute: ${attribute.label}`,\n );\n }\n }\n}\n","import type { ConstraintModel, FiletypeConstraintsType } from \"../types\";\n\nexport class FileExtensionConstraint implements ConstraintModel {\n private _filetypeConstraints: FiletypeConstraintsType;\n\n constructor(filetypeConstraints: FiletypeConstraintsType) {\n this._filetypeConstraints = filetypeConstraints;\n }\n\n get id(): string {\n return \"Constraint.File.InvalidExtension\";\n }\n\n get extensions(): string {\n return this._filetypeConstraints\n .map((filetypeConstraint) => filetypeConstraint.extensions.join(\", \"))\n .join(\", \");\n }\n\n hasValidation() {\n return false;\n }\n\n get defaultMessage(): string {\n return \"Allowed extensions are: ${extensions}\"; // NOSONAR\n }\n\n get parameters(): { extensions: string } {\n return { extensions: this.extensions };\n }\n\n validate() {\n return true;\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import filesize from \"file-size\";\n\nimport type { ConstraintModel, FilesizeConstraintsType } from \"../types\";\n\nconst MAX_TOTAL_FILE_SIZE_ID = \"Constraint.File.MaxTotalFileSize\";\nconst MAX_FILE_SIZE_ID = \"Constraint.File.MaxFileSize\";\n\nexport class FileSizeConstraint implements ConstraintModel {\n private _filesizeConstraint: FilesizeConstraintsType;\n\n constructor(filesizeConstraint: FilesizeConstraintsType) {\n this._filesizeConstraint = filesizeConstraint;\n }\n\n get id(): string {\n if (this.filesizeConstraint.isMaxTotal) {\n return MAX_TOTAL_FILE_SIZE_ID;\n } else if (this.filesizeConstraint.fileSize !== undefined) {\n return MAX_FILE_SIZE_ID;\n }\n\n return \"\";\n }\n\n get filesizeConstraint(): FilesizeConstraintsType {\n return this._filesizeConstraint;\n }\n\n hasValidation() {\n return false;\n }\n\n get defaultMessage(): string {\n if (this.id === MAX_TOTAL_FILE_SIZE_ID) {\n return \"{filesize-left} van {max-total-filesize} over van totaal toegestaan upload bestandsgrootte\"; // NOSONAR\n } else if (this.id === MAX_FILE_SIZE_ID) {\n return \"Maximale bestandsgroote is ${max-filesize}\"; // NOSONAR\n }\n\n return \"\";\n }\n\n get filesize() {\n return filesize(this.filesizeConstraint.fileSize ?? 0).human(\"jedec\");\n }\n\n get maxTotalFileSize() {\n if (this.filesizeConstraint.maxTotalFileSize) {\n return filesize(this.filesizeConstraint.maxTotalFileSize).human(\"jedec\");\n }\n\n return undefined;\n }\n\n get parameters() {\n if (this.id === MAX_TOTAL_FILE_SIZE_ID) {\n return {\n \"filesize-left\": this.filesize,\n \"max-total-filesize\": this.maxTotalFileSize,\n };\n } else if (this.id === MAX_FILE_SIZE_ID) {\n return {\n \"max-filesize\": this.filesize,\n };\n }\n\n return {};\n }\n\n validate() {\n return true;\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { ConstraintCollection } from \"./input-constraints/ConstraintCollection\";\nimport { FileExtensionConstraint } from \"./input-constraints/FileExtensionConstraint\";\nimport { FileSizeConstraint } from \"./input-constraints/FileSizeConstraint\";\n\nimport type {\n AttributeContributions,\n AttributeModel,\n BinaryAttributeContributions,\n FilesizeConstraintsType,\n FilesType,\n FiletypeConstraintsType,\n MaybeAttributeValue,\n} from \"./types\";\n\nconst UNCHANGED = \"UNCHANGED\";\n\nexport class UploadAttributeModel extends BaseAttributeModel<BinaryAttributeContributions> {\n private _files: FilesType | undefined;\n private _initialTotalFileSize = 0;\n private _maxTotalFileSize: number | undefined;\n\n static override isApplicableModel(contributions: AttributeContributions) {\n return contributions.type === ATTRIBUTE_TYPE.BINARY;\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.UPLOAD;\n }\n\n /**\n * Retrieve single or multi upload\n */\n get multiple() {\n return this.getContributionAsBoolean(\"multiple\", false);\n }\n\n get initialTotalFileSize() {\n return this._initialTotalFileSize ?? 0;\n }\n\n set initialTotalFileSize(initialTotalFileSize: number) {\n this._initialTotalFileSize = initialTotalFileSize;\n }\n\n get maxTotalFileSize() {\n return this._maxTotalFileSize;\n }\n\n set maxTotalFileSize(maxTotalFileSize: number | undefined) {\n this._maxTotalFileSize = maxTotalFileSize;\n }\n\n get currentFilesize() {\n return this.initialTotalFileSize + this.uploadedFileSize;\n }\n\n get maxFileSize() {\n if (this.maxTotalFileSize) {\n const uploadMaxFileSize = this.maxTotalFileSize - this.currentFilesize;\n if (uploadMaxFileSize < 0) {\n return 0;\n }\n\n return uploadMaxFileSize;\n }\n\n return this.getContributionAsNumber(\"uploadMaxFileSize\");\n }\n\n get uploadedFileSize() {\n if (Object.keys(this.files).length === 0) {\n return 0;\n }\n\n let accumulatedFileSize = 0;\n Object.keys(this.files).forEach((fileName) => {\n const file = this.files[fileName];\n if (file.size) {\n accumulatedFileSize += file.size;\n }\n });\n return accumulatedFileSize;\n }\n\n /**\n * Upload constraints\n */\n get uploadConstraints(): {\n fileTypes: FiletypeConstraintsType;\n maxFileSize: FilesizeConstraintsType;\n acceptedFiles: string[];\n } {\n const mimeTypes = this.getContributionAsArray(\n \"allowedMimeTypes\",\n [],\n ).filter((mimeType) => mimeType !== \"[...]\");\n\n const extensions = this.getContributionAsArray(\n \"allowedExtensions\",\n [],\n ).filter((extension) => extension !== \"[...]\");\n\n const fileTypes: FiletypeConstraintsType = extensions.map((extension) => ({\n extensions: [extension],\n mimeTypes,\n }));\n\n return {\n fileTypes,\n maxFileSize: {\n fileSize: this.maxFileSize,\n maxTotalFileSize: this.maxTotalFileSize,\n isMaxTotal: this.maxTotalFileSize !== undefined,\n },\n acceptedFiles: this.acceptedFiles,\n };\n }\n\n /**\n * Array of accepted file extensions and mime types.\n * Convenience method for accept attribute of file input html control\n */\n get acceptedFiles(): string[] {\n const mimeTypes = this.getContributionAsArray(\n \"allowedMimeTypes\",\n [],\n ).filter((mimeType) => mimeType !== \"[...]\");\n\n const extensions = this.getContributionAsArray(\n \"allowedExtensions\",\n [],\n ).filter((extension) => extension !== \"[...]\");\n return [...extensions, ...mimeTypes];\n }\n\n /**\n * Add upload constraints\n */\n override addConstraints() {\n const constraints = new ConstraintCollection();\n\n if (this.uploadConstraints.fileTypes.length > 0) {\n constraints.add(\n new FileExtensionConstraint(this.uploadConstraints.fileTypes),\n );\n }\n\n const hasFilesizeConstraint =\n this.uploadConstraints.maxFileSize.isMaxTotal ||\n this.uploadConstraints.maxFileSize.fileSize !== undefined;\n\n if (hasFilesizeConstraint) {\n constraints.add(\n new FileSizeConstraint(this.uploadConstraints.maxFileSize),\n );\n }\n\n return constraints;\n }\n\n get files(): FilesType {\n return this._files ?? {};\n }\n\n set files(files: FilesType) {\n this._files = files;\n }\n\n private getFilesTypeFromValue(value: MaybeAttributeValue) {\n if (typeof value === \"object\") {\n return value as unknown as FilesType;\n } else if (typeof value === \"string\") {\n try {\n return JSON.parse(value) as FilesType;\n } catch (_e) {\n console.warn(`Can't parse upload value: ${value}`);\n }\n }\n return null;\n }\n\n /**\n * Update the attribute\n */\n update(value: MaybeAttributeValue) {\n if (!value) {\n return this;\n }\n\n const files = this.getFilesTypeFromValue(value);\n if (files == null) {\n this.inputvalue = value;\n } else {\n this.files = files;\n this.inputvalue = Object.keys(files)\n .map((fileName) => files[fileName].token)\n .join(\",\");\n }\n\n this.updateLastModification();\n\n return this;\n }\n\n override updateByAttribute(_otherAttribute: AttributeModel) {\n // not supported\n }\n\n override get readonlyvalue() {\n if (this.initvalue) {\n return this.initvalue.toString();\n }\n\n return \"\";\n }\n\n /**\n * Getting the value of the attribute, return unchanged when the uploaded file has not changed\n */\n override getValue() {\n if (!this.hasValue()) {\n return null;\n }\n\n if (this.initvalue === this.inputvalue) {\n return UNCHANGED;\n }\n\n return super.getValue();\n }\n\n override mergeAttribute(oldAttribute: AttributeModel) {\n if (\n oldAttribute instanceof UploadAttributeModel &&\n oldAttribute.isValid &&\n oldAttribute.inputvalue !== null\n ) {\n this.update(JSON.stringify(oldAttribute.files));\n }\n }\n\n reset() {\n this._files = {};\n }\n}\n","import {\n INITIAL_TOTAL_FILESIZE,\n MAX_TOTAL_FILESIZE,\n} from \"../../../layouthints/LayoutHints\";\nimport { ATTRIBUTE_TYPE } from \"../constants\";\nimport { UploadAttributeModel } from \"../UploadAttributeModel\";\nimport { BaseLayoutHintRule } from \"./BaseLayoutHintRule\";\n\nimport type { AttributeCollection } from \"../AttributeCollection\";\nimport type { BaseAttributeModel } from \"../BaseAttributeModel\";\nimport type { AttributeModel, BaseAttributeContributions } from \"../types\";\n\n/**\n * This pattern enables showing the upload file size remaining when uploading resources<br>\n * The rule depends on other attributes with the INITIAL_TOTAL_FILESIZE and MAX_TOTAL_FILESIZE layout hints\n */\nexport class RemainingTotalUploadSize extends BaseLayoutHintRule {\n static override isApplicableForAttribute(attribute: AttributeModel) {\n return attribute.type === ATTRIBUTE_TYPE.UPLOAD;\n }\n\n static override initAttribute() {\n return new RemainingTotalUploadSize();\n }\n\n processUploadInformation(\n attribute: UploadAttributeModel,\n attributes: AttributeCollection,\n ) {\n const initialTotalFileSizeAttributes = attributes.getAttributesByLayoutHint(\n INITIAL_TOTAL_FILESIZE,\n );\n const maxTotalFileSizeAttributes =\n attributes.getAttributesByLayoutHint(MAX_TOTAL_FILESIZE);\n\n if (\n initialTotalFileSizeAttributes.length > 0 &&\n maxTotalFileSizeAttributes.length > 0\n ) {\n const initialTotalFileSize = initialTotalFileSizeAttributes[0].value;\n const maxTotalFileSize = maxTotalFileSizeAttributes[0].value;\n\n attribute.initialTotalFileSize = Number(initialTotalFileSize);\n attribute.maxTotalFileSize = Number(maxTotalFileSize);\n }\n }\n\n /**\n * Sets thresholds for initial and maximum upload file size\n */\n process<C extends BaseAttributeContributions>(\n attribute: BaseAttributeModel<C>,\n attributes: AttributeCollection,\n ) {\n if (attribute instanceof UploadAttributeModel) {\n this.processUploadInformation(attribute, attributes);\n }\n }\n}\n","import { IllegalReturnException } from \"../../../exceptions/IllegalReturnException\";\nimport { BaseCollection } from \"../../base/BaseCollection\";\nimport { DependentAttribute } from \"./DependentAttribute\";\nimport { RemainingTotalUploadSize } from \"./RemainingTotalUploadSize\";\n\nimport type { AttributeCollection } from \"../AttributeCollection\";\nimport type { BaseAttributeModel } from \"../BaseAttributeModel\";\nimport type {\n AttributeModel,\n BaseAttributeContributions,\n LayoutHintRule,\n} from \"../types\";\nimport type { BaseLayoutHintRule } from \"./BaseLayoutHintRule\";\n\n/**\n * Array of available layout hint rules\n * @private\n */\nlet layoutHintRules: (typeof BaseLayoutHintRule)[] = [\n DependentAttribute,\n RemainingTotalUploadSize,\n];\n\n/**\n * Add custom layout hint rules\n */\nexport const addLayoutHintRule = (rule: typeof BaseLayoutHintRule) => {\n layoutHintRules.push(rule);\n};\n\nexport type LayoutHintRulesUpdater = (\n rules: (typeof BaseLayoutHintRule)[],\n) => (typeof BaseLayoutHintRule)[];\n\n/**\n * Update existing array of layout hint rules, use this to update or remove standard rules\n *\n * @example\n * // remove RemainingTotalUploadSize rule\n * updateLayoutHintRules((rules) => {\n * return rules.filter(rule => rule !== RemainingTotalUploadSize));\n * });\n */\nexport const updateLayoutHintRules = (updater: LayoutHintRulesUpdater) => {\n const newRules = updater(layoutHintRules);\n if (Array.isArray(newRules)) {\n layoutHintRules = newRules;\n } else {\n throw new IllegalReturnException(\n \"Result of updater of updateLayoutHintRules is not an array\",\n );\n }\n};\n\n/**\n * Collection of layout hint rules\n */\nexport class LayoutHintRuleCollection extends BaseCollection<LayoutHintRule> {\n /**\n * Retrieve all rules available in the collection\n */\n get allRules(): (typeof BaseLayoutHintRule)[] {\n return layoutHintRules;\n }\n\n /**\n * Set layout hint rules on the applicable attributes\n */\n static setLayoutHintRules(attribute: AttributeModel) {\n const rules = new LayoutHintRuleCollection();\n\n layoutHintRules.forEach((rule) => {\n if (rule.isApplicableForAttribute(attribute)) {\n if (rule.checkHintApplicability) {\n attribute.layouthint.forEach((hint) => {\n if (rule.isApplicableForHint(hint)) {\n rules.add(rule.initHint(hint));\n }\n });\n } else {\n rules.add(rule.initAttribute(attribute));\n }\n }\n });\n\n attribute.layoutHintRules = rules;\n\n return attribute;\n }\n\n /**\n * Process layout hint rules in the collection\n */\n process<C extends BaseAttributeContributions>(\n attribute: BaseAttributeModel<C>,\n attributes: AttributeCollection,\n ) {\n this.all.forEach((rule) => {\n rule.process<C>(attribute, attributes);\n });\n }\n}\n","import type { ConstraintModel } from \"../types\";\n\nexport class BSNConstraint implements ConstraintModel {\n get id() {\n return \"Constraint.BSN.InvalidFormat\";\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage() {\n return \"Must be a valid BSN\";\n }\n\n get parameters() {\n return {};\n }\n\n isValidBSN(bsn: string) {\n // if remove invalid characters and check if this is still the same length to find out if unwanted characters are used\n // valid characters are: numbers\n if (bsn.replace(/[^\\d]/gu, \"\").length !== bsn.length) {\n return false;\n }\n\n const bsnNumber = bsn.replace(/\\D/gu, \"\");\n\n const bsnLength = bsnNumber.length;\n const MINBSNLENGTH = 8;\n const MAXBSNLENGTH = 9;\n\n if (\n bsnLength < MINBSNLENGTH ||\n bsnLength > MAXBSNLENGTH ||\n Number.isNaN(bsnNumber)\n ) {\n return false;\n }\n\n let pos = 0;\n let result = 0;\n\n for (let i = bsnLength; i > 0; i--) {\n const digit = parseInt(bsnNumber.charAt(pos), 10);\n\n result += i === 1 ? digit * -1 : digit * i;\n pos += 1;\n }\n\n return result % 11 === 0;\n }\n\n validate(value: string) {\n return this.isValidBSN(value);\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import IBAN from \"iban\";\n\nimport type { ConstraintModel } from \"../types\";\n\nexport class IBANConstraint implements ConstraintModel {\n get id(): string {\n return \"Constraint.IBAN.InvalidFormat\";\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Must be a valid IBAN number\";\n }\n\n get parameters() {\n return {};\n }\n\n validate(value: string) {\n return IBAN.isValid(value);\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import type { ConstraintModel } from \"../types\";\n\nexport interface RegexObject {\n messageKey: string;\n defaultMessage?: string | undefined;\n regex: string | RegExp;\n}\n\nexport class RegexConstraint implements ConstraintModel {\n private _regexConstraint: RegexObject;\n\n constructor(regexConstraint: RegexObject) {\n this._regexConstraint = regexConstraint;\n }\n\n get id() {\n return this.regexConstraint.messageKey;\n }\n\n get regexConstraint() {\n return this._regexConstraint;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage() {\n return (\n this.regexConstraint.defaultMessage || this.regexConstraint.messageKey\n );\n }\n\n get parameters() {\n return {\n regex: this.regexConstraint.regex,\n };\n }\n\n validate(value: string) {\n if (this.regexConstraint.regex instanceof RegExp) {\n return this.regexConstraint.regex.test(value);\n }\n\n return new RegExp(this.regexConstraint.regex).test(value);\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { ATTRIBUTE_WIDTH } from \"../../constants/Constants\";\nimport { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { BSNConstraint } from \"./input-constraints/BSNConstraint\";\nimport { ConstraintCollection } from \"./input-constraints/ConstraintCollection\";\nimport { IBANConstraint } from \"./input-constraints/IBANConstraint\";\nimport { RegexConstraint } from \"./input-constraints/RegexConstraint\";\n\nimport type {\n AttributeContributions,\n AttributeModel,\n BaseStringAttributeContributions,\n MaybeAttributeValue,\n StringAttributeContributions,\n} from \"./types\";\n\nexport class StringAttributeModel<\n C extends BaseStringAttributeContributions = StringAttributeContributions,\n> extends BaseAttributeModel<C> {\n override get type() {\n return ATTRIBUTE_TYPE.STRING;\n }\n\n static override isApplicableModel(contributions: AttributeContributions) {\n if (\"type\" in contributions && contributions.type === \"string\") {\n return true;\n }\n\n if (\n \"layouthint\" in contributions &&\n Array.isArray(contributions.layouthint)\n ) {\n return contributions.layouthint.includes(\"string\");\n }\n\n return false;\n }\n\n /**\n * Retrieve initial input value\n */\n override getInitialInputValue(value: string) {\n return this.formatValue(value);\n }\n\n /**\n * Get Regexp pattern\n */\n get regexp() {\n return this.getContributionAsString(\"regexp\");\n }\n\n get regexpvalidationmessage() {\n return this.getContributionAsString(\"regexpValidationMessage\");\n }\n\n /**\n * Get postfix text\n */\n get postfix() {\n return this.getContributionAsString(\"postfix\", \"\");\n }\n\n /**\n * Get prefix text\n */\n get prefix() {\n return this.getContributionAsString(\"prefix\", \"\");\n }\n\n isBSN() {\n return this.layouthint.has(\"bsn\");\n }\n\n isIBAN() {\n return this.layouthint.has(\"iban\");\n }\n\n isZipcode() {\n return this.layouthint.has(\"zipcode\");\n }\n\n isEmail() {\n return this.layouthint.has(\"email\");\n }\n\n override addConstraints() {\n const constraints = new ConstraintCollection();\n\n if (this.isBSN()) {\n constraints.add(new BSNConstraint());\n } else if (this.isIBAN()) {\n constraints.add(new IBANConstraint());\n }\n\n if (this.isZipcode()) {\n // validate zip when regex is set is set or exact or isNot\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.ZipCode.InvalidFormat\",\n defaultMessage: \"Must be a valid Dutch ZIP code, e.g. 1234 AB\",\n regex: new RegExp(\"^[1-9][0-9]{3} ?[a-zA-Z]{2}$\", \"gi\"),\n }),\n );\n } else if (this.isEmail() && this.regexp) {\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.Email.InvalidFormat\",\n defaultMessage: \"Must be a valid e-mail address\",\n regex: new RegExp(this.regexp, \"gi\"),\n }),\n );\n } else if (this.regexp) {\n constraints.add(\n new RegexConstraint({\n messageKey: \"Constraint.String.InvalidRegex\",\n defaultMessage: this.regexpvalidationmessage,\n regex: this.regexp,\n }),\n );\n }\n\n return constraints;\n }\n\n /**\n * Reset attribute to empty string\n */\n reset() {\n this.inputvalue = \"\";\n }\n\n formatIBAN(value: string) {\n const noFormat = this.removeFormat(value);\n\n const groups = noFormat.replace(/\\s/g, \"\").match(/.{1,4}/g);\n return groups == null ? \"\" : groups.join(\" \");\n }\n\n formatZipcode(value: string) {\n const noFormat = this.removeFormat(value);\n if (noFormat.length === 6) {\n return (\n noFormat.substring(0, 4) + \" \" + noFormat.substring(4).toUpperCase()\n );\n }\n return noFormat;\n }\n\n formatBSN(value: string) {\n return this.removeFormat(value);\n }\n\n override formatValue(value: string) {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (typeof value === \"string\") {\n if (this.isIBAN()) {\n return this.formatIBAN(value);\n }\n\n if (this.isZipcode()) {\n return this.formatZipcode(value);\n }\n\n if (this.isBSN()) {\n return this.formatBSN(value);\n }\n\n // fix for rendering of multiple spaces\n return value.replace(/ {2}/gi, \" \\u00A0\");\n }\n\n return JSON.stringify(value);\n }\n\n removeFormat(value: MaybeAttributeValue) {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (typeof value === \"string\") {\n if (this.isIBAN() || this.isZipcode() || this.isBSN()) {\n return value.replace(/[^a-z0-9,]/gi, \"\");\n }\n return value;\n }\n\n return JSON.stringify(value);\n }\n\n override get validateValue(): string {\n return this.removeFormat(this.inputvalue);\n }\n\n override get inputvalue(): string {\n return this.getInputValue();\n }\n\n /**\n * Sets the input value to the value entered by the user\n */\n override set inputvalue(value: MaybeAttributeValue) {\n this.setInputvalue(value);\n\n if (value == null) {\n this.value = value;\n } else {\n this.value = this.removeFormat(value);\n }\n\n this.validate(this.validateValue);\n }\n\n override get readonlyvalue() {\n if (typeof this.value === \"string\") {\n const formattedValue = this.formatValue(this.value);\n // fix for rendering of multiple spaces\n return formattedValue.replace(/ {2}/gi, \" \\u00A0\");\n }\n\n return this.value == null ? \"\" : JSON.stringify(this.value);\n }\n\n /**\n * Update the attribute by name and value\n */\n update(value: MaybeAttributeValue) {\n if (this.inputvalue === value) {\n return this;\n }\n\n this.updateLastModification();\n this.inputvalue = value;\n\n return this;\n }\n\n updateByAttribute(otherAttribute: AttributeModel) {\n this.reset();\n if (otherAttribute instanceof StringAttributeModel) {\n this.update(otherAttribute.value);\n } else {\n console.error(\n `update of string attribute with ${otherAttribute.type} not supported`,\n );\n }\n }\n\n override get readonlyWidth(): ATTRIBUTE_WIDTH {\n if (this.isZipcode() || this.isBSN()) {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n\n if (this.isIBAN()) {\n return ATTRIBUTE_WIDTH.LARGE;\n }\n\n // default value (also applied for email address + download attribute)\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n}\n","import { ATTRIBUTE_WIDTH } from \"../../constants/Constants\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { StringAttributeModel } from \"./StringAttributeModel\";\n\nimport type {\n AttributeContributions,\n MemoAttributeContributions,\n} from \"./types\";\n\nexport class MemoAttributeModel extends StringAttributeModel<MemoAttributeContributions> {\n static override isApplicableModel(contributions: AttributeContributions) {\n if (\n \"type\" in contributions &&\n typeof contributions.type === \"string\" &&\n contributions.type === ATTRIBUTE_TYPE.MEMO\n ) {\n return true;\n }\n\n if (\"rows\" in contributions && typeof contributions.rows === \"number\") {\n return contributions.rows > 1;\n }\n\n return false;\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.MEMO;\n }\n\n /**\n * Retrieve number of rows to render in a textarea and wysiwyg input\n */\n get rows() {\n const DEFAULT_ROWS_TO_RENDER = 10;\n return this.getContributionAsNumber(\"rows\", DEFAULT_ROWS_TO_RENDER);\n }\n\n /**\n * Get formatted switch\n */\n get formatted() {\n return this.getContributionAsBoolean(\"formatted\", false);\n }\n\n override get readonlyWidth(): ATTRIBUTE_WIDTH {\n return ATTRIBUTE_WIDTH.LARGE;\n }\n}\n","import isPlainObject from \"lodash/isPlainObject\";\n\nimport { ATTRIBUTE_WIDTH } from \"../../constants/Constants\";\nimport {\n CASEVIEW_LINK,\n INITIAL_TOTAL_FILESIZE,\n MAX_TOTAL_FILESIZE,\n} from \"../../layouthints/LayoutHints\";\nimport { NumberUtil } from \"../../utils/number/NumberUtil\";\nimport { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { ConstraintCollection } from \"./input-constraints/ConstraintCollection\";\nimport { NumberBoundaryConstraint } from \"./input-constraints/NumberBoundaryConstraint\";\nimport { NumberFormatConstraint } from \"./input-constraints/NumberFormatConstraint\";\nimport { NumberGroupingConstraint } from \"./input-constraints/NumberGroupingConstraint\";\n\nimport type {\n AttributeContributions,\n AttributeModel,\n MaybeAttributeValue,\n NumberAttributeContributions,\n} from \"./types\";\n\nexport class NumberAttributeModel<\n C extends AttributeContributions = NumberAttributeContributions,\n> extends BaseAttributeModel<C> {\n static override isApplicableModel(contributions: AttributeContributions) {\n if (\"type\" in contributions && typeof contributions.type === \"string\") {\n return (\n contributions.type === ATTRIBUTE_TYPE.NUMBER ||\n contributions.type === ATTRIBUTE_TYPE.INTEGER\n );\n }\n return false;\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.NUMBER;\n }\n\n /**\n * Get initial value\n */\n override getInitialInputValue(value?: MaybeAttributeValue) {\n if (value == null) {\n return \"\";\n }\n\n return this.formatValue(value);\n }\n\n /**\n * Get grouping separator\n */\n get groupingSeparator() {\n return this.getContributionAsString(\"groupingSeparator\", \"\");\n }\n\n /**\n * Get decimal separator\n */\n get decimalSeparator() {\n return this.getContributionAsString(\"decimalSeparator\", \"\");\n }\n\n /**\n * Get minimum value\n */\n get minNumber() {\n return this.getContributionAsNumber(\"minimum\");\n }\n\n /**\n * Get maximum value\n */\n get maxNumber() {\n return this.getContributionAsNumber(\"maximum\");\n }\n\n /**\n * Gets the maximum digits based on the format\n */\n get maxDigits() {\n const format = this.format;\n\n if (format != null && format.includes(\".\")) {\n return format.split(\".\")[1].length;\n }\n\n return 0;\n }\n\n /**\n * Get unit text\n */\n get unit() {\n return this.getContributionAsString(\"unit\", \"\");\n }\n\n /**\n * Add number constraints\n */\n override addConstraints() {\n const constraints = new ConstraintCollection();\n\n constraints.add(\n new NumberFormatConstraint(\n this.groupingSeparator,\n this.decimalSeparator,\n this.format,\n ),\n );\n constraints.add(\n new NumberGroupingConstraint(\n this.groupingSeparator,\n this.decimalSeparator,\n this.format ?? undefined,\n ),\n );\n constraints.add(\n new NumberBoundaryConstraint(\n this.minNumber,\n this.maxNumber,\n this.groupingSeparator,\n this.decimalSeparator,\n this.format ?? undefined,\n ),\n );\n\n return constraints;\n }\n\n /**\n * Reset attribute to empty string\n */\n reset() {\n this.inputvalue = \"\";\n }\n\n /**\n * Getting the display and input format of an attribute\n */\n override get format() {\n return this.getContributionAsString(\"format\", \"0\");\n }\n\n override formatValue(value: MaybeAttributeValue) {\n if (typeof value === \"string\" || typeof value === \"number\") {\n return NumberUtil.formatNumber(\n value,\n this.format,\n this.groupingSeparator,\n this.decimalSeparator,\n );\n }\n\n return \"\";\n }\n\n override get readonlyvalue() {\n if (!isPlainObject(this.value)) {\n return this.formatValue(this.value);\n }\n\n return JSON.stringify(this.value);\n }\n\n /**\n * Returns the value as entered by the user. This can differ from the internal iso value that is stored\n */\n override get inputvalue() {\n return this.getInputValue();\n }\n\n /**\n * Sets the input value to the value entered by the user\n */\n override set inputvalue(value: MaybeAttributeValue) {\n this.setInputvalue(value);\n this.validate(value);\n\n const outputNumber = NumberUtil.parseToNumber(\n value,\n this.groupingSeparator,\n this.decimalSeparator,\n );\n\n this.value = isNaN(outputNumber)\n ? null\n : NumberUtil.parseNumberToString(outputNumber);\n }\n\n /**\n * Getting the value of the attribute\n */\n override getValue(): number | null {\n const value = super.getValue();\n return value == null || value === \"\" ? null : Number(value);\n }\n\n /**\n * Update the attribute by name and value\n */\n update(value: MaybeAttributeValue) {\n if (value === this.inputvalue) {\n return this;\n }\n\n this.updateLastModification();\n this.inputvalue = value;\n\n return this;\n }\n\n updateByAttribute(otherAttribute: AttributeModel) {\n this.reset();\n if (otherAttribute instanceof NumberAttributeModel) {\n this.update(otherAttribute.value);\n } else {\n console.error(\n `update of number attribute with ${otherAttribute.type} not supported`,\n );\n }\n }\n\n override get isHidden() {\n return (\n super.isHidden ||\n this.layouthint.has(\n INITIAL_TOTAL_FILESIZE,\n MAX_TOTAL_FILESIZE,\n CASEVIEW_LINK,\n )\n );\n }\n\n override set isHidden(isHidden: boolean) {\n super.isHidden = isHidden;\n }\n\n override get readonlyWidth(): ATTRIBUTE_WIDTH {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n}\n","import big from \"big.js\";\n\nimport { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport { DecimalFormat } from \"./DecimalFormat\";\n\nimport type { MaybeAttributeValue } from \"../../models/attributes/types\";\n\nexport class NumberUtil {\n private static removeGroupingSeparator = (\n input: string | number,\n groupingSeparator?: string,\n ) => {\n if (typeof input === \"number\") {\n return input;\n }\n\n if (groupingSeparator == null) {\n return input;\n }\n\n const escapedGroupingSeparator = groupingSeparator.replace(\n /[$()*+.?[\\\\\\]^{|}]/g,\n \"\\\\$&\",\n );\n\n return input.replace(new RegExp(escapedGroupingSeparator, \"g\"), \"\");\n };\n\n private static updateDecimalSeparator = (\n input: string | number,\n decimalSeparator?: string,\n ) => {\n if (typeof input === \"number\") {\n return input;\n }\n\n if (decimalSeparator == null || decimalSeparator === \"\") {\n return input;\n }\n\n return input.replace(decimalSeparator, \".\");\n };\n\n /**\n * Parses input into a number, removes the grouping separator from the input and\n * replaces the decimal separator with a dot to make it a JavaScript parseable number\n */\n static parseToNumber = (\n input?: MaybeAttributeValue,\n groupingSeparator = \",\",\n decimalSeparator = \".\",\n ): number => {\n if (\n !(typeof input === \"number\" || typeof input === \"string\") ||\n input === \"\"\n ) {\n return NaN;\n }\n\n const inputNoGrouping = this.removeGroupingSeparator(\n input,\n groupingSeparator,\n );\n\n const inputCorrectDecimalSeparator = this.updateDecimalSeparator(\n inputNoGrouping,\n decimalSeparator,\n );\n\n return Number(inputCorrectDecimalSeparator);\n };\n\n /**\n * parses Numbers To String\n */\n static parseNumberToString = (\n input?: string | number | null | undefined,\n groupingSeparator = \",\",\n decimalSeparator = \".\",\n ): string => {\n if (input == null || input === \"\") {\n return \"NaN\";\n }\n\n const inputNoGrouping = this.removeGroupingSeparator(\n input,\n groupingSeparator,\n );\n\n const inputCorrectDecimalSeparator = this.updateDecimalSeparator(\n inputNoGrouping,\n decimalSeparator,\n );\n\n try {\n return big(inputCorrectDecimalSeparator).toFixed();\n } catch (_error) {\n return \"NaN\";\n }\n };\n\n private static updateGroupingSeparator(\n input: string,\n groupingSeparator: string,\n ) {\n if (groupingSeparator == null) {\n return input;\n }\n\n return input.replace(/,/g, groupingSeparator);\n }\n\n static formatNumber(\n value: number | string | null | undefined,\n format: string | undefined = \"#\",\n groupingSeparator = \",\",\n decimalSeparator = \".\",\n ) {\n if (value == null) {\n return \"\";\n }\n\n const numberValue =\n typeof value === \"number\"\n ? value\n : this.parseToNumber(value, groupingSeparator, decimalSeparator);\n\n if (typeof numberValue !== \"number\") {\n throw new IllegalArgumentException(\n `Not a valid number: ${value} for formatValue`,\n );\n }\n\n const stringValue = this.parseNumberToString(numberValue);\n\n if (format != null) {\n const formattedValue = new DecimalFormat(format).format(stringValue);\n\n const [integer, decimal] = formattedValue.split(\".\");\n\n const integerPart = this.updateGroupingSeparator(\n integer,\n groupingSeparator,\n );\n\n if (decimal) {\n return `${integerPart}${decimalSeparator}${decimal}`;\n }\n\n return integerPart;\n }\n\n return stringValue;\n }\n\n static isSameOrBefore(startValue: number, endValue: number) {\n return startValue <= endValue;\n }\n\n static isBefore(startValue: number, endValue: number) {\n return startValue < endValue;\n }\n}\n","// @see: https://docs.oracle.com/javase/tutorial/i18n/format/decimalFormat.html\nexport class DecimalFormat {\n private _prefix = \"\";\n private _suffix = \"\";\n\n // Grouping size\n private _comma = 0;\n // Minimum integer digits to be displayed\n private _minInt = 1;\n\n // Minimum fractional digits to be displayed\n private _minFrac = 0;\n // Maximum fractional digits to be displayed\n private _maxFrac = 0;\n\n private _isPercentage = false;\n\n constructor(format: string) {\n this.setAffix(format);\n this.setFractionLengths(format);\n this.setGroupLength(format);\n this.setMinLength(format);\n\n this.setPercentage();\n }\n\n get prefix(): string {\n return this._prefix;\n }\n\n get suffix(): string {\n return this._suffix;\n }\n\n get comma(): number {\n return this._comma;\n }\n\n get minInt(): number {\n return this._minInt;\n }\n\n get minFrac(): number {\n return this._minFrac;\n }\n\n get maxFrac(): number {\n return this._maxFrac;\n }\n\n get isPercentage(): boolean {\n return this._isPercentage;\n }\n\n setAffix(format: string) {\n const beforeDigit = format.includes(\"#\")\n ? format.substring(0, format.indexOf(\"#\"))\n : format;\n\n this._prefix = beforeDigit.includes(\"0\")\n ? beforeDigit.substring(0, beforeDigit.indexOf(\"0\"))\n : beforeDigit;\n this._suffix = format\n .substring(this._prefix.length)\n .replace(/[#,.0]/gu, \"\");\n }\n\n setFractionLengths(format: string) {\n const numberStr = format.replace(/[^#,.0]/gu, \"\");\n if (numberStr.includes(\".\")) {\n const fracStr = numberStr.substring(numberStr.indexOf(\".\") + 1);\n\n const maxFrac = fracStr.replace(/,|\\.+/g, \"\");\n this._maxFrac = maxFrac.length;\n\n // replace all but zeros\n const minFrac = maxFrac.replace(/[^0]/gu, \"\");\n this._minFrac = minFrac.length;\n }\n }\n\n setGroupLength(format: string) {\n const numberStr = format.replace(/[^#,.0]/gu, \"\");\n const intStr = numberStr.includes(\".\")\n ? numberStr.substring(0, numberStr.indexOf(\".\"))\n : numberStr;\n\n if (intStr.includes(\",\")) {\n this._comma = intStr.length - 1 - intStr.lastIndexOf(\",\");\n }\n }\n\n setMinLength(format: string) {\n const intFormatStr = format.includes(\".\")\n ? format.substring(0, format.indexOf(\".\"))\n : format;\n const intStr = intFormatStr.replace(/[^0]/gu, \"\");\n\n this._minInt = intStr.length > 1 ? intStr.length : 1;\n }\n\n setPercentage() {\n this._isPercentage = this.suffix.charAt(0) === \"%\";\n }\n\n /**\n * Solves problem where big numbers loose the precision:\n * e.g. Number(23423423423342234.34) => 23423423423342236\n */\n static getNumericString(stringNumber: string): string {\n const number = Number(stringNumber);\n const string = String(number);\n\n if (!string.includes(\".\") && stringNumber.includes(\".\")) {\n // check if original string has all zeros after dot or not\n const precision = stringNumber.substring(stringNumber.indexOf(\".\") + 1);\n if (precision.replace(/0/gu, \"\").length > 0) {\n return stringNumber;\n }\n\n return string;\n }\n\n return stringNumber;\n }\n\n /**\n * Converts formatted value back to non-formatted value\n * e.g. $1,223.06 --> 1223.06\n */\n formatBack(formattedNumber: string): string {\n const stringNumber = String(formattedNumber);\n\n if (!stringNumber) {\n return \"\";\n }\n\n if (!isNaN(Number(stringNumber))) {\n return DecimalFormat.getNumericString(stringNumber);\n }\n\n let tempNumber = formattedNumber;\n\n let negative = false;\n if (formattedNumber.charAt(0) === \"-\") {\n tempNumber = formattedNumber.substr(1);\n negative = true;\n }\n\n const hasPrefix = formattedNumber.startsWith(this.prefix);\n\n const suffixIndex =\n this.suffix === \"\"\n ? formattedNumber.length\n : formattedNumber.indexOf(this.suffix, this.prefix.length + 1);\n\n if (hasPrefix && suffixIndex > 0) {\n tempNumber = tempNumber.substr(0, suffixIndex);\n tempNumber = tempNumber.substr(this.prefix.length);\n tempNumber = tempNumber.replace(/,/gu, \"\");\n\n if (negative) {\n tempNumber = `-${tempNumber}`;\n }\n\n if (!isNaN(Number(tempNumber))) {\n return DecimalFormat.getNumericString(tempNumber);\n }\n }\n\n return tempNumber;\n }\n\n static scientificNumber(stringNumber: string): string {\n if (stringNumber.includes(\"e\")) {\n const number = Number(stringNumber);\n if (number === Infinity || number === -Infinity) {\n return stringNumber;\n }\n\n return String(number);\n }\n\n return stringNumber;\n }\n\n getFracAsNumber(fracStr: string): string {\n const number = Number(`0.${fracStr}`);\n const DECIMAL_RADIX = 10;\n\n return this.maxFrac === 0\n ? Math.round(number).toString(DECIMAL_RADIX)\n : number.toFixed(this.maxFrac);\n }\n\n getRoundedFrac(fracStr: string): string {\n const num = this.getFracAsNumber(fracStr);\n\n // toFixed method has bugs on IE (0.7 --> 0)\n return num.substr(2);\n }\n\n static getFraction(number: string): string {\n let fracStr = number.includes(\".\")\n ? number.substring(number.indexOf(\".\") + 1)\n : \"\";\n\n fracStr = fracStr.replace(/\\./, \"\");\n\n return fracStr;\n }\n\n getFracCorrectLength(frac: string): string {\n let fracStr = frac;\n\n if (fracStr.length > this.maxFrac) {\n fracStr = this.getRoundedFrac(fracStr);\n }\n\n for (let i = fracStr.length; i < this.minFrac; i++) {\n // if minFrac=4 then 1.12 --> 1.1200\n fracStr = `${fracStr}0`;\n }\n\n while (\n fracStr.length > this.minFrac &&\n fracStr.charAt(fracStr.length - 1) === \"0\"\n ) {\n // if minInt=4 then 00034 --> 0034)\n fracStr = fracStr.substring(0, fracStr.length - 1);\n }\n\n return fracStr;\n }\n\n getInteger(number: string): string {\n let intStr = number.includes(\".\")\n ? number.substring(0, number.indexOf(\".\"))\n : number;\n\n let doCarry = Number(this.getFracAsNumber(number)) > 1;\n let i = intStr.length - 1;\n\n while (doCarry) {\n if (i === -1) {\n intStr = `1${intStr}`;\n break;\n }\n\n let x = intStr.charAt(i);\n if (x === \"9\") {\n x = \"0\";\n } else {\n x = `${x + 1}`;\n doCarry = false;\n }\n\n intStr =\n intStr.substring(0, i) + x + intStr.substring(i + 1, intStr.length);\n\n i -= 1;\n }\n\n for (let j = intStr.length; j < this.minInt; j++) {\n // if minInt=4 then 034 --> 0034\n intStr = `0${intStr}`;\n }\n\n while (intStr.length > this.minInt && intStr.charAt(0) === \"0\") {\n // if minInt=4 then 00034 --> 0034)\n intStr = intStr.substring(1);\n }\n\n return intStr;\n }\n\n addGrouping(intStr: string): string {\n let groupedIntStr = intStr;\n\n let j = 0;\n for (let i = groupedIntStr.length; i > 0; i--) {\n // add commas\n if (j !== 0 && j % this.comma === 0) {\n groupedIntStr = `${groupedIntStr.substring(\n 0,\n i,\n )},${groupedIntStr.substring(i)}`;\n j = 0;\n }\n\n j += 1;\n }\n\n return groupedIntStr;\n }\n\n getFormattedValue(\n intStr: string,\n fracStr: string,\n isNegative: boolean,\n ): string {\n let formattedValue;\n if (fracStr.length > 0)\n formattedValue = `${this.prefix + intStr}.${fracStr}${this.suffix}`;\n else formattedValue = this.prefix + intStr + this.suffix;\n\n if (isNegative) {\n formattedValue = `-${formattedValue}`;\n }\n\n return formattedValue;\n }\n\n /**\n * Formats given value, using the pattern\n * e.g. $#,###.00: 1223.06 --> $1,223.06\n */\n format(stringNumber = \"\"): string {\n if (stringNumber === null) {\n return \"\";\n }\n\n let formattedNumber = this.formatBack(stringNumber).toLowerCase();\n\n if (isNaN(Number(formattedNumber)) || formattedNumber.length === 0) {\n return stringNumber;\n }\n\n formattedNumber = DecimalFormat.scientificNumber(formattedNumber);\n if (formattedNumber.includes(\"e\")) {\n return formattedNumber;\n }\n\n const isNegative = formattedNumber.charAt(0) === \"-\";\n if (isNegative || formattedNumber.charAt(0) === \"+\") {\n formattedNumber = formattedNumber.substring(1);\n }\n\n let fracStr = DecimalFormat.getFraction(formattedNumber);\n let intStr = this.getInteger(formattedNumber);\n if (this.isPercentage) {\n // Add zeros behind fraction to make sure we have at least two characters and take first two character:\n // 1 --> 100 --> 10\n const addZeroToFrac = `${fracStr}00`.substr(0, 2);\n // Add zeros in front of frac and get last two characters\n const lastTwoFrac = `00${addZeroToFrac}`.substr(-2);\n\n intStr = `${intStr}${lastTwoFrac}`;\n fracStr = fracStr.substr(2);\n }\n\n fracStr = this.getFracCorrectLength(fracStr);\n\n intStr = this.addGrouping(intStr);\n\n return this.getFormattedValue(intStr, fracStr, isNegative);\n }\n}\n","import { NumberUtil } from \"../../../utils/number/NumberUtil\";\n\nimport type { ConstraintModel } from \"../types\";\n\nconst INEXACT_NUMBER_ID = \"Constraint.Number.InexactNumber\";\nconst OUT_OF_RANGE_ID = \"Constraint.Number.OutOfRange\";\nconst BELOW_MINIMUM_ID = \"Constraint.Number.BelowMinimum\";\nconst ABOVE_MAXIMUM_ID = \"Constraint.Number.AboveMaximum\";\n\nexport class NumberBoundaryConstraint implements ConstraintModel {\n private _minNumber: number | null;\n private _maxNumber: number | null;\n private _groupingSeparator = \",\";\n private _decimalSeparator = \".\";\n private _format = \"\";\n\n constructor(\n minNumber: number | null = null,\n maxNumber: number | null = null,\n groupingSeparator = \",\",\n decimalSeparator = \".\",\n format?: string,\n ) {\n this._format = format ?? \"\";\n this._groupingSeparator = groupingSeparator;\n this._decimalSeparator = decimalSeparator;\n this._minNumber = minNumber;\n this._maxNumber = maxNumber;\n }\n\n get id(): string {\n if (\n this.minNumber !== null &&\n this.maxNumber !== null &&\n this.minNumber === this.maxNumber\n ) {\n return INEXACT_NUMBER_ID;\n } else if (this.minNumber !== null && this.maxNumber !== null) {\n return OUT_OF_RANGE_ID;\n } else if (this.minNumber !== null) {\n return BELOW_MINIMUM_ID;\n } else if (this.maxNumber !== null) {\n return ABOVE_MAXIMUM_ID;\n }\n\n return \"Constraint.Number.NoBoundaryConstraint\";\n }\n\n get minNumber(): number | null {\n return this._minNumber;\n }\n\n get maxNumber(): number | null {\n return this._maxNumber;\n }\n\n get format(): string {\n return this._format;\n }\n\n get groupingSeparator(): string {\n return this._groupingSeparator;\n }\n\n get decimalSeparator(): string {\n return this._decimalSeparator;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n switch (this.id) {\n case INEXACT_NUMBER_ID:\n return \"Number must be precisely ${min-number}\"; // NOSONAR\n case OUT_OF_RANGE_ID:\n return \"Must be between ${min-number} and ${max-number}\"; // NOSONAR\n case BELOW_MINIMUM_ID:\n return \"The number must be larger than ${min-number}\"; // NOSONAR\n case ABOVE_MAXIMUM_ID:\n return \"The number must be smaller than ${max-number}\"; // NOSONAR\n default:\n return \"\";\n }\n }\n\n get parameters(): {\n \"max-number\": null | string;\n \"min-number\": null | string;\n } {\n return {\n \"min-number\":\n this.minNumber === null\n ? null\n : NumberUtil.formatNumber(\n this.minNumber,\n this.format,\n this.groupingSeparator,\n this.decimalSeparator,\n ),\n \"max-number\":\n this.maxNumber === null\n ? null\n : NumberUtil.formatNumber(\n this.maxNumber,\n this.format,\n this.groupingSeparator,\n this.decimalSeparator,\n ),\n };\n }\n\n isExactNumber(value: string) {\n const parsedNumber = NumberUtil.parseToNumber(\n value,\n this.groupingSeparator,\n this.decimalSeparator,\n );\n return parsedNumber === this.minNumber;\n }\n\n isSameOrAboveMinNumber(value: string) {\n const parsedNumber = NumberUtil.parseToNumber(\n value,\n this.groupingSeparator,\n this.decimalSeparator,\n );\n\n if (isNaN(parsedNumber) || parsedNumber == null) {\n return false;\n }\n\n return this.minNumber != null && parsedNumber >= this.minNumber;\n }\n\n isSameOrBelowMaxNumber(value: string) {\n const parsedNumber = NumberUtil.parseToNumber(\n value,\n this.groupingSeparator,\n this.decimalSeparator,\n );\n\n if (isNaN(parsedNumber) || parsedNumber == null) {\n return false;\n }\n\n return this.maxNumber != null && parsedNumber <= this.maxNumber;\n }\n\n isBetweenNumbers(value: string) {\n return (\n this.isSameOrAboveMinNumber(value) && this.isSameOrBelowMaxNumber(value)\n );\n }\n\n validate(value: string) {\n switch (this.id) {\n case INEXACT_NUMBER_ID:\n return this.isExactNumber(value);\n case OUT_OF_RANGE_ID:\n return this.isBetweenNumbers(value);\n case BELOW_MINIMUM_ID:\n return this.isSameOrAboveMinNumber(value);\n case ABOVE_MAXIMUM_ID:\n return this.isSameOrBelowMaxNumber(value);\n default:\n return true;\n }\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { DecimalFormat } from \"../../../utils/number/DecimalFormat\";\nimport { NumberUtil } from \"../../../utils/number/NumberUtil\";\n\nimport type { ConstraintModel } from \"../types\";\n\nconst INVALID_INTEGER_ID = \"Constraint.Number.InvalidInteger\";\n\nexport class NumberFormatConstraint implements ConstraintModel {\n private _decimalSeparator = \",\";\n private _groupingSeparator = \".\";\n private _format = \"0\";\n\n constructor(\n groupingSeparator = \",\",\n decimalSeparator = \".\",\n format: string | null = \"0\",\n ) {\n this._decimalSeparator = decimalSeparator;\n this._groupingSeparator = groupingSeparator;\n this._format = format ?? \"0\";\n }\n\n get id(): string {\n if (this.maxDigits === 0) {\n return INVALID_INTEGER_ID;\n }\n\n return \"Constraint.Number.InvalidDecimal\";\n }\n\n get decimalSeparator(): string {\n return this._decimalSeparator;\n }\n\n get groupingSeparator(): string {\n return this._groupingSeparator;\n }\n\n get format(): string {\n return this._format;\n }\n\n get maxDigits(): number {\n return this.format ? new DecimalFormat(this.format).maxFrac : 0;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n if (this.id === INVALID_INTEGER_ID) {\n return \"Must be a whole number\";\n }\n\n return \"The value is not correct numeric format\";\n }\n\n get parameters(): { \"max-digits\": number } {\n return {\n \"max-digits\": this.maxDigits,\n };\n }\n\n isInteger(value: number) {\n return Number.isInteger(value);\n }\n\n getNumberOfDigits(value: number): number {\n if (Math.floor(value) === value) {\n return 0;\n }\n\n const stringValue = NumberUtil.parseNumberToString(value);\n return stringValue.split(\".\")[1].length;\n }\n\n isValidDecimal(value: number) {\n if (isNaN(value)) {\n return false;\n }\n\n const numberOfDigits = this.getNumberOfDigits(value);\n\n return (\n !isNaN(parseFloat(String(value))) &&\n isFinite(value) &&\n numberOfDigits <= this.maxDigits\n );\n }\n\n validate(value: string | number) {\n if (\n this.maxDigits === 0 &&\n this.decimalSeparator !== \"\" &&\n value.toString().includes(this.decimalSeparator)\n ) {\n return false;\n }\n\n const parsedNumber = NumberUtil.parseToNumber(\n value,\n this.groupingSeparator,\n this.decimalSeparator,\n );\n\n if (this.id === INVALID_INTEGER_ID) {\n return this.isInteger(parsedNumber);\n }\n\n return this.isValidDecimal(parsedNumber);\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { DecimalFormat } from \"../../../utils/number/DecimalFormat\";\n\nimport type { ConstraintModel } from \"../types\";\n\nconst DEFAULT_GROUPING_SIZE = 3;\n\nexport class NumberGroupingConstraint implements ConstraintModel {\n private _decimalSeparator: string;\n private _groupingSeparator: string;\n private _format: string;\n\n constructor(\n groupingSeparator = \",\",\n decimalSeparator = \".\",\n format: string | null = \"0\",\n ) {\n this._decimalSeparator = decimalSeparator;\n this._groupingSeparator = groupingSeparator;\n this._format = format ?? \"0\";\n }\n\n get id(): string {\n return \"Constraint.Number.GroupingSeparator\";\n }\n\n get decimalSeparator(): string {\n return this._decimalSeparator;\n }\n\n get groupingSeparator(): string {\n return this._groupingSeparator;\n }\n\n get format(): string {\n return this._format;\n }\n\n get groupSize(): number {\n if (this.format) {\n const fromFormat = new DecimalFormat(this.format).comma;\n if (fromFormat > 0) {\n return fromFormat;\n }\n }\n\n return DEFAULT_GROUPING_SIZE;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Group divider '${group-divider}' must be correctly placed\"; // NOSONAR\n }\n\n get parameters(): { \"group-divider\": string } {\n return { \"group-divider\": this.groupingSeparator };\n }\n\n // $FlowFixMe\n hasCorrectGrouping(value: string) {\n // A negative or a negative value may cause an incorrect group length compared to groupSize. To avoid this, the negative or positive sign must be removed from the value.\n const absStringValue = value.replace(\"-\", \"\").replace(\"+\", \"\");\n\n if (!absStringValue.includes(this.groupingSeparator)) {\n return true;\n }\n\n let integer = absStringValue;\n if (\n this.decimalSeparator !== \"\" &&\n absStringValue.includes(this.decimalSeparator)\n ) {\n // decimal before grouping\n if (\n absStringValue.indexOf(this.decimalSeparator) <\n absStringValue.indexOf(this.groupingSeparator)\n ) {\n return false;\n }\n\n integer = absStringValue.substring(\n 0,\n absStringValue.indexOf(this.decimalSeparator),\n );\n }\n\n let groups = integer.split(this.groupingSeparator);\n\n // when the first item is smaller than group size, remove it from check\n if (groups[0].length < this.groupSize) {\n groups = groups.slice(1);\n }\n\n return groups.every((group) => group.length === this.groupSize);\n }\n\n validate(value: string | number) {\n return (\n this.groupingSeparator === \"\" ||\n typeof value !== \"string\" ||\n !value.includes(this.groupingSeparator) ||\n this.hasCorrectGrouping(value)\n );\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { ATTRIBUTE_WIDTH } from \"../../constants/Constants\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { NumberAttributeModel } from \"./NumberAttributeModel\";\n\nimport type {\n AttributeContributions,\n MoneyAttributeContributions,\n} from \"./types\";\n\nexport class MoneyAttributeModel extends NumberAttributeModel<MoneyAttributeContributions> {\n static override isApplicableModel(contributions: AttributeContributions) {\n if (\n \"type\" in contributions &&\n typeof contributions.type === \"string\" &&\n // @ts-expect-error not sure if money is a type that could occur in the contributions, kept this for backwards compatibility\n contributions.type === ATTRIBUTE_TYPE.MONEY\n ) {\n return true;\n }\n\n if (\n \"layouthint\" in contributions &&\n Array.isArray(contributions.layouthint)\n ) {\n return contributions.layouthint.includes(\"money\");\n }\n\n return false;\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.MONEY;\n }\n\n /**\n * Retrieve currency symbol\n */\n get currencySymbol() {\n return this.getContributionAsString(\"currencySymbol\", \"\");\n }\n\n /**\n * Retrieve currency symbol as prefix\n */\n get prefix() {\n return this.currencySymbol;\n }\n\n override get readonlyWidth() {\n return ATTRIBUTE_WIDTH.SMALL;\n }\n}\n","import type { ConstraintModel } from \"../types\";\n\nexport class PasswordConfirmConstraint implements ConstraintModel {\n private _otherPasswordLabel: string;\n private _otherPasswordValue: string;\n\n constructor(otherPasswordValue: string, otherPasswordLabel: string) {\n this._otherPasswordLabel = otherPasswordLabel;\n this._otherPasswordValue = otherPasswordValue;\n }\n\n get id(): string {\n return \"Constraint.Password.ConfirmMismatch\";\n }\n\n get otherPasswordLabel(): string {\n return this._otherPasswordLabel;\n }\n\n get otherPasswordValue(): string {\n return this._otherPasswordValue;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Must match ${other} field\"; // NOSONAR\n }\n\n get parameters(): { other: string } {\n return {\n other: this.otherPasswordLabel,\n };\n }\n\n validate(value: string) {\n return value === this.otherPasswordValue;\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import type { ConstraintModel } from \"../types\";\n\nexport class PasswordLowerAndUpperCaseConstraint implements ConstraintModel {\n get id(): string {\n return \"Constraint.Password.LowerAndUpperCaseMandatory\";\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Must contain both upper and lowercase characters\";\n }\n\n get parameters() {\n return {};\n }\n\n validate(value: string) {\n return /[a-z]/u.test(value) && /[A-Z]/u.test(value);\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import type { ConstraintModel } from \"../types\";\n\nexport class PasswordMinNumericCharactersConstraint implements ConstraintModel {\n private _minNumeric: number;\n\n constructor(minNumeric: number) {\n this._minNumeric = minNumeric;\n }\n\n get id(): string {\n return \"Constraint.Password.MinNumericCharactersMandatory\";\n }\n\n get minNumeric(): number {\n return this._minNumeric;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Must contain ${min-numeric} or more numerical characters\"; // NOSONAR\n }\n\n get parameters(): { \"min-numeric\": number } {\n return {\n \"min-numeric\": this.minNumeric,\n };\n }\n\n validate(value: string) {\n return value.replace(/\\D/gu, \"\").length >= this.minNumeric;\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import type { ConstraintModel } from \"../types\";\n\nexport class PasswordMinSpecialCharactersConstraint implements ConstraintModel {\n private _minSpecial: number;\n\n constructor(minSpecial: number) {\n this._minSpecial = minSpecial;\n }\n\n get id(): string {\n return \"Constraint.Password.MinSpecialCharactersMandatory\";\n }\n\n get minSpecial(): number {\n return this._minSpecial;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Must contain ${min-special} or more special characters\"; // NOSONAR\n }\n\n get parameters(): { \"min-special\": number } {\n return {\n \"min-special\": this.minSpecial,\n };\n }\n\n validate(value: string) {\n return value.replace(/[\\da-z]/giu, \"\").length >= this.minSpecial;\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import type { ConstraintModel } from \"../types\";\n\nexport class PasswordThreeConsecutiveCharactersNotAllowedConstraint\n implements ConstraintModel\n{\n private _maxSequence: number;\n\n constructor(maxSequence = 2) {\n this._maxSequence = maxSequence;\n }\n\n get id(): string {\n return \"Constraint.Password.ThreeConsecutiveCharactersNotAllowed\";\n }\n\n get maxSequence(): number {\n return this._maxSequence;\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Must not contain any character more than twice consecutively\";\n }\n\n get parameters(): { \"max-sequence\": number } {\n return {\n \"max-sequence\": this.maxSequence,\n };\n }\n\n hasNoSequenceOfIdenticalCharacters(value: string) {\n return !value\n .split(\"\")\n .filter((char, i) => value.indexOf(char) === i)\n .some((char) => {\n const sequence = char.repeat(this.maxSequence + 1);\n return value.includes(sequence);\n });\n }\n\n validate(value: string) {\n return this.hasNoSequenceOfIdenticalCharacters(value);\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { CONFIRM_PASSWORD } from \"../../layouthints/LayoutHints\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { ConstraintCollection } from \"./input-constraints/ConstraintCollection\";\nimport { PasswordConfirmConstraint } from \"./input-constraints/PasswordConfirmConstraint\";\nimport { PasswordLowerAndUpperCaseConstraint } from \"./input-constraints/PasswordLowerAndUpperCaseConstraint\";\nimport { PasswordMinNumericCharactersConstraint } from \"./input-constraints/PasswordMinNumericCharactersConstraint\";\nimport { PasswordMinSpecialCharactersConstraint } from \"./input-constraints/PasswordMinSpecialCharactersConstraint\";\nimport { PasswordThreeConsecutiveCharactersNotAllowedConstraint } from \"./input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint\";\nimport { RegexConstraint } from \"./input-constraints/RegexConstraint\";\nimport { StringAttributeModel } from \"./StringAttributeModel\";\n\nimport type { RegexObject } from \"./input-constraints/RegexConstraint\";\nimport type {\n AttributeContributions,\n MaybeAttributeValue,\n PasswordAttributeContributions,\n} from \"./types\";\n\ninterface PasswordConstraints {\n upperAndLowerCaseMandatory?: boolean;\n maxSequenceOfIdenticalCharacters?: number;\n maxSequenceOfUsernameCharacters?: number;\n minNumberOfNumericCharacters?: number;\n minNumberOfSpecialCharacters?: number;\n regexConstraint?: RegexObject[];\n}\n\nexport class PasswordAttributeModel extends StringAttributeModel<PasswordAttributeContributions> {\n private _confirmValue: string | undefined;\n private _isConfirmPassword = false;\n private _otherLabel = \"\";\n\n static override isApplicableModel(contributions: AttributeContributions) {\n if (contributions.type === ATTRIBUTE_TYPE.PASSWORD) {\n return true;\n }\n\n if (\n \"layouthint\" in contributions &&\n Array.isArray(contributions.layouthint)\n ) {\n return contributions.layouthint.includes(\"password\");\n }\n\n return false;\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.PASSWORD;\n }\n\n /**\n * Update the attribute by name and value\n */\n override update(value: MaybeAttributeValue) {\n this.updateLastModification();\n this.inputvalue = value;\n\n return this;\n }\n\n get constraints(): PasswordConstraints {\n return this.getContributionAsObject(\"constraints\", {});\n }\n\n get upperAndLowerCaseMandatory() {\n return this.constraints.upperAndLowerCaseMandatory;\n }\n\n get maxSequenceOfIdenticalCharacters() {\n return this.constraints.maxSequenceOfIdenticalCharacters;\n }\n\n get maxSequenceOfUsernameCharacters() {\n return this.constraints.maxSequenceOfUsernameCharacters;\n }\n\n get minNumberOfNumericCharacters() {\n return this.constraints.minNumberOfNumericCharacters;\n }\n\n get minNumberOfSpecialCharacters() {\n return this.constraints.minNumberOfSpecialCharacters;\n }\n\n get regexConstraint() {\n return this.constraints.regexConstraint;\n }\n\n /**\n * Add password constraints\n */\n override addConstraints() {\n if (this.isConfirmPassword) {\n return this.getConfirmPasswordConstraints();\n }\n return this.getStandardPasswordConstraints();\n }\n\n /**\n * Constraints for a confirmation password\n */\n getConfirmPasswordConstraints() {\n const constraints = new ConstraintCollection();\n constraints.add(\n new PasswordConfirmConstraint(this.confirmValue, this.otherLabel),\n );\n return constraints;\n }\n\n /**\n * Constrains for a standard password\n */\n getStandardPasswordConstraints() {\n const constraints = new ConstraintCollection();\n\n if (this.upperAndLowerCaseMandatory) {\n constraints.add(new PasswordLowerAndUpperCaseConstraint());\n }\n\n if (this.maxSequenceOfIdenticalCharacters) {\n constraints.add(\n new PasswordThreeConsecutiveCharactersNotAllowedConstraint(\n this.maxSequenceOfIdenticalCharacters,\n ),\n );\n }\n\n if (this.minNumberOfNumericCharacters) {\n constraints.add(\n new PasswordMinNumericCharactersConstraint(\n this.minNumberOfNumericCharacters,\n ),\n );\n }\n\n if (this.minNumberOfSpecialCharacters) {\n constraints.add(\n new PasswordMinSpecialCharactersConstraint(\n this.minNumberOfSpecialCharacters,\n ),\n );\n }\n\n if (this.regexConstraint && this.regexConstraint.length > 0) {\n this.regexConstraint.forEach((regexConstraint) => {\n constraints.add(new RegexConstraint(regexConstraint));\n });\n }\n\n if (\n this.layouthint.has(CONFIRM_PASSWORD) &&\n this.isConfirmPassword == null\n ) {\n constraints.add(\n new PasswordConfirmConstraint(this.confirmValue, this.otherLabel),\n );\n }\n\n return constraints;\n }\n\n /**\n * Retrieve applicable constraint for this attribute\n */\n override get constraintCollection() {\n if (this.isConfirmPassword) {\n // confirm password only needs local constraints, no server constraints\n return this.getConfirmPasswordConstraints();\n }\n\n return super.constraintCollection;\n }\n\n get isConfirmPassword() {\n return this._isConfirmPassword;\n }\n\n set isConfirmPassword(isConfirmPassword: boolean) {\n this._isConfirmPassword = isConfirmPassword;\n }\n\n get confirmValue() {\n return this._confirmValue ?? \"\";\n }\n\n set confirmValue(confirmValue: string) {\n this._confirmValue = confirmValue;\n this.validate(this.inputvalue);\n }\n\n get otherLabel() {\n return this._otherLabel;\n }\n\n set otherLabel(otherLabel: string) {\n this._otherLabel = otherLabel;\n }\n\n /**\n * Validate input\n */\n override validate(value: string) {\n // when client side validation is disabled, this attribute is always valid\n if (!this.useClientsideValidation()) {\n return true;\n }\n\n if (this.isOptionalAndEmpty(value)) {\n this.setIsValid(true);\n } else if (\n this.getPreviouslyValidatedValue() !== `${this.confirmValue}-${value}`\n ) {\n this.setIsValid(this.constraintCollection.validate(value));\n }\n this.setPreviouslyValidatedValue(`${this.confirmValue}-${value}`);\n\n return this.getIsValid();\n }\n\n override getFormData() {\n if (this.isConfirmPassword || this.inError()) {\n return null;\n }\n\n return {\n [this.name]: this.value,\n };\n }\n}\n","import type { ConstraintModel } from \"../types\";\n\nexport class XMLConstraint implements ConstraintModel {\n get id(): string {\n return \"Constraint.XML.InvalidFormat\";\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Must be well-formed XML\";\n }\n\n get parameters() {\n return {};\n }\n\n isValidXML(value: string) {\n const oParser = new DOMParser();\n\n try {\n const oDom = oParser.parseFromString(value, \"text/xml\");\n\n if (oDom.querySelectorAll(\"parsererror\").length > 0) {\n return false;\n }\n } catch (_error) {\n return false;\n }\n\n return true;\n }\n\n validate(value: string) {\n return this.isValidXML(value);\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { ATTRIBUTE_WIDTH } from \"../../constants/Constants\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { ConstraintCollection } from \"./input-constraints/ConstraintCollection\";\nimport { XMLConstraint } from \"./input-constraints/XMLConstraint\";\nimport { StringAttributeModel } from \"./StringAttributeModel\";\n\nimport type { AttributeContributions } from \"./types\";\n\nexport class XMLAttributeModel extends StringAttributeModel {\n static override isApplicableModel(contributions: AttributeContributions) {\n if (\n \"type\" in contributions &&\n typeof contributions.type === \"string\" &&\n // @ts-expect-error kept for backwards compatibility\n contributions.type === ATTRIBUTE_TYPE.XML\n ) {\n return true;\n }\n\n if (\n \"layouthint\" in contributions &&\n Array.isArray(contributions.layouthint)\n ) {\n return contributions.layouthint.includes(\"xml\");\n }\n\n return false;\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.XML;\n }\n\n /**\n * Retrieve number of rows to render\n */\n get rows() {\n return 10;\n }\n\n /**\n * Add constraints\n */\n override addConstraints() {\n const constraints = new ConstraintCollection();\n\n constraints.add(new XMLConstraint());\n\n return constraints;\n }\n\n override get readonlyWidth(): ATTRIBUTE_WIDTH {\n return ATTRIBUTE_WIDTH.EXTRA_LARGE;\n }\n}\n","import type { DatetimeAttributeModel } from \"../DatetimeAttributeModel\";\nimport type { NumberAttributeModel } from \"../NumberAttributeModel\";\nimport type { ConstraintModel } from \"../types\";\n\ntype RangeChild = DatetimeAttributeModel | NumberAttributeModel;\n\nexport class MandatoryRangeConstraint implements ConstraintModel {\n private _type: string;\n private _start: RangeChild;\n private _end?: RangeChild;\n\n constructor(type: string, start: RangeChild, end?: RangeChild) {\n this._type = type;\n this._start = start;\n this._end = end;\n }\n\n get type(): string {\n return this._type;\n }\n\n get id(): string {\n switch (this.type) {\n case \"date\":\n return \"Constraint.DateRange.Mandatory\";\n case \"time\":\n return \"Constraint.TimeRange.Mandatory\";\n case \"datetime\":\n return \"Constraint.DateTimeRange.Mandatory\";\n case \"timestamp\":\n return \"Constraint.TimeStampRange.Mandatory\";\n default:\n return \"Constraint.Range.Mandatory\";\n }\n }\n\n hasValidation() {\n return true;\n }\n\n get defaultMessage(): string {\n return \"Field is mandatory: must contain at least a start or end value\";\n }\n\n get parameters() {\n return {};\n }\n\n validate() {\n // only validate when no children are in error\n if (this._start.hasErrors() || (this._end?.hasErrors() ?? false)) {\n return true;\n }\n\n return this._start.hasValue() || (this._end?.hasValue() ?? false);\n }\n\n get isMandatoryConstraint() {\n return true;\n }\n}\n","import {\n DateTimeUtil,\n DateUtil,\n TimestampUtil,\n TimeUtil,\n} from \"../../../utils/datetime/DateTimeUtil\";\nimport { NumberUtil } from \"../../../utils/number/NumberUtil\";\n\nimport type {\n AttributeModel,\n ConstraintModel,\n MaybeAttributeValue,\n} from \"../types\";\n\nexport class RangeConstraint implements ConstraintModel {\n private _start: AttributeModel;\n private _end: AttributeModel;\n\n constructor(startAttribute: AttributeModel, endAttribute: AttributeModel) {\n this._start = startAttribute;\n this._end = endAttribute;\n }\n\n get id(): string {\n const id = this.hasInclusiveBounds\n ? \"InvalidRangeInclusive\"\n : \"InvalidRange\";\n\n switch (this.rangeType) {\n case \"time\":\n return `Constraint.TimeRange.${id}`;\n case \"date\":\n return `Constraint.DateRange.${id}`;\n case \"datetime\":\n return `Constraint.DateTimeRange.${id}`;\n case \"timestamp\":\n return `Constraint.TimeStampRange.${id}`;\n default:\n return `Constraint.NumberRange.${id}`;\n }\n }\n\n get defaultMessage(): string {\n const inclusivePart = this.hasInclusiveBounds ? \" or equal to the\" : \"\";\n\n switch (this.rangeType) {\n case \"time\":\n return `Start time must be before${inclusivePart} end time`;\n case \"date\":\n return `Start date must be before${inclusivePart} end date`;\n case \"datetime\":\n return `Start value must be before${inclusivePart} end value`;\n case \"timestamp\":\n return `Start value must be before${inclusivePart} end value`;\n default:\n return `Start value must be less than${inclusivePart} the end value`;\n }\n }\n\n hasValidation() {\n return true;\n }\n\n get parameters() {\n return {};\n }\n\n get start() {\n return this._start;\n }\n\n get end() {\n return this._end;\n }\n\n get rangeType(): string {\n return this.start.type;\n }\n\n get hasInclusiveBounds() {\n return (\n this.start.operator === \"greaterThanOrEqualTo\" &&\n this.end.operator === \"lessThanOrEqualTo\"\n );\n }\n\n getDateTimeUtil() {\n switch (this.rangeType) {\n case \"time\":\n return TimeUtil;\n case \"date\":\n return DateUtil;\n case \"timestamp\":\n return TimestampUtil;\n default:\n return DateTimeUtil;\n }\n }\n\n doValidate(startValue: MaybeAttributeValue, endValue: MaybeAttributeValue) {\n if (typeof startValue === \"number\" && typeof endValue === \"number\") {\n return this.hasInclusiveBounds\n ? NumberUtil.isSameOrBefore(startValue, endValue)\n : NumberUtil.isBefore(startValue, endValue);\n } else if (typeof startValue === \"string\" && typeof endValue === \"string\") {\n return this.hasInclusiveBounds\n ? this.getDateTimeUtil().isSameOrBefore(startValue, endValue)\n : this.getDateTimeUtil().isBefore(startValue, endValue);\n }\n\n return false;\n }\n\n validate() {\n // only validate range when both attributes are valid\n if (this.start.inError() || this.end.inError()) {\n return true;\n }\n\n return this.doValidate(this.start.value, this.end.value);\n }\n\n get isMandatoryConstraint() {\n return false;\n }\n}\n","import { ATTRIBUTE_WIDTH } from \"../../constants/Constants\";\nimport { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport { AttributeFactory } from \"./AttributeFactory\";\nimport { BaseAttributeModel } from \"./BaseAttributeModel\";\nimport { ATTRIBUTE_TYPE } from \"./constants\";\nimport { ConstraintCollection } from \"./input-constraints/ConstraintCollection\";\nimport { MandatoryRangeConstraint } from \"./input-constraints/MandatoryRangeConstraint\";\nimport { RangeConstraint } from \"./input-constraints/RangeConstraint\";\n\nimport type { ContentConfiguration } from \"../contentconfiguration/ContentConfiguration\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelOptions, ModelWithChildModels } from \"../types\";\nimport type { DatetimeAttributeModel } from \"./DatetimeAttributeModel\";\nimport type { NumberAttributeModel } from \"./NumberAttributeModel\";\nimport type {\n AttributeContributions,\n AttributeData,\n AttributeModel,\n MaybeAttributeValue,\n RangeAttributeContributions,\n} from \"./types\";\n\ntype RangeChild = DatetimeAttributeModel | NumberAttributeModel;\n\nexport class RangeAttributeModel<\n C extends RangeAttributeContributions = RangeAttributeContributions,\n> extends BaseAttributeModel<RangeAttributeContributions> {\n private _startAttribute: RangeChild;\n private _endAttribute: RangeChild;\n\n constructor(\n data?: AttributeData,\n contributions?: C,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n if (!Array.isArray(contributions?.children)) {\n throw new Error(\n `Problem reading contributions of range attribute: ${this.key}, the children property must be an array.`,\n );\n }\n\n this._startAttribute = this.createChild(0);\n this._endAttribute = this.createChild(1);\n\n this.setChildrenOptionality();\n }\n\n get start() {\n return this._startAttribute;\n }\n\n get end() {\n return this._endAttribute;\n }\n\n override get type() {\n return ATTRIBUTE_TYPE.RANGE;\n }\n\n static override isApplicableModel(contributions: AttributeContributions) {\n return contributions.type.includes(\"range\");\n }\n\n override getInitialChildModelLinks() {\n return [\n ...this.start.getInitialChildModelLinks(),\n ...this.end.getInitialChildModelLinks(),\n ];\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n errors: ErrorResponse[],\n ) {\n this.start.setChildModels(models, errors);\n this.end.setChildModels(models, errors);\n }\n\n /**\n * Get input value of attribute\n */\n override getInputValue() {\n return [this.start.getInputValue(), this.end.getInputValue()].join(\",\");\n }\n\n /**\n * Check if at least one child has value\n */\n override hasValue(): boolean {\n return this.start.hasValue() || this.end.hasValue();\n }\n\n override get constraintCollection() {\n const constraints = new ConstraintCollection();\n\n constraints.add(this.getServerConstraints());\n constraints.add(this.addConstraints());\n\n return constraints;\n }\n\n /**\n * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION\n */\n override setUseClientsideValidation(enabled: boolean) {\n super.setUseClientsideValidation(enabled);\n\n this.start.setUseClientsideValidation(enabled);\n this.end.setUseClientsideValidation(enabled);\n }\n\n /**\n * Validate input\n */\n override validate(value: MaybeAttributeValue) {\n // when client side validation is disabled, this attribute is always valid\n if (!this.useClientsideValidation()) {\n return true;\n }\n\n this._isValid = this.start.isValid && this.end.isValid;\n\n if (this._isValid) {\n this._isValid = this.constraintCollection.validate(value);\n }\n\n return this._isValid;\n }\n\n /**\n * Add Date constraints for attribute\n */\n override addConstraints() {\n const constraints = new ConstraintCollection();\n\n if (this.start.hasValue() && this.end.hasValue()) {\n constraints.add(new RangeConstraint(this.start, this.end));\n }\n if (this.mandatory) {\n if (!this.start.mandatory && !this.end.mandatory) {\n constraints.add(\n new MandatoryRangeConstraint(this.start.type, this.start, this.end),\n );\n }\n }\n\n return constraints;\n }\n\n /**\n * Indicates if attribute input is valid\n */\n override get isValid() {\n return this.validate(\"\");\n }\n\n override hasServerErrors(): boolean {\n return (\n this.errorCollection.serverErrors.length > 0 ||\n this.start.hasServerErrors() ||\n this.end.hasServerErrors()\n );\n }\n\n override hasErrors(): boolean {\n return (\n this.errorCollection.hasItems() ||\n this.start.hasErrors() ||\n this.end.hasErrors()\n );\n }\n\n /**\n * Reset attribute to empty string\n */\n override reset() {\n this.start.reset();\n this.end.reset();\n }\n\n override mergeAttribute(oldAttribute: AttributeModel) {\n this.concept = oldAttribute.concept;\n\n if (oldAttribute instanceof RangeAttributeModel) {\n this.start.mergeAttribute(oldAttribute.start);\n this.end.mergeAttribute(oldAttribute.end);\n }\n }\n\n override update(\n value: MaybeAttributeValue,\n changedAttribute?: AttributeModel,\n ) {\n if (!changedAttribute) {\n throw new IllegalArgumentException(\n \"Range attribute needs changed attribute on update call\",\n );\n }\n\n this.updateLastModification();\n\n if (this.start.equals(changedAttribute)) {\n this.start.update(value);\n }\n if (this.end.equals(changedAttribute)) {\n this.end.update(value);\n }\n\n this.setChildrenOptionality();\n\n this.validate(value as string);\n\n return this;\n }\n\n override updateByAttribute(otherAttribute: AttributeModel) {\n if (otherAttribute instanceof RangeAttributeModel) {\n this.start.updateByAttribute(otherAttribute.start);\n this.end.updateByAttribute(otherAttribute.end);\n } else {\n console.error(\n `update of range attribute with ${otherAttribute.type} not supported`,\n );\n }\n }\n\n override get readonly() {\n return super.readonly ?? (this.start.readonly && this.end.readonly);\n }\n\n override set readonly(readonly: boolean) {\n super.readonly = readonly;\n }\n\n override get readonlyvalue() {\n const value = [];\n if (this.start.value !== null) {\n value.push(this.start.value);\n }\n if (this.end.value !== null) {\n value.push(this.end.value);\n }\n return value.join(\", \");\n }\n\n get initvalue() {\n return {\n [this.start.key]: this.start.initvalue,\n [this.end.key]: this.end.initvalue,\n };\n }\n\n override getFormData() {\n return { [this.name]: this.value };\n }\n\n override getValue(): MaybeAttributeValue {\n return {\n ...this.start.formdata,\n ...this.end.formdata,\n };\n }\n\n override get isResult() {\n return this._isResult;\n }\n\n override set isResult(isResult: boolean) {\n this._isResult = isResult;\n\n this.start.isResult = isResult;\n this.end.isResult = isResult;\n }\n\n override indicateContentConfiguration(\n contentConfiguration: ContentConfiguration,\n ) {\n if (contentConfiguration) {\n this.start.indicateContentConfiguration(contentConfiguration);\n this.end.indicateContentConfiguration(contentConfiguration);\n }\n }\n\n override equals(otherAttribute: AttributeModel): boolean {\n return (\n (this.key === otherAttribute.key &&\n this.parentKey === otherAttribute.parentKey) ||\n this.start.equals(otherAttribute) ||\n this.end.equals(otherAttribute)\n );\n }\n\n override get readonlyWidth(): ATTRIBUTE_WIDTH {\n switch (this.start.type) {\n case \"datetime\":\n return ATTRIBUTE_WIDTH.LARGE;\n case \"timestamp\":\n return ATTRIBUTE_WIDTH.EXTRA_LARGE;\n default:\n return ATTRIBUTE_WIDTH.MEDIUM;\n }\n }\n\n private createChild(index: number) {\n let data = this.data.children?.[index];\n if (Array.isArray(data)) {\n data = undefined;\n }\n\n const childContributions = this.contributions.children[index];\n\n const [key] = Object.keys(childContributions);\n const contributions = childContributions[key];\n\n const attribute = AttributeFactory.createAttribute<RangeChild>(\n key,\n data ?? {},\n contributions,\n this.modelOptions,\n );\n\n if (attribute && data && \"key\" in data) {\n attribute.parentKey = data.key;\n }\n\n return attribute;\n }\n\n private setChildrenOptionality() {\n const childrenAreOptional =\n !this.mandatory && this.start.value === null && this.end.value === null;\n\n if (this.start) {\n this.start.mandatory =\n childrenAreOptional || this.start.configuredMandatory\n ? false\n : this.start.configuredMandatory;\n }\n if (this.end) {\n this.end.mandatory =\n childrenAreOptional || this.end.configuredMandatory\n ? false\n : this.end.configuredMandatory;\n }\n }\n}\n","import { PARAMETER_SEPARATOR } from \"../../constants/Constants\";\nimport { AttributeFactory } from \"../attributes/AttributeFactory\";\nimport { ATTRIBUTE_TYPE, FILTER_TYPE } from \"../attributes/constants\";\nimport { BaseModel } from \"../base/BaseModel\";\n\nimport type {\n AttributeContributions,\n AttributeModel,\n MaybeAttributeValue,\n} from \"../attributes/types\";\nimport type { GroupingContributions } from \"../list/types\";\nimport type { ModelOptions } from \"../types\";\nimport type { FilterContribution, FilterData, FilterModel } from \"./types\";\n\nexport class BaseFilterModel<\n A extends AttributeModel = AttributeModel,\n D extends FilterData = FilterData,\n C extends FilterContribution = FilterContribution,\n >\n extends BaseModel<D, C>\n implements FilterModel\n{\n private _attribute: A | undefined;\n private _context: GroupingContributions | undefined;\n private _listKey: string | undefined;\n\n constructor(data?: D, contributions?: C, modelOptions?: ModelOptions) {\n super(data, contributions, modelOptions);\n\n this._attribute = this.createAttribute(\n this.type,\n this.param || \"\",\n this.data,\n this.contributions,\n );\n\n this._listKey = this.getContributionAsString(\"listKey\");\n }\n\n get attribute() {\n return this._attribute;\n }\n\n get type() {\n const type = this.getContributionAsString(\"type\", \"string\");\n return type.replace(\"filter\", \"\") as FILTER_TYPE;\n }\n\n /**\n * Getting the name of the filter\n */\n get name() {\n if (this.listkey) {\n return this.listkey + PARAMETER_SEPARATOR + this.param;\n }\n return this.param;\n }\n\n get param() {\n return this.getDataAsString(\"param\") ?? this.getDataAsString(\"name\", \"\");\n }\n\n /**\n * Inidiates if filter is multiplechoice\n */\n get isMultiple() {\n return this.getContributionAsBoolean(\"multiplechoice\", false);\n }\n\n /**\n * Getting context information\n */\n get context() {\n return this._context;\n }\n\n /**\n * Set context of filter\n */\n set context(context) {\n this._context = context;\n }\n\n setContext(context: GroupingContributions) {\n this.context = context;\n }\n\n /**\n * Getting the context label\n */\n get contextLabel() {\n return this.context?.label ?? \"\";\n }\n\n /**\n * Getting key of the list these filters apply to\n */\n get listkey() {\n return this._listKey;\n }\n\n /**\n * Set key of list this filter belongs to\n */\n set listkey(key) {\n this._listKey = key;\n }\n\n /**\n * Getting the label of the filter\n */\n get label() {\n return this.getContributionAsString(\"label\", \"\");\n }\n\n /**\n * Retrieve the parameters with it's value for this filter\n */\n get params() {\n if (!this.param) {\n return [];\n }\n\n return [\n {\n name: this.param,\n value: this.attribute?.value,\n },\n ];\n }\n\n /**\n * Getting the value of the filter\n */\n get value() {\n return this.attribute?.value;\n }\n\n /**\n * Getting the inputvalue of the filter\n */\n get inputvalue() {\n return this.attribute?.inputvalue ?? \"\";\n }\n\n private getAttributeType(type: FILTER_TYPE) {\n switch (type) {\n case FILTER_TYPE.CHOICE:\n return ATTRIBUTE_TYPE.CHOICE;\n case FILTER_TYPE.DATE:\n return ATTRIBUTE_TYPE.DATE;\n case FILTER_TYPE.DATETIME:\n return ATTRIBUTE_TYPE.DATETIME;\n case FILTER_TYPE.DATERANGE:\n case FILTER_TYPE.DATETIMERANGE:\n return ATTRIBUTE_TYPE.RANGE;\n case FILTER_TYPE.NUMBER:\n case FILTER_TYPE.NUMBERRANGE:\n return ATTRIBUTE_TYPE.RANGE;\n default:\n return ATTRIBUTE_TYPE.STRING;\n }\n }\n\n private getChildType(type: FILTER_TYPE) {\n switch (type) {\n case FILTER_TYPE.DATERANGE:\n return ATTRIBUTE_TYPE.DATE;\n case FILTER_TYPE.DATETIMERANGE:\n return ATTRIBUTE_TYPE.DATETIME;\n case FILTER_TYPE.NUMBERRANGE:\n return ATTRIBUTE_TYPE.NUMBER;\n default:\n return ATTRIBUTE_TYPE.STRING;\n }\n }\n\n createAttribute<AD extends FilterData = D, AC extends FilterContribution = C>(\n type: FILTER_TYPE,\n param: string,\n data: AD,\n contributions: AC,\n ) {\n if (type === FILTER_TYPE.ASSIGNMENT) {\n return undefined;\n }\n\n const attributeType: ATTRIBUTE_TYPE = this.getAttributeType(type);\n\n const attributeContributions: AC = {\n ...contributions,\n type: attributeType,\n };\n if (\n attributeType === ATTRIBUTE_TYPE.RANGE &&\n \"children\" in attributeContributions &&\n Array.isArray(attributeContributions.children)\n ) {\n const childType: ATTRIBUTE_TYPE = this.getChildType(type);\n attributeContributions.children = attributeContributions.children.map(\n (child) => {\n const key = Object.keys(child)[0];\n return {\n [key]: {\n ...child[key],\n type: childType,\n },\n };\n },\n );\n }\n\n return AttributeFactory.createAttribute<A>(\n param,\n data,\n attributeContributions as unknown as AttributeContributions,\n this.modelOptions,\n );\n }\n\n /**\n * Reset the value of this filter to undefined\n */\n reset() {\n this.attribute?.reset();\n return this;\n }\n\n /**\n * Update this filter with input name and value\n */\n update(_attribute: AttributeModel | undefined, value: MaybeAttributeValue) {\n this.attribute?.update(value);\n }\n\n /**\n * Inidicates if filter is a quick search filter\n */\n isQuickSearch() {\n return this.getContributionAsBoolean(\"quicksearch\", false);\n }\n\n /**\n * Inidiates if filter is active\n */\n isActive() {\n return this.attribute?.initvalue != null;\n }\n\n /**\n * Inidiates if filter is valid\n */\n get isValid() {\n return this.attribute?.isValid ?? false;\n }\n\n get readonlyvalue() {\n return this.attribute?.readonlyvalue ?? \"\";\n }\n\n /**\n * Get assistant message\n */\n get assistantMessage() {\n return this.getContributionAsString(\"assistant\");\n }\n}\n","import { IllegalStateException } from \"../../exceptions/IllegalStateException\";\nimport { FILTER_TYPE, OPTION_MODE } from \"../attributes/constants\";\nimport { BaseFilterModel } from \"./BaseFilterModel\";\n\nimport type { AttributeModel, NamedDynamicSchema } from \"../attributes/types\";\nimport type { ModelOptions } from \"../types\";\nimport type {\n AssignmentFilterContribution,\n AssignmentFilterData,\n ChoiceFilterContribution,\n ChoiceFilterData,\n} from \"./types\";\n\n/**\n * Assignment filter consists of two filters: assignment type and user filter\n */\nexport class AssignmentFilterModel extends BaseFilterModel<\n AttributeModel,\n AssignmentFilterData,\n AssignmentFilterContribution\n> {\n private _assignmenttype: AttributeModel;\n private _user: AttributeModel;\n\n constructor(\n data?: AssignmentFilterData,\n contributions?: AssignmentFilterContribution,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n this._assignmenttype = this.createAssignmentTypeModel();\n this._user = this.createUserModel();\n }\n\n get key() {\n return this.getDataAsString(\"name\", \"\");\n }\n\n get contextid() {\n return this.getContributionAsString(\"contextid\", \"\");\n }\n\n /**\n * Creates an assignmenttype model when assignmenttype json is present\n */\n createAssignmentTypeModel() {\n const key = `${this.contextid}ASSIGNMENTTYPE`;\n const assignmentTypeData = this.data[key] as ChoiceFilterData;\n\n if (typeof assignmentTypeData === \"undefined\") {\n throw new IllegalStateException(\n `Missing assignment type data for ${key}`,\n );\n }\n const dynamicschema = this.data.dynamicschema as NamedDynamicSchema;\n if (dynamicschema) {\n assignmentTypeData.dynamicschema = {\n [key]: dynamicschema[key],\n };\n }\n\n const contributionsByKey = this.contributions[\n key\n ] as ChoiceFilterContribution;\n const assignmentTypeContributions = {\n ...contributionsByKey,\n enumerated: true,\n optionMode: assignmentTypeData._links\n ? OPTION_MODE.LOOKUP\n : OPTION_MODE.STATIC,\n };\n\n const param = assignmentTypeData.name || assignmentTypeData.param;\n\n return this.createAttribute(\n FILTER_TYPE.CHOICE,\n param,\n assignmentTypeData,\n assignmentTypeContributions,\n ) as AttributeModel;\n }\n\n /**\n * Creates an assignmenttype model when userkey json is present\n */\n createUserModel() {\n const key = `${this.contextid}USERKEY`;\n const userData = this.data[key] as ChoiceFilterData;\n\n const dynamicschema = this.data.dynamicschema as NamedDynamicSchema;\n if (dynamicschema && dynamicschema[key]) {\n userData.dynamicschema = {\n [key]: dynamicschema[key],\n };\n }\n const contributionsByKey = this.contributions[\n key\n ] as ChoiceFilterContribution;\n const userContributions = {\n ...contributionsByKey,\n optionMode: userData._links ? OPTION_MODE.LOOKUP : OPTION_MODE.STATIC,\n };\n\n const param = userData.name || userData.param;\n\n return this.createAttribute(\n FILTER_TYPE.CHOICE,\n param,\n userData,\n userContributions,\n ) as AttributeModel;\n }\n\n /**\n * The assignment filter consists of two part. This method return the assignment type attribute\n */\n get assignmenttype() {\n return this._assignmenttype;\n }\n\n /**\n * The assignment filter consists of two part. This method return the user identifier attribute\n */\n get user() {\n return this._user;\n }\n\n /**\n * Getting the parameters of this filter\n */\n override get params(): { name: string; value: string }[] {\n if (this.assignmenttype && this.user) {\n return [\n {\n name: this.assignmenttype.name,\n value: this.assignmenttype.value as string,\n },\n {\n name: this.user.name,\n value: this.user.value as string,\n },\n ];\n }\n\n return [];\n }\n\n /**\n * Reset the values within the filter\n */\n override reset() {\n if (this.assignmenttype) {\n this.assignmenttype.reset();\n }\n if (this.user) {\n this.user.reset();\n }\n\n return this;\n }\n\n /**\n * Update this filter\n */\n override update(attribute: AttributeModel, value: string) {\n if (this.user != null && this.user.key === attribute.key) {\n this.user.update(value);\n } else if (\n this.assignmenttype != null &&\n this.assignmenttype.key === attribute.key\n ) {\n this.assignmenttype.update(value);\n }\n }\n\n /**\n * Inidiates if filter is active\n */\n override isActive() {\n return (\n (this.assignmenttype != null && this.assignmenttype.initvalue !== null) ||\n (this.user != null && this.user.initvalue !== null)\n );\n }\n\n /**\n * Inidiates if filter is valid\n */\n override get isValid() {\n return (\n this.assignmenttype != null &&\n this.assignmenttype.isValid &&\n this.user != null &&\n this.user.isValid\n );\n }\n}\n","import { BaseFilterModel } from \"./BaseFilterModel\";\n\nimport type { ChoiceAttributeModel } from \"../attributes/ChoiceAttributeModel\";\nimport type { ModelOptions } from \"../types\";\nimport type { ChoiceFilterData, FilterContribution } from \"./types\";\n\n/**\n * The concept index model is a special filter used to index all first concept label letters in de modelcatalog.\n */\nexport class ConceptIndexFilterModel extends BaseFilterModel<\n ChoiceAttributeModel,\n ChoiceFilterData\n> {\n constructor(\n data: ChoiceFilterData,\n contributions: FilterContribution,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n if (\n data &&\n \"options\" in data &&\n data.options &&\n Array.isArray(data.options)\n ) {\n const selectedValues = data.options\n .filter((option) => option.selected)\n .map((option) => option.key);\n\n data.options.forEach((option) => {\n this.attribute?.options.addOption(selectedValues, {\n code: option.key,\n label: option.key,\n });\n });\n }\n }\n}\n","import { RangeAttributeModel } from \"../attributes/RangeAttributeModel\";\nimport { BaseFilterModel } from \"./BaseFilterModel\";\n\nimport type { AttributeModel } from \"../attributes/types\";\n\n/**\n * Range filter, for instance a date range filter or a number range filter\n */\nexport class RangeFilterModel extends BaseFilterModel<RangeAttributeModel> {\n override update(attribute: AttributeModel | undefined, value: string) {\n if (this.attribute instanceof RangeAttributeModel) {\n this.attribute.update(value, attribute);\n } else {\n super.update(attribute, value);\n }\n }\n\n override get params() {\n if (this.attribute) {\n return [\n { name: this.attribute.start.name, value: this.attribute.start.value },\n { name: this.attribute.end.name, value: this.attribute.end.value },\n ];\n }\n return [];\n }\n}\n","import { BaseFilterModel } from \"./BaseFilterModel\";\n\nimport type { StringAttributeModel } from \"../attributes/StringAttributeModel\";\nimport type { AttributeValue, MaybeAttributeValue } from \"../attributes/types\";\nimport type { ModelOptions } from \"../types\";\nimport type { StringFilterContributions, StringFilterData } from \"./types\";\n\n/**\n * StringFilterModel can handle string filters with multiple setting\n */\nexport class StringFilterModel extends BaseFilterModel<\n StringAttributeModel,\n StringFilterData,\n StringFilterContributions\n> {\n private _isValid = true;\n private _value: MaybeAttributeValue;\n private _inputvalue: AttributeValue;\n\n constructor(\n data: StringFilterData,\n contributions: StringFilterContributions,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n if (this.attribute) {\n const value = this.getDataAsString(\"value\", \"\");\n this.update(this.attribute, value);\n }\n\n // when formatted value set, make input value the initial input value\n this._inputvalue = this._value ?? \"\";\n }\n\n /**\n * Retrieve the parameters with its value for this filter\n */\n override get params() {\n if (!this.param) {\n return [];\n }\n\n return [\n {\n name: this.param,\n value: this.removeFormat(this.value ?? \"\"),\n },\n ];\n }\n\n /**\n * Getting the value of the filter\n */\n override get value() {\n return this._value;\n }\n\n override get inputvalue() {\n return this._inputvalue;\n }\n\n /**\n * Reset the value of this filter to undefined\n */\n override reset() {\n this._inputvalue = \"\";\n this._value = undefined;\n\n return this;\n }\n\n override get isValid() {\n return this._isValid;\n }\n\n /**\n * Update this filter with input name and value\n */\n override update(\n _attribute: StringAttributeModel | undefined,\n value: MaybeAttributeValue,\n ) {\n this._isValid = true;\n this._inputvalue = typeof value !== \"string\" ? String(value) : value;\n\n if (this.shouldHandleFormat()) {\n const values = this.isMultiple\n ? this._inputvalue.split(\",\").map((val) => val.trim())\n : [this._inputvalue.trim()];\n\n const outputValues = [];\n for (const val of values) {\n const formattedValue = this.formatValue(val);\n if (formattedValue !== \"\") {\n outputValues.push(formattedValue);\n\n if (!this.attribute?.validate(formattedValue)) {\n this._isValid = false;\n }\n }\n }\n\n this._value = outputValues.join(\",\");\n } else {\n this._value = value;\n }\n }\n\n get operator() {\n return this.getContributionAsString(\"operator\", \"\");\n }\n\n formatValue(value: string) {\n if (this.shouldHandleFormat()) {\n return this.attribute?.formatValue(value) || \"\";\n }\n return value;\n }\n\n isBSN() {\n return this.layouthint.has(\"bsn\");\n }\n\n isIBAN() {\n return this.layouthint.has(\"iban\");\n }\n\n isZipcode() {\n return this.layouthint.has(\"zipcode\");\n }\n\n removeFormat(value: MaybeAttributeValue) {\n if (value == null || value.toString() === \"\") {\n return \"\";\n }\n\n if (typeof value === \"string\" && this.shouldHandleFormat()) {\n return value.replace(/[^a-z0-9,]/gi, \"\");\n }\n\n return value;\n }\n\n shouldHandleFormat() {\n return (\n (this.operator === \"exactly\" || this.operator === \"isNot\") &&\n (this.isIBAN() || this.isZipcode() || this.isBSN())\n );\n }\n}\n","import { AssignmentFilterModel } from \"./AssignmentFilterModel\";\nimport { BaseFilterModel } from \"./BaseFilterModel\";\nimport { ConceptIndexFilterModel } from \"./ConceptIndexFilterModel\";\nimport { RangeFilterModel } from \"./RangeFilterModel\";\nimport { StringFilterModel } from \"./StringFilterModel\";\n\nimport type { ModelOptions } from \"../types\";\nimport type {\n AssignmentFilterContribution,\n AssignmentFilterData,\n ChoiceFilterData,\n ContributionsForFilterCollection,\n FilterContribution,\n FilterData,\n FilterModel,\n StringFilterContributions,\n StringFilterData,\n} from \"./types\";\n\nexport class FilterFactory {\n static createFilter(\n filterKey: string,\n data: FilterData,\n contributions: FilterContribution,\n modelOptions: ModelOptions,\n ) {\n const type = contributions.type ?? \"stringfilter\";\n if (type === \"choicefilter\" && filterKey === \"index\") {\n return new ConceptIndexFilterModel(\n data as ChoiceFilterData,\n contributions,\n modelOptions,\n );\n }\n\n if (type.includes(\"rangefilter\")) {\n return new RangeFilterModel(data, contributions, modelOptions);\n }\n\n if (type === \"assignmentfilter\") {\n return new AssignmentFilterModel(\n data as AssignmentFilterData,\n contributions as AssignmentFilterContribution,\n modelOptions,\n );\n }\n\n if (type === \"stringfilter\") {\n return new StringFilterModel(\n data as StringFilterData,\n contributions as StringFilterContributions,\n modelOptions,\n );\n }\n\n return new BaseFilterModel(data, contributions, modelOptions);\n }\n\n static setListKey(\n filter: FilterModel,\n contributions: ContributionsForFilterCollection,\n ) {\n if (\n \"listkey\" in contributions &&\n typeof contributions.listkey === \"string\"\n ) {\n filter.listkey = contributions.listkey;\n }\n }\n\n static setFilterContext(\n filter: FilterModel,\n contextId: string,\n contributions: ContributionsForFilterCollection,\n ) {\n if (contributions.contexts) {\n const filterContext = contributions.contexts.find(\n (context) => context.id === contextId,\n );\n if (filterContext) {\n filter.setContext(filterContext);\n }\n }\n }\n}\n","import { RangeAttributeModel } from \"../attributes/RangeAttributeModel\";\nimport { BaseCollection } from \"../base/BaseCollection\";\nimport { AssignmentFilterModel } from \"./AssignmentFilterModel\";\nimport { FilterFactory } from \"./FilterFactory\";\nimport { RangeFilterModel } from \"./RangeFilterModel\";\n\nimport type { AttributeModel, MaybeAttributeValue } from \"../attributes/types\";\nimport type { ModelOptions } from \"../types\";\nimport type {\n ContributionsForFilterCollection,\n FilterCollectionData,\n FilterModel,\n} from \"./types\";\n\n/**\n * Contains a collection of filters\n */\nexport class FilterCollection extends BaseCollection<FilterModel> {\n constructor(\n data: FilterCollectionData = {},\n contributions?: ContributionsForFilterCollection,\n modelOptions?: ModelOptions,\n ) {\n super();\n\n this.collection = this.createCollection(data, contributions, modelOptions);\n }\n\n private createCollection(\n data: FilterCollectionData,\n contributions?: ContributionsForFilterCollection,\n modelOptions?: ModelOptions,\n ) {\n const collection = [];\n\n if (\n contributions &&\n \"filter\" in contributions &&\n Array.isArray(contributions.filter)\n ) {\n for (const filterContribution of contributions.filter) {\n const [filterKey] = Object.keys(filterContribution);\n\n const filterDataByKey = data[filterKey];\n const filterContributionByKey = filterContribution[filterKey];\n\n const filter = FilterFactory.createFilter(\n filterKey,\n filterDataByKey,\n filterContributionByKey,\n {\n origin: modelOptions?.origin,\n contextPath: modelOptions?.contextPath,\n },\n );\n\n FilterFactory.setListKey(filter, contributions);\n\n if (filterContributionByKey.contextid) {\n FilterFactory.setFilterContext(\n filter,\n filterContributionByKey.contextid,\n contributions,\n );\n }\n\n collection.push(filter);\n }\n }\n\n return collection;\n }\n\n /**\n * Call the reset function on all filters\n */\n reset() {\n this.collection = this.collection.map((filter) => filter.reset());\n\n return this;\n }\n\n /**\n * Checks if range attribute key equals key\n */\n checkRangeFilterByAttributeKey(filter: RangeFilterModel, key: string) {\n const rangeAttribute = filter.attribute;\n\n if (rangeAttribute instanceof RangeAttributeModel) {\n const start = rangeAttribute.start as AttributeModel;\n const end = rangeAttribute.end as AttributeModel;\n\n return (\n rangeAttribute.key === key || start?.name === key || end?.name === key\n );\n }\n\n return false;\n }\n\n /**\n * Check if assignment filter attribute matches key\n */\n checkAssignmentFilterByAttributeKey(\n filter: AssignmentFilterModel,\n key: string,\n ) {\n return (\n filter.key === key ||\n filter.user?.key === key ||\n filter.assignmenttype?.key === key\n );\n }\n\n /**\n * Getting the filter by name\n */\n getFilterByAttributeKey(key: string) {\n return this.find((filter) => {\n if (filter instanceof RangeFilterModel) {\n return this.checkRangeFilterByAttributeKey(filter, key);\n }\n\n if (filter instanceof AssignmentFilterModel) {\n return this.checkAssignmentFilterByAttributeKey(filter, key);\n }\n\n return filter.attribute?.key === key;\n });\n }\n\n /**\n * Update Filter by input name and value\n */\n update(attribute: AttributeModel, value: MaybeAttributeValue) {\n const filterToUpdate = attribute.parentKey\n ? this.getFilterByAttributeKey(attribute.parentKey)\n : this.getFilterByAttributeKey(attribute.key);\n\n if (!filterToUpdate) {\n throw new Error(`Can not find filter by attribute key: ${attribute.key}`);\n }\n\n filterToUpdate.update(attribute, value);\n\n this.collection = this.collection.map((filter) => {\n if (filter.name === filterToUpdate.name) {\n return filterToUpdate;\n }\n\n return filter;\n });\n }\n\n /**\n * Retrieve if all filters are valid\n */\n get isValid() {\n return this.collection.every((filter) => filter.isValid);\n }\n\n /**\n * Indicates if an active filter is present in the collection\n */\n hasActiveFilters() {\n return this.collection.some((filter) => filter.isActive());\n }\n}\n","import { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { FilterCollection } from \"../filters/FilterCollection\";\nimport { ContentTypeModel } from \"./ContentTypeModel\";\nimport { SectionModel } from \"./SectionModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ISO_DATE } from \"../../types/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type { ContentDetailContributions, ContentDetailData } from \"./types\";\n\n/**\n * Content detail model, represents one section of a source\n */\nexport class ContentModel extends ResourceModel<\n ContentDetailData,\n ContentDetailContributions\n> {\n private _section: SectionModel;\n private _contentType: ContentTypeModel | undefined;\n private _filterCollection: FilterCollection;\n\n constructor(response: ModularUIResponse) {\n super(response);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n },\n this.modelOptions,\n );\n\n this._section = new SectionModel(\n this.data,\n this.entryDate,\n this.modelOptions,\n );\n }\n\n get type() {\n return \"Content\";\n }\n\n static override get modelName() {\n return \"ContentModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"ContentDetail\";\n }\n\n override getInitialChildModelLinks() {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n _errors: ErrorResponse[],\n ) {\n this.contentType = models.find(\n (model) => model instanceof ContentTypeModel,\n );\n }\n\n get section() {\n return this._section;\n }\n\n get id() {\n return this.data._id;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection() {\n return this._filterCollection;\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate() {\n const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (entryDateFilter && entryDateFilter.attribute) {\n return entryDateFilter.attribute.value as ISO_DATE;\n }\n\n return undefined;\n }\n\n /**\n * Get conceptType of concept\n */\n get contentType() {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ContentTypeModel | undefined) {\n this._contentType = contentType;\n }\n\n /**\n * Get content label\n */\n override get label() {\n return this.section.label;\n }\n\n /**\n * Retrieve number of section\n */\n get number() {\n return this.section.number;\n }\n\n /**\n * Get content body\n */\n get body() {\n return this.section.body;\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks() {\n return this.section.childSectionLinks;\n }\n\n get selfContentLink() {\n return this.section.selfContentLink;\n }\n\n /**\n * Get tree of child sections\n */\n get childSections() {\n return this.section.childSections;\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: SectionModel[]) {\n this.section.childSections = sections || [];\n }\n\n /**\n * Get sub sections\n */\n get subSections() {\n return this.section.subSections;\n }\n\n get relatedConceptsHrefs() {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref() {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n href.setReferenceHash(this.referenceHash);\n return href;\n }\n\n return null;\n }\n\n get referenceHash(): number {\n return this.section.referenceHash;\n }\n}\n","import { immerable } from \"immer\";\n\nimport { getContextPathModularUI } from \"../../settings/Paths\";\nimport { Href } from \"../href/Href\";\nimport { LayoutHintCollection } from \"../layouthint/LayoutHintCollection\";\n\nimport type { FetchException } from \"../../exceptions/FetchException\";\nimport type { ModelOptions } from \"../types\";\nimport type { ModularUIErrorResponse } from \"./types\";\n\n/**\n * Error response model\n */\nexport class ErrorResponse {\n [immerable] = true;\n\n private _originalError: ModularUIErrorResponse | FetchException | Error;\n private _connectKey: string | undefined;\n private _modelOptions: ModelOptions | undefined;\n\n constructor(\n error: ModularUIErrorResponse | FetchException | Error,\n connectKey?: string,\n modelOptions?: ModelOptions,\n ) {\n this._originalError = error;\n this._connectKey = connectKey;\n this._modelOptions = modelOptions;\n }\n\n set connectKey(key: string | undefined) {\n this._connectKey = key;\n }\n\n get connectKey() {\n return this._connectKey;\n }\n\n get origin() {\n return this._modelOptions?.origin || \"\";\n }\n\n get contextPath() {\n return this._modelOptions?.contextPath || getContextPathModularUI();\n }\n\n /**\n * Return error information\n */\n get error() {\n return this._originalError;\n }\n\n /**\n * Get request status code\n */\n get status() {\n const NO_RESPONSE_CODE = 0;\n const DECIMAL_RADIX = 10;\n\n const error = this.error;\n\n if (\"status\" in error) {\n return parseInt(error.status as string, DECIMAL_RADIX);\n }\n\n return NO_RESPONSE_CODE;\n }\n\n /**\n * Return error type information\n */\n get id() {\n if (\n this.isResourceNotFound &&\n \"id\" in this.error &&\n this.error.id !== \"Error.NotAuthorized\"\n ) {\n return \"Error.ResourceNotFound\";\n }\n\n if (\"id\" in this.error && typeof this.error.id === \"string\") {\n return this.error.id;\n }\n\n return this.error.name || \"Error.GeneralError\";\n }\n\n get message() {\n const error = this.error;\n\n if (\"message\" in error) {\n return error.message;\n }\n\n return this.id;\n }\n\n /**\n * Return response error message\n */\n get responseMessage() {\n if (this.response && \"message\" in this.response) {\n return this.response.message;\n }\n\n return \"\";\n }\n\n /**\n * Return response error title\n */\n get title() {\n if (this.response && \"title\" in this.response) {\n return this.response.title;\n }\n\n return { id: \"\" };\n }\n\n /**\n * Return response error title message\n */\n get titleMessage() {\n if (\"title\" in this.error) {\n return this.error.title?.message;\n }\n return undefined;\n }\n\n /**\n * Return response error title Id\n */\n get titleId() {\n return this.response?.title?.id;\n }\n\n /**\n * Return response error title properties\n */\n get titleProperties() {\n return this.response?.title?.properties;\n }\n\n /**\n * Return response error redirect\n */\n get redirect() {\n return this.response?.redirect;\n }\n /**\n * Return response error redirect text\n */\n get redirectText() {\n if (this.redirect && \"text\" in this.redirect) {\n return this.redirect?.text;\n }\n return undefined;\n }\n\n /**\n * Return response error redirect text id\n */\n get redirectTextID() {\n return this.redirectText?.id;\n }\n\n /**\n * Return response error redirect text properties\n */\n get redirectTextProperties() {\n return this.redirectText?.properties;\n }\n\n /**\n * Return response error redirect text message\n */\n get redirectMessage() {\n return this.redirectText?.message;\n }\n\n /**\n * Return response error redirect href\n */\n get redirectHref() {\n if (this.redirect && \"href\" in this.redirect) {\n const redirectHref = this.redirect?.href;\n if (redirectHref) {\n return new Href(redirectHref);\n }\n }\n return undefined;\n }\n\n /**\n * Return error response layouthint\n */\n get layouthint() {\n if (this.response && Array.isArray(this.response.layouthint)) {\n return new LayoutHintCollection(this.response.layouthint);\n }\n return new LayoutHintCollection();\n }\n\n get response() {\n const error = this.error;\n\n if (\"response\" in error && typeof error.response === \"object\") {\n return error.response;\n }\n\n return undefined;\n }\n\n get properties() {\n const error = this.error;\n\n if (\"properties\" in error) {\n return error.properties;\n }\n\n return undefined;\n }\n\n /**\n * Return error parameters\n */\n get parameters() {\n const error = this.error;\n\n if (\"parameters\" in error) {\n return error.parameters;\n }\n\n return undefined;\n }\n\n get isResourceNotFound() {\n const RESOURCE_NOT_FOUND_RESPONSE_CODE = 404;\n\n return this.status === RESOURCE_NOT_FOUND_RESPONSE_CODE;\n }\n\n get isResourceNotFoundAfterReload() {\n const error = this.error;\n\n if (\"isReload\" in error && typeof error.isReload === \"boolean\") {\n return this.isResourceNotFound && error.isReload;\n }\n\n return false;\n }\n\n /**\n * Check if the error message is an authorization error\n */\n get isUnauthorized() {\n const UNAUTHORIZED_RESPONSE_CODE = 401;\n\n const hasUnauthorizedStatus = this.status === UNAUTHORIZED_RESPONSE_CODE;\n const hasUnauthorizedErrorId =\n this.id === \"Error.NotAuthorized\" ||\n this.id === \"Error.Authentication.Required\" ||\n this.id === \"Error.Authentication.InvalidCredentials\";\n\n const error = this.error;\n\n const hasLoginAction =\n \"action\" in error &&\n typeof error.action === \"object\" &&\n error.action !== null &&\n \"name\" in error.action &&\n error.action.name === \"login\";\n\n return hasUnauthorizedStatus || hasUnauthorizedErrorId || hasLoginAction;\n }\n\n get isChangePassword() {\n return this.id === \"Error.ChangePasswordRequired\";\n }\n\n get isConcurrentUser() {\n return this.id === \"Error.Authentication.ConcurrentUser\";\n }\n\n get isConcurrentError() {\n return (\n this.id === \"Error.Case.ConcurrentModification\" ||\n this.id === \"Error.DataStore.ConcurrentModification\" ||\n this.id === \"Error.DataStore.RecordAlreadyExists\" ||\n this.id === \"Error.DataStore.RowCannotBeLocked\"\n );\n }\n\n get isBlocked() {\n return this.id === \"Error.Authentication.BlockedUser\";\n }\n\n get isInvalidCredentials() {\n return this.id === \"Error.Authentication.InvalidCredentials\";\n }\n\n get isInvalidUsername() {\n return this.id === \"Error.Authentication.InvalidUsername\";\n }\n\n get isTimeoutError() {\n return this.id === \"Error.CodemapLookup.InvalidToken\";\n }\n\n /**\n * A RemoteServiceException occurs when an exception occurs connecting to an external system,\n * for example when using the service list panels\n */\n get isRemoteServiceException() {\n return this.id === \"Error.RemoteServiceException\";\n }\n\n /**\n * Get response url\n */\n get changePasswordHref() {\n const properties = this.properties;\n\n if (properties && \"redirect\" in properties) {\n return new Href(properties.redirect as string);\n }\n\n return undefined;\n }\n\n /**\n * When no action information is present in the unauthorized response, for now we assume it is Basic Authentication\n */\n get isBasicAuthentication() {\n const UNAUTHORIZED_RESPONSE_CODE = 401;\n\n const error = this.error;\n\n if (\"error\" in error) {\n return (\n this.isUnauthorized &&\n this.status === UNAUTHORIZED_RESPONSE_CODE &&\n error.error === \"No responseText\"\n );\n }\n\n return false;\n }\n\n /**\n * Retrieve a failed login attempt\n */\n get loginFailed() {\n return (\n this.id === \"Error.Authentication.Required\" ||\n this.id === \"Error.Authentication.InvalidCredentials\"\n );\n }\n\n get shouldThrowOnServer() {\n return !this.isChangePassword && !this.isBlocked && !this.isConcurrentUser;\n }\n}\n","import deepmerge from \"deepmerge\";\nimport { has } from \"lodash\";\nimport flattenDeep from \"lodash/flattenDeep\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\nimport { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport {\n CREATE_ACTION,\n DELETE_ACTION,\n UPDATE_ACTION,\n} from \"../../layouthints/LayoutHints\";\nimport { getBooleanSetting, getSetting } from \"../../settings/Settings\";\nimport { AttributeSetModel } from \"../attributes/AttributeSetModel\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { ErrorCollection, ErrorCollectionType } from \"../error/ErrorCollection\";\nimport { Href } from \"../href/Href\";\nimport { Parameter } from \"../parameter/Parameter\";\nimport { ParameterCollection } from \"../parameter/ParameterCollection\";\nimport { FormObjectModel } from \"./FormObjectModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { Data } from \"../../types/types\";\nimport type {\n AttributeModel,\n AttributeSetContributions,\n NamedDynamicSchema,\n} from \"../attributes/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type {\n AnchorElementData,\n ErrorObjectData,\n FormContributions,\n FormData,\n FormObjectData,\n SuccessData,\n} from \"./types\";\n\nexport class FormModel extends ResourceModel<FormData, FormContributions> {\n private _lastUpdate: number;\n private _completedFormObjects: FormObjectModel[] = [];\n private _currentFormObject: FormObjectModel | null = null;\n private _previouslyEnteredFormObjects: FormObjectModel[] = [];\n\n private _mergePreviouslyEnteredObjects = true;\n\n private _endResultFormObjects: FormObjectModel[] = [];\n private _previousEndResultKeys: string[] = [];\n\n private _useClientsideValidation: boolean = getBooleanSetting(\n \"USE_CLIENTSIDE_VALIDATION\",\n );\n\n private _errorCollection: ErrorCollection = new ErrorCollection(\n ErrorCollectionType.FORM,\n );\n\n private _redirectLocation: Href | undefined;\n\n private _commit = false;\n private _isFinished = false;\n private _isComplete = false;\n private _success: SuccessData | undefined;\n\n private _parameters: ParameterCollection = new ParameterCollection();\n private _tokens: string[] = [];\n\n constructor(modularuiResponse?: ModularUIResponse) {\n super(modularuiResponse);\n\n this._lastUpdate = 0;\n\n this.currentFormObject = this.createFormObject();\n this.endResultFormObjects = this.setEndResultFormObjects();\n\n this.parameters = this.setParameters(modularuiResponse?.parameters);\n\n this.isComplete = this.getDataAsBoolean(\"complete\", false);\n\n if (Array.isArray(this.data.errors)) {\n this.handleRootErrors(this.data.errors);\n }\n\n this.createSuccess();\n\n this.setTokens();\n }\n\n get type() {\n return \"Form\";\n }\n\n get actiontype() {\n if (this.layouthint.has(CREATE_ACTION)) {\n return \"create\";\n }\n if (this.layouthint.has(UPDATE_ACTION)) {\n return \"update\";\n }\n if (this.layouthint.has(DELETE_ACTION)) {\n return \"delete\";\n }\n\n return this.getContributionAsString(\"actiontype\", \"form\");\n }\n\n static override get modelName() {\n return \"FormModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"Form\";\n }\n\n override getInitialChildModelLinks() {\n const endResultChildLinks = flattenDeep(\n this.endResultFormObjects.map((endResultFormObject) =>\n endResultFormObject.getInitialChildModelLinks(),\n ),\n );\n\n if (this.currentFormObject == undefined) {\n return endResultChildLinks;\n }\n\n return [\n ...this.currentFormObject.getInitialChildModelLinks(),\n ...endResultChildLinks,\n ];\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n errors: ErrorResponse[],\n ) {\n if (this.currentFormObject) {\n this.currentFormObject.setChildModels(models, errors);\n }\n\n this.endResultFormObjects.forEach((endResultFormObject) => {\n endResultFormObject.setChildModels(models, errors);\n });\n }\n\n override get label() {\n return this.getContributionAsString(\"label\", \"\");\n }\n\n /**\n * Get form level button labels\n */\n get buttonLabels() {\n return this.getContributionAsObject(\"buttonLabels\", {}) as Record<\n string,\n string\n >;\n }\n\n /**\n * @returns button label from contributions;\n */\n getButtonLabel(buttonType: \"cancel\" | \"previous\" | \"next\" | \"finish\") {\n // cancel button labels are defined on the form\n if (buttonType === \"cancel\" && \"cancel\" in this.buttonLabels) {\n return this.buttonLabels.cancel;\n }\n\n // all other form related button labels are defined on the object\n const formObjectButtonLabels = this.currentFormObject?.buttonLabels;\n if (formObjectButtonLabels && buttonType in formObjectButtonLabels) {\n return formObjectButtonLabels[buttonType];\n }\n\n return undefined;\n }\n\n /**\n * Get all applicable objects\n */\n get allObjects() {\n if (this.currentFormObject == undefined) {\n return this.completedFormObjects;\n }\n\n return [...this.completedFormObjects, this.currentFormObject];\n }\n\n get objectKeys() {\n const formObjects = this.getContributionAsObject(\"objects\", {});\n return Object.keys(formObjects);\n }\n\n get numberOfExpectedQuestions() {\n return this.objectKeys.length;\n }\n\n /**\n * Has questions configured on form\n */\n get hasNoQuestionsConfigured() {\n return (\n this.isComplete &&\n (this.objectKeys.length === 0 ||\n (!(\"missing\" in this.data) &&\n !(\"results\" in this.data) &&\n !(\"errors\" in this.data)))\n );\n }\n\n private addDynamicSchemaToElements(\n elements: AnchorElementData[],\n dynamicschema: NamedDynamicSchema,\n ) {\n return elements?.map((element) => {\n return {\n ...element,\n dynamicschema: element.dynamicschema\n ? element.dynamicschema.map((item) => {\n const dsElements = \"elements\" in item ? item.elements : [];\n if (dsElements.length) {\n return {\n ...item,\n elements: { ...dsElements, dynamicschema },\n };\n }\n return item;\n })\n : undefined,\n };\n });\n }\n\n private getMissingAnchors() {\n const missingAnchors = this.data.missing?.anchors ?? [];\n\n // Add intermediate result data to anchor\n return missingAnchors.map((anchor) => {\n if (this.data.results) {\n const resultObject = this.data.results.find(\n (result) =>\n result.objectid === anchor.objectid && \"elements\" in result,\n );\n\n if (resultObject) {\n anchor.results = resultObject.elements;\n }\n }\n\n if (anchor.elements && this.data.dynamicschema) {\n return {\n ...anchor,\n elements: this.addDynamicSchemaToElements(\n anchor.elements,\n this.data.dynamicschema,\n ),\n };\n }\n\n return anchor;\n });\n }\n\n /**\n * Create form object based on the data and contributions available in this form\n */\n createFormObject() {\n if (this.data && this.contributions.objects) {\n const missingAnchors = this.getMissingAnchors();\n\n if (missingAnchors.length) {\n const firstAnchor = missingAnchors[0];\n // Get object id from first anchor\n const objectId = missingAnchors[0].objectid;\n if (objectId) {\n const objectContributions = this.contributions.objects[objectId];\n if (objectContributions) {\n return new FormObjectModel(\n firstAnchor as FormObjectData,\n objectContributions,\n );\n }\n }\n }\n }\n\n return null;\n }\n\n addEmptyFormObject(\n formObjectModel: FormObjectModel | null = this.currentFormObject,\n ) {\n if (formObjectModel) {\n const emptyFormObject = FormObjectModel.createEmpty(formObjectModel);\n\n emptyFormObject.repeatIndex =\n this.getHighestRepeatIndex(formObjectModel) + 1;\n\n this.addFormObject(emptyFormObject);\n }\n }\n\n getHighestRepeatIndex(formObjectModel: FormObjectModel) {\n return Math.max(\n ...this.allObjects\n .filter((formObject) => formObject.equals(formObjectModel, false))\n .map((formObject) => formObject.repeatIndex),\n );\n }\n\n addFormObject(formObjectModel: FormObjectModel) {\n if (!formObjectModel) {\n throw new IllegalArgumentException(\"Missing form object to add\");\n }\n\n this.completedFormObjects = [...this.allObjects];\n this.currentFormObject = formObjectModel;\n }\n\n /**\n * Retrieve a form object by the key\n */\n getFormObjectByKey(key: string) {\n return this.allObjects.find((formObject) => formObject.key === key);\n }\n\n /**\n * Retrieve a form object by a layouthint\n */\n getFormObjectByLayoutHint(hint: string) {\n return this.allObjects.find((formObject) =>\n formObject.layouthint.has(hint),\n );\n }\n\n removeFormObject(formObjectModel?: FormObjectModel | null) {\n if (!formObjectModel) {\n throw new IllegalArgumentException(\"Missing form object to remove\");\n }\n if (\n this.currentFormObject &&\n this.currentFormObject.equals(formObjectModel)\n ) {\n throw new IllegalArgumentException(\n \"Can not remove the current form object\",\n );\n }\n\n this.completedFormObjects = this.completedFormObjects.filter(\n (formObject) => !formObject.equals(formObjectModel),\n );\n }\n\n get currentFormObject() {\n return this._currentFormObject;\n }\n\n set currentFormObject(formObject: FormObjectModel | null) {\n this._currentFormObject = formObject;\n }\n\n /**\n * Completed objects are previously entered questions\n */\n get completedFormObjects() {\n return this._completedFormObjects;\n }\n\n /**\n */\n set completedFormObjects(formObjects: FormObjectModel[]) {\n this._completedFormObjects = formObjects;\n }\n\n /**\n * Previously entered objects are questions that have been entered before,\n * but are currently not applicable for the form.\n * For example because of previous navigation\n */\n get previouslyEnteredFormObjects() {\n return this._previouslyEnteredFormObjects;\n }\n\n /**\n */\n set previouslyEnteredFormObjects(formObjects: FormObjectModel[]) {\n this._previouslyEnteredFormObjects = formObjects;\n }\n\n /**\n * Handle end results\n */\n setEndResultFormObjects() {\n if (this.data && this.data.results && Array.isArray(this.data.results)) {\n const missingObjects = Array.isArray(this.data.missing?.anchors)\n ? this.data.missing?.anchors\n : [];\n const missingObjectIds = missingObjects.map((anchor) => anchor.objectid);\n\n // Filter out intermediate results and rename elements property to result property\n\n const endResultAnchors = this.data.results\n .filter((result) => !missingObjectIds.includes(result.objectid))\n .map((result) => {\n const { elements, ...otherProps } = result;\n\n return {\n ...otherProps,\n results: elements,\n };\n });\n\n if (endResultAnchors.length > 0) {\n return endResultAnchors\n .map((endResult) => {\n const endResultContribution =\n this.contributions.objects?.[endResult.objectid];\n if (endResultContribution) {\n return new FormObjectModel(endResult, endResultContribution);\n }\n return null;\n })\n .filter((o) => o != null);\n }\n }\n\n return [];\n }\n\n get expectsEndResultFormObjects() {\n const endResultKeys = this.endResultFormObjects.map(\n (endResult) => endResult.key,\n );\n\n return this.objectKeys.some((objectKey) => {\n const formObject = this.contributions.objects?.[objectKey];\n return formObject?.content?.results && !endResultKeys.includes(objectKey);\n });\n }\n\n get endResultFormObjects() {\n return this._endResultFormObjects;\n }\n\n set endResultFormObjects(endResultFormObjects: FormObjectModel[]) {\n this.previousEndResultKeys = this.endResultFormObjects.map(\n (endResult) => endResult.key,\n );\n this._endResultFormObjects = endResultFormObjects;\n }\n\n getEndResultFormObjects() {\n return this.endResultFormObjects.filter(\n (endResult) => !this.previousEndResultKeys.includes(endResult.key),\n );\n }\n\n get previousEndResultKeys() {\n return this._previousEndResultKeys;\n }\n\n set previousEndResultKeys(endResultFormObjectKeys: string[]) {\n this._previousEndResultKeys = endResultFormObjectKeys;\n }\n\n /**\n * Error handling\n */\n get isValid() {\n if (this.currentFormObject) {\n if (this.currentFormObject.isRepeatable) {\n if (!this.currentFormObject.hasFixedNrOfRepeats) {\n // For unknown repeats, initially valid\n return true;\n }\n // repeating objects need at least one valid form object\n const hasOneValidQuestion = this.allObjects\n .filter(\n (object) =>\n this.currentFormObject != null &&\n object.equals(this.currentFormObject, false),\n )\n .find((object) => object.isValid);\n\n if (hasOneValidQuestion) {\n return true;\n }\n }\n\n return this.currentFormObject?.isValid ?? true;\n }\n\n return true;\n }\n\n hasServerErrors() {\n if (this.errorCollection.hasItems()) {\n return true;\n }\n\n if (this.currentFormObject) {\n return this.currentFormObject.hasServerErrors();\n }\n\n return false;\n }\n\n hasErrors() {\n if (this.errorCollection.hasItems()) {\n return true;\n }\n\n if (this.currentFormObject) {\n return this.currentFormObject.hasErrors();\n }\n\n return false;\n }\n\n /**\n * Add an error to the error collection of this form\n */\n addServerError(error: ErrorObjectData | ErrorResponse) {\n this.errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n error.layouthint,\n );\n }\n\n /**\n * Reset error messages\n */\n resetErrors() {\n this._errorCollection.clear();\n\n if (this.currentFormObject) {\n this.currentFormObject.resetErrors();\n }\n }\n\n get errorCollection() {\n return this._errorCollection;\n }\n\n set errorCollection(errorCollection: ErrorCollection) {\n this._errorCollection = errorCollection;\n }\n\n /**\n * Indicates if the form needs to be committed\n */\n get commit() {\n return this._commit || false;\n }\n\n /**\n */\n set commit(commit: boolean) {\n this._commit = commit;\n }\n\n /**\n * Inidicates if form is finished: Form is completely entered and committed\n */\n get isFinished() {\n return this._isFinished || this.success != undefined;\n }\n\n set isFinished(isFinished: boolean) {\n this._isFinished = isFinished;\n }\n\n /**\n * Indicates if form is completely entered\n */\n get isComplete() {\n return this._isComplete;\n }\n\n set isComplete(isComplete: boolean) {\n this._isComplete = isComplete;\n }\n\n /**\n * Handle success redirects\n */\n get successRedirect() {\n return this.isFinished && this.success?.redirect\n ? new Href(this.success.redirect)\n : undefined;\n }\n\n get redirectLocation() {\n return this._redirectLocation || this.successRedirect;\n }\n\n /**\n * Get the result data as plain json object\n */\n getSuccessData() {\n return this.success?.data;\n }\n\n /**\n * Retrieve an object where each property is a result data attribute set\n */\n getResultData() {\n const resultdata: Record<string, AttributeSetModel> = {};\n\n if (this.contributions.resultdata) {\n const resultContributions = this.contributions.resultdata;\n const resultDataKeys = Object.keys(resultContributions);\n const successData = this.getSuccessData();\n\n for (const resultDataKey of resultDataKeys) {\n const d = successData?.[resultDataKey] || {};\n const c =\n resultDataKey in resultContributions\n ? resultContributions[resultDataKey]\n : {};\n\n resultdata[resultDataKey] = new AttributeSetModel(\n resultDataKey,\n d as Data,\n c as AttributeSetContributions,\n );\n }\n }\n\n return resultdata;\n }\n\n get resultData() {\n return this.getSuccessData();\n }\n\n setParameters(parameters: Parameter[] | undefined) {\n const params = parameters\n ? parameters.map((par) => new Parameter(par.prefix, par.name, par.value))\n : [];\n return new ParameterCollection(params);\n }\n\n get parameters() {\n return this._parameters;\n }\n\n set parameters(parameters: ParameterCollection) {\n this._parameters = parameters;\n }\n\n selfhrefNoCommitParam() {\n const filteredParameters = this.parameters.filter(\n (parameter) => parameter.name !== \"commit\",\n );\n\n const selfhref = this.selflink?.href;\n if (selfhref) {\n selfhref.method = HTTP_METHODS.POST;\n selfhref.parameters = new ParameterCollection(filteredParameters);\n return selfhref;\n }\n\n return new Href();\n }\n\n selfhrefWithCommitParam() {\n const selfhref = this.selfhrefNoCommitParam();\n\n if (this.expectsEndResultFormObjects && !this.isComplete && !this.commit) {\n selfhref.addParameter(\"commit\", \"false\");\n }\n\n return selfhref;\n }\n\n /**\n * Create a selfhref including the parameters that are used to start this form\n */\n override get selfhref() {\n if (!this.selflink) {\n throw new Error(\"No self link found for form\");\n }\n\n if (getSetting(\"ALWAYS_COMMIT_FORM\")) {\n return this.selfhrefNoCommitParam();\n }\n\n return this.selfhrefWithCommitParam();\n }\n\n /**\n * Handle form tokens to indicate concurrent form use\n */\n get tokens() {\n if (!this._tokens) {\n const tokens = this.data?.tokens;\n this._tokens = Array.isArray(tokens) ? tokens : [];\n }\n return this._tokens;\n }\n\n /**\n * Replaces all tokens with the given collection of tokens\n */\n set tokens(tokens: string[]) {\n this._tokens = tokens;\n }\n\n /**\n * Removes all tokens from the form\n */\n removeTokens() {\n this._tokens = [];\n }\n\n setTokens() {\n const tokens = this.data?.tokens;\n this._tokens = Array.isArray(tokens) ? tokens : [];\n }\n\n /**\n * Keep track of changed form\n */\n isChanged() {\n return (\n this.currentFormObject !== null &&\n this.currentFormObject.isChangedSince(this.lastUpdate)\n );\n }\n\n get lastUpdate() {\n return this._lastUpdate;\n }\n\n set lastUpdate(lastUpdate: number) {\n this._lastUpdate = lastUpdate;\n }\n\n getFormDataObjects(validOnly = true, validationData = false) {\n const formObjects = this.allObjects.filter((formObject) => {\n // repeatabe object without fixed nr of repeats, remove last form object from formdata,\n // because this is the formobject that is used as a placeholder for the create object\n // of the collection of repeats\n\n if (formObject.isRepeatable && !formObject.hasFixedNrOfRepeats) {\n const hasValue = formObject.attributeCollection.some(\n (attr) => attr.value !== null,\n );\n if (!hasValue) {\n return false;\n }\n }\n\n return formObject.isValid || !validOnly;\n });\n\n const formdata: {\n key: string;\n repeatIndex?: number;\n formdata: object;\n }[] = [];\n\n formObjects.forEach((formObject) => {\n const objectFormData = formObject.getFormData(validationData);\n\n if (!objectFormData) {\n return;\n }\n\n const hasNonNullValues =\n objectFormData &&\n Object.values(objectFormData).some((value) => value !== null);\n\n const shouldInclude = formObject.isDynamic ? hasNonNullValues : true;\n\n if (shouldInclude) {\n const existingObjectIndex = formdata.findIndex(\n (obj) =>\n obj.key === formObject.key &&\n obj.repeatIndex === formObject.repeatIndex,\n );\n /*\n * when the object already exists in the formdata with the same key and index,\n * merge the attributes of both objects together\n */\n if (existingObjectIndex > -1) {\n formdata[existingObjectIndex].formdata = deepmerge(\n formdata[existingObjectIndex].formdata,\n objectFormData,\n );\n } else {\n formdata.push({\n key: formObject.key,\n repeatIndex: formObject.repeatIndex,\n formdata: objectFormData,\n });\n }\n }\n });\n\n return formdata.map((obj) => ({ [obj.key]: obj.formdata }));\n }\n\n getFormData(\n validOnly = true,\n withConcurrencyToken = true,\n validationData = false,\n ) {\n if (withConcurrencyToken && this.tokens.length > 0) {\n return JSON.stringify({\n objects: this.getFormDataObjects(validOnly, validationData),\n tokens: this.tokens,\n });\n }\n\n return JSON.stringify({\n objects: this.getFormDataObjects(validOnly, validationData),\n });\n }\n\n /**\n * Used to programmatically overwrite the setting USE_CLIENTSIDE_VALIDATION\n */\n setUseClientsideValidation(enabled: boolean) {\n this._useClientsideValidation = enabled;\n\n this.allObjects.forEach((formObject) => {\n formObject.attributeCollection.all.forEach((item: AttributeModel) =>\n item.setUseClientsideValidation(enabled),\n );\n });\n }\n\n /**\n * Indicates if client side validation is enabled\n */\n useClientsideValidation() {\n return this._useClientsideValidation ?? true;\n }\n\n /**\n * Get form data for submitting\n */\n get formdata() {\n return this.getFormData(this.useClientsideValidation());\n }\n\n get validationData() {\n return this.getFormData(false, false, true);\n }\n\n /**\n * Form navigation: Go one object back (previous button)\n */\n get hasPreviousStep() {\n const currentFormObjectKey =\n this.currentFormObject != null ? this.currentFormObject.key : \"\";\n\n return (\n this.completedFormObjects.filter(\n (formObject) =>\n !formObject.isRepeatWithUnknownTotal ||\n formObject.key !== currentFormObjectKey,\n ).length > 0\n );\n }\n\n /**\n * Go one form-object back,\n * for repeating object this means go back until we get at a form object that had\n * a different key than the current form object\n */\n setPreviousObject() {\n this.isComplete = false;\n this.isFinished = false;\n this.success = undefined;\n\n const oldCurrentFormObject = this.currentFormObject;\n\n if (this.currentFormObject != undefined) {\n this.previouslyEnteredFormObjects = [\n this.currentFormObject,\n ...this.previouslyEnteredFormObjects,\n ];\n }\n\n this.currentFormObject =\n this.completedFormObjects[this.completedFormObjects.length - 1];\n this.completedFormObjects = this.completedFormObjects.slice(0, -1);\n\n const completedFormObjectKeys = this.completedFormObjects\n .map((formObject) => formObject.key)\n .filter((formObjectKey) => formObjectKey !== this.currentFormObject?.key);\n\n this.endResultFormObjects = this._endResultFormObjects.filter((endResult) =>\n completedFormObjectKeys.includes(endResult.key),\n );\n this.previousEndResultKeys = this.endResultFormObjects.map(\n (endResult) => endResult.key,\n );\n\n // while we are at the same repeating form object, go a step back\n if (\n this.currentFormObject &&\n this.currentFormObject.equals(\n oldCurrentFormObject,\n this.currentFormObject.hasFixedNrOfRepeats,\n )\n ) {\n this.setPreviousObject();\n }\n }\n\n /**\n * Form navigation: has next step or is last\n */\n get hasNextStep() {\n if (\n this.isComplete ||\n this.isFinished ||\n this.hasNoQuestionsConfigured ||\n !this.contributions.objects\n ) {\n return false;\n }\n\n // current object is a dynamic object\n if (this.currentFormObject && this.currentFormObject.isDynamic) {\n return true;\n }\n\n if (this.expectsEndResultFormObjects) {\n return true;\n }\n\n const currentObjectIndex = this.objectKeys.findIndex(\n (objectKey) => objectKey === this.currentFormObject?.key,\n );\n const isLastObject = this.objectKeys.length - 1 === currentObjectIndex;\n\n // current object is a repeating question but it is not the last one\n if (\n isLastObject &&\n this.currentFormObject &&\n this.currentFormObject.isRepeatable &&\n !this.currentFormObject.isLastRepeat\n ) {\n return true;\n }\n\n // current object is not repeatable and the last object\n if (isLastObject) {\n return false;\n }\n\n // can't determine if this is te last, render a next button\n return true;\n }\n\n /**\n * Merge existing form with new form\n */\n update(receivedForm: FormModel) {\n if (receivedForm instanceof FormModel) {\n this.resetErrors();\n\n this.lastUpdate = Date.now();\n this.lastServerUpdate = receivedForm.lastServerUpdate;\n\n this.tokens = receivedForm.tokens;\n\n this.isComplete = receivedForm.isComplete;\n this.isFinished = receivedForm.isFinished;\n this.success = receivedForm.success;\n\n const receivedFormData = receivedForm.data ?? {};\n const hasMissing = has(receivedFormData, \"missing\");\n const hasErrors = has(receivedFormData, \"errors\");\n\n if (!hasMissing && !hasErrors) {\n this.handleFinished(receivedForm);\n }\n\n if (hasErrors) {\n this.handleErrors(receivedForm);\n }\n\n if (hasMissing) {\n this.handleMissing(receivedForm);\n }\n }\n\n return this;\n }\n\n /**\n * Updates the current form object with new information about the object,\n * like for example a new dynamicschema. Used for autoupdate functionality that makes it possible\n * to update the options of a next missing attribute in a form-tree iq question\n */\n updateCurrentFormObject(receivedForm: FormModel) {\n if (receivedForm instanceof FormModel) {\n const receivedFormData = receivedForm.data ?? {};\n const hasMissing = has(receivedFormData, \"missing\");\n const hasErrors = has(receivedFormData, \"errors\");\n\n if (hasErrors) {\n this.handleErrors(receivedForm);\n }\n\n if (hasMissing) {\n this.handleMissing(receivedForm);\n }\n }\n }\n\n updateValidations(data: FormData) {\n if (this.currentFormObject) {\n this.currentFormObject.updateValidations(data);\n }\n return this;\n }\n\n /**\n * Retrieve success information from response\n */\n get success() {\n return this._success;\n }\n\n /**\n * Set success information, contains redirect and event data\n */\n set success(success: SuccessData | undefined) {\n this._success = success;\n }\n\n createSuccess() {\n this._success = this.data.success;\n }\n\n /**\n * Process finished form\n */\n handleFinished(receivedForm: FormModel) {\n if (this.currentFormObject) {\n this.completedFormObjects = [\n ...this.completedFormObjects,\n this.currentFormObject,\n ];\n }\n\n this.currentFormObject = receivedForm.currentFormObject;\n this.endResultFormObjects = receivedForm.endResultFormObjects;\n\n // Create a new object with the updated data\n this.replaceData({ ...this.data, ...receivedForm.data });\n }\n\n handleRootErrors(errors: ErrorObjectData[]) {\n errors\n .filter((error) => !error.anchor)\n .forEach((error) => {\n this.errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n error.layouthint,\n );\n });\n }\n\n /**\n * Process errors from received form§\n */\n handleErrors(receivedForm: FormModel) {\n const receivedErrorAnchors = Array.isArray(receivedForm.data.errors)\n ? receivedForm.data.errors\n : [];\n\n if (receivedErrorAnchors) {\n receivedErrorAnchors.forEach((receivedError: ErrorObjectData) => {\n if (\n receivedError.anchor &&\n this.currentFormObject &&\n this.currentFormObject.key === receivedError.anchor.objectid\n ) {\n this.currentFormObject.addServerError(receivedError);\n } else {\n this.errorCollection.addServerError(\n receivedError.id,\n receivedError.message,\n receivedError.properties,\n receivedError.layouthint,\n );\n }\n });\n }\n }\n\n /**\n * Process missing from received form\n */\n handleMissing(receivedForm: FormModel) {\n if (\n this.currentFormObject &&\n this.currentFormObject.equals(receivedForm.currentFormObject)\n ) {\n this.handleMissingErrors(receivedForm);\n } else {\n this.handleNewFormObject(receivedForm);\n }\n }\n\n /**\n * Received missing anchors in the response with an object id that is the current form object\n */\n processMissingErrors(receivedForm: FormModel) {\n if (this.currentFormObject === null) {\n return null;\n }\n\n this.currentFormObject.attributeCollection.map((attribute) => {\n const receivedAttribute =\n receivedForm.currentFormObject?.getAttributeByKey(attribute.key);\n\n if (receivedAttribute) {\n attribute.addMissingError(receivedAttribute);\n } else {\n attribute.removeMissingError();\n }\n\n return attribute;\n });\n\n return this.currentFormObject;\n }\n\n handleMissingErrors(receivedForm: FormModel) {\n this.currentFormObject = this.processMissingErrors(receivedForm);\n }\n\n handleNewFormObject(receivedForm: FormModel) {\n this.endResultFormObjects = receivedForm.endResultFormObjects;\n const receivedCurrentFormObject = receivedForm.currentFormObject;\n\n if (receivedCurrentFormObject === null) {\n this.completedFormObjects = [...this.allObjects];\n this.currentFormObject = null;\n } else {\n if (this.currentFormObject?.isRepeatable) {\n this.completedFormObjects = [\n ...this.completedFormObjects,\n this.currentFormObject,\n ];\n } else if (this.currentFormObject) {\n this.completedFormObjects = [...this.allObjects];\n }\n\n this.currentFormObject = receivedCurrentFormObject;\n }\n }\n\n /**\n * Indicate if a new form object model should be merged with a previousled entered form object model\n * Set this property to false on the form that receives the new form to skip the merge behavior\n */\n get mergePreviouslyEnteredObjects() {\n return this._mergePreviouslyEnteredObjects;\n }\n\n set mergePreviouslyEnteredObjects(mergePreviouslyEnteredObjects: boolean) {\n this._mergePreviouslyEnteredObjects = mergePreviouslyEnteredObjects;\n }\n\n handlePreviouslyEnteredFormObjects(\n receivedCurrentFormObject: FormObjectModel,\n previouslyEnteredFormObjects: FormObjectModel[],\n ) {\n previouslyEnteredFormObjects.forEach((previouslyEnteredFormObject) => {\n const mergedObject = this.mergePreviouslyEnteredObjects\n ? this.mergeObjects(\n receivedCurrentFormObject,\n previouslyEnteredFormObject,\n )\n : receivedCurrentFormObject;\n\n this.addFormObject(mergedObject);\n });\n\n // remove the previously entered form object\n this.previouslyEnteredFormObjects =\n this.previouslyEnteredFormObjects.filter((formObject) => {\n const hasPreviouslyEnteredObject = previouslyEnteredFormObjects.find(\n (previouslyEnteredFormObject) =>\n formObject.equals(previouslyEnteredFormObject),\n );\n\n return !hasPreviouslyEnteredObject;\n });\n }\n\n mergeObjects(newObject: FormObjectModel, oldObject: FormObjectModel) {\n const mergedFormObject = FormObjectModel.createEmpty(newObject);\n mergedFormObject.mergeObject(oldObject);\n return mergedFormObject;\n }\n\n findAttribute(findMethod: (item: AttributeModel) => boolean) {\n return this.allObjects\n .flatMap((formObject) => formObject.attributeCollection.all)\n .find((attribute) => findMethod(attribute));\n }\n}\n","import { has } from \"lodash\";\n\nimport { BaseModel } from \"../base/BaseModel\";\nimport { AttributeCollection } from \"./AttributeCollection\";\n\nimport type { Data } from \"../../types/types\";\nimport type { ModelOptions } from \"../types\";\nimport type { AttributeSetContributions } from \"./types\";\n\nexport class AttributeSetModel extends BaseModel<\n Data,\n AttributeSetContributions\n> {\n private _key: string;\n private _attributeCollection: AttributeCollection;\n\n constructor(\n key = \"\",\n data: Data,\n contributions: AttributeSetContributions,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [contributionKey] = Object.keys(contribution);\n return has(this.data, contributionKey);\n })\n : [];\n\n this._attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n { ...modelOptions, isReadonly: true },\n );\n\n this._key = key;\n }\n\n get key() {\n return this._key;\n }\n\n set key(key: string) {\n this._key = key;\n }\n\n get label() {\n return this.contributions.label;\n }\n\n /**\n * Retrieve attribute collection\n */\n get attributeCollection() {\n return this._attributeCollection;\n }\n\n /**\n * Set the attributes with a new AttributeCollection\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n private createChildAttributeSetModel(\n key: string,\n dataObject: object,\n index?: number,\n ) {\n type objects = Record<string, AttributeSetContributions>;\n const objects = this.contributions.objects as objects;\n\n return new AttributeSetModel(\n index ? `${key}-${index + 1}` : key,\n {\n ...dataObject,\n dynamicschema: this.data.dynamicschema,\n },\n objects?.[key],\n this.modelOptions,\n );\n }\n\n /**\n * Retrieve child {@code AttributeSetModel}s\n */\n getChildAttributeSets() {\n if (!this.contributions.objects) {\n return [];\n }\n\n const childAttributeSets = [];\n for (const key of Object.keys(this.contributions.objects)) {\n if (key in this.data) {\n const attributeData = this.data[key];\n if (Array.isArray(attributeData)) {\n for (const [i, dataObject] of attributeData.entries()) {\n childAttributeSets.push(\n this.createChildAttributeSetModel(key, dataObject, i),\n );\n }\n } else {\n childAttributeSets.push(\n this.createChildAttributeSetModel(key, attributeData as Data),\n );\n }\n }\n }\n return childAttributeSets;\n }\n}\n","import { has } from \"lodash\";\n\nimport { IllegalArgumentException } from \"../../exceptions/IllegalArgumentException\";\nimport { AttributeCollection } from \"../attributes/AttributeCollection\";\nimport { CompositeAttributeModel } from \"../attributes/CompositeAttributeModel\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { ContentConfiguration } from \"../contentconfiguration/ContentConfiguration\";\nimport { ErrorCollection } from \"../error/ErrorCollection\";\nimport { LayoutHintCollection } from \"../layouthint/LayoutHintCollection\";\n\nimport type { TextWithPlaceholders } from \"../../types/types\";\nimport type {\n AttributeContributions,\n AttributeModel,\n MaybeAttributeValue,\n} from \"../attributes/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelOptions, ModelWithChildModels } from \"../types\";\nimport type {\n AnchorElementData,\n ErrorObjectData,\n FormData,\n FormObjectContributions,\n FormObjectData,\n MissingObjectData,\n} from \"./types\";\n\nexport class FormObjectModel\n extends BaseModel<FormObjectData, FormObjectContributions>\n implements ModelWithChildModels\n{\n private _attributeCollection: AttributeCollection;\n private _contentConfiguration: ContentConfiguration;\n private _errorCollection: ErrorCollection;\n private _repeatIndex: number | undefined;\n private _dynamicValidationsLoaded = false;\n\n constructor(\n object: FormObjectData,\n objectContributions: FormObjectContributions,\n modelOptions?: ModelOptions,\n ) {\n super(object, objectContributions, modelOptions);\n\n if (object && this.getElements().length > 0) {\n this._attributeCollection = new AttributeCollection(\n this.getElements(),\n this.getApplicableAttributeContributions(),\n { ...modelOptions, isReadonly: false },\n );\n } else {\n this._attributeCollection = new AttributeCollection();\n }\n\n this._contentConfiguration = new ContentConfiguration(\n objectContributions ? objectContributions.content : {},\n );\n\n this._errorCollection = new ErrorCollection(\"formobject\");\n\n const referenceData = this.getDataAsString(\"referenceDate\");\n if (referenceData) {\n this.attributeCollection.setReferenceDate(referenceData);\n }\n\n this.attributeCollection.indicateContentConfiguration(\n this.contentConfiguration,\n );\n }\n\n static createEmpty(formObjectModel: FormObjectModel) {\n if (!formObjectModel) {\n throw new IllegalArgumentException(\n \"createEmpty method needs a FormObjectModel as input argument to create a new version of the object\",\n );\n }\n return new FormObjectModel(\n formObjectModel.data,\n formObjectModel.contributions,\n formObjectModel.modelOptions,\n );\n }\n\n equals(object: FormObjectModel | null, withRepeatIndex = true) {\n if (!object || this.key !== object.key) {\n return false;\n }\n\n const objectContainsOneOfTheAttributes = this.attributeCollection.all\n .filter((attribute) => !attribute.isResult)\n .some(\n (attribute) =>\n object && object.attributeCollection.hasAttributeByKey(attribute.key),\n );\n\n const hasSameRepeatIndex = withRepeatIndex\n ? this.repeatIndex === object.repeatIndex\n : true;\n\n return hasSameRepeatIndex && objectContainsOneOfTheAttributes;\n }\n\n getAttributeByAttribute(attribute: AttributeModel) {\n return this.attributeCollection.getAttributeByAttribute(attribute);\n }\n\n getAttributeByKey(key: string) {\n return this.attributeCollection.getAttributeByKey(key);\n }\n\n hasAttributeByKey(key: string) {\n return this.attributeCollection.hasAttributeByKey(key);\n }\n\n /**\n * Get elements from both the missing attributes and the result attributes\n */\n private getElements() {\n const elements: AnchorElementData[] = [];\n\n if (Array.isArray(this.data.elements)) {\n elements.push(...this.data.elements);\n }\n\n if (Array.isArray(this.data.results)) {\n const dataResults = this.data.results.map((result) => ({\n ...result,\n isResult: true,\n }));\n\n elements.push(...dataResults);\n }\n\n if (this.data.elementid) {\n elements.push({\n ...(this.data as AnchorElementData),\n });\n }\n\n return elements;\n }\n\n /**\n * Map available contributions on the available data. Only use contributions that are needed for the data\n */\n private getApplicableAttributeContributions(): Record<\n string,\n AttributeContributions\n >[] {\n if (this.data && this.contributions) {\n const dataElementIds = this.getElements().map(\n (element) => element.elementid,\n );\n\n const contributions = this.getAttributesInData(\n dataElementIds,\n this.contributions.attributes,\n );\n\n // set all attribute mandatory for dynamic object\n if (this.isDynamic) {\n return contributions.map((attribute) => {\n const [attributeKey] = Object.keys(attribute);\n return {\n [attributeKey]: {\n ...attribute[attributeKey],\n mandatory: true,\n },\n };\n });\n }\n\n return contributions;\n }\n\n return [];\n }\n\n /**\n * Recursevily check if an attribute id occurs in the tree of attribute contributions.\n * The complete leaf of the tree is returned when an attribute id matches\n */\n getAttributesInData(\n dataElementIds: string[],\n attributesContributions: Record<string, AttributeContributions>[] = [],\n ) {\n return attributesContributions.filter((attributeContributions) => {\n const [attributeKey] = Object.keys(attributeContributions);\n\n return dataElementIds.some(\n (dataElementId) => dataElementId.split(\".\")[0] === attributeKey,\n );\n });\n }\n\n getInitialChildModelLinks() {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n setChildModels(models: ModelWithChildModels[], errors: ErrorResponse[]) {\n this._attributeCollection.setChildModels(models, errors);\n }\n\n /**\n * get key\n */\n get key() {\n return this.data.objectid || \"unknown\";\n }\n\n /**\n * Get content configuration for form objects\n */\n get contentConfiguration(): ContentConfiguration {\n return this._contentConfiguration;\n }\n\n /**\n */\n get hasEndResultConfiguration() {\n return this.contributions.content?.results != null;\n }\n\n /**\n * Indicates if object is dynamic.\n *\n * A subtle difference exists between objects for wizard style instrument dialogs and other objects.\n * In the 'missing object' response, wizard style objects will include only the first attribute(s) to be answered,\n * while other objects will include the complete set of attributes of that object.\n *\n * This difference is condensed in the term of 'dynamic objects': these objects start (in the 'missing object' response)\n * with a very select set of attributes to be answered, and each successive 'missing elements' response will include next attributes to be answered.\n * When an object is dynamic, the form contributions will mention a \"dynamicObject\": true property.\n */\n get isDynamic() {\n return this.getContributionAsBoolean(\"dynamicObject\", false);\n }\n\n /**\n */\n get hasDynamicValidations() {\n return this.getContributionAsBoolean(\"dynamicValidations\", false);\n }\n\n /**\n * Indicates if object is repeatable\n */\n get isRepeatable() {\n return this.getContributionAsBoolean(\"repeatable\", false);\n }\n\n get repeatIndex() {\n return this._repeatIndex ?? this.data.index ?? 1;\n }\n\n set repeatIndex(repeatIndex: number) {\n this._repeatIndex = repeatIndex;\n }\n\n get maxRepeats() {\n if (this.isRepeatable) {\n return this.getDataAsNumber(\"numberofrepeats\", -1);\n }\n return 1;\n }\n\n get hasFixedNrOfRepeats() {\n return this.maxRepeats > -1;\n }\n\n get isRepeatWithUnknownTotal() {\n return this.isRepeatable && this.maxRepeats === -1;\n }\n\n get isLastRepeat() {\n if (this.isRepeatable) {\n return this.getDataAsBoolean(\"last\", false);\n }\n return true;\n }\n\n get repeatIndexLabel() {\n return this.getDataAsString(\"index-identifier\");\n }\n\n /**\n * Get label of form object\n */\n get label() {\n return this.getContributionAsString(\"label\");\n }\n\n /**\n * Get introText of form object\n */\n get introText() {\n if (typeof this.data.content === \"object\" && this.data.content != null) {\n if (\"text\" in this.data.content) {\n const { message } = this.data.content.text as TextWithPlaceholders;\n return message;\n }\n }\n\n if (this.contributions.text?.message) {\n return this.contributions.text.message;\n }\n\n return this.contributions.introText;\n }\n\n /**\n * Get assistent of form object\n */\n get assistent() {\n return this.contributions.assistent;\n }\n\n /**\n * Get button labels\n */\n get buttonLabels() {\n return this.getContributionAsObject<Record<string, string>>(\n \"buttonLabels\",\n {},\n );\n }\n\n /**\n * get attribute collection\n */\n get attributeCollection() {\n return this._attributeCollection;\n }\n\n set attributeCollection(attributeCollection: AttributeCollection) {\n this._attributeCollection = attributeCollection;\n }\n\n mergeObject(oldObject: FormObjectModel) {\n this.attributeCollection.forEach((attribute) => {\n const mergeWithAttribute = oldObject.getAttributeByAttribute(attribute);\n if (mergeWithAttribute) {\n attribute.mergeAttribute(mergeWithAttribute);\n }\n });\n\n this.repeatIndex = oldObject.repeatIndex;\n }\n\n /**\n * Update attribute\n */\n updateAttribute(attribute: AttributeModel, value: MaybeAttributeValue) {\n const attributeToUpdate =\n this.attributeCollection.getAttributeByAttribute(attribute);\n\n if (attributeToUpdate == null) {\n throw new Error(`Attribute with name: ${attribute.name} not found.`);\n }\n\n if (attributeToUpdate instanceof CompositeAttributeModel) {\n attributeToUpdate.update(value, attribute);\n } else {\n attributeToUpdate.update(value);\n }\n\n return attributeToUpdate;\n }\n\n /**\n * Inidicates if Form is changed since a given timestamp (Date.now)\n */\n isChangedSince(timestamp: number) {\n return (\n this.attributeCollection.find((attribute) =>\n attribute.isChangedSince(timestamp),\n ) != null\n );\n }\n\n /**\n * Reset all errors on Form Object\n */\n resetErrors() {\n this._errorCollection.clear();\n this.attributeCollection.forEach((attribute) => attribute.resetErrors());\n }\n\n /**\n * Get error messages\n */\n get errorCollection() {\n return this._errorCollection;\n }\n\n /**\n * Registers an error that was received from a server response\n */\n addServerError(error: ErrorObjectData) {\n if (error.anchor?.elementid != null) {\n this.attributeCollection.addServerError(error);\n } else {\n this._errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n error.layouthint,\n );\n }\n }\n\n hasServerErrors() {\n return (\n this.errorCollection.hasItems() ||\n this.attributeCollection.hasServerErrors()\n );\n }\n\n hasErrors() {\n return (\n this.errorCollection.hasItems() || this.attributeCollection.hasErrors()\n );\n }\n\n get isValid() {\n return (\n this.attributeCollection.visible.every(\n (attribute) => attribute.isValid,\n ) && !this.errorCollection.hasItems()\n );\n }\n\n get dynamicValidationsLoaded() {\n return this._dynamicValidationsLoaded;\n }\n\n set dynamicValidationsLoaded(dynamicValidationsLoaded: boolean) {\n this._dynamicValidationsLoaded = dynamicValidationsLoaded;\n }\n\n /**\n * Convert error json from a form service to validation messages on the form object and attributes\n */\n handleErrorValidations(errors: ErrorObjectData[]) {\n const attributeErrors: ErrorObjectData[] = [];\n\n errors\n .filter((error) => error.anchor?.objectid === this.key)\n .forEach((error) => {\n if (has(error.anchor, \"elementid\")) {\n attributeErrors.push(error);\n } else {\n this.errorCollection.addServerError(\n error.id,\n error.message,\n error.properties,\n new LayoutHintCollection(error.layouthint),\n );\n }\n });\n\n this.attributeCollection.updateValidations(attributeErrors);\n }\n\n /**\n * Convert missing json from a form service to mandatory validation constraints and messages\n */\n handleMissingValidations(\n missing: {\n anchors: (MissingObjectData | AnchorElementData)[];\n },\n errors?: ErrorObjectData[],\n ) {\n const attributeErrors: ErrorObjectData[] = [];\n\n for (const anchor of missing.anchors) {\n if (!anchor.objectid || anchor.objectid === this.key) {\n if (Array.isArray(anchor.elements)) {\n for (const element of anchor.elements) {\n attributeErrors.push({\n anchor: {\n objectid: element.objectid || \"\",\n elementid: element.elementid,\n },\n id: \"Constraint.Mandatory\",\n });\n }\n } else {\n attributeErrors.push({\n anchor: {\n ...anchor,\n objectid: anchor.objectid || \"\",\n },\n id: \"Constraint.Mandatory\",\n });\n }\n }\n }\n\n if (Array.isArray(errors)) {\n errors\n .filter(\n (error) =>\n error.id === \"Constraint.Mandatory\" &&\n error.anchor?.objectid === this.key &&\n has(error.anchor, \"elementid\"),\n )\n .forEach((error) => {\n attributeErrors.push(error);\n });\n }\n\n this.attributeCollection.updateValidations(attributeErrors);\n }\n\n updateValidations(data: FormData): FormObjectModel {\n this.resetErrors();\n\n if (Array.isArray(data.errors)) {\n this.handleErrorValidations(data.errors);\n }\n\n // missing attribute errors\n if (Array.isArray(data.missing?.anchors)) {\n this.handleMissingValidations(data.missing, data.errors);\n }\n\n this.dynamicValidationsLoaded = true;\n\n return this;\n }\n\n /**\n * Generate formdata object for current formobject based on formdata of attributes\n */\n get formdata() {\n return this.attributeCollection.formdata;\n }\n\n getFormData(validationData = false) {\n return this.attributeCollection.getFormData(validationData);\n }\n}\n","import { immerable } from \"immer\";\n\nimport { ContentConfigurationEndResults } from \"./ContentConfigurationEndResults\";\nimport { ContentConfigurationQuestions } from \"./ContentConfigurationQuestions\";\nimport { ContentConfigurationResults } from \"./ContentConfigurationResults\";\n\nimport type { ContentConfigurationContributions } from \"./types\";\n\n/**\n * Content definition for questions, results, given answers etc.\n * Mostly maps to the Instrument questions configuration of Be Informed\n */\nexport class ContentConfiguration {\n [immerable] = true;\n\n private _questions: ContentConfigurationQuestions | undefined;\n private _intermediateResults: ContentConfigurationResults | undefined;\n private _endResults: ContentConfigurationEndResults | undefined;\n\n constructor(configuration?: ContentConfigurationContributions) {\n this._questions = this.createQuestionConfiguration(configuration);\n this._intermediateResults =\n this.createIntermedidateResultsConfiguration(configuration);\n this._endResults = this.createEndResultsConfiguration(configuration);\n }\n\n private createQuestionConfiguration(\n configuration?: ContentConfigurationContributions,\n ) {\n if (\n configuration &&\n \"questions\" in configuration &&\n typeof configuration.questions === \"object\"\n ) {\n return new ContentConfigurationQuestions(configuration.questions);\n }\n return undefined;\n }\n\n private createIntermedidateResultsConfiguration(\n configuration?: ContentConfigurationContributions,\n ) {\n if (\n configuration &&\n \"intermediateResults\" in configuration &&\n typeof configuration.intermediateResults === \"object\"\n ) {\n return new ContentConfigurationResults(configuration.intermediateResults);\n }\n\n return undefined;\n }\n\n private createEndResultsConfiguration(\n configuration?: ContentConfigurationContributions,\n ) {\n if (\n configuration &&\n \"results\" in configuration &&\n typeof configuration.results === \"object\"\n ) {\n return new ContentConfigurationEndResults(configuration.results);\n }\n\n return undefined;\n }\n\n get questions() {\n return this._questions;\n }\n\n isConfiguredIntermediateResultAttribute(attributeKey: string) {\n return this.intermediateResults?.attributes.includes(attributeKey) ?? false;\n }\n\n get intermediateResults() {\n return this._intermediateResults;\n }\n\n isConfiguredEndResultAttribute(attributeKey: string) {\n if (!this.endResults) {\n return false;\n }\n return this.endResults?.config.some((item) =>\n item.attributes.includes(attributeKey),\n );\n }\n\n get endResults() {\n return this._endResults;\n }\n}\n","import { LayoutHintCollection } from \"../layouthint/LayoutHintCollection\";\nimport { ContentConfigurationElements } from \"./ContentConfigurationElements\";\n\nimport type { ResultsConfiguration } from \"./types\";\n\nexport class ContentConfigurationResults {\n private _configuration: ResultsConfiguration | null;\n private _layouthint: LayoutHintCollection;\n private _calculatedResults: ContentConfigurationElements;\n private _positiveResults: ContentConfigurationElements;\n private _negativeResults: ContentConfigurationElements;\n private _results: ContentConfigurationElements;\n\n constructor(configuration?: ResultsConfiguration) {\n this._configuration = configuration || null;\n this._layouthint = new LayoutHintCollection(configuration?.layouthint);\n\n this._calculatedResults = new ContentConfigurationElements(\n configuration?.calculatedResultElements,\n );\n this._positiveResults = new ContentConfigurationElements(\n configuration?.positiveResultElements,\n );\n this._negativeResults = new ContentConfigurationElements(\n configuration?.negativeResultElements,\n );\n this._results = new ContentConfigurationElements(\n configuration?.resultElements,\n );\n }\n\n get label() {\n return this._configuration?.label;\n }\n\n get description() {\n const description = this._configuration?.description;\n if (typeof description === \"object\" && \"message\" in description) {\n return description.message;\n }\n return description;\n }\n\n get layouthint() {\n return this._layouthint;\n }\n\n get attributes() {\n if (this._configuration === null) {\n return [];\n }\n\n // An issue with mapped attributes is giving us the wrong attribute keys in the attributes property\n // as a temporary fix a layouthint with the correct mapped attribute key can be set in the configuration of the end results\n return [\n ...this._configuration.attributes,\n ...this.layouthint.all\n .filter((hint) => hint.includes(\"attribute:\"))\n .map((hint) => hint.substring(\"attribute:\".length)),\n ];\n }\n\n get calculatedResultElements() {\n return this._calculatedResults;\n }\n\n get positiveResultElements() {\n return this._positiveResults;\n }\n\n get negativeResultElements() {\n return this._negativeResults;\n }\n\n get resultElements() {\n return this._results;\n }\n}\n","import { ContentConfigurationResults } from \"./ContentConfigurationResults\";\n\nimport type { EndResultsConfiguration } from \"./types\";\n\nexport class ContentConfigurationEndResults {\n private _configuration: EndResultsConfiguration;\n\n constructor(configuration: EndResultsConfiguration) {\n this._configuration = configuration || [];\n }\n\n get config() {\n return this._configuration\n .filter((configElement) => {\n const [key] = Object.keys(configElement);\n\n return (\n key === \"decisionResult\" ||\n key === \"classificationResult\" ||\n key === \"calculatorResult\"\n );\n })\n .map((configElement) => {\n const [key] = Object.keys(configElement);\n return new ContentConfigurationResults(configElement[key]);\n });\n }\n}\n","import { ContentConfigurationElements } from \"./ContentConfigurationElements\";\n\nimport type { QuestionConfiguration } from \"./types\";\n\nexport class ContentConfigurationQuestions {\n private _question: ContentConfigurationElements;\n private _options: ContentConfigurationElements;\n private _answers: ContentConfigurationElements;\n\n constructor(configuration: QuestionConfiguration) {\n this._question = new ContentConfigurationElements(\n configuration.questionElements,\n );\n this._options = new ContentConfigurationElements(\n configuration.optionElements,\n );\n this._answers = new ContentConfigurationElements(\n configuration.givenAnswerElements,\n );\n }\n\n hasConfig() {\n return (\n this._question.hasConfig() ||\n this._options.hasConfig() ||\n this._answers.hasConfig()\n );\n }\n\n get question() {\n return this._question;\n }\n\n get options() {\n return this._options;\n }\n\n get answers() {\n return this._answers;\n }\n}\n","import { has } from \"lodash\";\n\nimport { IllegalArgumentException } from \"../exceptions/IllegalArgumentException\";\nimport { ApplicationModel } from \"./application/ApplicationModel\";\nimport { CaseViewModel } from \"./caseview/CaseViewModel\";\nimport { ConceptDetailModel } from \"./concepts/ConceptDetailModel\";\nimport { ConceptIndexModel } from \"./concepts/ConceptIndexModel\";\nimport { ConceptTypeDetailModel } from \"./concepts/ConceptTypeDetailModel\";\nimport { ContentIndexModel } from \"./content/ContentIndexModel\";\nimport { ContentModel } from \"./content/ContentModel\";\nimport { ContentTOCModel } from \"./content/ContentTOCModel\";\nimport { ContentTypeModel } from \"./content/ContentTypeModel\";\nimport { DetailModel } from \"./detail/DetailModel\";\nimport { FormModel } from \"./form/FormModel\";\nimport { ListDetailModel } from \"./list/detail/ListDetailModel\";\nimport { ListModel } from \"./list/ListModel\";\nimport { LookupOptionsModel } from \"./lookup/LookupOptionsModel\";\nimport { ModelCatalogModel } from \"./modelcatalog/ModelCatalogModel\";\nimport { GroupingPanelModel } from \"./panels/GroupingPanelModel\";\nimport { CaseSearchModel } from \"./search/CaseSearchModel\";\nimport { TabModel } from \"./tab/TabModel\";\nimport { TaskGroupModel } from \"./taskgroup/TaskGroupModel\";\nimport { UserModel } from \"./user/UserModel\";\nimport { UserProfileModel } from \"./user/UserProfileModel\";\nimport { UserServicesModel } from \"./user/UserServicesModel\";\n\nimport type { ModularUIResponse } from \"../modularui/ModularUIResponse\";\n\n/**\n * Mapping of models and resourcetypes\n */\nconst RESOURCE_MODELS = [\n ApplicationModel,\n TabModel,\n ListDetailModel,\n ListModel,\n GroupingPanelModel,\n CaseSearchModel,\n CaseViewModel,\n DetailModel,\n TaskGroupModel,\n FormModel,\n UserModel,\n UserProfileModel,\n UserServicesModel,\n ModelCatalogModel,\n ConceptIndexModel,\n ConceptDetailModel,\n ConceptTypeDetailModel,\n ContentIndexModel,\n ContentTOCModel,\n ContentModel,\n ContentTypeModel,\n LookupOptionsModel,\n];\n\n/**\n * Resolve a model by resource\n */\nexport const resolveModel = (\n response: ModularUIResponse,\n availableModels = RESOURCE_MODELS,\n) => {\n if (!response) {\n throw new IllegalArgumentException(\n `No data or contribution available, cannot resolve model`,\n );\n }\n\n if (!has(response.contributions, \"resourcetype\")) {\n throw new IllegalArgumentException(\n `Contributions has wrong format, missing resourcetype property in contributions of ${response.requestHref?.toString()}`,\n );\n }\n\n const resourceTypeModel = availableModels.find((resourceModel) =>\n resourceModel.isApplicableModel(response),\n );\n\n if (resourceTypeModel) {\n return resourceTypeModel;\n }\n\n return undefined;\n};\n","export class NotAllowedUriException extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"NotAllowedUriException\";\n }\n}\n","import { ResourceModel } from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { UserContributions, UserData } from \"./types\";\n\nexport class UserModel extends ResourceModel<UserData, UserContributions> {\n override get type() {\n return \"User\";\n }\n\n static override get modelName() {\n return \"UserModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n const contributions = data.contributions;\n\n if (\n contributions &&\n \"resourcetype\" in contributions &&\n contributions.resourcetype &&\n typeof contributions.resourcetype === \"string\"\n ) {\n return contributions.resourcetype === \"userdata\";\n }\n\n return false;\n }\n\n get username() {\n return this.getDataAsString(\"Username\", \"Guest\");\n }\n\n get fullname() {\n return this.getDataAsString(\"Fullname\", \"Guest\");\n }\n}\n","import { Cache } from \"../../utils/storage/Cache\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { UserModel } from \"./UserModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type { UserServicesContributions, UserServicesData } from \"./types\";\n\nexport class UserServicesModel extends ResourceModel<\n UserServicesData,\n UserServicesContributions\n> {\n private _user?: UserModel;\n private _mustChangePassword = false;\n\n static override get modelName() {\n return \"UserServicesModel\";\n }\n\n get type() {\n return \"UserServices\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"user_services\";\n }\n\n override getInitialChildModelLinks() {\n const userLink = this.userLink;\n return userLink ? [userLink] : [];\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n _errors: ErrorResponse[],\n ) {\n this.user = models.find((model) => model instanceof UserModel);\n }\n\n get userLink() {\n return this.links.getLinkByKey(\"Userdata\");\n }\n\n get user() {\n return this._user;\n }\n\n set user(user: UserModel | undefined) {\n this._user = user;\n }\n\n get changePassword() {\n return this.links.getLinkByKey(\"ChangePassword\")?.href;\n }\n\n get isLoggedIn() {\n const hasUser = this.user instanceof UserModel;\n\n // when more than three unsecure links are present (always present: self, contributions and api-docs),\n // the userservice is permitted and thus we have an indication the user is probably logged in\n const UNSECURE_LINK_COUNT = 3;\n return (\n this.links.length > UNSECURE_LINK_COUNT ||\n hasUser ||\n Cache.getItem(\"basic-ok\") === true\n );\n }\n\n set mustChangePassword(mustChangePassword: boolean) {\n this._mustChangePassword = mustChangePassword;\n }\n\n get mustChangePassword(): boolean {\n return this._mustChangePassword;\n }\n}\n","import { DEFAULT_AUTHENTICATION_TYPE } from \"../../constants/Constants\";\nimport { NotAllowedUriException } from \"../../exceptions/NotAllowedUriException\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { LinkModel } from \"../links/LinkModel\";\nimport { UserServicesModel } from \"../user/UserServicesModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { AuthenticationType } from \"../../modularui/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type { ApplicationContributions, ApplicationData } from \"./types\";\n\nexport class ApplicationModel extends ResourceModel<\n ApplicationData,\n ApplicationContributions\n> {\n private _userServices?: UserServicesModel;\n\n static override get modelName() {\n return \"ApplicationModel\";\n }\n\n get type() {\n return \"Application\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"Application\";\n }\n\n /**\n * Getting the tab links\n */\n get tabs() {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog() {\n return LinkModel.create(\n \"modelcatalog\",\n \"/modelcatalog\",\n \"Model catalog\",\n this.modelOptions,\n );\n }\n\n get userServices() {\n return this._userServices;\n }\n\n set userServices(userServices) {\n this._userServices = userServices;\n }\n\n get user() {\n return this.userServices?.user;\n }\n\n get userHref() {\n return this.userServices?.userLink?.href;\n }\n\n override getInitialChildModelLinks() {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\",\n );\n }\n\n return userService ? [userService] : [];\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n _errors: ErrorResponse[],\n ) {\n this.userServices = models.find(\n (model) => model instanceof UserServicesModel,\n );\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn() {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n get userMustChangePassword() {\n return this.userServices?.mustChangePassword ?? false;\n }\n\n /**\n * Getting the authentication types of the application\n */\n get authenticationTypes(): AuthenticationType[] {\n const authenticationTypes = this.getContributionAsArray(\"security\", [\n DEFAULT_AUTHENTICATION_TYPE,\n ]);\n\n if (authenticationTypes) {\n //put primary first\n return authenticationTypes?.sort((a, b) =>\n a.isPrimary === b.isPrimary ? 0 : a.isPrimary ? -1 : 1,\n );\n }\n\n return [DEFAULT_AUTHENTICATION_TYPE];\n }\n}\n","import has from \"lodash/has\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\nimport {\n CREATE_ACTION,\n DELETE_ACTION,\n UPDATE_ACTION,\n} from \"../../layouthints/LayoutHints\";\nimport { AttributeCollection } from \"../attributes/AttributeCollection\";\nimport { BaseModel } from \"../base/BaseModel\";\nimport { Href } from \"../href/Href\";\nimport { ProcessStatusSettingsModel } from \"../process/ProcessStatusSettingsModel\";\n\nimport type { AttributeContributions } from \"../attributes/types\";\nimport type {\n ProcessStatusSettingsContributions,\n ProcessStatusSettingsData,\n} from \"../process/types\";\nimport type { ModelOptions } from \"../types\";\nimport type { ActionContributions, ActionData } from \"./types\";\n\nexport class ActionModel extends BaseModel<ActionData, ActionContributions> {\n private _fieldCollection: AttributeCollection;\n private _selfhref: Href | undefined;\n private _icon: string | undefined;\n\n constructor(\n data?: ActionData,\n contributions?: ActionContributions,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n this._fieldCollection = this.createFieldCollection(modelOptions);\n }\n\n static create(\n name: string,\n href: string,\n label: string,\n type = \"form\",\n origin?: string,\n contextPath?: string,\n ) {\n const data = { name, href };\n const contributions = { name, label: label ?? name, type };\n return new ActionModel(data, contributions, { origin, contextPath });\n }\n\n private createFieldCollection(modelOptions?: ModelOptions) {\n let fieldsData = {};\n let fieldsContributions = [] as Record<string, AttributeContributions>[];\n\n if (\n \"fields\" in this.data &&\n typeof this.data.fields === \"object\" &&\n this.data.fields != null\n ) {\n fieldsData = this.data.fields;\n }\n\n if (\n \"fields\" in this.contributions &&\n Array.isArray(this.contributions.fields)\n ) {\n fieldsContributions = this.contributions.fields;\n }\n\n return new AttributeCollection(fieldsData, fieldsContributions, {\n ...modelOptions,\n isReadonly: true,\n });\n }\n\n get isDisabled() {\n return !this.data.href;\n }\n\n get selfhref() {\n return (\n this._selfhref ??\n new Href(\n `${this.data.href}?${this.querystring}`,\n \"Form\",\n this.modelOptions,\n )\n );\n }\n\n set selfhref(href: Href) {\n this._selfhref = href;\n }\n\n /**\n * retrieve request method\n */\n get method() {\n const method = this.getDataAsString(\"method\", HTTP_METHODS.POST);\n return HTTP_METHODS[method as keyof typeof HTTP_METHODS];\n }\n\n /**\n * Retrieve type of method\n */\n get type() {\n if (this.layouthint.has(CREATE_ACTION)) {\n return \"create\";\n }\n if (this.layouthint.has(UPDATE_ACTION)) {\n return \"update\";\n }\n if (this.layouthint.has(DELETE_ACTION)) {\n return \"delete\";\n }\n\n return this.getContributionAsString(\"type\", \"general\");\n }\n\n /**\n * Retrieve name of action\n */\n get name() {\n return this.getDataAsString(\"name\", \"unknown\");\n }\n\n /**\n * retrieve the collection of field attributes as an array\n */\n get fields() {\n return this._fieldCollection.all;\n }\n\n /**\n * Retrieve the field collection\n */\n get fieldCollection() {\n return this._fieldCollection;\n }\n\n set fieldCollection(fieldCollection: AttributeCollection) {\n this._fieldCollection = fieldCollection;\n }\n\n /**\n * Retrieve querystring of action\n */\n get querystring() {\n return this.fields\n .filter((attribute) => attribute.value != null && attribute.value !== \"\")\n .map((attribute) => {\n const { value } = attribute;\n if (value !== null) {\n return `${attribute.name}=${value}`;\n }\n return attribute.name;\n })\n .join(\"&\");\n }\n\n /**\n * Retrieve a field by it's key\n */\n getFieldByKey(key: string) {\n return this._fieldCollection.getAttributeByKey(key);\n }\n\n /**\n * Indicates if field exists by the given key\n */\n hasFieldByKey(key: string) {\n const f = this.getFieldByKey(key);\n return f != null;\n }\n\n /**\n * Getting the key/name of this action\n */\n get key() {\n return this.getDataAsString(\"name\");\n }\n\n /**\n * Getting the label of the action\n */\n get label() {\n return this.getContributionAsString(\"label\", this.key);\n }\n\n get isProcessTask() {\n return has(this.contributions, \"processTask\");\n }\n\n get processStatus() {\n if (this.isProcessTask) {\n const d = this.data.processStatus || {};\n const c = this.contributions.processTask || {};\n\n return new ProcessStatusSettingsModel(\n d as ProcessStatusSettingsData,\n c as ProcessStatusSettingsContributions,\n this.modelOptions,\n );\n }\n return undefined;\n }\n\n get icon() {\n return this._icon;\n }\n\n set icon(icon: string | undefined) {\n this._icon = icon;\n }\n}\n","import { BaseCollection } from \"../base/BaseCollection\";\nimport { ActionModel } from \"./ActionModel\";\n\nimport type { ModelOptions } from \"../types\";\nimport type { ActionContributions, ActionData } from \"./types\";\n\nexport class ActionCollection extends BaseCollection<ActionModel> {\n constructor(\n data?: ActionData[],\n contributions?: ActionContributions[],\n modelOptions?: ModelOptions,\n ) {\n super();\n this.collection = this.createCollection(data, contributions, modelOptions);\n }\n\n createCollection(\n data?: ActionData[],\n contributions?: ActionContributions[],\n modelOptions?: ModelOptions,\n ) {\n const actionModels = [];\n\n if (\n data &&\n contributions &&\n Array.isArray(data) &&\n Array.isArray(contributions)\n ) {\n for (const action of data) {\n const contribution = contributions.find((c) => {\n if (\n typeof c === \"object\" &&\n c !== null &&\n \"name\" in c &&\n \"type\" in c &&\n \"name\" in action\n ) {\n return c.name === action.name && c.type !== \"service-operation\";\n }\n return;\n });\n\n if (contribution) {\n actionModels.push(\n new ActionModel(action, contribution, modelOptions),\n );\n }\n }\n }\n\n return actionModels;\n }\n\n /**\n * Retrieve action by key\n */\n getActionByKey(key: string) {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) => action.key === key);\n\n return newCollection.first;\n }\n\n /**\n * Retrieve actions by type\n */\n getActionsByType(type: string | string[]) {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) =>\n Array.isArray(type) ? type.includes(action.type) : action.type === type,\n );\n\n return newCollection;\n }\n\n /**\n * Retrieve actions including a layout hint\n */\n getActionsByLayoutHint(...hints: string[]) {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) =>\n action.layouthint.has(...hints),\n );\n\n return newCollection;\n }\n\n /**\n * Indicates if an action with layout hint exists\n */\n hasActionsByLayoutHint(...hints: string[]) {\n return this.getActionsByLayoutHint(...hints).length > 0;\n }\n\n /**\n * Use as path regex for react router routes\n */\n get routePath() {\n const enabledRoutes = this.collection.filter(\n (action) => !action.isDisabled,\n );\n\n if (enabledRoutes.length === 0) {\n return \"__NON_EXISTING_ROUTE__\";\n }\n\n const path = enabledRoutes.map((action) => action.selfhref.path).join(\"|\");\n\n return this.length > 1 ? `(${path})` : path;\n }\n}\n","import { TITLE } from \"../../layouthints/LayoutHints\";\nimport { ActionCollection } from \"../actions/ActionCollection\";\nimport { AttributeCollection } from \"../attributes/AttributeCollection\";\nimport { ResourceModel } from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels, ModularUIModel } from \"../types\";\nimport type {\n BaseDetailContributions,\n DetailData,\n DetailPanelContributions,\n} from \"./types\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport class DetailModel<\n D extends DetailData = DetailData,\n C extends BaseDetailContributions = DetailPanelContributions,\n> extends ResourceModel<D, C> {\n private _attributeCollection: AttributeCollection;\n private _metadataCollection: AttributeCollection;\n private _actionCollection: ActionCollection;\n\n constructor(modularuiResponse?: ModularUIResponse) {\n super(modularuiResponse);\n\n this._attributeCollection = this.createAttributeCollection();\n this._metadataCollection = this.createMetadataCollection();\n this._actionCollection = this.createActionCollection();\n }\n\n get type() {\n return \"Detail\";\n }\n\n static override get modelName() {\n return \"DetailModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n const resourceType = data.resourcetype;\n const endsWithDetailPanel = resourceType.endsWith(\"DetailPanel\");\n const otherPanel = [\n \"Detail\",\n \"CasePropertiesPanel\",\n \"CasePropertiesPanelDetail\",\n ].includes(resourceType);\n\n return endsWithDetailPanel || otherPanel;\n }\n\n override getInitialChildModelLinks() {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n errors: ErrorResponse[],\n ) {\n this._attributeCollection.setChildModels(models, errors);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id() {\n const id = this.getDataAsNumber(\"_id\");\n if (id) {\n return id;\n }\n return this.getDataAsString(\"_id\", this.key);\n }\n\n override get label() {\n return this.getContributionAsString(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.getContributionAsArray(\n \"attributes\",\n [],\n ).filter((contribution: object) => {\n const [key] = Object.keys(contribution);\n return key in this.data;\n });\n\n return new AttributeCollection(this.data, attributeContributions, {\n ...this.modelOptions,\n isReadonly: true,\n });\n }\n\n get attributeCollection() {\n return this._attributeCollection;\n }\n\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes() {\n return this.attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.has(TITLE) && !attribute.isHidden,\n );\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string) {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadata: object = this.getContributionAsObject(\"metadata\", {});\n\n const metadataContributions = Object.entries(metadata).map(\n ([key, value]) => ({ [key]: value }),\n );\n\n return new AttributeCollection(this.data, metadataContributions, {\n ...this.modelOptions,\n isReadonly: true,\n });\n }\n\n get metadataCollection() {\n return this._metadataCollection;\n }\n\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n const actionsData = this.getDataAsArray(\"actions\", []);\n const actionsContributions = this.getContributionAsArray(\"actions\", []);\n\n return new ActionCollection(actionsData, actionsContributions);\n }\n\n get actionCollection() {\n return this._actionCollection;\n }\n\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase() {\n return this.getContributionAsString(\"resourcetype\") === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute() {\n return this._attributeCollection.getAttributeByLayoutHint(TITLE);\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel) {\n if (model instanceof DetailModel) {\n const clonedModel = new DetailModel(model.modularuiResponse);\n\n clonedModel.attributeCollection = model.attributeCollection;\n clonedModel.metadataCollection = model.metadataCollection;\n clonedModel.actionCollection = model.actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n equals(model: DetailModel) {\n return this.id?.toString() === model.id?.toString();\n }\n}\n","import { BaseCollection } from \"../base/BaseCollection\";\n\nimport type { TaskGroupModel } from \"./TaskGroupModel\";\n\nexport class TaskGroupCollection extends BaseCollection<TaskGroupModel> {\n /**\n * Indicates if the taskgroup collection has has tasks\n */\n hasTasks() {\n return this.collection.some((taskgroup) => taskgroup.hasTasks());\n }\n}\n","import { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport { ActionCollection } from \"../actions/ActionCollection\";\nimport { ResourceModel } from \"../base/ResourceModel\";\n\nimport type { ModelOptions } from \"../types\";\nimport type { TaskGroupContributions, TaskGroupData } from \"./types\";\n\nexport class TaskGroupModel extends ResourceModel<\n TaskGroupData,\n TaskGroupContributions\n> {\n private _actionCollection: ActionCollection;\n\n constructor(response?: ModularUIResponse) {\n super(response);\n\n const actionsData =\n this.data.actions && Array.isArray(this.data.actions)\n ? this.data.actions\n : [];\n const actionsContributions =\n this.contributions.actions && Array.isArray(this.contributions.actions)\n ? this.contributions.actions\n : [];\n\n this._actionCollection = new ActionCollection(\n actionsData,\n actionsContributions,\n );\n\n try {\n const selfHref = this.selflink.href.href;\n if (selfHref) {\n this.key = selfHref.substring(selfHref.lastIndexOf(\"/\") + 1);\n }\n } catch {\n this.key = this.getDataAsString(\"name\", \"unknown\");\n }\n }\n\n static create(\n key: string,\n data: TaskGroupData,\n contributions: TaskGroupContributions,\n modelOptions?: ModelOptions,\n ) {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n taskgroup.origin = modelOptions?.origin;\n taskgroup.contextPath = modelOptions?.contextPath;\n\n return new TaskGroupModel(taskgroup);\n }\n\n get type() {\n return \"TaskGroup\";\n }\n\n static override get modelName() {\n return \"TaskGroupModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"TaskGroup\";\n }\n\n hasTasks() {\n return this.actionCollection.length > 0;\n }\n\n get actionCollection() {\n return this._actionCollection;\n }\n}\n","import { IllegalStateException } from \"../../exceptions/IllegalStateException\";\nimport { TITLE } from \"../../layouthints/LayoutHints\";\nimport { DetailModel } from \"../detail/DetailModel\";\nimport { TaskGroupCollection } from \"../taskgroup/TaskGroupCollection\";\nimport { TaskGroupModel } from \"../taskgroup/TaskGroupModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ActionContributions, ActionData } from \"../actions/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type { CaseViewContributions, CaseViewData } from \"./types\";\n\n/**\n * Model containing the details of one case.\n */\nexport class CaseViewModel extends DetailModel<\n CaseViewData,\n CaseViewContributions\n> {\n private _taskGroupCollection: TaskGroupCollection;\n\n constructor(caseviewData?: ModularUIResponse) {\n super(caseviewData);\n\n this._taskGroupCollection = this.createTaskGroupCollection();\n }\n\n override get type() {\n return \"CaseView\";\n }\n\n static override get modelName() {\n return \"CaseViewModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"CaseView\";\n }\n\n override getInitialChildModelLinks() {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n /**\n * Getting panel links\n */\n get panelLinks() {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n errors: ErrorResponse[],\n ) {\n super.setChildModels(models, errors);\n\n const taskGroupModels = models.filter(\n (model): model is TaskGroupModel => model instanceof TaskGroupModel,\n );\n\n this.taskGroupCollection.add(taskGroupModels);\n }\n\n /**\n * Getting the case name\n */\n get casename() {\n return this.attributeCollection.getAttributeByLayoutHint(TITLE);\n }\n\n /**\n * Retrieve the case label, this can be configured with a case property with the layout hint 'title'\n */\n override get label() {\n return this.casename?.readonlyvalue || \"\";\n }\n\n /**\n * Retrieve the label that was configured on the caseview\n */\n get viewLabel() {\n return this.getContributionAsString(\"label\", \"\");\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText() {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the case view\n */\n get introtext() {\n const content = this.data._content;\n\n if (\n content &&\n \"text\" in content &&\n typeof content.text === \"object\" &&\n content.text != null &&\n \"message\" in content.text\n ) {\n return content.text.message;\n }\n\n const contributions = this.contributions;\n if (contributions.text) {\n if (\n typeof contributions.text === \"object\" &&\n \"message\" in contributions.text &&\n typeof contributions.text.message === \"string\"\n ) {\n return contributions.text.message;\n }\n return contributions.text;\n }\n\n if (Array.isArray(contributions.texts)) {\n return contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n * Getting the self href\n */\n override get selfhref() {\n const selfLink = this.links.getLinkByKey(\"self\");\n\n if (selfLink == null) {\n throw new IllegalStateException(\"No self href available\");\n }\n\n return selfLink.href;\n }\n\n private createTaskGroupCollection() {\n const data = this.getDataAsArray(\"taskgroups\", []) as {\n actions: ActionData[];\n name: string;\n }[];\n const contributions = this.getContributionAsArray(\"taskgroups\", []) as {\n name: string;\n label: string;\n actions: ActionContributions[];\n }[];\n\n const taskgroups = [];\n\n for (const taskgroupData of data) {\n const name = taskgroupData.name;\n const taskgroupContributions = contributions.find(\n (taskgroupContribution) => taskgroupContribution.name === name,\n );\n\n if (taskgroupContributions) {\n const taskgroup = TaskGroupModel.create(\n name,\n taskgroupData,\n taskgroupContributions,\n this.modelOptions,\n );\n taskgroups.push(taskgroup);\n }\n }\n\n return new TaskGroupCollection(taskgroups);\n }\n\n set taskGroupCollection(taskgroups: TaskGroupCollection) {\n this._taskGroupCollection = taskgroups;\n }\n\n get taskGroupCollection() {\n return this._taskGroupCollection;\n }\n\n hasTaskGroups() {\n return this.taskGroupCollection && this.taskGroupCollection.hasItems();\n }\n}\n","import { ResourceCollection } from \"../base/ResourceCollection\";\n\nimport type { ConceptLinkModel } from \"./ConceptLinkModel\";\n\nexport class ConceptLinkCollection extends ResourceCollection<ConceptLinkModel> {}\n","import { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\nimport { DateUtil } from \"../../utils/datetime/DateTimeUtil\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { FilterCollection } from \"../filters/FilterCollection\";\nimport { ConceptLinkCollection } from \"./ConceptLinkCollection\";\nimport { ConceptLinkModel } from \"./ConceptLinkModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type { ConceptIndexContributions, ConceptIndexData } from \"./types\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport class ConceptIndexModel extends ResourceModel<\n ConceptIndexData,\n ConceptIndexContributions\n> {\n private _filterCollection: FilterCollection;\n private _concepts: ConceptLinkCollection;\n\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ConceptLinkCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n get type() {\n if (this.resourcetype.toLowerCase() === \"relatedconcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n static override get modelName() {\n return \"ConceptIndexModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n const resourceType = data.resourcetype;\n return (\n resourceType === \"ConceptSearch\" ||\n resourceType.toLowerCase() === \"relatedconcepts\"\n );\n }\n\n override getInitialChildModelLinks() {\n return this.items.getInitialChildModelLinks();\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n errors: ErrorResponse[],\n ) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n override get selfhref() {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems()) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n override get label() {\n return this.getContributionAsString(\"label\", \"\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection() {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter() {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate() {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value as string;\n }\n\n return DateUtil.now();\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter() {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get model category filter\n */\n get modelCategoryFilter() {\n return this.filterCollection.getFilterByAttributeKey(\"modelCategory\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items() {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection) {\n this._concepts = itemCollection;\n }\n}\n","import { ResourceCollection } from \"../base/ResourceCollection\";\n\nimport type { ContentLinkModel } from \"./ContentLinkModel\";\n\nexport class ContentLinkCollection extends ResourceCollection<ContentLinkModel> {}\n","import { ChoiceAttributeModel } from \"../attributes/ChoiceAttributeModel\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { FilterCollection } from \"../filters/FilterCollection\";\nimport { Href } from \"../href/Href\";\nimport { ContentLinkCollection } from \"./ContentLinkCollection\";\nimport { ContentLinkModel } from \"./ContentLinkModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type { ContentIndexContributions, ContentIndexData } from \"./types\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport class ContentIndexModel extends ResourceModel<\n ContentIndexData,\n ContentIndexContributions\n> {\n private _filterCollection: FilterCollection;\n private _content: ContentLinkCollection;\n\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._content = new ContentLinkCollection();\n this._content.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (content) =>\n new ContentLinkModel(content.content, undefined, this.modelOptions),\n )\n : [];\n }\n\n get type() {\n return \"ContentIndex\";\n }\n\n static override get modelName() {\n return \"ContentIndexModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"ContentSearch\";\n }\n\n override getInitialChildModelLinks() {\n return this.items.getInitialChildModelLinks();\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n errors: ErrorResponse[],\n ) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n override get selfhref() {\n const href = this.selflink.href;\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n override get label() {\n return this.getContributionAsString(\"label\", \"unknown\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection() {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter() {\n return this._filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve content collection\n */\n get items() {\n return this._content;\n }\n\n hasIndexFilter() {\n const filterAttribute = this.indexfilter?.attribute;\n\n return (\n filterAttribute instanceof ChoiceAttributeModel &&\n filterAttribute.options.length > 0\n );\n }\n\n hasFiltersSet() {\n return this.filterCollection.some((filter) => filter.isActive());\n }\n\n hasNoFiltersSet() {\n return !this.hasFiltersSet();\n }\n\n getFirstCharHref() {\n const filterAttribute = this.indexfilter?.attribute;\n\n let firstChar = \"#\";\n if (filterAttribute instanceof ChoiceAttributeModel) {\n firstChar = filterAttribute.options.filter(\n (option) => option.code !== \"0\",\n )[0].code;\n }\n\n return new Href(this.selfhref).addParameter(\"index\", firstChar);\n }\n}\n","import { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { FilterCollection } from \"../filters/FilterCollection\";\nimport { Href } from \"../href/Href\";\nimport { ContentLinkModel } from \"./ContentLinkModel\";\nimport { ContentTypeModel } from \"./ContentTypeModel\";\nimport { SectionModel } from \"./SectionModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type {\n ContentContributions,\n ContentDataItem,\n ContentDataSection,\n ContentLinkData,\n ContentTOCData,\n SectionData,\n} from \"./types\";\n\n/**\n * Content detail model\n */\nexport class ContentTOCModel extends ResourceModel<\n ContentTOCData,\n ContentContributions\n> {\n private _contentType: ContentTypeModel | undefined;\n private _filterCollection: FilterCollection;\n\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n },\n this.modelOptions,\n );\n }\n\n get type() {\n return \"ContentTOC\";\n }\n\n static override get modelName() {\n return \"ContentTOCModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"ContentTOC\";\n }\n\n override getInitialChildModelLinks() {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n _errors: ErrorResponse[],\n ) {\n this.contentType = models.find(\n (model) => model instanceof ContentTypeModel,\n );\n }\n\n /**\n * Get content label\n */\n override get label() {\n return this.getDataAsString(\"label\", \"\");\n }\n\n get abbreviation() {\n return this.getDataAsString(\"abbreviation\");\n }\n\n /**\n * Getting the self link of this list\n */\n override get selfhref() {\n const href = new Href(this.selflink.href);\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref() {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n return href;\n }\n\n return;\n }\n\n get selfContentLink() {\n return new ContentLinkModel(this.data, this.entryDate, this.modelOptions);\n }\n\n private getItems(items: ContentDataItem[]) {\n return items.map((item) => {\n const link = new ContentLinkModel(\n item,\n this.entryDate,\n this.modelOptions,\n );\n if (typeof item.items !== \"undefined\") {\n link.items = this.getItems(item.items);\n }\n return link;\n });\n }\n\n private getSectionItems(sections: ContentDataSection[]) {\n return sections.map((section) => {\n const link = new ContentLinkModel(\n section,\n this.entryDate,\n this.modelOptions,\n );\n if (typeof section.sections !== \"undefined\") {\n link.items = this.getItems(section.sections);\n }\n return link;\n });\n }\n\n /**\n * Get sub items of toc\n */\n get items() {\n if (Array.isArray(this.data.items)) {\n return this.getItems(this.data.items);\n }\n\n if (Array.isArray(this.data.sections)) {\n return this.getSectionItems(this.data.sections);\n }\n\n return [];\n }\n\n get sections() {\n if (this.data.sections) {\n const sections = this.data.sections as SectionData[];\n return sections.map(\n (section) =>\n new SectionModel(section, this.entryDate, this.modelOptions),\n );\n }\n return [];\n }\n\n /**\n * get categories of content\n */\n get categories() {\n if (Array.isArray(this.data.categories)) {\n return this.data.categories.map(\n (category) =>\n new ContentLinkModel(\n category as ContentLinkData,\n undefined,\n this.modelOptions,\n ),\n );\n }\n\n return [];\n }\n\n /**\n * Retrieve content type model\n */\n get contentType() {\n return this._contentType;\n }\n\n set contentType(contentType: ContentTypeModel | undefined) {\n this._contentType = contentType;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate() {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n\n return timeversionFilter?.attribute?.value as string | undefined;\n }\n\n get isCompleteSource(): boolean {\n const completeFilter =\n this.filterCollection.getFilterByAttributeKey(\"complete\");\n return completeFilter?.attribute?.value === \"true\";\n }\n}\n","import { has } from \"lodash\";\n\nimport { AttributeFactory } from \"../../attributes/AttributeFactory\";\nimport { AttributeSetModel } from \"../../attributes/AttributeSetModel\";\nimport { CompositeAttributeModel } from \"../../attributes/CompositeAttributeModel\";\nimport { ContentConfiguration } from \"../../contentconfiguration/ContentConfiguration\";\nimport { DetailModel } from \"../../detail/DetailModel\";\n\nimport type { ModularUIResponse } from \"../../../modularui/ModularUIResponse\";\nimport type {\n AttributeData,\n CompositeAttributeContributions,\n} from \"../../attributes/types\";\nimport type { ErrorResponse } from \"../../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../../types\";\nimport type { ListItemModel } from \"../ListItemModel\";\nimport type { ListDetailContributions, ListDetailData } from \"../types\";\n\n/**\n * Detail of a list item\n */\nexport class ListDetailModel extends DetailModel<\n ListDetailData,\n ListDetailContributions\n> {\n private _contentConfiguration: ContentConfiguration;\n private _listitem: ListItemModel | undefined;\n private _givenAnswers: CompositeAttributeModel | undefined;\n private _results: CompositeAttributeModel | undefined;\n private _eventdata: AttributeSetModel[];\n\n constructor(modularUIResponse?: ModularUIResponse) {\n super(modularUIResponse);\n\n this._contentConfiguration = new ContentConfiguration(\n this.contributions ? this.contributions.content : {},\n );\n\n this.setResultSection();\n this._eventdata = this.setEventData();\n }\n\n /**\n * Add links to expand on initialization of this model\n */\n override getInitialChildModelLinks() {\n const listitemPanels = this.listitem\n ? this.listitem.links.getLinksByGroup(\"panel\").all\n : [];\n\n const links = [...super.getInitialChildModelLinks(), ...listitemPanels];\n\n if (this.hasResults) {\n if (this.results) {\n links.push(...this.results.getInitialChildModelLinks());\n }\n if (this.givenAnswers) {\n links.push(...this.givenAnswers.getInitialChildModelLinks());\n }\n }\n\n return links;\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n errors: ErrorResponse[],\n ) {\n this.attributeCollection.setChildModels(models, errors);\n\n if (this.results) {\n this.results.setChildModels(models, errors);\n }\n\n if (this.givenAnswers) {\n this.givenAnswers.setChildModels(models, errors);\n }\n }\n\n override get type() {\n return \"ListDetail\";\n }\n\n static override get modelName() {\n return \"ListDetailModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n let resourcetype = data.resourcetype ?? \"unknown\";\n resourcetype = resourcetype.toLowerCase();\n\n return (\n resourcetype.endsWith(\"listdetail\") ||\n resourcetype.endsWith(\"listpaneldetail\") ||\n resourcetype.endsWith(\"datastorepaneldetail\")\n );\n }\n\n /**\n * Set listitem of this listdetail and transfer listitem actions to listdetail actions\n */\n set listitem(listitem: ListItemModel | undefined) {\n this._listitem = listitem;\n if (listitem) {\n this.actionCollection = listitem.actionCollection;\n }\n }\n\n get listitem() {\n return this._listitem;\n }\n\n /**\n * Getting panel links\n */\n get panelLinks() {\n return this.listitem?.links.getLinksByGroup(\"panel\");\n }\n\n /**\n * Getting the contentConfiguration\n */\n get contentConfiguration() {\n return this._contentConfiguration;\n }\n\n set contentConfiguration(configuration: ContentConfiguration) {\n this._contentConfiguration = configuration;\n }\n\n /**\n * Getting the introduction text configured on the case view\n */\n get introtext() {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n setResultSection() {\n const resultSectionContributions = this.contributions.resultSection;\n const resultSectionData = this.data.resultSection;\n\n if (resultSectionData && resultSectionContributions) {\n this.setResults(\n resultSectionData.results,\n resultSectionContributions.results,\n );\n this.setGivenAnswers(\n resultSectionData.givenAnswers,\n resultSectionContributions.givenAnswers,\n );\n }\n }\n\n setResults(\n resultsData: undefined | Record<string, AttributeData>,\n resultsContributions: undefined | CompositeAttributeContributions,\n ) {\n if (resultsData && resultsContributions) {\n if (resultsContributions.type === \"composite\") {\n resultsContributions.children = resultsContributions.children.filter(\n (child) => {\n const childKey = Object.keys(child)[0];\n return childKey in resultsData;\n },\n );\n }\n\n const results = AttributeFactory.createAttribute(\n \"results\",\n {\n key: \"results\",\n dynamicschema: this.data.dynamicschema,\n content: this.data.content?.results,\n ...this.data.resultSection,\n },\n resultsContributions,\n this.modelOptions,\n );\n\n if (results instanceof CompositeAttributeModel) {\n results.isResult = true;\n results.indicateContentConfiguration(this.contentConfiguration);\n this._results = results;\n }\n }\n }\n\n setGivenAnswers(\n givenAnswersData: undefined | Record<string, AttributeData>,\n givenAnswersContributions: undefined | CompositeAttributeContributions,\n ) {\n if (givenAnswersData && givenAnswersContributions) {\n const filteredContributions = {\n ...givenAnswersContributions,\n children: givenAnswersContributions.children.filter((child) => {\n const childKey = Object.keys(child)[0];\n return childKey in givenAnswersData;\n }),\n };\n\n const givenAnswers = AttributeFactory.createAttribute(\n \"givenAnswers\",\n {\n key: \"givenAnswers\",\n dynamicschema: this.data.dynamicschema,\n content: this.data.content?.givenAnswers,\n ...this.data.resultSection,\n },\n filteredContributions,\n this.modelOptions,\n );\n\n if (givenAnswers instanceof CompositeAttributeModel) {\n givenAnswers.isResult = true;\n this._givenAnswers = givenAnswers;\n }\n }\n }\n\n get givenAnswers() {\n return this._givenAnswers;\n }\n\n get hasResults() {\n return has(this.contributions, \"resultSection\");\n }\n\n get results() {\n return this._results;\n }\n\n get hasEventData() {\n return (\n has(this.contributions, \"eventdata\") &&\n has(this.data, \"eventdata\") &&\n this.data.eventdata != null &&\n this.contributions.eventdata != null\n );\n }\n\n setEventData() {\n if (!this.data.eventdata || !this.contributions.eventdata) {\n return [];\n }\n\n const eventdata: AttributeSetModel[] = [];\n\n const { eventdata: eventdataData, dynamicschema } = this.data;\n const eventdataContributions = this.contributions.eventdata;\n\n eventdataContributions.forEach((attributeset) => {\n for (const attributesetKey of Object.keys(attributeset)) {\n const attributesetContributions = attributeset[attributesetKey];\n const attributesetData = eventdataData[attributesetKey];\n\n if (!attributesetData) continue;\n\n if (Array.isArray(attributesetData)) {\n attributesetData.forEach((item, index) => {\n const key = `${attributesetKey}-${index + 1}`;\n eventdata.push(\n new AttributeSetModel(\n key,\n { ...item, dynamicschema },\n attributesetContributions,\n this.modelOptions,\n ),\n );\n });\n } else {\n eventdata.push(\n new AttributeSetModel(\n attributesetKey,\n { ...attributesetData, dynamicschema },\n attributesetContributions,\n this.modelOptions,\n ),\n );\n }\n }\n });\n\n return eventdata;\n }\n\n get eventdata() {\n return this._eventdata;\n }\n}\n","import { immerable } from \"immer\";\n\nimport { AttributeCollection } from \"../../attributes/AttributeCollection\";\n\nimport type {\n AttributeModel,\n NamedDynamicSchema,\n} from \"../../attributes/types\";\nimport type { ModelOptions } from \"../../types\";\nimport type { GroupData, GroupingContributions, GroupingData } from \"../types\";\n\n/**\n * Group information model\n * Put GroupModel here because of possible circular dependency with GroupingModel below\n */\nexport class GroupModel {\n private _group: GroupData & {\n dynamicschema: NamedDynamicSchema | undefined;\n };\n private _context: GroupingContributions | undefined;\n private _attributeCollection: AttributeCollection;\n private _grouping: GroupingModel | undefined;\n\n constructor(\n group: GroupData & {\n dynamicschema: NamedDynamicSchema | undefined;\n },\n context: GroupingContributions | undefined,\n allContexts: GroupingContributions[] | undefined,\n modelOptions?: ModelOptions,\n ) {\n this._group = group;\n this._context = context;\n\n this._attributeCollection = new AttributeCollection(\n group,\n context?.attributes,\n { ...modelOptions, isReadonly: true },\n );\n\n if (group.grouping) {\n this._grouping = new GroupingModel(\n { ...group.grouping, dynamicschema: group.dynamicschema },\n allContexts,\n modelOptions,\n );\n }\n }\n\n get type() {\n return this._group.type;\n }\n\n get id() {\n return this._group._id || \"unknown\";\n }\n\n get label() {\n return this._context?.label;\n }\n\n get attributeCollection() {\n return this._attributeCollection;\n }\n\n get grouping() {\n return this._grouping;\n }\n\n /**\n * Retrieve array of reference id's\n */\n get reference() {\n return this._group.reference || [];\n }\n\n hasAttributeByKey(key: string) {\n if (this.attributeCollection.hasAttributeByKey(key)) {\n return true;\n }\n\n if (this.grouping) {\n return this.grouping.hasAttributeByKey(key);\n }\n\n return false;\n }\n\n getAttributeByKey(key: string): AttributeModel | undefined {\n const attribute = this.attributeCollection.getAttributeByKey(key);\n if (attribute) {\n return attribute;\n }\n\n if (this.grouping) {\n return this.grouping.getAttributeByKey(key);\n }\n\n return undefined;\n }\n}\n\n/**\n * Grouping model to group lists\n */\nexport class GroupingModel {\n [immerable] = true;\n\n private _prefix: string | undefined;\n private _groups: GroupModel[] = [];\n\n constructor(\n data: GroupingData & {\n dynamicschema?: NamedDynamicSchema;\n },\n contexts: GroupingContributions[] | undefined,\n modelOptions?: ModelOptions,\n ) {\n this._prefix = data?.prefix;\n\n if (data?.group) {\n this._groups = this.createGroup(data, contexts, modelOptions);\n }\n }\n\n createGroup(\n data: GroupingData & {\n dynamicschema?: NamedDynamicSchema;\n },\n contexts: GroupingContributions[] | undefined,\n modelOptions?: ModelOptions,\n ) {\n if (!data.group) {\n return [];\n }\n\n const context = this.getContextFromContributionsByPrefix(\n contexts,\n this._prefix,\n );\n\n return data.group.map((group) => {\n const dynamicschema = this.getDynamicSchema(\n group.type,\n data.dynamicschema,\n );\n\n const d = {\n ...group,\n dynamicschema,\n } as GroupData & {\n dynamicschema: NamedDynamicSchema | undefined;\n };\n\n return new GroupModel(d, context, contexts, modelOptions);\n });\n }\n\n /**\n * add grouped prefix to the dynamicschema\n */\n getDynamicSchema(\n groupType: string,\n dynamicschema: NamedDynamicSchema | undefined,\n ) {\n if (dynamicschema) {\n if (\n this._prefix &&\n dynamicschema[groupType] &&\n !dynamicschema[this._prefix + groupType]\n ) {\n dynamicschema[this._prefix + groupType] = dynamicschema[groupType];\n }\n return dynamicschema;\n }\n return undefined;\n }\n\n /**\n * Retrieve groups of grouping\n */\n get groups() {\n return this._groups;\n }\n\n /**\n * Inidicates if Grouping has one or more groups\n */\n hasGroups() {\n return this._groups.length > 0;\n }\n\n /**\n * Get context of grouping\n */\n getContextFromContributionsByPrefix(\n contexts?: GroupingContributions[],\n prefix?: string,\n ) {\n if (contexts && prefix) {\n return contexts.find((context) => context.prefix === prefix);\n }\n return undefined;\n }\n\n hasAttributeByKey(key: string): boolean {\n return this.groups.some((group: GroupModel) =>\n group.hasAttributeByKey(key),\n );\n }\n\n getAttributeByKey(key: string) {\n const groupByKey = this.groups.find((group: GroupModel) =>\n group.hasAttributeByKey(key),\n );\n\n if (groupByKey) {\n return groupByKey.getAttributeByKey(key);\n }\n\n return undefined;\n }\n\n getGroupByAttributeKey(key: string) {\n return this.groups.find((group) => group.hasAttributeByKey(key));\n }\n}\n","import { Href } from \"../href/Href\";\n\nimport type { HistoryLocation } from \"../../types/types\";\nimport type { FilterCollection } from \"../filters/FilterCollection\";\nimport type { Parameter } from \"../parameter/Parameter\";\nimport type { ListModel } from \"./ListModel\";\n\n/**\n * Class representing the href of a list. It adds paging, sorting and filter parameters where necessary\n */\nexport class ListHref extends Href {\n private _isPrefixed: boolean;\n private _prefix: string | undefined;\n private _pagingName: string | undefined;\n private _pagesizeName: string | undefined;\n private _sortingName: string | undefined;\n\n constructor(\n href?: Href | string | HistoryLocation,\n list?: ListModel,\n isPrefixed = true,\n ) {\n super(href, undefined);\n\n this._isPrefixed = isPrefixed;\n\n if (list) {\n this.setParameterNamesFromListModel(list);\n } else if (href != null && href instanceof ListHref) {\n this.setParameterNamesFromHref(href);\n }\n }\n\n /**\n * Retrieve parameter names from Href\n */\n setParameterNamesFromHref(href: ListHref) {\n this._prefix = this._isPrefixed ? href.prefix : undefined;\n this._pagingName = href.pagingName;\n this._pagesizeName = href.pagesizeName;\n this._sortingName = href.sortingName;\n }\n\n /**\n * Retrieve parameter names and settings from List model\n */\n setParameterNamesFromListModel(list: ListModel) {\n this._prefix = this._isPrefixed ? list.key : undefined;\n\n this._pagingName = list.paging ? list.paging.name : \"\";\n this._pagesizeName =\n list.paging && list.paging.pagesize ? list.paging.pagesize.name : \"\";\n\n this._sortingName = list.sorting ? list.sorting.name : \"\";\n\n this.page = list.paging?.page;\n this.pagesize =\n list.paging && list.paging.pagesize.options.length > 0\n ? list.paging.pagesize.value\n : undefined;\n\n this.sort = list.sorting?.param;\n\n this.filterCollection = list.filterCollection;\n }\n\n /**\n * Getting prefix\n */\n get prefix() {\n return this._prefix;\n }\n\n /**\n * Getting paging name\n */\n get pagingName() {\n return this._pagingName;\n }\n\n /**\n * Getting pagesize name\n */\n get pagesizeName() {\n return this._pagesizeName;\n }\n\n /**\n * Getting sorting name\n */\n get sortingName() {\n return this._sortingName;\n }\n\n /**\n * Setting the current page\n */\n set page(page: number | undefined) {\n if (this.pagingName) {\n this.setParameter(this.pagingName, page?.toString(), this.prefix);\n }\n }\n\n get page(): Parameter | undefined {\n return this.pagingName\n ? this.getParameter(this.pagingName, this.prefix)\n : undefined;\n }\n\n /**\n * Setting the sort value\n */\n set sort(sort: string | undefined) {\n if (this.sortingName) {\n this.setParameter(this.sortingName, sort, this.prefix);\n }\n }\n\n /**\n * Setting the page size\n */\n set pagesize(pagesize: number | undefined) {\n if (this.pagesizeName) {\n this.setParameter(this.pagesizeName, pagesize?.toString(), this.prefix);\n }\n }\n\n /**\n * Add filter parameters to the parameter collection\n */\n set filterCollection(filters: FilterCollection) {\n if (!filters) {\n return;\n }\n\n filters.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value != null) {\n this.setParameter(param.name, param.value, this.prefix);\n } else {\n this.removeParameter(param.name, this.prefix);\n }\n });\n });\n }\n}\n","import { CASEVIEW_LINK } from \"../../layouthints/LayoutHints\";\nimport { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport { DetailModel } from \"../detail/DetailModel\";\nimport { Href } from \"../href/Href\";\n\nimport type { ChoiceAttributeOptionModel } from \"../attributes/ChoiceAttributeOptionModel\";\nimport type { BaseDetailContributions, DetailData } from \"../detail/types\";\nimport type { ModelOptions } from \"../types\";\n\nexport class ListItemModel extends DetailModel<\n DetailData,\n BaseDetailContributions\n> {\n static createFromListResult(\n key: string,\n data: DetailData,\n contributions: BaseDetailContributions,\n modelOptions?: ModelOptions,\n ): ListItemModel {\n const listitemInput = new ModularUIResponse();\n listitemInput.key = key;\n listitemInput.data = data;\n listitemInput.contributions = contributions;\n listitemInput.origin = modelOptions?.origin;\n listitemInput.contextPath = modelOptions?.contextPath;\n return new ListItemModel(listitemInput);\n }\n\n static createFromChoiceAttributeOption(option: ChoiceAttributeOptionModel) {\n const listitemInput = new ModularUIResponse();\n listitemInput.key = option.code;\n\n const item = new ListItemModel(listitemInput);\n item.attributeCollection = option.attributeCollection;\n return item;\n }\n\n override get selfhref() {\n const selflink = this.links.getLinkByKey(\"self\");\n\n if (selflink) {\n return selflink.href;\n }\n\n return new Href(\"#\");\n }\n\n get caseviewHref() {\n const caseviewLinkAttribute =\n this.attributeCollection.getAttributeByLayoutHint(CASEVIEW_LINK);\n\n if (caseviewLinkAttribute) {\n const caseviewLinkKey = caseviewLinkAttribute.name;\n const caseviewLink = this.links.getLinkByKey(caseviewLinkKey);\n\n if (caseviewLink) {\n return caseviewLink.href;\n }\n }\n\n return this.selfhref;\n }\n\n /**\n * Getting panel links\n */\n get panelLinks() {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n /**\n * Check if list item has panel links\n */\n hasPanelLinks() {\n return this.panelLinks.length > -1;\n }\n\n /**\n * Retrieve all actions by type\n */\n getActionsByType(actionType: string) {\n return this.actionCollection.getActionsByType(actionType);\n }\n\n get additionalDetailRoutePath() {\n const additionalDetailLinks = this.panelLinks;\n\n if (additionalDetailLinks.length === 0) {\n return \"__NON_EXISTING_ROUTE__\";\n }\n\n return additionalDetailLinks.map((link) => link.href.path).join(\"|\");\n }\n}\n","import { ConfigurationException } from \"../../exceptions/ConfigurationException\";\nimport { ActionCollection } from \"../actions/ActionCollection\";\nimport { BaseCollection } from \"../base/BaseCollection\";\nimport { ListItemModel } from \"./ListItemModel\";\n\nimport type { ListModel } from \"./ListModel\";\n\nexport class ListItemCollection extends BaseCollection<ListItemModel> {\n /**\n * Create a list item collection from the given list\n */\n static createFromList(list: ListModel) {\n const _embedded = list.data._embedded;\n if (_embedded) {\n if (Array.isArray(_embedded)) {\n throw new ConfigurationException(\n `One record panel with multiple tables is not supported, place all types in one panel for the panel with key ${list.key}`,\n );\n }\n\n const dynamicschema = list.data.dynamicschema;\n\n const collection = _embedded.results.map((resultItem) => {\n const [key] = Object.keys(resultItem);\n const listitemData = resultItem[key];\n listitemData.dynamicschema = dynamicschema;\n\n const listitemContributions = list.contributions.results[key];\n\n return ListItemModel.createFromListResult(\n key,\n listitemData,\n listitemContributions,\n list.modelOptions,\n );\n });\n\n return new ListItemCollection(collection);\n }\n\n return new ListItemCollection();\n }\n\n get additionalDetailRoutePath() {\n if (this.isEmpty()) {\n return \"__NON_EXISTING_ROUTE__\";\n }\n\n const allRoutes = this.all\n .map((listItem) => listItem.additionalDetailRoutePath)\n .join(\"|\");\n\n if (allRoutes.includes(\"|\")) {\n return `(${allRoutes})`;\n }\n\n return allRoutes;\n }\n\n get actionCollection() {\n const actions = new ActionCollection();\n\n this.all.forEach((listItem) => {\n actions.collection.push(...listItem.actionCollection.all);\n });\n\n return actions;\n }\n}\n","import { immerable } from \"immer\";\n\nimport { PagesizeModel } from \"./PagesizeModel\";\n\nimport type { PagingContributions, PagingData } from \"../types\";\n\nexport class PagingModel {\n [immerable] = true;\n\n private _data: PagingData | null;\n private _contributions: PagingContributions | undefined;\n\n private _page: number | undefined;\n private _pagesize: PagesizeModel;\n\n constructor(\n data: PagingData | null,\n contributions: PagingContributions | undefined,\n ) {\n this._data = data;\n this._contributions = contributions;\n\n this._page = this._data?.page;\n this._pagesize = new PagesizeModel(\n this._data?.pagesize,\n this._contributions?.pagesize,\n );\n }\n\n get isEnabled() {\n return typeof this.page !== \"undefined\";\n }\n\n /**\n * Get the paging parameter name\n */\n get name() {\n return \"page\";\n }\n\n /**\n * Getting paging value\n */\n get value() {\n return this.page;\n }\n\n /**\n * Get maximum pages\n */\n get maxpages() {\n return this._data?.maxpages;\n }\n\n /**\n * Get current page\n */\n get page() {\n return this._page;\n }\n\n set page(page: number | undefined) {\n this._page = page;\n }\n\n /**\n * Get the total number of results\n */\n get totalResults() {\n return this._data?.totalresults || -1;\n }\n\n get pagesize() {\n return this._pagesize;\n }\n}\n","import { immerable } from \"immer\";\n\nexport class PagesizeModel {\n [immerable] = true;\n\n private _pagesize: number | undefined;\n private _options: number[];\n\n constructor(\n pagesize: number | undefined,\n pagesizeContributions:\n | {\n options: number[];\n }\n | undefined,\n ) {\n this._pagesize = pagesize;\n this._options = pagesizeContributions?.options || [];\n }\n\n /**\n * Getting the name\n */\n get name() {\n return \"pagesize\";\n }\n\n /**\n * Geting the value\n */\n get value() {\n return this._pagesize;\n }\n\n /**\n * Setting the page size\n */\n set value(pagesize: number | undefined) {\n this._pagesize = pagesize;\n }\n\n /**\n * Getting available pagesize options\n */\n get options() {\n return this._options;\n }\n}\n","import { immerable } from \"immer\";\n\nimport { ListHref } from \"../ListHref\";\n\nimport type { GroupModel } from \"../grouping/GroupingModel\";\n\nexport enum SORT_ORDER {\n ASC = \"asc\",\n DESC = \"desc\",\n}\n\nexport class SortOptionModel {\n [immerable] = true;\n\n private _key: string;\n private _label: string;\n private _group: GroupModel | undefined;\n private _sortorder: SORT_ORDER = SORT_ORDER.DESC;\n private _selected = false;\n\n constructor(key: string, label?: string, group?: GroupModel) {\n this._key = key;\n this._group = group;\n\n this._label = this.setLabel(key, label, group);\n }\n\n private setLabel(key: string, label?: string, group?: GroupModel) {\n if (label) {\n this._label = label;\n } else if (group) {\n const attribute = group.getAttributeByKey(key);\n if (attribute) {\n this._label = attribute.label;\n }\n }\n return \"\";\n }\n\n get selected() {\n return this._selected;\n }\n\n set selected(selected: boolean) {\n this._selected = selected;\n }\n\n get key() {\n return this._key;\n }\n\n get value() {\n return `${this.key} ${this.sortorder}`;\n }\n\n get oppositeDirection() {\n return this.sortorder === SORT_ORDER.DESC\n ? SORT_ORDER.ASC\n : SORT_ORDER.DESC;\n }\n\n get oppositeValue() {\n return `${this.key} ${this.oppositeDirection}`;\n }\n\n get label() {\n return this._label;\n }\n\n get sortorder() {\n return this._sortorder;\n }\n\n set sortorder(sortorder: SORT_ORDER) {\n this._sortorder = sortorder;\n }\n\n get group() {\n return this._group;\n }\n\n getHref(listHref: ListHref) {\n const listhref = new ListHref(listHref);\n const hasPage = listhref.prefix\n ? listhref.hasParameter(\"page\", listhref.prefix)\n : listhref.hasParameter(\"page\");\n if (hasPage) {\n listhref.page = 1;\n }\n listhref.sort = this.oppositeValue;\n\n return listhref;\n }\n}\n","import { IllegalArgumentException } from \"../../../exceptions/IllegalArgumentException\";\nimport { BaseCollection } from \"../../base/BaseCollection\";\nimport { ListHref } from \"../ListHref\";\nimport { SORT_ORDER, SortOptionModel } from \"./SortOptionModel\";\n\nimport type { GroupingModel } from \"../grouping/GroupingModel\";\nimport type { ListContributions } from \"../types\";\n\nexport class SortingModel extends BaseCollection<SortOptionModel> {\n constructor(\n contributions: ListContributions,\n labels: Record<string, string>,\n grouping: GroupingModel,\n currentSort: string | undefined,\n ) {\n super();\n\n const sortAttributes = contributions?.sorting?.attributes;\n\n if (sortAttributes) {\n this.collection = sortAttributes.map((attributeKey) => {\n const label = labels[attributeKey];\n const group = grouping && grouping.getGroupByAttributeKey(attributeKey);\n return new SortOptionModel(attributeKey, label, group);\n });\n\n this.setSelected(currentSort);\n }\n }\n\n get name() {\n return \"sort\";\n }\n\n get value() {\n return this.filter((option) => option.selected)\n .map((option) => option.value)\n .join(\",\");\n }\n\n get param() {\n return this.value;\n }\n\n get options() {\n return this.collection;\n }\n\n setSelected(currentSort = \"\") {\n currentSort.split(\",\").forEach((sortItem) => {\n const [key, direction] = sortItem.split(\" \");\n\n this.collection.forEach((option) => {\n if (option.key === key) {\n option.selected = true;\n if (direction === SORT_ORDER.ASC) {\n option.sortorder = SORT_ORDER.ASC;\n } else if (direction === SORT_ORDER.DESC) {\n option.sortorder = SORT_ORDER.DESC;\n }\n }\n });\n });\n }\n\n /**\n * Retrieve a sort option from the model that can be used in the querystring to set it in the opposite direction\n * For example a sort option in the model with key books and direction descending will be retrieved as 'Books asc'\n */\n getUpdateQuerystring(optionKey: string) {\n if (!optionKey) {\n throw new IllegalArgumentException(\n \"Missing option key as input argument\",\n );\n }\n\n return this.filter((option) => option.key === optionKey)\n .map((option) =>\n option.key === optionKey ? option.oppositeValue : option.value,\n )\n .join(\",\");\n }\n\n /**\n * @see {@link SortingModel#getUpdateQuerystring}\n */\n getUpdateQuerystringBySortOption(sortOption: SortOptionModel) {\n if (!(sortOption instanceof SortOptionModel)) {\n throw new IllegalArgumentException(\n \"Missing SortOptionModel as input argument\",\n );\n }\n\n return this.getUpdateQuerystring(sortOption.key);\n }\n\n createListHref(listHref: ListHref, sortOption: SortOptionModel) {\n const listhref = new ListHref(listHref);\n const hasPage = listhref.prefix\n ? listhref.hasParameter(\"page\", listhref.prefix)\n : listhref.hasParameter(\"page\");\n if (hasPage) {\n listhref.page = 1;\n }\n listhref.sort = this.getUpdateQuerystringBySortOption(sortOption);\n\n return listhref;\n }\n}\n","import {\n CASEVIEW_LINK,\n HIDE_WHEN_EMPTY,\n SHOW_ONE_RESULT_AS_DETAIL,\n} from \"../../layouthints/LayoutHints\";\nimport { ActionCollection } from \"../actions/ActionCollection\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { FilterCollection } from \"../filters/FilterCollection\";\nimport { ListDetailModel } from \"./detail/ListDetailModel\";\nimport { GroupingModel } from \"./grouping/GroupingModel\";\nimport { ListHeaderModel } from \"./ListHeaderModel\";\nimport { ListHref } from \"./ListHref\";\nimport { ListItemCollection } from \"./ListItemCollection\";\nimport { PagingModel } from \"./paging/PagingModel\";\nimport { SortingModel } from \"./sorting/SortingModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { TargetModel } from \"../../modularui/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type { ListContributions, ListData } from \"./types\";\n\nexport class ListModel extends ResourceModel<ListData, ListContributions> {\n private _detail: ListDetailModel | undefined;\n private _headers: ListHeaderModel[];\n private _paging: PagingModel;\n private _filterCollection: FilterCollection;\n private _sorting: SortingModel;\n private _actionCollection: ActionCollection;\n private _listItemCollection: ListItemCollection;\n private _grouping: GroupingModel;\n private _selfhref: ListHref;\n\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._headers = this.setHeaders();\n this._paging = this.setPaging();\n this._filterCollection = this.setFilters();\n this._sorting = this.setSorting();\n this._actionCollection = this.setActionCollection();\n this._grouping = this.setGrouping();\n this._selfhref = this.setSelfHref();\n this._listItemCollection = this._listItemCollection =\n ListItemCollection.createFromList(this);\n }\n\n get type() {\n return \"List\";\n }\n\n static override get modelName() {\n return \"ListModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n const resourceType = data.resourcetype;\n return (\n resourceType.endsWith(\"List\") ||\n resourceType.endsWith(\"ListPanel\") ||\n resourceType.endsWith(\"RelatedDataStorePanel\") ||\n resourceType.endsWith(\"RelatedDatastorePanel\") ||\n [\n \"list-related-cases\",\n \"RecordPanel\",\n \"EventHistoryPanel\",\n \"NotePanel\",\n \"AppointmentPanel\",\n \"DocumentPanel\",\n \"AssignmentPanel\",\n ].includes(resourceType)\n );\n }\n\n override getInitialChildModelLinks() {\n if (\n this.layouthint.has(SHOW_ONE_RESULT_AS_DETAIL) &&\n this.listItemCollection.length === 1\n ) {\n return this.listItemCollection.map((listItem) => {\n const listDetailLink = listItem.selflink;\n listDetailLink.targetModel = ListDetailModel as TargetModel;\n return listDetailLink;\n });\n }\n return [];\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n _errors: ErrorResponse[],\n ) {\n this.detail = models.find(\n (childModel) => childModel instanceof ListDetailModel,\n );\n }\n\n /**\n * Getting the label of the list\n */\n override get label() {\n return this.contributions.label;\n }\n\n /**\n * Getting the introduction text\n */\n get introtext() {\n if (this.data.content) {\n return this.data.content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n * Getting the results\n */\n get listItemCollection() {\n return this._listItemCollection;\n }\n\n /**\n * Set results\n */\n set listItemCollection(listItemCollection: ListItemCollection) {\n this._listItemCollection = listItemCollection;\n }\n\n /**\n * Getting the detail\n */\n get detail() {\n return this._detail;\n }\n\n /**\n * Add detail model to the {ListModel}\n */\n set detail(detail: ListDetailModel | undefined) {\n const listitem = this.listItemCollection.find((listItem) =>\n listItem.selfhref.equals(detail?.selfhref),\n );\n\n if (listitem && detail) {\n detail.listitem = listitem;\n }\n\n this._detail = detail;\n\n this.setSelfHref();\n }\n\n /**\n * Retrieve grouping information\n */\n get grouping() {\n return this._grouping;\n }\n\n setGrouping() {\n return new GroupingModel(\n { ...this.data.grouping, dynamicschema: this.data.dynamicschema },\n this.contributions.contexts,\n this.modelOptions,\n );\n }\n\n hasGrouping() {\n return this.grouping.hasGroups();\n }\n\n /**\n * Check if list has results\n */\n hasResults() {\n return this.listItemCollection.hasItems;\n }\n\n isEmpty() {\n return !this.hasResults();\n }\n\n get shouldHide() {\n return (\n this.layouthint.has(HIDE_WHEN_EMPTY) &&\n this.isEmpty() &&\n this.actionCollection.isEmpty() &&\n !this.filterCollection.hasActiveFilters()\n );\n }\n\n /**\n * Get list item by ID\n */\n getListItemById(id: string | number) {\n const decodedId = decodeURIComponent(id.toString());\n return this.listItemCollection.find(\n (result) => result.id.toString() === decodedId,\n );\n }\n\n /**\n * Get list item by Href\n */\n getListItemByHref(href: ListHref) {\n return this.listItemCollection.find((result) =>\n result.selfhref.equals(href),\n );\n }\n\n /**\n * Getting paging information\n */\n get paging() {\n return this._paging;\n }\n\n setPaging() {\n return new PagingModel(this.data.paging, this.contributions.paging);\n }\n\n /**\n * Getting sorting information\n */\n get sorting() {\n return this._sorting;\n }\n\n setSorting() {\n return new SortingModel(\n this.contributions,\n this.getSortingLabels(),\n this.grouping,\n this.data.sorting,\n );\n }\n\n /**\n * Getting the filters\n */\n get filterCollection() {\n return this._filterCollection;\n }\n\n /**\n * Set filterCollection\n */\n set filterCollection(filterCollection: FilterCollection) {\n this._filterCollection = filterCollection;\n }\n\n setFilters() {\n return new FilterCollection(\n this.data.filter,\n {\n listkey: this.key,\n filter: this.contributions.filter || {},\n contexts: this.contributions.contexts,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n }\n\n /**\n * Indicates if list results are filtered\n */\n isFiltered() {\n return this.filterCollection.hasActiveFilters();\n }\n\n /**\n * Getting actions\n */\n get actionCollection() {\n return this._actionCollection;\n }\n\n setActionCollection() {\n return new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.modelOptions,\n );\n }\n\n /**\n * Contains this model list data\n */\n hasList() {\n return this.key != null;\n }\n\n /**\n * Sets self href from links collection\n */\n setSelfHref() {\n const selfLink = this.links.getLinkByKey(\"self\");\n return new ListHref(selfLink?.href, this);\n }\n\n /**\n * Getting the self link of this list\n */\n override get selfhref() {\n return this._selfhref;\n }\n\n /**\n * Getting the headers of this list\n */\n get headers() {\n return this._headers;\n }\n\n /**\n * Set initial headers of list\n */\n setHeaders() {\n const tempHeaders: ListHeaderModel[] = [];\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const listHeader = new ListHeaderModel(attribute, this.sorting);\n\n const exists = tempHeaders.some((tempHeader) =>\n tempHeader.equals(listHeader),\n );\n\n if (!exists && !listHeader.layouthint.has(CASEVIEW_LINK)) {\n tempHeaders.push(listHeader);\n }\n });\n });\n }\n\n return tempHeaders;\n }\n\n getSortingLabels() {\n const sortingLabels: Record<string, string> = {};\n\n if (this.contributions.results) {\n Object.values(this.contributions.results).forEach((result) => {\n result.attributes.forEach((attribute) => {\n const attributeKey = Object.keys(attribute)[0];\n const attributeLabel = attribute[attributeKey].label;\n sortingLabels[attributeKey] = attributeLabel;\n });\n });\n }\n\n return sortingLabels;\n }\n\n /**\n * Retrieve all actions by type\n */\n getActionsByType(actionType: string) {\n return this.actionCollection.getActionsByType(actionType);\n }\n\n /**\n * Retrieves the label of the first additional detail link by resource type\n */\n getAdditionalDetailLabel(resourceType: string) {\n const resultTypes = Object.keys(this.contributions.results);\n\n for (const resultType of resultTypes) {\n const link = this.contributions.results[resultType]._links?.panel?.find(\n (panelLink) => panelLink.resourcetype === resourceType,\n );\n if (link) {\n return link.label;\n }\n }\n\n return undefined;\n }\n}\n","import { ChoiceAttributeOptionModel } from \"../attributes/ChoiceAttributeOptionModel\";\nimport { ResourceCollection } from \"../base/ResourceCollection\";\n\nimport type { ModelOptions } from \"../types\";\nimport type {\n LookupOptionData,\n LookupOptionsContributions,\n LookupOptionsData,\n} from \"./types\";\n\nexport class LookupOptionCollection extends ResourceCollection<ChoiceAttributeOptionModel> {\n static create(\n data: LookupOptionsData,\n contributions: LookupOptionsContributions,\n modelOptions?: ModelOptions,\n ) {\n const collection = new LookupOptionCollection();\n\n if (data.options && contributions.options) {\n data.options.forEach((option) => {\n collection.add(\n new ChoiceAttributeOptionModel(\n [],\n {\n ...option,\n optionType: this.getOptionType(option, contributions),\n elementsContributions: contributions.options[0].elements,\n },\n {\n ...modelOptions,\n referenceDate: new Date().toISOString().split(\"T\")[0],\n },\n ),\n );\n });\n }\n\n return collection;\n }\n\n static getOptionType(\n option: LookupOptionData,\n contributions: LookupOptionsContributions,\n ) {\n if (contributions.optionType) {\n return contributions.optionType;\n }\n if (option._links?.download?.[0].name === \"avatar\") {\n return \"user\";\n }\n return \"generic\";\n }\n}\n","import { ResourceModel } from \"../base/ResourceModel\";\nimport { FilterCollection } from \"../filters/FilterCollection\";\nimport { LookupOptionCollection } from \"./LookupOptionCollection\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { FilterCollectionContributions } from \"../filters/types\";\nimport type { LookupOptionsContributions, LookupOptionsData } from \"./types\";\n\nexport class LookupOptionsModel extends ResourceModel<\n LookupOptionsData,\n LookupOptionsContributions\n> {\n private _options: LookupOptionCollection;\n private _filterCollection: FilterCollection;\n\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._options = LookupOptionCollection.create(\n this.data,\n this.contributions,\n this.modelOptions,\n );\n\n this._filterCollection = this.createFilterCollection(\n this.data.filter,\n this.contributions.filter,\n );\n }\n\n get type() {\n return \"LookupOptions\";\n }\n\n static override get modelName() {\n return \"LookupOptionsModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"lookupOptions\";\n }\n\n get options() {\n return this._options;\n }\n\n createFilterCollection(\n data: {\n name: \"labelFilter\";\n param: \"labelFilter\";\n value: string;\n },\n contributions: FilterCollectionContributions,\n ) {\n if (data && contributions) {\n return new FilterCollection(\n { [data.name]: data },\n { filter: contributions },\n this.modelOptions,\n );\n }\n return new FilterCollection();\n }\n\n /**\n * Getting the filters\n */\n get filterCollection() {\n return this._filterCollection;\n }\n}\n","import type { ModelCategory } from \"./types\";\n\nexport class ModelCategoryModel {\n private _modelCategory: ModelCategory;\n\n constructor(modelCategory: ModelCategory) {\n this._modelCategory = modelCategory;\n }\n\n /**\n * Id of the category\n */\n get key() {\n return this._modelCategory._id;\n }\n\n /**\n * Label of the category\n */\n get label() {\n return this._modelCategory.label;\n }\n\n /**\n * Description of the category\n */\n get description() {\n return this._modelCategory.description;\n }\n\n /**\n * Small icon of the category\n */\n get iconSmall() {\n return this._modelCategory.iconSmall;\n }\n\n /**\n * Medium icon of the category\n */\n get iconMedium() {\n return this._modelCategory.iconMedium;\n }\n\n /**\n * Large icon of the category\n */\n get iconLarge() {\n return this._modelCategory.iconLarge;\n }\n}\n","import { BaseCollection } from \"../base/BaseCollection\";\nimport { ModelCategoryModel } from \"./ModelCategoryModel\";\n\nimport type { ModelCategory } from \"./types\";\n\nexport class ModelCategoryCollection extends BaseCollection<ModelCategoryModel> {\n constructor(modelCategories: ModelCategory[] = []) {\n super();\n\n this.collection = modelCategories\n ? modelCategories.map(\n (modelCategory) => new ModelCategoryModel(modelCategory),\n )\n : [];\n }\n}\n","import { IllegalStateException } from \"../../exceptions/IllegalStateException\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { ModelCategoryCollection } from \"./ModelCategoryCollection\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ModelCatalogContributions, ModelCatalogData } from \"./types\";\n\n/**\n * The Application model\n */\nexport class ModelCatalogModel extends ResourceModel<\n ModelCatalogData,\n ModelCatalogContributions\n> {\n get type() {\n return \"ModelCatalog\";\n }\n\n static override get modelName() {\n return \"ModelCatalogModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"ModelCatalog\";\n }\n\n override get label() {\n return this.locale === \"nl\" ? \"Model catalogus\" : \"Model catalog\";\n }\n\n /**\n * Retrieve link to Concept Index model\n */\n get conceptIndexLink() {\n const link = this.links.getLinkByKey(\"concepts\");\n if (!link) {\n throw new IllegalStateException(\n \"Missing concepts index link in model catalog\",\n );\n }\n return link;\n }\n\n /**\n * Retrieve link to Content Index model\n */\n get contentIndexLink() {\n const link = this.links.getLinkByKey(\"content\");\n if (!link) {\n throw new IllegalStateException(\n \"Missing content index link in model catalog\",\n );\n }\n return link;\n }\n\n /**\n * Retrieve model categories as a collection\n */\n get modelcategories() {\n return new ModelCategoryCollection(this.data.modelcategories);\n }\n}\n","import { ResourceModel } from \"../base/ResourceModel\";\nimport { TaskGroupCollection } from \"../taskgroup/TaskGroupCollection\";\nimport { TaskGroupModel } from \"../taskgroup/TaskGroupModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ActionContributions, ActionData } from \"../actions/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type { GroupingPanelContributions, GroupingPanelData } from \"./types\";\n\n/**\n * Panel that groups other panels\n */\nexport class GroupingPanelModel extends ResourceModel<\n GroupingPanelData,\n GroupingPanelContributions\n> {\n private _taskGroupCollection: TaskGroupCollection;\n\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._taskGroupCollection = this.createTaskGroupCollection();\n }\n\n get type() {\n return \"GroupingPanel\";\n }\n\n static override get modelName() {\n return \"GroupingPanelModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return [\n \"GroupingPanel\",\n \"CaseTabGroupingPanel\",\n \"TabGroupingPanel\",\n ].includes(data.resourcetype);\n }\n\n /**\n * Getting the label of the panel\n */\n override get label() {\n return this.contributions.label;\n }\n\n override getInitialChildModelLinks() {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n get panelLinks() {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n _errors: ErrorResponse[],\n ) {\n const taskGroups = models.filter(\n (model) => model instanceof TaskGroupModel,\n );\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText() {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the grouping panel\n */\n get introtext() {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text as string;\n }\n\n return \"\";\n }\n\n private createTaskGroupCollection() {\n const data = this.getDataAsArray(\"taskgroups\", []) as {\n actions: ActionData[];\n name: string;\n }[];\n const contributions = this.getContributionAsArray(\"taskgroups\", []) as {\n name: string;\n label: string;\n actions: ActionContributions[];\n }[];\n\n const taskgroups = [];\n\n for (const taskgroupData of data) {\n const name = taskgroupData.name;\n const taskgroupContributions = contributions.find(\n (taskgroupContribution) => taskgroupContribution.name === name,\n );\n\n if (taskgroupContributions) {\n const taskgroup = TaskGroupModel.create(\n name,\n taskgroupData,\n taskgroupContributions,\n this.modelOptions,\n );\n taskgroups.push(taskgroup);\n }\n }\n\n return new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: TaskGroupCollection) {\n this._taskGroupCollection = taskgroups;\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection() {\n return this._taskGroupCollection;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups() {\n return this.taskGroupCollection && this.taskGroupCollection.hasItems();\n }\n\n /**\n * Has tasks\n */\n hasTasks() {\n return this.taskGroupCollection.hasTasks();\n }\n}\n","import { ListModel } from \"../list/ListModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\n\n/**\n * Case search model\n */\nexport class CaseSearchModel extends ListModel {\n override get type() {\n return \"CaseSearch\";\n }\n\n static override get modelName() {\n return \"CaseSearchModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return data.resourcetype === \"CaseSearch\";\n }\n\n /**\n * Retrieve quick search filters\n */\n getQuickSearchFilters() {\n return this.filterCollection\n ? this.filterCollection.filter((filter) => filter.isQuickSearch())\n : [];\n }\n\n hasQuickSearchFilters() {\n return this.getQuickSearchFilters().length > 0;\n }\n}\n","import { ActionCollection } from \"../actions/ActionCollection\";\nimport { ResourceModel } from \"../base/ResourceModel\";\nimport { TaskGroupCollection } from \"../taskgroup/TaskGroupCollection\";\nimport { TaskGroupModel } from \"../taskgroup/TaskGroupModel\";\n\nimport type { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport type { ActionContributions, ActionData } from \"../actions/types\";\nimport type { ErrorResponse } from \"../error/ErrorResponse\";\nimport type { ModelWithChildModels } from \"../types\";\nimport type { TabContributions, TabData } from \"./types\";\n\nexport class TabModel extends ResourceModel<TabData, TabContributions> {\n private _actionCollection: ActionCollection;\n private _taskGroupCollection: TaskGroupCollection;\n\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._taskGroupCollection = this.createTaskGroupCollection();\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.modelOptions,\n );\n }\n\n get type() {\n return \"Tab\";\n }\n\n static override get modelName() {\n return \"TabModel\";\n }\n\n static override isApplicableModel(data: ModularUIResponse) {\n return (\n data.resourcetype?.endsWith(\"Tab\") ||\n data.resourcetype?.endsWith(\"KnowledgeBank\")\n );\n }\n\n override getInitialChildModelLinks() {\n return this.links.getLinksByGroup(\"taskgroup\", \"actions\").all;\n }\n\n override setChildModels(\n models: ModelWithChildModels[],\n _errors: ErrorResponse[],\n ) {\n const taskGroups = models.filter(\n (model) => model instanceof TaskGroupModel,\n );\n this.taskGroupCollection.add(taskGroups);\n }\n\n get searchLink() {\n return this.links.getLinksByGroup(\"search\").first;\n }\n\n createTaskGroupCollection() {\n const data = this.getDataAsArray(\"taskgroups\", []) as {\n actions: ActionData[];\n name: string;\n }[];\n const contributions = this.getContributionAsArray(\"taskgroups\", []) as {\n name: string;\n label: string;\n actions: ActionContributions[];\n }[];\n\n const taskgroups = [];\n\n for (const taskgroupData of data) {\n const name = taskgroupData.name;\n const taskgroupContributions = contributions.find(\n (taskgroupContribution) => taskgroupContribution.name === name,\n );\n\n if (taskgroupContributions) {\n const taskgroup = TaskGroupModel.create(\n name,\n taskgroupData,\n taskgroupContributions,\n this.modelOptions,\n );\n taskgroups.push(taskgroup);\n }\n }\n\n return new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection() {\n return this._taskGroupCollection;\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: TaskGroupCollection) {\n this._taskGroupCollection = taskgroups;\n }\n\n /**\n * Getting the label of the tab\n */\n override get label() {\n return this.getContributionAsString(\"label\", \"\");\n }\n\n /**\n * Getting the component links on the tab\n */\n get components() {\n return this.links.getLinksByGroup(\"component\", \"search\");\n }\n\n get actionCollection() {\n return this._actionCollection;\n }\n\n /**\n * Has component links\n */\n hasComponents() {\n return this.components.size > 0;\n }\n\n hasTaskGroups() {\n return this.taskGroupCollection && this.taskGroupCollection?.hasItems();\n }\n\n hasActions() {\n return this.actionCollection && this.actionCollection.hasItems();\n }\n}\n","import { has } from \"lodash\";\n\nimport { ModularUIResponse } from \"../../modularui/ModularUIResponse\";\nimport { AttributeCollection } from \"../attributes/AttributeCollection\";\nimport { UserModel } from \"./UserModel\";\n\nexport class UserProfileModel extends UserModel {\n private _attributeCollection?: AttributeCollection;\n\n constructor(modularuiResponse: ModularUIResponse = new ModularUIResponse()) {\n super(modularuiResponse);\n const contributions = this.contributions;\n\n if (\n contributions &&\n contributions.attributes &&\n Array.isArray(contributions.attributes)\n ) {\n const attributeContributions = contributions.attributes.filter(\n (contribution) => {\n const [key] = Object.keys(contribution);\n return key !== \"sessiondata\" && has(this.data, key);\n },\n );\n\n this._attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n {\n ...this.modelOptions,\n isReadonly: true,\n },\n );\n } else {\n this._attributeCollection = new AttributeCollection(this.data, [], {\n ...this.modelOptions,\n isReadonly: true,\n });\n }\n }\n\n override get type() {\n return \"UserProfile\";\n }\n\n /**\n * returns all the attributes from the attribute collection\n */\n get attributeCollection() {\n return this._attributeCollection;\n }\n\n static override get modelName() {\n return \"UserProfileModel\";\n }\n}\n"],"mappings":"woBAAA,IAAAA,GAAAC,EAAA,CAAAC,GAAAC,KAAA,cACA,IAAIC,GAAc,OAAO,UAGrBC,GAAiBD,GAAY,eAUjC,SAASE,GAAQC,EAAQC,EAAK,CAC5B,OAAOD,GAAU,MAAQF,GAAe,KAAKE,EAAQC,CAAG,CAC1D,CAEAL,GAAO,QAAUG,KClBjB,IAAAG,GAAAC,EAAA,CAAAC,GAAAC,KAAA,cAuBA,IAAIC,GAAU,MAAM,QAEpBD,GAAO,QAAUC,KCzBjB,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,KAAA,cACA,IAAIC,GAAa,OAAO,QAAU,UAAY,QAAU,OAAO,SAAW,QAAU,OAEpFD,GAAO,QAAUC,KCHjB,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,KAAA,kBAAIC,GAAa,KAGbC,GAAW,OAAO,MAAQ,UAAY,MAAQ,KAAK,SAAW,QAAU,KAGxEC,GAAOF,IAAcC,IAAY,SAAS,aAAa,EAAE,EAE7DF,GAAO,QAAUG,KCRjB,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,KAAA,kBAAIC,GAAO,KAGPC,GAASD,GAAK,OAElBD,GAAO,QAAUE,KCLjB,IAAAC,GAAAC,EAAA,CAAAC,GAAAC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EACA,KAAM,GACN,UAAW,CAAC,MAAM,CACpB,EACA,gBAAiB,CACf,KAAM,kBACN,YAAa,CACX,GAAI,yEACJ,GAAI,+DACN,EACA,KAAM,GACN,UAAW,CAAC,MAAM,CACpB,EACA,eAAgB,CACd,KAAM,iDACN,YAAa,CACX,GAAI,qOACJ,GAAI,qMACN,EACA,KAAM,GACN,UAAW,CAAC,MAAM,CACpB,EACA,iBAAkB,CAChB,KAAM,mBACN,YAAa,CACX,GAAI,kFACJ,GAAI,yEACN,EACA,KAAM,GACN,UAAW,CAAC,oBAAoB,CAClC,EACA,MAAO,CACL,KAAM,QACN,YAAa,CACX,GAAI,iDACJ,GAAI,yCACN,EACA,KAAM,GACN,UAAW,CACT,iBACA,UACA,yBACA,wBACA,4BACA,sBACA,uBACA,0BACA,kBACA,oBACA,kBACA,wBACA,uBACA,2BACA,8BACA,mBACA,kBACA,yBACF,CACF,EACA,uBAAwB,CACtB,KAAM,0BACN,YAAa,CACX,GAAI,4JACJ,GAAI,kIACN,EACA,KAAM,GACN,UAAW,CAAC,kBAAkB,CAChC,EACA,mBAAoB,CAClB,KAAM,sBACN,YAAa,CACX,GAAI,gKACJ,GAAI,yIACN,EACA,KAAM,GACN,UAAW,CAAC,kBAAkB,CAChC,EACA,cAAe,CACb,KAAM,SACN,YAAa,CACX,GAAI,mCACJ,GAAI,0BACN,EACA,UAAW,CAAC,MAAM,CACpB,EACA,cAAe,CACb,KAAM,SACN,YAAa,CACX,GAAI,gCACJ,GAAI,0BACN,EACA,UAAW,CAAC,MAAM,CACpB,EACA,cAAe,CACb,KAAM,SACN,YAAa,CACX,GAAI,mCACJ,GAAI,0BACN,EACA,UAAW,CAAC,MAAM,CACpB,EACA,aAAc,CACZ,KAAM,eACN,YAAa,CACX,GAAI,6BACJ,GAAI,6BACN,EACA,UAAW,CAAC,kBAAkB,CAChC,EACA,cAAe,CACb,KAAM,iBACN,YAAa,CACX,GAAI,wHACJ,GAAI,6GACN,EACA,UAAW,CAAC,sB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,IAAKsB,GAChC,IAAIhD,EAAiBgD,EAAe,KAAM,CAC/C,OAAQ,KAAK,MACf,CAAC,EAAE,UAAU,CACd,EACD,OAAItB,aAAiB8B,GACnB9B,EAAM,eAAewB,EAAa,CAAC,CAAC,EAG/BxB,CACT,CACF","names":["require_baseHas","__commonJSMin","exports","module","objectProto","hasOwnProperty","baseHas","object","key","require_isArray","__commonJSMin","exports","module","isArray","require_freeGlobal","__commonJSMin","exports","module","freeGlobal","require_root","__commonJSMin","exports","module","freeGlobal","freeSelf","root","require_Symbol","__commonJSMin","exports","module","root","Symbol","require_getRawTag","__commonJSMin","exports","module","Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","value","isOwn","tag","unmasked","result","require_objectToString","__commonJSMin","exports","module","objectProto","nativeObjectToString","objectToString","value","require_baseGetTag","__commonJSMin","exports","module","Symbol","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","baseGetTag","value","require_isObjectLike","__commonJSMin","exports","module","isObjectLike","value","require_isSymbol","__commonJSMin","exports","module","baseGetTag","isObjectLike","symbolTag","isSymbol","value","require_isKey","__commonJSMin","exports","module","isArray","isSymbol","reIsDeepProp","reIsPlainProp","isKey","value","object","type","require_isObject","__commonJSMin","exports","module","isObject","value","type","require_isFunction","__commonJSMin","exports","module","baseGetTag","isObject","asyncTag","funcTag","genTag","proxyTag","isFunction","value","tag","require_coreJsData","__commonJSMin","exports","module","root","coreJsData","require_isMasked","__commonJSMin","exports","module","coreJsData","maskSrcKey","uid","isMasked","func","require_toSource","__commonJSMin","exports","module","funcProto","funcToString","toSource","func","require_baseIsNative","__commonJSMin","exports","module","isFunction","isMasked","isObject","toSource","reRegExpChar","reIsHostCtor","funcProto","objectProto","funcToString","hasOwnProperty","reIsNative","baseIsNative","value","pattern","require_getValue","__commonJSMin","exports","module","getValue","object","key","require_getNative","__commonJSMin","exports","module","baseIsNative","getValue","getNative","object","key","value","require_nativeCreate","__commonJSMin","exports","module","getNative","nativeCreate","require_hashClear","__commonJSMin","exports","module","nativeCreate","hashClear","require_hashDelete","__commonJSMin","exports","module","hashDelete","key","result","require_hashGet","__commonJSMin","exports","module","nativeCreate","HASH_UNDEFINED","objectProto","hasOwnProperty","hashGet","key","data","result","require_hashHas","__commonJSMin","exports","module","nativeCreate","objectProto","hasOwnProperty","hashHas","key","data","require_hashSet","__commonJSMin","exports","module","nativeCreate","HASH_UNDEFINED","hashSet","key","value","data","require_Hash","__commonJSMin","exports","module","hashClear","hashDelete","hashGet","hashHas","hashSet","Hash","entries","index","length","entry","require_listCacheClear","__commonJSMin","exports","module","listCacheClear","require_eq","__commonJSMin","exports","module","eq","value","other","require_assocIndexOf","__commonJSMin","exports","module","eq","assocIndexOf","array","key","length","require_listCacheDelete","__commonJSMin","exports","module","assocIndexOf","arrayProto","splice","listCacheDelete","key","data","index","lastIndex","require_listCacheGet","__commonJSMin","exports","module","assocIndexOf","listCacheGet","key","data","index","require_listCacheHas","__commonJSMin","exports","module","assocIndexOf","listCacheHas","key","require_listCacheSet","__commonJSMin","exports","module","assocIndexOf","listCacheSet","key","value","data","index","require_ListCache","__commonJSMin","exports","module","listCacheClear","listCacheDelete","listCacheGet","listCacheHas","listCacheSet","ListCache","entries","index","length","entry","require_Map","__commonJSMin","exports","module","getNative","root","Map","require_mapCacheClear","__commonJSMin","exports","module","Hash","ListCache","Map","mapCacheClear","require_isKeyable","__commonJSMin","exports","module","isKeyable","value","type","require_getMapData","__commonJSMin","exports","module","isKeyable","getMapData","map","key","data","require_mapCacheDelete","__commonJSMin","exports","module","getMapData","mapCacheDelete","key","result","require_mapCacheGet","__commonJSMin","exports","module","getMapData","mapCacheGet","key","require_mapCacheHas","__commonJSMin","exports","module","getMapData","mapCacheHas","key","require_mapCacheSet","__commonJSMin","exports","module","getMapData","mapCacheSet","key","value","data","size","require_MapCache","__commonJSMin","exports","module","mapCacheClear","mapCacheDelete","mapCacheGet","mapCacheHas","mapCacheSet","MapCache","entries","index","length","entry","require_memoize","__commonJSMin","exports","module","MapCache","FUNC_ERROR_TEXT","memoize","func","resolver","memoized","args","key","cache","result","require_memoizeCapped","__commonJSMin","exports","module","memoize","MAX_MEMOIZE_SIZE","memoizeCapped","func","result","key","cache","require_stringToPath","__commonJSMin","exports","module","memoizeCapped","rePropName","reEscapeChar","stringToPath","string","result","match","number","quote","subString","require_arrayMap","__commonJSMin","exports","module","arrayMap","array","iteratee","index","length","result","require_baseToString","__commonJSMin","exports","module","Symbol","arrayMap","isArray","isSymbol","INFINITY","symbolProto","symbolToString","baseToString","value","result","require_toString","__commonJSMin","exports","module","baseToString","toString","value","require_castPath","__commonJSMin","exports","module","isArray","isKey","stringToPath","toString","castPath","value","object","require_baseIsArguments","__commonJSMin","exports","module","baseGetTag","isObjectLike","argsTag","baseIsArguments","value","require_isArguments","__commonJSMin","exports","module","baseIsArguments","isObjectLike","objectProto","hasOwnProperty","propertyIsEnumerable","isArguments","value","require_isIndex","__commonJSMin","exports","module","MAX_SAFE_INTEGER","reIsUint","isIndex","value","length","type","require_isLength","__commonJSMin","exports","module","MAX_SAFE_INTEGER","isLength","value","require_toKey","__commonJSMin","exports","module","isSymbol","INFINITY","toKey","value","result","require_hasPath","__commonJSMin","exports","module","castPath","isArguments","isArray","isIndex","isLength","toKey","hasPath","object","path","hasFunc","index","length","result","key","require_has","__commonJSMin","exports","module","baseHas","hasPath","has","object","path","require_overArg","__commonJSMin","exports","module","overArg","func","transform","arg","require_getPrototype","__commonJSMin","exports","module","overArg","getPrototype","require_isPlainObject","__commonJSMin","exports","module","baseGetTag","getPrototype","isObjectLike","objectTag","funcProto","objectProto","funcToString","hasOwnProperty","objectCtorString","isPlainObject","value","proto","Ctor","require_lodash","__commonJSMin","exports","module","undefined","VERSION","LARGE_ARRAY_SIZE","CORE_ERROR_TEXT","FUNC_ERROR_TEXT","INVALID_TEMPL_VAR_ERROR_TEXT","HASH_UNDEFINED","MAX_MEMOIZE_SIZE","PLACEHOLDER","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","WRAP_BIND_FLAG","WRAP_BIND_KEY_FLAG","WRAP_CURRY_BOUND_FLAG","WRAP_CURRY_FLAG","WRAP_CURRY_RIGHT_FLAG","WRAP_PARTIAL_FLAG","WRAP_PARTIAL_RIGHT_FLAG","WRAP_ARY_FLAG","WRAP_REARG_FLAG","WRAP_FLIP_FLAG","DEFAULT_TRUNC_LENGTH","DEFAULT_TRUNC_OMISSION","HOT_COUNT","HOT_SPAN","LAZY_FILTER_FLAG","LAZY_MAP_FLAG","LAZY_WHILE_FLAG","INFINITY","MAX_SAFE_INTEGER","MAX_INTEGER","NAN","MAX_ARRAY_LENGTH","MAX_ARRAY_INDEX","HALF_MAX_ARRAY_LENGTH","wrapFlags","argsTag","arrayTag","asyncTag","boolTag","dateTag","domExcTag","errorTag","funcTag","genTag","mapTag","numberTag","nullTag","objectTag","promiseTag","proxyTag","regexpTag","setTag","stringTag","symbolTag","undefinedTag","weakMapTag","weakSetTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reEmptyStringLeading","reEmptyStringMiddle","reEmptyStringTrailing","reEscapedHtml","reUnescapedHtml","reHasEscapedHtml","reHasUnescapedHtml","reEscape","reEvaluate","reInterpolate","reIsDeepProp","reIsPlainProp","rePropName","reRegExpChar","reHasRegExpChar","reTrimStart","reWhitespace","reWrapComment","reWrapDetails","reSplitDetails","reAsciiWord","reForbiddenIdentifierChars","reEscapeChar","reEsTemplate","reFlags","reIsBadHex","reIsBinary","reIsHostCtor","reIsOctal","reIsUint","reLatin","reNoMatch","reUnescapedString","rsAstralRange","rsComboMarksRange","reComboHalfMarksRange","rsComboSymbolsRange","rsComboRange","rsDingbatRange","rsLowerRange","rsMathOpRange","rsNonCharRange","rsPunctuationRange","rsSpaceRange","rsUpperRange","rsVarRange","rsBreakRange","rsApos","rsAstral","rsBreak","rsCombo","rsDigits","rsDingbat","rsLower","rsMisc","rsFitz","rsModifier","rsNonAstral","rsRegional","rsSurrPair","rsUpper","rsZWJ","rsMiscLower","rsMiscUpper","rsOptContrLower","rsOptContrUpper","reOptMod","rsOptVar","rsOptJoin","rsOrdLower","rsOrdUpper","rsSeq","rsEmoji","rsSymbol","reApos","reComboMark","reUnicode","reUnicodeWord","reHasUnicode","reHasUnicodeWord","contextProps","templateCounter","typedArrayTags","cloneableTags","deburredLetters","htmlEscapes","htmlUnescapes","stringEscapes","freeParseFloat","freeParseInt","freeGlobal","freeSelf","root","freeExports","freeModule","moduleExports","freeProcess","nodeUtil","types","nodeIsArrayBuffer","nodeIsDate","nodeIsMap","nodeIsRegExp","nodeIsSet","nodeIsTypedArray","apply","func","thisArg","args","arrayAggregator","array","setter","iteratee","accumulator","index","length","value","arrayEach","arrayEachRight","arrayEvery","predicate","arrayFilter","resIndex","result","arrayIncludes","baseIndexOf","arrayIncludesWith","comparator","arrayMap","arrayPush","values","offset","arrayReduce","initAccum","arrayReduceRight","arraySome","asciiSize","baseProperty","asciiToArray","string","asciiWords","baseFindKey","collection","eachFunc","key","baseFindIndex","fromIndex","fromRight","strictIndexOf","baseIsNaN","baseIndexOfWith","baseMean","baseSum","object","basePropertyOf","baseReduce","baseSortBy","comparer","current","baseTimes","n","baseToPairs","props","baseTrim","trimmedEndIndex","baseUnary","baseValues","cacheHas","cache","charsStartIndex","strSymbols","chrSymbols","charsEndIndex","countHolders","placeholder","deburrLetter","escapeHtmlChar","escapeStringChar","chr","getValue","hasUnicode","hasUnicodeWord","iteratorToArray","iterator","data","mapToArray","map","overArg","transform","arg","replaceHolders","setToArray","set","setToPairs","strictLastIndexOf","stringSize","unicodeSize","stringToArray","unicodeToArray","unescapeHtmlChar","unicodeWords","runInContext","context","_","Array","Date","Error","Function","Math","Object","RegExp","String","TypeError","arrayProto","funcProto","objectProto","coreJsData","funcToString","hasOwnProperty","idCounter","maskSrcKey","uid","nativeObjectToString","objectCtorString","oldDash","reIsNative","Buffer","Symbol","Uint8Array","allocUnsafe","getPrototype","objectCreate","propertyIsEnumerable","splice","spreadableSymbol","symIterator","symToStringTag","defineProperty","getNative","ctxClearTimeout","ctxNow","ctxSetTimeout","nativeCeil","nativeFloor","nativeGetSymbols","nativeIsBuffer","nativeIsFinite","nativeJoin","nativeKeys","nativeMax","nativeMin","nativeNow","nativeParseInt","nativeRandom","nativeReverse","DataView","Map","Promise","Set","WeakMap","nativeCreate","metaMap","realNames","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","symbolToString","lodash","isObjectLike","isArray","LazyWrapper","LodashWrapper","wrapperClone","baseCreate","proto","isObject","baseLodash","chainAll","lazyClone","copyArray","lazyReverse","lazyValue","dir","isArr","isRight","arrLength","view","getView","start","end","iteratees","iterLength","takeCount","baseWrapperValue","outer","iterIndex","type","computed","Hash","entries","entry","hashClear","hashDelete","hashGet","hashHas","hashSet","ListCache","listCacheClear","listCacheDelete","assocIndexOf","lastIndex","listCacheGet","listCacheHas","listCacheSet","MapCache","mapCacheClear","mapCacheDelete","getMapData","mapCacheGet","mapCacheHas","mapCacheSet","size","SetCache","setCacheAdd","setCacheHas","Stack","stackClear","stackDelete","stackGet","stackHas","stackSet","pairs","arrayLikeKeys","inherited","isArg","isArguments","isBuff","isBuffer","isType","isTypedArray","skipIndexes","isIndex","arraySample","baseRandom","arraySampleSize","shuffleSelf","baseClamp","arrayShuffle","assignMergeValue","eq","baseAssignValue","assignValue","objValue","baseAggregator","baseEach","baseAssign","source","copyObject","keys","baseAssignIn","keysIn","baseAt","paths","skip","get","number","lower","upper","baseClone","bitmask","customizer","stack","isDeep","isFlat","isFull","initCloneArray","tag","getTag","isFunc","cloneBuffer","initCloneObject","copySymbolsIn","copySymbols","initCloneByTag","stacked","isSet","subValue","isMap","keysFunc","getAllKeysIn","getAllKeys","baseConforms","baseConformsTo","baseDelay","wait","setTimeout","baseDifference","includes","isCommon","valuesLength","valuesIndex","createBaseEach","baseForOwn","baseEachRight","baseForOwnRight","baseEvery","baseExtremum","isSymbol","baseFill","toInteger","toLength","baseFilter","baseFlatten","depth","isStrict","isFlattenable","baseFor","createBaseFor","baseForRight","baseFunctions","isFunction","baseGet","path","castPath","toKey","baseGetAllKeys","symbolsFunc","baseGetTag","getRawTag","objectToString","baseGt","other","baseHas","baseHasIn","baseInRange","baseIntersection","arrays","othLength","othIndex","caches","maxLength","seen","baseInverter","baseInvoke","parent","last","baseIsArguments","baseIsArrayBuffer","baseIsDate","baseIsEqual","baseIsEqualDeep","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","equalObjects","baseIsMap","baseIsMatch","matchData","noCustomizer","srcValue","baseIsNative","isMasked","pattern","baseIsRegExp","baseIsSet","baseIsTypedArray","isLength","baseIteratee","identity","baseMatchesProperty","baseMatches","property","baseKeys","isPrototype","baseKeysIn","nativeKeysIn","isProto","baseLt","baseMap","isArrayLike","getMatchData","matchesStrictComparable","isKey","isStrictComparable","hasIn","baseMerge","srcIndex","baseMergeDeep","newValue","safeGet","mergeFunc","isTyped","isArrayLikeObject","cloneTypedArray","isPlainObject","toPlainObject","baseNth","baseOrderBy","orders","getIteratee","criteria","compareMultiple","basePick","basePickBy","baseSet","basePropertyDeep","basePullAll","indexOf","basePullAt","indexes","previous","baseUnset","baseRange","step","baseRepeat","baseRest","setToString","overRest","baseSample","baseSampleSize","nested","baseSetData","baseSetToString","constant","baseShuffle","baseSlice","baseSome","baseSortedIndex","retHighest","low","high","mid","baseSortedIndexBy","valIsNaN","valIsNull","valIsSymbol","valIsUndefined","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","setLow","baseSortedUniq","baseToNumber","baseToString","baseUniq","createSet","seenIndex","baseUpdate","updater","baseWhile","isDrop","actions","action","baseXor","baseZipObject","assignFunc","valsLength","castArrayLikeObject","castFunction","stringToPath","toString","castRest","castSlice","clearTimeout","id","buffer","cloneArrayBuffer","arrayBuffer","cloneDataView","dataView","cloneRegExp","regexp","cloneSymbol","symbol","typedArray","compareAscending","valIsDefined","valIsReflexive","objCriteria","othCriteria","ordersLength","order","composeArgs","partials","holders","isCurried","argsIndex","argsLength","holdersLength","leftIndex","leftLength","rangeLength","isUncurried","composeArgsRight","holdersIndex","rightIndex","rightLength","isNew","getSymbols","getSymbolsIn","createAggregator","initializer","createAssigner","assigner","sources","guard","isIterateeCall","iterable","createBind","isBind","Ctor","createCtor","wrapper","fn","createCaseFirst","methodName","trailing","createCompounder","callback","words","deburr","thisBinding","createCurry","arity","getHolder","createRecurry","createHybrid","createFind","findIndexFunc","createFlow","flatRest","funcs","prereq","getFuncName","funcName","getData","isLaziable","partialsRight","holdersRight","argPos","ary","isAry","isBindKey","isFlip","holdersCount","newHolders","reorder","createInverter","toIteratee","createMathOperation","operator","defaultValue","createOver","arrayFunc","createPadding","chars","charsLength","createPartial","createRange","toFinite","createRelationalOperation","toNumber","wrapFunc","isCurry","newHoldersRight","newPartials","newPartialsRight","newData","setData","setWrapToString","createRound","precision","pair","noop","createToPairs","createWrap","mergeData","customDefaultsAssignIn","customDefaultsMerge","customOmitClone","isPartial","arrStacked","othStacked","arrValue","othValue","compared","convert","objProps","objLength","othProps","objStacked","skipCtor","objCtor","othCtor","flatten","otherFunc","isKeyable","isOwn","unmasked","stubArray","ctorString","transforms","getWrapDetails","match","hasPath","hasFunc","insertWrapDetails","details","isMaskable","stubFalse","memoizeCapped","memoize","srcBitmask","newBitmask","isCombo","otherArgs","oldArray","shortOut","reference","updateWrapDetails","count","lastCalled","stamp","remaining","rand","quote","subString","chunk","compact","concat","difference","differenceBy","differenceWith","drop","dropRight","dropRightWhile","dropWhile","fill","findIndex","findLastIndex","flattenDeep","flattenDepth","fromPairs","head","initial","intersection","mapped","intersectionBy","intersectionWith","join","separator","lastIndexOf","nth","pull","pullAll","pullAllBy","pullAllWith","pullAt","remove","reverse","slice","sortedIndex","sortedIndexBy","sortedIndexOf","sortedLastIndex","sortedLastIndexBy","sortedLastIndexOf","sortedUniq","sortedUniqBy","tail","take","takeRight","takeRightWhile","takeWhile","union","unionBy","unionWith","uniq","uniqBy","uniqWith","unzip","group","unzipWith","without","xor","xorBy","xorWith","zip","zipObject","zipObjectDeep","zipWith","chain","tap","interceptor","thru","wrapperAt","wrapperChain","wrapperCommit","wrapperNext","toArray","done","wrapperToIterator","wrapperPlant","clone","wrapperReverse","wrapped","wrapperValue","countBy","every","filter","find","findLast","flatMap","flatMapDeep","flatMapDepth","forEach","forEachRight","groupBy","isString","invokeMap","keyBy","orderBy","partition","reduce","reduceRight","reject","negate","sample","sampleSize","shuffle","some","sortBy","now","after","before","bind","bindKey","curry","curryRight","debounce","options","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","invokeFunc","time","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","defer","delay","flip","resolver","memoized","once","overArgs","funcsLength","partial","partialRight","rearg","rest","spread","throttle","unary","wrap","castArray","cloneWith","cloneDeep","cloneDeepWith","conformsTo","gt","gte","isArrayBuffer","isBoolean","isDate","isElement","isEmpty","isEqual","isEqualWith","isError","isFinite","isInteger","isMatch","isMatchWith","isNaN","isNumber","isNative","isNull","isNil","isRegExp","isSafeInteger","isUndefined","isWeakMap","isWeakSet","lt","lte","sign","remainder","isBinary","toSafeInteger","assign","assignIn","assignInWith","assignWith","at","create","prototype","properties","defaults","propsIndex","propsLength","defaultsDeep","mergeWith","findKey","findLastKey","forIn","forInRight","forOwn","forOwnRight","functions","functionsIn","has","invert","invertBy","invoke","mapKeys","mapValues","merge","omit","omitBy","pickBy","pick","prop","setWith","toPairs","toPairsIn","isArrLike","unset","update","updateWith","valuesIn","clamp","inRange","random","floating","temp","camelCase","word","capitalize","upperFirst","endsWith","target","position","escape","escapeRegExp","kebabCase","lowerCase","lowerFirst","pad","strLength","padEnd","padStart","parseInt","radix","repeat","replace","snakeCase","split","limit","startCase","startsWith","template","settings","imports","importsKeys","importsValues","isEscaping","isEvaluating","interpolate","reDelimiters","sourceURL","escapeValue","interpolateValue","esTemplateValue","evaluateValue","variable","attempt","toLower","toUpper","trim","trimEnd","trimStart","truncate","omission","substring","newEnd","unescape","upperCase","e","bindAll","methodNames","cond","conforms","defaultTo","flow","flowRight","matches","matchesProperty","method","methodOf","mixin","noConflict","nthArg","over","overEvery","overSome","propertyOf","range","rangeRight","stubObject","stubString","stubTrue","times","toPath","uniqueId","prefix","add","augend","addend","ceil","divide","dividend","divisor","floor","max","maxBy","mean","meanBy","min","minBy","multiply","multiplier","multiplicand","round","subtract","minuend","subtrahend","sum","sumBy","isFilter","takeName","dropName","checkIteratee","isTaker","lodashFunc","retUnwrapped","isLazy","useLazy","isHybrid","isUnwrapped","onlyLazy","chainName","require_arrayPush","__commonJSMin","exports","module","arrayPush","array","values","index","length","offset","require_isFlattenable","__commonJSMin","exports","module","Symbol","isArguments","isArray","spreadableSymbol","isFlattenable","value","require_baseFlatten","__commonJSMin","exports","module","arrayPush","isFlattenable","baseFlatten","array","depth","predicate","isStrict","result","index","length","value","require_flattenDeep","__commonJSMin","exports","module","baseFlatten","INFINITY","flattenDeep","array","length","modularui_exports","__export","Authenticate","CaptchaRequest","ModularUIError","ModularUIRequest","ModularUIResponse","__toCommonJS","IS_GRAALJS","HTTP_METHODS","PARAMETER_SEPARATOR","TIMEVERSION_FILTER_NAME","ISO_DATE_FORMAT","ISO_DATETIME_FORMAT","ISO_TIME_FORMAT","ISO_TIMESTAMP_FORMAT","DATETIME_OFFSET_FORMAT","DEFAULT_WEEK_STARTS_ON","DEFAULT_FIRST_WEEK_CONTAINS_DATE","INTERNAL_LOGIN_TYPE","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","DEFAULT_AUTHENTICATION_TYPE","UnauthorizedException","url","method","errorResponse","CONTENT_PATH","CAPTCHA_PATH","import_has","import_isPlainObject","import_immer","IllegalStateException","message","ALL_CONTENT_IN_DATA_SETTING","INCLUDE_TIME_OFFSET","defaultSettings","settings","getSetting","key","defaultValue","has","settings","getStringSetting","stringSetting","IllegalStateException","getNumberSetting","numberSetting","getBooleanSetting","booleanSetting","cacheContributions","getBooleanSetting","hasAllContentInData","ALL_CONTENT_IN_DATA_SETTING","isIncludeTimeOffsetInDateTimes","getSetting","INCLUDE_TIME_OFFSET","getEnabledLocales","setting","loginType","getStringSetting","LOGIN_TYPE","loginPath","clientName","LOGIN_PATH_SETTING","loginUsernameField","LOGIN_USERNAME_SETTING","loginPasswordField","LOGIN_PASSWORD_SETTING","logoutPath","LOGOUT_PATH_SETTING","LOGIN_PATH","LOGOUT_PATH","getContextPath","getStringSetting","getContextPathModularUI","getContentPath","contextPath","getContextPathModularUI","origin","CONTENT_PATH","getCaptchaPath","contextPath","getContextPathModularUI","origin","CAPTCHA_PATH","import_lodash","RESOURCE_CACHE_PREFIX","Cache","_Cache","requestArgs","resourceKey","key","cache","cacheItem","value","stringValue","pattern","k","callback","e","newData","cacheInstance","import_has","CLIENT_ERROR_CODE","FetchException","_FetchException","errorResponse","failedRequest","requestOptions","errorInfo","getErrorInfo","defaultErrorInfo","has","key","graalFetch","args","urlNoBase","getContextPath","params","url","data","jsonData","FetchException","error","import_lodash","IllegalArgumentException","message","JsonParseException","error","NetworkException","url","method","NotFoundException","url","method","isReload","TimeoutException","url","method","NETWORK_ERROR_CODE","SUCCESS_CODE","CLIENT_ERROR_CODE","UNAUTHORIZED_CODE","REDIRECTION_CODE","NOT_FOUND_CODE","JSON_TYPE","XHR","options","xmlhttp","attempts","url","aUrl","getNumberSetting","baseHeaders","reject","TimeoutException","responseJSON","status","isReload","NetworkException","NotFoundException","UnauthorizedException","FetchException","responseType","response","error","JsonParseException","resolve","progressEvent","eventType","event","eventName","cacheInstance","basicToken","headerName","allHeaders","getSetting","stringData","err","validateInputArguments","args","IllegalArgumentException","xhr","IS_FETCHING","waitForCachedItem","cacheKey","TIMEOUT","CHECK_TIMEOUT","resolve","reject","check","cacheInstance","cachedItem","browserFetch","args","cacheContributions","cacheItem","xhr","response","universalFetch","IS_GRAALJS","graalFetch","Authenticate","type","loginType","enumType","INTERNAL_LOGIN_TYPE","authenticationType","isBasicAuthentication","universalFetch","getContextPath","initLogin","error","UnauthorizedException","username","password","loginPath","encodedUsername","encodedPassword","loginUsernameField","loginPasswordField","cacheInstance","logoutPath","response","CaptchaRequest","getContextPathModularUI","options","response","xhr","getCaptchaPath","answer","error","ModularUIError","_ModularUIError","message","response","href","import_deepmerge","import_full","import_lodash","import_lodash","LayoutHintConfiguration","getHint","hint","LayoutHintConfiguration","MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","HIDE_IN_USER_INTERFACE","AVATAR_IN_TITLE","getHint","AVATAR","LayoutHintProcessor","origin","contextPath","requestOptions","response","getBooleanSetting","contributionLinks","dataLinks","contributionLinksRecord","dataTabLinksRecord","contributionTabLink","dataTabLinks","dataLink","newLinks","tabName","links","tabLink","dataLinksRecord","linksPerName","hideWhenEmptyLinks","contributionLink","HIDE_WHEN_EMPTY","isHiddenListChecks","hiddenLinks","newDataLinks","dataLinkKey","linkPerName","name","href","HIDE_WHEN_EMPTY_IGNORE_TASKS","universalFetch","responseRecord","key","_embedded","actions","noListItems","noActions","import_immer","import_has","ModularUIResponse","_ModularUIResponse","getContextPathModularUI","key","data","contributions","locale","input","response","has","dataKey","contributionsKey","resourcetype","origin","contextPath","parameters","requestHref","modelData","import_immer","BaseCollection","_BaseCollection","collection","items","itemIndex","index","callbackfn","thisArg","compareFn","import_immer","import_full","import_lodash","LayoutHintCollection","BaseCollection","layouthint","IllegalArgumentException","hints","hint","hint2","foundHint","checkHint","match","value","BaseModel","data","contributions","options","getContextPathModularUI","hints","LayoutHintCollection","propName","defaultValue","dataAsString","dataAsNumber","dataAsBoolean","dataAsArray","dataAsObject","contributionAsArray","contributionAObject","contributionAsString","contributionAsBoolean","contributionAsNumber","import_immer","import_immer","Parameter","_Parameter","prefix","name","value","parameter","param","key","PARAMETER_SEPARATOR","withPrefix","val","uiParameterSetting","getSetting","ParameterCollection","_ParameterCollection","BaseCollection","search","parameterCollection","value","key","Parameter","url","param","withPrefix","prefix","name","valueToRemove","newValue","val","Href","_Href","getContextPathModularUI","ParameterCollection","href","resourcetype","modelOptions","location","origin","contextPath","path","parameters","hash","state","method","name","value","prefix","Parameter","param","withPrefix","querystring","thisPath","otherPath","other","thisParams","getContentPath","referenceHash","import_tz","import_add","import_endOfMonth","import_format","import_getDay","import_getHours","import_getMinutes","import_getWeek","import_isAfter","import_isBefore","import_isSameDay","import_isValid","import_locale","import_parse","import_set","import_startOfMonth","import_startOfWeek","import_sub","import_timezone_soft","import_js_cookie","getCookie","name","Cookies","BaseDateTimeUtil","isoFormat","doOffsets","isIncludeTimeOffsetInDateTimes","weekStartsOn","getNumberSetting","DEFAULT_WEEK_STARTS_ON","firstWeekContainsDate","DEFAULT_FIRST_WEEK_CONTAINS_DATE","DATETIME_OFFSET_FORMAT","javaFormat","javaToUTS35Map","uts35Format","sortedKeys","a","b","javaToken","uts35Token","regex","defaultLocale","getEnabledLocales","getCookie","date","inputFormat","targetFormat","parsedDate","sourceFormat","formattedValue","inputDate","afterISODate","beforeISODate","compareDate","weekDay","dateTime","x","newDate","time","calculationFn","property","value","amount","method","options","year","month","day","hour","minute","second","millisecond","hours","minutes","seconds","milliseconds","timeZone","IS_GRAALJS","dateOffset","offsets","info","sign","absOffset","offsetString","timezone","soft","daylight","standard","DateUtil","ISO_DATE_FORMAT","DateTimeUtil","ISO_DATETIME_FORMAT","TimeUtil","ISO_TIME_FORMAT","TimestampUtil","ISO_TIMESTAMP_FORMAT","ProcessStatusSettingsModel","BaseModel","needed","LinkCollection","DateUtil","conceptLink","TIMEVERSION_FILTER_NAME","LinkModel","_LinkModel","BaseModel","data","contributions","modelOptions","name","href","label","Href","INITIAL_FILTER","filters","hintStart","hint","param","p","Parameter","key","value","LinkCollection","link","icon","targetModel","isCacheable","filter","ProcessStatusSettingsModel","normalizeLinkJSON","data","contribution","links","linksData","key","linkData","link","linksContribution","linkContribution","idx","l","LinkCollection","_LinkCollection","BaseCollection","data","contributions","modelOptions","links","normalizeLinkJSON","link","HIDE_IN_USER_INTERFACE","LinkModel","selflinkResourceType","linksData","linksContributions","key","href","args","groupsToFind","groupLinks","linkCollection","resourceType","hint","newCollection","l","newLink","oldIndex","path","ResourceModel","BaseModel","modularuiResponse","ModularUIResponse","LinkCollection","key","IllegalStateException","data","IllegalArgumentException","lastServerUpdate","selflink","models","errors","flattenModels","flattenErrors","import_lodash","import_isPlainObject","ContentConfigurationElements","_ContentConfigurationElements","configuration","hints","contentIncludeLayoutHint","configElement","key","config","hint","contentExcludeLayoutHint","elementConfig","types","LayoutHintCollection","item","type","concept","defaultLabel","configuredLabelProperties","configuredLabels","configuredLabel","contentConfiguredLabels","configuredLabelProperty","hasAllContentInData","ResourceCollection","BaseCollection","initialChildModelLinks","item","models","errors","ConceptTypeDetailModel","ResourceModel","data","conceptTypeHref","ConceptLinkModel","BaseModel","data","entryDate","modelOptions","LinkCollection","models","_errors","href","conceptTypeModel","model","ConceptTypeDetailModel","conceptType","label","selflink","TIMEVERSION_FILTER_NAME","link","LinkModel","ConceptRelationModel","BaseModel","relation","entryDate","modelOptions","ConceptLinkModel","models","errors","concept","ConceptRelationCollection","_ConceptRelationCollection","ResourceCollection","relations","entryDate","modelOptions","getContextPathModularUI","relation","ConceptRelationModel","pos","arr","item","type","import_hash_it","createHashFromHref","href","fragment","hrefString","hash","ContentTypeModel","ResourceModel","data","ContentLinkModel","BaseModel","data","entryDate","modelOptions","LinkCollection","models","_errors","href","model","ContentTypeModel","contentType","startURI","selfHref","Href","sourceId","encodedSection","TIMEVERSION_FILTER_NAME","selflink","getSetting","section","contentHref","items","SourceReferenceModel","BaseModel","sourceReference","entryDate","LinkCollection","selfhref","content","ContentLinkModel","createHashFromHref","SourceReferenceCollection","BaseCollection","sourceReference","entryDate","SourceReferenceModel","types","sourceRef","ConceptDetailModel","ResourceModel","modularuiResponse","ConceptRelationCollection","data","conceptTypeLink","relationsCollectionLinks","models","errors","conceptTypeModel","model","ConceptTypeDetailModel","href","TIMEVERSION_FILTER_NAME","conceptType","labels","labelType","labelData","l","ids","label","properties","propertyType","setting","property","textFragments","configuredTextFragments","textFragment","textFragmentType","notConfiguredTextFragments","textfragment","keys","availableLocales","SourceReferenceCollection","sourceReferences","LANGUAGE_POSTFIX_LENGTH","availableLanguagesInSourceReferences","sourceReference","currentLanguagePostfix","availableLanguages","locale","lang","conceptTypeId","import_immer","ErrorModel","id","defaultMessage","parameters","isClientConstraint","layouthint","LayoutHintCollection","ErrorCollection","BaseCollection","type","errorCollection","error","id","item","defaultMessage","parameters","layouthint","itemIdx","ErrorModel","errors","constraints","constraint","import_immer","retrieveText","text","SubSectionModel","_SubSectionModel","BaseModel","data","entryDate","modelOptions","LinkCollection","retrieveText","subSection","hrefs","relatedConceptsLink","href","firstPart","createHashFromHref","sections","referredChilds","SectionModel","_SectionModel","BaseModel","data","entryDate","modelOptions","selflink","LinkModel","id","body","retrieveText","sections","section","_links","ContentLinkModel","childSection","subSection","SubSectionModel","createHashFromHref","referredChilds","AttributeContent","_AttributeContent","content","hasAllContentInData","headerLabel","headerDescription","label","description","element","contentElement","LayoutHintCollection","textfragment","retrieveText","section","SectionModel","propertyElement","labels","textFragmentElement","types","sectionType","referredSections","GenericConstraintModel","id","validateMethod","defaultMessage","parameters","useClientsideValidation","getBooleanSetting","value","ConstraintCollection","BaseCollection","id","validateMethod","defaultMessage","data","useClientsideValidation","getBooleanSetting","GenericConstraintModel","value","constraint","MandatoryConstraint","value","INVALID_LENGTH_ID","INVALID_LENGTH_BETWEEN_ID","INVALID_LENGTH_TOO_SHORT_ID","INVALID_LENGTH_TOO_LONG_ID","StringLengthConstraint","minLength","maxLength","value","BaseAttributeModel","BaseModel","ConstraintCollection","getBooleanSetting","data","contributions","modelOptions","DateUtil","LinkCollection","MANDATORY","DISABLED","message","errorCollection","ErrorCollection","IllegalArgumentException","parentKey","label","placeholder","isEditable","isHidden","downloadLink","models","_errors","conceptHref","concept","model","ConceptDetailModel","conceptLink","TIMEVERSION_FILTER_NAME","date","hasAllContentInData","hasContentConfiguration","AttributeContent","contentConfiguration","hasQuestionConfig","hasEndResultConfig","hasIntermediateResultConfig","alignmentHints","alignment","rules","attributes","lastModification","timestamp","value","initvalue","inputvalue","mandatory","readonly","disabled","isResult","isValid","constraints","MandatoryConstraint","StringLengthConstraint","enabled","previouslyValidatedValue","collection","error","id","_receivedAttribute","defaultMessage","parameters","params","paramKey","paramValue","errors","oldAttribute","otherAttribute","import_immer","ListHeaderModel","header","sorting","headerKey","attribute","AttributeFactory","sortOption","LayoutHintCollection","alignment","listHeader","import_has","ConfigurationException","message","CompositeAttributeChildCollection","_CompositeAttributeChildCollection","ResourceCollection","data","contributions","modelOptions","compositeChildCollection","contribution","key","attributeData","attr","attributeContribution","attribute","AttributeFactory","childData","child","ErrorCollection","childrenObject","childrenArray","collection","children","prefix","errors","attributeErrors","error","enabled","BaseAttributeModel","CompositeAttributeModel","CompositeAttributeModel","_CompositeAttributeModel","BaseAttributeModel","data","contributions","modelOptions","CompositeAttributeChildCollection","models","errors","children","child","constraints","ConstraintCollection","enabled","value","attribute","key","oldAttribute","withChildAttribute","changedAttribute","IllegalArgumentException","otherAttribute","otherChild","childrenAreOptional","readonly","values","val","isResult","contentConfiguration","AttributeCollection","ResourceCollection","data","contributions","modelOptions","contribution","key","contributionValue","attribute","AttributeFactory","has","attributes","attr","CompositeAttributeModel","hints","layoutHint","ChoiceAttributeModel","oldAttribute","newAttribute","index","date","error","elementid","ConfigurationException","errors","attributeErrors","compositeChildErrors","elementId","contentConfiguration","validationData","attributesFormData","attributeFormData","ChoiceAttributeOptionModel","_ChoiceAttributeOptionModel","BaseModel","selectedValues","option","modelOptions","LinkCollection","listitem","initialLinks","models","errors","conceptHref","concept","model","ConceptDetailModel","code","contributions","data","AttributeCollection","attributeCollection","contributionsLabel","title","TITLE","contentConfiguration","hasAllContentInData","ChoiceAttributeOptionCollection","children","AttributeContent","selected","links","date","conceptLink","TIMEVERSION_FILTER_NAME","level","withOption","ChoiceAttributeOptionCollection","_ChoiceAttributeOptionCollection","ResourceCollection","modelOptions","getContextPathModularUI","sortOptions","option","data","contributions","collection","value","a","b","selectedOptions","code","options","foundOption","selectedValues","optionContributions","optionCode","optionType","children","optionDynamicschema","defaultLabel","label","optionValue","optionModel","ChoiceAttributeOptionModel","action","date","headers","child","ListHeaderModel","withOptions","addNotExistingOptions","removeNotExistingOptions","newCollection","withOption","opt","callbackfn","thisArg","optionIndex","collectionArray","result","ChoiceAttributeModel","_ChoiceAttributeModel","BaseAttributeModel","attribute","attributeContributions","modelOptions","ChoiceAttributeOptionCollection","SORT_OPTIONS","contributions","type","optionMode","hasLookupLink","links","models","errors","conceptLinkHref","model","ConceptDetailModel","date","option","initvalue","code","opt","hint","oldAttribute","addNotExistingOptions","removeNotExistingOptions","value","values","val","ChoiceAttributeOptionModel","otherAttribute","CompositeAttributeModel","otherValue","receivedAttribute","hasContentConfiguration","optionElementConfig","optionElement","RENDER_SECTION_LABEL","ContentConfigurationElements","error","id","message","properties","layouthint","ANSWER_OPTION_KEY","optionKey","foundOption","BooleanAttributeModel","_BooleanAttributeModel","BaseAttributeModel","data","contributions","modelOptions","DateUtil","ChoiceAttributeOptionCollection","date","hint","hasContentConfiguration","optionElementConfig","optionElement","RENDER_SECTION_LABEL","ContentConfigurationElements","option","initvalue","selected","code","oldAttribute","value","values","val","ChoiceAttributeOptionModel","otherAttribute","CaptchaAttributeModel","BaseAttributeModel","contributions","value","_otherAttribute","answer","INEXACT_DATE_ID","OUT_OF_RANGE_ID","BELOW_MINIMUM_ID","ABOVE_MAXIMUM_ID","DateBoundaryConstraint","type","minDate","maxDate","format","value","IllegalStateException","TimeUtil","TimestampUtil","DateTimeUtil","DateUtil","DateTimeDateFormatConstraint","format","formatLabel","value","DateUtil","DatetimeFormatConstraint","type","format","formatLabel","DATETIME_OFFSET_FORMAT","TimestampUtil","DateTimeUtil","value","isIncludeTimeOffsetInDateTimes","DateTimeTimeFormatConstraint","format","formatLabel","value","TimeUtil","DatetimeAttributeModel","_DatetimeAttributeModel","BaseAttributeModel","attribute","attributeContributions","modelOptions","contributions","TimeUtil","TimestampUtil","DateTimeUtil","DateUtil","value","timeValue","isIncludeTimeOffsetInDateTimes","oldOffset","DATETIME_OFFSET_FORMAT","newOffset","formattedValue","initValue","format","dateEraChars","timeOffsetChars","inputFormat","isInQuotes","keep","i","prevChar","nextChar","char","formatLabel","timeFormatParts","timeFormat","ISO_DATE_FORMAT","error","id","message","properties","layouthint","DateTimeDateFormatConstraint","DateTimeTimeFormatConstraint","DatetimeFormatConstraint","constraints","ConstraintCollection","DateBoundaryConstraint","otherAttribute","otherValue","inputValue","HelptextAttributeModel","BaseAttributeModel","contributions","message","contributionText","_value","_otherAttribute","LabelAttributeModel","BaseAttributeModel","contributions","_value","_otherAttribute","import_immer","BaseLayoutHintRule","_attribute","_hint","IllegalStateException","EQUALS","INCLUDES","NOT_EQUALS","NOT_INCLUDES","NOT_IS_EMPTY","IS_EMPTY","SHOW","HIDE","DependentAttribute","_DependentAttribute","BaseLayoutHintRule","hint","DEPENDENT_ATTRIBUTE","rule","OPERATORS","regex","DEPENDENT_ATTRIBUTE_CONTROL","isEmpyNotIsEmptRegex","result","ConfigurationException","action","control","operator","options","option","controlAttribute","selected","attributes","attribute","FileExtensionConstraint","filetypeConstraints","filetypeConstraint","import_file_size","MAX_TOTAL_FILE_SIZE_ID","MAX_FILE_SIZE_ID","FileSizeConstraint","filesizeConstraint","filesize","UNCHANGED","UploadAttributeModel","_UploadAttributeModel","BaseAttributeModel","contributions","initialTotalFileSize","maxTotalFileSize","uploadMaxFileSize","accumulatedFileSize","fileName","file","mimeTypes","mimeType","extension","constraints","ConstraintCollection","FileExtensionConstraint","FileSizeConstraint","files","value","_otherAttribute","oldAttribute","RemainingTotalUploadSize","_RemainingTotalUploadSize","BaseLayoutHintRule","attribute","attributes","initialTotalFileSizeAttributes","INITIAL_TOTAL_FILESIZE","maxTotalFileSizeAttributes","MAX_TOTAL_FILESIZE","initialTotalFileSize","maxTotalFileSize","UploadAttributeModel","layoutHintRules","DependentAttribute","RemainingTotalUploadSize","LayoutHintRuleCollection","_LayoutHintRuleCollection","BaseCollection","layoutHintRules","attribute","rules","rule","hint","attributes","BSNConstraint","bsn","bsnNumber","bsnLength","pos","result","i","digit","value","import_iban","IBANConstraint","value","IBAN","RegexConstraint","regexConstraint","value","StringAttributeModel","_StringAttributeModel","BaseAttributeModel","contributions","value","constraints","ConstraintCollection","BSNConstraint","IBANConstraint","RegexConstraint","groups","noFormat","otherAttribute","MemoAttributeModel","StringAttributeModel","contributions","import_isPlainObject","import_big","DecimalFormat","_DecimalFormat","format","beforeDigit","numberStr","maxFrac","minFrac","intStr","stringNumber","number","string","formattedNumber","tempNumber","negative","hasPrefix","suffixIndex","fracStr","frac","i","doCarry","x","j","groupedIntStr","isNegative","formattedValue","lastTwoFrac","NumberUtil","input","groupingSeparator","escapedGroupingSeparator","decimalSeparator","inputNoGrouping","inputCorrectDecimalSeparator","big","value","format","numberValue","IllegalArgumentException","stringValue","formattedValue","DecimalFormat","integer","decimal","integerPart","startValue","endValue","INEXACT_NUMBER_ID","OUT_OF_RANGE_ID","BELOW_MINIMUM_ID","ABOVE_MAXIMUM_ID","NumberBoundaryConstraint","minNumber","maxNumber","groupingSeparator","decimalSeparator","format","NumberUtil","value","parsedNumber","INVALID_INTEGER_ID","NumberFormatConstraint","groupingSeparator","decimalSeparator","format","DecimalFormat","value","NumberUtil","numberOfDigits","parsedNumber","DEFAULT_GROUPING_SIZE","NumberGroupingConstraint","groupingSeparator","decimalSeparator","format","fromFormat","DecimalFormat","value","absStringValue","integer","groups","group","NumberAttributeModel","_NumberAttributeModel","BaseAttributeModel","contributions","value","format","constraints","ConstraintCollection","NumberFormatConstraint","NumberGroupingConstraint","NumberBoundaryConstraint","NumberUtil","isPlainObject","outputNumber","otherAttribute","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","CASEVIEW_LINK","isHidden","MoneyAttributeModel","NumberAttributeModel","contributions","PasswordConfirmConstraint","otherPasswordValue","otherPasswordLabel","value","PasswordLowerAndUpperCaseConstraint","value","PasswordMinNumericCharactersConstraint","minNumeric","value","PasswordMinSpecialCharactersConstraint","minSpecial","value","PasswordThreeConsecutiveCharactersNotAllowedConstraint","maxSequence","value","char","i","sequence","PasswordAttributeModel","StringAttributeModel","contributions","value","constraints","ConstraintCollection","PasswordConfirmConstraint","PasswordLowerAndUpperCaseConstraint","PasswordThreeConsecutiveCharactersNotAllowedConstraint","PasswordMinNumericCharactersConstraint","PasswordMinSpecialCharactersConstraint","regexConstraint","RegexConstraint","CONFIRM_PASSWORD","isConfirmPassword","confirmValue","otherLabel","XMLConstraint","value","oParser","XMLAttributeModel","StringAttributeModel","contributions","constraints","ConstraintCollection","XMLConstraint","AttributeFactory","ChoiceAttributeModel","BooleanAttributeModel","HelptextAttributeModel","LabelAttributeModel","XMLAttributeModel","MemoAttributeModel","StringAttributeModel","DatetimeAttributeModel","MoneyAttributeModel","NumberAttributeModel","PasswordAttributeModel","UploadAttributeModel","CompositeAttributeModel","RangeAttributeModel","CaptchaAttributeModel","key","data","contributions","modelOptions","Model","children","attributeData","AttributeDataMapper","attribute","LayoutHintRuleCollection","model","_AttributeDataMapper","childrenKeys","attr","value","option","dynamicschema","dynamicschemaId","attrDS","pickedContent","child","childKey","isComposite","childChildren","keyObject","values","childData","content","parentKey","element","isPlainObject","parentData","dataContent","MandatoryRangeConstraint","type","start","end","RangeConstraint","startAttribute","endAttribute","id","inclusivePart","TimeUtil","DateUtil","TimestampUtil","DateTimeUtil","startValue","endValue","NumberUtil","RangeAttributeModel","_RangeAttributeModel","BaseAttributeModel","data","contributions","modelOptions","models","errors","constraints","ConstraintCollection","enabled","value","RangeConstraint","MandatoryRangeConstraint","oldAttribute","changedAttribute","IllegalArgumentException","otherAttribute","readonly","isResult","contentConfiguration","index","childContributions","key","attribute","AttributeFactory","childrenAreOptional","BaseFilterModel","BaseModel","data","contributions","modelOptions","PARAMETER_SEPARATOR","context","key","type","param","attributeType","attributeContributions","childType","child","AttributeFactory","_attribute","value","AssignmentFilterModel","BaseFilterModel","data","contributions","modelOptions","key","assignmentTypeData","IllegalStateException","dynamicschema","assignmentTypeContributions","param","userData","userContributions","attribute","value","ConceptIndexFilterModel","BaseFilterModel","data","contributions","modelOptions","selectedValues","option","RangeFilterModel","BaseFilterModel","attribute","value","RangeAttributeModel","StringFilterModel","BaseFilterModel","data","contributions","modelOptions","value","_attribute","values","val","outputValues","formattedValue","FilterFactory","filterKey","data","contributions","modelOptions","type","ConceptIndexFilterModel","RangeFilterModel","AssignmentFilterModel","StringFilterModel","BaseFilterModel","filter","contextId","filterContext","context","FilterCollection","BaseCollection","data","contributions","modelOptions","collection","filterContribution","filterKey","filterDataByKey","filterContributionByKey","filter","FilterFactory","key","rangeAttribute","RangeAttributeModel","start","end","RangeFilterModel","AssignmentFilterModel","attribute","value","filterToUpdate","ContentModel","ResourceModel","response","FilterCollection","SectionModel","data","contentTypeLink","models","_errors","model","ContentTypeModel","entryDateFilter","TIMEVERSION_FILTER_NAME","contentType","sections","hrefs","subSection","relatedConceptsLink","href","import_immer","ErrorResponse","error","connectKey","modelOptions","key","getContextPathModularUI","redirectHref","Href","LayoutHintCollection","hasUnauthorizedStatus","hasUnauthorizedErrorId","hasLoginAction","properties","import_deepmerge","import_lodash","import_flattenDeep","import_lodash","AttributeSetModel","_AttributeSetModel","BaseModel","key","data","contributions","modelOptions","attributeContributions","contribution","contributionKey","AttributeCollection","collection","dataObject","index","objects","childAttributeSets","attributeData","i","import_lodash","import_immer","ContentConfigurationResults","configuration","LayoutHintCollection","ContentConfigurationElements","description","hint","ContentConfigurationEndResults","configuration","configElement","key","ContentConfigurationResults","ContentConfigurationQuestions","configuration","ContentConfigurationElements","ContentConfiguration","configuration","ContentConfigurationQuestions","ContentConfigurationResults","ContentConfigurationEndResults","attributeKey","item","FormObjectModel","_FormObjectModel","BaseModel","object","objectContributions","modelOptions","AttributeCollection","ContentConfiguration","ErrorCollection","referenceData","formObjectModel","IllegalArgumentException","withRepeatIndex","objectContainsOneOfTheAttributes","attribute","key","elements","dataResults","result","dataElementIds","element","contributions","attributeKey","attributesContributions","attributeContributions","dataElementId","models","errors","repeatIndex","message","attributeCollection","oldObject","mergeWithAttribute","value","attributeToUpdate","CompositeAttributeModel","timestamp","error","dynamicValidationsLoaded","attributeErrors","LayoutHintCollection","missing","anchor","data","validationData","FormModel","_FormModel","ResourceModel","getBooleanSetting","ErrorCollection","ParameterCollection","modularuiResponse","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","data","endResultChildLinks","flattenDeep","endResultFormObject","models","errors","buttonType","formObjectButtonLabels","formObjects","elements","dynamicschema","element","item","dsElements","anchor","resultObject","result","missingAnchors","firstAnchor","objectId","objectContributions","FormObjectModel","formObjectModel","emptyFormObject","formObject","IllegalArgumentException","key","hint","missingObjectIds","endResultAnchors","otherProps","endResult","endResultContribution","o","endResultKeys","objectKey","endResultFormObjects","endResultFormObjectKeys","object","error","errorCollection","commit","isFinished","isComplete","Href","resultdata","resultContributions","resultDataKeys","successData","resultDataKey","d","c","AttributeSetModel","parameters","params","par","Parameter","filteredParameters","parameter","selfhref","getSetting","tokens","lastUpdate","validOnly","validationData","attr","formdata","objectFormData","hasNonNullValues","value","existingObjectIndex","obj","deepmerge","withConcurrencyToken","enabled","currentFormObjectKey","oldCurrentFormObject","completedFormObjectKeys","formObjectKey","currentObjectIndex","isLastObject","receivedForm","receivedFormData","hasMissing","hasErrors","success","receivedErrorAnchors","receivedError","attribute","receivedAttribute","receivedCurrentFormObject","mergePreviouslyEnteredObjects","previouslyEnteredFormObjects","previouslyEnteredFormObject","mergedObject","newObject","oldObject","mergedFormObject","findMethod","import_lodash","NotAllowedUriException","message","UserModel","ResourceModel","data","contributions","UserServicesModel","ResourceModel","data","userLink","models","_errors","model","UserModel","user","hasUser","cacheInstance","mustChangePassword","ApplicationModel","ResourceModel","data","LinkModel","userServices","userService","NotAllowedUriException","models","_errors","model","UserServicesModel","authenticationTypes","DEFAULT_AUTHENTICATION_TYPE","a","b","import_has","ActionModel","_ActionModel","BaseModel","data","contributions","modelOptions","name","href","label","type","origin","contextPath","fieldsData","fieldsContributions","AttributeCollection","Href","method","HTTP_METHODS","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","fieldCollection","attribute","value","key","has","d","c","ProcessStatusSettingsModel","icon","ActionCollection","_ActionCollection","BaseCollection","data","contributions","modelOptions","actionModels","action","contribution","c","ActionModel","key","newCollection","type","hints","enabledRoutes","path","DetailModel","_DetailModel","ResourceModel","modularuiResponse","data","resourceType","endsWithDetailPanel","otherPanel","models","errors","id","attributeContributions","contribution","key","AttributeCollection","collection","attribute","TITLE","metadata","metadataContributions","value","actionsData","actionsContributions","ActionCollection","actionCollection","model","clonedModel","TaskGroupCollection","BaseCollection","taskgroup","TaskGroupModel","_TaskGroupModel","ResourceModel","response","actionsData","actionsContributions","ActionCollection","selfHref","key","data","contributions","modelOptions","taskgroup","ModularUIResponse","CaseViewModel","DetailModel","caseviewData","data","models","errors","taskGroupModels","model","TaskGroupModel","TITLE","content","contributions","selfLink","IllegalStateException","taskgroups","taskgroupData","name","taskgroupContributions","taskgroupContribution","taskgroup","TaskGroupCollection","ConceptLinkCollection","ResourceCollection","ConceptIndexModel","ResourceModel","modularuiResponse","FilterCollection","ConceptLinkCollection","concept","ConceptLinkModel","data","resourceType","models","errors","href","filter","param","timeversionFilter","TIMEVERSION_FILTER_NAME","DateUtil","itemCollection","ContentLinkCollection","ResourceCollection","ContentIndexModel","ResourceModel","modularuiResponse","FilterCollection","ContentLinkCollection","content","ContentLinkModel","data","models","errors","href","filter","param","filterAttribute","ChoiceAttributeModel","firstChar","option","Href","ContentTOCModel","ResourceModel","modularuiResponse","FilterCollection","data","contentTypeLink","models","_errors","model","ContentTypeModel","href","Href","filter","param","relatedConceptsLink","ContentLinkModel","items","item","link","sections","section","SectionModel","category","contentType","TIMEVERSION_FILTER_NAME","import_lodash","ListDetailModel","DetailModel","modularUIResponse","ContentConfiguration","listitemPanels","links","models","errors","data","resourcetype","listitem","configuration","resultSectionContributions","resultSectionData","resultsData","resultsContributions","child","results","AttributeFactory","CompositeAttributeModel","givenAnswersData","givenAnswersContributions","filteredContributions","givenAnswers","eventdata","eventdataData","dynamicschema","attributeset","attributesetKey","attributesetContributions","attributesetData","item","index","key","AttributeSetModel","import_immer","GroupModel","group","context","allContexts","modelOptions","AttributeCollection","GroupingModel","key","attribute","data","contexts","dynamicschema","d","groupType","prefix","groupByKey","ListHref","_ListHref","Href","href","list","isPrefixed","page","sort","pagesize","filters","filter","param","ListItemModel","_ListItemModel","DetailModel","key","data","contributions","modelOptions","listitemInput","ModularUIResponse","option","item","selflink","Href","caseviewLinkAttribute","CASEVIEW_LINK","caseviewLinkKey","caseviewLink","actionType","additionalDetailLinks","link","ListItemCollection","_ListItemCollection","BaseCollection","list","_embedded","ConfigurationException","dynamicschema","collection","resultItem","key","listitemData","listitemContributions","ListItemModel","allRoutes","listItem","actions","ActionCollection","import_immer","import_immer","PagesizeModel","pagesize","pagesizeContributions","PagingModel","data","contributions","PagesizeModel","page","import_immer","SortOptionModel","key","label","group","attribute","selected","sortorder","listHref","listhref","ListHref","SortingModel","BaseCollection","contributions","labels","grouping","currentSort","sortAttributes","attributeKey","label","group","SortOptionModel","option","sortItem","key","direction","optionKey","IllegalArgumentException","sortOption","listHref","listhref","ListHref","ListModel","ResourceModel","modularuiResponse","ListItemCollection","data","resourceType","SHOW_ONE_RESULT_AS_DETAIL","listItem","listDetailLink","ListDetailModel","models","_errors","childModel","listItemCollection","detail","listitem","GroupingModel","HIDE_WHEN_EMPTY","id","decodedId","result","href","PagingModel","SortingModel","filterCollection","FilterCollection","ActionCollection","selfLink","ListHref","tempHeaders","results","key","attribute","listHeader","ListHeaderModel","tempHeader","CASEVIEW_LINK","sortingLabels","attributeKey","attributeLabel","actionType","resultTypes","resultType","link","panelLink","LookupOptionCollection","_LookupOptionCollection","ResourceCollection","data","contributions","modelOptions","collection","option","ChoiceAttributeOptionModel","LookupOptionsModel","ResourceModel","modularuiResponse","LookupOptionCollection","data","contributions","FilterCollection","ModelCategoryModel","modelCategory","ModelCategoryCollection","BaseCollection","modelCategories","modelCategory","ModelCategoryModel","ModelCatalogModel","ResourceModel","data","link","IllegalStateException","ModelCategoryCollection","GroupingPanelModel","ResourceModel","modularuiResponse","data","models","_errors","taskGroups","model","TaskGroupModel","contributions","taskgroups","taskgroupData","name","taskgroupContributions","taskgroupContribution","taskgroup","TaskGroupCollection","CaseSearchModel","ListModel","data","filter","TabModel","ResourceModel","modularuiResponse","ActionCollection","data","models","_errors","taskGroups","model","TaskGroupModel","contributions","taskgroups","taskgroupData","name","taskgroupContributions","taskgroupContribution","taskgroup","TaskGroupCollection","import_lodash","UserProfileModel","UserModel","modularuiResponse","ModularUIResponse","contributions","attributeContributions","contribution","key","AttributeCollection","RESOURCE_MODELS","ApplicationModel","TabModel","ListDetailModel","ListModel","GroupingPanelModel","CaseSearchModel","CaseViewModel","DetailModel","TaskGroupModel","FormModel","UserModel","UserProfileModel","UserServicesModel","ModelCatalogModel","ConceptIndexModel","ConceptDetailModel","ConceptTypeDetailModel","ContentIndexModel","ContentTOCModel","ContentModel","ContentTypeModel","LookupOptionsModel","resolveModel","response","availableModels","IllegalArgumentException","resourceTypeModel","resourceModel","ModularUIRequest","_ModularUIRequest","ModularUIResponse","getContextPathModularUI","href","options","IllegalArgumentException","Href","LayoutHintProcessor","optionLocale","origin","contextPath","path","contributionsHref","locale","method","targetModel","forceTargetModel","updateHandler","childmodels","isValidationRequest","removeOnUnmount","requestOptions","availableModels","Model","resolveModel","availableModelTypes","model","IllegalStateException","contributions","record","key","contributionsBody","error","errorMessage","ModularUIError","data","links","dataBody","universalFetch","progressEvent","prevData","FormModel","newData","deepmerge","getBooleanSetting","validationHref","formResponse","childModelRequests","childModelLink","request","childModels","resolvedChildModels","errorChildModels","childModel","reason","ErrorResponse","ResourceModel","withChildSections","ContentModel","contentModel","newContentModel","childSectionLink","contentHrefWithEntryDate","TIMEVERSION_FILTER_NAME","sectionModels","sectionModel","SectionModel","validatedModel","form","response","dataString","contributionsString"]}
|