@beinformed/react 1.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE.md +1 -0
  3. package/dist/ErrorBoundaryFallback-D6YQem9P.d.cts +13 -0
  4. package/dist/ErrorBoundaryFallback-D6YQem9P.d.ts +13 -0
  5. package/dist/beforeRenderHooks-CNvsMmi8.d.cts +18 -0
  6. package/dist/beforeRenderHooks-Gb0tcmCY.d.ts +18 -0
  7. package/dist/chunk-347XDLN7.js +1 -0
  8. package/dist/chunk-347XDLN7.js.map +1 -0
  9. package/dist/chunk-3OP2KQ56.js +2 -0
  10. package/dist/chunk-3OP2KQ56.js.map +1 -0
  11. package/dist/chunk-4AC7YQ5Q.js +2 -0
  12. package/dist/chunk-4AC7YQ5Q.js.map +1 -0
  13. package/dist/chunk-6E5DAS6G.js +1 -0
  14. package/dist/chunk-6E5DAS6G.js.map +1 -0
  15. package/dist/chunk-6KRECIRI.js +2 -0
  16. package/dist/chunk-6KRECIRI.js.map +1 -0
  17. package/dist/chunk-A4USB53Q.js +2 -0
  18. package/dist/chunk-A4USB53Q.js.map +1 -0
  19. package/dist/chunk-AMFWIR2R.js +2 -0
  20. package/dist/chunk-AMFWIR2R.js.map +1 -0
  21. package/dist/chunk-B7PQLTVC.js +2 -0
  22. package/dist/chunk-B7PQLTVC.js.map +1 -0
  23. package/dist/chunk-DI7VM62A.js +2 -0
  24. package/dist/chunk-DI7VM62A.js.map +1 -0
  25. package/dist/chunk-FW4363Y4.js +2 -0
  26. package/dist/chunk-FW4363Y4.js.map +1 -0
  27. package/dist/chunk-HDOILTJ2.js +2 -0
  28. package/dist/chunk-HDOILTJ2.js.map +1 -0
  29. package/dist/chunk-JYAETKRB.js +2 -0
  30. package/dist/chunk-JYAETKRB.js.map +1 -0
  31. package/dist/chunk-K3DTH6XN.js +2 -0
  32. package/dist/chunk-K3DTH6XN.js.map +1 -0
  33. package/dist/chunk-KNEDBCHP.js +2 -0
  34. package/dist/chunk-KNEDBCHP.js.map +1 -0
  35. package/dist/chunk-MT7D3AJU.js +12 -0
  36. package/dist/chunk-MT7D3AJU.js.map +1 -0
  37. package/dist/chunk-RKGGCIUD.js +2 -0
  38. package/dist/chunk-RKGGCIUD.js.map +1 -0
  39. package/dist/chunk-UZIZDEU6.js +2 -0
  40. package/dist/chunk-UZIZDEU6.js.map +1 -0
  41. package/dist/chunk-VFLYA5WJ.js +2 -0
  42. package/dist/chunk-VFLYA5WJ.js.map +1 -0
  43. package/dist/chunk-VG3QU524.js +22 -0
  44. package/dist/chunk-VG3QU524.js.map +1 -0
  45. package/dist/chunk-WBPDMDW4.js +2 -0
  46. package/dist/chunk-WBPDMDW4.js.map +1 -0
  47. package/dist/chunk-X2C7CKOK.js +2 -0
  48. package/dist/chunk-X2C7CKOK.js.map +1 -0
  49. package/dist/chunk-X3N2NQVZ.js +2 -0
  50. package/dist/chunk-X3N2NQVZ.js.map +1 -0
  51. package/dist/chunk-Y7ESITVO.js +2 -0
  52. package/dist/chunk-Y7ESITVO.js.map +1 -0
  53. package/dist/chunk-YG7XDCNV.js +2 -0
  54. package/dist/chunk-YG7XDCNV.js.map +1 -0
  55. package/dist/chunk-YJNJVQFW.js +2 -0
  56. package/dist/chunk-YJNJVQFW.js.map +1 -0
  57. package/dist/chunk-Z2Y3OPVI.js +2 -0
  58. package/dist/chunk-Z2Y3OPVI.js.map +1 -0
  59. package/dist/client/index.cjs +12 -0
  60. package/dist/client/index.cjs.map +1 -0
  61. package/dist/client/index.d.cts +84 -0
  62. package/dist/client/index.d.ts +84 -0
  63. package/dist/client/index.js +2 -0
  64. package/dist/client/index.js.map +1 -0
  65. package/dist/components/index.cjs +12 -0
  66. package/dist/components/index.cjs.map +1 -0
  67. package/dist/components/index.d.cts +28 -0
  68. package/dist/components/index.d.ts +28 -0
  69. package/dist/components/index.js +2 -0
  70. package/dist/components/index.js.map +1 -0
  71. package/dist/hooks/index.cjs +2 -0
  72. package/dist/hooks/index.cjs.map +1 -0
  73. package/dist/hooks/index.d.cts +353 -0
  74. package/dist/hooks/index.d.ts +353 -0
  75. package/dist/hooks/index.js +2 -0
  76. package/dist/hooks/index.js.map +1 -0
  77. package/dist/i18n/index.cjs +2 -0
  78. package/dist/i18n/index.cjs.map +1 -0
  79. package/dist/i18n/index.d.cts +26 -0
  80. package/dist/i18n/index.d.ts +26 -0
  81. package/dist/i18n/index.js +2 -0
  82. package/dist/i18n/index.js.map +1 -0
  83. package/dist/index.cjs +32 -0
  84. package/dist/index.cjs.map +1 -0
  85. package/dist/index.d.cts +27 -0
  86. package/dist/index.d.ts +27 -0
  87. package/dist/index.js +2 -0
  88. package/dist/index.js.map +1 -0
  89. package/dist/redux/index.cjs +2 -0
  90. package/dist/redux/index.cjs.map +1 -0
  91. package/dist/redux/index.d.cts +458 -0
  92. package/dist/redux/index.d.ts +458 -0
  93. package/dist/redux/index.js +2 -0
  94. package/dist/redux/index.js.map +1 -0
  95. package/dist/server/index.cjs +22 -0
  96. package/dist/server/index.cjs.map +1 -0
  97. package/dist/server/index.d.cts +78 -0
  98. package/dist/server/index.d.ts +78 -0
  99. package/dist/server/index.js +2 -0
  100. package/dist/server/index.js.map +1 -0
  101. package/dist/styled-components.d-CrkOxzv5.d.cts +346 -0
  102. package/dist/styled-components.d-CrkOxzv5.d.ts +346 -0
  103. package/dist/theme/index.cjs +2 -0
  104. package/dist/theme/index.cjs.map +1 -0
  105. package/dist/theme/index.d.cts +112 -0
  106. package/dist/theme/index.d.ts +112 -0
  107. package/dist/theme/index.js +2 -0
  108. package/dist/theme/index.js.map +1 -0
  109. package/dist/types-CGXygEPz.d.cts +8 -0
  110. package/dist/types-CGXygEPz.d.ts +8 -0
  111. package/dist/useForm-CG_DMYfZ.d.cts +178 -0
  112. package/dist/useForm-DW-a5mcV.d.ts +178 -0
  113. package/dist/utils/index.cjs +2 -0
  114. package/dist/utils/index.cjs.map +1 -0
  115. package/dist/utils/index.d.cts +6 -0
  116. package/dist/utils/index.d.ts +6 -0
  117. package/dist/utils/index.js +2 -0
  118. package/dist/utils/index.js.map +1 -0
  119. package/package.json +125 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../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/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/now.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.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/toNumber.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKey.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/_toKey.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGet.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_defineProperty.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAssignValue.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assignValue.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIndex.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseSet.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePickBy.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseHasIn.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/isLength.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hasPath.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/hasIn.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePick.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/flatten.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_apply.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_overRest.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/constant.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/identity.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseSetToString.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_shortOut.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_setToString.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_flatRest.js","../../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/pick.js","../../src/hooks/index.ts","../../src/hooks/useAllFormsOnModel.ts","../../src/hooks/useModularUIRequest.ts","../../src/redux/hooks.ts","../../src/redux/i18n/i18nSelectors.ts","../../src/hooks/useAuthentication.ts","../../src/redux/application/applicationSelectors.ts","../../src/redux/auth/authReducer.ts","../../src/redux/auth/signinActions.ts","../../src/redux/application/applicationActions.ts","../../src/redux/modularui/fetchModel.ts","../../src/redux/error/errorActions.ts","../../src/redux/auth/unauthorizedActions.ts","../../src/redux/modularui/modelActions.ts","../../src/redux/router/routerActions.ts","../../src/redux/notifications/notificationActions.ts","../../src/redux/progressindicator/progressIndicatorActions.ts","../../src/redux/notifications/notificationReducer.ts","../../src/redux/shared/actions.ts","../../src/redux/error/errorReducer.ts","../../src/redux/modularui/utils.ts","../../src/redux/shared/selectors.ts","../../src/redux/auth/signoutActions.ts","../../src/hooks/useContent.ts","../../src/hooks/useI18n.ts","../../src/hooks/useProgressIndicator.ts","../../src/hooks/useDeepCompareEffect.ts","../../src/hooks/useForm.ts","../../src/redux/form/attributeActions.ts","../../src/redux/form/autosaveActions.ts","../../src/redux/form/autosubmitActions.ts","../../src/redux/form/autoupdateActions.ts","../../src/redux/form/validateActions.ts","../../src/redux/form/formActions.ts","../../src/redux/form/formAttributesetRepeatable.ts","../../src/hooks/useModularUI.ts","../../src/hooks/useModal.ts","../../src/redux/modals/modalsReducer.ts","../../src/hooks/useModelCatalog.ts","../../src/redux/modelcatalog/modelCatalogReducer.ts","../../src/redux/modelcatalog/modelCatalogSelectors.ts","../../src/hooks/useModularUIBasic.ts","../../src/hooks/useRouter.ts","../../src/hooks/useModels.ts","../../src/redux/modularui/reloadModel.ts","../../src/hooks/useModularUIModel.ts","../../src/hooks/useNotification.ts","../../src/hooks/usePreference.ts"],"sourcesContent":["/** 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 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 root = require('./_root');\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 */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\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 */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\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 */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\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 baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\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 */\nfunction 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\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\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 */\nfunction 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\nmodule.exports = debounce;\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","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","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 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 toKey = require('./_toKey');\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 */\nfunction 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\nmodule.exports = baseGet;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\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 */\nfunction 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\nmodule.exports = baseAssignValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\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 * 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 */\nfunction 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\nmodule.exports = assignValue;\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","var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\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 */\nfunction 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\nmodule.exports = baseSet;\n","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet'),\n castPath = require('./_castPath');\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 */\nfunction 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\nmodule.exports = basePickBy;\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 */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\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/**\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 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 baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\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 */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var basePickBy = require('./_basePickBy'),\n hasIn = require('./hasIn');\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 */\nfunction basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n}\n\nmodule.exports = basePick;\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/**\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 */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\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 */\nfunction 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\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\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 */\nfunction 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\nmodule.exports = overRest;\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 */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\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 */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\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 */\nvar 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\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\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 */\nfunction 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\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\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 */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var flatten = require('./flatten'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\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 */\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nmodule.exports = flatRest;\n","var basePick = require('./_basePick'),\n flatRest = require('./_flatRest');\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 */\nvar pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n});\n\nmodule.exports = pick;\n","// Generated by createIndex.js - Do not edit manually!\n// This file is automatically updated when the script runs.\n\nexport * from \"./useAllFormsOnModel\";\nexport * from \"./useAuthentication\";\nexport * from \"./useContent\";\nexport * from \"./useDeepCompareEffect\";\nexport * from \"./useForm\";\nexport * from \"./useI18n\";\nexport * from \"./useModal\";\nexport * from \"./useModelCatalog\";\nexport * from \"./useModels\";\nexport * from \"./useModularUI\";\nexport * from \"./useModularUIBasic\";\nexport * from \"./useModularUIModel\";\nexport * from \"./useModularUIRequest\";\nexport * from \"./useNotification\";\nexport * from \"./usePreference\";\nexport * from \"./useProgressIndicator\";\nexport * from \"./useRouter\";\n","import { useEffect, useState } from \"react\";\n\nimport { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { FormModel, ListModel } from \"@beinformed/ui/models\";\n\nimport { useModularUIRequest } from \"./useModularUIRequest\";\n\nimport type { ActionModel, DetailModel, TabModel } from \"@beinformed/ui/models\";\n\nexport const useRetrieveFormsOnModel = (\n model: ListModel | DetailModel | TabModel,\n) => {\n const modularui = useModularUIRequest();\n\n const [forms, setForms] = useState(null);\n const [requestCount, setRequestCount] = useState(0);\n const [responseCount, setResponseCount] = useState(0);\n\n useEffect(() => {\n const requests = getActions(model).map((action) => {\n const href = action.selfhref.addParameter(\"commit\", \"false\");\n\n return modularui(href, { method: HTTP_METHODS.POST })\n .fetch()\n .then((form) => {\n if (form instanceof FormModel) {\n form.tokens = [];\n }\n return { [action.name]: form };\n });\n });\n\n setRequestCount(requests.length);\n\n Promise.all(requests).then((responses) => {\n // put response array in object\n const actionForms = Object.assign({}, ...responses);\n setForms(actionForms);\n setResponseCount(responses.length);\n });\n }, [model, modularui]);\n\n if (responseCount === requestCount) {\n return forms;\n }\n\n return null;\n};\n\nconst getActions = (model: ListModel | DetailModel | TabModel) => {\n if (!model.actionCollection) {\n return [];\n }\n\n const createActions = model.actionCollection\n .getActionsByType(\"create\")\n .filter((action) => !action.isDisabled);\n\n const allActions = [...createActions];\n\n if (model instanceof ListModel) {\n model.listItemCollection.forEach((listItem) => {\n const updateActions = listItem.actionCollection\n .getActionsByType(\"update\")\n .filter((action) => !action.isDisabled);\n\n allActions.push(...updateActions);\n });\n }\n\n const actions: ActionModel[] = [];\n const unique: string[] = [];\n allActions.forEach((action) => {\n if (!unique.includes(action.name)) {\n unique.push(action.name);\n actions.push(action);\n }\n });\n\n return actions;\n};\n","import { ModularUIRequest } from \"@beinformed/ui/modularui\";\nimport { createSelector } from \"reselect\";\n\nimport { useBEISelector } from \"../redux/hooks\";\nimport { getLocale } from \"../redux/i18n/i18nSelectors\";\n\nimport type { Href } from \"@beinformed/ui/models\";\nimport type { ModularUIRequestOptions } from \"@beinformed/ui/utils\";\n\nconst getModularUIRequest = createSelector([getLocale], (localeCode) => {\n return (href: Href, options?: ModularUIRequestOptions) => {\n const request = new ModularUIRequest(href, options);\n request.locale = localeCode;\n return request;\n };\n});\n\n/**\n * Creates a ModularUIRequest with the locale as available in the redux store\n */\nexport const useModularUIRequest = (): ((\n href: Href,\n options?: ModularUIRequestOptions,\n) => ModularUIRequest) => useBEISelector(getModularUIRequest);\n","// eslint-disable-next-line no-restricted-imports\nimport { useDispatch, useSelector, useStore } from \"react-redux\";\n\nimport type { BEIDispatch, BEIStore, RootState } from \"./store\";\n\n// Use throughout the library instead of plain `useDispatch` and `useSelector`\nexport const useBEIDispatch = useDispatch.withTypes<BEIDispatch>();\nexport const useBEISelector = useSelector.withTypes<RootState>();\nexport const useBEIStore = useStore.withTypes<BEIStore>();\n","import type { Locales } from \"../../i18n/Locales\";\nimport type { RootState } from \"../store\";\n\n/**\n * Retrieve the locale from state\n */\nexport const getLocale = (state: RootState) => {\n return state.i18n?.locale ?? \"en\";\n};\n\n/**\n * Retrieve all available locales in the store\n */\nexport const getLocales = (state: RootState): Locales => state.i18n.locales;\n","import { DEFAULT_AUTHENTICATION_TYPE } from \"@beinformed/ui/constants\";\nimport { IllegalStateException } from \"@beinformed/ui/exceptions\";\nimport { getContextPathServer, logoutPath } from \"@beinformed/ui/settings\";\nimport { Cache } from \"@beinformed/ui/utils\";\n\nimport { getApplication } from \"../redux/application/applicationSelectors\";\nimport { resetAuthErrors } from \"../redux/auth/authReducer\";\nimport { login } from \"../redux/auth/signinActions\";\nimport { logout } from \"../redux/auth/signoutActions\";\nimport { useBEIDispatch, useBEISelector } from \"../redux/hooks\";\n\nimport type { AuthenticationType } from \"@beinformed/ui/modularui\";\nimport type { RootState } from \"../redux/store\";\n\n/**\n * Provides access to authentication state and actions.\n * Includes functionality for standard username/password login and redirect-based login.\n * @returns An object containing authentication status, available authentication types, error messages, and login/logout functions.\n */\nexport const useLogin = () => {\n Cache.setItem(\"isRedirectLogin\", false);\n\n const dispatch = useBEIDispatch();\n\n const application = useBEISelector(getApplication);\n const auth = useBEISelector((state: RootState) => state.auth);\n\n const isAuthenticated = application?.isLoggedIn ?? false;\n\n return {\n /**\n * Indicates whether the user is currently authenticated.\n */\n isAuthenticated,\n\n /**\n * An array of available authentication types supported by the application.\n * Defaults to an array containing the `DEFAULT_AUTHENTICATION_TYPE` if no types are available in the application state.\n */\n authenticationTypes: application?.authenticationTypes ?? [\n DEFAULT_AUTHENTICATION_TYPE,\n ],\n\n /**\n * The current authentication error message, if any.\n */\n errorMessage: auth.error,\n\n /**\n * Resets the authentication error message in the Redux store.\n */\n resetErrors: () => dispatch(resetAuthErrors()),\n\n /**\n * Attempts to log in the user with the provided username and password.\n * Dispatches the `login` action to the Redux store.\n * @param username The username for authentication.\n * @param password The password for authentication.\n */\n login: (username: string, password: string) =>\n dispatch(login({ username, password })),\n\n /**\n * Initiates a redirect-based login flow for a specific authentication type.\n * If a redirect login is already in progress, it throws an `IllegalStateException` to prevent infinite loops.\n * If the user is not currently authenticated, it sets a flag in the cache and redirects the browser to the authentication provider's redirect URI.\n * @param authenticationType The authentication type to initiate the redirect for.\n * @throws {IllegalStateException} If a redirect login is already in progress for a different authentication type.\n */\n redirectLogin: (authenticationType: AuthenticationType) => {\n if (Cache.getItem(\"isRedirectLogin\")) {\n // prevent endless loop in redirects when authentication type can't be redirected\n throw new IllegalStateException(\n `Could not redirect to '${\n authenticationType.authentication\n }' using url: '${authenticationType.redirectUri ?? \"\"}'`,\n );\n }\n\n if (!isAuthenticated) {\n Cache.setItem(\"isRedirectLogin\", true);\n window.location.assign(\n `${getContextPathServer()}${authenticationType.redirectUri ?? \"\"}`,\n );\n }\n },\n };\n};\n\n/**\n * Provides access to logout functionality.\n * Handles both standard logout and redirect-based logout scenarios.\n * @returns An object containing the authentication status, available authentication types, and the logout function.\n */\nexport const useLogout = () => {\n const dispatch = useBEIDispatch();\n const application = useBEISelector(getApplication);\n\n const LOGOUT_PATH = logoutPath();\n const BASE_PATH = getContextPathServer();\n\n const isAuthenticated = application?.isLoggedIn ?? false;\n return {\n /**\n * Indicates whether the user is currently authenticated.\n */\n isAuthenticated,\n\n /**\n * An array of available authentication types supported by the application.\n * Defaults to an array containing the `DEFAULT_AUTHENTICATION_TYPE` if no types are available in the application state.\n */\n authenticationTypes: application?.authenticationTypes ?? [\n DEFAULT_AUTHENTICATION_TYPE,\n ],\n\n /**\n * Initiates the logout process.\n * If a redirect login was in progress, it redirects the user to the server's logout endpoint with a return URL to the current origin.\n * Otherwise, it dispatches the `logout` action to the Redux store.\n */\n logout: () => {\n if (Cache.getItem(\"isRedirectLogin\")) {\n const origin = window.location.origin;\n const url = `${origin}${BASE_PATH}/logout?url=${origin}${BASE_PATH}${LOGOUT_PATH}`;\n Cache.setItem(\"isRedirectLogin\", false);\n window.location.assign(url);\n } else {\n return dispatch(logout());\n }\n },\n };\n};\n","import { ApplicationModel } from \"@beinformed/ui/models\";\n\nimport type { RootState } from \"../store\";\n\n/**\n * Get the application model, which is the model with selfhref '/'\n */\nexport const getApplication = (state: RootState) => {\n const locale = state.i18n.locale || \"en\";\n const modularui = state.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const modelEntry = modularui[key];\n if (!modelEntry?.model) {\n return false;\n }\n return (\n modelEntry.model instanceof ApplicationModel &&\n modelEntry.model.locale === locale\n );\n });\n\n if (key) {\n return modularui[key] as unknown as ApplicationModel;\n }\n }\n\n return undefined;\n};\n","import { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nexport interface AuthState {\n authenticated: boolean;\n mustChangePassword: boolean;\n error: string | null;\n}\n\nconst initalState: AuthState = {\n authenticated: false,\n mustChangePassword: false,\n error: null,\n};\n\nexport const loginSuccess = createAction(\"AUTHENTICATION_SUCCESS\");\n\nexport const logoutSuccess = createAction(\"AUTHENTICATION_LOGOUT\");\n\nexport const sendAuthenticationError = createAction(\n \"AUTHENTICATION_ERROR\",\n (errorMessage: string) => {\n return {\n payload: errorMessage,\n };\n },\n);\n\nexport const resetAuthErrors = createAction(\"AUTHENTICATION_RESET_ERRORS\");\n\nexport const saveChangePassword = createAction(\"CHANGE_PASSWORD\");\n\nexport const authReducer = createReducer(initalState, (builder) => {\n builder\n .addCase(loginSuccess, (state) => {\n state.authenticated = true;\n state.error = null;\n state.mustChangePassword = false;\n })\n .addCase(sendAuthenticationError, (state, action) => {\n state.authenticated = false;\n state.error = action.payload;\n state.mustChangePassword = false;\n })\n .addCase(resetAuthErrors, (state) => {\n state.error = null;\n })\n .addCase(logoutSuccess, (state) => {\n state.authenticated = false;\n state.error = null;\n state.mustChangePassword = false;\n })\n .addCase(saveChangePassword, (state) => {\n state.authenticated = true;\n state.error = null;\n state.mustChangePassword = true;\n });\n});\n","import { CHANGEPASSWORD_PATH } from \"@beinformed/ui/constants\";\nimport { Authenticate } from \"@beinformed/ui/modularui\";\nimport { Cache } from \"@beinformed/ui/utils\";\nimport { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { reloadApplication } from \"../application/applicationActions\";\nimport { getApplication } from \"../application/applicationSelectors\";\nimport {\n finishProgress,\n startProgress,\n} from \"../progressindicator/progressIndicatorActions\";\nimport { push } from \"../router/routerActions\";\nimport { loginSuccess, sendAuthenticationError } from \"./authReducer\";\n\nimport type { PayloadAction } from \"@reduxjs/toolkit\";\nimport type { LocationState } from \"history\";\nimport type { RouterLocation } from \"../router/routerReducer\";\nimport type { BEIDispatch, RootState } from \"../store\";\n\nexport const loginFailed = (errorMessage: string) =>\n sendAuthenticationError(errorMessage);\n\nexport const changePassword = createAsyncThunk<\n PayloadAction<{ location: string | RouterLocation; state: LocationState }>,\n void,\n { state: RootState }\n>(\"auth/change_pass\", (_, { getState }) => {\n const isModal = getState().router.location?.state?.modal;\n const locationFrom = getState().router.location?.state?.from;\n return push(CHANGEPASSWORD_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n modal: isModal,\n });\n});\n\nexport const login = createAsyncThunk<\n void,\n { username: string; password: string },\n { state: RootState; dispatch: BEIDispatch }\n>(\"auth/login\", async ({ username, password }, { dispatch, getState }) => {\n dispatch(startProgress());\n\n try {\n await new Authenticate().login(username, password);\n await dispatch(reloadApplication());\n\n Cache.addItem(\"auth\", true);\n const application = getApplication(getState());\n if (application?.userMustChangePassword) {\n dispatch(changePassword());\n } else {\n dispatch(loginSuccess());\n }\n dispatch(finishProgress());\n } catch (error) {\n if (\n typeof error === \"object\" &&\n error != null &&\n \"id\" in error &&\n typeof error.id === \"string\"\n ) {\n if (error.id === \"Error.ChangePasswordRequired\") {\n Cache.addItem(\"auth\", true);\n await dispatch(reloadApplication());\n dispatch(changePassword());\n } else {\n dispatch(loginFailed(error.id));\n }\n } else if (error instanceof Error) {\n dispatch(loginFailed(error.message));\n }\n\n dispatch(finishProgress());\n }\n});\n","import { ApplicationModel, Href } from \"@beinformed/ui/models\";\nimport { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { getLocale } from \"../i18n/i18nSelectors\";\nimport { fetchModel } from \"../modularui/fetchModel\";\nimport { removeModelByKey } from \"../modularui/modelActions\";\nimport { allKeysByHref } from \"../shared/selectors\";\nimport { getApplication } from \"./applicationSelectors\";\n\nimport type { BEIDispatch, RootState } from \"../store\";\n\nexport const reloadApplication = createAsyncThunk<\n void,\n void,\n { dispatch: BEIDispatch; state: RootState; extra: unknown }\n>(\"application/reload\", async (_, { dispatch, getState }) => {\n const state = getState();\n\n const applicationHref = new Href(\"/\", \"Application\");\n\n const application = getApplication(state);\n if (application) {\n if (application.contextPath) {\n applicationHref.contextPath = application.contextPath;\n }\n if (application.origin) {\n applicationHref.origin = application.origin;\n }\n }\n\n const allKeys = allKeysByHref(state, applicationHref);\n for (const key of allKeys) {\n dispatch(removeModelByKey(key));\n }\n\n const locale = getLocale(state);\n const modelKey = `application(/)(${locale}`;\n\n await dispatch(\n fetchModel({\n key: modelKey,\n href: applicationHref,\n options: {\n targetModel: ApplicationModel,\n },\n }),\n );\n});\n","import { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { ErrorResponse, Href } from \"@beinformed/ui/models\";\nimport { ModularUIRequest } from \"@beinformed/ui/modularui\";\nimport { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { handleError } from \"../error/errorActions\";\nimport { MODULARUI_STATUS } from \"./constants\";\nimport { removeModelByKey, updateErrorStatus } from \"./modelActions\";\nimport { getRequestLocale } from \"./utils\";\n\nimport type { BEIDispatch, RootState } from \"../store\";\nimport type { FetchModelPayload, FetchModelResult } from \"./types\";\n\nconst executeRequest = async (\n { key, href, options }: FetchModelPayload,\n {\n dispatch,\n getState,\n rejectWithValue,\n }: {\n dispatch: BEIDispatch;\n getState: () => RootState;\n rejectWithValue: (value: ErrorResponse) => unknown;\n },\n): Promise<FetchModelResult> => {\n try {\n const locale = getRequestLocale(options?.locale, getState().i18n.locale);\n\n const requestHref =\n href instanceof Href\n ? href\n : new Href(href, \"\", {\n origin: options?.origin,\n contextPath: options?.contextPath,\n });\n\n const modularuiRequest = new ModularUIRequest(requestHref, {\n method: options?.method || HTTP_METHODS.GET,\n params: options?.params || \"\",\n data: options?.data || null,\n locale: locale,\n childmodels: options?.childmodels ?? true,\n isReload: options?.isReload,\n cache: options?.cache,\n headers: options?.headers,\n events: options?.events,\n onProgress: options?.onProgress,\n origin: options?.origin,\n contextPath: options?.contextPath,\n targetModel: options?.targetModel,\n forceTargetModel: options?.forceTargetModel ?? false,\n timeout: options?.timeout,\n });\n\n const model = await modularuiRequest.fetch();\n\n if (model) {\n model.connectKey = key;\n }\n\n // Return data for the fulfilled action\n return {\n key,\n model,\n updateHandler: options?.updateHandler,\n };\n } catch (error: unknown) {\n const errorResponse = new ErrorResponse(error as Error, key, {\n origin: options?.origin,\n contextPath: options?.contextPath,\n });\n\n // Specific error handling for removing model on certain errors\n if (\n errorResponse.isChangePassword ||\n errorResponse.isResourceNotFoundAfterReload\n ) {\n dispatch(removeModelByKey(key));\n } else {\n dispatch(updateErrorStatus(key, errorResponse));\n }\n\n // Dispatch the global error handler\n dispatch(handleError(error));\n\n throw rejectWithValue(errorResponse);\n }\n};\n\nexport const fetchModel = createAsyncThunk<\n FetchModelResult, // Return type of the fulfilled action payload\n FetchModelPayload, // First argument to the thunk\n {\n dispatch: BEIDispatch;\n state: RootState;\n rejectValue: ErrorResponse; // Type of the error payload in case of rejection\n }\n>(\"modularui/fetchModel\", executeRequest, {\n condition: ({ key }, { getState }) => {\n if (getState().modularui[key]?.status === MODULARUI_STATUS.LOADING) {\n return false;\n }\n },\n});\n","import { IS_SERVER } from \"@beinformed/ui/constants\";\nimport { ErrorResponse } from \"@beinformed/ui/models\";\nimport { logoutPath } from \"@beinformed/ui/settings\";\n\nimport { saveChangePassword } from \"../auth/authReducer\";\nimport { handleUnauthorized } from \"../auth/unauthorizedActions\";\nimport { showXHRErrorNotification } from \"../notifications/notificationActions\";\nimport { push } from \"../router/routerActions\";\nimport { noAction } from \"../shared/actions\";\nimport { saveError } from \"./errorReducer\";\n\nimport type { BEIDispatch } from \"../store\";\n\ntype DefaultHandler = typeof defaultErrorResponseHandler;\n\n// Default handler\nconst defaultErrorResponseHandler =\n (error: ErrorResponse) => (dispatch: BEIDispatch) => {\n if (error.isResourceNotFoundAfterReload || error.isRemoteServiceException) {\n return dispatch(noAction());\n }\n\n if (error.isUnauthorized) {\n return dispatch(handleUnauthorized(error));\n }\n\n if (error.isBlocked || error.isConcurrentUser || error.isInvalidUsername) {\n dispatch(push(logoutPath()));\n return;\n }\n\n if (error.isChangePassword) {\n return dispatch(saveChangePassword());\n }\n\n if (IS_SERVER) {\n return dispatch(saveError(error));\n }\n\n // This setTimeout might hide errors from Sentry/monitoring tools\n setTimeout(() => {\n throw error.error || error;\n });\n\n return dispatch(showXHRErrorNotification(error));\n };\n\ntype CustomErrorResponseHandler = (\n error: ErrorResponse,\n defaultHandler: DefaultHandler,\n) => (dispatch: BEIDispatch) => void;\n\nlet customErrorResponseHandler: CustomErrorResponseHandler =\n (error, defaultHandler) => (dispatch) =>\n dispatch(defaultHandler(error));\n\nexport const setCustomErrorResponseHandler = (\n handler: CustomErrorResponseHandler,\n) => {\n customErrorResponseHandler = handler;\n};\n\nexport const handleError = (error: unknown) => {\n // Ensure the error is an ErrorResponse if possible, otherwise create one.\n const errorResponse =\n error instanceof ErrorResponse ? error : new ErrorResponse(error as Error);\n\n // Dispatch the default handler or custom handler\n return customErrorResponseHandler(errorResponse, defaultErrorResponseHandler);\n};\n","import { getBooleanSetting, getStringSetting } from \"@beinformed/ui/settings\";\nimport { Cache } from \"@beinformed/ui/utils\";\nimport { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { reloadApplication } from \"../application/applicationActions\";\nimport { getApplication } from \"../application/applicationSelectors\";\nimport { removeModelByKey } from \"../modularui/modelActions\";\nimport { replace } from \"../router/routerActions\";\nimport { logoutSuccess, sendAuthenticationError } from \"./authReducer\";\n\nimport type { ErrorResponse } from \"@beinformed/ui/models\";\nimport type { BEIDispatch, RootState } from \"../store\";\n\nexport const handleUnauthorized = createAsyncThunk<\n void,\n ErrorResponse,\n { state: RootState; dispatch: BEIDispatch }\n>(\"auth/unauthorized\", (errorResponse, { dispatch, getState }) => {\n if (errorResponse.connectKey) {\n dispatch(removeModelByKey(errorResponse.connectKey));\n }\n\n if (\n getBooleanSetting(\"PAGE_RELOAD_ON_UNAUTHORIZED_ERROR\", false) &&\n errorResponse.response\n ) {\n window.location.reload();\n return;\n }\n\n // reload application when flag auth is set or isLogged\n const application = getApplication(getState());\n if (Cache.getItem(\"auth\") || application?.isLoggedIn) {\n dispatch(reloadApplication());\n }\n\n // set logged out\n dispatch(logoutSuccess());\n\n Cache.removeItem(\"auth\");\n\n if (errorResponse.isInvalidUsername) {\n dispatch(sendAuthenticationError(errorResponse.message || \"\"));\n }\n\n // add current location as from location before redirect\n const location = getState().router.location;\n const LOGIN_PATH = getStringSetting(\"LOGIN_PATH\", \"/signin\");\n if (location?.pathname !== LOGIN_PATH) {\n const locationFrom = location?.state?.from;\n dispatch(\n replace(LOGIN_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n // cannot open login in a modal, because of previous locations that might be secure\n modal: false,\n }),\n );\n }\n});\n","import { createAction } from \"@reduxjs/toolkit\";\n\nimport type { ErrorResponse, ModularUIModel } from \"@beinformed/ui/models\";\n\nexport const updateErrorStatus = createAction(\n \"MODULARUI/ERROR_STATUS\",\n (key: string, error: ErrorResponse) => {\n return {\n payload: {\n key,\n error,\n },\n };\n },\n);\n\nexport const setModel = createAction(\n \"MODULARUI/SET\",\n (key: string, model: ModularUIModel) => {\n model.connectKey = key;\n return {\n payload: {\n key,\n model,\n },\n };\n },\n);\n\nexport const initModels = createAction(\n \"MODULARUI/INIT\",\n (models: { key: string; model: ModularUIModel }[]) => {\n return {\n payload: models,\n };\n },\n);\n\nexport const updateModel = createAction(\n \"MODULARUI/UPDATE\",\n (model: ModularUIModel) => {\n return {\n payload: model,\n };\n },\n);\n\nexport const updateForm = createAction(\n \"MODULARUI/UPDATE_FORM\",\n (model: ModularUIModel) => {\n return {\n payload: model,\n };\n },\n);\n\nexport const removeModelByKey = createAction(\n \"MODULARUI/REMOVE_KEY\",\n (key: string) => {\n return {\n payload: key,\n };\n },\n);\n\n/**\n * Removes all models except the application model from the modular ui reducer\n */\nexport const resetModularUI = createAction(\"MODULARUI/RESET\");\n","import { createAction } from \"@reduxjs/toolkit\";\n\nimport type { LocationState } from \"history\";\nimport type { RouterLocation } from \"./routerReducer\";\n\nexport const push = createAction(\n \"ROUTER/PUSH\",\n (location: RouterLocation | string, state?: LocationState) => {\n return {\n payload: { location, state },\n };\n },\n);\n\nexport const replace = createAction(\n \"ROUTER/REPLACE\",\n (location: RouterLocation | string, state?: LocationState) => {\n return {\n payload: { location, state },\n };\n },\n);\n\nexport const go = createAction(\"ROUTER/GO\", (delta: number) => {\n return {\n payload: { delta },\n };\n});\n\nexport const goBack = createAction(\"ROUTER/GOBACK\");\n\nexport const goForward = createAction(\"ROUTER/GOFORWARD\");\n","import { getNumberSetting } from \"@beinformed/ui/settings\";\nimport { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport {\n finishProgress,\n startProgress,\n} from \"../progressindicator/progressIndicatorActions\";\nimport {\n dismissNotification,\n NOTIFICATION_TYPES,\n showNotification,\n} from \"./notificationReducer\";\n\nimport type { ErrorResponse, FormModel } from \"@beinformed/ui/models\";\n\nconst getNotificationMessageId = (form: FormModel) => {\n if (form.actiontype === \"create\") {\n return \"Notification.Msg.Create\";\n }\n\n if (form.actiontype === \"update\") {\n return \"Notification.Msg.Update\";\n }\n\n if (form.actiontype === \"delete\") {\n return \"Notification.Msg.Delete\";\n }\n\n return \"Notification.Msg.Generic\";\n};\n\n/**\n * Show form notification\n */\nexport const showFormNotification = createAsyncThunk(\n \"notification/show_form\",\n async (form: FormModel, { dispatch }) => {\n dispatch(startProgress());\n\n dispatch(\n showNotification({\n type: NOTIFICATION_TYPES.SUCCESS,\n message: {\n id: getNotificationMessageId(form),\n },\n }),\n );\n\n setTimeout(() => {\n dispatch(dismissNotification());\n }, getNumberSetting(\"HIDE_NOTIFICATION_TIMEOUT\"));\n\n return dispatch(finishProgress());\n },\n);\n\n/**\n * Show error notification\n */\nexport const showXHRErrorNotification = (error: ErrorResponse) => {\n return showNotification({\n type: NOTIFICATION_TYPES.ERROR,\n message: {\n id: error.id,\n defaultMessage: error.message,\n parameters: error.properties,\n },\n error,\n });\n};\n","import { createAction } from \"@reduxjs/toolkit\";\n\nexport const startProgress = createAction(\"START_PROGRESS\");\nexport const finishProgress = createAction(\"FINISH_PROGRESS\");\nexport const resetProgress = createAction(\"RESET_PROGRESS\");\nexport const updateProgress = createAction(\n \"UPDATE_PROGRESS\",\n (percentComplete: number) => ({\n payload: {\n percentComplete,\n },\n }),\n);\n","import {\n createAction,\n createAsyncThunk,\n createReducer,\n} from \"@reduxjs/toolkit\";\n\nimport type { ErrorResponse } from \"@beinformed/ui/models\";\nimport type { MessageObject } from \"../../i18n/types\";\n\nexport interface NotificationState {\n render: boolean;\n messageType: string | undefined;\n message: MessageObject | undefined;\n error: ErrorResponse | undefined;\n}\n\nexport interface ShowNotificationArguments {\n type: NOTIFICATION_TYPES | undefined;\n message: MessageObject | undefined;\n error?: ErrorResponse | undefined;\n timeout?: number;\n}\n\nexport enum NOTIFICATION_TYPES {\n SUCCESS = \"SUCCESS\",\n INFO = \"INFO\",\n WARNING = \"WARNING\",\n ERROR = \"ERROR\",\n}\n\nconst saveNotification = createAction(\n \"SHOW_NOTIFICATION\",\n (\n type: NOTIFICATION_TYPES | undefined,\n message: MessageObject | undefined,\n error?: ErrorResponse | undefined,\n ) => {\n return {\n payload: {\n type,\n message,\n error,\n },\n };\n },\n);\n\nexport const showNotification = createAsyncThunk(\n \"notifications/show\",\n (\n { type, message, error, timeout }: ShowNotificationArguments,\n { dispatch },\n ) => {\n if (timeout) {\n setTimeout(() => {\n dispatch(dismissNotification());\n }, timeout);\n }\n\n dispatch(saveNotification(type, message, error));\n },\n);\n\nexport const dismissNotification = createAction(\"DISMISS_NOTIFICATION\");\n\nconst initialState: NotificationState = {\n render: false,\n messageType: undefined,\n message: undefined,\n error: undefined,\n};\n\nexport const notificationReducer = createReducer<NotificationState>(\n initialState,\n (builder) => {\n builder\n .addCase(saveNotification, (state, action) => {\n return {\n ...state,\n render: true,\n messageType: action.payload.type,\n message: action.payload.message,\n error: action.payload.error,\n };\n })\n .addCase(dismissNotification, (state) => {\n return {\n ...state,\n render: false,\n messageType: undefined,\n message: undefined,\n error: undefined,\n };\n });\n },\n);\n","import { createAction } from \"@reduxjs/toolkit\";\n\nexport const noAction = createAction(\"NO_ACTION\");\n","import { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nimport type { ErrorResponse } from \"@beinformed/ui/models\";\n\nexport type ErrorState = null | ErrorResponse;\n\nexport const saveError = createAction(\"SAVE_ERROR\", (error: ErrorResponse) => {\n return {\n payload: error,\n };\n});\n\nconst initialState = null;\n\nexport const errorReducer = createReducer<ErrorState>(\n initialState,\n (builder) => {\n builder.addCase(saveError, (_state, action) => {\n return action.payload;\n });\n },\n);\n","/**\n * Retrieve the preferred language for this request, falls back to the browser language or english\n */\nexport const getRequestLocale = (\n optionLocale: string | undefined,\n currentStateLocale: string,\n) => {\n if (optionLocale) {\n return optionLocale;\n }\n\n if (typeof navigator !== \"undefined\" && navigator?.language) {\n return navigator.language.split(\"-\")[0] || currentStateLocale;\n }\n\n return currentStateLocale;\n};\n","import { Href } from \"@beinformed/ui/models\";\n\nimport type { RootState } from \"../store\";\n\nexport const getFirstModelByInstance = <\n T extends new (...args: unknown[]) => unknown,\n>(\n state: RootState,\n instance: T,\n): InstanceType<T> | undefined => {\n const locale = state.i18n.locale || \"en\";\n const modularui = state.modularui;\n\n if (modularui) {\n const key = Object.keys(modularui).find((key) => {\n const modelEntry = modularui[key];\n if (!modelEntry?.model) {\n return false;\n }\n return (\n modelEntry.model instanceof instance &&\n modelEntry.model.locale === locale\n );\n });\n\n if (key) {\n const modelEntry = modularui[key];\n if (modelEntry?.model instanceof instance) {\n return modelEntry.model as InstanceType<T>;\n }\n }\n }\n\n return undefined;\n};\n\n/**\n * Returns all model keys found in the store, restrict on href\n */\nexport const allKeysByHref = (state: RootState, href: Href | string) => {\n if (state && state.modularui) {\n const findHref = href instanceof Href ? href : new Href(href);\n\n return Object.keys(state.modularui).filter((key) => {\n const modelEntry = state.modularui[key];\n if (modelEntry) {\n return modelEntry.model?.selfhref?.equals(findHref);\n }\n });\n }\n\n return [];\n};\n","import { Authenticate } from \"@beinformed/ui/modularui\";\nimport { createAsyncThunk } from \"@reduxjs/toolkit\";\n\nimport { reloadApplication } from \"../application/applicationActions\";\nimport { resetModularUI } from \"../modularui/modelActions\";\nimport {\n finishProgress,\n startProgress,\n} from \"../progressindicator/progressIndicatorActions\";\nimport { logoutSuccess } from \"./authReducer\";\n\nimport type { BEIDispatch } from \"../store\";\n\nexport const logout = createAsyncThunk<void, void, { dispatch: BEIDispatch }>(\n \"auth/logout\",\n async (_, { dispatch }) => {\n dispatch(startProgress());\n\n await new Authenticate().logout();\n\n dispatch(resetModularUI());\n dispatch(reloadApplication());\n\n dispatch(logoutSuccess());\n dispatch(finishProgress());\n },\n);\n","import { useEffect, useState } from \"react\";\n\nimport { ModularUIRequest } from \"@beinformed/ui/modularui\";\n\nimport { useLocale } from \"../hooks/useI18n\";\nimport { useProgressIndicator } from \"../hooks/useProgressIndicator\";\n\nimport type {\n ContentModel,\n Href,\n SourceReferenceCollection,\n} from \"@beinformed/ui/models\";\n\n/**\n * Hook to retrieve multiple source references at once\n */\nexport const useContentFromSourceReferences = (\n sourceReferences: SourceReferenceCollection,\n renderChildSections: boolean,\n): ContentModel[] => {\n const [content, setContent] = useState<ContentModel[]>([]);\n const localeCode = useLocale();\n\n const { start, finish } = useProgressIndicator();\n\n const hrefs = sourceReferences\n .map((sourceReference) => sourceReference.link?.selfhref.href)\n .filter((href, index, self) => self.indexOf(href) === index)\n .map((href) => href?.toString());\n\n const allHrefs = JSON.stringify(hrefs);\n useEffect(() => {\n const requests = JSON.parse(allHrefs).map((href: Href) => {\n const modularuiRequest = new ModularUIRequest(href);\n modularuiRequest.locale = localeCode;\n return modularuiRequest.fetchContent(renderChildSections);\n });\n\n start();\n Promise.all(requests).then((responseContent) => {\n setContent(responseContent);\n finish();\n });\n\n // start and finish don't change\n }, [allHrefs, localeCode, renderChildSections]);\n\n return content;\n};\n","import memoize from \"lodash/memoize\";\nimport { createSelector } from \"reselect\";\n\nimport { useBEISelector } from \"../redux/hooks\";\nimport { getLocale, getLocales } from \"../redux/i18n/i18nSelectors\";\n\nimport type { MessageParameters } from \"@beinformed/ui/types\";\nimport type { RootState } from \"../redux/store\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (\n id: string,\n defaultMessage?: string,\n placeholders?: MessageParameters | undefined,\n ) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\nexport const useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: MessageParameters | undefined,\n) => useBEISelector(getMessage)(id, defaultMessage, placeholders);\n\nexport const useTranslate = () => useBEISelector(getMessage);\n\nexport const useLocale = (): string => useBEISelector(getLocale);\n\nconst getLocaleCodes = createSelector(\n (state: RootState) => state.i18n.locales,\n (locales) => locales.map((locale: { code: string }) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nexport const useLocaleCodes = (): string[] => useBEISelector(getLocaleCodes);\n","import { useBEIDispatch, useBEISelector } from \"../redux/hooks\";\nimport {\n finishProgress,\n resetProgress,\n startProgress,\n updateProgress,\n} from \"../redux/progressindicator/progressIndicatorActions\";\n\nimport type { RootState } from \"../redux/store\";\n\nexport const useProgressIndicator = () => {\n const dispatch = useBEIDispatch();\n const progress = useBEISelector(\n (state: RootState) => state.progressindicator,\n );\n\n return {\n ...progress,\n start: () => dispatch(startProgress()),\n finish: () => dispatch(finishProgress()),\n reset: () => dispatch(resetProgress()),\n update: (percentComplete: number) =>\n dispatch(updateProgress(percentComplete)),\n };\n};\n","import { useEffect, useRef } from \"react\";\n\nimport { dequal as deepEqual } from \"dequal/lite\";\n\ntype Callback = () => void | (() => void);\ntype DependencyList = unknown[];\n\n/**\n * As copied from https://github.com/kentcdodds/use-deep-compare-effect/\n * Need to copy this, because the dependency on dequal breaks in ie11\n */\nconst useDeepCompareMemoize = (value: DependencyList) => {\n const ref = useRef<DependencyList | null>(null);\n const signalRef = useRef<number>(0);\n\n if (!deepEqual(value, ref.current)) {\n ref.current = value;\n signalRef.current += 1;\n }\n\n return [signalRef.current];\n};\n\nexport function useDeepCompareEffect(\n callback: Callback,\n dependencies: DependencyList,\n): void {\n return useEffect(callback, useDeepCompareMemoize(dependencies));\n}\n","import { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { FormModel, Href } from \"@beinformed/ui/models\";\nimport { getSetting } from \"@beinformed/ui/settings\";\nimport { produce } from \"immer\";\n\nimport { updateFormAttribute } from \"../redux/form/attributeActions\";\nimport { cancelForm, previousObject } from \"../redux/form/formActions\";\nimport {\n addRepeatableAttributeSet,\n cancelRepeatableAttributeSet,\n removeRepeatableAttributeSet,\n} from \"../redux/form/formAttributesetRepeatable\";\nimport { useBEIDispatch } from \"../redux/hooks\";\nimport { fetchModel } from \"../redux/modularui/fetchModel\";\nimport { removeModelByKey } from \"../redux/modularui/modelActions\";\nimport { showFormNotification } from \"../redux/notifications/notificationActions\";\nimport { useModularUI } from \"./useModularUI\";\n\nimport type {\n AttributeModel,\n FormObjectModel,\n ModularUIModel,\n} from \"@beinformed/ui/models\";\n\nexport interface UpdateFormOptions {\n autosubmit: boolean;\n autosave: boolean;\n autoupdate: boolean;\n forceUpdate?: boolean;\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean;\n}\n\n/**\n * Load a form by href\n */\nexport const useForm = (\n href: string | Href,\n data?: Record<string, unknown>,\n) => {\n const formHref = new Href(href);\n\n if (!getSetting(\"ALWAYS_COMMIT_FORM\")) {\n formHref.addParameter(\"commit\", \"false\");\n }\n\n const form = useModularUI(\"form\", formHref, {\n method: HTTP_METHODS.POST,\n targetModel: FormModel,\n removeOnUnmount: true,\n data: data ? JSON.stringify(data) : undefined,\n origin: formHref.origin,\n contextPath: formHref.contextPath,\n });\n\n if (form?.model) {\n return form.model;\n }\n\n return;\n};\n\n/**\n * Form navigation methods\n */\nexport const useFormNavigation = () => {\n const dispatch = useBEIDispatch();\n\n const previous = (form: FormModel) => dispatch(previousObject(form));\n\n const cancel = (form: FormModel) => dispatch(cancelForm(form));\n\n const submit = (form: FormModel) =>\n dispatch(\n fetchModel({\n key: form.connectKey || form.key,\n href: form.selfhref,\n options: {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateHandler: (newModel: ModularUIModel): ModularUIModel => {\n if (newModel instanceof FormModel) {\n return produce(newModel, (draft) => {\n draft.update(newModel);\n });\n }\n return newModel;\n },\n targetModel: FormModel,\n },\n }),\n );\n\n const remove = (form: FormModel) =>\n dispatch(removeModelByKey(form.connectKey || \"\"));\n\n const showFormNotificationAction = (form: FormModel) =>\n dispatch(showFormNotification(form));\n\n return {\n previous,\n cancel,\n submit,\n remove,\n showFormNotification: showFormNotificationAction,\n };\n};\n\n/**\n * Hook that returns a function to update attributes of a form object.\n * <br >\n * The returned function accepts the following options:\n *\n * - autosubmit: Automatically submit the form after a change\n * - autosav: Automatically save the form (in the background) after a change\n * - autoupdate: Automatically update the current form object after a change\n * - forceUpdate: Force the update even if conditions are not met.\n * - validate: Activate/deactivate the form object validation by an update.\n */\nexport const useAttributeUpdate = (\n form: FormModel,\n formObject: FormObjectModel,\n) => {\n const dispatch = useBEIDispatch();\n\n return (\n attribute: AttributeModel,\n inputvalue: string,\n options?: UpdateFormOptions,\n ) =>\n dispatch(\n updateFormAttribute({ form, formObject, attribute, inputvalue, options }),\n );\n};\n\n/**\n * Repeatable attributeset actions\n */\nexport const useRepeatableAttributeSet = (form: FormModel) => {\n const dispatch = useBEIDispatch();\n\n return {\n save: () => dispatch(addRepeatableAttributeSet(form)),\n cancel: (object: FormObjectModel) =>\n dispatch(cancelRepeatableAttributeSet(form, object)),\n remove: (object: FormObjectModel) =>\n dispatch(removeRepeatableAttributeSet(form, object)),\n };\n};\n","import { getBooleanSetting } from \"@beinformed/ui/settings\";\nimport { createAsyncThunk } from \"@reduxjs/toolkit\";\nimport { produce } from \"immer\";\n\nimport { updateForm } from \"../modularui/modelActions\";\nimport { autosaveFormObject } from \"./autosaveActions\";\nimport { autosubmitFormObject } from \"./autosubmitActions\";\nimport { autoupdateFormObject } from \"./autoupdateActions\";\nimport { validateFormObject } from \"./validateActions\";\n\nimport type {\n AttributeModel,\n FormModel,\n FormObjectModel,\n} from \"@beinformed/ui/models\";\nimport type { UpdateFormOptions } from \"../../hooks/useForm\";\nimport type { BEIDispatch } from \"../store\";\n\nexport const updateFormAttribute = createAsyncThunk<\n void,\n {\n form: FormModel;\n formObject: FormObjectModel;\n attribute: AttributeModel;\n inputvalue: string;\n options?: UpdateFormOptions;\n },\n { dispatch: BEIDispatch }\n>(\n \"form/attribute\",\n async (\n {\n form,\n formObject,\n attribute,\n inputvalue,\n options = {\n autosubmit: false,\n autosave: false, // autosave commits the form in the background\n autoupdate: false, // autoupdate does not commit and updates the form with for example a new dynamicschema (work-around for form-tree iq)\n forceUpdate: false,\n validate: true,\n },\n },\n { dispatch },\n ) => {\n if (options.validate === undefined) {\n options.validate = true;\n }\n\n const newForm = produce(form, (draft) => {\n if (draft.currentFormObject?.equals(formObject)) {\n draft.currentFormObject.updateAttribute(attribute, inputvalue);\n } else {\n draft.completedFormObjects.forEach((completeObject) => {\n if (completeObject.equals(formObject)) {\n completeObject.updateAttribute(attribute, inputvalue);\n }\n });\n }\n });\n\n if (options.autosubmit && newForm.isValid) {\n const autosubmitAction = autosubmitFormObject(\n newForm,\n attribute,\n options.forceUpdate,\n );\n if (autosubmitAction) {\n dispatch(autosubmitAction);\n return;\n }\n }\n\n if (options.autoupdate && newForm.isValid) {\n const autoupdateAction = autoupdateFormObject(newForm, attribute);\n if (autoupdateAction) {\n dispatch(autoupdateAction);\n return;\n }\n }\n\n handleAutoSave(dispatch, newForm, options);\n\n handleValidate(dispatch, newForm, options);\n\n dispatch(updateForm(newForm));\n },\n);\n\nconst handleAutoSave = (\n dispatch: BEIDispatch,\n newForm: FormModel,\n options: UpdateFormOptions,\n) => {\n if (options.autosave && newForm.isValid && newForm.isChanged()) {\n dispatch(autosaveFormObject(newForm));\n }\n};\n\nconst handleValidate = (\n dispatch: BEIDispatch,\n newForm: FormModel,\n options: UpdateFormOptions,\n) => {\n if (\n options.validate &&\n newForm.currentFormObject?.hasDynamicValidations &&\n getBooleanSetting(\"USE_INSTANT_SERVER_VALIDATION\", false)\n ) {\n // server form validations happens async, don't wait for the form to return\n dispatch(validateFormObject(newForm));\n }\n};\n","import { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { FormModel } from \"@beinformed/ui/models\";\nimport { ModularUIRequest } from \"@beinformed/ui/modularui\";\nimport { getNumberSetting } from \"@beinformed/ui/settings\";\nimport debounce from \"lodash/debounce\";\n\nimport { updateForm } from \"../modularui/modelActions\";\n\nimport type { BEIDispatch } from \"../store\";\n\n/**\n * POSSIBLE AUTOSAVE STATUSSES\n * @type {{START: string, FINISHED: string}}\n */\nexport enum AUTOSAVE_STATUS {\n START,\n FINISHED,\n}\n\n/**\n * Update validations of the form currently in the reducer\n * because of the debounce timeout there might have been an update on the form during validation\n */\nconst updateAutosave = (status: AUTOSAVE_STATUS, model: FormModel) => ({\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status,\n model,\n },\n});\n\n/**\n */\nconst autosave = (dispatch: BEIDispatch, form: FormModel) => {\n dispatch(updateAutosave(AUTOSAVE_STATUS.START, form));\n\n const formdata = form.getFormData(true, false);\n\n new ModularUIRequest(form.selfhref.setParameter(\"commit\", \"true\"), {\n method: HTTP_METHODS.POST,\n data: formdata,\n childmodels: false,\n locale: form.locale,\n })\n .fetch()\n .then((savedForm) => {\n if (savedForm instanceof FormModel) {\n // update last server update to indicate an update has happened\n // send the existing form to prevent updates in the ui based on autosave results\n form.lastServerUpdate = savedForm.lastServerUpdate;\n\n dispatch(updateForm(form));\n dispatch(updateAutosave(AUTOSAVE_STATUS.FINISHED, savedForm));\n }\n });\n};\n\n/**\n * Validates form objects debounced to prevent overloading the (form) service\n * When a form with new errors (or complete) arrives, we send the validations\n * to the current form model where the errors are processed\n * A new form with the new constraints is send to the store\n */\nconst debouncedAutosave = debounce(\n (dispatch, form) => {\n autosave(dispatch, form);\n },\n getNumberSetting(\"VALIDATE_DEBOUNCE_TIMEOUT\", 500),\n);\n\nexport const autosaveFormObject =\n (form: FormModel) => (dispatch: BEIDispatch) =>\n debouncedAutosave(dispatch, form);\n","import { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { FormModel } from \"@beinformed/ui/models\";\nimport { produce } from \"immer\";\n\nimport { fetchModel } from \"../modularui/fetchModel\";\n\nimport type { AttributeModel } from \"@beinformed/ui/models\";\n\nexport const autosubmitFormObject = (\n form: FormModel,\n attribute: AttributeModel,\n forceUpdate = false,\n) => {\n // As long as we have form objects,\n // and the current attribute is not found in the current form object, go back.\n // When a form has a result, the current form object is null\n while (\n form.allObjects.length > 0 &&\n (!form.currentFormObject ||\n !form.currentFormObject.hasAttributeByKey(attribute.key))\n ) {\n form.setPreviousObject();\n }\n\n if (form.isChanged() || forceUpdate) {\n return fetchModel({\n key: form.connectKey || form.key,\n href: form.selfhref,\n options: {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateHandler: (newModel) => {\n if (newModel instanceof FormModel) {\n return produce(form, (draft) => {\n draft.update(newModel);\n });\n }\n return newModel;\n },\n },\n });\n }\n\n return null;\n};\n","import { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { FormModel } from \"@beinformed/ui/models\";\nimport { produce } from \"immer\";\n\nimport { fetchModel } from \"../modularui/fetchModel\";\n\nimport type { AttributeModel } from \"@beinformed/ui/models\";\n\nexport const autoupdateFormObject = (\n form: FormModel,\n attribute: AttributeModel,\n) => {\n // As long as we have form objects,\n // and the current attribute is not found in the current form object, go back.\n // When a form has a result, the current form object is null\n while (\n form.allObjects.length > 0 &&\n (!form.currentFormObject ||\n !form.currentFormObject.hasAttributeByKey(attribute.key))\n ) {\n form.setPreviousObject();\n }\n\n if (form.isChanged()) {\n return fetchModel({\n key: form.connectKey || form.key,\n href: form.selfhref.setParameter(\"commit\", \"false\"),\n options: {\n method: HTTP_METHODS.POST,\n data: form.formdata,\n updateHandler: (newModel) => {\n if (newModel instanceof FormModel) {\n return produce(form, (draft) => {\n draft.updateCurrentFormObject(newModel);\n });\n }\n return newModel;\n },\n },\n });\n }\n\n return null;\n};\n","import { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { FormModel } from \"@beinformed/ui/models\";\nimport { ModularUIRequest } from \"@beinformed/ui/modularui\";\nimport { getNumberSetting } from \"@beinformed/ui/settings\";\nimport { createAsyncThunk } from \"@reduxjs/toolkit\";\nimport { produce } from \"immer\";\nimport debounce from \"lodash/debounce\";\n\nimport { updateForm } from \"../modularui/modelActions\";\n\nimport type { BEIDispatch, RootState } from \"../store\";\n\n/**\n * Update validations of the form currently in the reducer\n * because of the debounce timeout there might have been an update on the form during validation\n */\nconst updateValidations = createAsyncThunk<\n void,\n { form: FormModel; formWithValidations: FormModel },\n { dispatch: BEIDispatch; state: RootState }\n>(\"\", ({ form, formWithValidations }, { dispatch, getState }) => {\n if (form.connectKey) {\n const currentFormEntry = getState().modularui[form.connectKey];\n\n if (currentFormEntry) {\n const currentForm = currentFormEntry.model;\n if (currentForm instanceof FormModel) {\n const validatedForm = produce(currentForm, (draft) => {\n draft.updateValidations(formWithValidations.data);\n });\n dispatch(updateForm(validatedForm));\n }\n }\n }\n});\n\n/**\n * Validates form objects debounced to prevent overloading the (form) service\n * When a form with new errors (or complete) arrives, we send the validations\n * to the current form model where the errors are processed\n * A new form with the new constraints is send to the store\n */\nconst debouncedValidateFormObject = debounce<\n (dispatch: BEIDispatch, form: FormModel) => void\n>(\n (dispatch, form: FormModel) => {\n new ModularUIRequest(form.selfhref.setParameter(\"commit\", \"false\"), {\n method: HTTP_METHODS.POST,\n data: form.validationData,\n childmodels: false,\n isValidationRequest: true,\n locale: form.locale,\n })\n .fetch()\n .then((formWithValidations) => {\n if (formWithValidations instanceof FormModel) {\n dispatch(updateValidations({ form, formWithValidations }));\n }\n });\n },\n getNumberSetting(\"VALIDATE_DEBOUNCE_TIMEOUT\", 500),\n {\n leading: true,\n trailing: true,\n },\n);\n\nexport const validateFormObject =\n (form: FormModel) => (dispatch: BEIDispatch) =>\n debouncedValidateFormObject(dispatch, form);\n","import { Authenticate } from \"@beinformed/ui/modularui\";\nimport { createAsyncThunk } from \"@reduxjs/toolkit\";\nimport { produce } from \"immer\";\n\nimport { reloadApplication } from \"../application/applicationActions\";\nimport { logoutSuccess } from \"../auth/authReducer\";\nimport { updateForm } from \"../modularui/modelActions\";\nimport {\n finishProgress,\n startProgress,\n} from \"../progressindicator/progressIndicatorActions\";\nimport { goBack } from \"../router/routerActions\";\n\nimport type { FormModel } from \"@beinformed/ui/models\";\nimport type { PayloadAction } from \"@reduxjs/toolkit\";\nimport type { BEIDispatch, RootState } from \"../store\";\n\nexport const previousObject = (form: FormModel) => {\n const newForm = produce(form, (draft) => {\n draft.setPreviousObject();\n });\n\n return updateForm(newForm);\n};\n\nexport const cancelForm = createAsyncThunk<\n PayloadAction<undefined, string>,\n FormModel,\n { dispatch: BEIDispatch; state: RootState }\n>(\"form/cancel\", async (form, { dispatch, getState }) => {\n if (form.key === \"ChangePassword\" && getState().auth.mustChangePassword) {\n dispatch(startProgress());\n\n await new Authenticate().logout();\n\n dispatch(logoutSuccess());\n dispatch(reloadApplication());\n dispatch(finishProgress());\n }\n\n return goBack();\n});\n","import { produce } from \"immer\";\n\nimport { updateForm } from \"../modularui/modelActions\";\n\nimport type { FormModel, FormObjectModel } from \"@beinformed/ui/models\";\n\nexport const addRepeatableAttributeSet = (form: FormModel) => {\n const newForm = produce(form, (draft) => {\n draft.addEmptyFormObject();\n });\n return updateForm(newForm);\n};\n\nexport const cancelRepeatableAttributeSet = (\n form: FormModel,\n formObject: FormObjectModel,\n) => {\n const newForm = produce(form, (draft) => {\n draft.addEmptyFormObject();\n draft.removeFormObject(formObject);\n });\n return updateForm(newForm);\n};\n\nexport const removeRepeatableAttributeSet = (\n form: FormModel,\n formObject: FormObjectModel,\n) => {\n const newForm = produce(form, (draft) => {\n draft.removeFormObject(formObject);\n });\n return updateForm(newForm);\n};\n","import { useEffect, useMemo, useRef } from \"react\";\n\nimport { HTTP_METHODS } from \"@beinformed/ui/constants\";\nimport { Href } from \"@beinformed/ui/models\";\nimport { useLocation } from \"react-router\";\n\nimport { useBEIDispatch, useBEISelector } from \"../redux/hooks\";\nimport { fetchModel } from \"../redux/modularui/fetchModel\";\nimport { removeModelByKey } from \"../redux/modularui/modelActions\";\nimport { useDeepCompareEffect } from \"./useDeepCompareEffect\";\nimport { useLocale } from \"./useI18n\";\n\nimport type { ModularUIRequestOptions } from \"@beinformed/ui/utils\";\nimport type { RootState } from \"../redux/store\";\n\nconst useKeyForHook = (modelKey: string, url: string) => {\n const locale = useLocale();\n return useMemo(\n () => `${modelKey}(${url.split(\"?\")[0]})(${locale})`,\n [modelKey, url, locale],\n );\n};\n\n/**\n * Use redux action and selector to retrieve the correct modular ui service model\n */\nexport const useModularUI = (\n modelKey: string,\n url: string | Href,\n options: ModularUIRequestOptions = {\n method: HTTP_METHODS.GET,\n removeOnUnmount: false,\n },\n) => {\n const dispatch = useBEIDispatch();\n const href = useMemo(() => url?.toString() || \"\", [url]);\n const key = useKeyForHook(modelKey, href);\n\n const modelSelector = useMemo(\n () => (state: RootState) => state.modularui[key],\n [key],\n );\n const model = useBEISelector(modelSelector);\n\n if (url instanceof Href) {\n options.origin = options.origin ?? url.origin;\n options.contextPath = options.contextPath ?? url.contextPath;\n }\n\n const location = useLocation();\n const redirectLocation =\n location !== null &&\n typeof location === \"object\" &&\n location.state !== null &&\n typeof location.state === \"object\" &&\n \"redirectLocation\" in location.state\n ? location.state.redirectLocation\n : undefined;\n const forceLoad =\n model == null ||\n (redirectLocation instanceof Href ? redirectLocation?.equals(href) : false);\n\n const prevOptions = useRef(options);\n const prevHref = useRef(href);\n const prevForceLoad = useRef(forceLoad);\n\n useDeepCompareEffect(() => {\n // prevent reloads when previous option had the isReload, but the new options not\n const isOldReload =\n prevHref.current === href &&\n prevOptions.current.isReload &&\n !options.isReload;\n\n const doForceLoad = forceLoad && !prevForceLoad.current;\n\n if (href !== \"\" && (doForceLoad || !isOldReload)) {\n dispatch(fetchModel({ key, href, options }));\n }\n\n prevOptions.current = options;\n prevHref.current = href;\n prevForceLoad.current = forceLoad;\n }, [key, href, options, forceLoad]);\n\n useEffect(() => {\n if (options.removeOnUnmount) {\n return () => {\n dispatch(removeModelByKey(key));\n };\n }\n return;\n }, [dispatch, key, options.removeOnUnmount]);\n\n return model;\n};\n","import { useCallback } from \"react\";\n\nimport { IllegalArgumentException } from \"@beinformed/ui/exceptions\";\n\nimport { useBEIDispatch, useBEISelector } from \"../redux/hooks\";\nimport { closeModal, showModal } from \"../redux/modals/modalsReducer\";\n\nimport type { RootState } from \"../redux/store\";\n\ntype ModalHook = (modalId: string) => {\n key: string | null;\n size?: string | null;\n visible: boolean;\n show: () => void;\n close: () => void;\n};\n\n/**\n * Manage modals\n */\nexport const useModal: ModalHook = (modalId: string) => {\n if (!modalId) {\n throw new IllegalArgumentException(\n \"Missing modalId argument for useModal hook\",\n );\n }\n\n const dispatch = useBEIDispatch();\n const modal = useBEISelector((state: RootState) =>\n state.modals.modals.find((m) => m.key === modalId),\n );\n\n const show = useCallback(() => {\n dispatch(showModal(modalId));\n }, [dispatch, modalId]);\n\n const close = useCallback(() => {\n dispatch(closeModal(modalId));\n }, [dispatch, modalId]);\n\n return {\n key: modal ? modal.key : null,\n size: modal ? modal.size : null,\n visible: modal ? modal.visible : false,\n show,\n close,\n };\n};\n","import { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nexport interface ModalState {\n key: string;\n visible: boolean;\n size?: string;\n}\n\nexport interface ModalsState {\n modals: ModalState[];\n}\n\nexport const showModal = createAction(\"SHOW_MODAL\", (key: string) => {\n return {\n payload: key,\n };\n});\n\nexport const closeModal = createAction(\"CLOSE_MODAL\", (key: string) => {\n return {\n payload: key,\n };\n});\n\nconst initialState: ModalsState = {\n modals: [],\n};\n\nexport const modalsReducer = createReducer(initialState, (builder) => {\n builder\n .addCase(showModal, (state, action) => {\n const key = action.payload;\n\n // Hide all modals\n state.modals.forEach((modal) => {\n modal.visible = false;\n });\n\n // Find existing modal\n const existing = state.modals.find((modal) => modal.key === key);\n\n if (existing) {\n existing.visible = true;\n } else {\n state.modals.push({ key, visible: true });\n }\n })\n .addCase(closeModal, (state, action) => {\n const key = action.payload;\n\n // Remove the modal\n state.modals = state.modals.filter((modal) => modal.key !== key);\n\n // Show the last modal (if any)\n const last = state.modals[state.modals.length - 1];\n if (last) {\n last.visible = true;\n }\n });\n});\n","import {\n ConceptIndexModel,\n ContentIndexModel,\n ContentTOCModel,\n ContentTypeModel,\n Href,\n ModelCatalogModel,\n} from \"@beinformed/ui/models\";\nimport { createHref, filterParameters } from \"@beinformed/ui/utils\";\n\nimport { useBEIDispatch, useBEISelector } from \"../redux/hooks\";\nimport { updateEntryDate } from \"../redux/modelcatalog/modelCatalogReducer\";\nimport { getEntryDate } from \"../redux/modelcatalog/modelCatalogSelectors\";\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { useLocation } from \"./useRouter\";\n\nimport type { ConceptDetailModel, ContentModel } from \"@beinformed/ui/models\";\nimport type { ISO_DATE } from \"@beinformed/ui/types\";\nimport type { UseModularUIBasicOptions } from \"./useModularUIBasic\";\n\nexport interface SearchFilter {\n index?: string;\n label?: string;\n type?: string | string[];\n modelCategory?: string | string[];\n entryDate?: string;\n}\n\nexport const useModelCatalog = (\n options?: UseModularUIBasicOptions<ModelCatalogModel>,\n) =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n ...options,\n });\n\nexport const useConceptIndex = (\n href: string | Href,\n key = \"conceptindex\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n) => {\n const { entryDate } = useEntryDate();\n const url = filterParameters(href, [\n \"index\",\n \"label\",\n \"modelcategory\",\n \"type\",\n ]);\n url.setParameter(\"entryDate\", entryDate);\n\n return useModularUIBasic(key, url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n ...options,\n });\n};\n\nexport const useConceptDetail = (\n concept: string | Href,\n key = \"conceptdetail\",\n options?: UseModularUIBasicOptions<ConceptDetailModel>,\n) => {\n const { entryDate } = useEntryDate();\n const location = useLocation();\n\n const href = createHref(\"concepts\", concept, entryDate, location, []);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n ...options,\n });\n};\n\nexport const useContentIndex = (\n href: string | Href,\n key = \"contentindex\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n) => {\n const url = filterParameters(href, [\"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n ...options,\n });\n};\n\nexport const useContentTOC = (\n content: string | Href,\n key = \"contenttoc\",\n options?: UseModularUIBasicOptions<ContentTOCModel>,\n) => {\n const { entryDate } = useEntryDate();\n const location = useLocation();\n\n const href = createHref(\"content\", content, entryDate, location, [\n \"complete\",\n ]);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n ...options,\n });\n};\n\nexport const useContent = (\n content: string | Href,\n key = \"content\",\n options?: UseModularUIBasicOptions<ContentModel>,\n) => {\n const { entryDate } = useEntryDate();\n const location = useLocation();\n\n const href = createHref(\"content\", content, entryDate, location, [\n \"complete\",\n ]);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"Content\", \"ContentTOC\"],\n ...options,\n });\n};\n\nexport const useCompleteSource = (\n content: string | Href,\n key = \"content\",\n options?: UseModularUIBasicOptions<ContentModel | ContentTOCModel>,\n) => {\n const { entryDate } = useEntryDate();\n const location = useLocation();\n\n const contentHref = new Href(content);\n contentHref.removeParameter(\"complete\");\n contentHref.addParameter(\"complete\", \"true\");\n\n const href = createHref(\"content\", contentHref, entryDate, location, [\n \"complete\",\n ]);\n\n return useModularUIBasic(key, href, {\n expectedModels: [\"Content\", \"ContentTOC\"],\n ...options,\n });\n};\n\nexport const useContentType = (\n contentType: string | Href,\n key = \"contenttypes\",\n options?: UseModularUIBasicOptions<ContentTypeModel>,\n) => {\n const href = createHref(\n \"contenttypes\",\n contentType,\n undefined,\n undefined,\n [],\n );\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n ...options,\n });\n};\n\nexport const useRelatedConcepts = (\n href: string | Href,\n key = \"relatedconcepts\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n) => {\n const { entryDate } = useEntryDate();\n const url = filterParameters(href, [\"modelcategory\"]);\n url.setParameter(\"entryDate\", entryDate);\n\n return useModularUIBasic(key, url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n ...options,\n });\n};\n\nconst getSearchHref = (uri: string, filters: SearchFilter) => {\n const filterString = [];\n\n for (const key of Object.keys(filters)) {\n const filterValue = filters[key as keyof SearchFilter];\n if (filterValue) {\n let value: string = Array.isArray(filterValue)\n ? filterValue.join(\",\")\n : filterValue;\n if (key === \"type\") {\n value = value.replace(\"#\", \"%23\"); // handles un-encoded #\n }\n filterString.push(`${key}=${value}`);\n }\n }\n\n return filterString.length ? `${uri}?${filterString.join(\"&\")}` : uri;\n};\n\nexport const useConceptSearch = (\n filters: SearchFilter,\n key: string | \"conceptSearch\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n) => {\n const href = getSearchHref(\"/concepts\", filters);\n return useConceptIndex(href, key, options);\n};\n\nexport const useContentSearch = (\n filters: SearchFilter,\n key: string | \"contentSearch\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n) => {\n const href = getSearchHref(\"/content\", filters);\n return useContentIndex(href, key, options);\n};\n\n/**\n * Retrieve and update the entrydate for the modelcatalog\n */\nexport const useEntryDate = () => {\n const dispatch = useBEIDispatch();\n const entryDate = useBEISelector(getEntryDate);\n\n return {\n entryDate,\n setEntryDate: (entryDate: ISO_DATE) => dispatch(updateEntryDate(entryDate)),\n };\n};\n","import { Cache } from \"@beinformed/ui/utils\";\nimport { createAction, createReducer } from \"@reduxjs/toolkit\";\n\nexport interface ModelCatalogState {\n entryDate: string | undefined;\n}\n\nexport const updateEntryDate = createAction(\n \"UPDATE_ENTRYDATE\",\n (entryDate: string) => {\n return {\n payload: entryDate,\n };\n },\n);\n\nconst initialState: ModelCatalogState = {\n entryDate: new Date().toISOString().split(\"T\")[0],\n};\n\n/**\n * Keep track of the entry date for the modelcatalog\n */\nexport const modelCatalogReducer = createReducer<ModelCatalogState>(\n initialState,\n (builder) => {\n builder.addCase(updateEntryDate, (state, action) => {\n Cache.addItem(\"ModelCatalogEntryDate\", action.payload);\n\n state.entryDate = action.payload;\n });\n },\n);\n","import type { ISO_DATE } from \"@beinformed/ui/types\";\nimport type { RootState } from \"../store\";\n\n/**\n * Retrieve entrydate for the model catalog\n */\nexport const getEntryDate = (state: RootState): ISO_DATE => {\n if (state.modelcatalog?.entryDate) {\n return state.modelcatalog?.entryDate;\n }\n\n const isoDate = new Date().toISOString();\n return isoDate.split(\"T\")[0] || isoDate;\n};\n","import { useMemo } from \"react\";\n\nimport { useModularUI } from \"./useModularUI\";\nimport { useLocation } from \"./useRouter\";\n\nimport type { Href } from \"@beinformed/ui/models\";\nimport type { ModularUIResponse } from \"@beinformed/ui/modularui\";\n\nexport interface UseModularUIBasicOptions<T> {\n expectedModels?: string[];\n targetModel?: new (modularuiResponse: ModularUIResponse) => T;\n forceTargetModel?: boolean;\n origin?: string;\n contextPath?: string;\n cache?: boolean;\n}\n\n// Helper to create useModularUI options\nconst createUseModularUIOptions = <T>(\n options: UseModularUIBasicOptions<T>,\n href: string,\n location: unknown,\n): Record<string, unknown> => {\n const baseOptions: Record<string, unknown> = {\n targetModel: undefined,\n forceTargetModel: undefined,\n isReload: false,\n origin: undefined,\n contextPath: undefined,\n cache: false,\n };\n\n // Handle targetModel and forceTargetModel\n\n if (options.targetModel) {\n baseOptions.targetModel = options.targetModel;\n baseOptions.forceTargetModel = options.forceTargetModel;\n }\n\n // Handle cache option\n if (options.cache) {\n baseOptions.cache = options.cache;\n }\n\n // Check for reload if location matches href\n if (\n location !== null &&\n typeof location === \"object\" &&\n \"state\" in location &&\n location.state !== null &&\n typeof location.state === \"object\" &&\n \"reload\" in location.state &&\n \"pathname\" in location &&\n typeof location.pathname === \"string\" &&\n location.pathname.startsWith(href)\n ) {\n baseOptions.isReload = true;\n }\n\n // Handle origin and contextPath options\n baseOptions.origin = options.origin ?? baseOptions.origin;\n baseOptions.contextPath = options.contextPath ?? baseOptions.contextPath;\n\n return baseOptions;\n};\n\n// Helper to validate the model against expectedModels\nconst validateModel = (model: unknown, expectedModels: string[]) => {\n if (expectedModels.length > 0) {\n const isCorrectModel = expectedModels.some((expectedModel) => {\n if (model !== null && typeof model === \"object\" && \"type\" in model) {\n return model.type === expectedModel;\n }\n return;\n });\n if (!isCorrectModel) {\n console.warn(model, \"is not of instance\", expectedModels);\n }\n }\n};\n\n/**\n * useModularUIBasic Hook\n */\nexport const useModularUIBasic = <T>(\n key: string,\n href: string | Href,\n options: UseModularUIBasicOptions<T> = {\n expectedModels: [],\n targetModel: undefined,\n forceTargetModel: false,\n origin: undefined,\n contextPath: undefined,\n },\n): T | undefined => {\n const location = useLocation();\n const memoizedHref = useMemo(() => href.toString(), [href]);\n const useModularUIOptions = useMemo(\n () => createUseModularUIOptions(options, memoizedHref, location),\n [options, memoizedHref, location],\n );\n\n const modularUI = useModularUI(key, href, useModularUIOptions);\n const expectedModels = useMemo(\n () => options.expectedModels ?? [],\n [options.expectedModels],\n );\n\n return useMemo((): T | undefined => {\n if (modularUI?.model) {\n validateModel(modularUI.model, expectedModels);\n return modularUI.model as T;\n }\n return undefined;\n }, [expectedModels, modularUI]);\n};\n","import { useBEIDispatch, useBEISelector } from \"../redux/hooks\";\nimport {\n go,\n goBack,\n goForward,\n push,\n replace,\n} from \"../redux/router/routerActions\";\n\nimport type { RouterLocation } from \"../redux/router/routerReducer\";\nimport type { RootState } from \"../redux/store\";\n\nexport const useLocation = () =>\n useBEISelector((state: RootState) => state.router.location);\n\nexport const useLocationKey = () => useLocation()?.key ?? \"\";\n\nexport const useQuerystring = () => useLocation()?.search;\n\nexport const usePathname = () => useLocation()?.pathname;\n\nexport const useNavigation = () => {\n const dispatch = useBEIDispatch();\n\n return {\n push: (location: RouterLocation | string, state?: RootState) =>\n dispatch(push(location, state)),\n replace: (location: RouterLocation | string, state?: RootState) =>\n dispatch(replace(location, state)),\n go: (delta: number) => dispatch(go(delta)),\n goBack: () => dispatch(goBack()),\n goForward: () => dispatch(goForward()),\n };\n};\n","import { createSelector } from \"reselect\";\n\nimport { useBEIDispatch, useBEISelector } from \"../redux/hooks\";\nimport { MODULARUI_STATUS } from \"../redux/modularui/constants\";\nimport { reloadModel } from \"../redux/modularui/reloadModel\";\n\nimport type { ModularUIModel } from \"@beinformed/ui/models\";\nimport type { ModularUIRequestOptions } from \"@beinformed/ui/utils\";\nimport type { RootState } from \"../redux/store\";\n\ntype ReloadCallback = (model: ModularUIModel | undefined) => boolean;\n\ntype UseModels = () => {\n reload: (model: ModularUIModel, options?: Record<string, unknown>) => void;\n reloadWithFilter: (\n callbackFn: ReloadCallback,\n options?: Record<string, unknown>,\n ) => void;\n};\n\n/**\n * Hook that contains the reload property that can be used to reload a model\n */\nexport const useModels: UseModels = () => {\n const dispatch = useBEIDispatch();\n\n const selectModularUI = (state: RootState) => state.modularui;\n const selector = createSelector([selectModularUI], (modularui) => {\n const models = [];\n const keys = Object.keys(modularui);\n for (const key of keys) {\n const model = modularui[key];\n if (model?.status === MODULARUI_STATUS.FINISHED) {\n models.push(model.model);\n }\n }\n return models;\n });\n\n const modularuiModels = useBEISelector(selector);\n\n return {\n reload: (model: ModularUIModel, options?: ModularUIRequestOptions) => {\n dispatch(reloadModel(model, options));\n },\n reloadWithFilter: (\n callbackFn: ReloadCallback,\n options?: Record<string, unknown>,\n ) => {\n const modelsToReload = modularuiModels.filter(callbackFn);\n for (const modelToReload of modelsToReload) {\n if (modelToReload) {\n dispatch(reloadModel(modelToReload, options));\n }\n }\n },\n };\n};\n","import { fetchModel } from \"./fetchModel\";\n\nimport type { ModularUIModel } from \"@beinformed/ui/models\";\nimport type { ModularUIRequestOptions } from \"@beinformed/ui/utils\";\n\nexport const reloadModel = (\n model: ModularUIModel,\n options?: ModularUIRequestOptions,\n) =>\n fetchModel({\n key: model.connectKey || \"\",\n href: model.selfhref || \"\",\n options: {\n ...options,\n isReload: true,\n },\n });\n","import {\n ApplicationModel,\n CaseSearchModel,\n CaseViewModel,\n DetailModel,\n GroupingPanelModel,\n ListDetailModel,\n ListModel,\n TabModel,\n UserProfileModel,\n} from \"@beinformed/ui/models\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\n\nimport type { Href } from \"@beinformed/ui/models\";\n\ninterface HookOptions {\n origin?: string;\n contextPath?: string;\n}\n\n/**\n * Load application\n */\nexport const useApplication = (options?: HookOptions) =>\n useModularUIBasic(\"application\", \"/\", {\n expectedModels: [\"Application\"],\n targetModel: ApplicationModel,\n ...options,\n });\n\n/**\n * Load a tab by href\n */\nexport const useTab = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic(\"tab\", href, {\n expectedModels: [\"Tab\"],\n targetModel: TabModel,\n ...options,\n });\n\n/**\n * Load caseview by href\n */\nexport const useCaseView = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic(\"caseview\", href, {\n expectedModels: [\"CaseView\"],\n targetModel: CaseViewModel,\n ...options,\n });\n\nexport const usePanel = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic<ListModel | GroupingPanelModel | DetailModel>(\n \"panel\",\n href,\n {\n expectedModels: [\"List\", \"GroupingPanel\", \"Detail\"],\n ...options,\n },\n );\n\nexport const useList = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\"],\n targetModel: ListModel,\n ...options,\n });\n\nexport const useListOrDetail = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic<ListModel | DetailModel>(\"list\", href, {\n expectedModels: [\"List\", \"Detail\"],\n // @ts-expect-error Need to improve typing for array\n targetModel: [ListModel, DetailModel],\n ...options,\n });\n\nexport const useListDetail = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n forceTargetModel: true,\n ...options,\n });\n\nexport const useGroupingPanel = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic(\"groupingpanel\", href, {\n expectedModels: [\"GroupingPanel\"],\n targetModel: GroupingPanelModel,\n ...options,\n });\n\nexport const useDetailPanel = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic(\"detailpanel\", href, {\n expectedModels: [\"Detail\"],\n targetModel: DetailModel,\n ...options,\n });\n\nexport const useQuicksearch = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic(\"quicksearch\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n ...options,\n });\n\nexport const useSearch = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic(\"search\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n ...options,\n });\n\nexport const useUserProfile = (href: string | Href, options?: HookOptions) =>\n useModularUIBasic(\"userprofile\", href, {\n expectedModels: [\"UserProfile\"],\n targetModel: UserProfileModel,\n ...options,\n });\n","import { useBEIDispatch, useBEISelector } from \"../redux/hooks\";\nimport {\n dismissNotification,\n NOTIFICATION_TYPES,\n showNotification,\n} from \"../redux/notifications/notificationReducer\";\n\nimport type { ErrorResponse } from \"@beinformed/ui/models\";\nimport type { MessageObject } from \"../i18n/types\";\nimport type { RootState } from \"../redux/store\";\n\nexport const useNotification = () => {\n const dispatch = useBEIDispatch();\n const { render, messageType, message, error } = useBEISelector(\n (state: RootState) => state.notification,\n );\n\n return {\n render,\n messageType,\n message,\n error,\n dismiss: () => dispatch(dismissNotification()),\n };\n};\n\nexport const useErrorNotification = () => {\n const dispatch = useBEIDispatch();\n return (message: MessageObject, error?: ErrorResponse) => {\n return dispatch(\n showNotification({ type: NOTIFICATION_TYPES.ERROR, message, error }),\n );\n };\n};\n","import { useMemo } from \"react\";\n\nimport pick from \"lodash/pick\";\nimport { createSelector } from \"reselect\";\n\nimport { useBEISelector } from \"../redux/hooks\";\n\nimport type { RootState } from \"../redux/store\";\n\nconst getPreferences = (state: RootState) => state.preferences;\n\nconst makeSelectPreference = (preferenceNames: string | string[]) => {\n const names = Array.isArray(preferenceNames)\n ? preferenceNames\n : [preferenceNames];\n\n return createSelector([getPreferences], (preferences) =>\n pick(preferences, names),\n );\n};\n\nexport const usePreference = (preferenceNames: string | string[]) => {\n const selectPreference = useMemo(\n () => makeSelectPreference(preferenceNames),\n [\n Array.isArray(preferenceNames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F,EAEaG,GAAiBJ,GAAuC,CACnE,IAAMK,KAAmB,YACvB,IAAMN,GAAqBC,CAAe,EAC1C,CACE,MAAM,QAAQA,CAAe,EACzBA,EAAgB,KAAK,GAAG,EACxBA,CACN,CACF,EAEA,OAAOM,EAAeD,CAAgB,CACxC","names":["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_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_now","__commonJSMin","exports","module","root","now","require_trimmedEndIndex","__commonJSMin","exports","module","reWhitespace","trimmedEndIndex","string","index","require_baseTrim","__commonJSMin","exports","module","trimmedEndIndex","reTrimStart","baseTrim","string","require_isObjectLike","__commonJSMin","exports","module","isObjectLike","value","require_isSymbol","__commonJSMin","exports","module","baseGetTag","isObjectLike","symbolTag","isSymbol","value","require_toNumber","__commonJSMin","exports","module","baseTrim","isObject","isSymbol","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","value","other","isBinary","require_debounce","__commonJSMin","exports","module","isObject","now","toNumber","FUNC_ERROR_TEXT","nativeMax","nativeMin","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","args","thisArg","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","require_isArray","__commonJSMin","exports","module","isArray","require_isKey","__commonJSMin","exports","module","isArray","isSymbol","reIsDeepProp","reIsPlainProp","isKey","value","object","type","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_toKey","__commonJSMin","exports","module","isSymbol","INFINITY","toKey","value","result","require_baseGet","__commonJSMin","exports","module","castPath","toKey","baseGet","object","path","index","length","require_defineProperty","__commonJSMin","exports","module","getNative","defineProperty","func","require_baseAssignValue","__commonJSMin","exports","module","defineProperty","baseAssignValue","object","key","value","require_assignValue","__commonJSMin","exports","module","baseAssignValue","eq","objectProto","hasOwnProperty","assignValue","object","key","value","objValue","require_isIndex","__commonJSMin","exports","module","MAX_SAFE_INTEGER","reIsUint","isIndex","value","length","type","require_baseSet","__commonJSMin","exports","module","assignValue","castPath","isIndex","isObject","toKey","baseSet","object","path","value","customizer","index","length","lastIndex","nested","key","newValue","objValue","require_basePickBy","__commonJSMin","exports","module","baseGet","baseSet","castPath","basePickBy","object","paths","predicate","index","length","result","path","value","require_baseHasIn","__commonJSMin","exports","module","baseHasIn","object","key","require_baseIsArguments","__commonJSMin","exports","module","baseGetTag","isObjectLike","argsTag","baseIsArguments","value","require_isArguments","__commonJSMin","exports","module","baseIsArguments","isObjectLike","objectProto","hasOwnProperty","propertyIsEnumerable","isArguments","value","require_isLength","__commonJSMin","exports","module","MAX_SAFE_INTEGER","isLength","value","require_hasPath","__commonJSMin","exports","module","castPath","isArguments","isArray","isIndex","isLength","toKey","hasPath","object","path","hasFunc","index","length","result","key","require_hasIn","__commonJSMin","exports","module","baseHasIn","hasPath","hasIn","object","path","require_basePick","__commonJSMin","exports","module","basePickBy","hasIn","basePick","object","paths","value","path","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_flatten","__commonJSMin","exports","module","baseFlatten","flatten","array","length","require_apply","__commonJSMin","exports","module","apply","func","thisArg","args","require_overRest","__commonJSMin","exports","module","apply","nativeMax","overRest","func","start","transform","args","index","length","array","otherArgs","require_constant","__commonJSMin","exports","module","constant","value","require_identity","__commonJSMin","exports","module","identity","value","require_baseSetToString","__commonJSMin","exports","module","constant","defineProperty","identity","baseSetToString","func","string","require_shortOut","__commonJSMin","exports","module","HOT_COUNT","HOT_SPAN","nativeNow","shortOut","func","count","lastCalled","stamp","remaining","require_setToString","__commonJSMin","exports","module","baseSetToString","shortOut","setToString","require_flatRest","__commonJSMin","exports","module","flatten","overRest","setToString","flatRest","func","require_pick","__commonJSMin","exports","module","basePick","flatRest","pick","object","paths","hooks_exports","__export","useApplication","useAttributeUpdate","useCaseView","useCompleteSource","useConceptDetail","useConceptIndex","useConceptSearch","useContent","useContentFromSourceReferences","useContentIndex","useContentSearch","useContentTOC","useContentType","useDeepCompareEffect","useDetailPanel","useEntryDate","useErrorNotification","useForm","useFormNavigation","useGroupingPanel","useList","useListDetail","useListOrDetail","useLocale","useLocaleCodes","useLocation","useLocationKey","useLogin","useLogout","useMessage","useModal","useModelCatalog","useModels","useModularUI","useModularUIBasic","useModularUIRequest","useNavigation","useNotification","usePanel","usePathname","usePreference","useProgressIndicator","useQuerystring","useQuicksearch","useRelatedConcepts","useRepeatableAttributeSet","useRetrieveFormsOnModel","useSearch","useTab","useTranslate","useUserProfile","__toCommonJS","import_react","import_constants","import_models","import_modularui","import_reselect","import_react_redux","useBEIDispatch","useBEISelector","useBEIStore","getLocale","state","getLocales","getModularUIRequest","getLocale","localeCode","href","options","request","useModularUIRequest","useBEISelector","useRetrieveFormsOnModel","model","modularui","useModularUIRequest","forms","setForms","requestCount","setRequestCount","responseCount","setResponseCount","requests","getActions","action","href","form","responses","actionForms","allActions","listItem","updateActions","actions","unique","import_constants","import_exceptions","import_settings","import_utils","import_models","getApplication","state","locale","modularui","key","modelEntry","import_toolkit","initalState","loginSuccess","logoutSuccess","sendAuthenticationError","errorMessage","resetAuthErrors","saveChangePassword","authReducer","builder","state","action","import_constants","import_modularui","import_utils","import_toolkit","import_models","import_toolkit","import_constants","import_models","import_modularui","import_toolkit","import_constants","import_models","import_settings","import_settings","import_utils","import_toolkit","import_toolkit","updateErrorStatus","key","error","setModel","model","initModels","models","updateModel","updateForm","removeModelByKey","resetModularUI","import_toolkit","push","location","state","replace","go","delta","goBack","goForward","handleUnauthorized","errorResponse","dispatch","getState","removeModelByKey","application","getApplication","reloadApplication","logoutSuccess","sendAuthenticationError","location","LOGIN_PATH","locationFrom","replace","import_settings","import_toolkit","import_toolkit","startProgress","finishProgress","resetProgress","updateProgress","percentComplete","import_toolkit","saveNotification","type","message","error","showNotification","timeout","dispatch","dismissNotification","initialState","notificationReducer","builder","state","action","getNotificationMessageId","form","showFormNotification","dispatch","startProgress","showNotification","dismissNotification","finishProgress","showXHRErrorNotification","error","import_toolkit","noAction","import_toolkit","saveError","error","initialState","errorReducer","builder","_state","action","defaultErrorResponseHandler","error","dispatch","noAction","handleUnauthorized","push","saveChangePassword","saveError","showXHRErrorNotification","customErrorResponseHandler","defaultHandler","handleError","error","errorResponse","customErrorResponseHandler","defaultErrorResponseHandler","getRequestLocale","optionLocale","currentStateLocale","executeRequest","key","href","options","dispatch","getState","rejectWithValue","locale","getRequestLocale","requestHref","model","error","errorResponse","removeModelByKey","updateErrorStatus","handleError","fetchModel","import_models","allKeysByHref","state","href","findHref","key","modelEntry","reloadApplication","_","dispatch","getState","state","applicationHref","application","getApplication","allKeys","allKeysByHref","key","removeModelByKey","modelKey","getLocale","fetchModel","loginFailed","errorMessage","sendAuthenticationError","changePassword","_","getState","isModal","locationFrom","push","login","username","password","dispatch","startProgress","reloadApplication","getApplication","loginSuccess","finishProgress","error","import_modularui","import_toolkit","logout","_","dispatch","startProgress","resetModularUI","reloadApplication","logoutSuccess","finishProgress","useLogin","dispatch","useBEIDispatch","application","useBEISelector","getApplication","auth","state","isAuthenticated","resetAuthErrors","username","password","login","authenticationType","useLogout","LOGOUT_PATH","BASE_PATH","origin","url","logout","import_react","import_modularui","import_memoize","import_reselect","getMessage","getLocales","getLocale","locales","localeCode","memoize","id","defaultMessage","placeholders","args","useMessage","useBEISelector","useTranslate","useLocale","getLocaleCodes","state","locale","useLocaleCodes","useProgressIndicator","dispatch","useBEIDispatch","useBEISelector","state","startProgress","finishProgress","resetProgress","percentComplete","updateProgress","useContentFromSourceReferences","sourceReferences","renderChildSections","content","setContent","localeCode","useLocale","start","finish","useProgressIndicator","hrefs","sourceReference","href","index","self","allHrefs","requests","modularuiRequest","responseContent","import_react","import_lite","useDeepCompareMemoize","value","ref","signalRef","deepEqual","useDeepCompareEffect","callback","dependencies","import_constants","import_models","import_settings","import_immer","import_settings","import_toolkit","import_immer","import_constants","import_models","import_modularui","import_settings","import_debounce","updateAutosave","status","model","autosave","dispatch","form","formdata","savedForm","updateForm","debouncedAutosave","debounce","autosaveFormObject","import_constants","import_models","import_immer","autosubmitFormObject","form","attribute","forceUpdate","fetchModel","newModel","draft","import_constants","import_models","import_immer","autoupdateFormObject","form","attribute","fetchModel","newModel","draft","import_constants","import_models","import_modularui","import_settings","import_toolkit","import_immer","import_debounce","updateValidations","form","formWithValidations","dispatch","getState","currentFormEntry","currentForm","validatedForm","draft","updateForm","debouncedValidateFormObject","debounce","validateFormObject","updateFormAttribute","form","formObject","attribute","inputvalue","options","dispatch","newForm","draft","completeObject","autosubmitAction","autosubmitFormObject","autoupdateAction","autoupdateFormObject","handleAutoSave","handleValidate","updateForm","autosaveFormObject","validateFormObject","import_modularui","import_toolkit","import_immer","previousObject","form","newForm","draft","updateForm","cancelForm","dispatch","getState","startProgress","logoutSuccess","reloadApplication","finishProgress","goBack","import_immer","addRepeatableAttributeSet","form","newForm","draft","updateForm","cancelRepeatableAttributeSet","formObject","removeRepeatableAttributeSet","import_react","import_constants","import_models","import_react_router","useKeyForHook","modelKey","url","locale","useLocale","useModularUI","options","dispatch","useBEIDispatch","href","key","modelSelector","state","model","useBEISelector","location","redirectLocation","forceLoad","prevOptions","prevHref","prevForceLoad","useDeepCompareEffect","isOldReload","doForceLoad","fetchModel","removeModelByKey","useForm","href","data","formHref","form","useModularUI","useFormNavigation","dispatch","useBEIDispatch","previousObject","cancelForm","fetchModel","newModel","draft","removeModelByKey","showFormNotification","useAttributeUpdate","formObject","attribute","inputvalue","options","updateFormAttribute","useRepeatableAttributeSet","addRepeatableAttributeSet","object","cancelRepeatableAttributeSet","removeRepeatableAttributeSet","import_react","import_exceptions","import_toolkit","showModal","key","closeModal","initialState","modalsReducer","builder","state","action","modal","existing","last","useModal","modalId","dispatch","useBEIDispatch","modal","useBEISelector","state","m","show","showModal","close","closeModal","import_models","import_utils","import_utils","import_toolkit","updateEntryDate","entryDate","initialState","modelCatalogReducer","builder","state","action","getEntryDate","state","isoDate","import_react","useLocation","useBEISelector","state","useLocationKey","useQuerystring","usePathname","useNavigation","dispatch","useBEIDispatch","location","push","replace","delta","go","goBack","goForward","createUseModularUIOptions","options","href","location","baseOptions","validateModel","model","expectedModels","expectedModel","useModularUIBasic","key","useLocation","memoizedHref","useModularUIOptions","modularUI","useModularUI","useModelCatalog","options","useModularUIBasic","useConceptIndex","href","key","entryDate","useEntryDate","url","useConceptDetail","concept","location","useLocation","useContentIndex","useContentTOC","content","useContent","useCompleteSource","contentHref","useContentType","contentType","useRelatedConcepts","getSearchHref","uri","filters","filterString","filterValue","value","useConceptSearch","useContentSearch","dispatch","useBEIDispatch","useBEISelector","getEntryDate","updateEntryDate","import_reselect","reloadModel","model","options","fetchModel","useModels","dispatch","useBEIDispatch","selector","state","modularui","models","keys","key","model","modularuiModels","useBEISelector","options","reloadModel","callbackFn","modelsToReload","modelToReload","import_models","useApplication","options","useModularUIBasic","useTab","href","useCaseView","usePanel","useList","useListOrDetail","useListDetail","useGroupingPanel","useDetailPanel","useQuicksearch","useSearch","useUserProfile","useNotification","dispatch","useBEIDispatch","render","messageType","message","error","useBEISelector","state","dismissNotification","useErrorNotification","showNotification","import_react","import_pick","import_reselect","getPreferences","state","makeSelectPreference","preferenceNames","names","preferences","pick","usePreference","selectPreference","useBEISelector"]}