idmission-web-sdk 2.3.32 → 2.3.34

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/sdk2.esm.js CHANGED
@@ -204,7 +204,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
204
204
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
205
205
  };
206
206
 
207
- var webSdkVersion = '2.3.32';
207
+ var webSdkVersion = '2.3.34';
208
208
 
209
209
  function getPlatform() {
210
210
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -7916,12 +7916,10 @@ function resetCanvasDimensions(canvas) {
7916
7916
  canvas.style.height = '0';
7917
7917
  }
7918
7918
 
7919
- var IdCardGuideImageContainer = styled(IdCardBorder)(templateObject_1$A || (templateObject_1$A = __makeTemplateObject(["\n position: relative;\n ", "\n box-sizing: border-box;\n aspect-ratio: ", ";\n display: flex;\n"], ["\n position: relative;\n ", "\n box-sizing: border-box;\n aspect-ratio: ", ";\n display: flex;\n"])), function (props) {
7919
+ var IdCardGuideImageContainer = styled(IdCardBorder)(templateObject_1$A || (templateObject_1$A = __makeTemplateObject(["\n position: relative;\n ", "\n box-sizing: border-box;\n"], ["\n position: relative;\n ", "\n box-sizing: border-box;\n"])), function (props) {
7920
7920
  return props.$isVisible ? '' : 'opacity: 0;';
7921
- }, function (props) {
7922
- return props.$aspectRatio;
7923
7921
  });
7924
- var IdCardGuideImage = styled.img(templateObject_2$t || (templateObject_2$t = __makeTemplateObject(["\n transform-style: preserve-3d;\n ", "\n ", "\n max-width: 100%;\n max-height: 100%;\n"], ["\n transform-style: preserve-3d;\n ", "\n ", "\n max-width: 100%;\n max-height: 100%;\n"])), function (props) {
7922
+ var IdCardGuideImage = styled.img(templateObject_2$t || (templateObject_2$t = __makeTemplateObject(["\n max-height: 100%;\n transform-style: preserve-3d;\n ", "\n ", "\n"], ["\n max-height: 100%;\n transform-style: preserve-3d;\n ", "\n ", "\n"])), function (props) {
7925
7923
  return props.$isMirrored ? 'transform: scaleX(-1);' : '';
7926
7924
  }, function (props) {
7927
7925
  return props.$isInvisible ? 'opacity: 0;' : '';
@@ -7937,19 +7935,20 @@ function IdCardBorder(_a) {
7937
7935
  borderRadius = _u === void 0 ? 25 : _u,
7938
7936
  _v = _a.borderColor,
7939
7937
  borderColor = _v === void 0 ? 'white' : _v,
7940
- aspectRatio = _a.aspectRatio,
7941
- _w = _a.progress,
7942
- progress = _w === void 0 ? 0 : _w,
7938
+ _w = _a.aspectRatio,
7939
+ aspectRatio = _w === void 0 ? 1 : _w,
7940
+ _x = _a.progress,
7941
+ progress = _x === void 0 ? 0 : _x,
7943
7942
  props = __rest(_a, ["children", "status", "borderWidth", "borderRadius", "borderColor", "aspectRatio", "progress"]);
7944
- var _x = useResizeObserver(),
7945
- ref = _x.ref,
7946
- _y = _x.width,
7947
- width = _y === void 0 ? 0 : _y,
7948
- _z = _x.height,
7949
- height = _z === void 0 ? 0 : _z;
7950
- var _0 = useState(0),
7951
- progressResets = _0[0],
7952
- setProgressResets = _0[1];
7943
+ var _y = useResizeObserver(),
7944
+ ref = _y.ref,
7945
+ _z = _y.width,
7946
+ width = _z === void 0 ? 0 : _z,
7947
+ _0 = _y.height,
7948
+ height = _0 === void 0 ? 0 : _0;
7949
+ var _1 = useState(0),
7950
+ progressResets = _1[0],
7951
+ setProgressResets = _1[1];
7953
7952
  useEffect(function () {
7954
7953
  if (progress === 0 && status === 'capturing') {
7955
7954
  setProgressResets(function (n) {
@@ -7963,11 +7962,17 @@ function IdCardBorder(_a) {
7963
7962
  var progressBarColor = (_k = (_j = (_h = theme.idCapture) === null || _h === void 0 ? void 0 : _h.guideBox) === null || _j === void 0 ? void 0 : _j.progressBarColor) !== null && _k !== void 0 ? _k : borderColor;
7964
7963
  var progressBarIndicatorColor = (_o = (_m = (_l = theme.idCapture) === null || _l === void 0 ? void 0 : _l.guideBox) === null || _m === void 0 ? void 0 : _m.progressBarIndicatorColor) !== null && _o !== void 0 ? _o : '#287ec6';
7965
7964
  var progressBarWidth = (_r = (_q = (_p = theme.idCapture) === null || _p === void 0 ? void 0 : _p.guideBox) === null || _q === void 0 ? void 0 : _q.progressBarWidth) !== null && _r !== void 0 ? _r : borderWidth;
7966
- return /*#__PURE__*/React__default.createElement(IdCardBorderContainer, _assign({}, props), /*#__PURE__*/React__default.createElement("div", {
7965
+ return /*#__PURE__*/React__default.createElement(IdCardBorderContainer, _assign({}, props, {
7966
+ style: {
7967
+ aspectRatio: aspectRatio
7968
+ }
7969
+ }), /*#__PURE__*/React__default.createElement("div", {
7967
7970
  ref: ref,
7968
7971
  style: {
7969
- aspectRatio: aspectRatio,
7970
- flex: 1
7972
+ maxHeight: '100%',
7973
+ maxWidth: '100%',
7974
+ display: 'flex',
7975
+ aspectRatio: aspectRatio
7971
7976
  }
7972
7977
  }, children), status === 'ready' && !wavesDisabled && ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IdCardBorderSvg, {
7973
7978
  width: width,
@@ -8066,7 +8071,7 @@ function IdCardBorderSvg(_a) {
8066
8071
  className: isProgressBar ? "idmSdkProgressBorder ".concat(progressPaused ? 'idmSdkProgressPaused' : '') : ''
8067
8072
  }));
8068
8073
  }
8069
- var IdCardBorderContainer = styled.div(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n & > .idmSdkWaves {\n position: absolute;\n animation: ", " 2s ease-out infinite;\n transform-style: preserve-3d;\n\n &:nth-child(2) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(3) {\n animation-delay: 1.33s;\n }\n }\n"], ["\n & > .idmSdkWaves {\n position: absolute;\n animation: ", " 2s ease-out infinite;\n transform-style: preserve-3d;\n\n &:nth-child(2) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(3) {\n animation-delay: 1.33s;\n }\n }\n"])), wavesAnimation);
8074
+ var IdCardBorderContainer = styled.div(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n max-width: 100%;\n max-height: 100%;\n\n & > .idmSdkWaves {\n position: absolute;\n animation: ", " 2s ease-out infinite;\n transform-style: preserve-3d;\n\n &:nth-child(2) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(3) {\n animation-delay: 1.33s;\n }\n }\n"], ["\n max-width: 100%;\n max-height: 100%;\n\n & > .idmSdkWaves {\n position: absolute;\n animation: ", " 2s ease-out infinite;\n transform-style: preserve-3d;\n\n &:nth-child(2) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(3) {\n animation-delay: 1.33s;\n }\n }\n"])), wavesAnimation);
8070
8075
  var SvgOverlay = styled.svg(templateObject_4$e || (templateObject_4$e = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n"])));
8071
8076
  var IdCardBorderRect = styled.rect(templateObject_5$a || (templateObject_5$a = __makeTemplateObject(["\n &.idmSdkProgressBorder {\n animation: ", " ", "\n ", ";\n }\n\n &.idmSdkProgressPaused {\n animation-play-state: paused;\n }\n"], ["\n &.idmSdkProgressBorder {\n animation: ", " ", "\n ", ";\n }\n\n &.idmSdkProgressPaused {\n animation-play-state: paused;\n }\n"])), progressBorderAnimation, function (props) {
8072
8077
  var _a;
@@ -8258,65 +8263,6 @@ var FlipImageContainer = styled(IdCardGuideImageContainer)(templateObject_1$z ||
8258
8263
  });
8259
8264
  var templateObject_1$z;
8260
8265
 
8261
- var GuideOrientationContext = /*#__PURE__*/createContext({
8262
- orientation: 'landscape',
8263
- wrapperWidth: 1,
8264
- wrapperHeight: 1,
8265
- wrapperAspectRatio: 0,
8266
- imageAspectRatio: 0,
8267
- wrapperRef: null,
8268
- setDimensions: function setDimensions() {
8269
- return null;
8270
- },
8271
- onImageLoaded: function onImageLoaded() {
8272
- return null;
8273
- }
8274
- });
8275
- function GuideOrientationContextProvider(_a) {
8276
- var children = _a.children;
8277
- var setDimensions = useState({
8278
- width: 1,
8279
- height: 1
8280
- })[1];
8281
- var _b = useState(1),
8282
- imageAspectRatio = _b[0],
8283
- setImageAspectRatio = _b[1];
8284
- var _c = useResizeObserver(),
8285
- wrapperRef = _c.ref,
8286
- _d = _c.width,
8287
- wrapperWidth = _d === void 0 ? 1 : _d,
8288
- _e = _c.height,
8289
- wrapperHeight = _e === void 0 ? 1 : _e;
8290
- var wrapperAspectRatio = useMemo(function () {
8291
- return wrapperWidth / wrapperHeight;
8292
- }, [wrapperHeight, wrapperWidth]);
8293
- var onImageLoaded = useCallback(function (e) {
8294
- var img = e.target;
8295
- setImageAspectRatio(img.naturalWidth / img.naturalHeight);
8296
- }, []);
8297
- var orientation = 'landscape'; //width > height ? 'landscape' : 'portrait'
8298
- var value = useMemo(function () {
8299
- return {
8300
- orientation: orientation,
8301
- wrapperWidth: wrapperWidth,
8302
- wrapperHeight: wrapperHeight,
8303
- wrapperAspectRatio: wrapperAspectRatio,
8304
- imageAspectRatio: imageAspectRatio,
8305
- setDimensions: setDimensions,
8306
- wrapperRef: wrapperRef,
8307
- onImageLoaded: onImageLoaded
8308
- };
8309
- }, [imageAspectRatio, onImageLoaded, setDimensions, wrapperAspectRatio, wrapperHeight, wrapperRef, wrapperWidth]);
8310
- return /*#__PURE__*/React__default.createElement(GuideOrientationContext.Provider, {
8311
- value: value
8312
- }, children);
8313
- }
8314
- function useGuideOrientationContext() {
8315
- var ctx = useContext(GuideOrientationContext);
8316
- if (!ctx) throw new Error('useGuideOrientationContext cannot be used without GuideOrientationContextProvider');
8317
- return ctx;
8318
- }
8319
-
8320
8266
  var FlipIdPrompt = function FlipIdPrompt(_a) {
8321
8267
  var _b = _a.images,
8322
8268
  images = _b === void 0 ? defaultIdCaptureGuideImages : _b,
@@ -8334,7 +8280,6 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
8334
8280
  portraitGuidesOnMobile = _g === void 0 ? true : _g,
8335
8281
  _h = _a.classNames,
8336
8282
  classNames = _h === void 0 ? {} : _h;
8337
- var onImageLoaded = useGuideOrientationContext().onImageLoaded;
8338
8283
  var orientation = getOrientation(portraitGuidesOnMobile);
8339
8284
  var _j = useState(1),
8340
8285
  transitionTime = _j[0],
@@ -8376,7 +8321,6 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
8376
8321
  alt: "",
8377
8322
  src: images[orientation].SHOW_ID_FRONT.url,
8378
8323
  className: classNames.frontImage,
8379
- onLoad: onImageLoaded,
8380
8324
  width: width,
8381
8325
  height: height
8382
8326
  })), /*#__PURE__*/React__default.createElement(FlipImageContainer, {
@@ -8397,86 +8341,114 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
8397
8341
  })));
8398
8342
  };
8399
8343
 
8344
+ var GuideOrientationContext = /*#__PURE__*/createContext({
8345
+ orientation: 'landscape',
8346
+ wrapperWidth: 1,
8347
+ wrapperHeight: 1,
8348
+ wrapperAspectRatio: 0,
8349
+ imageAspectRatio: 0,
8350
+ wrapperRef: null,
8351
+ setImageAspectRatio: function setImageAspectRatio() {
8352
+ return null;
8353
+ }
8354
+ });
8355
+ function GuideOrientationContextProvider(_a) {
8356
+ var children = _a.children;
8357
+ var _b = useState(1),
8358
+ imageAspectRatio = _b[0],
8359
+ setImageAspectRatio = _b[1];
8360
+ var _c = useResizeObserver(),
8361
+ wrapperRef = _c.ref,
8362
+ _d = _c.width,
8363
+ wrapperWidth = _d === void 0 ? 1 : _d,
8364
+ _e = _c.height,
8365
+ wrapperHeight = _e === void 0 ? 1 : _e;
8366
+ var wrapperAspectRatio = useMemo(function () {
8367
+ return wrapperWidth / wrapperHeight;
8368
+ }, [wrapperHeight, wrapperWidth]);
8369
+ var orientation = 'landscape'; //width > height ? 'landscape' : 'portrait'
8370
+ var value = useMemo(function () {
8371
+ return {
8372
+ orientation: orientation,
8373
+ wrapperWidth: wrapperWidth,
8374
+ wrapperHeight: wrapperHeight,
8375
+ wrapperAspectRatio: wrapperAspectRatio,
8376
+ imageAspectRatio: imageAspectRatio,
8377
+ setImageAspectRatio: setImageAspectRatio,
8378
+ wrapperRef: wrapperRef
8379
+ };
8380
+ }, [imageAspectRatio, wrapperAspectRatio, wrapperHeight, wrapperRef, wrapperWidth]);
8381
+ return /*#__PURE__*/React__default.createElement(GuideOrientationContext.Provider, {
8382
+ value: value
8383
+ }, children);
8384
+ }
8385
+ function useGuideOrientationContext() {
8386
+ var ctx = useContext(GuideOrientationContext);
8387
+ if (!ctx) throw new Error('useGuideOrientationContext cannot be used without GuideOrientationContextProvider');
8388
+ return ctx;
8389
+ }
8390
+
8400
8391
  var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8401
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
8402
- var _p = _a.classNames,
8403
- classNames = _p === void 0 ? {} : _p,
8404
- _q = _a.images,
8405
- userSuppliedImages = _q === void 0 ? defaultIdCaptureGuideImages : _q,
8392
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
8393
+ var _s = _a.classNames,
8394
+ classNames = _s === void 0 ? {} : _s,
8395
+ _t = _a.images,
8396
+ userSuppliedImages = _t === void 0 ? defaultIdCaptureGuideImages : _t,
8406
8397
  userSuppliedPadding = _a.padding,
8407
8398
  userSuppliedImagePadding = _a.imagePadding,
8408
- _r = _a.imageVisible,
8409
- imageVisible = _r === void 0 ? true : _r,
8399
+ _u = _a.imageVisible,
8400
+ imageVisible = _u === void 0 ? true : _u,
8410
8401
  borderWidth = _a.borderWidth,
8411
8402
  borderColor = _a.borderColor,
8412
- _s = _a.idCardBorderWidth,
8413
- idCardBorderWidth = _s === void 0 ? '2.5%' : _s,
8414
- _t = _a.idCardBorderColor,
8415
- idCardBorderColor = _t === void 0 ? 'white' : _t,
8403
+ _v = _a.idCardBorderWidth,
8404
+ idCardBorderWidth = _v === void 0 ? '2.5%' : _v,
8405
+ _w = _a.idCardBorderColor,
8406
+ idCardBorderColor = _w === void 0 ? 'white' : _w,
8416
8407
  maskColor = _a.maskColor,
8417
- _u = _a.isMirrored,
8418
- isMirrored = _u === void 0 ? false : _u,
8419
- _v = _a.isBackToFront,
8420
- isBackToFront = _v === void 0 ? false : _v,
8421
- _w = _a.portraitGuidesOnMobile,
8422
- portraitGuidesOnMobile = _w === void 0 ? true : _w,
8423
- _x = _a.instruction,
8424
- instruction = _x === void 0 ? '' : _x,
8425
- _y = _a.requestedAction,
8426
- requestedAction = _y === void 0 ? 'SHOW_ID_FRONT' : _y,
8427
- _z = _a.progress,
8428
- progress = _z === void 0 ? 0 : _z,
8429
- _0 = _a.status,
8430
- status = _0 === void 0 ? 'ready' : _0,
8408
+ _x = _a.isMirrored,
8409
+ isMirrored = _x === void 0 ? false : _x,
8410
+ _y = _a.isBackToFront,
8411
+ isBackToFront = _y === void 0 ? false : _y,
8412
+ _z = _a.portraitGuidesOnMobile,
8413
+ portraitGuidesOnMobile = _z === void 0 ? true : _z,
8414
+ _0 = _a.instruction,
8415
+ instruction = _0 === void 0 ? '' : _0,
8416
+ _1 = _a.requestedAction,
8417
+ requestedAction = _1 === void 0 ? 'SHOW_ID_FRONT' : _1,
8418
+ _2 = _a.progress,
8419
+ progress = _2 === void 0 ? 0 : _2,
8420
+ _3 = _a.status,
8421
+ status = _3 === void 0 ? 'ready' : _3,
8431
8422
  onClick = _a.onClick;
8432
- var _1 = useGuideOrientationContext(),
8433
- wrapperRef = _1.wrapperRef,
8434
- wrapperWidth = _1.wrapperWidth,
8435
- wrapperHeight = _1.wrapperHeight,
8436
- imageAspectRatio = _1.imageAspectRatio,
8437
- wrapperAspectRatio = _1.wrapperAspectRatio,
8438
- guideOrientationOnImageLoaded = _1.onImageLoaded,
8439
- setDimensions = _1.setDimensions;
8440
- var state = useIdCaptureStore();
8423
+ var _4 = useGuideOrientationContext(),
8424
+ wrapperRef = _4.wrapperRef,
8425
+ wrapperWidth = _4.wrapperWidth,
8426
+ imageAspectRatio = _4.imageAspectRatio,
8427
+ wrapperAspectRatio = _4.wrapperAspectRatio,
8428
+ setImageAspectRatio = _4.setImageAspectRatio;
8429
+ var _5 = useResizeObserver(),
8430
+ innerRef = _5.ref,
8431
+ innerWidth = _5.width,
8432
+ innerHeight = _5.height;
8441
8433
  var theme = useTheme();
8442
8434
  if (borderWidth === undefined) borderWidth = (_d = (_c = (_b = theme.idCapture) === null || _b === void 0 ? void 0 : _b.guideBox) === null || _c === void 0 ? void 0 : _c.borderWidth) !== null && _d !== void 0 ? _d : 4;
8443
- useEffect(function () {
8444
- setDimensions({
8445
- width: wrapperWidth,
8446
- height: wrapperHeight
8447
- });
8448
- }, [setDimensions, wrapperHeight, wrapperWidth]);
8449
8435
  var padding = userSuppliedPadding !== null && userSuppliedPadding !== void 0 ? userSuppliedPadding : isMobile() ? (_g = (_f = (_e = theme.idCapture) === null || _e === void 0 ? void 0 : _e.guideBox) === null || _f === void 0 ? void 0 : _f.mobilePadding) !== null && _g !== void 0 ? _g : 0 : (_k = (_j = (_h = theme.idCapture) === null || _h === void 0 ? void 0 : _h.guideBox) === null || _j === void 0 ? void 0 : _j.desktopPadding) !== null && _k !== void 0 ? _k : 50;
8450
8436
  var paddingAndBorderPx = padding * 2 + (borderWidth !== null && borderWidth !== void 0 ? borderWidth : 0) * 2;
8451
8437
  var images = useImagesWithBackToFront(userSuppliedImages, isBackToFront);
8452
- var imagesByUrl = useGuideImagesByUrl(images);
8453
8438
  var orientation = getOrientation(portraitGuidesOnMobile);
8454
8439
  var currentImage = images[orientation][requestedAction === 'FLIP_ID' ? 'SHOW_ID_FRONT' : requestedAction];
8455
- var imagePadding = (_o = userSuppliedImagePadding !== null && userSuppliedImagePadding !== void 0 ? userSuppliedImagePadding : (_m = (_l = theme.idCapture) === null || _l === void 0 ? void 0 : _l.guideBox) === null || _m === void 0 ? void 0 : _m.imagePadding) !== null && _o !== void 0 ? _o : '0 50px';
8456
- if (typeof imagePadding === 'number') {
8457
- imagePadding = "".concat(imagePadding, "px");
8458
- }
8459
- var paddingForMath = imagePadding.replace(/[^0-9\s]/g, '').split(' ').map(Number);
8460
- var paddingForMathMax = Math.max.apply(Math, paddingForMath);
8461
- var imageWidth = state.guideRectWidth - paddingForMathMax * 2;
8462
- var imageHeight = state.guideRectHeight - paddingForMathMax * 2;
8440
+ var imagePadding = userSuppliedImagePadding !== null && userSuppliedImagePadding !== void 0 ? userSuppliedImagePadding : isMobile() ? (_o = (_m = (_l = theme.idCapture) === null || _l === void 0 ? void 0 : _l.guideBox) === null || _m === void 0 ? void 0 : _m.mobileImagePadding) !== null && _o !== void 0 ? _o : 0 : (_r = (_q = (_p = theme.idCapture) === null || _p === void 0 ? void 0 : _p.guideBox) === null || _q === void 0 ? void 0 : _q.imagePadding) !== null && _r !== void 0 ? _r : 50;
8463
8441
  var centerRegionMinWidth = imageAspectRatio >= wrapperAspectRatio ? wrapperWidth - paddingAndBorderPx : undefined;
8464
- var cardAspectRatio = imageAspectRatio > 1 ? '1.6' : '0.625';
8465
- var onImageLoaded = useCallback(function (e) {
8466
- var _a, _b;
8467
- guideOrientationOnImageLoaded(e);
8468
- var img = e.currentTarget;
8469
- var imageByUrl = imagesByUrl[img.src];
8470
- var width = (_a = imageByUrl === null || imageByUrl === void 0 ? void 0 : imageByUrl.width) !== null && _a !== void 0 ? _a : img.naturalWidth;
8471
- var height = (_b = imageByUrl === null || imageByUrl === void 0 ? void 0 : imageByUrl.height) !== null && _b !== void 0 ? _b : img.naturalHeight;
8442
+ function onImageLoaded() {
8443
+ setImageAspectRatio(currentImage.width / currentImage.height);
8472
8444
  dispatchIdCaptureAction({
8473
8445
  type: 'guideImageLoaded',
8474
8446
  payload: {
8475
- width: width,
8476
- height: height
8447
+ width: currentImage.width,
8448
+ height: currentImage.height
8477
8449
  }
8478
8450
  });
8479
- }, [guideOrientationOnImageLoaded, imagesByUrl]);
8451
+ }
8480
8452
  return /*#__PURE__*/React__default.createElement(StyledPageContainer, {
8481
8453
  ref: wrapperRef,
8482
8454
  onClick: onClick,
@@ -8505,14 +8477,19 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8505
8477
  "$padding": imagePadding,
8506
8478
  className: classNames.centerRegionBorder
8507
8479
  }, /*#__PURE__*/React__default.createElement(GuideCenterInner, {
8508
- className: classNames.centerRegionInner
8480
+ "$isLandscape": orientation === 'landscape',
8481
+ ref: innerRef,
8482
+ className: classNames.centerRegionInner,
8483
+ style: {
8484
+ aspectRatio: imageAspectRatio
8485
+ }
8509
8486
  }, /*#__PURE__*/React__default.createElement(IdCardGuideImageContainer, {
8510
8487
  status: status,
8511
8488
  progress: progress,
8512
8489
  borderWidth: idCardBorderWidth,
8513
8490
  borderColor: idCardBorderColor,
8514
8491
  "$isVisible": requestedAction !== 'FLIP_ID',
8515
- "$aspectRatio": cardAspectRatio
8492
+ aspectRatio: imageAspectRatio
8516
8493
  }, /*#__PURE__*/React__default.createElement(IdCardGuideImage, {
8517
8494
  alt: "",
8518
8495
  src: currentImage.url,
@@ -8520,8 +8497,8 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8520
8497
  className: classNames.image,
8521
8498
  "$isInvisible": !imageVisible,
8522
8499
  "$isMirrored": isMirrored,
8523
- width: imageWidth,
8524
- height: imageHeight
8500
+ width: innerWidth || currentImage.width,
8501
+ height: innerHeight || currentImage.height
8525
8502
  })), requestedAction === 'FLIP_ID' && ( /*#__PURE__*/React__default.createElement(FlipIdPrompt, {
8526
8503
  images: images,
8527
8504
  borderWidth: idCardBorderWidth,
@@ -8529,8 +8506,8 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8529
8506
  portraitGuidesOnMobile: portraitGuidesOnMobile,
8530
8507
  isMirrored: isMirrored,
8531
8508
  classNames: classNames.flipIdPrompt,
8532
- width: imageWidth,
8533
- height: imageHeight
8509
+ width: currentImage.width,
8510
+ height: currentImage.height
8534
8511
  }))))), /*#__PURE__*/React__default.createElement(Spacer, {
8535
8512
  "$maskColor": maskColor,
8536
8513
  "$minWidth": padding,
@@ -8570,14 +8547,16 @@ var GuideCenterRegion = styled.div(templateObject_6$6 || (templateObject_6$6 = _
8570
8547
  }, function (props) {
8571
8548
  return props.$isMirrored ? 'transform: scaleX(-1);' : '';
8572
8549
  });
8573
- var GuideCenterBorder = styled.div(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject(["\n box-sizing: border-box;\n border: ", ";\n display: flex;\n flex: 1;\n justify-content: center;\n max-height: 100%;\n min-height: 0;\n position: relative;\n ", "\n"], ["\n box-sizing: border-box;\n border: ", ";\n display: flex;\n flex: 1;\n justify-content: center;\n max-height: 100%;\n min-height: 0;\n position: relative;\n ", "\n"])), function (props) {
8550
+ var GuideCenterBorder = styled.div(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject(["\n box-sizing: border-box;\n border: ", ";\n display: flex;\n flex: 1;\n justify-content: center;\n max-height: 100%;\n min-height: 0;\n max-width: 100%;\n position: relative;\n ", "\n"], ["\n box-sizing: border-box;\n border: ", ";\n display: flex;\n flex: 1;\n justify-content: center;\n max-height: 100%;\n min-height: 0;\n max-width: 100%;\n position: relative;\n ", "\n"])), function (props) {
8574
8551
  var _a, _b;
8575
8552
  return "".concat((_a = props.$borderWidth) !== null && _a !== void 0 ? _a : 4, "px solid ").concat((_b = props.$borderColor) !== null && _b !== void 0 ? _b : 'white');
8576
8553
  }, function (props) {
8577
- return props.$padding ? "padding: ".concat(props.$padding, ";") : '';
8554
+ return props.$padding ? "padding: ".concat(props.$padding, "px;") : '';
8578
8555
  });
8579
8556
  var GuideText = styled.span(templateObject_8$2 || (templateObject_8$2 = __makeTemplateObject(["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"], ["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"])));
8580
- var GuideCenterInner = styled.div(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject(["\n position: relative;\n margin: auto;\n"], ["\n position: relative;\n margin: auto;\n"])));
8557
+ var GuideCenterInner = styled.div(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject(["\n position: relative;\n margin: auto;\n ", "\n max-height: 100%;\n max-width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n position: relative;\n margin: auto;\n ", "\n max-height: 100%;\n max-width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (props) {
8558
+ return props.$isLandscape ? 'height: 100%;' : 'width: 90%;';
8559
+ });
8581
8560
  var templateObject_1$y, templateObject_2$s, templateObject_3$j, templateObject_4$d, templateObject_5$9, templateObject_6$6, templateObject_7$4, templateObject_8$2, templateObject_9$2;
8582
8561
 
8583
8562
  var IdCaptureFitGuide = function IdCaptureFitGuide(_a) {
@@ -15710,7 +15689,8 @@ var defaultTheme = {
15710
15689
  borderWidth: 4,
15711
15690
  desktopPadding: 50,
15712
15691
  mobilePadding: 0,
15713
- imagePadding: '0 50px',
15692
+ imagePadding: 50,
15693
+ mobileImagePadding: 0,
15714
15694
  wavesDisabled: false,
15715
15695
  wavesColor: '#287ec6',
15716
15696
  progressBarColor: 'white',