@djb25/digit-ui-module-ekyc 1.0.34 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -297,12 +297,7 @@ const DesktopInbox = _ref => {
297
297
  let row = _ref2.row;
298
298
  const kno = ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.kno) || ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.applicationNumber) || "NA";
299
299
  return /*#__PURE__*/React__default.createElement("span", {
300
- className: "ekyc-application-link",
301
- style: {
302
- color: "#add8f7",
303
- cursor: "pointer",
304
- fontWeight: "bold"
305
- },
300
+ className: "link",
306
301
  onClick: () => handleReview(kno)
307
302
  }, kno);
308
303
  }
@@ -344,12 +339,7 @@ const DesktopInbox = _ref => {
344
339
  let row = _ref6.row;
345
340
  const kno = ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.kno) || ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.applicationNumber) || "NA";
346
341
  return /*#__PURE__*/React__default.createElement("span", {
347
- className: "ekyc-application-link",
348
- style: {
349
- color: "#add8f7",
350
- cursor: "pointer",
351
- fontWeight: "bold"
352
- },
342
+ className: "link",
353
343
  onClick: () => handleReview(kno)
354
344
  }, t("EKYC_REVIEW"));
355
345
  }
@@ -1798,7 +1788,7 @@ const useInboxTableConfig = _ref => {
1798
1788
  let row = _ref2.row;
1799
1789
  const kno = ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.kno) || ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.applicationNumber) || "NA";
1800
1790
  return /*#__PURE__*/React__default.createElement("span", {
1801
- className: "ekyc-application-link",
1791
+ className: "link",
1802
1792
  onClick: () => handleReview(kno)
1803
1793
  }, kno);
1804
1794
  }
@@ -1832,23 +1822,6 @@ const useInboxTableConfig = _ref => {
1832
1822
  className: "ekyc-status-tag " + ekycStatus
1833
1823
  }, t("" + ekycStatus));
1834
1824
  }
1835
- }, {
1836
- Header: t("EKYC_REVIEW"),
1837
- accessor: "review",
1838
- Cell: _ref6 => {
1839
- var _row$original7, _row$original8;
1840
- let row = _ref6.row;
1841
- const kno = ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.kno) || ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.applicationNumber) || "NA";
1842
- return /*#__PURE__*/React__default.createElement("span", {
1843
- className: "ekyc-application-link",
1844
- style: {
1845
- color: "#add8f7",
1846
- cursor: "pointer",
1847
- fontWeight: "bold"
1848
- },
1849
- onClick: () => handleReview(kno)
1850
- }, t("EKYC_REVIEW"));
1851
- }
1852
1825
  }];
1853
1826
  return {
1854
1827
  disableSort: false,
@@ -1902,261 +1875,259 @@ const useInboxTableConfig = _ref => {
1902
1875
  };
1903
1876
  };
1904
1877
 
