idmission-web-sdk 2.3.98 → 2.3.100

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.
@@ -4,6 +4,7 @@
4
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
5
  })(this, (function (exports, React, ReactDOM, platform, styled, reactDom, tusJsClient, require$$0, server) { 'use strict';
6
6
 
7
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
8
  function _interopNamespaceDefault(e) {
8
9
  var n = Object.create(null);
9
10
  if (e) {
@@ -211,7 +212,7 @@
211
212
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
213
  };
213
214
 
214
- var webSdkVersion = '2.3.98';
215
+ var webSdkVersion = '2.3.100';
215
216
 
216
217
  function getPlatform() {
217
218
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -3615,9 +3616,9 @@
3615
3616
  }
3616
3617
  var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
3617
3618
 
3618
- function _createForOfIteratorHelperLoose$2(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$2(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."); }
3619
- function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(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$2(r, a) : void 0; } }
3620
- function _arrayLikeToArray$2(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; }
3619
+ function _createForOfIteratorHelperLoose$3(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$3(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."); }
3620
+ function _unsupportedIterableToArray$3(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$3(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$3(r, a) : void 0; } }
3621
+ function _arrayLikeToArray$3(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; }
3621
3622
  var t = self;
3622
3623
  function e() {
3623
3624
  throw Error("Invalid UTF8");
@@ -5844,7 +5845,7 @@
5844
5845
  height: (_hn4 = hn(e, 4)) != null ? _hn4 : 0,
5845
5846
  angle: 0
5846
5847
  }), (_en2 = en$1(t, ws, 4)) != null && _en2.g().length) {
5847
- for (var _iterator = _createForOfIteratorHelperLoose$2(en$1(t, ws, 4).g()), _step; !(_step = _iterator()).done;) {
5848
+ for (var _iterator = _createForOfIteratorHelperLoose$3(en$1(t, ws, 4).g()), _step; !(_step = _iterator()).done;) {
5848
5849
  var _We, _We2, _We3, _un3;
5849
5850
  var _e16 = _step.value;
5850
5851
  i.keypoints.push({
@@ -5859,7 +5860,7 @@
5859
5860
  }
5860
5861
  function Qi(t) {
5861
5862
  var e = [];
5862
- for (var _iterator2 = _createForOfIteratorHelperLoose$2(rn(t, Fs, 1)), _step2; !(_step2 = _iterator2()).done;) {
5863
+ for (var _iterator2 = _createForOfIteratorHelperLoose$3(rn(t, Fs, 1)), _step2; !(_step2 = _iterator2()).done;) {
5863
5864
  var _fn2, _fn3, _fn4;
5864
5865
  var _n14 = _step2.value;
5865
5866
  e.push({
@@ -5872,7 +5873,7 @@
5872
5873
  }
5873
5874
  function to(t) {
5874
5875
  var e = [];
5875
- for (var _iterator3 = _createForOfIteratorHelperLoose$2(rn(t, Ts, 1)), _step3; !(_step3 = _iterator3()).done;) {
5876
+ for (var _iterator3 = _createForOfIteratorHelperLoose$3(rn(t, Ts, 1)), _step3; !(_step3 = _iterator3()).done;) {
5876
5877
  var _fn5, _fn6, _fn7;
5877
5878
  var _n15 = _step3.value;
5878
5879
  e.push({
@@ -6020,7 +6021,7 @@
6020
6021
  var r = new Uint32Array(e.length);
6021
6022
  for (var _n16 = 0; _n16 < e.length; _n16++) r[_n16] = t.i.stringToNewUTF8(e[_n16]);
6022
6023
  e = t.i._malloc(4 * r.length), t.i.HEAPU32.set(r, e >> 2), n(e);
6023
- for (var _iterator4 = _createForOfIteratorHelperLoose$2(r), _step4; !(_step4 = _iterator4()).done;) {
6024
+ for (var _iterator4 = _createForOfIteratorHelperLoose$3(r), _step4; !(_step4 = _iterator4()).done;) {
6024
6025
  var _e17 = _step4.value;
6025
6026
  t.i._free(_e17);
6026
6027
  }
@@ -6386,7 +6387,7 @@
6386
6387
  }
6387
6388
  t.push(n);
6388
6389
  };
6389
- for (var _iterator7 = _createForOfIteratorHelperLoose$2(this.g), _step7; !(_step7 = _iterator7()).done;) {
6390
+ for (var _iterator7 = _createForOfIteratorHelperLoose$3(this.g), _step7; !(_step7 = _iterator7()).done;) {
6390
6391
  _loop();
6391
6392
  }
6392
6393
  return new _Yo(t, this.ba(), this.K(), this.canvas, this.l, this.width, this.height);
@@ -6518,7 +6519,7 @@
6518
6519
  }
6519
6520
  t.push(n);
6520
6521
  };
6521
- for (var _iterator8 = _createForOfIteratorHelperLoose$2(this.g), _step8; !(_step8 = _iterator8()).done;) {
6522
+ for (var _iterator8 = _createForOfIteratorHelperLoose$3(this.g), _step8; !(_step8 = _iterator8()).done;) {
6522
6523
  _loop2();
6523
6524
  }
6524
6525
  return new _ia(t, this.K(), this.canvas, this.l, this.width, this.height);
@@ -6998,7 +6999,7 @@
6998
6999
  yn(e, si, this.h);
6999
7000
  var n = new qr();
7000
7001
  Hr(n, "mediapipe.tasks.vision.face_detector.FaceDetectorGraph"), Yr(n, "IMAGE:image_in"), Yr(n, "NORM_RECT:norm_rect_in"), $r(n, "DETECTIONS:detections"), n.o(e), es$1(t, n), this.g.attachProtoVectorListener("detections", function (t, e) {
7001
- for (var _iterator9 = _createForOfIteratorHelperLoose$2(t), _step9; !(_step9 = _iterator9()).done;) {
7002
+ for (var _iterator9 = _createForOfIteratorHelperLoose$3(t), _step9; !(_step9 = _iterator9()).done;) {
7002
7003
  var _e23 = _step9.value;
7003
7004
  t = Es(_e23), _this43.j.detections.push(Zi(t));
7004
7005
  }
@@ -7092,7 +7093,7 @@
7092
7093
  yn(e, di, this.h);
7093
7094
  var n = new qr();
7094
7095
  Hr(n, "mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"), Yr(n, "IMAGE:image_in"), Yr(n, "NORM_RECT:norm_rect"), $r(n, "NORM_LANDMARKS:face_landmarks"), n.o(e), es$1(t, n), this.g.attachProtoVectorListener("face_landmarks", function (t, e) {
7095
- for (var _iterator10 = _createForOfIteratorHelperLoose$2(t), _step10; !(_step10 = _iterator10()).done;) {
7096
+ for (var _iterator10 = _createForOfIteratorHelperLoose$3(t), _step10; !(_step10 = _iterator10()).done;) {
7096
7097
  var _e24 = _step10.value;
7097
7098
  t = Ms(_e24), _this45.j.faceLandmarks.push(Qi(t));
7098
7099
  }
@@ -7101,7 +7102,7 @@
7101
7102
  _o(_this45, t);
7102
7103
  }), this.outputFaceBlendshapes && (rs(t, "blendshapes"), $r(n, "BLENDSHAPES:blendshapes"), this.g.attachProtoVectorListener("blendshapes", function (t, e) {
7103
7104
  if (_this45.outputFaceBlendshapes) {
7104
- for (var _iterator11 = _createForOfIteratorHelperLoose$2(t), _step11; !(_step11 = _iterator11()).done;) {
7105
+ for (var _iterator11 = _createForOfIteratorHelperLoose$3(t), _step11; !(_step11 = _iterator11()).done;) {
7105
7106
  var _t$g;
7106
7107
  var _e25 = _step11.value;
7107
7108
  t = fs(_e25), _this45.j.faceBlendshapes.push(Ji((_t$g = t.g()) != null ? _t$g : []));
@@ -7112,7 +7113,7 @@
7112
7113
  _o(_this45, t);
7113
7114
  })), this.outputFacialTransformationMatrixes && (rs(t, "face_geometry"), $r(n, "FACE_GEOMETRY:face_geometry"), this.g.attachProtoVectorListener("face_geometry", function (t, e) {
7114
7115
  if (_this45.outputFacialTransformationMatrixes) {
7115
- for (var _iterator12 = _createForOfIteratorHelperLoose$2(t), _step12; !(_step12 = _iterator12()).done;) {
7116
+ for (var _iterator12 = _createForOfIteratorHelperLoose$3(t), _step12; !(_step12 = _iterator12()).done;) {
7116
7117
  var _ln2, _ln3, _He;
7117
7118
  var _e26 = _step12.value;
7118
7119
  (t = en$1(ai(_e26), Ps, 2)) && _this45.j.facialTransformationMatrixes.push({
@@ -7243,11 +7244,11 @@
7243
7244
  e = !0;
7244
7245
  }
7245
7246
  var n = [];
7246
- for (var _iterator13 = _createForOfIteratorHelperLoose$2(t), _step13; !(_step13 = _iterator13()).done;) {
7247
+ for (var _iterator13 = _createForOfIteratorHelperLoose$3(t), _step13; !(_step13 = _iterator13()).done;) {
7247
7248
  var _s9 = _step13.value;
7248
7249
  var r = fs(_s9);
7249
7250
  t = [];
7250
- for (var _iterator14 = _createForOfIteratorHelperLoose$2(r.g()), _step14; !(_step14 = _iterator14()).done;) {
7251
+ for (var _iterator14 = _createForOfIteratorHelperLoose$3(r.g()), _step14; !(_step14 = _iterator14()).done;) {
7251
7252
  var _fn8, _ref9, _un4, _ref10, _un5;
7252
7253
  var _n24 = _step14.value;
7253
7254
  r = e && null != hn(_n24, 1) ? ln(hn(_n24, 1)) : -1, t.push({
@@ -7293,11 +7294,11 @@
7293
7294
  yn(e, Oi, this.v);
7294
7295
  var n = new qr();
7295
7296
  Hr(n, "mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"), Yr(n, "IMAGE:image_in"), Yr(n, "NORM_RECT:norm_rect"), $r(n, "HAND_GESTURES:hand_gestures"), $r(n, "LANDMARKS:hand_landmarks"), $r(n, "WORLD_LANDMARKS:world_hand_landmarks"), $r(n, "HANDEDNESS:handedness"), n.o(e), es$1(t, n), this.g.attachProtoVectorListener("hand_landmarks", function (t, e) {
7296
- for (var _iterator15 = _createForOfIteratorHelperLoose$2(t), _step15; !(_step15 = _iterator15()).done;) {
7297
+ for (var _iterator15 = _createForOfIteratorHelperLoose$3(t), _step15; !(_step15 = _iterator15()).done;) {
7297
7298
  var _e28 = _step15.value;
7298
7299
  t = Ms(_e28);
7299
7300
  var _n25 = [];
7300
- for (var _iterator16 = _createForOfIteratorHelperLoose$2(rn(t, Fs, 1)), _step16; !(_step16 = _iterator16()).done;) {
7301
+ for (var _iterator16 = _createForOfIteratorHelperLoose$3(rn(t, Fs, 1)), _step16; !(_step16 = _iterator16()).done;) {
7301
7302
  var _fn9, _fn10, _fn11;
7302
7303
  var _e29 = _step16.value;
7303
7304
  _n25.push({
@@ -7312,11 +7313,11 @@
7312
7313
  }), this.g.attachEmptyPacketListener("hand_landmarks", function (t) {
7313
7314
  _o(_this49, t);
7314
7315
  }), this.g.attachProtoVectorListener("world_hand_landmarks", function (t, e) {
7315
- for (var _iterator17 = _createForOfIteratorHelperLoose$2(t), _step17; !(_step17 = _iterator17()).done;) {
7316
+ for (var _iterator17 = _createForOfIteratorHelperLoose$3(t), _step17; !(_step17 = _iterator17()).done;) {
7316
7317
  var _e30 = _step17.value;
7317
7318
  t = Ls(_e30);
7318
7319
  var _n26 = [];
7319
- for (var _iterator18 = _createForOfIteratorHelperLoose$2(rn(t, Ts, 1)), _step18; !(_step18 = _iterator18()).done;) {
7320
+ for (var _iterator18 = _createForOfIteratorHelperLoose$3(rn(t, Ts, 1)), _step18; !(_step18 = _iterator18()).done;) {
7320
7321
  var _fn12, _fn13, _fn14;
7321
7322
  var _e31 = _step18.value;
7322
7323
  _n26.push({
@@ -7401,7 +7402,7 @@
7401
7402
  yn(e, Si, this.j);
7402
7403
  var n = new qr();
7403
7404
  Hr(n, "mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"), Yr(n, "IMAGE:image_in"), Yr(n, "NORM_RECT:norm_rect"), $r(n, "LANDMARKS:hand_landmarks"), $r(n, "WORLD_LANDMARKS:world_hand_landmarks"), $r(n, "HANDEDNESS:handedness"), n.o(e), es$1(t, n), this.g.attachProtoVectorListener("hand_landmarks", function (t, e) {
7404
- for (var _iterator19 = _createForOfIteratorHelperLoose$2(t), _step19; !(_step19 = _iterator19()).done;) {
7405
+ for (var _iterator19 = _createForOfIteratorHelperLoose$3(t), _step19; !(_step19 = _iterator19()).done;) {
7405
7406
  var _e32 = _step19.value;
7406
7407
  t = Ms(_e32), _this51.landmarks.push(Qi(t));
7407
7408
  }
@@ -7409,7 +7410,7 @@
7409
7410
  }), this.g.attachEmptyPacketListener("hand_landmarks", function (t) {
7410
7411
  _o(_this51, t);
7411
7412
  }), this.g.attachProtoVectorListener("world_hand_landmarks", function (t, e) {
7412
- for (var _iterator20 = _createForOfIteratorHelperLoose$2(t), _step20; !(_step20 = _iterator20()).done;) {
7413
+ for (var _iterator20 = _createForOfIteratorHelperLoose$3(t), _step20; !(_step20 = _iterator20()).done;) {
7413
7414
  var _e33 = _step20.value;
7414
7415
  t = Ls(_e33), _this51.worldLandmarks.push(to(t));
7415
7416
  }
@@ -7420,11 +7421,11 @@
7420
7421
  var n = _this51.handedness,
7421
7422
  r = n.push;
7422
7423
  var s = [];
7423
- for (var _iterator21 = _createForOfIteratorHelperLoose$2(t), _step21; !(_step21 = _iterator21()).done;) {
7424
+ for (var _iterator21 = _createForOfIteratorHelperLoose$3(t), _step21; !(_step21 = _iterator21()).done;) {
7424
7425
  var _e34 = _step21.value;
7425
7426
  t = fs(_e34);
7426
7427
  var _n27 = [];
7427
- for (var _iterator22 = _createForOfIteratorHelperLoose$2(t.g()), _step22; !(_step22 = _iterator22()).done;) {
7428
+ for (var _iterator22 = _createForOfIteratorHelperLoose$3(t.g()), _step22; !(_step22 = _iterator22()).done;) {
7428
7429
  var _fn15, _ln4, _ref11, _un6, _ref12, _un7;
7429
7430
  var _e35 = _step22.value;
7430
7431
  _n27.push({
@@ -7816,7 +7817,7 @@
7816
7817
  dn(a, 3, !0), gn(a, 1, e.keypoint.x), gn(a, 2, e.keypoint.y), on(i, 5, oh, a);
7817
7818
  } else {
7818
7819
  if (!e.scribble) throw Error("Must provide either a keypoint or a scribble.");
7819
- for (var _iterator23 = _createForOfIteratorHelperLoose$2((o = new sh(), e.scribble)), _step23; !(_step23 = _iterator23()).done;) {
7820
+ for (var _iterator23 = _createForOfIteratorHelperLoose$3((o = new sh(), e.scribble)), _step23; !(_step23 = _iterator23()).done;) {
7820
7821
  a = _step23.value;
7821
7822
  dn(e = new nh(), 3, !0), gn(e, 1, a.x), gn(e, 2, a.y), an(o, nh, e);
7822
7823
  }
@@ -7917,7 +7918,7 @@
7917
7918
  yn(e, Vi, this.h);
7918
7919
  var n = new qr();
7919
7920
  Hr(n, "mediapipe.tasks.vision.ObjectDetectorGraph"), Yr(n, "IMAGE:input_frame_gpu"), Yr(n, "NORM_RECT:norm_rect"), $r(n, "DETECTIONS:detections"), n.o(e), es$1(t, n), this.g.attachProtoVectorListener("detections", function (t, e) {
7920
- for (var _iterator24 = _createForOfIteratorHelperLoose$2(t), _step24; !(_step24 = _iterator24()).done;) {
7921
+ for (var _iterator24 = _createForOfIteratorHelperLoose$3(t), _step24; !(_step24 = _iterator24()).done;) {
7921
7922
  var _e37 = _step24.value;
7922
7923
  t = Es(_e37), _this61.j.detections.push(Zi(t));
7923
7924
  }
@@ -8017,7 +8018,7 @@
8017
8018
  var n = new qr();
8018
8019
  Hr(n, "mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"), Yr(n, "IMAGE:image_in"), Yr(n, "NORM_RECT:norm_rect"), $r(n, "NORM_LANDMARKS:normalized_landmarks"), $r(n, "WORLD_LANDMARKS:world_landmarks"), n.o(e), es$1(t, n), wo(this, t), this.g.attachProtoVectorListener("normalized_landmarks", function (t, e) {
8019
8020
  _this63.landmarks = [];
8020
- for (var _iterator25 = _createForOfIteratorHelperLoose$2(t), _step25; !(_step25 = _iterator25()).done;) {
8021
+ for (var _iterator25 = _createForOfIteratorHelperLoose$3(t), _step25; !(_step25 = _iterator25()).done;) {
8021
8022
  var _e39 = _step25.value;
8022
8023
  t = Ms(_e39), _this63.landmarks.push(Qi(t));
8023
8024
  }
@@ -8026,7 +8027,7 @@
8026
8027
  _this63.landmarks = [], _o(_this63, t);
8027
8028
  }), this.g.attachProtoVectorListener("world_landmarks", function (t, e) {
8028
8029
  _this63.worldLandmarks = [];
8029
- for (var _iterator26 = _createForOfIteratorHelperLoose$2(t), _step26; !(_step26 = _iterator26()).done;) {
8030
+ for (var _iterator26 = _createForOfIteratorHelperLoose$3(t), _step26; !(_step26 = _iterator26()).done;) {
8030
8031
  var _e40 = _step26.value;
8031
8032
  t = Ls(_e40), _this63.worldLandmarks.push(to(t));
8032
8033
  }
@@ -9504,9 +9505,9 @@
9504
9505
  return e;
9505
9506
  }
9506
9507
 
9507
- function _createForOfIteratorHelperLoose$1(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$1(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."); }
9508
- function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(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$1(r, a) : void 0; } }
9509
- function _arrayLikeToArray$1(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; }
9508
+ function _createForOfIteratorHelperLoose$2(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$2(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."); }
9509
+ function _unsupportedIterableToArray$2(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$2(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$2(r, a) : void 0; } }
9510
+ function _arrayLikeToArray$2(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; }
9510
9511
  var consoleLogger = {
9511
9512
  type: 'logger',
9512
9513
  log: function log(args) {
@@ -10353,7 +10354,7 @@
10353
10354
  }
10354
10355
  if (!useOptionsReplaceForData) {
10355
10356
  data = _extends({}, data);
10356
- for (var _iterator = _createForOfIteratorHelperLoose$1(optionsKeys), _step; !(_step = _iterator()).done;) {
10357
+ for (var _iterator = _createForOfIteratorHelperLoose$2(optionsKeys), _step; !(_step = _iterator()).done;) {
10357
10358
  var key = _step.value;
10358
10359
  delete data[key];
10359
10360
  }
@@ -14945,7 +14946,7 @@
14945
14946
  });
14946
14947
  }
14947
14948
 
14948
- var _excluded = ["enabled", "anonymousActionType", "store"],
14949
+ var _excluded$1 = ["enabled", "anonymousActionType", "store"],
14949
14950
  _excluded2 = ["connection"];
14950
14951
  var trackedConnections = /* @__PURE__ */new Map();
14951
14952
  var getTrackedConnectionState = function getTrackedConnectionState(name) {
@@ -14990,7 +14991,7 @@
14990
14991
  enabled = _devtoolsOptions.enabled,
14991
14992
  anonymousActionType = _devtoolsOptions.anonymousActionType,
14992
14993
  store = _devtoolsOptions.store,
14993
- options = _objectWithoutPropertiesLoose(_devtoolsOptions, _excluded);
14994
+ options = _objectWithoutPropertiesLoose(_devtoolsOptions, _excluded$1);
14994
14995
  var extensionConnector;
14995
14996
  try {
14996
14997
  extensionConnector = (enabled != null ? enabled : (undefined ? undefined.MODE : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
@@ -15151,9 +15152,9 @@
15151
15152
  if (parsed !== void 0) f(parsed);
15152
15153
  };
15153
15154
 
15154
- 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."); }
15155
- 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; } }
15156
- 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; }
15155
+ function _createForOfIteratorHelperLoose$1(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$1(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."); }
15156
+ function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(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$1(r, a) : void 0; } }
15157
+ function _arrayLikeToArray$1(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; }
15157
15158
  var isIterable = function isIterable(obj) {
15158
15159
  return Symbol.iterator in obj;
15159
15160
  };
@@ -15169,7 +15170,7 @@
15169
15170
  if (mapA.size !== mapB.size) {
15170
15171
  return false;
15171
15172
  }
15172
- for (var _iterator = _createForOfIteratorHelperLoose(mapA), _step; !(_step = _iterator()).done;) {
15173
+ for (var _iterator = _createForOfIteratorHelperLoose$1(mapA), _step; !(_step = _iterator()).done;) {
15173
15174
  var _step$value = _step.value,
15174
15175
  key = _step$value[0],
15175
15176
  value = _step$value[1];
@@ -24200,14 +24201,23 @@
24200
24201
  return t.length > 0 ? t : undefined;
24201
24202
  }
24202
24203
 
24203
- // import { mediaInfoFactory } from 'mediainfo.js'
24204
- // import type { ReadChunkFunc, MediaInfo, MediaInfoResult } from 'mediainfo.js'
24205
- // import { DEFAULT_CDN_URL } from '../common/cdn'
24206
- // import { warn } from '../../lib/utils/logger'
24207
- // function makeReadChunk(file: File | Blob): ReadChunkFunc {
24208
- // return async (chunkSize: number, offset: number) =>
24209
- // new Uint8Array(await file.slice(offset, offset + chunkSize).arrayBuffer())
24210
- // }
24204
+ function makeReadChunk(file) {
24205
+ var _this = this;
24206
+ return function (chunkSize, offset) {
24207
+ return __awaiter(_this, void 0, void 0, function () {
24208
+ var _a;
24209
+ return __generator(this, function (_b) {
24210
+ switch (_b.label) {
24211
+ case 0:
24212
+ _a = Uint8Array.bind;
24213
+ return [4 /*yield*/, file.slice(offset, offset + chunkSize).arrayBuffer()];
24214
+ case 1:
24215
+ return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _b.sent()]))()];
24216
+ }
24217
+ });
24218
+ });
24219
+ };
24220
+ }
24211
24221
  var signatureRecorder = null;
24212
24222
  var signatureChunks = [];
24213
24223
  var videoSignatureInitialState = {
@@ -24242,9 +24252,8 @@
24242
24252
  if (!camera) throw new Error('Camera not found');
24243
24253
  // set our flag and clear whatever we have recorded so far.
24244
24254
  signatureChunks = [];
24245
- var outputCanvas = get().outputCanvas;
24246
24255
  // start recording from the output canvas to capture the signature
24247
- var outputStream = (_a = outputCanvas.current) === null || _a === void 0 ? void 0 : _a.captureStream(24);
24256
+ var outputStream = (_a = get().outputCanvas.current) === null || _a === void 0 ? void 0 : _a.captureStream(24);
24248
24257
  if (!outputStream) throw new Error('outputStream not found');
24249
24258
  var tracks = [outputStream.getVideoTracks()[0]];
24250
24259
  if (captureAudio) {
@@ -24289,39 +24298,42 @@
24289
24298
  signatureRecorder.stop();
24290
24299
  signatureRecorder.onstop = function () {
24291
24300
  return __awaiter(void 0, void 0, void 0, function () {
24292
- var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt;
24293
- return __generator(this, function (_b) {
24294
- recordingStoppedAt = performance.now();
24295
- set({
24296
- recordingStoppedAt: recordingStoppedAt
24297
- });
24298
- inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
24299
- blob = new Blob(signatureChunks, {
24300
- type: inferredType
24301
- });
24302
- signatureChunks = [];
24303
- signatureRecorder = null;
24304
- if (!signatureData) return [2 /*return*/];
24305
- _a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartRequestedAt = _a.recordingStartRequestedAt, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt;
24306
- // const mediaInfo = await get().mediaInfo?.analyzeData(
24307
- // blob.size,
24308
- // makeReadChunk(blob),
24309
- // )
24310
- onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
24311
- // mediaInfo,
24312
- mimeType: inferredType,
24313
- timingData: {
24314
- recordingStartRequestedAt: recordingStartRequestedAt,
24315
- recordingStartedAt: recordingStartedAt,
24316
- firstChunkReceivedAt: firstChunkReceivedAt,
24317
- signatureStartedAt: signatureStartedAt,
24318
- signatureEndedAt: signatureEndedAt,
24319
- recordingStopRequestedAt: recordingStopRequestedAt,
24320
- recordingStoppedAt: recordingStoppedAt,
24321
- lastChunkReceivedAt: lastChunkReceivedAt
24322
- }
24323
- });
24324
- return [2 /*return*/];
24301
+ var recordingStoppedAt, inferredType, blob, _a, onSignatureVideoCaptured, recordingStartRequestedAt, recordingStartedAt, firstChunkReceivedAt, signatureStartedAt, signatureEndedAt, recordingStopRequestedAt, lastChunkReceivedAt, mediaInfo;
24302
+ var _b;
24303
+ return __generator(this, function (_c) {
24304
+ switch (_c.label) {
24305
+ case 0:
24306
+ recordingStoppedAt = performance.now();
24307
+ set({
24308
+ recordingStoppedAt: recordingStoppedAt
24309
+ });
24310
+ inferredType = inferBlobType(signatureChunks[0]) || (signatureRecorder === null || signatureRecorder === void 0 ? void 0 : signatureRecorder.mimeType) || 'video/mp4';
24311
+ blob = new Blob(signatureChunks, {
24312
+ type: inferredType
24313
+ });
24314
+ signatureChunks = [];
24315
+ signatureRecorder = null;
24316
+ if (!signatureData) return [2 /*return*/];
24317
+ _a = get(), onSignatureVideoCaptured = _a.onSignatureVideoCaptured, recordingStartRequestedAt = _a.recordingStartRequestedAt, recordingStartedAt = _a.recordingStartedAt, firstChunkReceivedAt = _a.firstChunkReceivedAt, signatureStartedAt = _a.signatureStartedAt, signatureEndedAt = _a.signatureEndedAt, recordingStopRequestedAt = _a.recordingStopRequestedAt, lastChunkReceivedAt = _a.lastChunkReceivedAt;
24318
+ return [4 /*yield*/, (_b = get().mediaInfo) === null || _b === void 0 ? void 0 : _b.analyzeData(blob.size, makeReadChunk(blob))];
24319
+ case 1:
24320
+ mediaInfo = _c.sent();
24321
+ onSignatureVideoCaptured(blob, signatureData, imageUrl !== null && imageUrl !== void 0 ? imageUrl : null, {
24322
+ mediaInfo: mediaInfo,
24323
+ mimeType: inferredType,
24324
+ timingData: {
24325
+ recordingStartRequestedAt: recordingStartRequestedAt,
24326
+ recordingStartedAt: recordingStartedAt,
24327
+ firstChunkReceivedAt: firstChunkReceivedAt,
24328
+ signatureStartedAt: signatureStartedAt,
24329
+ signatureEndedAt: signatureEndedAt,
24330
+ recordingStopRequestedAt: recordingStopRequestedAt,
24331
+ recordingStoppedAt: recordingStoppedAt,
24332
+ lastChunkReceivedAt: lastChunkReceivedAt
24333
+ }
24334
+ });
24335
+ return [2 /*return*/];
24336
+ }
24325
24337
  });
24326
24338
  });
24327
24339
  };
@@ -24371,7 +24383,9 @@
24371
24383
  function VideoSignatureContextProvider(_a) {
24372
24384
  var _this = this;
24373
24385
  var _b, _c, _d, _e;
24374
- var children = _a.children;
24386
+ var children = _a.children,
24387
+ _f = _a.captureMediaInfo,
24388
+ captureMediaInfo = _f === void 0 ? false : _f;
24375
24389
  var videoRef = useCameraStore().videoRef;
24376
24390
  var outputCanvas = React.useRef(null);
24377
24391
  React.useEffect(function () {
@@ -24381,27 +24395,74 @@
24381
24395
  }, []);
24382
24396
  var signatureVideoRef = React.useRef(null);
24383
24397
  var frameCheckCanvas = React.useRef(null);
24384
- // useEffect(() => {
24385
- // if (!captureMediaInfo) return
24386
- // mediaInfoFactory({
24387
- // format: 'object',
24388
- // full: true,
24389
- // locateFile: (filename) => `${DEFAULT_CDN_URL}/${filename}`,
24390
- // })
24391
- // .then((mediaInfo) => {
24392
- // useVideoSignatureStore.setState({ mediaInfo })
24393
- // })
24394
- // .catch((e) => {
24395
- // warn('error loading mediaInfo', e)
24396
- // })
24397
- // return () => {
24398
- // const mediaInfo = useVideoSignatureStore.getState().mediaInfo
24399
- // if (mediaInfo) {
24400
- // mediaInfo.close()
24401
- // useVideoSignatureStore.setState({ mediaInfo: undefined })
24402
- // }
24403
- // }
24404
- // }, [captureMediaInfo])
24398
+ React.useEffect(function () {
24399
+ if (!captureMediaInfo) return;
24400
+ // Use dynamic import to avoid build-time WASM loading issues
24401
+ var loadMediaInfo = function loadMediaInfo() {
24402
+ return __awaiter(_this, void 0, void 0, function () {
24403
+ var mediaInfoFactory, mediaInfo, e_1, mediaInfoFactory, mediaInfo, fallbackError_1;
24404
+ return __generator(this, function (_a) {
24405
+ switch (_a.label) {
24406
+ case 0:
24407
+ _a.trys.push([0, 3,, 9]);
24408
+ return [4 /*yield*/, Promise.resolve().then(function () { return index; })];
24409
+ case 1:
24410
+ mediaInfoFactory = _a.sent().mediaInfoFactory;
24411
+ return [4 /*yield*/, mediaInfoFactory({
24412
+ format: 'object',
24413
+ full: true,
24414
+ locateFile: function locateFile(filename) {
24415
+ return "".concat(DEFAULT_CDN_URL, "/").concat(filename);
24416
+ }
24417
+ })];
24418
+ case 2:
24419
+ mediaInfo = _a.sent();
24420
+ useVideoSignatureStore.setState({
24421
+ mediaInfo: mediaInfo
24422
+ });
24423
+ return [3 /*break*/, 9];
24424
+ case 3:
24425
+ e_1 = _a.sent();
24426
+ warn('error loading mediaInfo', e_1);
24427
+ _a.label = 4;
24428
+ case 4:
24429
+ _a.trys.push([4, 7,, 8]);
24430
+ return [4 /*yield*/, Promise.resolve().then(function () { return index; })];
24431
+ case 5:
24432
+ mediaInfoFactory = _a.sent().mediaInfoFactory;
24433
+ return [4 /*yield*/, mediaInfoFactory({
24434
+ format: 'object',
24435
+ full: true
24436
+ })];
24437
+ case 6:
24438
+ mediaInfo = _a.sent();
24439
+ useVideoSignatureStore.setState({
24440
+ mediaInfo: mediaInfo
24441
+ });
24442
+ return [3 /*break*/, 8];
24443
+ case 7:
24444
+ fallbackError_1 = _a.sent();
24445
+ warn('fallback mediaInfo loading also failed', fallbackError_1);
24446
+ return [3 /*break*/, 8];
24447
+ case 8:
24448
+ return [3 /*break*/, 9];
24449
+ case 9:
24450
+ return [2 /*return*/];
24451
+ }
24452
+ });
24453
+ });
24454
+ };
24455
+ loadMediaInfo();
24456
+ return function () {
24457
+ var mediaInfo = useVideoSignatureStore.getState().mediaInfo;
24458
+ if (mediaInfo) {
24459
+ mediaInfo.close();
24460
+ useVideoSignatureStore.setState({
24461
+ mediaInfo: undefined
24462
+ });
24463
+ }
24464
+ };
24465
+ }, [captureMediaInfo]);
24405
24466
  var signaturePadEmpty = useVideoSignatureStore().signaturePadEmpty;
24406
24467
  var blankCheckPassed = React.useRef(false);
24407
24468
  React.useEffect(function () {
@@ -24442,40 +24503,15 @@
24442
24503
  });
24443
24504
  });
24444
24505
  }, [videoRef, outputCanvas]);
24445
- React.useEffect(function () {
24446
- if (!signatureVideoRef.current) return;
24447
- var video = signatureVideoRef.current;
24448
- function onFrame() {
24449
- blankCheckPassed.current || (blankCheckPassed.current = !isVideoBlank(signatureVideoRef.current, frameCheckCanvas.current));
24450
- drawOutputFrame();
24451
- video.requestVideoFrameCallback(onFrame);
24452
- }
24453
- function onPlay() {
24454
- video.requestVideoFrameCallback(onFrame);
24455
- }
24456
- video.addEventListener('play', onPlay);
24457
- return function () {
24458
- video.removeEventListener('play', onPlay);
24459
- };
24460
- }, [drawOutputFrame]);
24461
- React.useEffect(function () {
24462
- if (!videoRef.current) return;
24463
- var video = videoRef.current;
24464
- function onFrame() {
24465
- drawOutputFrame();
24466
- video.requestVideoFrameCallback(onFrame);
24467
- }
24468
- function onPlay() {
24469
- video.requestVideoFrameCallback(onFrame);
24470
- }
24471
- video.addEventListener('play', onPlay);
24472
- return function () {
24473
- video.removeEventListener('play', onPlay);
24474
- };
24475
- }, [drawOutputFrame, videoRef]);
24476
- var _f = useVideoSignatureStore(),
24477
- signaturePad = _f.signaturePad,
24478
- recordingStartedAt = _f.recordingStartedAt;
24506
+ var checkBlankAndDrawOutputFrame = React.useCallback(function () {
24507
+ blankCheckPassed.current || (blankCheckPassed.current = !isVideoBlank(signatureVideoRef.current, frameCheckCanvas.current));
24508
+ drawOutputFrame();
24509
+ }, [drawOutputFrame, signatureVideoRef]);
24510
+ useVideoFrameLoop(signatureVideoRef, checkBlankAndDrawOutputFrame);
24511
+ useVideoFrameLoop(videoRef, drawOutputFrame);
24512
+ var _g = useVideoSignatureStore(),
24513
+ signaturePad = _g.signaturePad,
24514
+ recordingStartedAt = _g.recordingStartedAt;
24479
24515
  React.useEffect(function () {
24480
24516
  var _a;
24481
24517
  if (!signaturePad.current || !recordingStartedAt) return;
@@ -24515,6 +24551,32 @@
24515
24551
  });
24516
24552
  return result;
24517
24553
  }
24554
+ function requestVideoFrameCallback(video, onFrame) {
24555
+ if (typeof (video === null || video === void 0 ? void 0 : video.requestVideoFrameCallback) === 'function') {
24556
+ video.requestVideoFrameCallback(onFrame);
24557
+ } else {
24558
+ requestAnimationFrame(onFrame);
24559
+ }
24560
+ }
24561
+ function videoFrameLoop(video, onFrame) {
24562
+ if (!video) return;
24563
+ function onFrameRecursive() {
24564
+ onFrame();
24565
+ requestVideoFrameCallback(video, onFrameRecursive);
24566
+ }
24567
+ function onPlay() {
24568
+ requestVideoFrameCallback(video, onFrameRecursive);
24569
+ }
24570
+ video.addEventListener('play', onPlay);
24571
+ return function () {
24572
+ video.removeEventListener('play', onPlay);
24573
+ };
24574
+ }
24575
+ function useVideoFrameLoop(ref, onFrame) {
24576
+ React.useEffect(function () {
24577
+ return videoFrameLoop(ref.current, onFrame);
24578
+ }, [onFrame, ref]);
24579
+ }
24518
24580
 
24519
24581
  function VideoSignaturePad(_a) {
24520
24582
  var onAcceptBtnClicked = _a.onAcceptBtnClicked,
@@ -29352,6 +29414,8 @@
29352
29414
  documentServiceUrl = _a.documentServiceUrl,
29353
29415
  sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
29354
29416
  useDocumentServiceForLivenessChecks = _a.useDocumentServiceForLivenessChecks,
29417
+ _c = _a.captureMediaInfo,
29418
+ captureMediaInfo = _c === void 0 ? false : _c,
29355
29419
  onLoadingStarted = _a.onLoadingStarted,
29356
29420
  onLoadingProgress = _a.onLoadingProgress,
29357
29421
  onLoadingCompleted = _a.onLoadingCompleted,
@@ -29371,48 +29435,48 @@
29371
29435
  onCameraAccessDenied = _a.onCameraAccessDenied,
29372
29436
  onCameraTamperingDetected = _a.onCameraTamperingDetected,
29373
29437
  onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
29374
- _c = _a.loadingOverlayMode,
29375
- loadingOverlayMode = _c === void 0 ? 'default' : _c,
29438
+ _d = _a.loadingOverlayMode,
29439
+ loadingOverlayMode = _d === void 0 ? 'default' : _d,
29376
29440
  customOverlayContent = _a.customOverlayContent,
29377
- _d = _a.skipSuccessScreen,
29378
- skipSuccessScreen = _d === void 0 ? false : _d,
29379
- _e = _a.captureAudio,
29380
- captureAudio = _e === void 0 ? false : _e,
29441
+ _e = _a.skipSuccessScreen,
29442
+ skipSuccessScreen = _e === void 0 ? false : _e,
29443
+ _f = _a.captureAudio,
29444
+ captureAudio = _f === void 0 ? false : _f,
29381
29445
  idCardForFaceMatch = _a.idCardForFaceMatch,
29382
- _f = _a.minSignaturePadPoints,
29383
- minSignaturePadPoints = _f === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _f,
29384
- _g = _a.headTrackingDisabled,
29385
- headTrackingDisabled = _g === void 0 ? false : _g,
29386
- _h = _a.headTrackingBoundaryPercentage,
29387
- headTrackingBoundaryPercentage = _h === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_PERCENTAGE : _h,
29388
- _j = _a.headTrackingBoundaryType,
29389
- headTrackingBoundaryType = _j === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_TYPE : _j,
29390
- _k = _a.modelLoadTimeoutMs,
29391
- modelLoadTimeoutMs = _k === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _k,
29392
- _l = _a.allowSignatureAfterLivenessCheckFailure,
29393
- allowSignatureAfterLivenessCheckFailure = _l === void 0 ? false : _l,
29394
- _m = _a.restartVideoOnSignaturePadCleared,
29395
- restartVideoOnSignaturePadCleared = _m === void 0 ? true : _m,
29446
+ _g = _a.minSignaturePadPoints,
29447
+ minSignaturePadPoints = _g === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _g,
29448
+ _h = _a.headTrackingDisabled,
29449
+ headTrackingDisabled = _h === void 0 ? false : _h,
29450
+ _j = _a.headTrackingBoundaryPercentage,
29451
+ headTrackingBoundaryPercentage = _j === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_PERCENTAGE : _j,
29452
+ _k = _a.headTrackingBoundaryType,
29453
+ headTrackingBoundaryType = _k === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_TYPE : _k,
29454
+ _l = _a.modelLoadTimeoutMs,
29455
+ modelLoadTimeoutMs = _l === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _l,
29456
+ _m = _a.allowSignatureAfterLivenessCheckFailure,
29457
+ allowSignatureAfterLivenessCheckFailure = _m === void 0 ? false : _m,
29458
+ _o = _a.restartVideoOnSignaturePadCleared,
29459
+ restartVideoOnSignaturePadCleared = _o === void 0 ? true : _o,
29396
29460
  faceLivenessProps = _a.faceLivenessProps,
29397
- _o = _a.skipLivenessValidation,
29398
- skipLivenessValidation = _o === void 0 ? false : _o,
29399
- _p = _a.allowManualSelfieCaptureOnLoadingError,
29400
- allowManualSelfieCaptureOnLoadingError = _p === void 0 ? false : _p,
29461
+ _p = _a.skipLivenessValidation,
29462
+ skipLivenessValidation = _p === void 0 ? false : _p,
29463
+ _q = _a.allowManualSelfieCaptureOnLoadingError,
29464
+ allowManualSelfieCaptureOnLoadingError = _q === void 0 ? false : _q,
29401
29465
  guidesComponent = _a.guidesComponent,
29402
- _q = _a.showFaceGuideThenSignaturePad,
29403
- showFaceGuideThenSignaturePad = _q === void 0 ? false : _q,
29466
+ _r = _a.showFaceGuideThenSignaturePad,
29467
+ showFaceGuideThenSignaturePad = _r === void 0 ? false : _r,
29404
29468
  minCaptureBrightnessThreshold = _a.minCaptureBrightnessThreshold,
29405
29469
  minCaptureRangeThreshold = _a.minCaptureRangeThreshold,
29406
29470
  minCaptureVarianceThreshold = _a.minCaptureVarianceThreshold,
29407
- _r = _a.theme,
29408
- theme = _r === void 0 ? 'default' : _r,
29471
+ _s = _a.theme,
29472
+ theme = _s === void 0 ? 'default' : _s,
29409
29473
  classNames = _a.classNames,
29410
29474
  colors = _a.colors,
29411
29475
  verbiage = _a.verbiage,
29412
29476
  geolocationEnabled = _a.geolocationEnabled,
29413
29477
  geolocationRequired = _a.geolocationRequired,
29414
- _s = _a.debugMode,
29415
- debugMode = _s === void 0 ? false : _s;
29478
+ _t = _a.debugMode,
29479
+ debugMode = _t === void 0 ? false : _t;
29416
29480
  useLanguage(lang);
29417
29481
  useDebugLogging(debugMode);
29418
29482
  return /*#__PURE__*/React.createElement(AuthProvider, {
@@ -29462,6 +29526,7 @@
29462
29526
  loadingOverlayMode: loadingOverlayMode,
29463
29527
  skipSuccessScreen: skipSuccessScreen,
29464
29528
  captureAudio: captureAudio,
29529
+ captureMediaInfo: captureMediaInfo,
29465
29530
  minSignaturePadPoints: minSignaturePadPoints,
29466
29531
  headTrackingDisabled: headTrackingDisabled,
29467
29532
  headTrackingBoundaryPercentage: headTrackingBoundaryPercentage,
@@ -29484,7 +29549,7 @@
29484
29549
  onModelError: onModelError,
29485
29550
  onUserCancel: onUserCancel
29486
29551
  };
29487
- }, [onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onSelfieCaptured, customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, minSignaturePadPoints, headTrackingDisabled, headTrackingBoundaryPercentage, headTrackingBoundaryType, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, skipLivenessValidation, allowManualSelfieCaptureOnLoadingError, guidesComponent, showFaceGuideThenSignaturePad, minCaptureBrightnessThreshold, minCaptureRangeThreshold, minCaptureVarianceThreshold, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
29552
+ }, [onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onSelfieCaptured, customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, captureMediaInfo, minSignaturePadPoints, headTrackingDisabled, headTrackingBoundaryPercentage, headTrackingBoundaryType, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, skipLivenessValidation, allowManualSelfieCaptureOnLoadingError, guidesComponent, showFaceGuideThenSignaturePad, minCaptureBrightnessThreshold, minCaptureRangeThreshold, minCaptureVarianceThreshold, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
29488
29553
  })))));
29489
29554
  };
29490
29555
 
@@ -30558,6 +30623,2724 @@
30558
30623
  stopAll: stopAll
30559
30624
  });
30560
30625
 
30626
+ var _excluded = ["locateFile"];
30627
+ 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."); }
30628
+ 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; } }
30629
+ 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; }
30630
+ function isError(error) {
30631
+ return error !== null && typeof error === 'object' && Object.prototype.hasOwnProperty.call(error, 'message');
30632
+ }
30633
+ function unknownToError(error) {
30634
+ if (isError(error)) {
30635
+ return error;
30636
+ }
30637
+ return new Error(typeof error === 'string' ? error : 'Unknown error');
30638
+ }
30639
+
30640
+ // DO NOT EDIT! File generated using `generate-types` script.
30641
+
30642
+ var INT_FIELDS = ['Active_Height', 'Active_Width', 'AudioCount', 'Audio_Channels_Total', 'BitDepth_Detected', 'BitDepth', 'BitDepth_Stored', 'Channels', 'Channels_Original', 'Chapters_Pos_Begin', 'Chapters_Pos_End', 'Comic_Position_Total', 'Count', 'DataSize', 'ElementCount', 'EPG_Positions_Begin', 'EPG_Positions_End', 'FirstPacketOrder', 'FooterSize', 'Format_Settings_GMC', 'Format_Settings_RefFrames', 'Format_Settings_SliceCount', 'FrameCount', 'FrameRate_Den', 'FrameRate_Num', 'GeneralCount', 'HeaderSize', 'Height_CleanAperture', 'Height', 'Height_Offset', 'Height_Original', 'ImageCount', 'Lines_MaxCharacterCount', 'Lines_MaxCountPerEvent', 'Matrix_Channels', 'MenuCount', 'OtherCount', 'Part_Position', 'Part_Position_Total', 'Played_Count', 'Reel_Position', 'Reel_Position_Total', 'Resolution', 'Sampled_Height', 'Sampled_Width', 'SamplingCount', 'Season_Position', 'Season_Position_Total', 'Source_FrameCount', 'Source_SamplingCount', 'Source_StreamSize_Encoded', 'Source_StreamSize', 'Status', 'Stored_Height', 'Stored_Width', 'StreamCount', 'StreamKindID', 'StreamKindPos', 'StreamSize_Demuxed', 'StreamSize_Encoded', 'StreamSize', 'TextCount', 'Track_Position', 'Track_Position_Total', 'Video0_Delay', 'VideoCount', 'Width_CleanAperture', 'Width', 'Width_Offset', 'Width_Original'];
30643
+ var FLOAT_FIELDS = ['Active_DisplayAspectRatio', 'BitRate_Encoded', 'BitRate_Maximum', 'BitRate_Minimum', 'BitRate', 'BitRate_Nominal', 'Bits-Pixel_Frame', 'BitsPixel_Frame', 'Compression_Ratio', 'Delay', 'Delay_Original', 'DisplayAspectRatio_CleanAperture', 'DisplayAspectRatio', 'DisplayAspectRatio_Original', 'Duration_End_Command', 'Duration_End', 'Duration_FirstFrame', 'Duration_LastFrame', 'Duration', 'Duration_Start2End', 'Duration_Start_Command', 'Duration_Start', 'Events_MinDuration', 'FrameRate_Maximum', 'FrameRate_Minimum', 'FrameRate', 'FrameRate_Nominal', 'FrameRate_Original_Den', 'FrameRate_Original', 'FrameRate_Original_Num', 'FrameRate_Real', 'Interleave_Duration', 'Interleave_Preload', 'Interleave_VideoFrames', 'OverallBitRate_Maximum', 'OverallBitRate_Minimum', 'OverallBitRate', 'OverallBitRate_Nominal', 'PixelAspectRatio_CleanAperture', 'PixelAspectRatio', 'PixelAspectRatio_Original', 'SamplesPerFrame', 'SamplingRate', 'Source_Duration_FirstFrame', 'Source_Duration_LastFrame', 'Source_Duration', 'TimeStamp_FirstFrame', 'Video_Delay'];
30644
+ var MAX_UINT32_PLUS_ONE = Math.pow(2, 32);
30645
+ var DEFAULT_OPTIONS = {
30646
+ coverData: false,
30647
+ chunkSize: 256 * 1024,
30648
+ format: 'object',
30649
+ full: false
30650
+ };
30651
+ /**
30652
+ * Wrapper for the MediaInfoLib WASM module.
30653
+ *
30654
+ * This class should not be instantiated directly. Use the {@link mediaInfoFactory} function
30655
+ * to create instances of `MediaInfo`.
30656
+ *
30657
+ * @typeParam TFormat - The format type, defaults to `object`.
30658
+ */
30659
+ var MediaInfo = /*#__PURE__*/function () {
30660
+ /** @group General Use */
30661
+
30662
+ /**
30663
+ * The constructor should not be called directly, instead use {@link mediaInfoFactory}.
30664
+ *
30665
+ * @hidden
30666
+ * @param mediainfoModule WASM module
30667
+ * @param options User options
30668
+ */
30669
+ function MediaInfo(mediainfoModule, options) {
30670
+ this.isAnalyzing = false;
30671
+ this.mediainfoModule = mediainfoModule;
30672
+ this.options = options;
30673
+ this.mediainfoModuleInstance = this.instantiateModuleInstance();
30674
+ }
30675
+
30676
+ /**
30677
+ * Convenience method for analyzing a buffer chunk by chunk.
30678
+ *
30679
+ * @param size Return total buffer size in bytes.
30680
+ * @param readChunk Read chunk of data and return an {@link Uint8Array}.
30681
+ * @group General Use
30682
+ */
30683
+
30684
+ /**
30685
+ * Convenience method for analyzing a buffer chunk by chunk.
30686
+ *
30687
+ * @param size Return total buffer size in bytes.
30688
+ * @param readChunk Read chunk of data and return an {@link Uint8Array}.
30689
+ * @param callback Function that is called once the processing is done
30690
+ * @group General Use
30691
+ */
30692
+ var _proto = MediaInfo.prototype;
30693
+ _proto.analyzeData = function analyzeData(size, readChunk, callback) {
30694
+ var _this = this;
30695
+ // Support promise signature
30696
+ if (callback === undefined) {
30697
+ return new Promise(function (resolve, reject) {
30698
+ var resultCb = function resultCb(result, error) {
30699
+ _this.isAnalyzing = false;
30700
+ if (error || !result) {
30701
+ reject(unknownToError(error));
30702
+ } else {
30703
+ resolve(result);
30704
+ }
30705
+ };
30706
+ _this.analyzeData(size, readChunk, resultCb);
30707
+ });
30708
+ }
30709
+ if (this.isAnalyzing) {
30710
+ callback('', new Error('cannot start a new analysis while another is in progress'));
30711
+ return;
30712
+ }
30713
+ this.reset();
30714
+ this.isAnalyzing = true;
30715
+ var finalize = function finalize() {
30716
+ try {
30717
+ _this.openBufferFinalize();
30718
+ var result = _this.inform();
30719
+ if (_this.options.format === 'object') {
30720
+ callback(_this.parseResultJson(result));
30721
+ } else {
30722
+ callback(result);
30723
+ }
30724
+ } finally {
30725
+ _this.isAnalyzing = false;
30726
+ }
30727
+ };
30728
+ var offset = 0;
30729
+ var runReadDataLoop = function runReadDataLoop(fileSize) {
30730
+ var readNextChunk = function readNextChunk(data) {
30731
+ if (continueBuffer(data)) {
30732
+ getChunk();
30733
+ } else {
30734
+ finalize();
30735
+ }
30736
+ };
30737
+ var getChunk = function getChunk() {
30738
+ var dataValue;
30739
+ try {
30740
+ var safeSize = Math.min(_this.options.chunkSize, fileSize - offset);
30741
+ dataValue = readChunk(safeSize, offset);
30742
+ } catch (error) {
30743
+ _this.isAnalyzing = false;
30744
+ callback('', unknownToError(error));
30745
+ return;
30746
+ }
30747
+ if (dataValue instanceof Promise) {
30748
+ dataValue.then(readNextChunk)["catch"](function (error) {
30749
+ _this.isAnalyzing = false;
30750
+ callback('', unknownToError(error));
30751
+ });
30752
+ } else {
30753
+ readNextChunk(dataValue);
30754
+ }
30755
+ };
30756
+ var continueBuffer = function continueBuffer(data) {
30757
+ if (data.length === 0 || _this.openBufferContinue(data, data.length)) {
30758
+ return false;
30759
+ }
30760
+ var seekTo = _this.openBufferContinueGotoGet();
30761
+ if (seekTo === -1) {
30762
+ offset += data.length;
30763
+ } else {
30764
+ offset = seekTo;
30765
+ _this.openBufferInit(fileSize, seekTo);
30766
+ }
30767
+ return true;
30768
+ };
30769
+ _this.openBufferInit(fileSize, offset);
30770
+ getChunk();
30771
+ };
30772
+ var fileSizeValue = typeof size === 'function' ? size() : size;
30773
+ if (fileSizeValue instanceof Promise) {
30774
+ fileSizeValue.then(runReadDataLoop)["catch"](function (error) {
30775
+ callback(null, unknownToError(error));
30776
+ });
30777
+ } else {
30778
+ runReadDataLoop(fileSizeValue);
30779
+ }
30780
+ }
30781
+
30782
+ /**
30783
+ * Close the MediaInfoLib WASM instance.
30784
+ *
30785
+ * @group General Use
30786
+ */;
30787
+ _proto.close = function close() {
30788
+ if (typeof this.mediainfoModuleInstance.close === 'function') {
30789
+ this.mediainfoModuleInstance.close();
30790
+ }
30791
+ }
30792
+
30793
+ /**
30794
+ * Reset the MediaInfoLib WASM instance to its initial state.
30795
+ *
30796
+ * This method ensures that the instance is ready for a new parse.
30797
+ * @group General Use
30798
+ */;
30799
+ _proto.reset = function reset() {
30800
+ this.mediainfoModuleInstance["delete"]();
30801
+ this.mediainfoModuleInstance = this.instantiateModuleInstance();
30802
+ }
30803
+
30804
+ /**
30805
+ * Receive result data from the WASM instance.
30806
+ *
30807
+ * (This is a low-level MediaInfoLib function.)
30808
+ *
30809
+ * @returns Result data (format can be configured in options)
30810
+ * @group Low-level
30811
+ */;
30812
+ _proto.inform = function inform() {
30813
+ return this.mediainfoModuleInstance.inform();
30814
+ }
30815
+
30816
+ /**
30817
+ * Send more data to the WASM instance.
30818
+ *
30819
+ * (This is a low-level MediaInfoLib function.)
30820
+ *
30821
+ * @param data Data buffer
30822
+ * @param size Buffer size
30823
+ * @returns Processing state: `0` (no bits set) = not finished, Bit `0` set = enough data read for providing information
30824
+ * @group Low-level
30825
+ */;
30826
+ _proto.openBufferContinue = function openBufferContinue(data, size) {
30827
+ // bit 3 set -> done
30828
+ return !!(this.mediainfoModuleInstance.open_buffer_continue(data, size) & 0x08);
30829
+ }
30830
+
30831
+ /**
30832
+ * Retrieve seek position from WASM instance.
30833
+ * The MediaInfoLib function `Open_Buffer_GoTo` returns an integer with 64 bit precision.
30834
+ * It would be cut at 32 bit due to the JavaScript bindings. Here we transport the low and high
30835
+ * parts separately and put them together.
30836
+ *
30837
+ * (This is a low-level MediaInfoLib function.)
30838
+ *
30839
+ * @returns Seek position (where MediaInfoLib wants go in the data buffer)
30840
+ * @group Low-level
30841
+ */;
30842
+ _proto.openBufferContinueGotoGet = function openBufferContinueGotoGet() {
30843
+ // JS bindings don't support 64 bit int
30844
+ // https://github.com/buzz/mediainfo.js/issues/11
30845
+ var seekTo = -1;
30846
+ var seekToLow = this.mediainfoModuleInstance.open_buffer_continue_goto_get_lower();
30847
+ var seekToHigh = this.mediainfoModuleInstance.open_buffer_continue_goto_get_upper();
30848
+ if (seekToLow == -1 && seekToHigh == -1) {
30849
+ seekTo = -1;
30850
+ } else if (seekToLow < 0) {
30851
+ seekTo = seekToLow + MAX_UINT32_PLUS_ONE + seekToHigh * MAX_UINT32_PLUS_ONE;
30852
+ } else {
30853
+ seekTo = seekToLow + seekToHigh * MAX_UINT32_PLUS_ONE;
30854
+ }
30855
+ return seekTo;
30856
+ }
30857
+
30858
+ /**
30859
+ * Inform MediaInfoLib that no more data is being read.
30860
+ *
30861
+ * (This is a low-level MediaInfoLib function.)
30862
+ *
30863
+ * @group Low-level
30864
+ */;
30865
+ _proto.openBufferFinalize = function openBufferFinalize() {
30866
+ this.mediainfoModuleInstance.open_buffer_finalize();
30867
+ }
30868
+
30869
+ /**
30870
+ * Prepare MediaInfoLib to process a data buffer.
30871
+ *
30872
+ * (This is a low-level MediaInfoLib function.)
30873
+ *
30874
+ * @param size Expected buffer size
30875
+ * @param offset Buffer offset
30876
+ * @group Low-level
30877
+ */;
30878
+ _proto.openBufferInit = function openBufferInit(size, offset) {
30879
+ this.mediainfoModuleInstance.open_buffer_init(size, offset);
30880
+ }
30881
+
30882
+ /**
30883
+ * Parse result JSON. Convert integer/float fields.
30884
+ *
30885
+ * @param result Serialized JSON from MediaInfo
30886
+ * @returns Parsed JSON object
30887
+ */;
30888
+ _proto.parseResultJson = function parseResultJson(resultString) {
30889
+ var intFields = INT_FIELDS;
30890
+ var floatFields = FLOAT_FIELDS;
30891
+
30892
+ // Parse JSON
30893
+ var result = JSON.parse(resultString);
30894
+ if (result.media) {
30895
+ var newMedia = _extends({}, result.media, {
30896
+ track: []
30897
+ });
30898
+ if (Array.isArray(result.media.track)) {
30899
+ for (var _iterator = _createForOfIteratorHelperLoose(result.media.track), _step; !(_step = _iterator()).done;) {
30900
+ var track = _step.value;
30901
+ var newTrack = {
30902
+ '@type': track['@type']
30903
+ };
30904
+ for (var _i = 0, _Object$entries = Object.entries(track); _i < _Object$entries.length; _i++) {
30905
+ var _Object$entries$_i = _Object$entries[_i],
30906
+ key = _Object$entries$_i[0],
30907
+ val = _Object$entries$_i[1];
30908
+ if (key === '@type') {
30909
+ continue;
30910
+ }
30911
+ if (typeof val === 'string' && intFields.includes(key)) {
30912
+ var _extends2;
30913
+ newTrack = _extends({}, newTrack, (_extends2 = {}, _extends2[key] = Number.parseInt(val, 10), _extends2));
30914
+ } else if (typeof val === 'string' && floatFields.includes(key)) {
30915
+ var _extends3;
30916
+ newTrack = _extends({}, newTrack, (_extends3 = {}, _extends3[key] = Number.parseFloat(val), _extends3));
30917
+ } else {
30918
+ var _extends4;
30919
+ newTrack = _extends({}, newTrack, (_extends4 = {}, _extends4[key] = val, _extends4));
30920
+ }
30921
+ }
30922
+ newMedia.track.push(newTrack);
30923
+ }
30924
+ }
30925
+ return _extends({}, result, {
30926
+ media: newMedia
30927
+ });
30928
+ }
30929
+ return result;
30930
+ }
30931
+
30932
+ /**
30933
+ * Instantiate a new WASM module instance.
30934
+ *
30935
+ * @returns MediaInfo module instance
30936
+ */;
30937
+ _proto.instantiateModuleInstance = function instantiateModuleInstance() {
30938
+ return new this.mediainfoModule.MediaInfo(this.options.format === 'object' ? 'JSON' : this.options.format, this.options.coverData, this.options.full);
30939
+ };
30940
+ return MediaInfo;
30941
+ }(); // This code implements the `-sMODULARIZE` settings by taking the generated
30942
+ // JS program code (INNER_JS_CODE) and wrapping it in a factory function.
30943
+ // When targetting node and ES6 we use `await import ..` in the generated code
30944
+ // so the outer function needs to be marked as async.
30945
+ function Module(_x) {
30946
+ return _Module.apply(this, arguments);
30947
+ }
30948
+ function _Module() {
30949
+ _Module = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(moduleArg) {
30950
+ var moduleRtn, Module, thisProgram, _scriptName, scriptDirectory, locateFile, readAsync, out, err, wasmBinary, ABORT, readyPromiseResolve, readyPromiseReject, wasmMemory, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64, HEAP64, HEAPU64, runtimeInitialized, updateMemoryViews, initRuntime, runDependencies, dependenciesFulfilled, addRunDependency, removeRunDependency, abort, wasmBinaryFile, findWasmBinary, getBinarySync, getWasmBinary, _getWasmBinary, instantiateArrayBuffer, _instantiateArrayBuffer, instantiateAsync, _instantiateAsync, getWasmImports, createWasm, _createWasm, __abort_js, AsciiToString, awaitingDependencies, registeredTypes, typeDependencies, BindingError, throwBindingError, sharedRegisterType, registerType, integerReadValueFromPointer, __embind_register_bigint, __embind_register_bool, shallowCopyInternalPointer, throwInstanceAlreadyDeleted, finalizationRegistry, detachFinalizer, runDestructor, releaseClassHandle, _attachFinalizer, init_ClassHandle, ClassHandle, createNamedFunction, registeredPointers, ensureOverloadTable, exposePublicSymbol, char_0, char_9, makeLegalFunctionName, RegisteredClass, upcastPointer, embindRepr, constNoSmartPtrRawPointerToWireType, genericPointerToWireType, nonConstNoSmartPtrRawPointerToWireType, readPointer, _downcastPointer, registeredInstances, getBasestPointer, getInheritedInstance, InternalError, throwInternalError, makeClassHandle, RegisteredPointer_fromWireType, init_RegisteredPointer, RegisteredPointer, replacePublicSymbol, wasmTableMirror, wasmTable, getWasmTableEntry, embind__requireFunction, UnboundTypeError, getTypeName, throwUnboundTypeError, whenDependentTypesAreResolved, __embind_register_class, heap32VectorToArray, runDestructors, usesDestructorStack, createJsInvoker, craftInvokerFunction, __embind_register_class_constructor, getFunctionName, __embind_register_class_function, emval_freelist, emval_handles, __emval_decref, Emval, EmValType, __embind_register_emval, floatReadValueFromPointer, __embind_register_float, __embind_register_integer, __embind_register_memory_view, __embind_register_smart_ptr, stringToUTF8Array, stringToUTF8, lengthBytesUTF8, UTF8Decoder, findStringEnd, UTF8ArrayToString, UTF8ToString, __embind_register_std_string, UTF16Decoder, UTF16ToString, stringToUTF16, lengthBytesUTF16, UTF32ToString, stringToUTF32, lengthBytesUTF32, __embind_register_std_wstring, __embind_register_void, emval_methodCallers, emval_addMethodCaller, requireRegisteredType, emval_lookupTypes, emval_returnValue, emval_symbols, getStringOrSymbol, __emval_create_invoker, __emval_incref, __emval_invoke, __emval_run_destructors, INT53_MAX, INT53_MIN, bigintToI53Checked, __gmtime_js, __tzset_js, _emscripten_date_now, getHeapMax, alignMemory, growMemory, _emscripten_resize_heap, ENV, getExecutableName, _getEnvStrings, _environ_get, _environ_sizes_get, _fd_close, _fd_seek, printCharBuffers, printChar, _fd_write, ___getTypeName, _malloc, _free, assignWasmExports, wasmImports, wasmExports, run;
30951
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
30952
+ while (1) switch (_context6.prev = _context6.next) {
30953
+ case 0:
30954
+ run = function _run() {
30955
+ if (runDependencies > 0) {
30956
+ dependenciesFulfilled = run;
30957
+ return;
30958
+ }
30959
+
30960
+ // a preRun added a dependency, run will be called later
30961
+ if (runDependencies > 0) {
30962
+ dependenciesFulfilled = run;
30963
+ return;
30964
+ }
30965
+ function doRun() {
30966
+ // run may have just been called through dependencies being fulfilled just in this very frame,
30967
+ // or while the async setStatus time below was happening
30968
+ Module['calledRun'] = true;
30969
+ if (ABORT) return;
30970
+ initRuntime();
30971
+ readyPromiseResolve == null || readyPromiseResolve(Module);
30972
+ }
30973
+ {
30974
+ doRun();
30975
+ }
30976
+ };
30977
+ assignWasmExports = function _assignWasmExports(wasmExports) {
30978
+ ___getTypeName = wasmExports['__getTypeName'];
30979
+ _malloc = wasmExports['malloc'];
30980
+ _free = wasmExports['free'];
30981
+ wasmExports['_emscripten_stack_restore'];
30982
+ wasmExports['_emscripten_stack_alloc'];
30983
+ wasmExports['emscripten_stack_get_current'];
30984
+ };
30985
+ _fd_seek = function _fd_seek2(fd, offset, whence, newOffset) {
30986
+ return 70;
30987
+ };
30988
+ __gmtime_js = function _gmtime_js(time, tmPtr) {
30989
+ time = bigintToI53Checked(time);
30990
+ var date = new Date(time * 1000);
30991
+ HEAP32[tmPtr >> 2] = date.getUTCSeconds();
30992
+ HEAP32[tmPtr + 4 >> 2] = date.getUTCMinutes();
30993
+ HEAP32[tmPtr + 8 >> 2] = date.getUTCHours();
30994
+ HEAP32[tmPtr + 12 >> 2] = date.getUTCDate();
30995
+ HEAP32[tmPtr + 16 >> 2] = date.getUTCMonth();
30996
+ HEAP32[tmPtr + 20 >> 2] = date.getUTCFullYear() - 1900;
30997
+ HEAP32[tmPtr + 24 >> 2] = date.getUTCDay();
30998
+ var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0);
30999
+ var yday = (date.getTime() - start) / (1000 * 60 * 60 * 24) | 0;
31000
+ HEAP32[tmPtr + 28 >> 2] = yday;
31001
+ };
31002
+ craftInvokerFunction = function _craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc, /** boolean= */isAsync) {
31003
+ // humanName: a human-readable string name for the function to be generated.
31004
+ // argTypes: An array that contains the embind type objects for all types in the function signature.
31005
+ // argTypes[0] is the type object for the function return value.
31006
+ // argTypes[1] is the type object for function this object/class type, or null if not crafting an invoker for a class method.
31007
+ // argTypes[2...] are the actual function parameters.
31008
+ // classType: The embind type object for the class to be bound, or null if this is not a method of a class.
31009
+ // cppInvokerFunc: JS Function object to the C++-side function that interops into C++ code.
31010
+ // cppTargetFunc: Function pointer (an integer to FUNCTION_TABLE) to the target C++ function the cppInvokerFunc will end up calling.
31011
+ // isAsync: Optional. If true, returns an async function. Async bindings are only supported with JSPI.
31012
+ var argCount = argTypes.length;
31013
+ if (argCount < 2) {
31014
+ throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!");
31015
+ }
31016
+ var isClassMethodFunc = argTypes[1] !== null && classType !== null;
31017
+
31018
+ // Free functions with signature "void function()" do not need an invoker that marshalls between wire types.
31019
+ // TODO: This omits argument count check - enable only at -O3 or similar.
31020
+ // if (ENABLE_UNSAFE_OPTS && argCount == 2 && argTypes[0].name == "void" && !isClassMethodFunc) {
31021
+ // return FUNCTION_TABLE[fn];
31022
+ // }
31023
+
31024
+ // Determine if we need to use a dynamic stack to store the destructors for the function parameters.
31025
+ // TODO: Remove this completely once all function invokers are being dynamically generated.
31026
+ var needsDestructorStack = usesDestructorStack(argTypes);
31027
+ var returns = !argTypes[0].isVoid;
31028
+ // Builld the arguments that will be passed into the closure around the invoker
31029
+ // function.
31030
+ var retType = argTypes[0];
31031
+ var instType = argTypes[1];
31032
+ var closureArgs = [humanName, throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, retType.fromWireType.bind(retType), instType == null ? void 0 : instType.toWireType.bind(instType)];
31033
+ for (var i = 2; i < argCount; ++i) {
31034
+ var argType = argTypes[i];
31035
+ closureArgs.push(argType.toWireType.bind(argType));
31036
+ }
31037
+ if (!needsDestructorStack) {
31038
+ // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method.
31039
+ for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) {
31040
+ if (argTypes[i].destructorFunction !== null) {
31041
+ closureArgs.push(argTypes[i].destructorFunction);
31042
+ }
31043
+ }
31044
+ }
31045
+ var invokerFactory = createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync);
31046
+ var invokerFn = invokerFactory.apply(void 0, closureArgs);
31047
+ return createNamedFunction(humanName, invokerFn);
31048
+ };
31049
+ createJsInvoker = function _createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync) {
31050
+ var needsDestructorStack = usesDestructorStack(argTypes);
31051
+ var argCount = argTypes.length - 2;
31052
+ var argsList = [];
31053
+ var argsListWired = ['fn'];
31054
+ if (isClassMethodFunc) {
31055
+ argsListWired.push('thisWired');
31056
+ }
31057
+ for (var i = 0; i < argCount; ++i) {
31058
+ argsList.push("arg" + i);
31059
+ argsListWired.push("arg" + i + "Wired");
31060
+ }
31061
+ argsList = argsList.join(',');
31062
+ argsListWired = argsListWired.join(',');
31063
+ var invokerFnBody = "return function (" + argsList + ") {\n";
31064
+ if (needsDestructorStack) {
31065
+ invokerFnBody += 'var destructors = [];\n';
31066
+ }
31067
+ var dtorStack = needsDestructorStack ? 'destructors' : 'null';
31068
+ var args1 = ['humanName', 'throwBindingError', 'invoker', 'fn', 'runDestructors', 'fromRetWire', 'toClassParamWire'];
31069
+ if (isClassMethodFunc) {
31070
+ invokerFnBody += "var thisWired = toClassParamWire(" + dtorStack + ", this);\n";
31071
+ }
31072
+ for (var i = 0; i < argCount; ++i) {
31073
+ var argName = "toArg" + i + "Wire";
31074
+ invokerFnBody += "var arg" + i + "Wired = " + argName + "(" + dtorStack + ", arg" + i + ");\n";
31075
+ args1.push(argName);
31076
+ }
31077
+ invokerFnBody += (returns || isAsync ? 'var rv = ' : '') + ("invoker(" + argsListWired + ");\n");
31078
+ if (needsDestructorStack) {
31079
+ invokerFnBody += 'runDestructors(destructors);\n';
31080
+ } else {
31081
+ for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) {
31082
+ // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method.
31083
+ var paramName = i === 1 ? 'thisWired' : 'arg' + (i - 2) + 'Wired';
31084
+ if (argTypes[i].destructorFunction !== null) {
31085
+ invokerFnBody += paramName + "_dtor(" + paramName + ");\n";
31086
+ args1.push(paramName + "_dtor");
31087
+ }
31088
+ }
31089
+ }
31090
+ if (returns) {
31091
+ invokerFnBody += 'var ret = fromRetWire(rv);\n' + 'return ret;\n';
31092
+ }
31093
+ invokerFnBody += '}\n';
31094
+ return new Function(args1, invokerFnBody);
31095
+ };
31096
+ usesDestructorStack = function _usesDestructorStack(argTypes) {
31097
+ // Skip return value at index 0 - it's not deleted here.
31098
+ for (var i = 1; i < argTypes.length; ++i) {
31099
+ // The type does not define a destructor function - must use dynamic stack
31100
+ if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) {
31101
+ return true;
31102
+ }
31103
+ }
31104
+ return false;
31105
+ };
31106
+ RegisteredPointer = function _RegisteredPointer(name, registeredClass, isReference, isConst,
31107
+ // smart pointer properties
31108
+ isSmartPointer, pointeeType, sharingPolicy, rawGetPointee, rawConstructor, rawShare, rawDestructor) {
31109
+ this.name = name;
31110
+ this.registeredClass = registeredClass;
31111
+ this.isReference = isReference;
31112
+ this.isConst = isConst;
31113
+
31114
+ // smart pointer properties
31115
+ this.isSmartPointer = isSmartPointer;
31116
+ this.pointeeType = pointeeType;
31117
+ this.sharingPolicy = sharingPolicy;
31118
+ this.rawGetPointee = rawGetPointee;
31119
+ this.rawConstructor = rawConstructor;
31120
+ this.rawShare = rawShare;
31121
+ this.rawDestructor = rawDestructor;
31122
+ if (!isSmartPointer && registeredClass.baseClass === undefined) {
31123
+ if (isConst) {
31124
+ this.toWireType = constNoSmartPtrRawPointerToWireType;
31125
+ this.destructorFunction = null;
31126
+ } else {
31127
+ this.toWireType = nonConstNoSmartPtrRawPointerToWireType;
31128
+ this.destructorFunction = null;
31129
+ }
31130
+ } else {
31131
+ this.toWireType = genericPointerToWireType;
31132
+ // Here we must leave this.destructorFunction undefined, since whether genericPointerToWireType returns
31133
+ // a pointer that needs to be freed up is runtime-dependent, and cannot be evaluated at registration time.
31134
+ // TODO: Create an alternative mechanism that allows removing the use of var destructors = []; array in
31135
+ // craftInvokerFunction altogether.
31136
+ }
31137
+ };
31138
+ RegisteredPointer_fromWireType = function _RegisteredPointer_fr(ptr) {
31139
+ // ptr is a raw pointer (or a raw smartpointer)
31140
+
31141
+ // rawPointer is a maybe-null raw pointer
31142
+ var rawPointer = this.getPointee(ptr);
31143
+ if (!rawPointer) {
31144
+ this.destructor(ptr);
31145
+ return null;
31146
+ }
31147
+ var registeredInstance = getInheritedInstance(this.registeredClass, rawPointer);
31148
+ if (undefined !== registeredInstance) {
31149
+ // JS object has been neutered, time to repopulate it
31150
+ if (0 === registeredInstance.$$.count.value) {
31151
+ registeredInstance.$$.ptr = rawPointer;
31152
+ registeredInstance.$$.smartPtr = ptr;
31153
+ return registeredInstance['clone']();
31154
+ } else {
31155
+ // else, just increment reference count on existing object
31156
+ // it already has a reference to the smart pointer
31157
+ var rv = registeredInstance['clone']();
31158
+ this.destructor(ptr);
31159
+ return rv;
31160
+ }
31161
+ }
31162
+ function makeDefaultHandle() {
31163
+ if (this.isSmartPointer) {
31164
+ return makeClassHandle(this.registeredClass.instancePrototype, {
31165
+ ptrType: this.pointeeType,
31166
+ ptr: rawPointer,
31167
+ smartPtrType: this,
31168
+ smartPtr: ptr
31169
+ });
31170
+ } else {
31171
+ return makeClassHandle(this.registeredClass.instancePrototype, {
31172
+ ptrType: this,
31173
+ ptr: ptr
31174
+ });
31175
+ }
31176
+ }
31177
+ var actualType = this.registeredClass.getActualType(rawPointer);
31178
+ var registeredPointerRecord = registeredPointers[actualType];
31179
+ if (!registeredPointerRecord) {
31180
+ return makeDefaultHandle.call(this);
31181
+ }
31182
+ var toType;
31183
+ if (this.isConst) {
31184
+ toType = registeredPointerRecord.constPointerType;
31185
+ } else {
31186
+ toType = registeredPointerRecord.pointerType;
31187
+ }
31188
+ var dp = _downcastPointer(rawPointer, this.registeredClass, toType.registeredClass);
31189
+ if (dp === null) {
31190
+ return makeDefaultHandle.call(this);
31191
+ }
31192
+ if (this.isSmartPointer) {
31193
+ return makeClassHandle(toType.registeredClass.instancePrototype, {
31194
+ ptrType: toType,
31195
+ ptr: dp,
31196
+ smartPtrType: this,
31197
+ smartPtr: ptr
31198
+ });
31199
+ } else {
31200
+ return makeClassHandle(toType.registeredClass.instancePrototype, {
31201
+ ptrType: toType,
31202
+ ptr: dp
31203
+ });
31204
+ }
31205
+ };
31206
+ readPointer = function _readPointer(pointer) {
31207
+ return this.fromWireType(HEAPU32[pointer >> 2]);
31208
+ };
31209
+ nonConstNoSmartPtrRawPointerToWireType = function _nonConstNoSmartPtrRa(destructors, handle) {
31210
+ if (handle === null) {
31211
+ if (this.isReference) {
31212
+ throwBindingError("null is not a valid " + this.name);
31213
+ }
31214
+ return 0;
31215
+ }
31216
+ if (!handle.$$) {
31217
+ throwBindingError("Cannot pass \"" + embindRepr(handle) + "\" as a " + this.name);
31218
+ }
31219
+ if (!handle.$$.ptr) {
31220
+ throwBindingError("Cannot pass deleted object as a pointer of type " + this.name);
31221
+ }
31222
+ if (handle.$$.ptrType.isConst) {
31223
+ throwBindingError("Cannot convert argument of type " + handle.$$.ptrType.name + " to parameter type " + this.name);
31224
+ }
31225
+ var handleClass = handle.$$.ptrType.registeredClass;
31226
+ var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
31227
+ return ptr;
31228
+ };
31229
+ genericPointerToWireType = function _genericPointerToWire(destructors, handle) {
31230
+ var ptr;
31231
+ if (handle === null) {
31232
+ if (this.isReference) {
31233
+ throwBindingError("null is not a valid " + this.name);
31234
+ }
31235
+ if (this.isSmartPointer) {
31236
+ ptr = this.rawConstructor();
31237
+ if (destructors !== null) {
31238
+ destructors.push(this.rawDestructor, ptr);
31239
+ }
31240
+ return ptr;
31241
+ } else {
31242
+ return 0;
31243
+ }
31244
+ }
31245
+ if (!handle || !handle.$$) {
31246
+ throwBindingError("Cannot pass \"" + embindRepr(handle) + "\" as a " + this.name);
31247
+ }
31248
+ if (!handle.$$.ptr) {
31249
+ throwBindingError("Cannot pass deleted object as a pointer of type " + this.name);
31250
+ }
31251
+ if (!this.isConst && handle.$$.ptrType.isConst) {
31252
+ throwBindingError("Cannot convert argument of type " + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + " to parameter type " + this.name);
31253
+ }
31254
+ var handleClass = handle.$$.ptrType.registeredClass;
31255
+ ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
31256
+ if (this.isSmartPointer) {
31257
+ // TODO: this is not strictly true
31258
+ // We could support BY_EMVAL conversions from raw pointers to smart pointers
31259
+ // because the smart pointer can hold a reference to the handle
31260
+ if (undefined === handle.$$.smartPtr) {
31261
+ throwBindingError('Passing raw pointer to smart pointer is illegal');
31262
+ }
31263
+ switch (this.sharingPolicy) {
31264
+ case 0:
31265
+ // NONE
31266
+ // no upcasting
31267
+ if (handle.$$.smartPtrType === this) {
31268
+ ptr = handle.$$.smartPtr;
31269
+ } else {
31270
+ throwBindingError("Cannot convert argument of type " + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + " to parameter type " + this.name);
31271
+ }
31272
+ break;
31273
+ case 1:
31274
+ // INTRUSIVE
31275
+ ptr = handle.$$.smartPtr;
31276
+ break;
31277
+ case 2:
31278
+ // BY_EMVAL
31279
+ if (handle.$$.smartPtrType === this) {
31280
+ ptr = handle.$$.smartPtr;
31281
+ } else {
31282
+ var clonedHandle = handle['clone']();
31283
+ ptr = this.rawShare(ptr, Emval.toHandle(function () {
31284
+ return clonedHandle['delete']();
31285
+ }));
31286
+ if (destructors !== null) {
31287
+ destructors.push(this.rawDestructor, ptr);
31288
+ }
31289
+ }
31290
+ break;
31291
+ default:
31292
+ throwBindingError('Unsupporting sharing policy');
31293
+ }
31294
+ }
31295
+ return ptr;
31296
+ };
31297
+ constNoSmartPtrRawPointerToWireType = function _constNoSmartPtrRawPo(destructors, handle) {
31298
+ if (handle === null) {
31299
+ if (this.isReference) {
31300
+ throwBindingError("null is not a valid " + this.name);
31301
+ }
31302
+ return 0;
31303
+ }
31304
+ if (!handle.$$) {
31305
+ throwBindingError("Cannot pass \"" + embindRepr(handle) + "\" as a " + this.name);
31306
+ }
31307
+ if (!handle.$$.ptr) {
31308
+ throwBindingError("Cannot pass deleted object as a pointer of type " + this.name);
31309
+ }
31310
+ var handleClass = handle.$$.ptrType.registeredClass;
31311
+ var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
31312
+ return ptr;
31313
+ };
31314
+ RegisteredClass = function _RegisteredClass(name, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast) {
31315
+ this.name = name;
31316
+ this.constructor = constructor;
31317
+ this.instancePrototype = instancePrototype;
31318
+ this.rawDestructor = rawDestructor;
31319
+ this.baseClass = baseClass;
31320
+ this.getActualType = getActualType;
31321
+ this.upcast = upcast;
31322
+ this.downcast = downcast;
31323
+ this.pureVirtualFunctions = [];
31324
+ };
31325
+ ClassHandle = function _ClassHandle() {};
31326
+ registerType = function _registerType(rawType, registeredInstance, options) {
31327
+ if (options === void 0) {
31328
+ options = {};
31329
+ }
31330
+ return sharedRegisterType(rawType, registeredInstance, options);
31331
+ };
31332
+ sharedRegisterType = function _sharedRegisterType(rawType, registeredInstance, options) {
31333
+ if (options === void 0) {
31334
+ options = {};
31335
+ }
31336
+ var name = registeredInstance.name;
31337
+ if (!rawType) {
31338
+ throwBindingError("type \"" + name + "\" must have a positive integer typeid pointer");
31339
+ }
31340
+ if (registeredTypes.hasOwnProperty(rawType)) {
31341
+ if (options.ignoreDuplicateRegistrations) {
31342
+ return;
31343
+ } else {
31344
+ throwBindingError("Cannot register type '" + name + "' twice");
31345
+ }
31346
+ }
31347
+ registeredTypes[rawType] = registeredInstance;
31348
+ delete typeDependencies[rawType];
31349
+ if (awaitingDependencies.hasOwnProperty(rawType)) {
31350
+ var callbacks = awaitingDependencies[rawType];
31351
+ delete awaitingDependencies[rawType];
31352
+ callbacks.forEach(function (cb) {
31353
+ return cb();
31354
+ });
31355
+ }
31356
+ };
31357
+ _createWasm = function _createWasm3() {
31358
+ _createWasm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
31359
+ var _wasmBinaryFile;
31360
+ var receiveInstance, receiveInstantiationResult, info, result, exports;
31361
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
31362
+ while (1) switch (_context5.prev = _context5.next) {
31363
+ case 0:
31364
+ receiveInstantiationResult = function _receiveInstantiation(result) {
31365
+ // 'result' is a ResultObject object which has both the module and instance.
31366
+ // receiveInstance() will swap in the exports (to Module.asm) so they can be called
31367
+ // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.
31368
+ // When the regression is fixed, can restore the above PTHREADS-enabled path.
31369
+ return receiveInstance(result['instance']);
31370
+ };
31371
+ receiveInstance = function _receiveInstance(instance, module) {
31372
+ wasmExports = instance.exports;
31373
+ wasmMemory = wasmExports['memory'];
31374
+ updateMemoryViews();
31375
+ wasmTable = wasmExports['__indirect_function_table'];
31376
+ assignWasmExports(wasmExports);
31377
+ removeRunDependency();
31378
+ return wasmExports;
31379
+ }; // Load the wasm module and create an instance of using native support in the JS engine.
31380
+ // handle a generated wasm instance, receiving its exports and
31381
+ // performing other necessary setup
31382
+ /** @param {WebAssembly.Module=} module*/
31383
+ // wait for the pthread pool (if any)
31384
+ addRunDependency();
31385
+
31386
+ // Prefer streaming instantiation if available.
31387
+ info = getWasmImports();
31388
+ (_wasmBinaryFile = wasmBinaryFile) != null ? _wasmBinaryFile : wasmBinaryFile = findWasmBinary();
31389
+ _context5.next = 7;
31390
+ return instantiateAsync(wasmBinary, wasmBinaryFile, info);
31391
+ case 7:
31392
+ result = _context5.sent;
31393
+ exports = receiveInstantiationResult(result);
31394
+ return _context5.abrupt("return", exports);
31395
+ case 10:
31396
+ case "end":
31397
+ return _context5.stop();
31398
+ }
31399
+ }, _callee5);
31400
+ }));
31401
+ return _createWasm.apply(this, arguments);
31402
+ };
31403
+ createWasm = function _createWasm2() {
31404
+ return _createWasm.apply(this, arguments);
31405
+ };
31406
+ getWasmImports = function _getWasmImports() {
31407
+ // prepare imports
31408
+ return {
31409
+ env: wasmImports,
31410
+ wasi_snapshot_preview1: wasmImports
31411
+ };
31412
+ };
31413
+ _instantiateAsync = function _instantiateAsync3() {
31414
+ _instantiateAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(binary, binaryFile, imports) {
31415
+ var response, instantiationResult;
31416
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
31417
+ while (1) switch (_context4.prev = _context4.next) {
31418
+ case 0:
31419
+ _context4.prev = 0;
31420
+ response = fetch(binaryFile, {
31421
+ credentials: 'same-origin'
31422
+ });
31423
+ _context4.next = 4;
31424
+ return WebAssembly.instantiateStreaming(response, imports);
31425
+ case 4:
31426
+ instantiationResult = _context4.sent;
31427
+ return _context4.abrupt("return", instantiationResult);
31428
+ case 8:
31429
+ _context4.prev = 8;
31430
+ _context4.t0 = _context4["catch"](0);
31431
+ // We expect the most common failure cause to be a bad MIME type for the binary,
31432
+ // in which case falling back to ArrayBuffer instantiation should work.
31433
+ err("wasm streaming compile failed: " + _context4.t0);
31434
+ err('falling back to ArrayBuffer instantiation');
31435
+ // fall back of instantiateArrayBuffer below
31436
+ case 12:
31437
+ return _context4.abrupt("return", instantiateArrayBuffer(binaryFile, imports));
31438
+ case 13:
31439
+ case "end":
31440
+ return _context4.stop();
31441
+ }
31442
+ }, _callee4, null, [[0, 8]]);
31443
+ }));
31444
+ return _instantiateAsync.apply(this, arguments);
31445
+ };
31446
+ instantiateAsync = function _instantiateAsync2(_x6, _x7, _x8) {
31447
+ return _instantiateAsync.apply(this, arguments);
31448
+ };
31449
+ _instantiateArrayBuffer = function _instantiateArrayBuff2() {
31450
+ _instantiateArrayBuffer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(binaryFile, imports) {
31451
+ var binary, instance;
31452
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
31453
+ while (1) switch (_context3.prev = _context3.next) {
31454
+ case 0:
31455
+ _context3.prev = 0;
31456
+ _context3.next = 3;
31457
+ return getWasmBinary(binaryFile);
31458
+ case 3:
31459
+ binary = _context3.sent;
31460
+ _context3.next = 6;
31461
+ return WebAssembly.instantiate(binary, imports);
31462
+ case 6:
31463
+ instance = _context3.sent;
31464
+ return _context3.abrupt("return", instance);
31465
+ case 10:
31466
+ _context3.prev = 10;
31467
+ _context3.t0 = _context3["catch"](0);
31468
+ err("failed to asynchronously prepare wasm: " + _context3.t0);
31469
+ abort(_context3.t0);
31470
+ case 14:
31471
+ case "end":
31472
+ return _context3.stop();
31473
+ }
31474
+ }, _callee3, null, [[0, 10]]);
31475
+ }));
31476
+ return _instantiateArrayBuffer.apply(this, arguments);
31477
+ };
31478
+ instantiateArrayBuffer = function _instantiateArrayBuff(_x4, _x5) {
31479
+ return _instantiateArrayBuffer.apply(this, arguments);
31480
+ };
31481
+ _getWasmBinary = function _getWasmBinary3() {
31482
+ _getWasmBinary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(binaryFile) {
31483
+ var response;
31484
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
31485
+ while (1) switch (_context2.prev = _context2.next) {
31486
+ case 0:
31487
+ _context2.prev = 0;
31488
+ _context2.next = 3;
31489
+ return readAsync(binaryFile);
31490
+ case 3:
31491
+ response = _context2.sent;
31492
+ return _context2.abrupt("return", new Uint8Array(response));
31493
+ case 7:
31494
+ _context2.prev = 7;
31495
+ _context2.t0 = _context2["catch"](0);
31496
+ case 9:
31497
+ return _context2.abrupt("return", getBinarySync());
31498
+ case 10:
31499
+ case "end":
31500
+ return _context2.stop();
31501
+ }
31502
+ }, _callee2, null, [[0, 7]]);
31503
+ }));
31504
+ return _getWasmBinary.apply(this, arguments);
31505
+ };
31506
+ getWasmBinary = function _getWasmBinary2(_x3) {
31507
+ return _getWasmBinary.apply(this, arguments);
31508
+ };
31509
+ getBinarySync = function _getBinarySync(file) {
31510
+ throw 'both async and sync fetching of the wasm failed';
31511
+ };
31512
+ findWasmBinary = function _findWasmBinary() {
31513
+ if (Module['locateFile']) {
31514
+ return locateFile('MediaInfoModule.wasm');
31515
+ }
31516
+ // Use bundler-friendly `new URL(..., import.meta.url)` pattern; works in browsers too.
31517
+ return new URL('MediaInfoModule.wasm', (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('sdk2.umd.development.js', document.baseURI).href))).href;
31518
+ };
31519
+ abort = function _abort(what) {
31520
+ what = 'Aborted(' + what + ')';
31521
+ // TODO(sbc): Should we remove printing and leave it up to whoever
31522
+ // catches the exception?
31523
+ err(what);
31524
+ ABORT = true;
31525
+ what += '. Build with -sASSERTIONS for more info.';
31526
+
31527
+ // Use a wasm runtime error, because a JS error might be seen as a foreign
31528
+ // exception, which means we'd run destructors on it. We need the error to
31529
+ // simply make the program stop.
31530
+ // FIXME This approach does not work in Wasm EH because it currently does not assume
31531
+ // all RuntimeErrors are from traps; it decides whether a RuntimeError is from
31532
+ // a trap or not based on a hidden field within the object. So at the moment
31533
+ // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that
31534
+ // allows this in the wasm spec.
31535
+
31536
+ // Suppress closure compiler warning here. Closure compiler's builtin extern
31537
+ // definition for WebAssembly.RuntimeError claims it takes no arguments even
31538
+ // though it can.
31539
+ // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.
31540
+ /** @suppress {checkTypes} */
31541
+ var e = new WebAssembly.RuntimeError(what);
31542
+ readyPromiseReject == null || readyPromiseReject(e);
31543
+ // Throw the error whether or not MODULARIZE is set because abort is used
31544
+ // in code paths apart from instantiation where an exception is expected
31545
+ // to be thrown when abort is called.
31546
+ throw e;
31547
+ };
31548
+ removeRunDependency = function _removeRunDependency(id) {
31549
+ runDependencies--;
31550
+ if (runDependencies == 0) {
31551
+ if (dependenciesFulfilled) {
31552
+ var callback = dependenciesFulfilled;
31553
+ dependenciesFulfilled = null;
31554
+ callback(); // can add another dependenciesFulfilled
31555
+ }
31556
+ }
31557
+ };
31558
+ addRunDependency = function _addRunDependency(id) {
31559
+ runDependencies++;
31560
+ };
31561
+ initRuntime = function _initRuntime() {
31562
+ runtimeInitialized = true;
31563
+
31564
+ // No ATINITS hooks
31565
+
31566
+ wasmExports['__wasm_call_ctors']();
31567
+
31568
+ // No ATPOSTCTORS hooks
31569
+ };
31570
+ updateMemoryViews = function _updateMemoryViews() {
31571
+ var b = wasmMemory.buffer;
31572
+ HEAP8 = new Int8Array(b);
31573
+ HEAP16 = new Int16Array(b);
31574
+ HEAPU8 = new Uint8Array(b);
31575
+ HEAPU16 = new Uint16Array(b);
31576
+ HEAP32 = new Int32Array(b);
31577
+ HEAPU32 = new Uint32Array(b);
31578
+ HEAPF32 = new Float32Array(b);
31579
+ HEAPF64 = new Float64Array(b);
31580
+ HEAP64 = new BigInt64Array(b);
31581
+ HEAPU64 = new BigUint64Array(b);
31582
+ };
31583
+ locateFile = function _locateFile(path) {
31584
+ if (Module['locateFile']) {
31585
+ return Module['locateFile'](path, scriptDirectory);
31586
+ }
31587
+ return scriptDirectory + path;
31588
+ };
31589
+ if (moduleArg === void 0) {
31590
+ moduleArg = {};
31591
+ }
31592
+ // include: shell.js
31593
+ // The Module object: Our interface to the outside world. We import
31594
+ // and export values on it. There are various ways Module can be used:
31595
+ // 1. Not defined. We create it here
31596
+ // 2. A function parameter, function(moduleArg) => Promise<Module>
31597
+ // 3. pre-run appended it, var Module = {}; ..generated code..
31598
+ // 4. External script tag defines var Module.
31599
+ // We need to check if Module already exists (e.g. case 3 above).
31600
+ // Substitution will be replaced with actual code on later stage of the build,
31601
+ // this way Closure Compiler will not mangle it (e.g. case 4. above).
31602
+ // Note that if you want to run closure, and also to use Module
31603
+ // after the generated code, you will need to define var Module = {};
31604
+ // before the code. Then that object will be used in the code, and you
31605
+ // can continue to use Module afterwards as well.
31606
+ Module = moduleArg;
31607
+ thisProgram = './this.program';
31608
+ _scriptName = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('sdk2.umd.development.js', document.baseURI).href)); // `/` should be present at the end if `scriptDirectory` is not empty
31609
+ scriptDirectory = ''; // Hooks that are implemented differently in different runtime environments.
31610
+ try {
31611
+ scriptDirectory = new URL('.', _scriptName).href; // includes trailing slash
31612
+ } catch (_unused2) {
31613
+ // Must be a `blob:` or `data:` URL (e.g. `blob:http://site.com/etc/etc`), we cannot
31614
+ // infer anything from them.
31615
+ }
31616
+ // include: web_or_worker_shell_read.js
31617
+ readAsync = /*#__PURE__*/function () {
31618
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url) {
31619
+ var response;
31620
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
31621
+ while (1) switch (_context.prev = _context.next) {
31622
+ case 0:
31623
+ _context.next = 2;
31624
+ return fetch(url, {
31625
+ credentials: 'same-origin'
31626
+ });
31627
+ case 2:
31628
+ response = _context.sent;
31629
+ if (!response.ok) {
31630
+ _context.next = 5;
31631
+ break;
31632
+ }
31633
+ return _context.abrupt("return", response.arrayBuffer());
31634
+ case 5:
31635
+ throw new Error(response.status + ' : ' + response.url);
31636
+ case 6:
31637
+ case "end":
31638
+ return _context.stop();
31639
+ }
31640
+ }, _callee);
31641
+ }));
31642
+ return function readAsync(_x2) {
31643
+ return _ref.apply(this, arguments);
31644
+ };
31645
+ }();
31646
+ // end include: web_or_worker_shell_read.js
31647
+ out = console.log.bind(console);
31648
+ err = console.error.bind(console); // end include: shell.js
31649
+ // include: preamble.js
31650
+ // === Preamble library stuff ===
31651
+ // Documentation for the public APIs defined in this file must be updated in:
31652
+ // site/source/docs/api_reference/preamble.js.rst
31653
+ // A prebuilt local version of the documentation is available at:
31654
+ // site/build/text/docs/api_reference/preamble.js.txt
31655
+ // You can also build docs locally as HTML or other formats in site/
31656
+ // An online HTML version (which may be of a different version of Emscripten)
31657
+ // is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html
31658
+ // Wasm globals
31659
+ //========================================
31660
+ // Runtime essentials
31661
+ //========================================
31662
+ // whether we are quitting the application. no code should run after this.
31663
+ // set in exit() and abort()
31664
+ ABORT = false; // include: runtime_common.js
31665
+ // include: runtime_stack_check.js
31666
+ // end include: runtime_stack_check.js
31667
+ // include: runtime_exceptions.js
31668
+ // end include: runtime_exceptions.js
31669
+ // include: runtime_debug.js
31670
+ // end include: runtime_debug.js
31671
+ // Memory management
31672
+ // BigInt64Array type is not correctly defined in closure
31673
+ runtimeInitialized = false;
31674
+ // A counter of dependencies for calling run(). If we need to
31675
+ // do asynchronous work before running, increment this and
31676
+ // decrement it. Incrementing must happen in a place like
31677
+ // Module.preRun (used by emcc to add file preloading).
31678
+ // Note that you can add dependencies in preRun, even though
31679
+ // it happens right before run - run will be postponed until
31680
+ // the dependencies are met.
31681
+ runDependencies = 0;
31682
+ dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled
31683
+ /** @param {string|number=} what */
31684
+ // Create the wasm instance.
31685
+ // Receives the wasm imports, returns the exports.
31686
+ __abort_js = function __abort_js() {
31687
+ return abort('');
31688
+ };
31689
+ AsciiToString = function AsciiToString(ptr) {
31690
+ var str = '';
31691
+ while (1) {
31692
+ var ch = HEAPU8[ptr++];
31693
+ if (!ch) return str;
31694
+ str += String.fromCharCode(ch);
31695
+ }
31696
+ };
31697
+ awaitingDependencies = {};
31698
+ registeredTypes = {};
31699
+ typeDependencies = {};
31700
+ BindingError = /*#__PURE__*/function (_Error) {
31701
+ function BindingError(message) {
31702
+ var _this2;
31703
+ _this2 = _Error.call(this, message) || this;
31704
+ _this2.name = 'BindingError';
31705
+ return _this2;
31706
+ }
31707
+ _inheritsLoose(BindingError, _Error);
31708
+ return BindingError;
31709
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
31710
+ throwBindingError = function throwBindingError(message) {
31711
+ throw new BindingError(message);
31712
+ };
31713
+ /** @param {Object=} options */
31714
+ /** @param {Object=} options */
31715
+ integerReadValueFromPointer = function integerReadValueFromPointer(name, width, signed) {
31716
+ // integers are quite common, so generate very specialized functions
31717
+ switch (width) {
31718
+ case 1:
31719
+ return signed ? function (pointer) {
31720
+ return HEAP8[pointer];
31721
+ } : function (pointer) {
31722
+ return HEAPU8[pointer];
31723
+ };
31724
+ case 2:
31725
+ return signed ? function (pointer) {
31726
+ return HEAP16[pointer >> 1];
31727
+ } : function (pointer) {
31728
+ return HEAPU16[pointer >> 1];
31729
+ };
31730
+ case 4:
31731
+ return signed ? function (pointer) {
31732
+ return HEAP32[pointer >> 2];
31733
+ } : function (pointer) {
31734
+ return HEAPU32[pointer >> 2];
31735
+ };
31736
+ case 8:
31737
+ return signed ? function (pointer) {
31738
+ return HEAP64[pointer >> 3];
31739
+ } : function (pointer) {
31740
+ return HEAPU64[pointer >> 3];
31741
+ };
31742
+ default:
31743
+ throw new TypeError("invalid integer width (" + width + "): " + name);
31744
+ }
31745
+ };
31746
+ /** @suppress {globalThis} */
31747
+ __embind_register_bigint = function __embind_register_bigint(primitiveType, name, size, minRange, maxRange) {
31748
+ name = AsciiToString(name);
31749
+ var isUnsignedType = minRange === 0n;
31750
+ var fromWireType = function fromWireType(value) {
31751
+ return value;
31752
+ };
31753
+ if (isUnsignedType) {
31754
+ // uint64 get converted to int64 in ABI, fix them up like we do for 32-bit integers.
31755
+ var bitSize = size * 8;
31756
+ fromWireType = function fromWireType(value) {
31757
+ return BigInt.asUintN(bitSize, value);
31758
+ };
31759
+ maxRange = fromWireType(maxRange);
31760
+ }
31761
+ registerType(primitiveType, {
31762
+ name: name,
31763
+ fromWireType: fromWireType,
31764
+ toWireType: function toWireType(destructors, value) {
31765
+ if (typeof value == 'number') {
31766
+ value = BigInt(value);
31767
+ }
31768
+ return value;
31769
+ },
31770
+ readValueFromPointer: integerReadValueFromPointer(name, size, !isUnsignedType),
31771
+ destructorFunction: null // This type does not need a destructor
31772
+ });
31773
+ };
31774
+ /** @suppress {globalThis} */
31775
+ __embind_register_bool = function __embind_register_bool(rawType, name, trueValue, falseValue) {
31776
+ name = AsciiToString(name);
31777
+ registerType(rawType, {
31778
+ name: name,
31779
+ fromWireType: function fromWireType(wt) {
31780
+ // ambiguous emscripten ABI: sometimes return values are
31781
+ // true or false, and sometimes integers (0 or 1)
31782
+ return !!wt;
31783
+ },
31784
+ toWireType: function toWireType(destructors, o) {
31785
+ return o ? trueValue : falseValue;
31786
+ },
31787
+ readValueFromPointer: function readValueFromPointer(pointer) {
31788
+ return this.fromWireType(HEAPU8[pointer]);
31789
+ },
31790
+ destructorFunction: null // This type does not need a destructor
31791
+ });
31792
+ };
31793
+ shallowCopyInternalPointer = function shallowCopyInternalPointer(o) {
31794
+ return {
31795
+ count: o.count,
31796
+ deleteScheduled: o.deleteScheduled,
31797
+ preservePointerOnDelete: o.preservePointerOnDelete,
31798
+ ptr: o.ptr,
31799
+ ptrType: o.ptrType,
31800
+ smartPtr: o.smartPtr,
31801
+ smartPtrType: o.smartPtrType
31802
+ };
31803
+ };
31804
+ throwInstanceAlreadyDeleted = function throwInstanceAlreadyDeleted(obj) {
31805
+ function getInstanceTypeName(handle) {
31806
+ return handle.$$.ptrType.registeredClass.name;
31807
+ }
31808
+ throwBindingError(getInstanceTypeName(obj) + ' instance already deleted');
31809
+ };
31810
+ finalizationRegistry = false;
31811
+ detachFinalizer = function detachFinalizer(handle) {};
31812
+ runDestructor = function runDestructor($$) {
31813
+ if ($$.smartPtr) {
31814
+ $$.smartPtrType.rawDestructor($$.smartPtr);
31815
+ } else {
31816
+ $$.ptrType.registeredClass.rawDestructor($$.ptr);
31817
+ }
31818
+ };
31819
+ releaseClassHandle = function releaseClassHandle($$) {
31820
+ $$.count.value -= 1;
31821
+ var toDelete = 0 === $$.count.value;
31822
+ if (toDelete) {
31823
+ runDestructor($$);
31824
+ }
31825
+ };
31826
+ _attachFinalizer = function attachFinalizer(handle) {
31827
+ if ('undefined' === typeof FinalizationRegistry) {
31828
+ _attachFinalizer = function attachFinalizer(handle) {
31829
+ return handle;
31830
+ };
31831
+ return handle;
31832
+ }
31833
+ // If the running environment has a FinalizationRegistry (see
31834
+ // https://github.com/tc39/proposal-weakrefs), then attach finalizers
31835
+ // for class handles. We check for the presence of FinalizationRegistry
31836
+ // at run-time, not build-time.
31837
+ finalizationRegistry = new FinalizationRegistry(function (info) {
31838
+ releaseClassHandle(info.$$);
31839
+ });
31840
+ _attachFinalizer = function attachFinalizer(handle) {
31841
+ var $$ = handle.$$;
31842
+ var hasSmartPtr = !!$$.smartPtr;
31843
+ if (hasSmartPtr) {
31844
+ // We should not call the destructor on raw pointers in case other code expects the pointee to live
31845
+ var info = {
31846
+ $$: $$
31847
+ };
31848
+ finalizationRegistry.register(handle, info, handle);
31849
+ }
31850
+ return handle;
31851
+ };
31852
+ detachFinalizer = function detachFinalizer(handle) {
31853
+ return finalizationRegistry.unregister(handle);
31854
+ };
31855
+ return _attachFinalizer(handle);
31856
+ };
31857
+ init_ClassHandle = function init_ClassHandle() {
31858
+ var proto = ClassHandle.prototype;
31859
+ Object.assign(proto, {
31860
+ isAliasOf: function isAliasOf(other) {
31861
+ if (!(this instanceof ClassHandle)) {
31862
+ return false;
31863
+ }
31864
+ if (!(other instanceof ClassHandle)) {
31865
+ return false;
31866
+ }
31867
+ var leftClass = this.$$.ptrType.registeredClass;
31868
+ var left = this.$$.ptr;
31869
+ other.$$ = /** @type {Object} */other.$$;
31870
+ var rightClass = other.$$.ptrType.registeredClass;
31871
+ var right = other.$$.ptr;
31872
+ while (leftClass.baseClass) {
31873
+ left = leftClass.upcast(left);
31874
+ leftClass = leftClass.baseClass;
31875
+ }
31876
+ while (rightClass.baseClass) {
31877
+ right = rightClass.upcast(right);
31878
+ rightClass = rightClass.baseClass;
31879
+ }
31880
+ return leftClass === rightClass && left === right;
31881
+ },
31882
+ clone: function clone() {
31883
+ if (!this.$$.ptr) {
31884
+ throwInstanceAlreadyDeleted(this);
31885
+ }
31886
+ if (this.$$.preservePointerOnDelete) {
31887
+ this.$$.count.value += 1;
31888
+ return this;
31889
+ } else {
31890
+ var clone = _attachFinalizer(Object.create(Object.getPrototypeOf(this), {
31891
+ $$: {
31892
+ value: shallowCopyInternalPointer(this.$$)
31893
+ }
31894
+ }));
31895
+ clone.$$.count.value += 1;
31896
+ clone.$$.deleteScheduled = false;
31897
+ return clone;
31898
+ }
31899
+ },
31900
+ "delete": function _delete() {
31901
+ if (!this.$$.ptr) {
31902
+ throwInstanceAlreadyDeleted(this);
31903
+ }
31904
+ if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) {
31905
+ throwBindingError('Object already scheduled for deletion');
31906
+ }
31907
+ detachFinalizer(this);
31908
+ releaseClassHandle(this.$$);
31909
+ if (!this.$$.preservePointerOnDelete) {
31910
+ this.$$.smartPtr = undefined;
31911
+ this.$$.ptr = undefined;
31912
+ }
31913
+ },
31914
+ isDeleted: function isDeleted() {
31915
+ return !this.$$.ptr;
31916
+ },
31917
+ deleteLater: function deleteLater() {
31918
+ if (!this.$$.ptr) {
31919
+ throwInstanceAlreadyDeleted(this);
31920
+ }
31921
+ if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) {
31922
+ throwBindingError('Object already scheduled for deletion');
31923
+ }
31924
+ this.$$.deleteScheduled = true;
31925
+ return this;
31926
+ }
31927
+ });
31928
+
31929
+ // Support `using ...` from https://github.com/tc39/proposal-explicit-resource-management.
31930
+ var symbolDispose = Symbol.dispose;
31931
+ if (symbolDispose) {
31932
+ proto[symbolDispose] = proto['delete'];
31933
+ }
31934
+ };
31935
+ /** @constructor */
31936
+ createNamedFunction = function createNamedFunction(name, func) {
31937
+ return Object.defineProperty(func, 'name', {
31938
+ value: name
31939
+ });
31940
+ };
31941
+ registeredPointers = {};
31942
+ ensureOverloadTable = function ensureOverloadTable(proto, methodName, humanName) {
31943
+ if (undefined === proto[methodName].overloadTable) {
31944
+ var prevFunc = proto[methodName];
31945
+ // Inject an overload resolver function that routes to the appropriate overload based on the number of arguments.
31946
+ proto[methodName] = function () {
31947
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
31948
+ args[_key] = arguments[_key];
31949
+ }
31950
+ // TODO This check can be removed in -O3 level "unsafe" optimizations.
31951
+ if (!proto[methodName].overloadTable.hasOwnProperty(args.length)) {
31952
+ throwBindingError("Function '" + humanName + "' called with an invalid number of arguments (" + args.length + ") - expects one of (" + proto[methodName].overloadTable + ")!");
31953
+ }
31954
+ return proto[methodName].overloadTable[args.length].apply(this, args);
31955
+ };
31956
+ // Move the previous function into the overload table.
31957
+ proto[methodName].overloadTable = [];
31958
+ proto[methodName].overloadTable[prevFunc.argCount] = prevFunc;
31959
+ }
31960
+ };
31961
+ /** @param {number=} numArguments */
31962
+ exposePublicSymbol = function exposePublicSymbol(name, value, numArguments) {
31963
+ if (Module.hasOwnProperty(name)) {
31964
+ {
31965
+ throwBindingError("Cannot register public name '" + name + "' twice");
31966
+ }
31967
+
31968
+ // We are exposing a function with the same name as an existing function. Create an overload table and a function selector
31969
+ // that routes between the two.
31970
+ ensureOverloadTable(Module, name, name);
31971
+ if (Module[name].overloadTable.hasOwnProperty(numArguments)) {
31972
+ throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (" + numArguments + ")!");
31973
+ }
31974
+ // Add the new function into the overload table.
31975
+ Module[name].overloadTable[numArguments] = value;
31976
+ } else {
31977
+ Module[name] = value;
31978
+ Module[name].argCount = numArguments;
31979
+ }
31980
+ };
31981
+ char_0 = 48;
31982
+ char_9 = 57;
31983
+ makeLegalFunctionName = function makeLegalFunctionName(name) {
31984
+ name = name.replace(/[^a-zA-Z0-9_]/g, '$');
31985
+ var f = name.charCodeAt(0);
31986
+ if (f >= char_0 && f <= char_9) {
31987
+ return "_" + name;
31988
+ }
31989
+ return name;
31990
+ };
31991
+ /** @constructor */
31992
+ upcastPointer = function upcastPointer(ptr, ptrClass, desiredClass) {
31993
+ while (ptrClass !== desiredClass) {
31994
+ if (!ptrClass.upcast) {
31995
+ throwBindingError("Expected null or instance of " + desiredClass.name + ", got an instance of " + ptrClass.name);
31996
+ }
31997
+ ptr = ptrClass.upcast(ptr);
31998
+ ptrClass = ptrClass.baseClass;
31999
+ }
32000
+ return ptr;
32001
+ };
32002
+ embindRepr = function embindRepr(v) {
32003
+ if (v === null) {
32004
+ return 'null';
32005
+ }
32006
+ var t = typeof v;
32007
+ if (t === 'object' || t === 'array' || t === 'function') {
32008
+ return v.toString();
32009
+ } else {
32010
+ return '' + v;
32011
+ }
32012
+ };
32013
+ /** @suppress {globalThis} */
32014
+ /** @suppress {globalThis} */
32015
+ /** @suppress {globalThis} */
32016
+ /** @suppress {globalThis} */
32017
+ _downcastPointer = function downcastPointer(ptr, ptrClass, desiredClass) {
32018
+ if (ptrClass === desiredClass) {
32019
+ return ptr;
32020
+ }
32021
+ if (undefined === desiredClass.baseClass) {
32022
+ return null; // no conversion
32023
+ }
32024
+ var rv = _downcastPointer(ptr, ptrClass, desiredClass.baseClass);
32025
+ if (rv === null) {
32026
+ return null;
32027
+ }
32028
+ return desiredClass.downcast(rv);
32029
+ };
32030
+ registeredInstances = {};
32031
+ getBasestPointer = function getBasestPointer(class_, ptr) {
32032
+ if (ptr === undefined) {
32033
+ throwBindingError('ptr should not be undefined');
32034
+ }
32035
+ while (class_.baseClass) {
32036
+ ptr = class_.upcast(ptr);
32037
+ class_ = class_.baseClass;
32038
+ }
32039
+ return ptr;
32040
+ };
32041
+ getInheritedInstance = function getInheritedInstance(class_, ptr) {
32042
+ ptr = getBasestPointer(class_, ptr);
32043
+ return registeredInstances[ptr];
32044
+ };
32045
+ InternalError = /*#__PURE__*/function (_Error2) {
32046
+ function InternalError(message) {
32047
+ var _this3;
32048
+ _this3 = _Error2.call(this, message) || this;
32049
+ _this3.name = 'InternalError';
32050
+ return _this3;
32051
+ }
32052
+ _inheritsLoose(InternalError, _Error2);
32053
+ return InternalError;
32054
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
32055
+ throwInternalError = function throwInternalError(message) {
32056
+ throw new InternalError(message);
32057
+ };
32058
+ makeClassHandle = function makeClassHandle(prototype, record) {
32059
+ if (!record.ptrType || !record.ptr) {
32060
+ throwInternalError('makeClassHandle requires ptr and ptrType');
32061
+ }
32062
+ var hasSmartPtrType = !!record.smartPtrType;
32063
+ var hasSmartPtr = !!record.smartPtr;
32064
+ if (hasSmartPtrType !== hasSmartPtr) {
32065
+ throwInternalError('Both smartPtrType and smartPtr must be specified');
32066
+ }
32067
+ record.count = {
32068
+ value: 1
32069
+ };
32070
+ return _attachFinalizer(Object.create(prototype, {
32071
+ $$: {
32072
+ value: record,
32073
+ writable: true
32074
+ }
32075
+ }));
32076
+ };
32077
+ /** @suppress {globalThis} */
32078
+ init_RegisteredPointer = function init_RegisteredPointer() {
32079
+ Object.assign(RegisteredPointer.prototype, {
32080
+ getPointee: function getPointee(ptr) {
32081
+ if (this.rawGetPointee) {
32082
+ ptr = this.rawGetPointee(ptr);
32083
+ }
32084
+ return ptr;
32085
+ },
32086
+ destructor: function destructor(ptr) {
32087
+ var _this$rawDestructor;
32088
+ (_this$rawDestructor = this.rawDestructor) == null || _this$rawDestructor.call(this, ptr);
32089
+ },
32090
+ readValueFromPointer: readPointer,
32091
+ fromWireType: RegisteredPointer_fromWireType
32092
+ });
32093
+ };
32094
+ /** @constructor
32095
+ @param {*=} pointeeType,
32096
+ @param {*=} sharingPolicy,
32097
+ @param {*=} rawGetPointee,
32098
+ @param {*=} rawConstructor,
32099
+ @param {*=} rawShare,
32100
+ @param {*=} rawDestructor,
32101
+ */
32102
+ /** @param {number=} numArguments */
32103
+ replacePublicSymbol = function replacePublicSymbol(name, value, numArguments) {
32104
+ if (!Module.hasOwnProperty(name)) {
32105
+ throwInternalError('Replacing nonexistent public symbol');
32106
+ }
32107
+ // If there's an overload table for this symbol, replace the symbol in the overload table instead.
32108
+ if (undefined !== Module[name].overloadTable && undefined !== numArguments) ;else {
32109
+ Module[name] = value;
32110
+ Module[name].argCount = numArguments;
32111
+ }
32112
+ };
32113
+ wasmTableMirror = [];
32114
+ /** @type {WebAssembly.Table} */
32115
+ getWasmTableEntry = function getWasmTableEntry(funcPtr) {
32116
+ var func = wasmTableMirror[funcPtr];
32117
+ if (!func) {
32118
+ /** @suppress {checkTypes} */
32119
+ wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr);
32120
+ }
32121
+ return func;
32122
+ };
32123
+ embind__requireFunction = function embind__requireFunction(signature, rawFunction, isAsync) {
32124
+ signature = AsciiToString(signature);
32125
+ function makeDynCaller() {
32126
+ var rtn = getWasmTableEntry(rawFunction);
32127
+ return rtn;
32128
+ }
32129
+ var fp = makeDynCaller();
32130
+ if (typeof fp != 'function') {
32131
+ throwBindingError("unknown function pointer with signature " + signature + ": " + rawFunction);
32132
+ }
32133
+ return fp;
32134
+ };
32135
+ UnboundTypeError = /*#__PURE__*/function (_Error3) {
32136
+ function UnboundTypeError() {
32137
+ return _Error3.apply(this, arguments) || this;
32138
+ }
32139
+ _inheritsLoose(UnboundTypeError, _Error3);
32140
+ return UnboundTypeError;
32141
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
32142
+ getTypeName = function getTypeName(type) {
32143
+ var ptr = ___getTypeName(type);
32144
+ var rv = AsciiToString(ptr);
32145
+ _free(ptr);
32146
+ return rv;
32147
+ };
32148
+ throwUnboundTypeError = function throwUnboundTypeError(message, types) {
32149
+ var unboundTypes = [];
32150
+ var seen = {};
32151
+ function visit(type) {
32152
+ if (seen[type]) {
32153
+ return;
32154
+ }
32155
+ if (registeredTypes[type]) {
32156
+ return;
32157
+ }
32158
+ if (typeDependencies[type]) {
32159
+ typeDependencies[type].forEach(visit);
32160
+ return;
32161
+ }
32162
+ unboundTypes.push(type);
32163
+ seen[type] = true;
32164
+ }
32165
+ types.forEach(visit);
32166
+ throw new UnboundTypeError(message + ": " + unboundTypes.map(getTypeName).join([', ']));
32167
+ };
32168
+ whenDependentTypesAreResolved = function whenDependentTypesAreResolved(myTypes, dependentTypes, getTypeConverters) {
32169
+ myTypes.forEach(function (type) {
32170
+ return typeDependencies[type] = dependentTypes;
32171
+ });
32172
+ function onComplete(typeConverters) {
32173
+ var myTypeConverters = getTypeConverters(typeConverters);
32174
+ if (myTypeConverters.length !== myTypes.length) {
32175
+ throwInternalError('Mismatched type converter count');
32176
+ }
32177
+ for (var i = 0; i < myTypes.length; ++i) {
32178
+ registerType(myTypes[i], myTypeConverters[i]);
32179
+ }
32180
+ }
32181
+ var typeConverters = new Array(dependentTypes.length);
32182
+ var unregisteredTypes = [];
32183
+ var registered = 0;
32184
+ dependentTypes.forEach(function (dt, i) {
32185
+ if (registeredTypes.hasOwnProperty(dt)) {
32186
+ typeConverters[i] = registeredTypes[dt];
32187
+ } else {
32188
+ unregisteredTypes.push(dt);
32189
+ if (!awaitingDependencies.hasOwnProperty(dt)) {
32190
+ awaitingDependencies[dt] = [];
32191
+ }
32192
+ awaitingDependencies[dt].push(function () {
32193
+ typeConverters[i] = registeredTypes[dt];
32194
+ ++registered;
32195
+ if (registered === unregisteredTypes.length) {
32196
+ onComplete(typeConverters);
32197
+ }
32198
+ });
32199
+ }
32200
+ });
32201
+ if (0 === unregisteredTypes.length) {
32202
+ onComplete(typeConverters);
32203
+ }
32204
+ };
32205
+ __embind_register_class = function __embind_register_class(rawType, rawPointerType, rawConstPointerType, baseClassRawType, getActualTypeSignature, getActualType, upcastSignature, upcast, downcastSignature, downcast, name, destructorSignature, rawDestructor) {
32206
+ name = AsciiToString(name);
32207
+ getActualType = embind__requireFunction(getActualTypeSignature, getActualType);
32208
+ upcast && (upcast = embind__requireFunction(upcastSignature, upcast));
32209
+ downcast && (downcast = embind__requireFunction(downcastSignature, downcast));
32210
+ rawDestructor = embind__requireFunction(destructorSignature, rawDestructor);
32211
+ var legalFunctionName = makeLegalFunctionName(name);
32212
+ exposePublicSymbol(legalFunctionName, function () {
32213
+ // this code cannot run if baseClassRawType is zero
32214
+ throwUnboundTypeError("Cannot construct " + name + " due to unbound types", [baseClassRawType]);
32215
+ });
32216
+ whenDependentTypesAreResolved([rawType, rawPointerType, rawConstPointerType], baseClassRawType ? [baseClassRawType] : [], function (base) {
32217
+ base = base[0];
32218
+ var baseClass;
32219
+ var basePrototype;
32220
+ if (baseClassRawType) {
32221
+ baseClass = base.registeredClass;
32222
+ basePrototype = baseClass.instancePrototype;
32223
+ } else {
32224
+ basePrototype = ClassHandle.prototype;
32225
+ }
32226
+ var constructor = createNamedFunction(name, function () {
32227
+ if (Object.getPrototypeOf(this) !== instancePrototype) {
32228
+ throw new BindingError("Use 'new' to construct " + name);
32229
+ }
32230
+ if (undefined === registeredClass.constructor_body) {
32231
+ throw new BindingError(name + " has no accessible constructor");
32232
+ }
32233
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
32234
+ args[_key2] = arguments[_key2];
32235
+ }
32236
+ var body = registeredClass.constructor_body[args.length];
32237
+ if (undefined === body) {
32238
+ throw new BindingError("Tried to invoke ctor of " + name + " with invalid number of parameters (" + args.length + ") - expected (" + Object.keys(registeredClass.constructor_body).toString() + ") parameters instead!");
32239
+ }
32240
+ return body.apply(this, args);
32241
+ });
32242
+ var instancePrototype = Object.create(basePrototype, {
32243
+ constructor: {
32244
+ value: constructor
32245
+ }
32246
+ });
32247
+ constructor.prototype = instancePrototype;
32248
+ var registeredClass = new RegisteredClass(name, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast);
32249
+ if (registeredClass.baseClass) {
32250
+ var _registeredClass$base, _registeredClass$base2;
32251
+ // Keep track of class hierarchy. Used to allow sub-classes to inherit class functions.
32252
+ (_registeredClass$base2 = (_registeredClass$base = registeredClass.baseClass).__derivedClasses) != null ? _registeredClass$base2 : _registeredClass$base.__derivedClasses = [];
32253
+ registeredClass.baseClass.__derivedClasses.push(registeredClass);
32254
+ }
32255
+ var referenceConverter = new RegisteredPointer(name, registeredClass, true, false, false);
32256
+ var pointerConverter = new RegisteredPointer(name + '*', registeredClass, false, false, false);
32257
+ var constPointerConverter = new RegisteredPointer(name + ' const*', registeredClass, false, true, false);
32258
+ registeredPointers[rawType] = {
32259
+ pointerType: pointerConverter,
32260
+ constPointerType: constPointerConverter
32261
+ };
32262
+ replacePublicSymbol(legalFunctionName, constructor);
32263
+ return [referenceConverter, pointerConverter, constPointerConverter];
32264
+ });
32265
+ };
32266
+ heap32VectorToArray = function heap32VectorToArray(count, firstElement) {
32267
+ var array = [];
32268
+ for (var i = 0; i < count; i++) {
32269
+ // TODO(https://github.com/emscripten-core/emscripten/issues/17310):
32270
+ // Find a way to hoist the `>> 2` or `>> 3` out of this loop.
32271
+ array.push(HEAPU32[firstElement + i * 4 >> 2]);
32272
+ }
32273
+ return array;
32274
+ };
32275
+ runDestructors = function runDestructors(destructors) {
32276
+ while (destructors.length) {
32277
+ var ptr = destructors.pop();
32278
+ var del = destructors.pop();
32279
+ del(ptr);
32280
+ }
32281
+ };
32282
+ __embind_register_class_constructor = function __embind_register_class_constructor(rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) {
32283
+ var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
32284
+ invoker = embind__requireFunction(invokerSignature, invoker);
32285
+ whenDependentTypesAreResolved([], [rawClassType], function (classType) {
32286
+ classType = classType[0];
32287
+ var humanName = "constructor " + classType.name;
32288
+ if (undefined === classType.registeredClass.constructor_body) {
32289
+ classType.registeredClass.constructor_body = [];
32290
+ }
32291
+ if (undefined !== classType.registeredClass.constructor_body[argCount - 1]) {
32292
+ throw new BindingError("Cannot register multiple constructors with identical number of parameters (" + (argCount - 1) + ") for class '" + classType.name + "'! Overload resolution is currently only performed using the parameter count, not actual type info!");
32293
+ }
32294
+ classType.registeredClass.constructor_body[argCount - 1] = function () {
32295
+ throwUnboundTypeError("Cannot construct " + classType.name + " due to unbound types", rawArgTypes);
32296
+ };
32297
+ whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) {
32298
+ // Insert empty slot for context type (argTypes[1]).
32299
+ argTypes.splice(1, 0, null);
32300
+ classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction(humanName, argTypes, null, invoker, rawConstructor);
32301
+ return [];
32302
+ });
32303
+ return [];
32304
+ });
32305
+ };
32306
+ getFunctionName = function getFunctionName(signature) {
32307
+ signature = signature.trim();
32308
+ var argsIndex = signature.indexOf('(');
32309
+ if (argsIndex === -1) return signature;
32310
+ return signature.slice(0, argsIndex);
32311
+ };
32312
+ __embind_register_class_function = function __embind_register_class_function(rawClassType, methodName, argCount, rawArgTypesAddr,
32313
+ // [ReturnType, ThisType, Args...]
32314
+ invokerSignature, rawInvoker, context, isPureVirtual, isAsync, isNonnullReturn) {
32315
+ var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
32316
+ methodName = AsciiToString(methodName);
32317
+ methodName = getFunctionName(methodName);
32318
+ rawInvoker = embind__requireFunction(invokerSignature, rawInvoker, isAsync);
32319
+ whenDependentTypesAreResolved([], [rawClassType], function (classType) {
32320
+ classType = classType[0];
32321
+ var humanName = classType.name + "." + methodName;
32322
+ if (methodName.startsWith('@@')) {
32323
+ methodName = Symbol[methodName.substring(2)];
32324
+ }
32325
+ if (isPureVirtual) {
32326
+ classType.registeredClass.pureVirtualFunctions.push(methodName);
32327
+ }
32328
+ function unboundTypesHandler() {
32329
+ throwUnboundTypeError("Cannot call " + humanName + " due to unbound types", rawArgTypes);
32330
+ }
32331
+ var proto = classType.registeredClass.instancePrototype;
32332
+ var method = proto[methodName];
32333
+ if (undefined === method || undefined === method.overloadTable && method.className !== classType.name && method.argCount === argCount - 2) {
32334
+ // This is the first overload to be registered, OR we are replacing a
32335
+ // function in the base class with a function in the derived class.
32336
+ unboundTypesHandler.argCount = argCount - 2;
32337
+ unboundTypesHandler.className = classType.name;
32338
+ proto[methodName] = unboundTypesHandler;
32339
+ } else {
32340
+ // There was an existing function with the same name registered. Set up
32341
+ // a function overload routing table.
32342
+ ensureOverloadTable(proto, methodName, humanName);
32343
+ proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler;
32344
+ }
32345
+ whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) {
32346
+ var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context, isAsync);
32347
+
32348
+ // Replace the initial unbound-handler-stub function with the
32349
+ // appropriate member function, now that all types are resolved. If
32350
+ // multiple overloads are registered for this function, the function
32351
+ // goes into an overload table.
32352
+ if (undefined === proto[methodName].overloadTable) {
32353
+ // Set argCount in case an overload is registered later
32354
+ memberFunction.argCount = argCount - 2;
32355
+ proto[methodName] = memberFunction;
32356
+ } else {
32357
+ proto[methodName].overloadTable[argCount - 2] = memberFunction;
32358
+ }
32359
+ return [];
32360
+ });
32361
+ return [];
32362
+ });
32363
+ };
32364
+ emval_freelist = [];
32365
+ emval_handles = [0, 1,, 1, null, 1, true, 1, false, 1];
32366
+ __emval_decref = function __emval_decref(handle) {
32367
+ if (handle > 9 && 0 === --emval_handles[handle + 1]) {
32368
+ emval_handles[handle] = undefined;
32369
+ emval_freelist.push(handle);
32370
+ }
32371
+ };
32372
+ Emval = {
32373
+ toValue: function toValue(handle) {
32374
+ if (!handle) {
32375
+ throwBindingError("Cannot use deleted val. handle = " + handle);
32376
+ }
32377
+ return emval_handles[handle];
32378
+ },
32379
+ toHandle: function toHandle(value) {
32380
+ switch (value) {
32381
+ case undefined:
32382
+ return 2;
32383
+ case null:
32384
+ return 4;
32385
+ case true:
32386
+ return 6;
32387
+ case false:
32388
+ return 8;
32389
+ default:
32390
+ {
32391
+ var handle = emval_freelist.pop() || emval_handles.length;
32392
+ emval_handles[handle] = value;
32393
+ emval_handles[handle + 1] = 1;
32394
+ return handle;
32395
+ }
32396
+ }
32397
+ }
32398
+ };
32399
+ EmValType = {
32400
+ name: 'emscripten::val',
32401
+ fromWireType: function fromWireType(handle) {
32402
+ var rv = Emval.toValue(handle);
32403
+ __emval_decref(handle);
32404
+ return rv;
32405
+ },
32406
+ toWireType: function toWireType(destructors, value) {
32407
+ return Emval.toHandle(value);
32408
+ },
32409
+ readValueFromPointer: readPointer,
32410
+ destructorFunction: null // This type does not need a destructor
32411
+
32412
+ // TODO: do we need a deleteObject here? write a test where
32413
+ // emval is passed into JS via an interface
32414
+ };
32415
+ __embind_register_emval = function __embind_register_emval(rawType) {
32416
+ return registerType(rawType, EmValType);
32417
+ };
32418
+ floatReadValueFromPointer = function floatReadValueFromPointer(name, width) {
32419
+ switch (width) {
32420
+ case 4:
32421
+ return function (pointer) {
32422
+ return this.fromWireType(HEAPF32[pointer >> 2]);
32423
+ };
32424
+ case 8:
32425
+ return function (pointer) {
32426
+ return this.fromWireType(HEAPF64[pointer >> 3]);
32427
+ };
32428
+ default:
32429
+ throw new TypeError("invalid float width (" + width + "): " + name);
32430
+ }
32431
+ };
32432
+ __embind_register_float = function __embind_register_float(rawType, name, size) {
32433
+ name = AsciiToString(name);
32434
+ registerType(rawType, {
32435
+ name: name,
32436
+ fromWireType: function fromWireType(value) {
32437
+ return value;
32438
+ },
32439
+ toWireType: function toWireType(destructors, value) {
32440
+ // The VM will perform JS to Wasm value conversion, according to the spec:
32441
+ // https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue
32442
+ return value;
32443
+ },
32444
+ readValueFromPointer: floatReadValueFromPointer(name, size),
32445
+ destructorFunction: null // This type does not need a destructor
32446
+ });
32447
+ };
32448
+ /** @suppress {globalThis} */
32449
+ __embind_register_integer = function __embind_register_integer(primitiveType, name, size, minRange, maxRange) {
32450
+ name = AsciiToString(name);
32451
+ var isUnsignedType = minRange === 0;
32452
+ var fromWireType = function fromWireType(value) {
32453
+ return value;
32454
+ };
32455
+ if (isUnsignedType) {
32456
+ var bitshift = 32 - 8 * size;
32457
+ fromWireType = function fromWireType(value) {
32458
+ return value << bitshift >>> bitshift;
32459
+ };
32460
+ maxRange = fromWireType(maxRange);
32461
+ }
32462
+ registerType(primitiveType, {
32463
+ name: name,
32464
+ fromWireType: fromWireType,
32465
+ toWireType: function toWireType(destructors, value) {
32466
+ // The VM will perform JS to Wasm value conversion, according to the spec:
32467
+ // https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue
32468
+ return value;
32469
+ },
32470
+ readValueFromPointer: integerReadValueFromPointer(name, size, minRange !== 0),
32471
+ destructorFunction: null // This type does not need a destructor
32472
+ });
32473
+ };
32474
+ __embind_register_memory_view = function __embind_register_memory_view(rawType, dataTypeIndex, name) {
32475
+ var typeMapping = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array];
32476
+ var TA = typeMapping[dataTypeIndex];
32477
+ function decodeMemoryView(handle) {
32478
+ var size = HEAPU32[handle >> 2];
32479
+ var data = HEAPU32[handle + 4 >> 2];
32480
+ return new TA(HEAP8.buffer, data, size);
32481
+ }
32482
+ name = AsciiToString(name);
32483
+ registerType(rawType, {
32484
+ name: name,
32485
+ fromWireType: decodeMemoryView,
32486
+ readValueFromPointer: decodeMemoryView
32487
+ }, {
32488
+ ignoreDuplicateRegistrations: true
32489
+ });
32490
+ };
32491
+ __embind_register_smart_ptr = function __embind_register_smart_ptr(rawType, rawPointeeType, name, sharingPolicy, getPointeeSignature, rawGetPointee, constructorSignature, rawConstructor, shareSignature, rawShare, destructorSignature, rawDestructor) {
32492
+ name = AsciiToString(name);
32493
+ rawGetPointee = embind__requireFunction(getPointeeSignature, rawGetPointee);
32494
+ rawConstructor = embind__requireFunction(constructorSignature, rawConstructor);
32495
+ rawShare = embind__requireFunction(shareSignature, rawShare);
32496
+ rawDestructor = embind__requireFunction(destructorSignature, rawDestructor);
32497
+ whenDependentTypesAreResolved([rawType], [rawPointeeType], function (pointeeType) {
32498
+ pointeeType = pointeeType[0];
32499
+ var registeredPointer = new RegisteredPointer(name, pointeeType.registeredClass, false, false,
32500
+ // smart pointer properties
32501
+ true, pointeeType, sharingPolicy, rawGetPointee, rawConstructor, rawShare, rawDestructor);
32502
+ return [registeredPointer];
32503
+ });
32504
+ };
32505
+ stringToUTF8Array = function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
32506
+ // Parameter maxBytesToWrite is not optional. Negative values, 0, null,
32507
+ // undefined and false each don't write out any bytes.
32508
+ if (!(maxBytesToWrite > 0)) return 0;
32509
+ var startIdx = outIdx;
32510
+ var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
32511
+ for (var i = 0; i < str.length; ++i) {
32512
+ // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description
32513
+ // and https://www.ietf.org/rfc/rfc2279.txt
32514
+ // and https://tools.ietf.org/html/rfc3629
32515
+ var u = str.codePointAt(i);
32516
+ if (u <= 0x7f) {
32517
+ if (outIdx >= endIdx) break;
32518
+ heap[outIdx++] = u;
32519
+ } else if (u <= 0x7ff) {
32520
+ if (outIdx + 1 >= endIdx) break;
32521
+ heap[outIdx++] = 0xc0 | u >> 6;
32522
+ heap[outIdx++] = 0x80 | u & 63;
32523
+ } else if (u <= 0xffff) {
32524
+ if (outIdx + 2 >= endIdx) break;
32525
+ heap[outIdx++] = 0xe0 | u >> 12;
32526
+ heap[outIdx++] = 0x80 | u >> 6 & 63;
32527
+ heap[outIdx++] = 0x80 | u & 63;
32528
+ } else {
32529
+ if (outIdx + 3 >= endIdx) break;
32530
+ heap[outIdx++] = 0xf0 | u >> 18;
32531
+ heap[outIdx++] = 0x80 | u >> 12 & 63;
32532
+ heap[outIdx++] = 0x80 | u >> 6 & 63;
32533
+ heap[outIdx++] = 0x80 | u & 63;
32534
+ // Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16.
32535
+ // We need to manually skip over the second code unit for correct iteration.
32536
+ i++;
32537
+ }
32538
+ }
32539
+ // Null-terminate the pointer to the buffer.
32540
+ heap[outIdx] = 0;
32541
+ return outIdx - startIdx;
32542
+ };
32543
+ stringToUTF8 = function stringToUTF8(str, outPtr, maxBytesToWrite) {
32544
+ return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
32545
+ };
32546
+ lengthBytesUTF8 = function lengthBytesUTF8(str) {
32547
+ var len = 0;
32548
+ for (var i = 0; i < str.length; ++i) {
32549
+ // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
32550
+ // unit, not a Unicode code point of the character! So decode
32551
+ // UTF16->UTF32->UTF8.
32552
+ // See http://unicode.org/faq/utf_bom.html#utf16-3
32553
+ var c = str.charCodeAt(i); // possibly a lead surrogate
32554
+ if (c <= 0x7f) {
32555
+ len++;
32556
+ } else if (c <= 0x7ff) {
32557
+ len += 2;
32558
+ } else if (c >= 0xd800 && c <= 0xdfff) {
32559
+ len += 4;
32560
+ ++i;
32561
+ } else {
32562
+ len += 3;
32563
+ }
32564
+ }
32565
+ return len;
32566
+ };
32567
+ UTF8Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder() : undefined;
32568
+ findStringEnd = function findStringEnd(heapOrArray, idx, maxBytesToRead, ignoreNul) {
32569
+ var maxIdx = idx + maxBytesToRead;
32570
+ if (ignoreNul) return maxIdx;
32571
+ // TextDecoder needs to know the byte length in advance, it doesn't stop on
32572
+ // null terminator by itself.
32573
+ // As a tiny code save trick, compare idx against maxIdx using a negation,
32574
+ // so that maxBytesToRead=undefined/NaN means Infinity.
32575
+ while (heapOrArray[idx] && !(idx >= maxIdx)) ++idx;
32576
+ return idx;
32577
+ };
32578
+ /**
32579
+ * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given
32580
+ * array that contains uint8 values, returns a copy of that string as a
32581
+ * Javascript String object.
32582
+ * heapOrArray is either a regular array, or a JavaScript typed array view.
32583
+ * @param {number=} idx
32584
+ * @param {number=} maxBytesToRead
32585
+ * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
32586
+ * @return {string}
32587
+ */
32588
+ UTF8ArrayToString = function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead, ignoreNul) {
32589
+ if (idx === void 0) {
32590
+ idx = 0;
32591
+ }
32592
+ var endPtr = findStringEnd(heapOrArray, idx, maxBytesToRead, ignoreNul);
32593
+
32594
+ // When using conditional TextDecoder, skip it for short strings as the overhead of the native call is not worth it.
32595
+ if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
32596
+ return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
32597
+ }
32598
+ var str = '';
32599
+ while (idx < endPtr) {
32600
+ // For UTF8 byte structure, see:
32601
+ // http://en.wikipedia.org/wiki/UTF-8#Description
32602
+ // https://www.ietf.org/rfc/rfc2279.txt
32603
+ // https://tools.ietf.org/html/rfc3629
32604
+ var u0 = heapOrArray[idx++];
32605
+ if (!(u0 & 0x80)) {
32606
+ str += String.fromCharCode(u0);
32607
+ continue;
32608
+ }
32609
+ var u1 = heapOrArray[idx++] & 63;
32610
+ if ((u0 & 0xe0) == 0xc0) {
32611
+ str += String.fromCharCode((u0 & 31) << 6 | u1);
32612
+ continue;
32613
+ }
32614
+ var u2 = heapOrArray[idx++] & 63;
32615
+ if ((u0 & 0xf0) == 0xe0) {
32616
+ u0 = (u0 & 15) << 12 | u1 << 6 | u2;
32617
+ } else {
32618
+ u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
32619
+ }
32620
+ if (u0 < 0x10000) {
32621
+ str += String.fromCharCode(u0);
32622
+ } else {
32623
+ var ch = u0 - 0x10000;
32624
+ str += String.fromCharCode(0xd800 | ch >> 10, 0xdc00 | ch & 0x3ff);
32625
+ }
32626
+ }
32627
+ return str;
32628
+ };
32629
+ /**
32630
+ * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
32631
+ * emscripten HEAP, returns a copy of that string as a Javascript String object.
32632
+ *
32633
+ * @param {number} ptr
32634
+ * @param {number=} maxBytesToRead - An optional length that specifies the
32635
+ * maximum number of bytes to read. You can omit this parameter to scan the
32636
+ * string until the first 0 byte. If maxBytesToRead is passed, and the string
32637
+ * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
32638
+ * string will cut short at that byte index.
32639
+ * @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
32640
+ * @return {string}
32641
+ */
32642
+ UTF8ToString = function UTF8ToString(ptr, maxBytesToRead, ignoreNul) {
32643
+ return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead, ignoreNul) : '';
32644
+ };
32645
+ __embind_register_std_string = function __embind_register_std_string(rawType, name) {
32646
+ name = AsciiToString(name);
32647
+ registerType(rawType, {
32648
+ name: name,
32649
+ // For some method names we use string keys here since they are part of
32650
+ // the public/external API and/or used by the runtime-generated code.
32651
+ fromWireType: function fromWireType(value) {
32652
+ var length = HEAPU32[value >> 2];
32653
+ var payload = value + 4;
32654
+ var str;
32655
+ {
32656
+ str = UTF8ToString(payload, length, true);
32657
+ }
32658
+ _free(value);
32659
+ return str;
32660
+ },
32661
+ toWireType: function toWireType(destructors, value) {
32662
+ if (value instanceof ArrayBuffer) {
32663
+ value = new Uint8Array(value);
32664
+ }
32665
+ var length;
32666
+ var valueIsOfTypeString = typeof value == 'string';
32667
+
32668
+ // We accept `string` or array views with single byte elements
32669
+ if (!(valueIsOfTypeString || ArrayBuffer.isView(value) && value.BYTES_PER_ELEMENT == 1)) {
32670
+ throwBindingError('Cannot pass non-string to std::string');
32671
+ }
32672
+ if (valueIsOfTypeString) {
32673
+ length = lengthBytesUTF8(value);
32674
+ } else {
32675
+ length = value.length;
32676
+ }
32677
+
32678
+ // assumes POINTER_SIZE alignment
32679
+ var base = _malloc(4 + length + 1);
32680
+ var ptr = base + 4;
32681
+ HEAPU32[base >> 2] = length;
32682
+ if (valueIsOfTypeString) {
32683
+ {
32684
+ stringToUTF8(value, ptr, length + 1);
32685
+ }
32686
+ } else {
32687
+ HEAPU8.set(value, ptr);
32688
+ }
32689
+ if (destructors !== null) {
32690
+ destructors.push(_free, base);
32691
+ }
32692
+ return base;
32693
+ },
32694
+ readValueFromPointer: readPointer,
32695
+ destructorFunction: function destructorFunction(ptr) {
32696
+ _free(ptr);
32697
+ }
32698
+ });
32699
+ };
32700
+ UTF16Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf-16le') : undefined;
32701
+ UTF16ToString = function UTF16ToString(ptr, maxBytesToRead, ignoreNul) {
32702
+ var idx = ptr >> 1;
32703
+ var endIdx = findStringEnd(HEAPU16, idx, maxBytesToRead / 2, ignoreNul);
32704
+
32705
+ // When using conditional TextDecoder, skip it for short strings as the overhead of the native call is not worth it.
32706
+ if (endIdx - idx > 16 && UTF16Decoder) return UTF16Decoder.decode(HEAPU16.subarray(idx, endIdx));
32707
+
32708
+ // Fallback: decode without UTF16Decoder
32709
+ var str = '';
32710
+
32711
+ // If maxBytesToRead is not passed explicitly, it will be undefined, and the
32712
+ // for-loop's condition will always evaluate to true. The loop is then
32713
+ // terminated on the first null char.
32714
+ for (var i = idx; i < endIdx; ++i) {
32715
+ var codeUnit = HEAPU16[i];
32716
+ // fromCharCode constructs a character from a UTF-16 code unit, so we can
32717
+ // pass the UTF16 string right through.
32718
+ str += String.fromCharCode(codeUnit);
32719
+ }
32720
+ return str;
32721
+ };
32722
+ stringToUTF16 = function stringToUTF16(str, outPtr, maxBytesToWrite) {
32723
+ var _maxBytesToWrite;
32724
+ // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
32725
+ (_maxBytesToWrite = maxBytesToWrite) != null ? _maxBytesToWrite : maxBytesToWrite = 0x7fffffff;
32726
+ if (maxBytesToWrite < 2) return 0;
32727
+ maxBytesToWrite -= 2; // Null terminator.
32728
+ var startPtr = outPtr;
32729
+ var numCharsToWrite = maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length;
32730
+ for (var i = 0; i < numCharsToWrite; ++i) {
32731
+ // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.
32732
+ var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
32733
+ HEAP16[outPtr >> 1] = codeUnit;
32734
+ outPtr += 2;
32735
+ }
32736
+ // Null-terminate the pointer to the HEAP.
32737
+ HEAP16[outPtr >> 1] = 0;
32738
+ return outPtr - startPtr;
32739
+ };
32740
+ lengthBytesUTF16 = function lengthBytesUTF16(str) {
32741
+ return str.length * 2;
32742
+ };
32743
+ UTF32ToString = function UTF32ToString(ptr, maxBytesToRead, ignoreNul) {
32744
+ var str = '';
32745
+ var startIdx = ptr >> 2;
32746
+ // If maxBytesToRead is not passed explicitly, it will be undefined, and this
32747
+ // will always evaluate to true. This saves on code size.
32748
+ for (var i = 0; !(i >= maxBytesToRead / 4); i++) {
32749
+ var utf32 = HEAPU32[startIdx + i];
32750
+ if (!utf32 && !ignoreNul) break;
32751
+ str += String.fromCodePoint(utf32);
32752
+ }
32753
+ return str;
32754
+ };
32755
+ stringToUTF32 = function stringToUTF32(str, outPtr, maxBytesToWrite) {
32756
+ var _maxBytesToWrite2;
32757
+ // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
32758
+ (_maxBytesToWrite2 = maxBytesToWrite) != null ? _maxBytesToWrite2 : maxBytesToWrite = 0x7fffffff;
32759
+ if (maxBytesToWrite < 4) return 0;
32760
+ var startPtr = outPtr;
32761
+ var endPtr = startPtr + maxBytesToWrite - 4;
32762
+ for (var i = 0; i < str.length; ++i) {
32763
+ var codePoint = str.codePointAt(i);
32764
+ // Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16.
32765
+ // We need to manually skip over the second code unit for correct iteration.
32766
+ if (codePoint > 0xffff) {
32767
+ i++;
32768
+ }
32769
+ HEAP32[outPtr >> 2] = codePoint;
32770
+ outPtr += 4;
32771
+ if (outPtr + 4 > endPtr) break;
32772
+ }
32773
+ // Null-terminate the pointer to the HEAP.
32774
+ HEAP32[outPtr >> 2] = 0;
32775
+ return outPtr - startPtr;
32776
+ };
32777
+ lengthBytesUTF32 = function lengthBytesUTF32(str) {
32778
+ var len = 0;
32779
+ for (var i = 0; i < str.length; ++i) {
32780
+ var codePoint = str.codePointAt(i);
32781
+ // Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16.
32782
+ // We need to manually skip over the second code unit for correct iteration.
32783
+ if (codePoint > 0xffff) {
32784
+ i++;
32785
+ }
32786
+ len += 4;
32787
+ }
32788
+ return len;
32789
+ };
32790
+ __embind_register_std_wstring = function __embind_register_std_wstring(rawType, charSize, name) {
32791
+ name = AsciiToString(name);
32792
+ var decodeString, encodeString, lengthBytesUTF;
32793
+ if (charSize === 2) {
32794
+ decodeString = UTF16ToString;
32795
+ encodeString = stringToUTF16;
32796
+ lengthBytesUTF = lengthBytesUTF16;
32797
+ } else {
32798
+ decodeString = UTF32ToString;
32799
+ encodeString = stringToUTF32;
32800
+ lengthBytesUTF = lengthBytesUTF32;
32801
+ }
32802
+ registerType(rawType, {
32803
+ name: name,
32804
+ fromWireType: function fromWireType(value) {
32805
+ // Code mostly taken from _embind_register_std_string fromWireType
32806
+ var length = HEAPU32[value >> 2];
32807
+ var str = decodeString(value + 4, length * charSize, true);
32808
+ _free(value);
32809
+ return str;
32810
+ },
32811
+ toWireType: function toWireType(destructors, value) {
32812
+ if (!(typeof value == 'string')) {
32813
+ throwBindingError("Cannot pass non-string to C++ string type " + name);
32814
+ }
32815
+
32816
+ // assumes POINTER_SIZE alignment
32817
+ var length = lengthBytesUTF(value);
32818
+ var ptr = _malloc(4 + length + charSize);
32819
+ HEAPU32[ptr >> 2] = length / charSize;
32820
+ encodeString(value, ptr + 4, length + charSize);
32821
+ if (destructors !== null) {
32822
+ destructors.push(_free, ptr);
32823
+ }
32824
+ return ptr;
32825
+ },
32826
+ readValueFromPointer: readPointer,
32827
+ destructorFunction: function destructorFunction(ptr) {
32828
+ _free(ptr);
32829
+ }
32830
+ });
32831
+ };
32832
+ __embind_register_void = function __embind_register_void(rawType, name) {
32833
+ name = AsciiToString(name);
32834
+ registerType(rawType, {
32835
+ isVoid: true,
32836
+ // void return values can be optimized out sometimes
32837
+ name: name,
32838
+ fromWireType: function fromWireType() {
32839
+ return undefined;
32840
+ },
32841
+ // TODO: assert if anything else is given?
32842
+ toWireType: function toWireType(destructors, o) {
32843
+ return undefined;
32844
+ }
32845
+ });
32846
+ };
32847
+ emval_methodCallers = [];
32848
+ emval_addMethodCaller = function emval_addMethodCaller(caller) {
32849
+ var id = emval_methodCallers.length;
32850
+ emval_methodCallers.push(caller);
32851
+ return id;
32852
+ };
32853
+ requireRegisteredType = function requireRegisteredType(rawType, humanName) {
32854
+ var impl = registeredTypes[rawType];
32855
+ if (undefined === impl) {
32856
+ throwBindingError(humanName + " has unknown type " + getTypeName(rawType));
32857
+ }
32858
+ return impl;
32859
+ };
32860
+ emval_lookupTypes = function emval_lookupTypes(argCount, argTypes) {
32861
+ var a = new Array(argCount);
32862
+ for (var i = 0; i < argCount; ++i) {
32863
+ a[i] = requireRegisteredType(HEAPU32[argTypes + i * 4 >> 2], "parameter " + i);
32864
+ }
32865
+ return a;
32866
+ };
32867
+ emval_returnValue = function emval_returnValue(toReturnWire, destructorsRef, handle) {
32868
+ var destructors = [];
32869
+ var result = toReturnWire(destructors, handle);
32870
+ if (destructors.length) {
32871
+ // void, primitives and any other types w/o destructors don't need to allocate a handle
32872
+ HEAPU32[destructorsRef >> 2] = Emval.toHandle(destructors);
32873
+ }
32874
+ return result;
32875
+ };
32876
+ emval_symbols = {};
32877
+ getStringOrSymbol = function getStringOrSymbol(address) {
32878
+ var symbol = emval_symbols[address];
32879
+ if (symbol === undefined) {
32880
+ return AsciiToString(address);
32881
+ }
32882
+ return symbol;
32883
+ };
32884
+ __emval_create_invoker = function __emval_create_invoker(argCount, argTypesPtr, kind) {
32885
+ var GenericWireTypeSize = 8;
32886
+ var _emval_lookupTypes = emval_lookupTypes(argCount, argTypesPtr),
32887
+ retType = _emval_lookupTypes[0],
32888
+ argTypes = _emval_lookupTypes.slice(1);
32889
+ var toReturnWire = retType.toWireType.bind(retType);
32890
+ var argFromPtr = argTypes.map(function (type) {
32891
+ return type.readValueFromPointer.bind(type);
32892
+ });
32893
+ argCount--; // remove the extracted return type
32894
+
32895
+ var captures = {
32896
+ toValue: Emval.toValue
32897
+ };
32898
+ var args = argFromPtr.map(function (argFromPtr, i) {
32899
+ var captureName = "argFromPtr" + i;
32900
+ captures[captureName] = argFromPtr;
32901
+ return captureName + "(args" + (i ? '+' + i * GenericWireTypeSize : '') + ")";
32902
+ });
32903
+ var functionBody;
32904
+ switch (kind) {
32905
+ case 0:
32906
+ functionBody = 'toValue(handle)';
32907
+ break;
32908
+ case 2:
32909
+ functionBody = 'new (toValue(handle))';
32910
+ break;
32911
+ case 3:
32912
+ functionBody = '';
32913
+ break;
32914
+ case 1:
32915
+ captures['getStringOrSymbol'] = getStringOrSymbol;
32916
+ functionBody = 'toValue(handle)[getStringOrSymbol(methodName)]';
32917
+ break;
32918
+ }
32919
+ functionBody += "(" + args + ")";
32920
+ if (!retType.isVoid) {
32921
+ captures['toReturnWire'] = toReturnWire;
32922
+ captures['emval_returnValue'] = emval_returnValue;
32923
+ functionBody = "return emval_returnValue(toReturnWire, destructorsRef, " + functionBody + ")";
32924
+ }
32925
+ functionBody = "return function (handle, methodName, destructorsRef, args) {\n " + functionBody + "\n }";
32926
+ var invokerFunction = new Function(Object.keys(captures), functionBody).apply(void 0, Object.values(captures));
32927
+ var functionName = "methodCaller<(" + argTypes.map(function (t) {
32928
+ return t.name;
32929
+ }) + ") => " + retType.name + ">";
32930
+ return emval_addMethodCaller(createNamedFunction(functionName, invokerFunction));
32931
+ };
32932
+ __emval_incref = function __emval_incref(handle) {
32933
+ if (handle > 9) {
32934
+ emval_handles[handle + 1] += 1;
32935
+ }
32936
+ };
32937
+ __emval_invoke = function __emval_invoke(caller, handle, methodName, destructorsRef, args) {
32938
+ return emval_methodCallers[caller](handle, methodName, destructorsRef, args);
32939
+ };
32940
+ __emval_run_destructors = function __emval_run_destructors(handle) {
32941
+ var destructors = Emval.toValue(handle);
32942
+ runDestructors(destructors);
32943
+ __emval_decref(handle);
32944
+ };
32945
+ INT53_MAX = 9007199254740992;
32946
+ INT53_MIN = -9007199254740992;
32947
+ bigintToI53Checked = function bigintToI53Checked(num) {
32948
+ return num < INT53_MIN || num > INT53_MAX ? NaN : Number(num);
32949
+ };
32950
+ __tzset_js = function __tzset_js(timezone, daylight, std_name, dst_name) {
32951
+ // TODO: Use (malleable) environment variables instead of system settings.
32952
+ var currentYear = new Date().getFullYear();
32953
+ var winter = new Date(currentYear, 0, 1);
32954
+ var summer = new Date(currentYear, 6, 1);
32955
+ var winterOffset = winter.getTimezoneOffset();
32956
+ var summerOffset = summer.getTimezoneOffset();
32957
+
32958
+ // Local standard timezone offset. Local standard time is not adjusted for
32959
+ // daylight savings. This code uses the fact that getTimezoneOffset returns
32960
+ // a greater value during Standard Time versus Daylight Saving Time (DST).
32961
+ // Thus it determines the expected output during Standard Time, and it
32962
+ // compares whether the output of the given date the same (Standard) or less
32963
+ // (DST).
32964
+ var stdTimezoneOffset = Math.max(winterOffset, summerOffset);
32965
+
32966
+ // timezone is specified as seconds west of UTC ("The external variable
32967
+ // `timezone` shall be set to the difference, in seconds, between
32968
+ // Coordinated Universal Time (UTC) and local standard time."), the same
32969
+ // as returned by stdTimezoneOffset.
32970
+ // See http://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html
32971
+ HEAPU32[timezone >> 2] = stdTimezoneOffset * 60;
32972
+ HEAP32[daylight >> 2] = Number(winterOffset != summerOffset);
32973
+ var extractZone = function extractZone(timezoneOffset) {
32974
+ // Why inverse sign?
32975
+ // Read here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset
32976
+ var sign = timezoneOffset >= 0 ? '-' : '+';
32977
+ var absOffset = Math.abs(timezoneOffset);
32978
+ var hours = String(Math.floor(absOffset / 60)).padStart(2, '0');
32979
+ var minutes = String(absOffset % 60).padStart(2, '0');
32980
+ return "UTC" + sign + hours + minutes;
32981
+ };
32982
+ var winterName = extractZone(winterOffset);
32983
+ var summerName = extractZone(summerOffset);
32984
+ if (summerOffset < winterOffset) {
32985
+ // Northern hemisphere
32986
+ stringToUTF8(winterName, std_name, 17);
32987
+ stringToUTF8(summerName, dst_name, 17);
32988
+ } else {
32989
+ stringToUTF8(winterName, dst_name, 17);
32990
+ stringToUTF8(summerName, std_name, 17);
32991
+ }
32992
+ };
32993
+ _emscripten_date_now = function _emscripten_date_now() {
32994
+ return Date.now();
32995
+ };
32996
+ getHeapMax = function getHeapMax() {
32997
+ return (
32998
+ // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate
32999
+ // full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side
33000
+ // for any code that deals with heap sizes, which would require special
33001
+ // casing all heap size related code to treat 0 specially.
33002
+ 2147483648
33003
+ );
33004
+ };
33005
+ alignMemory = function alignMemory(size, alignment) {
33006
+ return Math.ceil(size / alignment) * alignment;
33007
+ };
33008
+ growMemory = function growMemory(size) {
33009
+ var oldHeapSize = wasmMemory.buffer.byteLength;
33010
+ var pages = (size - oldHeapSize + 65535) / 65536 | 0;
33011
+ try {
33012
+ // round size grow request up to wasm page size (fixed 64KB per spec)
33013
+ wasmMemory.grow(pages); // .grow() takes a delta compared to the previous size
33014
+ updateMemoryViews();
33015
+ return 1; /*success*/
33016
+ } catch (e) {}
33017
+ // implicit 0 return to save code size (caller will cast "undefined" into 0
33018
+ // anyhow)
33019
+ };
33020
+ _emscripten_resize_heap = function _emscripten_resize_heap(requestedSize) {
33021
+ var oldSize = HEAPU8.length;
33022
+ // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.
33023
+ requestedSize >>>= 0;
33024
+ // With multithreaded builds, races can happen (another thread might increase the size
33025
+ // in between), so return a failure, and let the caller retry.
33026
+
33027
+ // Memory resize rules:
33028
+ // 1. Always increase heap size to at least the requested size, rounded up
33029
+ // to next page multiple.
33030
+ // 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap
33031
+ // geometrically: increase the heap size according to
33032
+ // MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most
33033
+ // overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB).
33034
+ // 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap
33035
+ // linearly: increase the heap size by at least
33036
+ // MEMORY_GROWTH_LINEAR_STEP bytes.
33037
+ // 3. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by
33038
+ // MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest
33039
+ // 4. If we were unable to allocate as much memory, it may be due to
33040
+ // over-eager decision to excessively reserve due to (3) above.
33041
+ // Hence if an allocation fails, cut down on the amount of excess
33042
+ // growth, in an attempt to succeed to perform a smaller allocation.
33043
+
33044
+ // A limit is set for how much we can grow. We should not exceed that
33045
+ // (the wasm binary specifies it, so if we tried, we'd fail anyhow).
33046
+ var maxHeapSize = getHeapMax();
33047
+ if (requestedSize > maxHeapSize) {
33048
+ return false;
33049
+ }
33050
+
33051
+ // Loop through potential heap size increases. If we attempt a too eager
33052
+ // reservation that fails, cut down on the attempted size and reserve a
33053
+ // smaller bump instead. (max 3 times, chosen somewhat arbitrarily)
33054
+ for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
33055
+ var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); // ensure geometric growth
33056
+ // but limit overreserving (default to capping at +96MB overgrowth at most)
33057
+ overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
33058
+ var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536));
33059
+ var replacement = growMemory(newSize);
33060
+ if (replacement) {
33061
+ return true;
33062
+ }
33063
+ }
33064
+ return false;
33065
+ };
33066
+ ENV = {};
33067
+ getExecutableName = function getExecutableName() {
33068
+ return thisProgram;
33069
+ };
33070
+ _getEnvStrings = function getEnvStrings() {
33071
+ if (!_getEnvStrings.strings) {
33072
+ // Default values.
33073
+ // Browser language detection #8751
33074
+ var lang = (typeof navigator == 'object' && navigator.language || 'C').replace('-', '_') + '.UTF-8';
33075
+ var env = {
33076
+ USER: 'web_user',
33077
+ LOGNAME: 'web_user',
33078
+ PATH: '/',
33079
+ PWD: '/',
33080
+ HOME: '/home/web_user',
33081
+ LANG: lang,
33082
+ _: getExecutableName()
33083
+ };
33084
+ // Apply the user-provided values, if any.
33085
+ for (var x in ENV) {
33086
+ // x is a key in ENV; if ENV[x] is undefined, that means it was
33087
+ // explicitly set to be so. We allow user code to do that to
33088
+ // force variables with default values to remain unset.
33089
+ if (ENV[x] === undefined) delete env[x];else env[x] = ENV[x];
33090
+ }
33091
+ var strings = [];
33092
+ for (var x in env) {
33093
+ strings.push(x + "=" + env[x]);
33094
+ }
33095
+ _getEnvStrings.strings = strings;
33096
+ }
33097
+ return _getEnvStrings.strings;
33098
+ };
33099
+ _environ_get = function _environ_get(__environ, environ_buf) {
33100
+ var bufSize = 0;
33101
+ var envp = 0;
33102
+ for (var _iterator2 = _createForOfIteratorHelperLoose(_getEnvStrings()), _step2; !(_step2 = _iterator2()).done;) {
33103
+ var string = _step2.value;
33104
+ var ptr = environ_buf + bufSize;
33105
+ HEAPU32[__environ + envp >> 2] = ptr;
33106
+ bufSize += stringToUTF8(string, ptr, Infinity) + 1;
33107
+ envp += 4;
33108
+ }
33109
+ return 0;
33110
+ };
33111
+ _environ_sizes_get = function _environ_sizes_get(penviron_count, penviron_buf_size) {
33112
+ var strings = _getEnvStrings();
33113
+ HEAPU32[penviron_count >> 2] = strings.length;
33114
+ var bufSize = 0;
33115
+ for (var _iterator3 = _createForOfIteratorHelperLoose(strings), _step3; !(_step3 = _iterator3()).done;) {
33116
+ var string = _step3.value;
33117
+ bufSize += lengthBytesUTF8(string) + 1;
33118
+ }
33119
+ HEAPU32[penviron_buf_size >> 2] = bufSize;
33120
+ return 0;
33121
+ };
33122
+ _fd_close = function _fd_close(fd) {
33123
+ return 52;
33124
+ };
33125
+ printCharBuffers = [null, [], []];
33126
+ printChar = function printChar(stream, curr) {
33127
+ var buffer = printCharBuffers[stream];
33128
+ if (curr === 0 || curr === 10) {
33129
+ (stream === 1 ? out : err)(UTF8ArrayToString(buffer));
33130
+ buffer.length = 0;
33131
+ } else {
33132
+ buffer.push(curr);
33133
+ }
33134
+ };
33135
+ _fd_write = function _fd_write(fd, iov, iovcnt, pnum) {
33136
+ // hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0
33137
+ var num = 0;
33138
+ for (var i = 0; i < iovcnt; i++) {
33139
+ var ptr = HEAPU32[iov >> 2];
33140
+ var len = HEAPU32[iov + 4 >> 2];
33141
+ iov += 8;
33142
+ for (var j = 0; j < len; j++) {
33143
+ printChar(fd, HEAPU8[ptr + j]);
33144
+ }
33145
+ num += len;
33146
+ }
33147
+ HEAPU32[pnum >> 2] = num;
33148
+ return 0;
33149
+ };
33150
+ init_ClassHandle();
33151
+ init_RegisteredPointer();
33152
+
33153
+ // Begin runtime exports
33154
+ // End runtime exports
33155
+ // Begin JS library exports
33156
+ // End JS library exports
33157
+
33158
+ // end include: postlibrary.js
33159
+
33160
+ // Imports from the Wasm binary.
33161
+ wasmImports = {
33162
+ /** @export */
33163
+ _abort_js: __abort_js,
33164
+ /** @export */
33165
+ _embind_register_bigint: __embind_register_bigint,
33166
+ /** @export */
33167
+ _embind_register_bool: __embind_register_bool,
33168
+ /** @export */
33169
+ _embind_register_class: __embind_register_class,
33170
+ /** @export */
33171
+ _embind_register_class_constructor: __embind_register_class_constructor,
33172
+ /** @export */
33173
+ _embind_register_class_function: __embind_register_class_function,
33174
+ /** @export */
33175
+ _embind_register_emval: __embind_register_emval,
33176
+ /** @export */
33177
+ _embind_register_float: __embind_register_float,
33178
+ /** @export */
33179
+ _embind_register_integer: __embind_register_integer,
33180
+ /** @export */
33181
+ _embind_register_memory_view: __embind_register_memory_view,
33182
+ /** @export */
33183
+ _embind_register_smart_ptr: __embind_register_smart_ptr,
33184
+ /** @export */
33185
+ _embind_register_std_string: __embind_register_std_string,
33186
+ /** @export */
33187
+ _embind_register_std_wstring: __embind_register_std_wstring,
33188
+ /** @export */
33189
+ _embind_register_void: __embind_register_void,
33190
+ /** @export */
33191
+ _emval_create_invoker: __emval_create_invoker,
33192
+ /** @export */
33193
+ _emval_decref: __emval_decref,
33194
+ /** @export */
33195
+ _emval_incref: __emval_incref,
33196
+ /** @export */
33197
+ _emval_invoke: __emval_invoke,
33198
+ /** @export */
33199
+ _emval_run_destructors: __emval_run_destructors,
33200
+ /** @export */
33201
+ _gmtime_js: __gmtime_js,
33202
+ /** @export */
33203
+ _tzset_js: __tzset_js,
33204
+ /** @export */
33205
+ emscripten_date_now: _emscripten_date_now,
33206
+ /** @export */
33207
+ emscripten_resize_heap: _emscripten_resize_heap,
33208
+ /** @export */
33209
+ environ_get: _environ_get,
33210
+ /** @export */
33211
+ environ_sizes_get: _environ_sizes_get,
33212
+ /** @export */
33213
+ fd_close: _fd_close,
33214
+ /** @export */
33215
+ fd_seek: _fd_seek,
33216
+ /** @export */
33217
+ fd_write: _fd_write
33218
+ };
33219
+ _context6.next = 158;
33220
+ return createWasm();
33221
+ case 158:
33222
+ wasmExports = _context6.sent;
33223
+ run();
33224
+
33225
+ // end include: postamble.js
33226
+
33227
+ // include: postamble_modularize.js
33228
+ // In MODULARIZE mode we wrap the generated code in a factory function
33229
+ // and return either the Module itself, or a promise of the module.
33230
+ //
33231
+ // We assign to the `moduleRtn` global here and configure closure to see
33232
+ // this as and extern so it won't get minified.
33233
+
33234
+ if (runtimeInitialized) {
33235
+ moduleRtn = Module;
33236
+ } else {
33237
+ // Set up the promise that indicates the Module is initialized
33238
+ moduleRtn = new Promise(function (resolve, reject) {
33239
+ readyPromiseResolve = resolve;
33240
+ readyPromiseReject = reject;
33241
+ });
33242
+ }
33243
+
33244
+ // end include: postamble_modularize.js
33245
+ return _context6.abrupt("return", moduleRtn);
33246
+ case 162:
33247
+ case "end":
33248
+ return _context6.stop();
33249
+ }
33250
+ }, _callee6);
33251
+ }));
33252
+ return _Module.apply(this, arguments);
33253
+ }
33254
+ var noopPrint = function noopPrint() {
33255
+ // No-op
33256
+ };
33257
+ function defaultLocateFile(path, prefix) {
33258
+ try {
33259
+ var url = new URL(prefix);
33260
+ if (url.pathname === '/') {
33261
+ return prefix + "mediainfo.js/dist/" + path;
33262
+ }
33263
+ } catch (_unused) {
33264
+ // empty
33265
+ }
33266
+ return prefix + "../" + path;
33267
+ }
33268
+
33269
+ // TODO pass through more emscripten module options?
33270
+
33271
+ /**
33272
+ * Creates a {@link MediaInfo} instance with the specified options.
33273
+ *
33274
+ * @typeParam TFormat - The format type, defaults to `object`.
33275
+ * @param options - Configuration options for creating the {@link MediaInfo} instance.
33276
+ * @returns A promise that resolves to a {@link MediaInfo} instance when no callback is provided.
33277
+ */
33278
+
33279
+ /**
33280
+ * Creates a {@link MediaInfo} instance with the specified options and executes the callback.
33281
+ *
33282
+ * @typeParam TFormat - The format type, defaults to `object`.
33283
+ * @param options - Configuration options for creating the {@link MediaInfo} instance.
33284
+ * @param callback - Function to call with the {@link MediaInfo} instance.
33285
+ * @param errCallback - Optional function to call on error.
33286
+ */
33287
+
33288
+ function mediaInfoFactory() {
33289
+ var _options$format;
33290
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
33291
+ var callback = arguments.length > 1 ? arguments[1] : undefined;
33292
+ var errCallback = arguments.length > 2 ? arguments[2] : undefined;
33293
+ if (callback === undefined) {
33294
+ return new Promise(function (resolve, reject) {
33295
+ mediaInfoFactory(options, resolve, reject);
33296
+ });
33297
+ }
33298
+ var _DEFAULT_OPTIONS$opti = _extends({}, DEFAULT_OPTIONS, options, {
33299
+ format: (_options$format = options.format) != null ? _options$format : DEFAULT_OPTIONS.format
33300
+ }),
33301
+ locateFile = _DEFAULT_OPTIONS$opti.locateFile,
33302
+ mergedOptions = _objectWithoutPropertiesLoose(_DEFAULT_OPTIONS$opti, _excluded);
33303
+ var mediaInfoModuleFactoryOpts = {
33304
+ // Silence all print in module
33305
+ print: noopPrint,
33306
+ printErr: noopPrint,
33307
+ locateFile: locateFile != null ? locateFile : defaultLocateFile,
33308
+ onAbort: function onAbort(err) {
33309
+ if (errCallback) {
33310
+ errCallback(err);
33311
+ }
33312
+ }
33313
+ };
33314
+
33315
+ // Fetch and load WASM module
33316
+ Module(mediaInfoModuleFactoryOpts).then(function (wasmModule) {
33317
+ callback(new MediaInfo(wasmModule, mergedOptions));
33318
+ })["catch"](function (error) {
33319
+ if (errCallback) {
33320
+ errCallback(error);
33321
+ }
33322
+ });
33323
+ }
33324
+
33325
+ /**
33326
+ * Checks if a given object is of a specified track type.
33327
+ *
33328
+ * @template T - The type of track to check for.
33329
+ * @param thing - The object to check.
33330
+ * @param type - The track type to check against.
33331
+ * @returns A boolean indicating whether the object is of the specified track type.
33332
+ */
33333
+ function isTrackType(thing, type) {
33334
+ return thing !== null && typeof thing === 'object' && thing['@type'] === type;
33335
+ }
33336
+
33337
+ var index = /*#__PURE__*/Object.freeze({
33338
+ __proto__: null,
33339
+ default: mediaInfoFactory,
33340
+ isTrackType: isTrackType,
33341
+ mediaInfoFactory: mediaInfoFactory
33342
+ });
33343
+
30561
33344
  exports.CapturedDocumentImg = CapturedDocumentImg;
30562
33345
  exports.CustomerBiometricsEnrollment = CustomerBiometricsEnrollment;
30563
33346
  exports.CustomerIdAndBiometricsEnrollment = CustomerIdAndBiometricsEnrollment;