idmission-web-sdk 2.3.57 → 2.3.58

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom/client'), require('platform'), require('styled-components'), require('react-dom'), require('tus-js-client'), require('prop-types')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom/client', 'platform', 'styled-components', 'react-dom', 'tus-js-client', 'prop-types'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sdk2 = {}, global.React, global.ReactDOM, global.platform, global.styled, global.ReactDOM, global.tusJsClient, global.PropTypes));
5
- })(this, (function (exports, React, ReactDOM, platform, styled, reactDom, tusJsClient, require$$0) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom/client'), require('platform'), require('styled-components'), require('react-dom'), require('tus-js-client'), require('prop-types'), require('react-dom/server')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom/client', 'platform', 'styled-components', 'react-dom', 'tus-js-client', 'prop-types', 'react-dom/server'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sdk2 = {}, global.React, global.ReactDOM, global.platform, global.styled, global.ReactDOM, global.tusJsClient, global.PropTypes, global.server));
5
+ })(this, (function (exports, React, ReactDOM, platform, styled, reactDom, tusJsClient, require$$0, server) { 'use strict';
6
6
 
7
7
  function _interopNamespaceDefault(e) {
8
8
  var n = Object.create(null);
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.3.57';
214
+ var webSdkVersion = '2.3.58';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -9477,18 +9477,11 @@
9477
9477
  return listeners["delete"](listener);
9478
9478
  };
9479
9479
  };
9480
- var destroy = function destroy() {
9481
- if ((undefined ? undefined.MODE : void 0) !== "production") {
9482
- console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected.");
9483
- }
9484
- listeners.clear();
9485
- };
9486
9480
  var api = {
9487
9481
  setState: setState,
9488
9482
  getState: getState,
9489
9483
  getInitialState: getInitialState,
9490
- subscribe: subscribe,
9491
- destroy: destroy
9484
+ subscribe: subscribe
9492
9485
  };
9493
9486
  var initialState = state = createState(setState, getState, api);
9494
9487
  return api;
@@ -9497,213 +9490,25 @@
9497
9490
  return createState ? createStoreImpl(createState) : createStoreImpl;
9498
9491
  };
9499
9492
 
9500
- var withSelector = {exports: {}};
9501
-
9502
- var shim = {exports: {}};
9503
-
9504
- var useSyncExternalStoreShim_development = {};
9505
-
9506
- /**
9507
- * @license React
9508
- * use-sync-external-store-shim.development.js
9509
- *
9510
- * Copyright (c) Meta Platforms, Inc. and affiliates.
9511
- *
9512
- * This source code is licensed under the MIT license found in the
9513
- * LICENSE file in the root directory of this source tree.
9514
- */
9515
- var hasRequiredUseSyncExternalStoreShim_development;
9516
- function requireUseSyncExternalStoreShim_development() {
9517
- if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
9518
- hasRequiredUseSyncExternalStoreShim_development = 1;
9519
- (function () {
9520
- function is(x, y) {
9521
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
9522
- }
9523
- function useSyncExternalStore$2(subscribe, getSnapshot) {
9524
- didWarnOld18Alpha || void 0 === React$1.startTransition || (didWarnOld18Alpha = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
9525
- var value = getSnapshot();
9526
- if (!didWarnUncachedGetSnapshot) {
9527
- var cachedValue = getSnapshot();
9528
- objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = !0);
9529
- }
9530
- cachedValue = useState({
9531
- inst: {
9532
- value: value,
9533
- getSnapshot: getSnapshot
9534
- }
9535
- });
9536
- var inst = cachedValue[0].inst,
9537
- forceUpdate = cachedValue[1];
9538
- useLayoutEffect(function () {
9539
- inst.value = value;
9540
- inst.getSnapshot = getSnapshot;
9541
- checkIfSnapshotChanged(inst) && forceUpdate({
9542
- inst: inst
9543
- });
9544
- }, [subscribe, value, getSnapshot]);
9545
- useEffect(function () {
9546
- checkIfSnapshotChanged(inst) && forceUpdate({
9547
- inst: inst
9548
- });
9549
- return subscribe(function () {
9550
- checkIfSnapshotChanged(inst) && forceUpdate({
9551
- inst: inst
9552
- });
9553
- });
9554
- }, [subscribe]);
9555
- useDebugValue(value);
9556
- return value;
9557
- }
9558
- function checkIfSnapshotChanged(inst) {
9559
- var latestGetSnapshot = inst.getSnapshot;
9560
- inst = inst.value;
9561
- try {
9562
- var nextValue = latestGetSnapshot();
9563
- return !objectIs(inst, nextValue);
9564
- } catch (error) {
9565
- return !0;
9566
- }
9567
- }
9568
- function useSyncExternalStore$1(subscribe, getSnapshot) {
9569
- return getSnapshot();
9570
- }
9571
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
9572
- var React$1 = React,
9573
- objectIs = "function" === typeof Object.is ? Object.is : is,
9574
- useState = React$1.useState,
9575
- useEffect = React$1.useEffect,
9576
- useLayoutEffect = React$1.useLayoutEffect,
9577
- useDebugValue = React$1.useDebugValue,
9578
- didWarnOld18Alpha = !1,
9579
- didWarnUncachedGetSnapshot = !1,
9580
- shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
9581
- useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
9582
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
9583
- })();
9584
- return useSyncExternalStoreShim_development;
9585
- }
9586
-
9587
- var hasRequiredShim;
9588
- function requireShim() {
9589
- if (hasRequiredShim) return shim.exports;
9590
- hasRequiredShim = 1;
9591
- {
9592
- shim.exports = requireUseSyncExternalStoreShim_development();
9593
- }
9594
- return shim.exports;
9595
- }
9596
-
9597
- var withSelector_development = {};
9598
-
9599
- /**
9600
- * @license React
9601
- * use-sync-external-store-shim/with-selector.development.js
9602
- *
9603
- * Copyright (c) Meta Platforms, Inc. and affiliates.
9604
- *
9605
- * This source code is licensed under the MIT license found in the
9606
- * LICENSE file in the root directory of this source tree.
9607
- */
9608
- var hasRequiredWithSelector_development;
9609
- function requireWithSelector_development() {
9610
- if (hasRequiredWithSelector_development) return withSelector_development;
9611
- hasRequiredWithSelector_development = 1;
9612
- (function () {
9613
- function is(x, y) {
9614
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
9615
- }
9616
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
9617
- var React$1 = React,
9618
- shim = requireShim(),
9619
- objectIs = "function" === typeof Object.is ? Object.is : is,
9620
- useSyncExternalStore = shim.useSyncExternalStore,
9621
- useRef = React$1.useRef,
9622
- useEffect = React$1.useEffect,
9623
- useMemo = React$1.useMemo,
9624
- useDebugValue = React$1.useDebugValue;
9625
- withSelector_development.useSyncExternalStoreWithSelector = function (subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
9626
- var instRef = useRef(null);
9627
- if (null === instRef.current) {
9628
- var inst = {
9629
- hasValue: !1,
9630
- value: null
9631
- };
9632
- instRef.current = inst;
9633
- } else inst = instRef.current;
9634
- instRef = useMemo(function () {
9635
- function memoizedSelector(nextSnapshot) {
9636
- if (!hasMemo) {
9637
- hasMemo = !0;
9638
- memoizedSnapshot = nextSnapshot;
9639
- nextSnapshot = selector(nextSnapshot);
9640
- if (void 0 !== isEqual && inst.hasValue) {
9641
- var currentSelection = inst.value;
9642
- if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
9643
- }
9644
- return memoizedSelection = nextSnapshot;
9645
- }
9646
- currentSelection = memoizedSelection;
9647
- if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
9648
- var nextSelection = selector(nextSnapshot);
9649
- if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
9650
- memoizedSnapshot = nextSnapshot;
9651
- return memoizedSelection = nextSelection;
9652
- }
9653
- var hasMemo = !1,
9654
- memoizedSnapshot,
9655
- memoizedSelection,
9656
- maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
9657
- return [function () {
9658
- return memoizedSelector(getSnapshot());
9659
- }, null === maybeGetServerSnapshot ? void 0 : function () {
9660
- return memoizedSelector(maybeGetServerSnapshot());
9661
- }];
9662
- }, [getSnapshot, getServerSnapshot, selector, isEqual]);
9663
- var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
9664
- useEffect(function () {
9665
- inst.hasValue = !0;
9666
- inst.value = value;
9667
- }, [value]);
9668
- useDebugValue(value);
9669
- return value;
9670
- };
9671
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
9672
- })();
9673
- return withSelector_development;
9674
- }
9675
-
9676
- {
9677
- withSelector.exports = requireWithSelector_development();
9678
- }
9679
- var withSelectorExports = withSelector.exports;
9680
- var useSyncExternalStoreExports = /*@__PURE__*/getDefaultExportFromCjs(withSelectorExports);
9681
-
9682
- var useDebugValue = React.useDebugValue;
9683
- var useSyncExternalStoreWithSelector = useSyncExternalStoreExports.useSyncExternalStoreWithSelector;
9684
- var didWarnAboutEqualityFn = false;
9685
9493
  var identity = function identity(arg) {
9686
9494
  return arg;
9687
9495
  };
9688
- function useStore(api, selector, equalityFn) {
9496
+ function useStore(api, selector) {
9689
9497
  if (selector === void 0) {
9690
9498
  selector = identity;
9691
9499
  }
9692
- if ((undefined ? undefined.MODE : void 0) !== "production" && equalityFn && !didWarnAboutEqualityFn) {
9693
- console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937");
9694
- didWarnAboutEqualityFn = true;
9695
- }
9696
- var slice = useSyncExternalStoreWithSelector(api.subscribe, api.getState, api.getServerState || api.getInitialState, selector, equalityFn);
9697
- useDebugValue(slice);
9500
+ var slice = React.useSyncExternalStore(api.subscribe, function () {
9501
+ return selector(api.getState());
9502
+ }, function () {
9503
+ return selector(api.getInitialState());
9504
+ });
9505
+ React.useDebugValue(slice);
9698
9506
  return slice;
9699
9507
  }
9700
9508
  var createImpl = function createImpl(createState) {
9701
- if ((undefined ? undefined.MODE : void 0) !== "production" && typeof createState !== "function") {
9702
- console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");
9703
- }
9704
- var api = typeof createState === "function" ? createStore(createState) : createState;
9705
- var useBoundStore = function useBoundStore(selector, equalityFn) {
9706
- return useStore(api, selector, equalityFn);
9509
+ var api = createStore(createState);
9510
+ var useBoundStore = function useBoundStore(selector) {
9511
+ return useStore(api, selector);
9707
9512
  };
9708
9513
  Object.assign(useBoundStore, api);
9709
9514
  return useBoundStore;
@@ -14903,11 +14708,8 @@
14903
14708
  var extensionConnector;
14904
14709
  try {
14905
14710
  extensionConnector = (enabled != null ? enabled : (undefined ? undefined.MODE : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
14906
- } catch (_e) {}
14711
+ } catch (e) {}
14907
14712
  if (!extensionConnector) {
14908
- if ((undefined ? undefined.MODE : void 0) !== "production" && enabled) {
14909
- console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension");
14910
- }
14911
14713
  return fn(set, get, api);
14912
14714
  }
14913
14715
  var _extractConnectionInf = extractConnectionInformation(store, extensionConnector, options),
@@ -14978,7 +14780,7 @@
14978
14780
  return;
14979
14781
  }
14980
14782
  if (Object.keys(action.state).length !== 1) {
14981
- console.error("\n [zustand devtools middleware] Unsupported __setState action format. \n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n ");
14783
+ console.error("\n [zustand devtools middleware] Unsupported __setState action format.\n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n ");
14982
14784
  }
14983
14785
  var stateFromDevtools = action.state[store];
14984
14786
  if (stateFromDevtools === void 0 || stateFromDevtools === null) {
@@ -15066,50 +14868,71 @@
15066
14868
  function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15067
14869
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
15068
14870
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
15069
- function shallow(objA, objB) {
15070
- if (Object.is(objA, objB)) {
15071
- return true;
15072
- }
15073
- if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
14871
+ var isIterable = function isIterable(obj) {
14872
+ return Symbol.iterator in obj;
14873
+ };
14874
+ var hasIterableEntries = function hasIterableEntries(value) {
14875
+ return (
14876
+ // HACK: avoid checking entries type
14877
+ "entries" in value
14878
+ );
14879
+ };
14880
+ var compareEntries = function compareEntries(valueA, valueB) {
14881
+ var mapA = valueA instanceof Map ? valueA : new Map(valueA.entries());
14882
+ var mapB = valueB instanceof Map ? valueB : new Map(valueB.entries());
14883
+ if (mapA.size !== mapB.size) {
15074
14884
  return false;
15075
14885
  }
15076
- if (objA instanceof Map && objB instanceof Map) {
15077
- if (objA.size !== objB.size) return false;
15078
- for (var _iterator = _createForOfIteratorHelperLoose(objA), _step; !(_step = _iterator()).done;) {
15079
- var _step$value = _step.value,
15080
- key = _step$value[0],
15081
- value = _step$value[1];
15082
- if (!Object.is(value, objB.get(key))) {
15083
- return false;
15084
- }
14886
+ for (var _iterator = _createForOfIteratorHelperLoose(mapA), _step; !(_step = _iterator()).done;) {
14887
+ var _step$value = _step.value,
14888
+ key = _step$value[0],
14889
+ value = _step$value[1];
14890
+ if (!Object.is(value, mapB.get(key))) {
14891
+ return false;
15085
14892
  }
15086
- return true;
15087
14893
  }
15088
- if (objA instanceof Set && objB instanceof Set) {
15089
- if (objA.size !== objB.size) return false;
15090
- for (var _iterator2 = _createForOfIteratorHelperLoose(objA), _step2; !(_step2 = _iterator2()).done;) {
15091
- var _value = _step2.value;
15092
- if (!objB.has(_value)) {
15093
- return false;
15094
- }
14894
+ return true;
14895
+ };
14896
+ var compareIterables = function compareIterables(valueA, valueB) {
14897
+ var iteratorA = valueA[Symbol.iterator]();
14898
+ var iteratorB = valueB[Symbol.iterator]();
14899
+ var nextA = iteratorA.next();
14900
+ var nextB = iteratorB.next();
14901
+ while (!nextA.done && !nextB.done) {
14902
+ if (!Object.is(nextA.value, nextB.value)) {
14903
+ return false;
15095
14904
  }
14905
+ nextA = iteratorA.next();
14906
+ nextB = iteratorB.next();
14907
+ }
14908
+ return !!nextA.done && !!nextB.done;
14909
+ };
14910
+ function shallow(valueA, valueB) {
14911
+ if (Object.is(valueA, valueB)) {
15096
14912
  return true;
15097
14913
  }
15098
- var keysA = Object.keys(objA);
15099
- if (keysA.length !== Object.keys(objB).length) {
14914
+ if (typeof valueA !== "object" || valueA === null || typeof valueB !== "object" || valueB === null) {
15100
14915
  return false;
15101
14916
  }
15102
- for (var _i = 0, _keysA = keysA; _i < _keysA.length; _i++) {
15103
- var keyA = _keysA[_i];
15104
- if (!Object.prototype.hasOwnProperty.call(objB, keyA) || !Object.is(objA[keyA], objB[keyA])) {
15105
- return false;
15106
- }
14917
+ if (!isIterable(valueA) || !isIterable(valueB)) {
14918
+ return compareEntries({
14919
+ entries: function entries() {
14920
+ return Object.entries(valueA);
14921
+ }
14922
+ }, {
14923
+ entries: function entries() {
14924
+ return Object.entries(valueB);
14925
+ }
14926
+ });
15107
14927
  }
15108
- return true;
14928
+ if (hasIterableEntries(valueA) && hasIterableEntries(valueB)) {
14929
+ return compareEntries(valueA, valueB);
14930
+ }
14931
+ return compareIterables(valueA, valueB);
15109
14932
  }
15110
- var useRef = React.useRef;
14933
+
15111
14934
  function useShallow(selector) {
15112
- var prev = useRef();
14935
+ var prev = React.useRef();
15113
14936
  return function (state) {
15114
14937
  var next = selector(state);
15115
14938
  return shallow(prev.current, next) ? prev.current : prev.current = next;
@@ -19902,7 +19725,7 @@
19902
19725
  focusScore: metadata.bestFocusScore
19903
19726
  }
19904
19727
  });
19905
- }, [logCaptureMetadata]);
19728
+ }, [logCaptureMetadata, onDocumentCaptured]);
19906
19729
  var onSubmitClick = React.useCallback(function () {
19907
19730
  var _a, _b, _c, _d, _e, _f, _g, _h;
19908
19731
  var docs = state.capturedDocuments;
@@ -25134,7 +24957,8 @@
25134
24957
  setRequestedAction('READ_TEXT');
25135
24958
  useVideoRecorderStore.getState().startRecordingAudio(audioStream);
25136
24959
  setIdCaptureVideoAudioStartsAt(new Date().getTime() - ((_a = videoStartsAt === null || videoStartsAt === void 0 ? void 0 : videoStartsAt.getTime()) !== null && _a !== void 0 ? _a : 0));
25137
- setExpectedAudioText(translatedText);
24960
+ var renderedTranslatedText = typeof translatedText === 'string' ? translatedText : server.renderToString(translatedText);
24961
+ setExpectedAudioText(renderedTranslatedText);
25138
24962
  } else {
25139
24963
  useVideoRecorderStore.getState().stopRecordingVideo();
25140
24964
  }