1905
- var isNullOrUndefined = (value) => value == null;
1906
-
1907
- const isObjectType = (value) => typeof value === 'object';
1908
- var isObject = (value) => !isNullOrUndefined(value) &&
1909
- !Array.isArray(value) &&
1910
- isObjectType(value) &&
1911
- !(value instanceof Date);
1912
-
1913
- var isKey = (value) => /^\w*$/.test(value);
1914
-
1915
- var compact = (value) => value.filter(Boolean);
1916
-
1917
- var stringToPath = (input) => compact(input
1918
- .replace(/["|']/g, '')
1919
- .replace(/\[/g, '.')
1920
- .replace(/\]/g, '')
1921
- .split('.'));
1922
-
1923
- function set(object, path, value) {
1924
- let index = -1;
1925
- const tempPath = isKey(path) ? [path] : stringToPath(path);
1926
- const length = tempPath.length;
1927
- const lastIndex = length - 1;
1928
- while (++index < length) {
1929
- const key = tempPath[index];
1930
- let newValue = value;
1931
- if (index !== lastIndex) {
1932
- const objValue = object[key];
1933
- newValue =
1934
- isObject(objValue) || Array.isArray(objValue)
1935
- ? objValue
1936
- : !isNaN(+tempPath[index + 1])
1937
- ? []
1938
- : {};
1939
- }
1940
- object[key] = newValue;
1941
- object = object[key];
1942
- }
1943
- return object;
1878
+ const _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
1879
+ const _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
1880
+ function _catch(body, recover) {
1881
+ try {
1882
+ var result = body();
1883
+ } catch (e) {
1884
+ return recover(e);
1885
+ }
1886
+ if (result && result.then) {
1887
+ return result.then(void 0, recover);
1888
+ }
1889
+ return result;
1890
+ }
1891
+ function _finallyRethrows(body, finalizer) {
1892
+ try {
1893
+ var result = body();
1894
+ } catch (e) {
1895
+ return finalizer(true, e);
1896
+ }
1897
+ if (result && result.then) {
1898
+ return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
1899
+ }
1900
+ return finalizer(false, result);
1944
1901
  }
1945
1902
 
1946
- var isUndefined = (val) => val === undefined;
1947
-
1948
- var get = (obj = {}, path, defaultValue) => {
1949
- const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => (isNullOrUndefined(result) ? result : result[key]), obj);
1950
- return isUndefined(result) || result === obj
1951
- ? isUndefined(obj[path])
1952
- ? defaultValue
1953
- : obj[path]
1954
- : result;
1903
+ var isNullOrUndefined = value => value == null;
1904
+ const isObjectType = value => typeof value === 'object';
1905
+ var isObject = value => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !(value instanceof Date);
1906
+ var isKey = value => /^\w*$/.test(value);
1907
+ var compact = value => value.filter(Boolean);
1908
+ var stringToPath = input => compact(input.replace(/["|']/g, '').replace(/\[/g, '.').replace(/\]/g, '').split('.'));
1909
+ function set(object, path, value) {
1910
+ let index = -1;
1911
+ const tempPath = isKey(path) ? [path] : stringToPath(path);
1912
+ const length = tempPath.length;
1913
+ const lastIndex = length - 1;
1914
+ while (++index < length) {
1915
+ const key = tempPath[index];
1916
+ let newValue = value;
1917
+ if (index !== lastIndex) {
1918
+ const objValue = object[key];
1919
+ newValue = isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {};
1920
+ }
1921
+ object[key] = newValue;
1922
+ object = object[key];
1923
+ }
1924
+ return object;
1925
+ }
1926
+ var isUndefined = val => val === undefined;
1927
+ var get = function (obj, path, defaultValue) {
1928
+ if (obj === void 0) {
1929
+ obj = {};
1930
+ }
1931
+ const result = compact(path.split(/[,[\].]+?/)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], obj);
1932
+ return isUndefined(result) || result === obj ? isUndefined(obj[path]) ? defaultValue : obj[path] : result;
1955
1933
  };
1956
-
1957
- var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
1958
-
1959
- var isFunction = (value) => typeof value === 'function';
1960
-
1961
- var skipValidation = ({ isOnBlur, isOnChange, isOnTouch, isTouched, isReValidateOnBlur, isReValidateOnChange, isBlurEvent, isSubmitted, isOnAll, }) => {
1962
- if (isOnAll) {
1963
- return false;
1964
- }
1965
- else if (!isSubmitted && isOnTouch) {
1966
- return !(isTouched || isBlurEvent);
1967
- }
1968
- else if (isSubmitted ? isReValidateOnBlur : isOnBlur) {
1969
- return !isBlurEvent;
1970
- }
1971
- else if (isSubmitted ? isReValidateOnChange : isOnChange) {
1972
- return isBlurEvent;
1973
- }
1974
- return true;
1934
+ var isPrimitive = value => isNullOrUndefined(value) || !isObjectType(value);
1935
+ var isFunction = value => typeof value === 'function';
1936
+ var skipValidation = _ref9 => {
1937
+ let isOnBlur = _ref9.isOnBlur,
1938
+ isOnChange = _ref9.isOnChange,
1939
+ isOnTouch = _ref9.isOnTouch,
1940
+ isTouched = _ref9.isTouched,
1941
+ isReValidateOnBlur = _ref9.isReValidateOnBlur,
1942
+ isReValidateOnChange = _ref9.isReValidateOnChange,
1943
+ isBlurEvent = _ref9.isBlurEvent,
1944
+ isSubmitted = _ref9.isSubmitted,
1945
+ isOnAll = _ref9.isOnAll;
1946
+ if (isOnAll) {
1947
+ return false;
1948
+ } else if (!isSubmitted && isOnTouch) {
1949
+ return !(isTouched || isBlurEvent);
1950
+ } else if (isSubmitted ? isReValidateOnBlur : isOnBlur) {
1951
+ return !isBlurEvent;
1952
+ } else if (isSubmitted ? isReValidateOnChange : isOnChange) {
1953
+ return isBlurEvent;
1954
+ }
1955
+ return true;
1975
1956
  };
1976
-
1977
- const isMatchFieldArrayName = (name, searchName) => RegExp(`^${searchName}([|.)\\d+`.replace(/\[/g, '\\[').replace(/\]/g, '\\]')).test(name);
1978
- var isNameInFieldArray = (names, name) => [...names].some((current) => isMatchFieldArrayName(name, current));
1979
-
1980
- /*! *****************************************************************************
1981
- Copyright (c) Microsoft Corporation.
1982
-
1983
- Permission to use, copy, modify, and/or distribute this software for any
1984
- purpose with or without fee is hereby granted.
1985
-
1986
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1987
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1988
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1989
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1990
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1991
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1992
- PERFORMANCE OF THIS SOFTWARE.
1993
- ***************************************************************************** */
1994
-
1995
- function __rest(s, e) {
1996
- var t = {};
1997
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1998
- t[p] = s[p];
1999
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
2000
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2001
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
2002
- t[p[i]] = s[p[i]];
2003
- }
2004
- return t;
1957
+ const isMatchFieldArrayName = (name, searchName) => RegExp(("^" + searchName + "([|.)\\d+").replace(/\[/g, '\\[').replace(/\]/g, '\\]')).test(name);
1958
+ var isNameInFieldArray = (names, name) => [...names].some(current => isMatchFieldArrayName(name, current));
1959
+ function __rest(s, e) {
1960
+ var t = {};
1961
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1962
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1963
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1964
+ }
1965
+ return t;
2005
1966
  }
2006
-
2007
- const FormContext = React.createContext(null);
2008
- FormContext.displayName = 'RHFContext';
2009
- const useFormContext = () => React.useContext(FormContext);
2010
-
2011
- var getInputValue = (event) => isPrimitive(event) ||
2012
- !isObject(event.target) ||
2013
- (isObject(event.target) && !event.type)
2014
- ? event
2015
- : isUndefined(event.target.value)
2016
- ? event.target.checked
2017
- : event.target.value;
2018
-
2019
- function useController({ name, rules, defaultValue, control, onFocus, }) {
2020
- const methods = useFormContext();
2021
- if (process.env.NODE_ENV !== 'production') {
2022
- if (!control && !methods) {
2023
- throw new Error('📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller');
2024
- }
2025
- }
2026
- const { defaultValuesRef, setValue, register, unregister, trigger, mode, reValidateMode: { isReValidateOnBlur, isReValidateOnChange }, formState, formStateRef: { current: { isSubmitted, touched, errors }, }, updateFormState, readFormStateRef, fieldsRef, fieldArrayNamesRef, shallowFieldsStateRef, } = control || methods.control;
2027
- const isNotFieldArray = !isNameInFieldArray(fieldArrayNamesRef.current, name);
2028
- const getInitialValue = () => !isUndefined(get(shallowFieldsStateRef.current, name)) && isNotFieldArray
2029
- ? get(shallowFieldsStateRef.current, name)
2030
- : isUndefined(defaultValue)
2031
- ? get(defaultValuesRef.current, name)
2032
- : defaultValue;
2033
- const [value, setInputStateValue] = React.useState(getInitialValue());
2034
- const valueRef = React.useRef(value);
2035
- const ref = React.useRef({
2036
- focus: () => null,
2037
- });
2038
- const onFocusRef = React.useRef(onFocus ||
2039
- (() => {
2040
- if (isFunction(ref.current.focus)) {
2041
- ref.current.focus();
2042
- }
2043
- if (process.env.NODE_ENV !== 'production') {
2044
- if (!isFunction(ref.current.focus)) {
2045
- console.warn(`📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method`);
2046
- }
2047
- }
2048
- }));
2049
- const shouldValidate = React.useCallback((isBlurEvent) => !skipValidation(Object.assign({ isBlurEvent,
2050
- isReValidateOnBlur,
2051
- isReValidateOnChange,
2052
- isSubmitted, isTouched: !!get(touched, name) }, mode)), [
2053
- isReValidateOnBlur,
2054
- isReValidateOnChange,
2055
- isSubmitted,
2056
- touched,
2057
- name,
2058
- mode,
2059
- ]);
2060
- const commonTask = React.useCallback(([event]) => {
2061
- const data = getInputValue(event);
2062
- setInputStateValue(data);
2063
- valueRef.current = data;
2064
- return data;
2065
- }, []);
2066
- const registerField = React.useCallback((shouldUpdateValue) => {
2067
- if (process.env.NODE_ENV !== 'production') {
2068
- if (!name) {
2069
- return console.warn('📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller');
2070
- }
2071
- }
2072
- if (fieldsRef.current[name]) {
2073
- fieldsRef.current[name] = Object.assign({ ref: fieldsRef.current[name].ref }, rules);
2074
- }
2075
- else {
2076
- register(Object.defineProperties({
2077
- name,
2078
- focus: onFocusRef.current,
2079
- }, {
2080
- value: {
2081
- set(data) {
2082
- setInputStateValue(data);
2083
- valueRef.current = data;
2084
- },
2085
- get() {
2086
- return valueRef.current;
2087
- },
2088
- },
2089
- }), rules);
2090
- shouldUpdateValue = isUndefined(get(defaultValuesRef.current, name));
2091
- }
2092
- shouldUpdateValue &&
2093
- isNotFieldArray &&
2094
- setInputStateValue(getInitialValue());
2095
- }, [rules, name, register]);
2096
- React.useEffect(() => () => unregister(name), [name]);
2097
- React.useEffect(() => {
2098
- if (process.env.NODE_ENV !== 'production') {
2099
- if (isUndefined(value)) {
2100
- console.warn(`📋 ${name} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`);
2101
- }
2102
- if (!isNotFieldArray && isUndefined(defaultValue)) {
2103
- console.warn('📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller');
2104
- }
2105
- }
2106
- registerField();
2107
- }, [registerField]);
2108
- React.useEffect(() => {
2109
- !fieldsRef.current[name] && registerField(true);
2110
- });
2111
- const onBlur = React.useCallback(() => {
2112
- if (readFormStateRef.current.touched && !get(touched, name)) {
2113
- set(touched, name, true);
2114
- updateFormState({
2115
- touched,
2116
- });
2117
- }
2118
- shouldValidate(true) && trigger(name);
2119
- }, [name, updateFormState, shouldValidate, trigger, readFormStateRef]);
2120
- const onChange = React.useCallback((...event) => setValue(name, commonTask(event), {
2121
- shouldValidate: shouldValidate(),
2122
- shouldDirty: true,
2123
- }), [setValue, name, shouldValidate]);
2124
- return {
2125
- field: {
2126
- onChange,
2127
- onBlur,
2128
- name,
2129
- value,
2130
- ref,
2131
- },
2132
- meta: Object.defineProperties({
2133
- invalid: !!get(errors, name),
2134
- }, {
2135
- isDirty: {
2136
- get() {
2137
- return !!get(formState.dirtyFields, name);
2138
- },
2139
- },
2140
- isTouched: {
2141
- get() {
2142
- return !!get(formState.touched, name);
2143
- },
2144
- },
2145
- }),
2146
- };
1967
+ const FormContext = React.createContext(null);
1968
+ FormContext.displayName = 'RHFContext';
1969
+ const useFormContext = () => React.useContext(FormContext);
1970
+ var getInputValue = event => isPrimitive(event) || !isObject(event.target) || isObject(event.target) && !event.type ? event : isUndefined(event.target.value) ? event.target.checked : event.target.value;
1971
+ function useController(_ref20) {
1972
+ let name = _ref20.name,
1973
+ rules = _ref20.rules,
1974
+ defaultValue = _ref20.defaultValue,
1975
+ control = _ref20.control,
1976
+ onFocus = _ref20.onFocus;
1977
+ const methods = useFormContext();
1978
+ if (process.env.NODE_ENV !== 'production') {
1979
+ if (!control && !methods) {
1980
+ throw new Error('📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller');
1981
+ }
1982
+ }
1983
+ const _ref21 = control || methods.control,
1984
+ defaultValuesRef = _ref21.defaultValuesRef,
1985
+ setValue = _ref21.setValue,
1986
+ register = _ref21.register,
1987
+ unregister = _ref21.unregister,
1988
+ trigger = _ref21.trigger,
1989
+ mode = _ref21.mode,
1990
+ _ref21$reValidateMode = _ref21.reValidateMode,
1991
+ isReValidateOnBlur = _ref21$reValidateMode.isReValidateOnBlur,
1992
+ isReValidateOnChange = _ref21$reValidateMode.isReValidateOnChange,
1993
+ formState = _ref21.formState,
1994
+ _ref21$formStateRef$c = _ref21.formStateRef.current,
1995
+ isSubmitted = _ref21$formStateRef$c.isSubmitted,
1996
+ touched = _ref21$formStateRef$c.touched,
1997
+ errors = _ref21$formStateRef$c.errors,
1998
+ updateFormState = _ref21.updateFormState,
1999
+ readFormStateRef = _ref21.readFormStateRef,
2000
+ fieldsRef = _ref21.fieldsRef,
2001
+ fieldArrayNamesRef = _ref21.fieldArrayNamesRef,
2002
+ shallowFieldsStateRef = _ref21.shallowFieldsStateRef;
2003
+ const isNotFieldArray = !isNameInFieldArray(fieldArrayNamesRef.current, name);
2004
+ const getInitialValue = () => !isUndefined(get(shallowFieldsStateRef.current, name)) && isNotFieldArray ? get(shallowFieldsStateRef.current, name) : isUndefined(defaultValue) ? get(defaultValuesRef.current, name) : defaultValue;
2005
+ const _useState3 = React.useState(getInitialValue()),
2006
+ value = _useState3[0],
2007
+ setInputStateValue = _useState3[1];
2008
+ const valueRef = React.useRef(value);
2009
+ const ref = React.useRef({
2010
+ focus: () => null
2011
+ });
2012
+ const onFocusRef = React.useRef(onFocus || (() => {
2013
+ if (isFunction(ref.current.focus)) {
2014
+ ref.current.focus();
2015
+ }
2016
+ if (process.env.NODE_ENV !== 'production') {
2017
+ if (!isFunction(ref.current.focus)) {
2018
+ console.warn("\uD83D\uDCCB 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method");
2019
+ }
2020
+ }
2021
+ }));
2022
+ const shouldValidate = React.useCallback(isBlurEvent => !skipValidation(Object.assign({
2023
+ isBlurEvent,
2024
+ isReValidateOnBlur,
2025
+ isReValidateOnChange,
2026
+ isSubmitted,
2027
+ isTouched: !!get(touched, name)
2028
+ }, mode)), [isReValidateOnBlur, isReValidateOnChange, isSubmitted, touched, name, mode]);
2029
+ const commonTask = React.useCallback(_ref22 => {
2030
+ let event = _ref22[0];
2031
+ const data = getInputValue(event);
2032
+ setInputStateValue(data);
2033
+ valueRef.current = data;
2034
+ return data;
2035
+ }, []);
2036
+ const registerField = React.useCallback(shouldUpdateValue => {
2037
+ if (process.env.NODE_ENV !== 'production') {
2038
+ if (!name) {
2039
+ return console.warn('📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller');
2040
+ }
2041
+ }
2042
+ if (fieldsRef.current[name]) {
2043
+ fieldsRef.current[name] = Object.assign({
2044
+ ref: fieldsRef.current[name].ref
2045
+ }, rules);
2046
+ } else {
2047
+ register(Object.defineProperties({
2048
+ name,
2049
+ focus: onFocusRef.current
2050
+ }, {
2051
+ value: {
2052
+ set(data) {
2053
+ setInputStateValue(data);
2054
+ valueRef.current = data;
2055
+ },
2056
+ get() {
2057
+ return valueRef.current;
2058
+ }
2059
+ }
2060
+ }), rules);
2061
+ shouldUpdateValue = isUndefined(get(defaultValuesRef.current, name));
2062
+ }
2063
+ shouldUpdateValue && isNotFieldArray && setInputStateValue(getInitialValue());
2064
+ }, [rules, name, register]);
2065
+ React.useEffect(() => () => unregister(name), [name]);
2066
+ React.useEffect(() => {
2067
+ if (process.env.NODE_ENV !== 'production') {
2068
+ if (isUndefined(value)) {
2069
+ console.warn("\uD83D\uDCCB " + name + " is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)");
2070
+ }
2071
+ if (!isNotFieldArray && isUndefined(defaultValue)) {
2072
+ console.warn('📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller');
2073
+ }
2074
+ }
2075
+ registerField();
2076
+ }, [registerField]);
2077
+ React.useEffect(() => {
2078
+ !fieldsRef.current[name] && registerField(true);
2079
+ });
2080
+ const onBlur = React.useCallback(() => {
2081
+ if (readFormStateRef.current.touched && !get(touched, name)) {
2082
+ set(touched, name, true);
2083
+ updateFormState({
2084
+ touched
2085
+ });
2086
+ }
2087
+ shouldValidate(true) && trigger(name);
2088
+ }, [name, updateFormState, shouldValidate, trigger, readFormStateRef]);
2089
+ const onChange = React.useCallback(function () {
2090
+ for (var _len = arguments.length, event = new Array(_len), _key = 0; _key < _len; _key++) {
2091
+ event[_key] = arguments[_key];
2092
+ }
2093
+ return setValue(name, commonTask(event), {
2094
+ shouldValidate: shouldValidate(),
2095
+ shouldDirty: true
2096
+ });
2097
+ }, [setValue, name, shouldValidate]);
2098
+ return {
2099
+ field: {
2100
+ onChange,
2101
+ onBlur,
2102
+ name,
2103
+ value,
2104
+ ref
2105
+ },
2106
+ meta: Object.defineProperties({
2107
+ invalid: !!get(errors, name)
2108
+ }, {
2109
+ isDirty: {
2110
+ get() {
2111
+ return !!get(formState.dirtyFields, name);
2112
+ }
2113
+ },
2114
+ isTouched: {
2115
+ get() {
2116
+ return !!get(formState.touched, name);
2117
+ }
2118
+ }
2119
+ })
2120
+ };
2147
2121
  }
2148
-
2149
- const Controller = (props) => {
2150
- const { rules, as, render, defaultValue, control, onFocus } = props, rest = __rest(props, ["rules", "as", "render", "defaultValue", "control", "onFocus"]);
2151
- const { field, meta } = useController(props);
2152
- const componentProps = Object.assign(Object.assign({}, rest), field);
2153
- return as
2154
- ? React.isValidElement(as)
2155
- ? React.cloneElement(as, componentProps)
2156
- : React.createElement(as, componentProps)
2157
- : render
2158
- ? render(field, meta)
2159
- : null;
2122
+ const Controller = props => {
2123
+ const as = props.as,
2124
+ render = props.render,
2125
+ rest = __rest(props, ["rules", "as", "render", "defaultValue", "control", "onFocus"]);
2126
+ const _useController = useController(props),
2127
+ field = _useController.field,
2128
+ meta = _useController.meta;
2129
+ const componentProps = Object.assign(Object.assign({}, rest), field);
2130
+ return as ? React.isValidElement(as) ? React.cloneElement(as, componentProps) : React.createElement(as, componentProps) : render ? render(field, meta) : null;
2160
2131
  };
2161
2132
 
2162
2133
  const SearchFormFieldsComponents = _ref => {
@@ -2368,28 +2339,24 @@ const Inbox = _ref => {
2368
2339
  onSearchFormReset,
2369
2340
  className: "search-form-wns-inbox"
2370
2341
  };
2371
- const FilterFormFields = React.useCallback(_ref3 => {
2372
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
2373
- }, []);
2374
2342
  function formReducer(state, payload) {
2375
- const storageKey = payload.checkPathName ? "EKYC.INBOX" : "EKYC.SW.INBOX";
2376
2343
  switch (payload.action) {
2377
2344
  case "mutateSearchForm":
2378
- Digit.SessionStorage.set(storageKey, _extends({}, state, {
2345
+ Digit.SessionStorage.set("EKYC.INBOX", _extends({}, state, {
2379
2346
  searchForm: payload.data
2380
2347
  }));
2381
2348
  return _extends({}, state, {
2382
2349
  searchForm: payload.data
2383
2350
  });
2384
2351
  case "mutateFilterForm":
2385
- Digit.SessionStorage.set(storageKey, _extends({}, state, {
2352
+ Digit.SessionStorage.set("EKYC.INBOX", _extends({}, state, {
2386
2353
  filterForm: payload.data
2387
2354
  }));
2388
2355
  return _extends({}, state, {
2389
2356
  filterForm: payload.data
2390
2357
  });
2391
2358
  case "mutateTableForm":
2392
- Digit.SessionStorage.set(storageKey, _extends({}, state, {
2359
+ Digit.SessionStorage.set("EKYC.INBOX", _extends({}, state, {
2393
2360
  tableForm: payload.data
2394
2361
  }));
2395
2362
  return _extends({}, state, {
@@ -3192,38 +3159,6 @@ const Create = () => {
3192
3159
  }));
3193
3160
  };
3194
3161
 
3195
- // A type of promise-like that resolves synchronously and supports only one observer
3196
-
3197
- const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
3198
-
3199
- const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
3200
-
3201
- // Asynchronously call a function and send errors to recovery continuation
3202
- function _catch(body, recover) {
3203
- try {
3204
- var result = body();
3205
- } catch(e) {
3206
- return recover(e);
3207
- }
3208
- if (result && result.then) {
3209
- return result.then(void 0, recover);
3210
- }
3211
- return result;
3212
- }
3213
-
3214
- // Asynchronously await a promise and pass the result to a finally continuation
3215
- function _finallyRethrows(body, finalizer) {
3216
- try {
3217
- var result = body();
3218
- } catch (e) {
3219
- return finalizer(true, e);
3220
- }
3221
- if (result && result.then) {
3222
- return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
3223
- }
3224
- return finalizer(false, result);
3225
- }
3226
-
3227
3162
  const ActionButton = _ref => {
3228
3163
  let jumpTo = _ref.jumpTo,
3229
3164
  state = _ref.state;
@@ -4998,42 +4933,41 @@ const AssignEkycModal = _ref => {
4998
4933
  }),
4999
4934
  applicationData = _Digit$Hooks$ekyc$use.data,
5000
4935
  isLoading = _Digit$Hooks$ekyc$use.isFetching;
4936
+ const handleAssignmentError = (errMsg, variables) => {
4937
+ const isAlreadyAssigned = errMsg.toLowerCase().includes("already assigned") || errMsg.toLowerCase().includes("already assign") || errMsg.toLowerCase().includes("active assignment") || errMsg.toLowerCase().includes("mrkey") || errMsg.toLowerCase().includes("mr key") || errMsg.toLowerCase().includes("kno") || errMsg.toLowerCase().includes("already exists");
4938
+ if (isAlreadyAssigned) {
4939
+ const isMrKeyType = (variables === null || variables === void 0 ? void 0 : variables.assignmentType) === "MRKEY";
4940
+ if (isMrKeyType) {
4941
+ setToastData({
4942
+ error: true,
4943
+ label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
4944
+ });
4945
+ } else {
4946
+ setToastData({
4947
+ error: true,
4948
+ label: t("EKYC_KNO_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "kno is already assign with another surveyor"
4949
+ });
4950
+ }
4951
+ } else {
4952
+ setToastData({
4953
+ error: true,
4954
+ label: t(errMsg) || errMsg || t("EKYC_SOMETHING_WENT_WRONG") || "Something went wrong"
4955
+ });
4956
+ }
4957
+ setShowToast(true);
4958
+ };
5001
4959
  const assignmentMutation = Digit.Hooks.ekyc.useEkycAssignmentCreate({
5002
- onSuccess: response => {
4960
+ onSuccess: (response, variables) => {
5003
4961
  if (response !== null && response !== void 0 && response.error) {
5004
4962
  var _response$data;
5005
4963
  const errMsg = (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.message) || "";
5006
- const isMrKeyAlreadyAssigned = errMsg.toLowerCase().includes("already assigned") || errMsg.toLowerCase().includes("already assign") || errMsg.toLowerCase().includes("mrkey") || errMsg.toLowerCase().includes("mr key");
5007
- if (isMrKeyAlreadyAssigned) {
5008
- setToastData({
5009
- error: true,
5010
- label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
5011
- });
5012
- } else {
5013
- setToastData({
5014
- error: true,
5015
- label: t(errMsg) || errMsg || t("EKYC_SOMETHING_WENT_WRONG") || "Something went wrong"
5016
- });
5017
- }
5018
- setShowToast(true);
4964
+ handleAssignmentError(errMsg, variables);
5019
4965
  return;
5020
4966
  }
5021
4967
  if (response !== null && response !== void 0 && response.skipped && response.skipped.length > 0) {
5022
4968
  var _response$skipped$;
5023
4969
  const reason = ((_response$skipped$ = response.skipped[0]) === null || _response$skipped$ === void 0 ? void 0 : _response$skipped$.reason) || "";
5024
- const isMrKeyAlreadyAssigned = reason.toLowerCase().includes("already exists") || reason.toLowerCase().includes("already assign") || reason.toLowerCase().includes("active assignment") || reason.toLowerCase().includes("mrkey") || reason.toLowerCase().includes("mr key");
5025
- if (isMrKeyAlreadyAssigned) {
5026
- setToastData({
5027
- error: true,
5028
- label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
5029
- });
5030
- } else {
5031
- setToastData({
5032
- error: true,
5033
- label: t(reason) || reason || t("EKYC_ASSIGNMENT_SKIPPED") || "Assignment skipped"
5034
- });
5035
- }
5036
- setShowToast(true);
4970
+ handleAssignmentError(reason, variables);
5037
4971
  return;
5038
4972
  }
5039
4973
  setToastData({
@@ -5051,22 +4985,10 @@ const AssignEkycModal = _ref => {
5051
4985
  }
5052
4986
  }, 1000);
5053
4987
  },
5054
- onError: error => {
4988
+ onError: (error, variables) => {
5055
4989
  var _error$data, _error$response, _error$response$data;
5056
4990
  const errMsg = (error === null || error === void 0 ? void 0 : (_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.message) || (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.message) || "";
5057
- const isMrKeyAlreadyAssigned = errMsg.toLowerCase().includes("already assigned") || errMsg.toLowerCase().includes("already assign") || errMsg.toLowerCase().includes("mrkey") || errMsg.toLowerCase().includes("mr key");
5058
- if (isMrKeyAlreadyAssigned) {
5059
- setToastData({
5060
- error: true,
5061
- label: t("EKYC_MR_KEY_ALREADY_ASSIGNED_WITH_ANOTHER_SURVEYOR") || "mr key is already assign with another surveyor"
5062
- });
5063
- } else {
5064
- setToastData({
5065
- error: true,
5066
- label: t(errMsg) || errMsg || t("EKYC_SOMETHING_WENT_WRONG") || "Something went wrong"
5067
- });
5068
- }
5069
- setShowToast(true);
4991
+ handleAssignmentError(errMsg, variables);
5070
4992
  }
5071
4993
  });
5072
4994
  const tableData = (applicationData === null || applicationData === void 0 ? void 0 : applicationData.consumerList) || [];
@@ -6047,12 +5969,7 @@ const tableColumnConfig = (t, handleReview) => [{
6047
5969
  let row = _ref.row;
6048
5970
  const id = (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.id;
6049
5971
  return /*#__PURE__*/React__default.createElement("span", {
6050
- className: "ekyc-application-link",
6051
- style: {
6052
- color: "#318ED0",
6053
- cursor: "pointer",
6054
- fontSize: "16px"
6055
- },
5972
+ className: "link",
6056
5973
  onClick: () => handleReview(id)
6057
5974
  }, ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.surveyorName) || ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.name) || "NA");
6058
5975
  }
@@ -7556,14 +7473,35 @@ const Home = () => {
7556
7473
  link: "/digit-ui/citizen/ekyc/supervisor-dashboard"
7557
7474
  });
7558
7475
  }
7476
+ if (roles.includes("EKYC_SUPERVISOR") || roles.includes("EKYC_VENDOR")) {
7477
+ propsForModuleCard.links.push({
7478
+ label: t("TITLE_VENDOR_MANAGEMENT"),
7479
+ link: "/digit-ui/citizen/vendor/search-vendor"
7480
+ });
7481
+ }
7559
7482
  if (roles.length === 1 && roles.includes("CITIZEN")) {
7560
7483
  propsForModuleCard.links.push({
7484
+ label: t("EKYC_CREATE_KYC"),
7485
+ link: "/digit-ui/citizen/ekyc/create-kyc"
7486
+ }, {
7487
+ label: t("EKYC_UPDATE_KYC"),
7488
+ link: "/digit-ui/citizen/ekyc/update-kyc"
7489
+ }, {
7561
7490
  label: t("EKYC_STATUS"),
7562
7491
  link: "/digit-ui/citizen/ekyc/:id"
7563
7492
  });
7564
7493
  }
7565
- return /*#__PURE__*/React__default.createElement(digitUiReactComponents.ModuleLinksView, {
7566
- links: propsForModuleCard.links
7494
+ const formattedLinks = propsForModuleCard.links.map(l => ({
7495
+ i18nKey: l.label,
7496
+ link: l.link,
7497
+ count: l.count
7498
+ }));
7499
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.CitizenHomeCard, {
7500
+ header: t("EKYC_MODULE_NAME"),
7501
+ links: formattedLinks,
7502
+ Icon: () => /*#__PURE__*/React__default.createElement(digitUiReactComponents.DocumentIcon, {
7503
+ className: "fill-path-primary-main"
7504
+ })
7567
7505
  });
7568
7506
  };
7569
7507
 
@@ -8673,6 +8611,10 @@ const CitizenApp = () => {
8673
8611
  const location = reactRouterDom.useLocation();
8674
8612
  const _useRouteMatch = reactRouterDom.useRouteMatch(),
8675
8613
  path = _useRouteMatch.path;
8614
+ const _Digit$Hooks$useStore = Digit.Hooks.useStore.getInitData(),
8615
+ _Digit$Hooks$useStore2 = _Digit$Hooks$useStore.data,
8616
+ _Digit$Hooks$useStore3 = _Digit$Hooks$useStore2 === void 0 ? {} : _Digit$Hooks$useStore2,
8617
+ stateInfo = _Digit$Hooks$useStore3.stateInfo;
8676
8618
  sessionStorage.removeItem("revalidateddone");
8677
8619
  const getDynamicBreadcrumbs = () => {
8678
8620
  const pathname = location.pathname;
@@ -8747,6 +8689,29 @@ const CitizenApp = () => {
8747
8689
  }
8748
8690
  return crumbs;
8749
8691
  };
8692
+ const isEkycHome = location.pathname === "/digit-ui/citizen/ekyc" || location.pathname === "/digit-ui/citizen/ekyc/";
8693
+ if (isEkycHome) {
8694
+ const isMobile = window.Digit.Utils.browser.isMobile();
8695
+ return (
8696
+ /*#__PURE__*/
8697
+ React__default.createElement("div", {
8698
+ className: "moduleLinkHomePage"
8699
+ }, /*#__PURE__*/React__default.createElement("div", {
8700
+ style: {
8701
+ position: "relative"
8702
+ }
8703
+ }, /*#__PURE__*/React__default.createElement("img", {
8704
+ src: stateInfo === null || stateInfo === void 0 ? void 0 : stateInfo.bannerUrl,
8705
+ alt: "noimagefound"
8706
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.BackButton, {
8707
+ className: "moduleLinkHomePageBackButton"
8708
+ }), /*#__PURE__*/React__default.createElement("div", {
8709
+ className: "moduleTitle"
8710
+ }, isMobile ? /*#__PURE__*/React__default.createElement("h4", null, t("MODULE_EKYC")) : /*#__PURE__*/React__default.createElement("h1", null, t("MODULE_EKYC")))), /*#__PURE__*/React__default.createElement("div", {
8711
+ className: "moduleLinkHomePageModuleLinks"
8712
+ }, /*#__PURE__*/React__default.createElement(Home, null)))
8713
+ );
8714
+ }
8750
8715
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8751
8716
  className: "ground-container form-container"
8752
8717
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.ModuleHeader, {