idmission-web-sdk 2.3.95 → 2.3.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk2.cjs.development.js +3 -4
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +2 -2
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +43 -2743
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom/client'), require('platform'), require('styled-components'), require('react-dom'), require('tus-js-client'), require('prop-types'), require('react-dom/server')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom/client', 'platform', 'styled-components', 'react-dom', 'tus-js-client', 'prop-types', 'react-dom/server'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sdk2 = {}, global.React, global.ReactDOM, global.platform, global.styled, global.ReactDOM, global.tusJsClient, global.PropTypes, global.server));
|
|
5
|
-
})(this, (function (exports, React, ReactDOM, platform, styled, reactDom, tusJsClient, require$$0, server) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom/client'), require('platform'), require('styled-components'), require('react-dom'), require('tus-js-client'), require('prop-types'), require('mediainfo.js'), require('react-dom/server')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom/client', 'platform', 'styled-components', 'react-dom', 'tus-js-client', 'prop-types', 'mediainfo.js', 'react-dom/server'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Sdk2 = {}, global.React, global.ReactDOM, global.platform, global.styled, global.ReactDOM, global.tusJsClient, global.PropTypes, global.mediainfo_js, global.server));
|
|
5
|
+
})(this, (function (exports, React, ReactDOM, platform, styled, reactDom, tusJsClient, require$$0, mediainfo_js, server) { 'use strict';
|
|
6
6
|
|
|
7
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
8
7
|
function _interopNamespaceDefault(e) {
|
|
9
8
|
var n = Object.create(null);
|
|
10
9
|
if (e) {
|
|
@@ -212,7 +211,7 @@
|
|
|
212
211
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
213
212
|
};
|
|
214
213
|
|
|
215
|
-
var webSdkVersion = '2.3.
|
|
214
|
+
var webSdkVersion = '2.3.97';
|
|
216
215
|
|
|
217
216
|
function getPlatform() {
|
|
218
217
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -3616,9 +3615,9 @@
|
|
|
3616
3615
|
}
|
|
3617
3616
|
var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
3618
3617
|
|
|
3619
|
-
function _createForOfIteratorHelperLoose$
|
|
3620
|
-
function _unsupportedIterableToArray$
|
|
3621
|
-
function _arrayLikeToArray$
|
|
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; }
|
|
3622
3621
|
var t = self;
|
|
3623
3622
|
function e() {
|
|
3624
3623
|
throw Error("Invalid UTF8");
|
|
@@ -5845,7 +5844,7 @@
|
|
|
5845
5844
|
height: (_hn4 = hn(e, 4)) != null ? _hn4 : 0,
|
|
5846
5845
|
angle: 0
|
|
5847
5846
|
}), (_en2 = en$1(t, ws, 4)) != null && _en2.g().length) {
|
|
5848
|
-
for (var _iterator = _createForOfIteratorHelperLoose$
|
|
5847
|
+
for (var _iterator = _createForOfIteratorHelperLoose$2(en$1(t, ws, 4).g()), _step; !(_step = _iterator()).done;) {
|
|
5849
5848
|
var _We, _We2, _We3, _un3;
|
|
5850
5849
|
var _e16 = _step.value;
|
|
5851
5850
|
i.keypoints.push({
|
|
@@ -5860,7 +5859,7 @@
|
|
|
5860
5859
|
}
|
|
5861
5860
|
function Qi(t) {
|
|
5862
5861
|
var e = [];
|
|
5863
|
-
for (var _iterator2 = _createForOfIteratorHelperLoose$
|
|
5862
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose$2(rn(t, Fs, 1)), _step2; !(_step2 = _iterator2()).done;) {
|
|
5864
5863
|
var _fn2, _fn3, _fn4;
|
|
5865
5864
|
var _n14 = _step2.value;
|
|
5866
5865
|
e.push({
|
|
@@ -5873,7 +5872,7 @@
|
|
|
5873
5872
|
}
|
|
5874
5873
|
function to(t) {
|
|
5875
5874
|
var e = [];
|
|
5876
|
-
for (var _iterator3 = _createForOfIteratorHelperLoose$
|
|
5875
|
+
for (var _iterator3 = _createForOfIteratorHelperLoose$2(rn(t, Ts, 1)), _step3; !(_step3 = _iterator3()).done;) {
|
|
5877
5876
|
var _fn5, _fn6, _fn7;
|
|
5878
5877
|
var _n15 = _step3.value;
|
|
5879
5878
|
e.push({
|
|
@@ -6021,7 +6020,7 @@
|
|
|
6021
6020
|
var r = new Uint32Array(e.length);
|
|
6022
6021
|
for (var _n16 = 0; _n16 < e.length; _n16++) r[_n16] = t.i.stringToNewUTF8(e[_n16]);
|
|
6023
6022
|
e = t.i._malloc(4 * r.length), t.i.HEAPU32.set(r, e >> 2), n(e);
|
|
6024
|
-
for (var _iterator4 = _createForOfIteratorHelperLoose$
|
|
6023
|
+
for (var _iterator4 = _createForOfIteratorHelperLoose$2(r), _step4; !(_step4 = _iterator4()).done;) {
|
|
6025
6024
|
var _e17 = _step4.value;
|
|
6026
6025
|
t.i._free(_e17);
|
|
6027
6026
|
}
|
|
@@ -6387,7 +6386,7 @@
|
|
|
6387
6386
|
}
|
|
6388
6387
|
t.push(n);
|
|
6389
6388
|
};
|
|
6390
|
-
for (var _iterator7 = _createForOfIteratorHelperLoose$
|
|
6389
|
+
for (var _iterator7 = _createForOfIteratorHelperLoose$2(this.g), _step7; !(_step7 = _iterator7()).done;) {
|
|
6391
6390
|
_loop();
|
|
6392
6391
|
}
|
|
6393
6392
|
return new _Yo(t, this.ba(), this.K(), this.canvas, this.l, this.width, this.height);
|
|
@@ -6519,7 +6518,7 @@
|
|
|
6519
6518
|
}
|
|
6520
6519
|
t.push(n);
|
|
6521
6520
|
};
|
|
6522
|
-
for (var _iterator8 = _createForOfIteratorHelperLoose$
|
|
6521
|
+
for (var _iterator8 = _createForOfIteratorHelperLoose$2(this.g), _step8; !(_step8 = _iterator8()).done;) {
|
|
6523
6522
|
_loop2();
|
|
6524
6523
|
}
|
|
6525
6524
|
return new _ia(t, this.K(), this.canvas, this.l, this.width, this.height);
|
|
@@ -6999,7 +6998,7 @@
|
|
|
6999
6998
|
yn(e, si, this.h);
|
|
7000
6999
|
var n = new qr();
|
|
7001
7000
|
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) {
|
|
7002
|
-
for (var _iterator9 = _createForOfIteratorHelperLoose$
|
|
7001
|
+
for (var _iterator9 = _createForOfIteratorHelperLoose$2(t), _step9; !(_step9 = _iterator9()).done;) {
|
|
7003
7002
|
var _e23 = _step9.value;
|
|
7004
7003
|
t = Es(_e23), _this43.j.detections.push(Zi(t));
|
|
7005
7004
|
}
|
|
@@ -7093,7 +7092,7 @@
|
|
|
7093
7092
|
yn(e, di, this.h);
|
|
7094
7093
|
var n = new qr();
|
|
7095
7094
|
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) {
|
|
7096
|
-
for (var _iterator10 = _createForOfIteratorHelperLoose$
|
|
7095
|
+
for (var _iterator10 = _createForOfIteratorHelperLoose$2(t), _step10; !(_step10 = _iterator10()).done;) {
|
|
7097
7096
|
var _e24 = _step10.value;
|
|
7098
7097
|
t = Ms(_e24), _this45.j.faceLandmarks.push(Qi(t));
|
|
7099
7098
|
}
|
|
@@ -7102,7 +7101,7 @@
|
|
|
7102
7101
|
_o(_this45, t);
|
|
7103
7102
|
}), this.outputFaceBlendshapes && (rs(t, "blendshapes"), $r(n, "BLENDSHAPES:blendshapes"), this.g.attachProtoVectorListener("blendshapes", function (t, e) {
|
|
7104
7103
|
if (_this45.outputFaceBlendshapes) {
|
|
7105
|
-
for (var _iterator11 = _createForOfIteratorHelperLoose$
|
|
7104
|
+
for (var _iterator11 = _createForOfIteratorHelperLoose$2(t), _step11; !(_step11 = _iterator11()).done;) {
|
|
7106
7105
|
var _t$g;
|
|
7107
7106
|
var _e25 = _step11.value;
|
|
7108
7107
|
t = fs(_e25), _this45.j.faceBlendshapes.push(Ji((_t$g = t.g()) != null ? _t$g : []));
|
|
@@ -7113,7 +7112,7 @@
|
|
|
7113
7112
|
_o(_this45, t);
|
|
7114
7113
|
})), this.outputFacialTransformationMatrixes && (rs(t, "face_geometry"), $r(n, "FACE_GEOMETRY:face_geometry"), this.g.attachProtoVectorListener("face_geometry", function (t, e) {
|
|
7115
7114
|
if (_this45.outputFacialTransformationMatrixes) {
|
|
7116
|
-
for (var _iterator12 = _createForOfIteratorHelperLoose$
|
|
7115
|
+
for (var _iterator12 = _createForOfIteratorHelperLoose$2(t), _step12; !(_step12 = _iterator12()).done;) {
|
|
7117
7116
|
var _ln2, _ln3, _He;
|
|
7118
7117
|
var _e26 = _step12.value;
|
|
7119
7118
|
(t = en$1(ai(_e26), Ps, 2)) && _this45.j.facialTransformationMatrixes.push({
|
|
@@ -7244,11 +7243,11 @@
|
|
|
7244
7243
|
e = !0;
|
|
7245
7244
|
}
|
|
7246
7245
|
var n = [];
|
|
7247
|
-
for (var _iterator13 = _createForOfIteratorHelperLoose$
|
|
7246
|
+
for (var _iterator13 = _createForOfIteratorHelperLoose$2(t), _step13; !(_step13 = _iterator13()).done;) {
|
|
7248
7247
|
var _s9 = _step13.value;
|
|
7249
7248
|
var r = fs(_s9);
|
|
7250
7249
|
t = [];
|
|
7251
|
-
for (var _iterator14 = _createForOfIteratorHelperLoose$
|
|
7250
|
+
for (var _iterator14 = _createForOfIteratorHelperLoose$2(r.g()), _step14; !(_step14 = _iterator14()).done;) {
|
|
7252
7251
|
var _fn8, _ref9, _un4, _ref10, _un5;
|
|
7253
7252
|
var _n24 = _step14.value;
|
|
7254
7253
|
r = e && null != hn(_n24, 1) ? ln(hn(_n24, 1)) : -1, t.push({
|
|
@@ -7294,11 +7293,11 @@
|
|
|
7294
7293
|
yn(e, Oi, this.v);
|
|
7295
7294
|
var n = new qr();
|
|
7296
7295
|
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) {
|
|
7297
|
-
for (var _iterator15 = _createForOfIteratorHelperLoose$
|
|
7296
|
+
for (var _iterator15 = _createForOfIteratorHelperLoose$2(t), _step15; !(_step15 = _iterator15()).done;) {
|
|
7298
7297
|
var _e28 = _step15.value;
|
|
7299
7298
|
t = Ms(_e28);
|
|
7300
7299
|
var _n25 = [];
|
|
7301
|
-
for (var _iterator16 = _createForOfIteratorHelperLoose$
|
|
7300
|
+
for (var _iterator16 = _createForOfIteratorHelperLoose$2(rn(t, Fs, 1)), _step16; !(_step16 = _iterator16()).done;) {
|
|
7302
7301
|
var _fn9, _fn10, _fn11;
|
|
7303
7302
|
var _e29 = _step16.value;
|
|
7304
7303
|
_n25.push({
|
|
@@ -7313,11 +7312,11 @@
|
|
|
7313
7312
|
}), this.g.attachEmptyPacketListener("hand_landmarks", function (t) {
|
|
7314
7313
|
_o(_this49, t);
|
|
7315
7314
|
}), this.g.attachProtoVectorListener("world_hand_landmarks", function (t, e) {
|
|
7316
|
-
for (var _iterator17 = _createForOfIteratorHelperLoose$
|
|
7315
|
+
for (var _iterator17 = _createForOfIteratorHelperLoose$2(t), _step17; !(_step17 = _iterator17()).done;) {
|
|
7317
7316
|
var _e30 = _step17.value;
|
|
7318
7317
|
t = Ls(_e30);
|
|
7319
7318
|
var _n26 = [];
|
|
7320
|
-
for (var _iterator18 = _createForOfIteratorHelperLoose$
|
|
7319
|
+
for (var _iterator18 = _createForOfIteratorHelperLoose$2(rn(t, Ts, 1)), _step18; !(_step18 = _iterator18()).done;) {
|
|
7321
7320
|
var _fn12, _fn13, _fn14;
|
|
7322
7321
|
var _e31 = _step18.value;
|
|
7323
7322
|
_n26.push({
|
|
@@ -7402,7 +7401,7 @@
|
|
|
7402
7401
|
yn(e, Si, this.j);
|
|
7403
7402
|
var n = new qr();
|
|
7404
7403
|
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) {
|
|
7405
|
-
for (var _iterator19 = _createForOfIteratorHelperLoose$
|
|
7404
|
+
for (var _iterator19 = _createForOfIteratorHelperLoose$2(t), _step19; !(_step19 = _iterator19()).done;) {
|
|
7406
7405
|
var _e32 = _step19.value;
|
|
7407
7406
|
t = Ms(_e32), _this51.landmarks.push(Qi(t));
|
|
7408
7407
|
}
|
|
@@ -7410,7 +7409,7 @@
|
|
|
7410
7409
|
}), this.g.attachEmptyPacketListener("hand_landmarks", function (t) {
|
|
7411
7410
|
_o(_this51, t);
|
|
7412
7411
|
}), this.g.attachProtoVectorListener("world_hand_landmarks", function (t, e) {
|
|
7413
|
-
for (var _iterator20 = _createForOfIteratorHelperLoose$
|
|
7412
|
+
for (var _iterator20 = _createForOfIteratorHelperLoose$2(t), _step20; !(_step20 = _iterator20()).done;) {
|
|
7414
7413
|
var _e33 = _step20.value;
|
|
7415
7414
|
t = Ls(_e33), _this51.worldLandmarks.push(to(t));
|
|
7416
7415
|
}
|
|
@@ -7421,11 +7420,11 @@
|
|
|
7421
7420
|
var n = _this51.handedness,
|
|
7422
7421
|
r = n.push;
|
|
7423
7422
|
var s = [];
|
|
7424
|
-
for (var _iterator21 = _createForOfIteratorHelperLoose$
|
|
7423
|
+
for (var _iterator21 = _createForOfIteratorHelperLoose$2(t), _step21; !(_step21 = _iterator21()).done;) {
|
|
7425
7424
|
var _e34 = _step21.value;
|
|
7426
7425
|
t = fs(_e34);
|
|
7427
7426
|
var _n27 = [];
|
|
7428
|
-
for (var _iterator22 = _createForOfIteratorHelperLoose$
|
|
7427
|
+
for (var _iterator22 = _createForOfIteratorHelperLoose$2(t.g()), _step22; !(_step22 = _iterator22()).done;) {
|
|
7429
7428
|
var _fn15, _ln4, _ref11, _un6, _ref12, _un7;
|
|
7430
7429
|
var _e35 = _step22.value;
|
|
7431
7430
|
_n27.push({
|
|
@@ -7817,7 +7816,7 @@
|
|
|
7817
7816
|
dn(a, 3, !0), gn(a, 1, e.keypoint.x), gn(a, 2, e.keypoint.y), on(i, 5, oh, a);
|
|
7818
7817
|
} else {
|
|
7819
7818
|
if (!e.scribble) throw Error("Must provide either a keypoint or a scribble.");
|
|
7820
|
-
for (var _iterator23 = _createForOfIteratorHelperLoose$
|
|
7819
|
+
for (var _iterator23 = _createForOfIteratorHelperLoose$2((o = new sh(), e.scribble)), _step23; !(_step23 = _iterator23()).done;) {
|
|
7821
7820
|
a = _step23.value;
|
|
7822
7821
|
dn(e = new nh(), 3, !0), gn(e, 1, a.x), gn(e, 2, a.y), an(o, nh, e);
|
|
7823
7822
|
}
|
|
@@ -7918,7 +7917,7 @@
|
|
|
7918
7917
|
yn(e, Vi, this.h);
|
|
7919
7918
|
var n = new qr();
|
|
7920
7919
|
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) {
|
|
7921
|
-
for (var _iterator24 = _createForOfIteratorHelperLoose$
|
|
7920
|
+
for (var _iterator24 = _createForOfIteratorHelperLoose$2(t), _step24; !(_step24 = _iterator24()).done;) {
|
|
7922
7921
|
var _e37 = _step24.value;
|
|
7923
7922
|
t = Es(_e37), _this61.j.detections.push(Zi(t));
|
|
7924
7923
|
}
|
|
@@ -8018,7 +8017,7 @@
|
|
|
8018
8017
|
var n = new qr();
|
|
8019
8018
|
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) {
|
|
8020
8019
|
_this63.landmarks = [];
|
|
8021
|
-
for (var _iterator25 = _createForOfIteratorHelperLoose$
|
|
8020
|
+
for (var _iterator25 = _createForOfIteratorHelperLoose$2(t), _step25; !(_step25 = _iterator25()).done;) {
|
|
8022
8021
|
var _e39 = _step25.value;
|
|
8023
8022
|
t = Ms(_e39), _this63.landmarks.push(Qi(t));
|
|
8024
8023
|
}
|
|
@@ -8027,7 +8026,7 @@
|
|
|
8027
8026
|
_this63.landmarks = [], _o(_this63, t);
|
|
8028
8027
|
}), this.g.attachProtoVectorListener("world_landmarks", function (t, e) {
|
|
8029
8028
|
_this63.worldLandmarks = [];
|
|
8030
|
-
for (var _iterator26 = _createForOfIteratorHelperLoose$
|
|
8029
|
+
for (var _iterator26 = _createForOfIteratorHelperLoose$2(t), _step26; !(_step26 = _iterator26()).done;) {
|
|
8031
8030
|
var _e40 = _step26.value;
|
|
8032
8031
|
t = Ls(_e40), _this63.worldLandmarks.push(to(t));
|
|
8033
8032
|
}
|
|
@@ -9505,9 +9504,9 @@
|
|
|
9505
9504
|
return e;
|
|
9506
9505
|
}
|
|
9507
9506
|
|
|
9508
|
-
function _createForOfIteratorHelperLoose$
|
|
9509
|
-
function _unsupportedIterableToArray$
|
|
9510
|
-
function _arrayLikeToArray$
|
|
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; }
|
|
9511
9510
|
var consoleLogger = {
|
|
9512
9511
|
type: 'logger',
|
|
9513
9512
|
log: function log(args) {
|
|
@@ -10354,7 +10353,7 @@
|
|
|
10354
10353
|
}
|
|
10355
10354
|
if (!useOptionsReplaceForData) {
|
|
10356
10355
|
data = _extends({}, data);
|
|
10357
|
-
for (var _iterator = _createForOfIteratorHelperLoose$
|
|
10356
|
+
for (var _iterator = _createForOfIteratorHelperLoose$1(optionsKeys), _step; !(_step = _iterator()).done;) {
|
|
10358
10357
|
var key = _step.value;
|
|
10359
10358
|
delete data[key];
|
|
10360
10359
|
}
|
|
@@ -14946,7 +14945,7 @@
|
|
|
14946
14945
|
});
|
|
14947
14946
|
}
|
|
14948
14947
|
|
|
14949
|
-
var _excluded
|
|
14948
|
+
var _excluded = ["enabled", "anonymousActionType", "store"],
|
|
14950
14949
|
_excluded2 = ["connection"];
|
|
14951
14950
|
var trackedConnections = /* @__PURE__ */new Map();
|
|
14952
14951
|
var getTrackedConnectionState = function getTrackedConnectionState(name) {
|
|
@@ -14991,7 +14990,7 @@
|
|
|
14991
14990
|
enabled = _devtoolsOptions.enabled,
|
|
14992
14991
|
anonymousActionType = _devtoolsOptions.anonymousActionType,
|
|
14993
14992
|
store = _devtoolsOptions.store,
|
|
14994
|
-
options = _objectWithoutPropertiesLoose(_devtoolsOptions, _excluded
|
|
14993
|
+
options = _objectWithoutPropertiesLoose(_devtoolsOptions, _excluded);
|
|
14995
14994
|
var extensionConnector;
|
|
14996
14995
|
try {
|
|
14997
14996
|
extensionConnector = (enabled != null ? enabled : (undefined ? undefined.MODE : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
@@ -15152,9 +15151,9 @@
|
|
|
15152
15151
|
if (parsed !== void 0) f(parsed);
|
|
15153
15152
|
};
|
|
15154
15153
|
|
|
15155
|
-
function _createForOfIteratorHelperLoose
|
|
15156
|
-
function _unsupportedIterableToArray
|
|
15157
|
-
function _arrayLikeToArray
|
|
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; }
|
|
15158
15157
|
var isIterable = function isIterable(obj) {
|
|
15159
15158
|
return Symbol.iterator in obj;
|
|
15160
15159
|
};
|
|
@@ -15170,7 +15169,7 @@
|
|
|
15170
15169
|
if (mapA.size !== mapB.size) {
|
|
15171
15170
|
return false;
|
|
15172
15171
|
}
|
|
15173
|
-
for (var _iterator = _createForOfIteratorHelperLoose
|
|
15172
|
+
for (var _iterator = _createForOfIteratorHelperLoose(mapA), _step; !(_step = _iterator()).done;) {
|
|
15174
15173
|
var _step$value = _step.value,
|
|
15175
15174
|
key = _step$value[0],
|
|
15176
15175
|
value = _step$value[1];
|
|
@@ -24201,2705 +24200,6 @@
|
|
|
24201
24200
|
return t.length > 0 ? t : undefined;
|
|
24202
24201
|
}
|
|
24203
24202
|
|
|
24204
|
-
var _excluded = ["locateFile"];
|
|
24205
|
-
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."); }
|
|
24206
|
-
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; } }
|
|
24207
|
-
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; }
|
|
24208
|
-
function isError(error) {
|
|
24209
|
-
return error !== null && typeof error === 'object' && Object.prototype.hasOwnProperty.call(error, 'message');
|
|
24210
|
-
}
|
|
24211
|
-
function unknownToError(error) {
|
|
24212
|
-
if (isError(error)) {
|
|
24213
|
-
return error;
|
|
24214
|
-
}
|
|
24215
|
-
return new Error(typeof error === 'string' ? error : 'Unknown error');
|
|
24216
|
-
}
|
|
24217
|
-
|
|
24218
|
-
// DO NOT EDIT! File generated using `generate-types` script.
|
|
24219
|
-
|
|
24220
|
-
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'];
|
|
24221
|
-
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'];
|
|
24222
|
-
var MAX_UINT32_PLUS_ONE = Math.pow(2, 32);
|
|
24223
|
-
var DEFAULT_OPTIONS = {
|
|
24224
|
-
coverData: false,
|
|
24225
|
-
chunkSize: 256 * 1024,
|
|
24226
|
-
format: 'object',
|
|
24227
|
-
full: false
|
|
24228
|
-
};
|
|
24229
|
-
/**
|
|
24230
|
-
* Wrapper for the MediaInfoLib WASM module.
|
|
24231
|
-
*
|
|
24232
|
-
* This class should not be instantiated directly. Use the {@link mediaInfoFactory} function
|
|
24233
|
-
* to create instances of `MediaInfo`.
|
|
24234
|
-
*
|
|
24235
|
-
* @typeParam TFormat - The format type, defaults to `object`.
|
|
24236
|
-
*/
|
|
24237
|
-
var MediaInfo = /*#__PURE__*/function () {
|
|
24238
|
-
/** @group General Use */
|
|
24239
|
-
|
|
24240
|
-
/**
|
|
24241
|
-
* The constructor should not be called directly, instead use {@link mediaInfoFactory}.
|
|
24242
|
-
*
|
|
24243
|
-
* @hidden
|
|
24244
|
-
* @param mediainfoModule WASM module
|
|
24245
|
-
* @param options User options
|
|
24246
|
-
*/
|
|
24247
|
-
function MediaInfo(mediainfoModule, options) {
|
|
24248
|
-
this.isAnalyzing = false;
|
|
24249
|
-
this.mediainfoModule = mediainfoModule;
|
|
24250
|
-
this.options = options;
|
|
24251
|
-
this.mediainfoModuleInstance = this.instantiateModuleInstance();
|
|
24252
|
-
}
|
|
24253
|
-
|
|
24254
|
-
/**
|
|
24255
|
-
* Convenience method for analyzing a buffer chunk by chunk.
|
|
24256
|
-
*
|
|
24257
|
-
* @param size Return total buffer size in bytes.
|
|
24258
|
-
* @param readChunk Read chunk of data and return an {@link Uint8Array}.
|
|
24259
|
-
* @group General Use
|
|
24260
|
-
*/
|
|
24261
|
-
|
|
24262
|
-
/**
|
|
24263
|
-
* Convenience method for analyzing a buffer chunk by chunk.
|
|
24264
|
-
*
|
|
24265
|
-
* @param size Return total buffer size in bytes.
|
|
24266
|
-
* @param readChunk Read chunk of data and return an {@link Uint8Array}.
|
|
24267
|
-
* @param callback Function that is called once the processing is done
|
|
24268
|
-
* @group General Use
|
|
24269
|
-
*/
|
|
24270
|
-
var _proto = MediaInfo.prototype;
|
|
24271
|
-
_proto.analyzeData = function analyzeData(size, readChunk, callback) {
|
|
24272
|
-
var _this = this;
|
|
24273
|
-
// Support promise signature
|
|
24274
|
-
if (callback === undefined) {
|
|
24275
|
-
return new Promise(function (resolve, reject) {
|
|
24276
|
-
var resultCb = function resultCb(result, error) {
|
|
24277
|
-
_this.isAnalyzing = false;
|
|
24278
|
-
if (error || !result) {
|
|
24279
|
-
reject(unknownToError(error));
|
|
24280
|
-
} else {
|
|
24281
|
-
resolve(result);
|
|
24282
|
-
}
|
|
24283
|
-
};
|
|
24284
|
-
_this.analyzeData(size, readChunk, resultCb);
|
|
24285
|
-
});
|
|
24286
|
-
}
|
|
24287
|
-
if (this.isAnalyzing) {
|
|
24288
|
-
callback('', new Error('cannot start a new analysis while another is in progress'));
|
|
24289
|
-
return;
|
|
24290
|
-
}
|
|
24291
|
-
this.reset();
|
|
24292
|
-
this.isAnalyzing = true;
|
|
24293
|
-
var finalize = function finalize() {
|
|
24294
|
-
try {
|
|
24295
|
-
_this.openBufferFinalize();
|
|
24296
|
-
var result = _this.inform();
|
|
24297
|
-
if (_this.options.format === 'object') {
|
|
24298
|
-
callback(_this.parseResultJson(result));
|
|
24299
|
-
} else {
|
|
24300
|
-
callback(result);
|
|
24301
|
-
}
|
|
24302
|
-
} finally {
|
|
24303
|
-
_this.isAnalyzing = false;
|
|
24304
|
-
}
|
|
24305
|
-
};
|
|
24306
|
-
var offset = 0;
|
|
24307
|
-
var runReadDataLoop = function runReadDataLoop(fileSize) {
|
|
24308
|
-
var readNextChunk = function readNextChunk(data) {
|
|
24309
|
-
if (continueBuffer(data)) {
|
|
24310
|
-
getChunk();
|
|
24311
|
-
} else {
|
|
24312
|
-
finalize();
|
|
24313
|
-
}
|
|
24314
|
-
};
|
|
24315
|
-
var getChunk = function getChunk() {
|
|
24316
|
-
var dataValue;
|
|
24317
|
-
try {
|
|
24318
|
-
var safeSize = Math.min(_this.options.chunkSize, fileSize - offset);
|
|
24319
|
-
dataValue = readChunk(safeSize, offset);
|
|
24320
|
-
} catch (error) {
|
|
24321
|
-
_this.isAnalyzing = false;
|
|
24322
|
-
callback('', unknownToError(error));
|
|
24323
|
-
return;
|
|
24324
|
-
}
|
|
24325
|
-
if (dataValue instanceof Promise) {
|
|
24326
|
-
dataValue.then(readNextChunk)["catch"](function (error) {
|
|
24327
|
-
_this.isAnalyzing = false;
|
|
24328
|
-
callback('', unknownToError(error));
|
|
24329
|
-
});
|
|
24330
|
-
} else {
|
|
24331
|
-
readNextChunk(dataValue);
|
|
24332
|
-
}
|
|
24333
|
-
};
|
|
24334
|
-
var continueBuffer = function continueBuffer(data) {
|
|
24335
|
-
if (data.length === 0 || _this.openBufferContinue(data, data.length)) {
|
|
24336
|
-
return false;
|
|
24337
|
-
}
|
|
24338
|
-
var seekTo = _this.openBufferContinueGotoGet();
|
|
24339
|
-
if (seekTo === -1) {
|
|
24340
|
-
offset += data.length;
|
|
24341
|
-
} else {
|
|
24342
|
-
offset = seekTo;
|
|
24343
|
-
_this.openBufferInit(fileSize, seekTo);
|
|
24344
|
-
}
|
|
24345
|
-
return true;
|
|
24346
|
-
};
|
|
24347
|
-
_this.openBufferInit(fileSize, offset);
|
|
24348
|
-
getChunk();
|
|
24349
|
-
};
|
|
24350
|
-
var fileSizeValue = typeof size === 'function' ? size() : size;
|
|
24351
|
-
if (fileSizeValue instanceof Promise) {
|
|
24352
|
-
fileSizeValue.then(runReadDataLoop)["catch"](function (error) {
|
|
24353
|
-
callback(null, unknownToError(error));
|
|
24354
|
-
});
|
|
24355
|
-
} else {
|
|
24356
|
-
runReadDataLoop(fileSizeValue);
|
|
24357
|
-
}
|
|
24358
|
-
}
|
|
24359
|
-
|
|
24360
|
-
/**
|
|
24361
|
-
* Close the MediaInfoLib WASM instance.
|
|
24362
|
-
*
|
|
24363
|
-
* @group General Use
|
|
24364
|
-
*/;
|
|
24365
|
-
_proto.close = function close() {
|
|
24366
|
-
if (typeof this.mediainfoModuleInstance.close === 'function') {
|
|
24367
|
-
this.mediainfoModuleInstance.close();
|
|
24368
|
-
}
|
|
24369
|
-
}
|
|
24370
|
-
|
|
24371
|
-
/**
|
|
24372
|
-
* Reset the MediaInfoLib WASM instance to its initial state.
|
|
24373
|
-
*
|
|
24374
|
-
* This method ensures that the instance is ready for a new parse.
|
|
24375
|
-
* @group General Use
|
|
24376
|
-
*/;
|
|
24377
|
-
_proto.reset = function reset() {
|
|
24378
|
-
this.mediainfoModuleInstance["delete"]();
|
|
24379
|
-
this.mediainfoModuleInstance = this.instantiateModuleInstance();
|
|
24380
|
-
}
|
|
24381
|
-
|
|
24382
|
-
/**
|
|
24383
|
-
* Receive result data from the WASM instance.
|
|
24384
|
-
*
|
|
24385
|
-
* (This is a low-level MediaInfoLib function.)
|
|
24386
|
-
*
|
|
24387
|
-
* @returns Result data (format can be configured in options)
|
|
24388
|
-
* @group Low-level
|
|
24389
|
-
*/;
|
|
24390
|
-
_proto.inform = function inform() {
|
|
24391
|
-
return this.mediainfoModuleInstance.inform();
|
|
24392
|
-
}
|
|
24393
|
-
|
|
24394
|
-
/**
|
|
24395
|
-
* Send more data to the WASM instance.
|
|
24396
|
-
*
|
|
24397
|
-
* (This is a low-level MediaInfoLib function.)
|
|
24398
|
-
*
|
|
24399
|
-
* @param data Data buffer
|
|
24400
|
-
* @param size Buffer size
|
|
24401
|
-
* @returns Processing state: `0` (no bits set) = not finished, Bit `0` set = enough data read for providing information
|
|
24402
|
-
* @group Low-level
|
|
24403
|
-
*/;
|
|
24404
|
-
_proto.openBufferContinue = function openBufferContinue(data, size) {
|
|
24405
|
-
// bit 3 set -> done
|
|
24406
|
-
return !!(this.mediainfoModuleInstance.open_buffer_continue(data, size) & 0x08);
|
|
24407
|
-
}
|
|
24408
|
-
|
|
24409
|
-
/**
|
|
24410
|
-
* Retrieve seek position from WASM instance.
|
|
24411
|
-
* The MediaInfoLib function `Open_Buffer_GoTo` returns an integer with 64 bit precision.
|
|
24412
|
-
* It would be cut at 32 bit due to the JavaScript bindings. Here we transport the low and high
|
|
24413
|
-
* parts separately and put them together.
|
|
24414
|
-
*
|
|
24415
|
-
* (This is a low-level MediaInfoLib function.)
|
|
24416
|
-
*
|
|
24417
|
-
* @returns Seek position (where MediaInfoLib wants go in the data buffer)
|
|
24418
|
-
* @group Low-level
|
|
24419
|
-
*/;
|
|
24420
|
-
_proto.openBufferContinueGotoGet = function openBufferContinueGotoGet() {
|
|
24421
|
-
// JS bindings don't support 64 bit int
|
|
24422
|
-
// https://github.com/buzz/mediainfo.js/issues/11
|
|
24423
|
-
var seekTo = -1;
|
|
24424
|
-
var seekToLow = this.mediainfoModuleInstance.open_buffer_continue_goto_get_lower();
|
|
24425
|
-
var seekToHigh = this.mediainfoModuleInstance.open_buffer_continue_goto_get_upper();
|
|
24426
|
-
if (seekToLow == -1 && seekToHigh == -1) {
|
|
24427
|
-
seekTo = -1;
|
|
24428
|
-
} else if (seekToLow < 0) {
|
|
24429
|
-
seekTo = seekToLow + MAX_UINT32_PLUS_ONE + seekToHigh * MAX_UINT32_PLUS_ONE;
|
|
24430
|
-
} else {
|
|
24431
|
-
seekTo = seekToLow + seekToHigh * MAX_UINT32_PLUS_ONE;
|
|
24432
|
-
}
|
|
24433
|
-
return seekTo;
|
|
24434
|
-
}
|
|
24435
|
-
|
|
24436
|
-
/**
|
|
24437
|
-
* Inform MediaInfoLib that no more data is being read.
|
|
24438
|
-
*
|
|
24439
|
-
* (This is a low-level MediaInfoLib function.)
|
|
24440
|
-
*
|
|
24441
|
-
* @group Low-level
|
|
24442
|
-
*/;
|
|
24443
|
-
_proto.openBufferFinalize = function openBufferFinalize() {
|
|
24444
|
-
this.mediainfoModuleInstance.open_buffer_finalize();
|
|
24445
|
-
}
|
|
24446
|
-
|
|
24447
|
-
/**
|
|
24448
|
-
* Prepare MediaInfoLib to process a data buffer.
|
|
24449
|
-
*
|
|
24450
|
-
* (This is a low-level MediaInfoLib function.)
|
|
24451
|
-
*
|
|
24452
|
-
* @param size Expected buffer size
|
|
24453
|
-
* @param offset Buffer offset
|
|
24454
|
-
* @group Low-level
|
|
24455
|
-
*/;
|
|
24456
|
-
_proto.openBufferInit = function openBufferInit(size, offset) {
|
|
24457
|
-
this.mediainfoModuleInstance.open_buffer_init(size, offset);
|
|
24458
|
-
}
|
|
24459
|
-
|
|
24460
|
-
/**
|
|
24461
|
-
* Parse result JSON. Convert integer/float fields.
|
|
24462
|
-
*
|
|
24463
|
-
* @param result Serialized JSON from MediaInfo
|
|
24464
|
-
* @returns Parsed JSON object
|
|
24465
|
-
*/;
|
|
24466
|
-
_proto.parseResultJson = function parseResultJson(resultString) {
|
|
24467
|
-
var intFields = INT_FIELDS;
|
|
24468
|
-
var floatFields = FLOAT_FIELDS;
|
|
24469
|
-
|
|
24470
|
-
// Parse JSON
|
|
24471
|
-
var result = JSON.parse(resultString);
|
|
24472
|
-
if (result.media) {
|
|
24473
|
-
var newMedia = _extends({}, result.media, {
|
|
24474
|
-
track: []
|
|
24475
|
-
});
|
|
24476
|
-
if (Array.isArray(result.media.track)) {
|
|
24477
|
-
for (var _iterator = _createForOfIteratorHelperLoose(result.media.track), _step; !(_step = _iterator()).done;) {
|
|
24478
|
-
var track = _step.value;
|
|
24479
|
-
var newTrack = {
|
|
24480
|
-
'@type': track['@type']
|
|
24481
|
-
};
|
|
24482
|
-
for (var _i = 0, _Object$entries = Object.entries(track); _i < _Object$entries.length; _i++) {
|
|
24483
|
-
var _Object$entries$_i = _Object$entries[_i],
|
|
24484
|
-
key = _Object$entries$_i[0],
|
|
24485
|
-
val = _Object$entries$_i[1];
|
|
24486
|
-
if (key === '@type') {
|
|
24487
|
-
continue;
|
|
24488
|
-
}
|
|
24489
|
-
if (typeof val === 'string' && intFields.includes(key)) {
|
|
24490
|
-
var _extends2;
|
|
24491
|
-
newTrack = _extends({}, newTrack, (_extends2 = {}, _extends2[key] = Number.parseInt(val, 10), _extends2));
|
|
24492
|
-
} else if (typeof val === 'string' && floatFields.includes(key)) {
|
|
24493
|
-
var _extends3;
|
|
24494
|
-
newTrack = _extends({}, newTrack, (_extends3 = {}, _extends3[key] = Number.parseFloat(val), _extends3));
|
|
24495
|
-
} else {
|
|
24496
|
-
var _extends4;
|
|
24497
|
-
newTrack = _extends({}, newTrack, (_extends4 = {}, _extends4[key] = val, _extends4));
|
|
24498
|
-
}
|
|
24499
|
-
}
|
|
24500
|
-
newMedia.track.push(newTrack);
|
|
24501
|
-
}
|
|
24502
|
-
}
|
|
24503
|
-
return _extends({}, result, {
|
|
24504
|
-
media: newMedia
|
|
24505
|
-
});
|
|
24506
|
-
}
|
|
24507
|
-
return result;
|
|
24508
|
-
}
|
|
24509
|
-
|
|
24510
|
-
/**
|
|
24511
|
-
* Instantiate a new WASM module instance.
|
|
24512
|
-
*
|
|
24513
|
-
* @returns MediaInfo module instance
|
|
24514
|
-
*/;
|
|
24515
|
-
_proto.instantiateModuleInstance = function instantiateModuleInstance() {
|
|
24516
|
-
return new this.mediainfoModule.MediaInfo(this.options.format === 'object' ? 'JSON' : this.options.format, this.options.coverData, this.options.full);
|
|
24517
|
-
};
|
|
24518
|
-
return MediaInfo;
|
|
24519
|
-
}(); // This code implements the `-sMODULARIZE` settings by taking the generated
|
|
24520
|
-
// JS program code (INNER_JS_CODE) and wrapping it in a factory function.
|
|
24521
|
-
// When targetting node and ES6 we use `await import ..` in the generated code
|
|
24522
|
-
// so the outer function needs to be marked as async.
|
|
24523
|
-
function Module(_x) {
|
|
24524
|
-
return _Module.apply(this, arguments);
|
|
24525
|
-
}
|
|
24526
|
-
function _Module() {
|
|
24527
|
-
_Module = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(moduleArg) {
|
|
24528
|
-
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;
|
|
24529
|
-
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
24530
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
24531
|
-
case 0:
|
|
24532
|
-
run = function _run() {
|
|
24533
|
-
if (runDependencies > 0) {
|
|
24534
|
-
dependenciesFulfilled = run;
|
|
24535
|
-
return;
|
|
24536
|
-
}
|
|
24537
|
-
|
|
24538
|
-
// a preRun added a dependency, run will be called later
|
|
24539
|
-
if (runDependencies > 0) {
|
|
24540
|
-
dependenciesFulfilled = run;
|
|
24541
|
-
return;
|
|
24542
|
-
}
|
|
24543
|
-
function doRun() {
|
|
24544
|
-
// run may have just been called through dependencies being fulfilled just in this very frame,
|
|
24545
|
-
// or while the async setStatus time below was happening
|
|
24546
|
-
Module['calledRun'] = true;
|
|
24547
|
-
if (ABORT) return;
|
|
24548
|
-
initRuntime();
|
|
24549
|
-
readyPromiseResolve == null || readyPromiseResolve(Module);
|
|
24550
|
-
}
|
|
24551
|
-
{
|
|
24552
|
-
doRun();
|
|
24553
|
-
}
|
|
24554
|
-
};
|
|
24555
|
-
assignWasmExports = function _assignWasmExports(wasmExports) {
|
|
24556
|
-
___getTypeName = wasmExports['__getTypeName'];
|
|
24557
|
-
_malloc = wasmExports['malloc'];
|
|
24558
|
-
_free = wasmExports['free'];
|
|
24559
|
-
wasmExports['_emscripten_stack_restore'];
|
|
24560
|
-
wasmExports['_emscripten_stack_alloc'];
|
|
24561
|
-
wasmExports['emscripten_stack_get_current'];
|
|
24562
|
-
};
|
|
24563
|
-
_fd_seek = function _fd_seek2(fd, offset, whence, newOffset) {
|
|
24564
|
-
return 70;
|
|
24565
|
-
};
|
|
24566
|
-
__gmtime_js = function _gmtime_js(time, tmPtr) {
|
|
24567
|
-
time = bigintToI53Checked(time);
|
|
24568
|
-
var date = new Date(time * 1000);
|
|
24569
|
-
HEAP32[tmPtr >> 2] = date.getUTCSeconds();
|
|
24570
|
-
HEAP32[tmPtr + 4 >> 2] = date.getUTCMinutes();
|
|
24571
|
-
HEAP32[tmPtr + 8 >> 2] = date.getUTCHours();
|
|
24572
|
-
HEAP32[tmPtr + 12 >> 2] = date.getUTCDate();
|
|
24573
|
-
HEAP32[tmPtr + 16 >> 2] = date.getUTCMonth();
|
|
24574
|
-
HEAP32[tmPtr + 20 >> 2] = date.getUTCFullYear() - 1900;
|
|
24575
|
-
HEAP32[tmPtr + 24 >> 2] = date.getUTCDay();
|
|
24576
|
-
var start = Date.UTC(date.getUTCFullYear(), 0, 1, 0, 0, 0, 0);
|
|
24577
|
-
var yday = (date.getTime() - start) / (1000 * 60 * 60 * 24) | 0;
|
|
24578
|
-
HEAP32[tmPtr + 28 >> 2] = yday;
|
|
24579
|
-
};
|
|
24580
|
-
craftInvokerFunction = function _craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc, /** boolean= */isAsync) {
|
|
24581
|
-
// humanName: a human-readable string name for the function to be generated.
|
|
24582
|
-
// argTypes: An array that contains the embind type objects for all types in the function signature.
|
|
24583
|
-
// argTypes[0] is the type object for the function return value.
|
|
24584
|
-
// argTypes[1] is the type object for function this object/class type, or null if not crafting an invoker for a class method.
|
|
24585
|
-
// argTypes[2...] are the actual function parameters.
|
|
24586
|
-
// classType: The embind type object for the class to be bound, or null if this is not a method of a class.
|
|
24587
|
-
// cppInvokerFunc: JS Function object to the C++-side function that interops into C++ code.
|
|
24588
|
-
// cppTargetFunc: Function pointer (an integer to FUNCTION_TABLE) to the target C++ function the cppInvokerFunc will end up calling.
|
|
24589
|
-
// isAsync: Optional. If true, returns an async function. Async bindings are only supported with JSPI.
|
|
24590
|
-
var argCount = argTypes.length;
|
|
24591
|
-
if (argCount < 2) {
|
|
24592
|
-
throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
24593
|
-
}
|
|
24594
|
-
var isClassMethodFunc = argTypes[1] !== null && classType !== null;
|
|
24595
|
-
|
|
24596
|
-
// Free functions with signature "void function()" do not need an invoker that marshalls between wire types.
|
|
24597
|
-
// TODO: This omits argument count check - enable only at -O3 or similar.
|
|
24598
|
-
// if (ENABLE_UNSAFE_OPTS && argCount == 2 && argTypes[0].name == "void" && !isClassMethodFunc) {
|
|
24599
|
-
// return FUNCTION_TABLE[fn];
|
|
24600
|
-
// }
|
|
24601
|
-
|
|
24602
|
-
// Determine if we need to use a dynamic stack to store the destructors for the function parameters.
|
|
24603
|
-
// TODO: Remove this completely once all function invokers are being dynamically generated.
|
|
24604
|
-
var needsDestructorStack = usesDestructorStack(argTypes);
|
|
24605
|
-
var returns = !argTypes[0].isVoid;
|
|
24606
|
-
// Builld the arguments that will be passed into the closure around the invoker
|
|
24607
|
-
// function.
|
|
24608
|
-
var retType = argTypes[0];
|
|
24609
|
-
var instType = argTypes[1];
|
|
24610
|
-
var closureArgs = [humanName, throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, retType.fromWireType.bind(retType), instType == null ? void 0 : instType.toWireType.bind(instType)];
|
|
24611
|
-
for (var i = 2; i < argCount; ++i) {
|
|
24612
|
-
var argType = argTypes[i];
|
|
24613
|
-
closureArgs.push(argType.toWireType.bind(argType));
|
|
24614
|
-
}
|
|
24615
|
-
if (!needsDestructorStack) {
|
|
24616
|
-
// Skip return value at index 0 - it's not deleted here. Also skip class type if not a method.
|
|
24617
|
-
for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) {
|
|
24618
|
-
if (argTypes[i].destructorFunction !== null) {
|
|
24619
|
-
closureArgs.push(argTypes[i].destructorFunction);
|
|
24620
|
-
}
|
|
24621
|
-
}
|
|
24622
|
-
}
|
|
24623
|
-
var invokerFactory = createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync);
|
|
24624
|
-
var invokerFn = invokerFactory.apply(void 0, closureArgs);
|
|
24625
|
-
return createNamedFunction(humanName, invokerFn);
|
|
24626
|
-
};
|
|
24627
|
-
createJsInvoker = function _createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync) {
|
|
24628
|
-
var needsDestructorStack = usesDestructorStack(argTypes);
|
|
24629
|
-
var argCount = argTypes.length - 2;
|
|
24630
|
-
var argsList = [];
|
|
24631
|
-
var argsListWired = ['fn'];
|
|
24632
|
-
if (isClassMethodFunc) {
|
|
24633
|
-
argsListWired.push('thisWired');
|
|
24634
|
-
}
|
|
24635
|
-
for (var i = 0; i < argCount; ++i) {
|
|
24636
|
-
argsList.push("arg" + i);
|
|
24637
|
-
argsListWired.push("arg" + i + "Wired");
|
|
24638
|
-
}
|
|
24639
|
-
argsList = argsList.join(',');
|
|
24640
|
-
argsListWired = argsListWired.join(',');
|
|
24641
|
-
var invokerFnBody = "return function (" + argsList + ") {\n";
|
|
24642
|
-
if (needsDestructorStack) {
|
|
24643
|
-
invokerFnBody += 'var destructors = [];\n';
|
|
24644
|
-
}
|
|
24645
|
-
var dtorStack = needsDestructorStack ? 'destructors' : 'null';
|
|
24646
|
-
var args1 = ['humanName', 'throwBindingError', 'invoker', 'fn', 'runDestructors', 'fromRetWire', 'toClassParamWire'];
|
|
24647
|
-
if (isClassMethodFunc) {
|
|
24648
|
-
invokerFnBody += "var thisWired = toClassParamWire(" + dtorStack + ", this);\n";
|
|
24649
|
-
}
|
|
24650
|
-
for (var i = 0; i < argCount; ++i) {
|
|
24651
|
-
var argName = "toArg" + i + "Wire";
|
|
24652
|
-
invokerFnBody += "var arg" + i + "Wired = " + argName + "(" + dtorStack + ", arg" + i + ");\n";
|
|
24653
|
-
args1.push(argName);
|
|
24654
|
-
}
|
|
24655
|
-
invokerFnBody += (returns || isAsync ? 'var rv = ' : '') + ("invoker(" + argsListWired + ");\n");
|
|
24656
|
-
if (needsDestructorStack) {
|
|
24657
|
-
invokerFnBody += 'runDestructors(destructors);\n';
|
|
24658
|
-
} else {
|
|
24659
|
-
for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) {
|
|
24660
|
-
// Skip return value at index 0 - it's not deleted here. Also skip class type if not a method.
|
|
24661
|
-
var paramName = i === 1 ? 'thisWired' : 'arg' + (i - 2) + 'Wired';
|
|
24662
|
-
if (argTypes[i].destructorFunction !== null) {
|
|
24663
|
-
invokerFnBody += paramName + "_dtor(" + paramName + ");\n";
|
|
24664
|
-
args1.push(paramName + "_dtor");
|
|
24665
|
-
}
|
|
24666
|
-
}
|
|
24667
|
-
}
|
|
24668
|
-
if (returns) {
|
|
24669
|
-
invokerFnBody += 'var ret = fromRetWire(rv);\n' + 'return ret;\n';
|
|
24670
|
-
}
|
|
24671
|
-
invokerFnBody += '}\n';
|
|
24672
|
-
return new Function(args1, invokerFnBody);
|
|
24673
|
-
};
|
|
24674
|
-
usesDestructorStack = function _usesDestructorStack(argTypes) {
|
|
24675
|
-
// Skip return value at index 0 - it's not deleted here.
|
|
24676
|
-
for (var i = 1; i < argTypes.length; ++i) {
|
|
24677
|
-
// The type does not define a destructor function - must use dynamic stack
|
|
24678
|
-
if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) {
|
|
24679
|
-
return true;
|
|
24680
|
-
}
|
|
24681
|
-
}
|
|
24682
|
-
return false;
|
|
24683
|
-
};
|
|
24684
|
-
RegisteredPointer = function _RegisteredPointer(name, registeredClass, isReference, isConst,
|
|
24685
|
-
// smart pointer properties
|
|
24686
|
-
isSmartPointer, pointeeType, sharingPolicy, rawGetPointee, rawConstructor, rawShare, rawDestructor) {
|
|
24687
|
-
this.name = name;
|
|
24688
|
-
this.registeredClass = registeredClass;
|
|
24689
|
-
this.isReference = isReference;
|
|
24690
|
-
this.isConst = isConst;
|
|
24691
|
-
|
|
24692
|
-
// smart pointer properties
|
|
24693
|
-
this.isSmartPointer = isSmartPointer;
|
|
24694
|
-
this.pointeeType = pointeeType;
|
|
24695
|
-
this.sharingPolicy = sharingPolicy;
|
|
24696
|
-
this.rawGetPointee = rawGetPointee;
|
|
24697
|
-
this.rawConstructor = rawConstructor;
|
|
24698
|
-
this.rawShare = rawShare;
|
|
24699
|
-
this.rawDestructor = rawDestructor;
|
|
24700
|
-
if (!isSmartPointer && registeredClass.baseClass === undefined) {
|
|
24701
|
-
if (isConst) {
|
|
24702
|
-
this.toWireType = constNoSmartPtrRawPointerToWireType;
|
|
24703
|
-
this.destructorFunction = null;
|
|
24704
|
-
} else {
|
|
24705
|
-
this.toWireType = nonConstNoSmartPtrRawPointerToWireType;
|
|
24706
|
-
this.destructorFunction = null;
|
|
24707
|
-
}
|
|
24708
|
-
} else {
|
|
24709
|
-
this.toWireType = genericPointerToWireType;
|
|
24710
|
-
// Here we must leave this.destructorFunction undefined, since whether genericPointerToWireType returns
|
|
24711
|
-
// a pointer that needs to be freed up is runtime-dependent, and cannot be evaluated at registration time.
|
|
24712
|
-
// TODO: Create an alternative mechanism that allows removing the use of var destructors = []; array in
|
|
24713
|
-
// craftInvokerFunction altogether.
|
|
24714
|
-
}
|
|
24715
|
-
};
|
|
24716
|
-
RegisteredPointer_fromWireType = function _RegisteredPointer_fr(ptr) {
|
|
24717
|
-
// ptr is a raw pointer (or a raw smartpointer)
|
|
24718
|
-
|
|
24719
|
-
// rawPointer is a maybe-null raw pointer
|
|
24720
|
-
var rawPointer = this.getPointee(ptr);
|
|
24721
|
-
if (!rawPointer) {
|
|
24722
|
-
this.destructor(ptr);
|
|
24723
|
-
return null;
|
|
24724
|
-
}
|
|
24725
|
-
var registeredInstance = getInheritedInstance(this.registeredClass, rawPointer);
|
|
24726
|
-
if (undefined !== registeredInstance) {
|
|
24727
|
-
// JS object has been neutered, time to repopulate it
|
|
24728
|
-
if (0 === registeredInstance.$$.count.value) {
|
|
24729
|
-
registeredInstance.$$.ptr = rawPointer;
|
|
24730
|
-
registeredInstance.$$.smartPtr = ptr;
|
|
24731
|
-
return registeredInstance['clone']();
|
|
24732
|
-
} else {
|
|
24733
|
-
// else, just increment reference count on existing object
|
|
24734
|
-
// it already has a reference to the smart pointer
|
|
24735
|
-
var rv = registeredInstance['clone']();
|
|
24736
|
-
this.destructor(ptr);
|
|
24737
|
-
return rv;
|
|
24738
|
-
}
|
|
24739
|
-
}
|
|
24740
|
-
function makeDefaultHandle() {
|
|
24741
|
-
if (this.isSmartPointer) {
|
|
24742
|
-
return makeClassHandle(this.registeredClass.instancePrototype, {
|
|
24743
|
-
ptrType: this.pointeeType,
|
|
24744
|
-
ptr: rawPointer,
|
|
24745
|
-
smartPtrType: this,
|
|
24746
|
-
smartPtr: ptr
|
|
24747
|
-
});
|
|
24748
|
-
} else {
|
|
24749
|
-
return makeClassHandle(this.registeredClass.instancePrototype, {
|
|
24750
|
-
ptrType: this,
|
|
24751
|
-
ptr: ptr
|
|
24752
|
-
});
|
|
24753
|
-
}
|
|
24754
|
-
}
|
|
24755
|
-
var actualType = this.registeredClass.getActualType(rawPointer);
|
|
24756
|
-
var registeredPointerRecord = registeredPointers[actualType];
|
|
24757
|
-
if (!registeredPointerRecord) {
|
|
24758
|
-
return makeDefaultHandle.call(this);
|
|
24759
|
-
}
|
|
24760
|
-
var toType;
|
|
24761
|
-
if (this.isConst) {
|
|
24762
|
-
toType = registeredPointerRecord.constPointerType;
|
|
24763
|
-
} else {
|
|
24764
|
-
toType = registeredPointerRecord.pointerType;
|
|
24765
|
-
}
|
|
24766
|
-
var dp = _downcastPointer(rawPointer, this.registeredClass, toType.registeredClass);
|
|
24767
|
-
if (dp === null) {
|
|
24768
|
-
return makeDefaultHandle.call(this);
|
|
24769
|
-
}
|
|
24770
|
-
if (this.isSmartPointer) {
|
|
24771
|
-
return makeClassHandle(toType.registeredClass.instancePrototype, {
|
|
24772
|
-
ptrType: toType,
|
|
24773
|
-
ptr: dp,
|
|
24774
|
-
smartPtrType: this,
|
|
24775
|
-
smartPtr: ptr
|
|
24776
|
-
});
|
|
24777
|
-
} else {
|
|
24778
|
-
return makeClassHandle(toType.registeredClass.instancePrototype, {
|
|
24779
|
-
ptrType: toType,
|
|
24780
|
-
ptr: dp
|
|
24781
|
-
});
|
|
24782
|
-
}
|
|
24783
|
-
};
|
|
24784
|
-
readPointer = function _readPointer(pointer) {
|
|
24785
|
-
return this.fromWireType(HEAPU32[pointer >> 2]);
|
|
24786
|
-
};
|
|
24787
|
-
nonConstNoSmartPtrRawPointerToWireType = function _nonConstNoSmartPtrRa(destructors, handle) {
|
|
24788
|
-
if (handle === null) {
|
|
24789
|
-
if (this.isReference) {
|
|
24790
|
-
throwBindingError("null is not a valid " + this.name);
|
|
24791
|
-
}
|
|
24792
|
-
return 0;
|
|
24793
|
-
}
|
|
24794
|
-
if (!handle.$$) {
|
|
24795
|
-
throwBindingError("Cannot pass \"" + embindRepr(handle) + "\" as a " + this.name);
|
|
24796
|
-
}
|
|
24797
|
-
if (!handle.$$.ptr) {
|
|
24798
|
-
throwBindingError("Cannot pass deleted object as a pointer of type " + this.name);
|
|
24799
|
-
}
|
|
24800
|
-
if (handle.$$.ptrType.isConst) {
|
|
24801
|
-
throwBindingError("Cannot convert argument of type " + handle.$$.ptrType.name + " to parameter type " + this.name);
|
|
24802
|
-
}
|
|
24803
|
-
var handleClass = handle.$$.ptrType.registeredClass;
|
|
24804
|
-
var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
24805
|
-
return ptr;
|
|
24806
|
-
};
|
|
24807
|
-
genericPointerToWireType = function _genericPointerToWire(destructors, handle) {
|
|
24808
|
-
var ptr;
|
|
24809
|
-
if (handle === null) {
|
|
24810
|
-
if (this.isReference) {
|
|
24811
|
-
throwBindingError("null is not a valid " + this.name);
|
|
24812
|
-
}
|
|
24813
|
-
if (this.isSmartPointer) {
|
|
24814
|
-
ptr = this.rawConstructor();
|
|
24815
|
-
if (destructors !== null) {
|
|
24816
|
-
destructors.push(this.rawDestructor, ptr);
|
|
24817
|
-
}
|
|
24818
|
-
return ptr;
|
|
24819
|
-
} else {
|
|
24820
|
-
return 0;
|
|
24821
|
-
}
|
|
24822
|
-
}
|
|
24823
|
-
if (!handle || !handle.$$) {
|
|
24824
|
-
throwBindingError("Cannot pass \"" + embindRepr(handle) + "\" as a " + this.name);
|
|
24825
|
-
}
|
|
24826
|
-
if (!handle.$$.ptr) {
|
|
24827
|
-
throwBindingError("Cannot pass deleted object as a pointer of type " + this.name);
|
|
24828
|
-
}
|
|
24829
|
-
if (!this.isConst && handle.$$.ptrType.isConst) {
|
|
24830
|
-
throwBindingError("Cannot convert argument of type " + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + " to parameter type " + this.name);
|
|
24831
|
-
}
|
|
24832
|
-
var handleClass = handle.$$.ptrType.registeredClass;
|
|
24833
|
-
ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
24834
|
-
if (this.isSmartPointer) {
|
|
24835
|
-
// TODO: this is not strictly true
|
|
24836
|
-
// We could support BY_EMVAL conversions from raw pointers to smart pointers
|
|
24837
|
-
// because the smart pointer can hold a reference to the handle
|
|
24838
|
-
if (undefined === handle.$$.smartPtr) {
|
|
24839
|
-
throwBindingError('Passing raw pointer to smart pointer is illegal');
|
|
24840
|
-
}
|
|
24841
|
-
switch (this.sharingPolicy) {
|
|
24842
|
-
case 0:
|
|
24843
|
-
// NONE
|
|
24844
|
-
// no upcasting
|
|
24845
|
-
if (handle.$$.smartPtrType === this) {
|
|
24846
|
-
ptr = handle.$$.smartPtr;
|
|
24847
|
-
} else {
|
|
24848
|
-
throwBindingError("Cannot convert argument of type " + (handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name) + " to parameter type " + this.name);
|
|
24849
|
-
}
|
|
24850
|
-
break;
|
|
24851
|
-
case 1:
|
|
24852
|
-
// INTRUSIVE
|
|
24853
|
-
ptr = handle.$$.smartPtr;
|
|
24854
|
-
break;
|
|
24855
|
-
case 2:
|
|
24856
|
-
// BY_EMVAL
|
|
24857
|
-
if (handle.$$.smartPtrType === this) {
|
|
24858
|
-
ptr = handle.$$.smartPtr;
|
|
24859
|
-
} else {
|
|
24860
|
-
var clonedHandle = handle['clone']();
|
|
24861
|
-
ptr = this.rawShare(ptr, Emval.toHandle(function () {
|
|
24862
|
-
return clonedHandle['delete']();
|
|
24863
|
-
}));
|
|
24864
|
-
if (destructors !== null) {
|
|
24865
|
-
destructors.push(this.rawDestructor, ptr);
|
|
24866
|
-
}
|
|
24867
|
-
}
|
|
24868
|
-
break;
|
|
24869
|
-
default:
|
|
24870
|
-
throwBindingError('Unsupporting sharing policy');
|
|
24871
|
-
}
|
|
24872
|
-
}
|
|
24873
|
-
return ptr;
|
|
24874
|
-
};
|
|
24875
|
-
constNoSmartPtrRawPointerToWireType = function _constNoSmartPtrRawPo(destructors, handle) {
|
|
24876
|
-
if (handle === null) {
|
|
24877
|
-
if (this.isReference) {
|
|
24878
|
-
throwBindingError("null is not a valid " + this.name);
|
|
24879
|
-
}
|
|
24880
|
-
return 0;
|
|
24881
|
-
}
|
|
24882
|
-
if (!handle.$$) {
|
|
24883
|
-
throwBindingError("Cannot pass \"" + embindRepr(handle) + "\" as a " + this.name);
|
|
24884
|
-
}
|
|
24885
|
-
if (!handle.$$.ptr) {
|
|
24886
|
-
throwBindingError("Cannot pass deleted object as a pointer of type " + this.name);
|
|
24887
|
-
}
|
|
24888
|
-
var handleClass = handle.$$.ptrType.registeredClass;
|
|
24889
|
-
var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
24890
|
-
return ptr;
|
|
24891
|
-
};
|
|
24892
|
-
RegisteredClass = function _RegisteredClass(name, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast) {
|
|
24893
|
-
this.name = name;
|
|
24894
|
-
this.constructor = constructor;
|
|
24895
|
-
this.instancePrototype = instancePrototype;
|
|
24896
|
-
this.rawDestructor = rawDestructor;
|
|
24897
|
-
this.baseClass = baseClass;
|
|
24898
|
-
this.getActualType = getActualType;
|
|
24899
|
-
this.upcast = upcast;
|
|
24900
|
-
this.downcast = downcast;
|
|
24901
|
-
this.pureVirtualFunctions = [];
|
|
24902
|
-
};
|
|
24903
|
-
ClassHandle = function _ClassHandle() {};
|
|
24904
|
-
registerType = function _registerType(rawType, registeredInstance, options) {
|
|
24905
|
-
if (options === void 0) {
|
|
24906
|
-
options = {};
|
|
24907
|
-
}
|
|
24908
|
-
return sharedRegisterType(rawType, registeredInstance, options);
|
|
24909
|
-
};
|
|
24910
|
-
sharedRegisterType = function _sharedRegisterType(rawType, registeredInstance, options) {
|
|
24911
|
-
if (options === void 0) {
|
|
24912
|
-
options = {};
|
|
24913
|
-
}
|
|
24914
|
-
var name = registeredInstance.name;
|
|
24915
|
-
if (!rawType) {
|
|
24916
|
-
throwBindingError("type \"" + name + "\" must have a positive integer typeid pointer");
|
|
24917
|
-
}
|
|
24918
|
-
if (registeredTypes.hasOwnProperty(rawType)) {
|
|
24919
|
-
if (options.ignoreDuplicateRegistrations) {
|
|
24920
|
-
return;
|
|
24921
|
-
} else {
|
|
24922
|
-
throwBindingError("Cannot register type '" + name + "' twice");
|
|
24923
|
-
}
|
|
24924
|
-
}
|
|
24925
|
-
registeredTypes[rawType] = registeredInstance;
|
|
24926
|
-
delete typeDependencies[rawType];
|
|
24927
|
-
if (awaitingDependencies.hasOwnProperty(rawType)) {
|
|
24928
|
-
var callbacks = awaitingDependencies[rawType];
|
|
24929
|
-
delete awaitingDependencies[rawType];
|
|
24930
|
-
callbacks.forEach(function (cb) {
|
|
24931
|
-
return cb();
|
|
24932
|
-
});
|
|
24933
|
-
}
|
|
24934
|
-
};
|
|
24935
|
-
_createWasm = function _createWasm3() {
|
|
24936
|
-
_createWasm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
24937
|
-
var _wasmBinaryFile;
|
|
24938
|
-
var receiveInstance, receiveInstantiationResult, info, result, exports;
|
|
24939
|
-
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
24940
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
24941
|
-
case 0:
|
|
24942
|
-
receiveInstantiationResult = function _receiveInstantiation(result) {
|
|
24943
|
-
// 'result' is a ResultObject object which has both the module and instance.
|
|
24944
|
-
// receiveInstance() will swap in the exports (to Module.asm) so they can be called
|
|
24945
|
-
// 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.
|
|
24946
|
-
// When the regression is fixed, can restore the above PTHREADS-enabled path.
|
|
24947
|
-
return receiveInstance(result['instance']);
|
|
24948
|
-
};
|
|
24949
|
-
receiveInstance = function _receiveInstance(instance, module) {
|
|
24950
|
-
wasmExports = instance.exports;
|
|
24951
|
-
wasmMemory = wasmExports['memory'];
|
|
24952
|
-
updateMemoryViews();
|
|
24953
|
-
wasmTable = wasmExports['__indirect_function_table'];
|
|
24954
|
-
assignWasmExports(wasmExports);
|
|
24955
|
-
removeRunDependency();
|
|
24956
|
-
return wasmExports;
|
|
24957
|
-
}; // Load the wasm module and create an instance of using native support in the JS engine.
|
|
24958
|
-
// handle a generated wasm instance, receiving its exports and
|
|
24959
|
-
// performing other necessary setup
|
|
24960
|
-
/** @param {WebAssembly.Module=} module*/
|
|
24961
|
-
// wait for the pthread pool (if any)
|
|
24962
|
-
addRunDependency();
|
|
24963
|
-
|
|
24964
|
-
// Prefer streaming instantiation if available.
|
|
24965
|
-
info = getWasmImports();
|
|
24966
|
-
(_wasmBinaryFile = wasmBinaryFile) != null ? _wasmBinaryFile : wasmBinaryFile = findWasmBinary();
|
|
24967
|
-
_context5.next = 7;
|
|
24968
|
-
return instantiateAsync(wasmBinary, wasmBinaryFile, info);
|
|
24969
|
-
case 7:
|
|
24970
|
-
result = _context5.sent;
|
|
24971
|
-
exports = receiveInstantiationResult(result);
|
|
24972
|
-
return _context5.abrupt("return", exports);
|
|
24973
|
-
case 10:
|
|
24974
|
-
case "end":
|
|
24975
|
-
return _context5.stop();
|
|
24976
|
-
}
|
|
24977
|
-
}, _callee5);
|
|
24978
|
-
}));
|
|
24979
|
-
return _createWasm.apply(this, arguments);
|
|
24980
|
-
};
|
|
24981
|
-
createWasm = function _createWasm2() {
|
|
24982
|
-
return _createWasm.apply(this, arguments);
|
|
24983
|
-
};
|
|
24984
|
-
getWasmImports = function _getWasmImports() {
|
|
24985
|
-
// prepare imports
|
|
24986
|
-
return {
|
|
24987
|
-
env: wasmImports,
|
|
24988
|
-
wasi_snapshot_preview1: wasmImports
|
|
24989
|
-
};
|
|
24990
|
-
};
|
|
24991
|
-
_instantiateAsync = function _instantiateAsync3() {
|
|
24992
|
-
_instantiateAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(binary, binaryFile, imports) {
|
|
24993
|
-
var response, instantiationResult;
|
|
24994
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
24995
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
24996
|
-
case 0:
|
|
24997
|
-
_context4.prev = 0;
|
|
24998
|
-
response = fetch(binaryFile, {
|
|
24999
|
-
credentials: 'same-origin'
|
|
25000
|
-
});
|
|
25001
|
-
_context4.next = 4;
|
|
25002
|
-
return WebAssembly.instantiateStreaming(response, imports);
|
|
25003
|
-
case 4:
|
|
25004
|
-
instantiationResult = _context4.sent;
|
|
25005
|
-
return _context4.abrupt("return", instantiationResult);
|
|
25006
|
-
case 8:
|
|
25007
|
-
_context4.prev = 8;
|
|
25008
|
-
_context4.t0 = _context4["catch"](0);
|
|
25009
|
-
// We expect the most common failure cause to be a bad MIME type for the binary,
|
|
25010
|
-
// in which case falling back to ArrayBuffer instantiation should work.
|
|
25011
|
-
err("wasm streaming compile failed: " + _context4.t0);
|
|
25012
|
-
err('falling back to ArrayBuffer instantiation');
|
|
25013
|
-
// fall back of instantiateArrayBuffer below
|
|
25014
|
-
case 12:
|
|
25015
|
-
return _context4.abrupt("return", instantiateArrayBuffer(binaryFile, imports));
|
|
25016
|
-
case 13:
|
|
25017
|
-
case "end":
|
|
25018
|
-
return _context4.stop();
|
|
25019
|
-
}
|
|
25020
|
-
}, _callee4, null, [[0, 8]]);
|
|
25021
|
-
}));
|
|
25022
|
-
return _instantiateAsync.apply(this, arguments);
|
|
25023
|
-
};
|
|
25024
|
-
instantiateAsync = function _instantiateAsync2(_x6, _x7, _x8) {
|
|
25025
|
-
return _instantiateAsync.apply(this, arguments);
|
|
25026
|
-
};
|
|
25027
|
-
_instantiateArrayBuffer = function _instantiateArrayBuff2() {
|
|
25028
|
-
_instantiateArrayBuffer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(binaryFile, imports) {
|
|
25029
|
-
var binary, instance;
|
|
25030
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
25031
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
25032
|
-
case 0:
|
|
25033
|
-
_context3.prev = 0;
|
|
25034
|
-
_context3.next = 3;
|
|
25035
|
-
return getWasmBinary(binaryFile);
|
|
25036
|
-
case 3:
|
|
25037
|
-
binary = _context3.sent;
|
|
25038
|
-
_context3.next = 6;
|
|
25039
|
-
return WebAssembly.instantiate(binary, imports);
|
|
25040
|
-
case 6:
|
|
25041
|
-
instance = _context3.sent;
|
|
25042
|
-
return _context3.abrupt("return", instance);
|
|
25043
|
-
case 10:
|
|
25044
|
-
_context3.prev = 10;
|
|
25045
|
-
_context3.t0 = _context3["catch"](0);
|
|
25046
|
-
err("failed to asynchronously prepare wasm: " + _context3.t0);
|
|
25047
|
-
abort(_context3.t0);
|
|
25048
|
-
case 14:
|
|
25049
|
-
case "end":
|
|
25050
|
-
return _context3.stop();
|
|
25051
|
-
}
|
|
25052
|
-
}, _callee3, null, [[0, 10]]);
|
|
25053
|
-
}));
|
|
25054
|
-
return _instantiateArrayBuffer.apply(this, arguments);
|
|
25055
|
-
};
|
|
25056
|
-
instantiateArrayBuffer = function _instantiateArrayBuff(_x4, _x5) {
|
|
25057
|
-
return _instantiateArrayBuffer.apply(this, arguments);
|
|
25058
|
-
};
|
|
25059
|
-
_getWasmBinary = function _getWasmBinary3() {
|
|
25060
|
-
_getWasmBinary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(binaryFile) {
|
|
25061
|
-
var response;
|
|
25062
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
25063
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
25064
|
-
case 0:
|
|
25065
|
-
_context2.prev = 0;
|
|
25066
|
-
_context2.next = 3;
|
|
25067
|
-
return readAsync(binaryFile);
|
|
25068
|
-
case 3:
|
|
25069
|
-
response = _context2.sent;
|
|
25070
|
-
return _context2.abrupt("return", new Uint8Array(response));
|
|
25071
|
-
case 7:
|
|
25072
|
-
_context2.prev = 7;
|
|
25073
|
-
_context2.t0 = _context2["catch"](0);
|
|
25074
|
-
case 9:
|
|
25075
|
-
return _context2.abrupt("return", getBinarySync());
|
|
25076
|
-
case 10:
|
|
25077
|
-
case "end":
|
|
25078
|
-
return _context2.stop();
|
|
25079
|
-
}
|
|
25080
|
-
}, _callee2, null, [[0, 7]]);
|
|
25081
|
-
}));
|
|
25082
|
-
return _getWasmBinary.apply(this, arguments);
|
|
25083
|
-
};
|
|
25084
|
-
getWasmBinary = function _getWasmBinary2(_x3) {
|
|
25085
|
-
return _getWasmBinary.apply(this, arguments);
|
|
25086
|
-
};
|
|
25087
|
-
getBinarySync = function _getBinarySync(file) {
|
|
25088
|
-
throw 'both async and sync fetching of the wasm failed';
|
|
25089
|
-
};
|
|
25090
|
-
findWasmBinary = function _findWasmBinary() {
|
|
25091
|
-
if (Module['locateFile']) {
|
|
25092
|
-
return locateFile('MediaInfoModule.wasm');
|
|
25093
|
-
}
|
|
25094
|
-
// Use bundler-friendly `new URL(..., import.meta.url)` pattern; works in browsers too.
|
|
25095
|
-
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;
|
|
25096
|
-
};
|
|
25097
|
-
abort = function _abort(what) {
|
|
25098
|
-
what = 'Aborted(' + what + ')';
|
|
25099
|
-
// TODO(sbc): Should we remove printing and leave it up to whoever
|
|
25100
|
-
// catches the exception?
|
|
25101
|
-
err(what);
|
|
25102
|
-
ABORT = true;
|
|
25103
|
-
what += '. Build with -sASSERTIONS for more info.';
|
|
25104
|
-
|
|
25105
|
-
// Use a wasm runtime error, because a JS error might be seen as a foreign
|
|
25106
|
-
// exception, which means we'd run destructors on it. We need the error to
|
|
25107
|
-
// simply make the program stop.
|
|
25108
|
-
// FIXME This approach does not work in Wasm EH because it currently does not assume
|
|
25109
|
-
// all RuntimeErrors are from traps; it decides whether a RuntimeError is from
|
|
25110
|
-
// a trap or not based on a hidden field within the object. So at the moment
|
|
25111
|
-
// we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that
|
|
25112
|
-
// allows this in the wasm spec.
|
|
25113
|
-
|
|
25114
|
-
// Suppress closure compiler warning here. Closure compiler's builtin extern
|
|
25115
|
-
// definition for WebAssembly.RuntimeError claims it takes no arguments even
|
|
25116
|
-
// though it can.
|
|
25117
|
-
// TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.
|
|
25118
|
-
/** @suppress {checkTypes} */
|
|
25119
|
-
var e = new WebAssembly.RuntimeError(what);
|
|
25120
|
-
readyPromiseReject == null || readyPromiseReject(e);
|
|
25121
|
-
// Throw the error whether or not MODULARIZE is set because abort is used
|
|
25122
|
-
// in code paths apart from instantiation where an exception is expected
|
|
25123
|
-
// to be thrown when abort is called.
|
|
25124
|
-
throw e;
|
|
25125
|
-
};
|
|
25126
|
-
removeRunDependency = function _removeRunDependency(id) {
|
|
25127
|
-
runDependencies--;
|
|
25128
|
-
if (runDependencies == 0) {
|
|
25129
|
-
if (dependenciesFulfilled) {
|
|
25130
|
-
var callback = dependenciesFulfilled;
|
|
25131
|
-
dependenciesFulfilled = null;
|
|
25132
|
-
callback(); // can add another dependenciesFulfilled
|
|
25133
|
-
}
|
|
25134
|
-
}
|
|
25135
|
-
};
|
|
25136
|
-
addRunDependency = function _addRunDependency(id) {
|
|
25137
|
-
runDependencies++;
|
|
25138
|
-
};
|
|
25139
|
-
initRuntime = function _initRuntime() {
|
|
25140
|
-
runtimeInitialized = true;
|
|
25141
|
-
|
|
25142
|
-
// No ATINITS hooks
|
|
25143
|
-
|
|
25144
|
-
wasmExports['__wasm_call_ctors']();
|
|
25145
|
-
|
|
25146
|
-
// No ATPOSTCTORS hooks
|
|
25147
|
-
};
|
|
25148
|
-
updateMemoryViews = function _updateMemoryViews() {
|
|
25149
|
-
var b = wasmMemory.buffer;
|
|
25150
|
-
HEAP8 = new Int8Array(b);
|
|
25151
|
-
HEAP16 = new Int16Array(b);
|
|
25152
|
-
HEAPU8 = new Uint8Array(b);
|
|
25153
|
-
HEAPU16 = new Uint16Array(b);
|
|
25154
|
-
HEAP32 = new Int32Array(b);
|
|
25155
|
-
HEAPU32 = new Uint32Array(b);
|
|
25156
|
-
HEAPF32 = new Float32Array(b);
|
|
25157
|
-
HEAPF64 = new Float64Array(b);
|
|
25158
|
-
HEAP64 = new BigInt64Array(b);
|
|
25159
|
-
HEAPU64 = new BigUint64Array(b);
|
|
25160
|
-
};
|
|
25161
|
-
locateFile = function _locateFile(path) {
|
|
25162
|
-
if (Module['locateFile']) {
|
|
25163
|
-
return Module['locateFile'](path, scriptDirectory);
|
|
25164
|
-
}
|
|
25165
|
-
return scriptDirectory + path;
|
|
25166
|
-
};
|
|
25167
|
-
if (moduleArg === void 0) {
|
|
25168
|
-
moduleArg = {};
|
|
25169
|
-
}
|
|
25170
|
-
// include: shell.js
|
|
25171
|
-
// The Module object: Our interface to the outside world. We import
|
|
25172
|
-
// and export values on it. There are various ways Module can be used:
|
|
25173
|
-
// 1. Not defined. We create it here
|
|
25174
|
-
// 2. A function parameter, function(moduleArg) => Promise<Module>
|
|
25175
|
-
// 3. pre-run appended it, var Module = {}; ..generated code..
|
|
25176
|
-
// 4. External script tag defines var Module.
|
|
25177
|
-
// We need to check if Module already exists (e.g. case 3 above).
|
|
25178
|
-
// Substitution will be replaced with actual code on later stage of the build,
|
|
25179
|
-
// this way Closure Compiler will not mangle it (e.g. case 4. above).
|
|
25180
|
-
// Note that if you want to run closure, and also to use Module
|
|
25181
|
-
// after the generated code, you will need to define var Module = {};
|
|
25182
|
-
// before the code. Then that object will be used in the code, and you
|
|
25183
|
-
// can continue to use Module afterwards as well.
|
|
25184
|
-
Module = moduleArg;
|
|
25185
|
-
thisProgram = './this.program';
|
|
25186
|
-
_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
|
|
25187
|
-
scriptDirectory = ''; // Hooks that are implemented differently in different runtime environments.
|
|
25188
|
-
try {
|
|
25189
|
-
scriptDirectory = new URL('.', _scriptName).href; // includes trailing slash
|
|
25190
|
-
} catch (_unused2) {
|
|
25191
|
-
// Must be a `blob:` or `data:` URL (e.g. `blob:http://site.com/etc/etc`), we cannot
|
|
25192
|
-
// infer anything from them.
|
|
25193
|
-
}
|
|
25194
|
-
// include: web_or_worker_shell_read.js
|
|
25195
|
-
readAsync = /*#__PURE__*/function () {
|
|
25196
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url) {
|
|
25197
|
-
var response;
|
|
25198
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
25199
|
-
while (1) switch (_context.prev = _context.next) {
|
|
25200
|
-
case 0:
|
|
25201
|
-
_context.next = 2;
|
|
25202
|
-
return fetch(url, {
|
|
25203
|
-
credentials: 'same-origin'
|
|
25204
|
-
});
|
|
25205
|
-
case 2:
|
|
25206
|
-
response = _context.sent;
|
|
25207
|
-
if (!response.ok) {
|
|
25208
|
-
_context.next = 5;
|
|
25209
|
-
break;
|
|
25210
|
-
}
|
|
25211
|
-
return _context.abrupt("return", response.arrayBuffer());
|
|
25212
|
-
case 5:
|
|
25213
|
-
throw new Error(response.status + ' : ' + response.url);
|
|
25214
|
-
case 6:
|
|
25215
|
-
case "end":
|
|
25216
|
-
return _context.stop();
|
|
25217
|
-
}
|
|
25218
|
-
}, _callee);
|
|
25219
|
-
}));
|
|
25220
|
-
return function readAsync(_x2) {
|
|
25221
|
-
return _ref.apply(this, arguments);
|
|
25222
|
-
};
|
|
25223
|
-
}();
|
|
25224
|
-
// end include: web_or_worker_shell_read.js
|
|
25225
|
-
out = console.log.bind(console);
|
|
25226
|
-
err = console.error.bind(console); // end include: shell.js
|
|
25227
|
-
// include: preamble.js
|
|
25228
|
-
// === Preamble library stuff ===
|
|
25229
|
-
// Documentation for the public APIs defined in this file must be updated in:
|
|
25230
|
-
// site/source/docs/api_reference/preamble.js.rst
|
|
25231
|
-
// A prebuilt local version of the documentation is available at:
|
|
25232
|
-
// site/build/text/docs/api_reference/preamble.js.txt
|
|
25233
|
-
// You can also build docs locally as HTML or other formats in site/
|
|
25234
|
-
// An online HTML version (which may be of a different version of Emscripten)
|
|
25235
|
-
// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html
|
|
25236
|
-
// Wasm globals
|
|
25237
|
-
//========================================
|
|
25238
|
-
// Runtime essentials
|
|
25239
|
-
//========================================
|
|
25240
|
-
// whether we are quitting the application. no code should run after this.
|
|
25241
|
-
// set in exit() and abort()
|
|
25242
|
-
ABORT = false; // include: runtime_common.js
|
|
25243
|
-
// include: runtime_stack_check.js
|
|
25244
|
-
// end include: runtime_stack_check.js
|
|
25245
|
-
// include: runtime_exceptions.js
|
|
25246
|
-
// end include: runtime_exceptions.js
|
|
25247
|
-
// include: runtime_debug.js
|
|
25248
|
-
// end include: runtime_debug.js
|
|
25249
|
-
// Memory management
|
|
25250
|
-
// BigInt64Array type is not correctly defined in closure
|
|
25251
|
-
runtimeInitialized = false;
|
|
25252
|
-
// A counter of dependencies for calling run(). If we need to
|
|
25253
|
-
// do asynchronous work before running, increment this and
|
|
25254
|
-
// decrement it. Incrementing must happen in a place like
|
|
25255
|
-
// Module.preRun (used by emcc to add file preloading).
|
|
25256
|
-
// Note that you can add dependencies in preRun, even though
|
|
25257
|
-
// it happens right before run - run will be postponed until
|
|
25258
|
-
// the dependencies are met.
|
|
25259
|
-
runDependencies = 0;
|
|
25260
|
-
dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled
|
|
25261
|
-
/** @param {string|number=} what */
|
|
25262
|
-
// Create the wasm instance.
|
|
25263
|
-
// Receives the wasm imports, returns the exports.
|
|
25264
|
-
__abort_js = function __abort_js() {
|
|
25265
|
-
return abort('');
|
|
25266
|
-
};
|
|
25267
|
-
AsciiToString = function AsciiToString(ptr) {
|
|
25268
|
-
var str = '';
|
|
25269
|
-
while (1) {
|
|
25270
|
-
var ch = HEAPU8[ptr++];
|
|
25271
|
-
if (!ch) return str;
|
|
25272
|
-
str += String.fromCharCode(ch);
|
|
25273
|
-
}
|
|
25274
|
-
};
|
|
25275
|
-
awaitingDependencies = {};
|
|
25276
|
-
registeredTypes = {};
|
|
25277
|
-
typeDependencies = {};
|
|
25278
|
-
BindingError = /*#__PURE__*/function (_Error) {
|
|
25279
|
-
function BindingError(message) {
|
|
25280
|
-
var _this2;
|
|
25281
|
-
_this2 = _Error.call(this, message) || this;
|
|
25282
|
-
_this2.name = 'BindingError';
|
|
25283
|
-
return _this2;
|
|
25284
|
-
}
|
|
25285
|
-
_inheritsLoose(BindingError, _Error);
|
|
25286
|
-
return BindingError;
|
|
25287
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
25288
|
-
throwBindingError = function throwBindingError(message) {
|
|
25289
|
-
throw new BindingError(message);
|
|
25290
|
-
};
|
|
25291
|
-
/** @param {Object=} options */
|
|
25292
|
-
/** @param {Object=} options */
|
|
25293
|
-
integerReadValueFromPointer = function integerReadValueFromPointer(name, width, signed) {
|
|
25294
|
-
// integers are quite common, so generate very specialized functions
|
|
25295
|
-
switch (width) {
|
|
25296
|
-
case 1:
|
|
25297
|
-
return signed ? function (pointer) {
|
|
25298
|
-
return HEAP8[pointer];
|
|
25299
|
-
} : function (pointer) {
|
|
25300
|
-
return HEAPU8[pointer];
|
|
25301
|
-
};
|
|
25302
|
-
case 2:
|
|
25303
|
-
return signed ? function (pointer) {
|
|
25304
|
-
return HEAP16[pointer >> 1];
|
|
25305
|
-
} : function (pointer) {
|
|
25306
|
-
return HEAPU16[pointer >> 1];
|
|
25307
|
-
};
|
|
25308
|
-
case 4:
|
|
25309
|
-
return signed ? function (pointer) {
|
|
25310
|
-
return HEAP32[pointer >> 2];
|
|
25311
|
-
} : function (pointer) {
|
|
25312
|
-
return HEAPU32[pointer >> 2];
|
|
25313
|
-
};
|
|
25314
|
-
case 8:
|
|
25315
|
-
return signed ? function (pointer) {
|
|
25316
|
-
return HEAP64[pointer >> 3];
|
|
25317
|
-
} : function (pointer) {
|
|
25318
|
-
return HEAPU64[pointer >> 3];
|
|
25319
|
-
};
|
|
25320
|
-
default:
|
|
25321
|
-
throw new TypeError("invalid integer width (" + width + "): " + name);
|
|
25322
|
-
}
|
|
25323
|
-
};
|
|
25324
|
-
/** @suppress {globalThis} */
|
|
25325
|
-
__embind_register_bigint = function __embind_register_bigint(primitiveType, name, size, minRange, maxRange) {
|
|
25326
|
-
name = AsciiToString(name);
|
|
25327
|
-
var isUnsignedType = minRange === 0n;
|
|
25328
|
-
var fromWireType = function fromWireType(value) {
|
|
25329
|
-
return value;
|
|
25330
|
-
};
|
|
25331
|
-
if (isUnsignedType) {
|
|
25332
|
-
// uint64 get converted to int64 in ABI, fix them up like we do for 32-bit integers.
|
|
25333
|
-
var bitSize = size * 8;
|
|
25334
|
-
fromWireType = function fromWireType(value) {
|
|
25335
|
-
return BigInt.asUintN(bitSize, value);
|
|
25336
|
-
};
|
|
25337
|
-
maxRange = fromWireType(maxRange);
|
|
25338
|
-
}
|
|
25339
|
-
registerType(primitiveType, {
|
|
25340
|
-
name: name,
|
|
25341
|
-
fromWireType: fromWireType,
|
|
25342
|
-
toWireType: function toWireType(destructors, value) {
|
|
25343
|
-
if (typeof value == 'number') {
|
|
25344
|
-
value = BigInt(value);
|
|
25345
|
-
}
|
|
25346
|
-
return value;
|
|
25347
|
-
},
|
|
25348
|
-
readValueFromPointer: integerReadValueFromPointer(name, size, !isUnsignedType),
|
|
25349
|
-
destructorFunction: null // This type does not need a destructor
|
|
25350
|
-
});
|
|
25351
|
-
};
|
|
25352
|
-
/** @suppress {globalThis} */
|
|
25353
|
-
__embind_register_bool = function __embind_register_bool(rawType, name, trueValue, falseValue) {
|
|
25354
|
-
name = AsciiToString(name);
|
|
25355
|
-
registerType(rawType, {
|
|
25356
|
-
name: name,
|
|
25357
|
-
fromWireType: function fromWireType(wt) {
|
|
25358
|
-
// ambiguous emscripten ABI: sometimes return values are
|
|
25359
|
-
// true or false, and sometimes integers (0 or 1)
|
|
25360
|
-
return !!wt;
|
|
25361
|
-
},
|
|
25362
|
-
toWireType: function toWireType(destructors, o) {
|
|
25363
|
-
return o ? trueValue : falseValue;
|
|
25364
|
-
},
|
|
25365
|
-
readValueFromPointer: function readValueFromPointer(pointer) {
|
|
25366
|
-
return this.fromWireType(HEAPU8[pointer]);
|
|
25367
|
-
},
|
|
25368
|
-
destructorFunction: null // This type does not need a destructor
|
|
25369
|
-
});
|
|
25370
|
-
};
|
|
25371
|
-
shallowCopyInternalPointer = function shallowCopyInternalPointer(o) {
|
|
25372
|
-
return {
|
|
25373
|
-
count: o.count,
|
|
25374
|
-
deleteScheduled: o.deleteScheduled,
|
|
25375
|
-
preservePointerOnDelete: o.preservePointerOnDelete,
|
|
25376
|
-
ptr: o.ptr,
|
|
25377
|
-
ptrType: o.ptrType,
|
|
25378
|
-
smartPtr: o.smartPtr,
|
|
25379
|
-
smartPtrType: o.smartPtrType
|
|
25380
|
-
};
|
|
25381
|
-
};
|
|
25382
|
-
throwInstanceAlreadyDeleted = function throwInstanceAlreadyDeleted(obj) {
|
|
25383
|
-
function getInstanceTypeName(handle) {
|
|
25384
|
-
return handle.$$.ptrType.registeredClass.name;
|
|
25385
|
-
}
|
|
25386
|
-
throwBindingError(getInstanceTypeName(obj) + ' instance already deleted');
|
|
25387
|
-
};
|
|
25388
|
-
finalizationRegistry = false;
|
|
25389
|
-
detachFinalizer = function detachFinalizer(handle) {};
|
|
25390
|
-
runDestructor = function runDestructor($$) {
|
|
25391
|
-
if ($$.smartPtr) {
|
|
25392
|
-
$$.smartPtrType.rawDestructor($$.smartPtr);
|
|
25393
|
-
} else {
|
|
25394
|
-
$$.ptrType.registeredClass.rawDestructor($$.ptr);
|
|
25395
|
-
}
|
|
25396
|
-
};
|
|
25397
|
-
releaseClassHandle = function releaseClassHandle($$) {
|
|
25398
|
-
$$.count.value -= 1;
|
|
25399
|
-
var toDelete = 0 === $$.count.value;
|
|
25400
|
-
if (toDelete) {
|
|
25401
|
-
runDestructor($$);
|
|
25402
|
-
}
|
|
25403
|
-
};
|
|
25404
|
-
_attachFinalizer = function attachFinalizer(handle) {
|
|
25405
|
-
if ('undefined' === typeof FinalizationRegistry) {
|
|
25406
|
-
_attachFinalizer = function attachFinalizer(handle) {
|
|
25407
|
-
return handle;
|
|
25408
|
-
};
|
|
25409
|
-
return handle;
|
|
25410
|
-
}
|
|
25411
|
-
// If the running environment has a FinalizationRegistry (see
|
|
25412
|
-
// https://github.com/tc39/proposal-weakrefs), then attach finalizers
|
|
25413
|
-
// for class handles. We check for the presence of FinalizationRegistry
|
|
25414
|
-
// at run-time, not build-time.
|
|
25415
|
-
finalizationRegistry = new FinalizationRegistry(function (info) {
|
|
25416
|
-
releaseClassHandle(info.$$);
|
|
25417
|
-
});
|
|
25418
|
-
_attachFinalizer = function attachFinalizer(handle) {
|
|
25419
|
-
var $$ = handle.$$;
|
|
25420
|
-
var hasSmartPtr = !!$$.smartPtr;
|
|
25421
|
-
if (hasSmartPtr) {
|
|
25422
|
-
// We should not call the destructor on raw pointers in case other code expects the pointee to live
|
|
25423
|
-
var info = {
|
|
25424
|
-
$$: $$
|
|
25425
|
-
};
|
|
25426
|
-
finalizationRegistry.register(handle, info, handle);
|
|
25427
|
-
}
|
|
25428
|
-
return handle;
|
|
25429
|
-
};
|
|
25430
|
-
detachFinalizer = function detachFinalizer(handle) {
|
|
25431
|
-
return finalizationRegistry.unregister(handle);
|
|
25432
|
-
};
|
|
25433
|
-
return _attachFinalizer(handle);
|
|
25434
|
-
};
|
|
25435
|
-
init_ClassHandle = function init_ClassHandle() {
|
|
25436
|
-
var proto = ClassHandle.prototype;
|
|
25437
|
-
Object.assign(proto, {
|
|
25438
|
-
isAliasOf: function isAliasOf(other) {
|
|
25439
|
-
if (!(this instanceof ClassHandle)) {
|
|
25440
|
-
return false;
|
|
25441
|
-
}
|
|
25442
|
-
if (!(other instanceof ClassHandle)) {
|
|
25443
|
-
return false;
|
|
25444
|
-
}
|
|
25445
|
-
var leftClass = this.$$.ptrType.registeredClass;
|
|
25446
|
-
var left = this.$$.ptr;
|
|
25447
|
-
other.$$ = /** @type {Object} */other.$$;
|
|
25448
|
-
var rightClass = other.$$.ptrType.registeredClass;
|
|
25449
|
-
var right = other.$$.ptr;
|
|
25450
|
-
while (leftClass.baseClass) {
|
|
25451
|
-
left = leftClass.upcast(left);
|
|
25452
|
-
leftClass = leftClass.baseClass;
|
|
25453
|
-
}
|
|
25454
|
-
while (rightClass.baseClass) {
|
|
25455
|
-
right = rightClass.upcast(right);
|
|
25456
|
-
rightClass = rightClass.baseClass;
|
|
25457
|
-
}
|
|
25458
|
-
return leftClass === rightClass && left === right;
|
|
25459
|
-
},
|
|
25460
|
-
clone: function clone() {
|
|
25461
|
-
if (!this.$$.ptr) {
|
|
25462
|
-
throwInstanceAlreadyDeleted(this);
|
|
25463
|
-
}
|
|
25464
|
-
if (this.$$.preservePointerOnDelete) {
|
|
25465
|
-
this.$$.count.value += 1;
|
|
25466
|
-
return this;
|
|
25467
|
-
} else {
|
|
25468
|
-
var clone = _attachFinalizer(Object.create(Object.getPrototypeOf(this), {
|
|
25469
|
-
$$: {
|
|
25470
|
-
value: shallowCopyInternalPointer(this.$$)
|
|
25471
|
-
}
|
|
25472
|
-
}));
|
|
25473
|
-
clone.$$.count.value += 1;
|
|
25474
|
-
clone.$$.deleteScheduled = false;
|
|
25475
|
-
return clone;
|
|
25476
|
-
}
|
|
25477
|
-
},
|
|
25478
|
-
"delete": function _delete() {
|
|
25479
|
-
if (!this.$$.ptr) {
|
|
25480
|
-
throwInstanceAlreadyDeleted(this);
|
|
25481
|
-
}
|
|
25482
|
-
if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) {
|
|
25483
|
-
throwBindingError('Object already scheduled for deletion');
|
|
25484
|
-
}
|
|
25485
|
-
detachFinalizer(this);
|
|
25486
|
-
releaseClassHandle(this.$$);
|
|
25487
|
-
if (!this.$$.preservePointerOnDelete) {
|
|
25488
|
-
this.$$.smartPtr = undefined;
|
|
25489
|
-
this.$$.ptr = undefined;
|
|
25490
|
-
}
|
|
25491
|
-
},
|
|
25492
|
-
isDeleted: function isDeleted() {
|
|
25493
|
-
return !this.$$.ptr;
|
|
25494
|
-
},
|
|
25495
|
-
deleteLater: function deleteLater() {
|
|
25496
|
-
if (!this.$$.ptr) {
|
|
25497
|
-
throwInstanceAlreadyDeleted(this);
|
|
25498
|
-
}
|
|
25499
|
-
if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) {
|
|
25500
|
-
throwBindingError('Object already scheduled for deletion');
|
|
25501
|
-
}
|
|
25502
|
-
this.$$.deleteScheduled = true;
|
|
25503
|
-
return this;
|
|
25504
|
-
}
|
|
25505
|
-
});
|
|
25506
|
-
|
|
25507
|
-
// Support `using ...` from https://github.com/tc39/proposal-explicit-resource-management.
|
|
25508
|
-
var symbolDispose = Symbol.dispose;
|
|
25509
|
-
if (symbolDispose) {
|
|
25510
|
-
proto[symbolDispose] = proto['delete'];
|
|
25511
|
-
}
|
|
25512
|
-
};
|
|
25513
|
-
/** @constructor */
|
|
25514
|
-
createNamedFunction = function createNamedFunction(name, func) {
|
|
25515
|
-
return Object.defineProperty(func, 'name', {
|
|
25516
|
-
value: name
|
|
25517
|
-
});
|
|
25518
|
-
};
|
|
25519
|
-
registeredPointers = {};
|
|
25520
|
-
ensureOverloadTable = function ensureOverloadTable(proto, methodName, humanName) {
|
|
25521
|
-
if (undefined === proto[methodName].overloadTable) {
|
|
25522
|
-
var prevFunc = proto[methodName];
|
|
25523
|
-
// Inject an overload resolver function that routes to the appropriate overload based on the number of arguments.
|
|
25524
|
-
proto[methodName] = function () {
|
|
25525
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25526
|
-
args[_key] = arguments[_key];
|
|
25527
|
-
}
|
|
25528
|
-
// TODO This check can be removed in -O3 level "unsafe" optimizations.
|
|
25529
|
-
if (!proto[methodName].overloadTable.hasOwnProperty(args.length)) {
|
|
25530
|
-
throwBindingError("Function '" + humanName + "' called with an invalid number of arguments (" + args.length + ") - expects one of (" + proto[methodName].overloadTable + ")!");
|
|
25531
|
-
}
|
|
25532
|
-
return proto[methodName].overloadTable[args.length].apply(this, args);
|
|
25533
|
-
};
|
|
25534
|
-
// Move the previous function into the overload table.
|
|
25535
|
-
proto[methodName].overloadTable = [];
|
|
25536
|
-
proto[methodName].overloadTable[prevFunc.argCount] = prevFunc;
|
|
25537
|
-
}
|
|
25538
|
-
};
|
|
25539
|
-
/** @param {number=} numArguments */
|
|
25540
|
-
exposePublicSymbol = function exposePublicSymbol(name, value, numArguments) {
|
|
25541
|
-
if (Module.hasOwnProperty(name)) {
|
|
25542
|
-
{
|
|
25543
|
-
throwBindingError("Cannot register public name '" + name + "' twice");
|
|
25544
|
-
}
|
|
25545
|
-
|
|
25546
|
-
// We are exposing a function with the same name as an existing function. Create an overload table and a function selector
|
|
25547
|
-
// that routes between the two.
|
|
25548
|
-
ensureOverloadTable(Module, name, name);
|
|
25549
|
-
if (Module[name].overloadTable.hasOwnProperty(numArguments)) {
|
|
25550
|
-
throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (" + numArguments + ")!");
|
|
25551
|
-
}
|
|
25552
|
-
// Add the new function into the overload table.
|
|
25553
|
-
Module[name].overloadTable[numArguments] = value;
|
|
25554
|
-
} else {
|
|
25555
|
-
Module[name] = value;
|
|
25556
|
-
Module[name].argCount = numArguments;
|
|
25557
|
-
}
|
|
25558
|
-
};
|
|
25559
|
-
char_0 = 48;
|
|
25560
|
-
char_9 = 57;
|
|
25561
|
-
makeLegalFunctionName = function makeLegalFunctionName(name) {
|
|
25562
|
-
name = name.replace(/[^a-zA-Z0-9_]/g, '$');
|
|
25563
|
-
var f = name.charCodeAt(0);
|
|
25564
|
-
if (f >= char_0 && f <= char_9) {
|
|
25565
|
-
return "_" + name;
|
|
25566
|
-
}
|
|
25567
|
-
return name;
|
|
25568
|
-
};
|
|
25569
|
-
/** @constructor */
|
|
25570
|
-
upcastPointer = function upcastPointer(ptr, ptrClass, desiredClass) {
|
|
25571
|
-
while (ptrClass !== desiredClass) {
|
|
25572
|
-
if (!ptrClass.upcast) {
|
|
25573
|
-
throwBindingError("Expected null or instance of " + desiredClass.name + ", got an instance of " + ptrClass.name);
|
|
25574
|
-
}
|
|
25575
|
-
ptr = ptrClass.upcast(ptr);
|
|
25576
|
-
ptrClass = ptrClass.baseClass;
|
|
25577
|
-
}
|
|
25578
|
-
return ptr;
|
|
25579
|
-
};
|
|
25580
|
-
embindRepr = function embindRepr(v) {
|
|
25581
|
-
if (v === null) {
|
|
25582
|
-
return 'null';
|
|
25583
|
-
}
|
|
25584
|
-
var t = typeof v;
|
|
25585
|
-
if (t === 'object' || t === 'array' || t === 'function') {
|
|
25586
|
-
return v.toString();
|
|
25587
|
-
} else {
|
|
25588
|
-
return '' + v;
|
|
25589
|
-
}
|
|
25590
|
-
};
|
|
25591
|
-
/** @suppress {globalThis} */
|
|
25592
|
-
/** @suppress {globalThis} */
|
|
25593
|
-
/** @suppress {globalThis} */
|
|
25594
|
-
/** @suppress {globalThis} */
|
|
25595
|
-
_downcastPointer = function downcastPointer(ptr, ptrClass, desiredClass) {
|
|
25596
|
-
if (ptrClass === desiredClass) {
|
|
25597
|
-
return ptr;
|
|
25598
|
-
}
|
|
25599
|
-
if (undefined === desiredClass.baseClass) {
|
|
25600
|
-
return null; // no conversion
|
|
25601
|
-
}
|
|
25602
|
-
var rv = _downcastPointer(ptr, ptrClass, desiredClass.baseClass);
|
|
25603
|
-
if (rv === null) {
|
|
25604
|
-
return null;
|
|
25605
|
-
}
|
|
25606
|
-
return desiredClass.downcast(rv);
|
|
25607
|
-
};
|
|
25608
|
-
registeredInstances = {};
|
|
25609
|
-
getBasestPointer = function getBasestPointer(class_, ptr) {
|
|
25610
|
-
if (ptr === undefined) {
|
|
25611
|
-
throwBindingError('ptr should not be undefined');
|
|
25612
|
-
}
|
|
25613
|
-
while (class_.baseClass) {
|
|
25614
|
-
ptr = class_.upcast(ptr);
|
|
25615
|
-
class_ = class_.baseClass;
|
|
25616
|
-
}
|
|
25617
|
-
return ptr;
|
|
25618
|
-
};
|
|
25619
|
-
getInheritedInstance = function getInheritedInstance(class_, ptr) {
|
|
25620
|
-
ptr = getBasestPointer(class_, ptr);
|
|
25621
|
-
return registeredInstances[ptr];
|
|
25622
|
-
};
|
|
25623
|
-
InternalError = /*#__PURE__*/function (_Error2) {
|
|
25624
|
-
function InternalError(message) {
|
|
25625
|
-
var _this3;
|
|
25626
|
-
_this3 = _Error2.call(this, message) || this;
|
|
25627
|
-
_this3.name = 'InternalError';
|
|
25628
|
-
return _this3;
|
|
25629
|
-
}
|
|
25630
|
-
_inheritsLoose(InternalError, _Error2);
|
|
25631
|
-
return InternalError;
|
|
25632
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
25633
|
-
throwInternalError = function throwInternalError(message) {
|
|
25634
|
-
throw new InternalError(message);
|
|
25635
|
-
};
|
|
25636
|
-
makeClassHandle = function makeClassHandle(prototype, record) {
|
|
25637
|
-
if (!record.ptrType || !record.ptr) {
|
|
25638
|
-
throwInternalError('makeClassHandle requires ptr and ptrType');
|
|
25639
|
-
}
|
|
25640
|
-
var hasSmartPtrType = !!record.smartPtrType;
|
|
25641
|
-
var hasSmartPtr = !!record.smartPtr;
|
|
25642
|
-
if (hasSmartPtrType !== hasSmartPtr) {
|
|
25643
|
-
throwInternalError('Both smartPtrType and smartPtr must be specified');
|
|
25644
|
-
}
|
|
25645
|
-
record.count = {
|
|
25646
|
-
value: 1
|
|
25647
|
-
};
|
|
25648
|
-
return _attachFinalizer(Object.create(prototype, {
|
|
25649
|
-
$$: {
|
|
25650
|
-
value: record,
|
|
25651
|
-
writable: true
|
|
25652
|
-
}
|
|
25653
|
-
}));
|
|
25654
|
-
};
|
|
25655
|
-
/** @suppress {globalThis} */
|
|
25656
|
-
init_RegisteredPointer = function init_RegisteredPointer() {
|
|
25657
|
-
Object.assign(RegisteredPointer.prototype, {
|
|
25658
|
-
getPointee: function getPointee(ptr) {
|
|
25659
|
-
if (this.rawGetPointee) {
|
|
25660
|
-
ptr = this.rawGetPointee(ptr);
|
|
25661
|
-
}
|
|
25662
|
-
return ptr;
|
|
25663
|
-
},
|
|
25664
|
-
destructor: function destructor(ptr) {
|
|
25665
|
-
var _this$rawDestructor;
|
|
25666
|
-
(_this$rawDestructor = this.rawDestructor) == null || _this$rawDestructor.call(this, ptr);
|
|
25667
|
-
},
|
|
25668
|
-
readValueFromPointer: readPointer,
|
|
25669
|
-
fromWireType: RegisteredPointer_fromWireType
|
|
25670
|
-
});
|
|
25671
|
-
};
|
|
25672
|
-
/** @constructor
|
|
25673
|
-
@param {*=} pointeeType,
|
|
25674
|
-
@param {*=} sharingPolicy,
|
|
25675
|
-
@param {*=} rawGetPointee,
|
|
25676
|
-
@param {*=} rawConstructor,
|
|
25677
|
-
@param {*=} rawShare,
|
|
25678
|
-
@param {*=} rawDestructor,
|
|
25679
|
-
*/
|
|
25680
|
-
/** @param {number=} numArguments */
|
|
25681
|
-
replacePublicSymbol = function replacePublicSymbol(name, value, numArguments) {
|
|
25682
|
-
if (!Module.hasOwnProperty(name)) {
|
|
25683
|
-
throwInternalError('Replacing nonexistent public symbol');
|
|
25684
|
-
}
|
|
25685
|
-
// If there's an overload table for this symbol, replace the symbol in the overload table instead.
|
|
25686
|
-
if (undefined !== Module[name].overloadTable && undefined !== numArguments) ;else {
|
|
25687
|
-
Module[name] = value;
|
|
25688
|
-
Module[name].argCount = numArguments;
|
|
25689
|
-
}
|
|
25690
|
-
};
|
|
25691
|
-
wasmTableMirror = [];
|
|
25692
|
-
/** @type {WebAssembly.Table} */
|
|
25693
|
-
getWasmTableEntry = function getWasmTableEntry(funcPtr) {
|
|
25694
|
-
var func = wasmTableMirror[funcPtr];
|
|
25695
|
-
if (!func) {
|
|
25696
|
-
/** @suppress {checkTypes} */
|
|
25697
|
-
wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr);
|
|
25698
|
-
}
|
|
25699
|
-
return func;
|
|
25700
|
-
};
|
|
25701
|
-
embind__requireFunction = function embind__requireFunction(signature, rawFunction, isAsync) {
|
|
25702
|
-
signature = AsciiToString(signature);
|
|
25703
|
-
function makeDynCaller() {
|
|
25704
|
-
var rtn = getWasmTableEntry(rawFunction);
|
|
25705
|
-
return rtn;
|
|
25706
|
-
}
|
|
25707
|
-
var fp = makeDynCaller();
|
|
25708
|
-
if (typeof fp != 'function') {
|
|
25709
|
-
throwBindingError("unknown function pointer with signature " + signature + ": " + rawFunction);
|
|
25710
|
-
}
|
|
25711
|
-
return fp;
|
|
25712
|
-
};
|
|
25713
|
-
UnboundTypeError = /*#__PURE__*/function (_Error3) {
|
|
25714
|
-
function UnboundTypeError() {
|
|
25715
|
-
return _Error3.apply(this, arguments) || this;
|
|
25716
|
-
}
|
|
25717
|
-
_inheritsLoose(UnboundTypeError, _Error3);
|
|
25718
|
-
return UnboundTypeError;
|
|
25719
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
25720
|
-
getTypeName = function getTypeName(type) {
|
|
25721
|
-
var ptr = ___getTypeName(type);
|
|
25722
|
-
var rv = AsciiToString(ptr);
|
|
25723
|
-
_free(ptr);
|
|
25724
|
-
return rv;
|
|
25725
|
-
};
|
|
25726
|
-
throwUnboundTypeError = function throwUnboundTypeError(message, types) {
|
|
25727
|
-
var unboundTypes = [];
|
|
25728
|
-
var seen = {};
|
|
25729
|
-
function visit(type) {
|
|
25730
|
-
if (seen[type]) {
|
|
25731
|
-
return;
|
|
25732
|
-
}
|
|
25733
|
-
if (registeredTypes[type]) {
|
|
25734
|
-
return;
|
|
25735
|
-
}
|
|
25736
|
-
if (typeDependencies[type]) {
|
|
25737
|
-
typeDependencies[type].forEach(visit);
|
|
25738
|
-
return;
|
|
25739
|
-
}
|
|
25740
|
-
unboundTypes.push(type);
|
|
25741
|
-
seen[type] = true;
|
|
25742
|
-
}
|
|
25743
|
-
types.forEach(visit);
|
|
25744
|
-
throw new UnboundTypeError(message + ": " + unboundTypes.map(getTypeName).join([', ']));
|
|
25745
|
-
};
|
|
25746
|
-
whenDependentTypesAreResolved = function whenDependentTypesAreResolved(myTypes, dependentTypes, getTypeConverters) {
|
|
25747
|
-
myTypes.forEach(function (type) {
|
|
25748
|
-
return typeDependencies[type] = dependentTypes;
|
|
25749
|
-
});
|
|
25750
|
-
function onComplete(typeConverters) {
|
|
25751
|
-
var myTypeConverters = getTypeConverters(typeConverters);
|
|
25752
|
-
if (myTypeConverters.length !== myTypes.length) {
|
|
25753
|
-
throwInternalError('Mismatched type converter count');
|
|
25754
|
-
}
|
|
25755
|
-
for (var i = 0; i < myTypes.length; ++i) {
|
|
25756
|
-
registerType(myTypes[i], myTypeConverters[i]);
|
|
25757
|
-
}
|
|
25758
|
-
}
|
|
25759
|
-
var typeConverters = new Array(dependentTypes.length);
|
|
25760
|
-
var unregisteredTypes = [];
|
|
25761
|
-
var registered = 0;
|
|
25762
|
-
dependentTypes.forEach(function (dt, i) {
|
|
25763
|
-
if (registeredTypes.hasOwnProperty(dt)) {
|
|
25764
|
-
typeConverters[i] = registeredTypes[dt];
|
|
25765
|
-
} else {
|
|
25766
|
-
unregisteredTypes.push(dt);
|
|
25767
|
-
if (!awaitingDependencies.hasOwnProperty(dt)) {
|
|
25768
|
-
awaitingDependencies[dt] = [];
|
|
25769
|
-
}
|
|
25770
|
-
awaitingDependencies[dt].push(function () {
|
|
25771
|
-
typeConverters[i] = registeredTypes[dt];
|
|
25772
|
-
++registered;
|
|
25773
|
-
if (registered === unregisteredTypes.length) {
|
|
25774
|
-
onComplete(typeConverters);
|
|
25775
|
-
}
|
|
25776
|
-
});
|
|
25777
|
-
}
|
|
25778
|
-
});
|
|
25779
|
-
if (0 === unregisteredTypes.length) {
|
|
25780
|
-
onComplete(typeConverters);
|
|
25781
|
-
}
|
|
25782
|
-
};
|
|
25783
|
-
__embind_register_class = function __embind_register_class(rawType, rawPointerType, rawConstPointerType, baseClassRawType, getActualTypeSignature, getActualType, upcastSignature, upcast, downcastSignature, downcast, name, destructorSignature, rawDestructor) {
|
|
25784
|
-
name = AsciiToString(name);
|
|
25785
|
-
getActualType = embind__requireFunction(getActualTypeSignature, getActualType);
|
|
25786
|
-
upcast && (upcast = embind__requireFunction(upcastSignature, upcast));
|
|
25787
|
-
downcast && (downcast = embind__requireFunction(downcastSignature, downcast));
|
|
25788
|
-
rawDestructor = embind__requireFunction(destructorSignature, rawDestructor);
|
|
25789
|
-
var legalFunctionName = makeLegalFunctionName(name);
|
|
25790
|
-
exposePublicSymbol(legalFunctionName, function () {
|
|
25791
|
-
// this code cannot run if baseClassRawType is zero
|
|
25792
|
-
throwUnboundTypeError("Cannot construct " + name + " due to unbound types", [baseClassRawType]);
|
|
25793
|
-
});
|
|
25794
|
-
whenDependentTypesAreResolved([rawType, rawPointerType, rawConstPointerType], baseClassRawType ? [baseClassRawType] : [], function (base) {
|
|
25795
|
-
base = base[0];
|
|
25796
|
-
var baseClass;
|
|
25797
|
-
var basePrototype;
|
|
25798
|
-
if (baseClassRawType) {
|
|
25799
|
-
baseClass = base.registeredClass;
|
|
25800
|
-
basePrototype = baseClass.instancePrototype;
|
|
25801
|
-
} else {
|
|
25802
|
-
basePrototype = ClassHandle.prototype;
|
|
25803
|
-
}
|
|
25804
|
-
var constructor = createNamedFunction(name, function () {
|
|
25805
|
-
if (Object.getPrototypeOf(this) !== instancePrototype) {
|
|
25806
|
-
throw new BindingError("Use 'new' to construct " + name);
|
|
25807
|
-
}
|
|
25808
|
-
if (undefined === registeredClass.constructor_body) {
|
|
25809
|
-
throw new BindingError(name + " has no accessible constructor");
|
|
25810
|
-
}
|
|
25811
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
25812
|
-
args[_key2] = arguments[_key2];
|
|
25813
|
-
}
|
|
25814
|
-
var body = registeredClass.constructor_body[args.length];
|
|
25815
|
-
if (undefined === body) {
|
|
25816
|
-
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!");
|
|
25817
|
-
}
|
|
25818
|
-
return body.apply(this, args);
|
|
25819
|
-
});
|
|
25820
|
-
var instancePrototype = Object.create(basePrototype, {
|
|
25821
|
-
constructor: {
|
|
25822
|
-
value: constructor
|
|
25823
|
-
}
|
|
25824
|
-
});
|
|
25825
|
-
constructor.prototype = instancePrototype;
|
|
25826
|
-
var registeredClass = new RegisteredClass(name, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast);
|
|
25827
|
-
if (registeredClass.baseClass) {
|
|
25828
|
-
var _registeredClass$base, _registeredClass$base2;
|
|
25829
|
-
// Keep track of class hierarchy. Used to allow sub-classes to inherit class functions.
|
|
25830
|
-
(_registeredClass$base2 = (_registeredClass$base = registeredClass.baseClass).__derivedClasses) != null ? _registeredClass$base2 : _registeredClass$base.__derivedClasses = [];
|
|
25831
|
-
registeredClass.baseClass.__derivedClasses.push(registeredClass);
|
|
25832
|
-
}
|
|
25833
|
-
var referenceConverter = new RegisteredPointer(name, registeredClass, true, false, false);
|
|
25834
|
-
var pointerConverter = new RegisteredPointer(name + '*', registeredClass, false, false, false);
|
|
25835
|
-
var constPointerConverter = new RegisteredPointer(name + ' const*', registeredClass, false, true, false);
|
|
25836
|
-
registeredPointers[rawType] = {
|
|
25837
|
-
pointerType: pointerConverter,
|
|
25838
|
-
constPointerType: constPointerConverter
|
|
25839
|
-
};
|
|
25840
|
-
replacePublicSymbol(legalFunctionName, constructor);
|
|
25841
|
-
return [referenceConverter, pointerConverter, constPointerConverter];
|
|
25842
|
-
});
|
|
25843
|
-
};
|
|
25844
|
-
heap32VectorToArray = function heap32VectorToArray(count, firstElement) {
|
|
25845
|
-
var array = [];
|
|
25846
|
-
for (var i = 0; i < count; i++) {
|
|
25847
|
-
// TODO(https://github.com/emscripten-core/emscripten/issues/17310):
|
|
25848
|
-
// Find a way to hoist the `>> 2` or `>> 3` out of this loop.
|
|
25849
|
-
array.push(HEAPU32[firstElement + i * 4 >> 2]);
|
|
25850
|
-
}
|
|
25851
|
-
return array;
|
|
25852
|
-
};
|
|
25853
|
-
runDestructors = function runDestructors(destructors) {
|
|
25854
|
-
while (destructors.length) {
|
|
25855
|
-
var ptr = destructors.pop();
|
|
25856
|
-
var del = destructors.pop();
|
|
25857
|
-
del(ptr);
|
|
25858
|
-
}
|
|
25859
|
-
};
|
|
25860
|
-
__embind_register_class_constructor = function __embind_register_class_constructor(rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) {
|
|
25861
|
-
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
25862
|
-
invoker = embind__requireFunction(invokerSignature, invoker);
|
|
25863
|
-
whenDependentTypesAreResolved([], [rawClassType], function (classType) {
|
|
25864
|
-
classType = classType[0];
|
|
25865
|
-
var humanName = "constructor " + classType.name;
|
|
25866
|
-
if (undefined === classType.registeredClass.constructor_body) {
|
|
25867
|
-
classType.registeredClass.constructor_body = [];
|
|
25868
|
-
}
|
|
25869
|
-
if (undefined !== classType.registeredClass.constructor_body[argCount - 1]) {
|
|
25870
|
-
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!");
|
|
25871
|
-
}
|
|
25872
|
-
classType.registeredClass.constructor_body[argCount - 1] = function () {
|
|
25873
|
-
throwUnboundTypeError("Cannot construct " + classType.name + " due to unbound types", rawArgTypes);
|
|
25874
|
-
};
|
|
25875
|
-
whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) {
|
|
25876
|
-
// Insert empty slot for context type (argTypes[1]).
|
|
25877
|
-
argTypes.splice(1, 0, null);
|
|
25878
|
-
classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction(humanName, argTypes, null, invoker, rawConstructor);
|
|
25879
|
-
return [];
|
|
25880
|
-
});
|
|
25881
|
-
return [];
|
|
25882
|
-
});
|
|
25883
|
-
};
|
|
25884
|
-
getFunctionName = function getFunctionName(signature) {
|
|
25885
|
-
signature = signature.trim();
|
|
25886
|
-
var argsIndex = signature.indexOf('(');
|
|
25887
|
-
if (argsIndex === -1) return signature;
|
|
25888
|
-
return signature.slice(0, argsIndex);
|
|
25889
|
-
};
|
|
25890
|
-
__embind_register_class_function = function __embind_register_class_function(rawClassType, methodName, argCount, rawArgTypesAddr,
|
|
25891
|
-
// [ReturnType, ThisType, Args...]
|
|
25892
|
-
invokerSignature, rawInvoker, context, isPureVirtual, isAsync, isNonnullReturn) {
|
|
25893
|
-
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
25894
|
-
methodName = AsciiToString(methodName);
|
|
25895
|
-
methodName = getFunctionName(methodName);
|
|
25896
|
-
rawInvoker = embind__requireFunction(invokerSignature, rawInvoker, isAsync);
|
|
25897
|
-
whenDependentTypesAreResolved([], [rawClassType], function (classType) {
|
|
25898
|
-
classType = classType[0];
|
|
25899
|
-
var humanName = classType.name + "." + methodName;
|
|
25900
|
-
if (methodName.startsWith('@@')) {
|
|
25901
|
-
methodName = Symbol[methodName.substring(2)];
|
|
25902
|
-
}
|
|
25903
|
-
if (isPureVirtual) {
|
|
25904
|
-
classType.registeredClass.pureVirtualFunctions.push(methodName);
|
|
25905
|
-
}
|
|
25906
|
-
function unboundTypesHandler() {
|
|
25907
|
-
throwUnboundTypeError("Cannot call " + humanName + " due to unbound types", rawArgTypes);
|
|
25908
|
-
}
|
|
25909
|
-
var proto = classType.registeredClass.instancePrototype;
|
|
25910
|
-
var method = proto[methodName];
|
|
25911
|
-
if (undefined === method || undefined === method.overloadTable && method.className !== classType.name && method.argCount === argCount - 2) {
|
|
25912
|
-
// This is the first overload to be registered, OR we are replacing a
|
|
25913
|
-
// function in the base class with a function in the derived class.
|
|
25914
|
-
unboundTypesHandler.argCount = argCount - 2;
|
|
25915
|
-
unboundTypesHandler.className = classType.name;
|
|
25916
|
-
proto[methodName] = unboundTypesHandler;
|
|
25917
|
-
} else {
|
|
25918
|
-
// There was an existing function with the same name registered. Set up
|
|
25919
|
-
// a function overload routing table.
|
|
25920
|
-
ensureOverloadTable(proto, methodName, humanName);
|
|
25921
|
-
proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler;
|
|
25922
|
-
}
|
|
25923
|
-
whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) {
|
|
25924
|
-
var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context, isAsync);
|
|
25925
|
-
|
|
25926
|
-
// Replace the initial unbound-handler-stub function with the
|
|
25927
|
-
// appropriate member function, now that all types are resolved. If
|
|
25928
|
-
// multiple overloads are registered for this function, the function
|
|
25929
|
-
// goes into an overload table.
|
|
25930
|
-
if (undefined === proto[methodName].overloadTable) {
|
|
25931
|
-
// Set argCount in case an overload is registered later
|
|
25932
|
-
memberFunction.argCount = argCount - 2;
|
|
25933
|
-
proto[methodName] = memberFunction;
|
|
25934
|
-
} else {
|
|
25935
|
-
proto[methodName].overloadTable[argCount - 2] = memberFunction;
|
|
25936
|
-
}
|
|
25937
|
-
return [];
|
|
25938
|
-
});
|
|
25939
|
-
return [];
|
|
25940
|
-
});
|
|
25941
|
-
};
|
|
25942
|
-
emval_freelist = [];
|
|
25943
|
-
emval_handles = [0, 1,, 1, null, 1, true, 1, false, 1];
|
|
25944
|
-
__emval_decref = function __emval_decref(handle) {
|
|
25945
|
-
if (handle > 9 && 0 === --emval_handles[handle + 1]) {
|
|
25946
|
-
emval_handles[handle] = undefined;
|
|
25947
|
-
emval_freelist.push(handle);
|
|
25948
|
-
}
|
|
25949
|
-
};
|
|
25950
|
-
Emval = {
|
|
25951
|
-
toValue: function toValue(handle) {
|
|
25952
|
-
if (!handle) {
|
|
25953
|
-
throwBindingError("Cannot use deleted val. handle = " + handle);
|
|
25954
|
-
}
|
|
25955
|
-
return emval_handles[handle];
|
|
25956
|
-
},
|
|
25957
|
-
toHandle: function toHandle(value) {
|
|
25958
|
-
switch (value) {
|
|
25959
|
-
case undefined:
|
|
25960
|
-
return 2;
|
|
25961
|
-
case null:
|
|
25962
|
-
return 4;
|
|
25963
|
-
case true:
|
|
25964
|
-
return 6;
|
|
25965
|
-
case false:
|
|
25966
|
-
return 8;
|
|
25967
|
-
default:
|
|
25968
|
-
{
|
|
25969
|
-
var handle = emval_freelist.pop() || emval_handles.length;
|
|
25970
|
-
emval_handles[handle] = value;
|
|
25971
|
-
emval_handles[handle + 1] = 1;
|
|
25972
|
-
return handle;
|
|
25973
|
-
}
|
|
25974
|
-
}
|
|
25975
|
-
}
|
|
25976
|
-
};
|
|
25977
|
-
EmValType = {
|
|
25978
|
-
name: 'emscripten::val',
|
|
25979
|
-
fromWireType: function fromWireType(handle) {
|
|
25980
|
-
var rv = Emval.toValue(handle);
|
|
25981
|
-
__emval_decref(handle);
|
|
25982
|
-
return rv;
|
|
25983
|
-
},
|
|
25984
|
-
toWireType: function toWireType(destructors, value) {
|
|
25985
|
-
return Emval.toHandle(value);
|
|
25986
|
-
},
|
|
25987
|
-
readValueFromPointer: readPointer,
|
|
25988
|
-
destructorFunction: null // This type does not need a destructor
|
|
25989
|
-
|
|
25990
|
-
// TODO: do we need a deleteObject here? write a test where
|
|
25991
|
-
// emval is passed into JS via an interface
|
|
25992
|
-
};
|
|
25993
|
-
__embind_register_emval = function __embind_register_emval(rawType) {
|
|
25994
|
-
return registerType(rawType, EmValType);
|
|
25995
|
-
};
|
|
25996
|
-
floatReadValueFromPointer = function floatReadValueFromPointer(name, width) {
|
|
25997
|
-
switch (width) {
|
|
25998
|
-
case 4:
|
|
25999
|
-
return function (pointer) {
|
|
26000
|
-
return this.fromWireType(HEAPF32[pointer >> 2]);
|
|
26001
|
-
};
|
|
26002
|
-
case 8:
|
|
26003
|
-
return function (pointer) {
|
|
26004
|
-
return this.fromWireType(HEAPF64[pointer >> 3]);
|
|
26005
|
-
};
|
|
26006
|
-
default:
|
|
26007
|
-
throw new TypeError("invalid float width (" + width + "): " + name);
|
|
26008
|
-
}
|
|
26009
|
-
};
|
|
26010
|
-
__embind_register_float = function __embind_register_float(rawType, name, size) {
|
|
26011
|
-
name = AsciiToString(name);
|
|
26012
|
-
registerType(rawType, {
|
|
26013
|
-
name: name,
|
|
26014
|
-
fromWireType: function fromWireType(value) {
|
|
26015
|
-
return value;
|
|
26016
|
-
},
|
|
26017
|
-
toWireType: function toWireType(destructors, value) {
|
|
26018
|
-
// The VM will perform JS to Wasm value conversion, according to the spec:
|
|
26019
|
-
// https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue
|
|
26020
|
-
return value;
|
|
26021
|
-
},
|
|
26022
|
-
readValueFromPointer: floatReadValueFromPointer(name, size),
|
|
26023
|
-
destructorFunction: null // This type does not need a destructor
|
|
26024
|
-
});
|
|
26025
|
-
};
|
|
26026
|
-
/** @suppress {globalThis} */
|
|
26027
|
-
__embind_register_integer = function __embind_register_integer(primitiveType, name, size, minRange, maxRange) {
|
|
26028
|
-
name = AsciiToString(name);
|
|
26029
|
-
var isUnsignedType = minRange === 0;
|
|
26030
|
-
var fromWireType = function fromWireType(value) {
|
|
26031
|
-
return value;
|
|
26032
|
-
};
|
|
26033
|
-
if (isUnsignedType) {
|
|
26034
|
-
var bitshift = 32 - 8 * size;
|
|
26035
|
-
fromWireType = function fromWireType(value) {
|
|
26036
|
-
return value << bitshift >>> bitshift;
|
|
26037
|
-
};
|
|
26038
|
-
maxRange = fromWireType(maxRange);
|
|
26039
|
-
}
|
|
26040
|
-
registerType(primitiveType, {
|
|
26041
|
-
name: name,
|
|
26042
|
-
fromWireType: fromWireType,
|
|
26043
|
-
toWireType: function toWireType(destructors, value) {
|
|
26044
|
-
// The VM will perform JS to Wasm value conversion, according to the spec:
|
|
26045
|
-
// https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue
|
|
26046
|
-
return value;
|
|
26047
|
-
},
|
|
26048
|
-
readValueFromPointer: integerReadValueFromPointer(name, size, minRange !== 0),
|
|
26049
|
-
destructorFunction: null // This type does not need a destructor
|
|
26050
|
-
});
|
|
26051
|
-
};
|
|
26052
|
-
__embind_register_memory_view = function __embind_register_memory_view(rawType, dataTypeIndex, name) {
|
|
26053
|
-
var typeMapping = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array];
|
|
26054
|
-
var TA = typeMapping[dataTypeIndex];
|
|
26055
|
-
function decodeMemoryView(handle) {
|
|
26056
|
-
var size = HEAPU32[handle >> 2];
|
|
26057
|
-
var data = HEAPU32[handle + 4 >> 2];
|
|
26058
|
-
return new TA(HEAP8.buffer, data, size);
|
|
26059
|
-
}
|
|
26060
|
-
name = AsciiToString(name);
|
|
26061
|
-
registerType(rawType, {
|
|
26062
|
-
name: name,
|
|
26063
|
-
fromWireType: decodeMemoryView,
|
|
26064
|
-
readValueFromPointer: decodeMemoryView
|
|
26065
|
-
}, {
|
|
26066
|
-
ignoreDuplicateRegistrations: true
|
|
26067
|
-
});
|
|
26068
|
-
};
|
|
26069
|
-
__embind_register_smart_ptr = function __embind_register_smart_ptr(rawType, rawPointeeType, name, sharingPolicy, getPointeeSignature, rawGetPointee, constructorSignature, rawConstructor, shareSignature, rawShare, destructorSignature, rawDestructor) {
|
|
26070
|
-
name = AsciiToString(name);
|
|
26071
|
-
rawGetPointee = embind__requireFunction(getPointeeSignature, rawGetPointee);
|
|
26072
|
-
rawConstructor = embind__requireFunction(constructorSignature, rawConstructor);
|
|
26073
|
-
rawShare = embind__requireFunction(shareSignature, rawShare);
|
|
26074
|
-
rawDestructor = embind__requireFunction(destructorSignature, rawDestructor);
|
|
26075
|
-
whenDependentTypesAreResolved([rawType], [rawPointeeType], function (pointeeType) {
|
|
26076
|
-
pointeeType = pointeeType[0];
|
|
26077
|
-
var registeredPointer = new RegisteredPointer(name, pointeeType.registeredClass, false, false,
|
|
26078
|
-
// smart pointer properties
|
|
26079
|
-
true, pointeeType, sharingPolicy, rawGetPointee, rawConstructor, rawShare, rawDestructor);
|
|
26080
|
-
return [registeredPointer];
|
|
26081
|
-
});
|
|
26082
|
-
};
|
|
26083
|
-
stringToUTF8Array = function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
|
|
26084
|
-
// Parameter maxBytesToWrite is not optional. Negative values, 0, null,
|
|
26085
|
-
// undefined and false each don't write out any bytes.
|
|
26086
|
-
if (!(maxBytesToWrite > 0)) return 0;
|
|
26087
|
-
var startIdx = outIdx;
|
|
26088
|
-
var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
|
|
26089
|
-
for (var i = 0; i < str.length; ++i) {
|
|
26090
|
-
// For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description
|
|
26091
|
-
// and https://www.ietf.org/rfc/rfc2279.txt
|
|
26092
|
-
// and https://tools.ietf.org/html/rfc3629
|
|
26093
|
-
var u = str.codePointAt(i);
|
|
26094
|
-
if (u <= 0x7f) {
|
|
26095
|
-
if (outIdx >= endIdx) break;
|
|
26096
|
-
heap[outIdx++] = u;
|
|
26097
|
-
} else if (u <= 0x7ff) {
|
|
26098
|
-
if (outIdx + 1 >= endIdx) break;
|
|
26099
|
-
heap[outIdx++] = 0xc0 | u >> 6;
|
|
26100
|
-
heap[outIdx++] = 0x80 | u & 63;
|
|
26101
|
-
} else if (u <= 0xffff) {
|
|
26102
|
-
if (outIdx + 2 >= endIdx) break;
|
|
26103
|
-
heap[outIdx++] = 0xe0 | u >> 12;
|
|
26104
|
-
heap[outIdx++] = 0x80 | u >> 6 & 63;
|
|
26105
|
-
heap[outIdx++] = 0x80 | u & 63;
|
|
26106
|
-
} else {
|
|
26107
|
-
if (outIdx + 3 >= endIdx) break;
|
|
26108
|
-
heap[outIdx++] = 0xf0 | u >> 18;
|
|
26109
|
-
heap[outIdx++] = 0x80 | u >> 12 & 63;
|
|
26110
|
-
heap[outIdx++] = 0x80 | u >> 6 & 63;
|
|
26111
|
-
heap[outIdx++] = 0x80 | u & 63;
|
|
26112
|
-
// Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16.
|
|
26113
|
-
// We need to manually skip over the second code unit for correct iteration.
|
|
26114
|
-
i++;
|
|
26115
|
-
}
|
|
26116
|
-
}
|
|
26117
|
-
// Null-terminate the pointer to the buffer.
|
|
26118
|
-
heap[outIdx] = 0;
|
|
26119
|
-
return outIdx - startIdx;
|
|
26120
|
-
};
|
|
26121
|
-
stringToUTF8 = function stringToUTF8(str, outPtr, maxBytesToWrite) {
|
|
26122
|
-
return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
|
|
26123
|
-
};
|
|
26124
|
-
lengthBytesUTF8 = function lengthBytesUTF8(str) {
|
|
26125
|
-
var len = 0;
|
|
26126
|
-
for (var i = 0; i < str.length; ++i) {
|
|
26127
|
-
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
|
|
26128
|
-
// unit, not a Unicode code point of the character! So decode
|
|
26129
|
-
// UTF16->UTF32->UTF8.
|
|
26130
|
-
// See http://unicode.org/faq/utf_bom.html#utf16-3
|
|
26131
|
-
var c = str.charCodeAt(i); // possibly a lead surrogate
|
|
26132
|
-
if (c <= 0x7f) {
|
|
26133
|
-
len++;
|
|
26134
|
-
} else if (c <= 0x7ff) {
|
|
26135
|
-
len += 2;
|
|
26136
|
-
} else if (c >= 0xd800 && c <= 0xdfff) {
|
|
26137
|
-
len += 4;
|
|
26138
|
-
++i;
|
|
26139
|
-
} else {
|
|
26140
|
-
len += 3;
|
|
26141
|
-
}
|
|
26142
|
-
}
|
|
26143
|
-
return len;
|
|
26144
|
-
};
|
|
26145
|
-
UTF8Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder() : undefined;
|
|
26146
|
-
findStringEnd = function findStringEnd(heapOrArray, idx, maxBytesToRead, ignoreNul) {
|
|
26147
|
-
var maxIdx = idx + maxBytesToRead;
|
|
26148
|
-
if (ignoreNul) return maxIdx;
|
|
26149
|
-
// TextDecoder needs to know the byte length in advance, it doesn't stop on
|
|
26150
|
-
// null terminator by itself.
|
|
26151
|
-
// As a tiny code save trick, compare idx against maxIdx using a negation,
|
|
26152
|
-
// so that maxBytesToRead=undefined/NaN means Infinity.
|
|
26153
|
-
while (heapOrArray[idx] && !(idx >= maxIdx)) ++idx;
|
|
26154
|
-
return idx;
|
|
26155
|
-
};
|
|
26156
|
-
/**
|
|
26157
|
-
* Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given
|
|
26158
|
-
* array that contains uint8 values, returns a copy of that string as a
|
|
26159
|
-
* Javascript String object.
|
|
26160
|
-
* heapOrArray is either a regular array, or a JavaScript typed array view.
|
|
26161
|
-
* @param {number=} idx
|
|
26162
|
-
* @param {number=} maxBytesToRead
|
|
26163
|
-
* @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
|
|
26164
|
-
* @return {string}
|
|
26165
|
-
*/
|
|
26166
|
-
UTF8ArrayToString = function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead, ignoreNul) {
|
|
26167
|
-
if (idx === void 0) {
|
|
26168
|
-
idx = 0;
|
|
26169
|
-
}
|
|
26170
|
-
var endPtr = findStringEnd(heapOrArray, idx, maxBytesToRead, ignoreNul);
|
|
26171
|
-
|
|
26172
|
-
// When using conditional TextDecoder, skip it for short strings as the overhead of the native call is not worth it.
|
|
26173
|
-
if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
|
|
26174
|
-
return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
|
|
26175
|
-
}
|
|
26176
|
-
var str = '';
|
|
26177
|
-
while (idx < endPtr) {
|
|
26178
|
-
// For UTF8 byte structure, see:
|
|
26179
|
-
// http://en.wikipedia.org/wiki/UTF-8#Description
|
|
26180
|
-
// https://www.ietf.org/rfc/rfc2279.txt
|
|
26181
|
-
// https://tools.ietf.org/html/rfc3629
|
|
26182
|
-
var u0 = heapOrArray[idx++];
|
|
26183
|
-
if (!(u0 & 0x80)) {
|
|
26184
|
-
str += String.fromCharCode(u0);
|
|
26185
|
-
continue;
|
|
26186
|
-
}
|
|
26187
|
-
var u1 = heapOrArray[idx++] & 63;
|
|
26188
|
-
if ((u0 & 0xe0) == 0xc0) {
|
|
26189
|
-
str += String.fromCharCode((u0 & 31) << 6 | u1);
|
|
26190
|
-
continue;
|
|
26191
|
-
}
|
|
26192
|
-
var u2 = heapOrArray[idx++] & 63;
|
|
26193
|
-
if ((u0 & 0xf0) == 0xe0) {
|
|
26194
|
-
u0 = (u0 & 15) << 12 | u1 << 6 | u2;
|
|
26195
|
-
} else {
|
|
26196
|
-
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
|
|
26197
|
-
}
|
|
26198
|
-
if (u0 < 0x10000) {
|
|
26199
|
-
str += String.fromCharCode(u0);
|
|
26200
|
-
} else {
|
|
26201
|
-
var ch = u0 - 0x10000;
|
|
26202
|
-
str += String.fromCharCode(0xd800 | ch >> 10, 0xdc00 | ch & 0x3ff);
|
|
26203
|
-
}
|
|
26204
|
-
}
|
|
26205
|
-
return str;
|
|
26206
|
-
};
|
|
26207
|
-
/**
|
|
26208
|
-
* Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
|
|
26209
|
-
* emscripten HEAP, returns a copy of that string as a Javascript String object.
|
|
26210
|
-
*
|
|
26211
|
-
* @param {number} ptr
|
|
26212
|
-
* @param {number=} maxBytesToRead - An optional length that specifies the
|
|
26213
|
-
* maximum number of bytes to read. You can omit this parameter to scan the
|
|
26214
|
-
* string until the first 0 byte. If maxBytesToRead is passed, and the string
|
|
26215
|
-
* at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
|
|
26216
|
-
* string will cut short at that byte index.
|
|
26217
|
-
* @param {boolean=} ignoreNul - If true, the function will not stop on a NUL character.
|
|
26218
|
-
* @return {string}
|
|
26219
|
-
*/
|
|
26220
|
-
UTF8ToString = function UTF8ToString(ptr, maxBytesToRead, ignoreNul) {
|
|
26221
|
-
return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead, ignoreNul) : '';
|
|
26222
|
-
};
|
|
26223
|
-
__embind_register_std_string = function __embind_register_std_string(rawType, name) {
|
|
26224
|
-
name = AsciiToString(name);
|
|
26225
|
-
registerType(rawType, {
|
|
26226
|
-
name: name,
|
|
26227
|
-
// For some method names we use string keys here since they are part of
|
|
26228
|
-
// the public/external API and/or used by the runtime-generated code.
|
|
26229
|
-
fromWireType: function fromWireType(value) {
|
|
26230
|
-
var length = HEAPU32[value >> 2];
|
|
26231
|
-
var payload = value + 4;
|
|
26232
|
-
var str;
|
|
26233
|
-
{
|
|
26234
|
-
str = UTF8ToString(payload, length, true);
|
|
26235
|
-
}
|
|
26236
|
-
_free(value);
|
|
26237
|
-
return str;
|
|
26238
|
-
},
|
|
26239
|
-
toWireType: function toWireType(destructors, value) {
|
|
26240
|
-
if (value instanceof ArrayBuffer) {
|
|
26241
|
-
value = new Uint8Array(value);
|
|
26242
|
-
}
|
|
26243
|
-
var length;
|
|
26244
|
-
var valueIsOfTypeString = typeof value == 'string';
|
|
26245
|
-
|
|
26246
|
-
// We accept `string` or array views with single byte elements
|
|
26247
|
-
if (!(valueIsOfTypeString || ArrayBuffer.isView(value) && value.BYTES_PER_ELEMENT == 1)) {
|
|
26248
|
-
throwBindingError('Cannot pass non-string to std::string');
|
|
26249
|
-
}
|
|
26250
|
-
if (valueIsOfTypeString) {
|
|
26251
|
-
length = lengthBytesUTF8(value);
|
|
26252
|
-
} else {
|
|
26253
|
-
length = value.length;
|
|
26254
|
-
}
|
|
26255
|
-
|
|
26256
|
-
// assumes POINTER_SIZE alignment
|
|
26257
|
-
var base = _malloc(4 + length + 1);
|
|
26258
|
-
var ptr = base + 4;
|
|
26259
|
-
HEAPU32[base >> 2] = length;
|
|
26260
|
-
if (valueIsOfTypeString) {
|
|
26261
|
-
{
|
|
26262
|
-
stringToUTF8(value, ptr, length + 1);
|
|
26263
|
-
}
|
|
26264
|
-
} else {
|
|
26265
|
-
HEAPU8.set(value, ptr);
|
|
26266
|
-
}
|
|
26267
|
-
if (destructors !== null) {
|
|
26268
|
-
destructors.push(_free, base);
|
|
26269
|
-
}
|
|
26270
|
-
return base;
|
|
26271
|
-
},
|
|
26272
|
-
readValueFromPointer: readPointer,
|
|
26273
|
-
destructorFunction: function destructorFunction(ptr) {
|
|
26274
|
-
_free(ptr);
|
|
26275
|
-
}
|
|
26276
|
-
});
|
|
26277
|
-
};
|
|
26278
|
-
UTF16Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf-16le') : undefined;
|
|
26279
|
-
UTF16ToString = function UTF16ToString(ptr, maxBytesToRead, ignoreNul) {
|
|
26280
|
-
var idx = ptr >> 1;
|
|
26281
|
-
var endIdx = findStringEnd(HEAPU16, idx, maxBytesToRead / 2, ignoreNul);
|
|
26282
|
-
|
|
26283
|
-
// When using conditional TextDecoder, skip it for short strings as the overhead of the native call is not worth it.
|
|
26284
|
-
if (endIdx - idx > 16 && UTF16Decoder) return UTF16Decoder.decode(HEAPU16.subarray(idx, endIdx));
|
|
26285
|
-
|
|
26286
|
-
// Fallback: decode without UTF16Decoder
|
|
26287
|
-
var str = '';
|
|
26288
|
-
|
|
26289
|
-
// If maxBytesToRead is not passed explicitly, it will be undefined, and the
|
|
26290
|
-
// for-loop's condition will always evaluate to true. The loop is then
|
|
26291
|
-
// terminated on the first null char.
|
|
26292
|
-
for (var i = idx; i < endIdx; ++i) {
|
|
26293
|
-
var codeUnit = HEAPU16[i];
|
|
26294
|
-
// fromCharCode constructs a character from a UTF-16 code unit, so we can
|
|
26295
|
-
// pass the UTF16 string right through.
|
|
26296
|
-
str += String.fromCharCode(codeUnit);
|
|
26297
|
-
}
|
|
26298
|
-
return str;
|
|
26299
|
-
};
|
|
26300
|
-
stringToUTF16 = function stringToUTF16(str, outPtr, maxBytesToWrite) {
|
|
26301
|
-
var _maxBytesToWrite;
|
|
26302
|
-
// Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
|
|
26303
|
-
(_maxBytesToWrite = maxBytesToWrite) != null ? _maxBytesToWrite : maxBytesToWrite = 0x7fffffff;
|
|
26304
|
-
if (maxBytesToWrite < 2) return 0;
|
|
26305
|
-
maxBytesToWrite -= 2; // Null terminator.
|
|
26306
|
-
var startPtr = outPtr;
|
|
26307
|
-
var numCharsToWrite = maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length;
|
|
26308
|
-
for (var i = 0; i < numCharsToWrite; ++i) {
|
|
26309
|
-
// charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP.
|
|
26310
|
-
var codeUnit = str.charCodeAt(i); // possibly a lead surrogate
|
|
26311
|
-
HEAP16[outPtr >> 1] = codeUnit;
|
|
26312
|
-
outPtr += 2;
|
|
26313
|
-
}
|
|
26314
|
-
// Null-terminate the pointer to the HEAP.
|
|
26315
|
-
HEAP16[outPtr >> 1] = 0;
|
|
26316
|
-
return outPtr - startPtr;
|
|
26317
|
-
};
|
|
26318
|
-
lengthBytesUTF16 = function lengthBytesUTF16(str) {
|
|
26319
|
-
return str.length * 2;
|
|
26320
|
-
};
|
|
26321
|
-
UTF32ToString = function UTF32ToString(ptr, maxBytesToRead, ignoreNul) {
|
|
26322
|
-
var str = '';
|
|
26323
|
-
var startIdx = ptr >> 2;
|
|
26324
|
-
// If maxBytesToRead is not passed explicitly, it will be undefined, and this
|
|
26325
|
-
// will always evaluate to true. This saves on code size.
|
|
26326
|
-
for (var i = 0; !(i >= maxBytesToRead / 4); i++) {
|
|
26327
|
-
var utf32 = HEAPU32[startIdx + i];
|
|
26328
|
-
if (!utf32 && !ignoreNul) break;
|
|
26329
|
-
str += String.fromCodePoint(utf32);
|
|
26330
|
-
}
|
|
26331
|
-
return str;
|
|
26332
|
-
};
|
|
26333
|
-
stringToUTF32 = function stringToUTF32(str, outPtr, maxBytesToWrite) {
|
|
26334
|
-
var _maxBytesToWrite2;
|
|
26335
|
-
// Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
|
|
26336
|
-
(_maxBytesToWrite2 = maxBytesToWrite) != null ? _maxBytesToWrite2 : maxBytesToWrite = 0x7fffffff;
|
|
26337
|
-
if (maxBytesToWrite < 4) return 0;
|
|
26338
|
-
var startPtr = outPtr;
|
|
26339
|
-
var endPtr = startPtr + maxBytesToWrite - 4;
|
|
26340
|
-
for (var i = 0; i < str.length; ++i) {
|
|
26341
|
-
var codePoint = str.codePointAt(i);
|
|
26342
|
-
// Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16.
|
|
26343
|
-
// We need to manually skip over the second code unit for correct iteration.
|
|
26344
|
-
if (codePoint > 0xffff) {
|
|
26345
|
-
i++;
|
|
26346
|
-
}
|
|
26347
|
-
HEAP32[outPtr >> 2] = codePoint;
|
|
26348
|
-
outPtr += 4;
|
|
26349
|
-
if (outPtr + 4 > endPtr) break;
|
|
26350
|
-
}
|
|
26351
|
-
// Null-terminate the pointer to the HEAP.
|
|
26352
|
-
HEAP32[outPtr >> 2] = 0;
|
|
26353
|
-
return outPtr - startPtr;
|
|
26354
|
-
};
|
|
26355
|
-
lengthBytesUTF32 = function lengthBytesUTF32(str) {
|
|
26356
|
-
var len = 0;
|
|
26357
|
-
for (var i = 0; i < str.length; ++i) {
|
|
26358
|
-
var codePoint = str.codePointAt(i);
|
|
26359
|
-
// Gotcha: if codePoint is over 0xFFFF, it is represented as a surrogate pair in UTF-16.
|
|
26360
|
-
// We need to manually skip over the second code unit for correct iteration.
|
|
26361
|
-
if (codePoint > 0xffff) {
|
|
26362
|
-
i++;
|
|
26363
|
-
}
|
|
26364
|
-
len += 4;
|
|
26365
|
-
}
|
|
26366
|
-
return len;
|
|
26367
|
-
};
|
|
26368
|
-
__embind_register_std_wstring = function __embind_register_std_wstring(rawType, charSize, name) {
|
|
26369
|
-
name = AsciiToString(name);
|
|
26370
|
-
var decodeString, encodeString, lengthBytesUTF;
|
|
26371
|
-
if (charSize === 2) {
|
|
26372
|
-
decodeString = UTF16ToString;
|
|
26373
|
-
encodeString = stringToUTF16;
|
|
26374
|
-
lengthBytesUTF = lengthBytesUTF16;
|
|
26375
|
-
} else {
|
|
26376
|
-
decodeString = UTF32ToString;
|
|
26377
|
-
encodeString = stringToUTF32;
|
|
26378
|
-
lengthBytesUTF = lengthBytesUTF32;
|
|
26379
|
-
}
|
|
26380
|
-
registerType(rawType, {
|
|
26381
|
-
name: name,
|
|
26382
|
-
fromWireType: function fromWireType(value) {
|
|
26383
|
-
// Code mostly taken from _embind_register_std_string fromWireType
|
|
26384
|
-
var length = HEAPU32[value >> 2];
|
|
26385
|
-
var str = decodeString(value + 4, length * charSize, true);
|
|
26386
|
-
_free(value);
|
|
26387
|
-
return str;
|
|
26388
|
-
},
|
|
26389
|
-
toWireType: function toWireType(destructors, value) {
|
|
26390
|
-
if (!(typeof value == 'string')) {
|
|
26391
|
-
throwBindingError("Cannot pass non-string to C++ string type " + name);
|
|
26392
|
-
}
|
|
26393
|
-
|
|
26394
|
-
// assumes POINTER_SIZE alignment
|
|
26395
|
-
var length = lengthBytesUTF(value);
|
|
26396
|
-
var ptr = _malloc(4 + length + charSize);
|
|
26397
|
-
HEAPU32[ptr >> 2] = length / charSize;
|
|
26398
|
-
encodeString(value, ptr + 4, length + charSize);
|
|
26399
|
-
if (destructors !== null) {
|
|
26400
|
-
destructors.push(_free, ptr);
|
|
26401
|
-
}
|
|
26402
|
-
return ptr;
|
|
26403
|
-
},
|
|
26404
|
-
readValueFromPointer: readPointer,
|
|
26405
|
-
destructorFunction: function destructorFunction(ptr) {
|
|
26406
|
-
_free(ptr);
|
|
26407
|
-
}
|
|
26408
|
-
});
|
|
26409
|
-
};
|
|
26410
|
-
__embind_register_void = function __embind_register_void(rawType, name) {
|
|
26411
|
-
name = AsciiToString(name);
|
|
26412
|
-
registerType(rawType, {
|
|
26413
|
-
isVoid: true,
|
|
26414
|
-
// void return values can be optimized out sometimes
|
|
26415
|
-
name: name,
|
|
26416
|
-
fromWireType: function fromWireType() {
|
|
26417
|
-
return undefined;
|
|
26418
|
-
},
|
|
26419
|
-
// TODO: assert if anything else is given?
|
|
26420
|
-
toWireType: function toWireType(destructors, o) {
|
|
26421
|
-
return undefined;
|
|
26422
|
-
}
|
|
26423
|
-
});
|
|
26424
|
-
};
|
|
26425
|
-
emval_methodCallers = [];
|
|
26426
|
-
emval_addMethodCaller = function emval_addMethodCaller(caller) {
|
|
26427
|
-
var id = emval_methodCallers.length;
|
|
26428
|
-
emval_methodCallers.push(caller);
|
|
26429
|
-
return id;
|
|
26430
|
-
};
|
|
26431
|
-
requireRegisteredType = function requireRegisteredType(rawType, humanName) {
|
|
26432
|
-
var impl = registeredTypes[rawType];
|
|
26433
|
-
if (undefined === impl) {
|
|
26434
|
-
throwBindingError(humanName + " has unknown type " + getTypeName(rawType));
|
|
26435
|
-
}
|
|
26436
|
-
return impl;
|
|
26437
|
-
};
|
|
26438
|
-
emval_lookupTypes = function emval_lookupTypes(argCount, argTypes) {
|
|
26439
|
-
var a = new Array(argCount);
|
|
26440
|
-
for (var i = 0; i < argCount; ++i) {
|
|
26441
|
-
a[i] = requireRegisteredType(HEAPU32[argTypes + i * 4 >> 2], "parameter " + i);
|
|
26442
|
-
}
|
|
26443
|
-
return a;
|
|
26444
|
-
};
|
|
26445
|
-
emval_returnValue = function emval_returnValue(toReturnWire, destructorsRef, handle) {
|
|
26446
|
-
var destructors = [];
|
|
26447
|
-
var result = toReturnWire(destructors, handle);
|
|
26448
|
-
if (destructors.length) {
|
|
26449
|
-
// void, primitives and any other types w/o destructors don't need to allocate a handle
|
|
26450
|
-
HEAPU32[destructorsRef >> 2] = Emval.toHandle(destructors);
|
|
26451
|
-
}
|
|
26452
|
-
return result;
|
|
26453
|
-
};
|
|
26454
|
-
emval_symbols = {};
|
|
26455
|
-
getStringOrSymbol = function getStringOrSymbol(address) {
|
|
26456
|
-
var symbol = emval_symbols[address];
|
|
26457
|
-
if (symbol === undefined) {
|
|
26458
|
-
return AsciiToString(address);
|
|
26459
|
-
}
|
|
26460
|
-
return symbol;
|
|
26461
|
-
};
|
|
26462
|
-
__emval_create_invoker = function __emval_create_invoker(argCount, argTypesPtr, kind) {
|
|
26463
|
-
var GenericWireTypeSize = 8;
|
|
26464
|
-
var _emval_lookupTypes = emval_lookupTypes(argCount, argTypesPtr),
|
|
26465
|
-
retType = _emval_lookupTypes[0],
|
|
26466
|
-
argTypes = _emval_lookupTypes.slice(1);
|
|
26467
|
-
var toReturnWire = retType.toWireType.bind(retType);
|
|
26468
|
-
var argFromPtr = argTypes.map(function (type) {
|
|
26469
|
-
return type.readValueFromPointer.bind(type);
|
|
26470
|
-
});
|
|
26471
|
-
argCount--; // remove the extracted return type
|
|
26472
|
-
|
|
26473
|
-
var captures = {
|
|
26474
|
-
toValue: Emval.toValue
|
|
26475
|
-
};
|
|
26476
|
-
var args = argFromPtr.map(function (argFromPtr, i) {
|
|
26477
|
-
var captureName = "argFromPtr" + i;
|
|
26478
|
-
captures[captureName] = argFromPtr;
|
|
26479
|
-
return captureName + "(args" + (i ? '+' + i * GenericWireTypeSize : '') + ")";
|
|
26480
|
-
});
|
|
26481
|
-
var functionBody;
|
|
26482
|
-
switch (kind) {
|
|
26483
|
-
case 0:
|
|
26484
|
-
functionBody = 'toValue(handle)';
|
|
26485
|
-
break;
|
|
26486
|
-
case 2:
|
|
26487
|
-
functionBody = 'new (toValue(handle))';
|
|
26488
|
-
break;
|
|
26489
|
-
case 3:
|
|
26490
|
-
functionBody = '';
|
|
26491
|
-
break;
|
|
26492
|
-
case 1:
|
|
26493
|
-
captures['getStringOrSymbol'] = getStringOrSymbol;
|
|
26494
|
-
functionBody = 'toValue(handle)[getStringOrSymbol(methodName)]';
|
|
26495
|
-
break;
|
|
26496
|
-
}
|
|
26497
|
-
functionBody += "(" + args + ")";
|
|
26498
|
-
if (!retType.isVoid) {
|
|
26499
|
-
captures['toReturnWire'] = toReturnWire;
|
|
26500
|
-
captures['emval_returnValue'] = emval_returnValue;
|
|
26501
|
-
functionBody = "return emval_returnValue(toReturnWire, destructorsRef, " + functionBody + ")";
|
|
26502
|
-
}
|
|
26503
|
-
functionBody = "return function (handle, methodName, destructorsRef, args) {\n " + functionBody + "\n }";
|
|
26504
|
-
var invokerFunction = new Function(Object.keys(captures), functionBody).apply(void 0, Object.values(captures));
|
|
26505
|
-
var functionName = "methodCaller<(" + argTypes.map(function (t) {
|
|
26506
|
-
return t.name;
|
|
26507
|
-
}) + ") => " + retType.name + ">";
|
|
26508
|
-
return emval_addMethodCaller(createNamedFunction(functionName, invokerFunction));
|
|
26509
|
-
};
|
|
26510
|
-
__emval_incref = function __emval_incref(handle) {
|
|
26511
|
-
if (handle > 9) {
|
|
26512
|
-
emval_handles[handle + 1] += 1;
|
|
26513
|
-
}
|
|
26514
|
-
};
|
|
26515
|
-
__emval_invoke = function __emval_invoke(caller, handle, methodName, destructorsRef, args) {
|
|
26516
|
-
return emval_methodCallers[caller](handle, methodName, destructorsRef, args);
|
|
26517
|
-
};
|
|
26518
|
-
__emval_run_destructors = function __emval_run_destructors(handle) {
|
|
26519
|
-
var destructors = Emval.toValue(handle);
|
|
26520
|
-
runDestructors(destructors);
|
|
26521
|
-
__emval_decref(handle);
|
|
26522
|
-
};
|
|
26523
|
-
INT53_MAX = 9007199254740992;
|
|
26524
|
-
INT53_MIN = -9007199254740992;
|
|
26525
|
-
bigintToI53Checked = function bigintToI53Checked(num) {
|
|
26526
|
-
return num < INT53_MIN || num > INT53_MAX ? NaN : Number(num);
|
|
26527
|
-
};
|
|
26528
|
-
__tzset_js = function __tzset_js(timezone, daylight, std_name, dst_name) {
|
|
26529
|
-
// TODO: Use (malleable) environment variables instead of system settings.
|
|
26530
|
-
var currentYear = new Date().getFullYear();
|
|
26531
|
-
var winter = new Date(currentYear, 0, 1);
|
|
26532
|
-
var summer = new Date(currentYear, 6, 1);
|
|
26533
|
-
var winterOffset = winter.getTimezoneOffset();
|
|
26534
|
-
var summerOffset = summer.getTimezoneOffset();
|
|
26535
|
-
|
|
26536
|
-
// Local standard timezone offset. Local standard time is not adjusted for
|
|
26537
|
-
// daylight savings. This code uses the fact that getTimezoneOffset returns
|
|
26538
|
-
// a greater value during Standard Time versus Daylight Saving Time (DST).
|
|
26539
|
-
// Thus it determines the expected output during Standard Time, and it
|
|
26540
|
-
// compares whether the output of the given date the same (Standard) or less
|
|
26541
|
-
// (DST).
|
|
26542
|
-
var stdTimezoneOffset = Math.max(winterOffset, summerOffset);
|
|
26543
|
-
|
|
26544
|
-
// timezone is specified as seconds west of UTC ("The external variable
|
|
26545
|
-
// `timezone` shall be set to the difference, in seconds, between
|
|
26546
|
-
// Coordinated Universal Time (UTC) and local standard time."), the same
|
|
26547
|
-
// as returned by stdTimezoneOffset.
|
|
26548
|
-
// See http://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html
|
|
26549
|
-
HEAPU32[timezone >> 2] = stdTimezoneOffset * 60;
|
|
26550
|
-
HEAP32[daylight >> 2] = Number(winterOffset != summerOffset);
|
|
26551
|
-
var extractZone = function extractZone(timezoneOffset) {
|
|
26552
|
-
// Why inverse sign?
|
|
26553
|
-
// Read here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset
|
|
26554
|
-
var sign = timezoneOffset >= 0 ? '-' : '+';
|
|
26555
|
-
var absOffset = Math.abs(timezoneOffset);
|
|
26556
|
-
var hours = String(Math.floor(absOffset / 60)).padStart(2, '0');
|
|
26557
|
-
var minutes = String(absOffset % 60).padStart(2, '0');
|
|
26558
|
-
return "UTC" + sign + hours + minutes;
|
|
26559
|
-
};
|
|
26560
|
-
var winterName = extractZone(winterOffset);
|
|
26561
|
-
var summerName = extractZone(summerOffset);
|
|
26562
|
-
if (summerOffset < winterOffset) {
|
|
26563
|
-
// Northern hemisphere
|
|
26564
|
-
stringToUTF8(winterName, std_name, 17);
|
|
26565
|
-
stringToUTF8(summerName, dst_name, 17);
|
|
26566
|
-
} else {
|
|
26567
|
-
stringToUTF8(winterName, dst_name, 17);
|
|
26568
|
-
stringToUTF8(summerName, std_name, 17);
|
|
26569
|
-
}
|
|
26570
|
-
};
|
|
26571
|
-
_emscripten_date_now = function _emscripten_date_now() {
|
|
26572
|
-
return Date.now();
|
|
26573
|
-
};
|
|
26574
|
-
getHeapMax = function getHeapMax() {
|
|
26575
|
-
return (
|
|
26576
|
-
// Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate
|
|
26577
|
-
// full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side
|
|
26578
|
-
// for any code that deals with heap sizes, which would require special
|
|
26579
|
-
// casing all heap size related code to treat 0 specially.
|
|
26580
|
-
2147483648
|
|
26581
|
-
);
|
|
26582
|
-
};
|
|
26583
|
-
alignMemory = function alignMemory(size, alignment) {
|
|
26584
|
-
return Math.ceil(size / alignment) * alignment;
|
|
26585
|
-
};
|
|
26586
|
-
growMemory = function growMemory(size) {
|
|
26587
|
-
var oldHeapSize = wasmMemory.buffer.byteLength;
|
|
26588
|
-
var pages = (size - oldHeapSize + 65535) / 65536 | 0;
|
|
26589
|
-
try {
|
|
26590
|
-
// round size grow request up to wasm page size (fixed 64KB per spec)
|
|
26591
|
-
wasmMemory.grow(pages); // .grow() takes a delta compared to the previous size
|
|
26592
|
-
updateMemoryViews();
|
|
26593
|
-
return 1; /*success*/
|
|
26594
|
-
} catch (e) {}
|
|
26595
|
-
// implicit 0 return to save code size (caller will cast "undefined" into 0
|
|
26596
|
-
// anyhow)
|
|
26597
|
-
};
|
|
26598
|
-
_emscripten_resize_heap = function _emscripten_resize_heap(requestedSize) {
|
|
26599
|
-
var oldSize = HEAPU8.length;
|
|
26600
|
-
// With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.
|
|
26601
|
-
requestedSize >>>= 0;
|
|
26602
|
-
// With multithreaded builds, races can happen (another thread might increase the size
|
|
26603
|
-
// in between), so return a failure, and let the caller retry.
|
|
26604
|
-
|
|
26605
|
-
// Memory resize rules:
|
|
26606
|
-
// 1. Always increase heap size to at least the requested size, rounded up
|
|
26607
|
-
// to next page multiple.
|
|
26608
|
-
// 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap
|
|
26609
|
-
// geometrically: increase the heap size according to
|
|
26610
|
-
// MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most
|
|
26611
|
-
// overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB).
|
|
26612
|
-
// 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap
|
|
26613
|
-
// linearly: increase the heap size by at least
|
|
26614
|
-
// MEMORY_GROWTH_LINEAR_STEP bytes.
|
|
26615
|
-
// 3. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by
|
|
26616
|
-
// MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest
|
|
26617
|
-
// 4. If we were unable to allocate as much memory, it may be due to
|
|
26618
|
-
// over-eager decision to excessively reserve due to (3) above.
|
|
26619
|
-
// Hence if an allocation fails, cut down on the amount of excess
|
|
26620
|
-
// growth, in an attempt to succeed to perform a smaller allocation.
|
|
26621
|
-
|
|
26622
|
-
// A limit is set for how much we can grow. We should not exceed that
|
|
26623
|
-
// (the wasm binary specifies it, so if we tried, we'd fail anyhow).
|
|
26624
|
-
var maxHeapSize = getHeapMax();
|
|
26625
|
-
if (requestedSize > maxHeapSize) {
|
|
26626
|
-
return false;
|
|
26627
|
-
}
|
|
26628
|
-
|
|
26629
|
-
// Loop through potential heap size increases. If we attempt a too eager
|
|
26630
|
-
// reservation that fails, cut down on the attempted size and reserve a
|
|
26631
|
-
// smaller bump instead. (max 3 times, chosen somewhat arbitrarily)
|
|
26632
|
-
for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
|
|
26633
|
-
var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); // ensure geometric growth
|
|
26634
|
-
// but limit overreserving (default to capping at +96MB overgrowth at most)
|
|
26635
|
-
overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
|
|
26636
|
-
var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536));
|
|
26637
|
-
var replacement = growMemory(newSize);
|
|
26638
|
-
if (replacement) {
|
|
26639
|
-
return true;
|
|
26640
|
-
}
|
|
26641
|
-
}
|
|
26642
|
-
return false;
|
|
26643
|
-
};
|
|
26644
|
-
ENV = {};
|
|
26645
|
-
getExecutableName = function getExecutableName() {
|
|
26646
|
-
return thisProgram;
|
|
26647
|
-
};
|
|
26648
|
-
_getEnvStrings = function getEnvStrings() {
|
|
26649
|
-
if (!_getEnvStrings.strings) {
|
|
26650
|
-
// Default values.
|
|
26651
|
-
// Browser language detection #8751
|
|
26652
|
-
var lang = (typeof navigator == 'object' && navigator.language || 'C').replace('-', '_') + '.UTF-8';
|
|
26653
|
-
var env = {
|
|
26654
|
-
USER: 'web_user',
|
|
26655
|
-
LOGNAME: 'web_user',
|
|
26656
|
-
PATH: '/',
|
|
26657
|
-
PWD: '/',
|
|
26658
|
-
HOME: '/home/web_user',
|
|
26659
|
-
LANG: lang,
|
|
26660
|
-
_: getExecutableName()
|
|
26661
|
-
};
|
|
26662
|
-
// Apply the user-provided values, if any.
|
|
26663
|
-
for (var x in ENV) {
|
|
26664
|
-
// x is a key in ENV; if ENV[x] is undefined, that means it was
|
|
26665
|
-
// explicitly set to be so. We allow user code to do that to
|
|
26666
|
-
// force variables with default values to remain unset.
|
|
26667
|
-
if (ENV[x] === undefined) delete env[x];else env[x] = ENV[x];
|
|
26668
|
-
}
|
|
26669
|
-
var strings = [];
|
|
26670
|
-
for (var x in env) {
|
|
26671
|
-
strings.push(x + "=" + env[x]);
|
|
26672
|
-
}
|
|
26673
|
-
_getEnvStrings.strings = strings;
|
|
26674
|
-
}
|
|
26675
|
-
return _getEnvStrings.strings;
|
|
26676
|
-
};
|
|
26677
|
-
_environ_get = function _environ_get(__environ, environ_buf) {
|
|
26678
|
-
var bufSize = 0;
|
|
26679
|
-
var envp = 0;
|
|
26680
|
-
for (var _iterator2 = _createForOfIteratorHelperLoose(_getEnvStrings()), _step2; !(_step2 = _iterator2()).done;) {
|
|
26681
|
-
var string = _step2.value;
|
|
26682
|
-
var ptr = environ_buf + bufSize;
|
|
26683
|
-
HEAPU32[__environ + envp >> 2] = ptr;
|
|
26684
|
-
bufSize += stringToUTF8(string, ptr, Infinity) + 1;
|
|
26685
|
-
envp += 4;
|
|
26686
|
-
}
|
|
26687
|
-
return 0;
|
|
26688
|
-
};
|
|
26689
|
-
_environ_sizes_get = function _environ_sizes_get(penviron_count, penviron_buf_size) {
|
|
26690
|
-
var strings = _getEnvStrings();
|
|
26691
|
-
HEAPU32[penviron_count >> 2] = strings.length;
|
|
26692
|
-
var bufSize = 0;
|
|
26693
|
-
for (var _iterator3 = _createForOfIteratorHelperLoose(strings), _step3; !(_step3 = _iterator3()).done;) {
|
|
26694
|
-
var string = _step3.value;
|
|
26695
|
-
bufSize += lengthBytesUTF8(string) + 1;
|
|
26696
|
-
}
|
|
26697
|
-
HEAPU32[penviron_buf_size >> 2] = bufSize;
|
|
26698
|
-
return 0;
|
|
26699
|
-
};
|
|
26700
|
-
_fd_close = function _fd_close(fd) {
|
|
26701
|
-
return 52;
|
|
26702
|
-
};
|
|
26703
|
-
printCharBuffers = [null, [], []];
|
|
26704
|
-
printChar = function printChar(stream, curr) {
|
|
26705
|
-
var buffer = printCharBuffers[stream];
|
|
26706
|
-
if (curr === 0 || curr === 10) {
|
|
26707
|
-
(stream === 1 ? out : err)(UTF8ArrayToString(buffer));
|
|
26708
|
-
buffer.length = 0;
|
|
26709
|
-
} else {
|
|
26710
|
-
buffer.push(curr);
|
|
26711
|
-
}
|
|
26712
|
-
};
|
|
26713
|
-
_fd_write = function _fd_write(fd, iov, iovcnt, pnum) {
|
|
26714
|
-
// hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0
|
|
26715
|
-
var num = 0;
|
|
26716
|
-
for (var i = 0; i < iovcnt; i++) {
|
|
26717
|
-
var ptr = HEAPU32[iov >> 2];
|
|
26718
|
-
var len = HEAPU32[iov + 4 >> 2];
|
|
26719
|
-
iov += 8;
|
|
26720
|
-
for (var j = 0; j < len; j++) {
|
|
26721
|
-
printChar(fd, HEAPU8[ptr + j]);
|
|
26722
|
-
}
|
|
26723
|
-
num += len;
|
|
26724
|
-
}
|
|
26725
|
-
HEAPU32[pnum >> 2] = num;
|
|
26726
|
-
return 0;
|
|
26727
|
-
};
|
|
26728
|
-
init_ClassHandle();
|
|
26729
|
-
init_RegisteredPointer();
|
|
26730
|
-
|
|
26731
|
-
// Begin runtime exports
|
|
26732
|
-
// End runtime exports
|
|
26733
|
-
// Begin JS library exports
|
|
26734
|
-
// End JS library exports
|
|
26735
|
-
|
|
26736
|
-
// end include: postlibrary.js
|
|
26737
|
-
|
|
26738
|
-
// Imports from the Wasm binary.
|
|
26739
|
-
wasmImports = {
|
|
26740
|
-
/** @export */
|
|
26741
|
-
_abort_js: __abort_js,
|
|
26742
|
-
/** @export */
|
|
26743
|
-
_embind_register_bigint: __embind_register_bigint,
|
|
26744
|
-
/** @export */
|
|
26745
|
-
_embind_register_bool: __embind_register_bool,
|
|
26746
|
-
/** @export */
|
|
26747
|
-
_embind_register_class: __embind_register_class,
|
|
26748
|
-
/** @export */
|
|
26749
|
-
_embind_register_class_constructor: __embind_register_class_constructor,
|
|
26750
|
-
/** @export */
|
|
26751
|
-
_embind_register_class_function: __embind_register_class_function,
|
|
26752
|
-
/** @export */
|
|
26753
|
-
_embind_register_emval: __embind_register_emval,
|
|
26754
|
-
/** @export */
|
|
26755
|
-
_embind_register_float: __embind_register_float,
|
|
26756
|
-
/** @export */
|
|
26757
|
-
_embind_register_integer: __embind_register_integer,
|
|
26758
|
-
/** @export */
|
|
26759
|
-
_embind_register_memory_view: __embind_register_memory_view,
|
|
26760
|
-
/** @export */
|
|
26761
|
-
_embind_register_smart_ptr: __embind_register_smart_ptr,
|
|
26762
|
-
/** @export */
|
|
26763
|
-
_embind_register_std_string: __embind_register_std_string,
|
|
26764
|
-
/** @export */
|
|
26765
|
-
_embind_register_std_wstring: __embind_register_std_wstring,
|
|
26766
|
-
/** @export */
|
|
26767
|
-
_embind_register_void: __embind_register_void,
|
|
26768
|
-
/** @export */
|
|
26769
|
-
_emval_create_invoker: __emval_create_invoker,
|
|
26770
|
-
/** @export */
|
|
26771
|
-
_emval_decref: __emval_decref,
|
|
26772
|
-
/** @export */
|
|
26773
|
-
_emval_incref: __emval_incref,
|
|
26774
|
-
/** @export */
|
|
26775
|
-
_emval_invoke: __emval_invoke,
|
|
26776
|
-
/** @export */
|
|
26777
|
-
_emval_run_destructors: __emval_run_destructors,
|
|
26778
|
-
/** @export */
|
|
26779
|
-
_gmtime_js: __gmtime_js,
|
|
26780
|
-
/** @export */
|
|
26781
|
-
_tzset_js: __tzset_js,
|
|
26782
|
-
/** @export */
|
|
26783
|
-
emscripten_date_now: _emscripten_date_now,
|
|
26784
|
-
/** @export */
|
|
26785
|
-
emscripten_resize_heap: _emscripten_resize_heap,
|
|
26786
|
-
/** @export */
|
|
26787
|
-
environ_get: _environ_get,
|
|
26788
|
-
/** @export */
|
|
26789
|
-
environ_sizes_get: _environ_sizes_get,
|
|
26790
|
-
/** @export */
|
|
26791
|
-
fd_close: _fd_close,
|
|
26792
|
-
/** @export */
|
|
26793
|
-
fd_seek: _fd_seek,
|
|
26794
|
-
/** @export */
|
|
26795
|
-
fd_write: _fd_write
|
|
26796
|
-
};
|
|
26797
|
-
_context6.next = 158;
|
|
26798
|
-
return createWasm();
|
|
26799
|
-
case 158:
|
|
26800
|
-
wasmExports = _context6.sent;
|
|
26801
|
-
run();
|
|
26802
|
-
|
|
26803
|
-
// end include: postamble.js
|
|
26804
|
-
|
|
26805
|
-
// include: postamble_modularize.js
|
|
26806
|
-
// In MODULARIZE mode we wrap the generated code in a factory function
|
|
26807
|
-
// and return either the Module itself, or a promise of the module.
|
|
26808
|
-
//
|
|
26809
|
-
// We assign to the `moduleRtn` global here and configure closure to see
|
|
26810
|
-
// this as and extern so it won't get minified.
|
|
26811
|
-
|
|
26812
|
-
if (runtimeInitialized) {
|
|
26813
|
-
moduleRtn = Module;
|
|
26814
|
-
} else {
|
|
26815
|
-
// Set up the promise that indicates the Module is initialized
|
|
26816
|
-
moduleRtn = new Promise(function (resolve, reject) {
|
|
26817
|
-
readyPromiseResolve = resolve;
|
|
26818
|
-
readyPromiseReject = reject;
|
|
26819
|
-
});
|
|
26820
|
-
}
|
|
26821
|
-
|
|
26822
|
-
// end include: postamble_modularize.js
|
|
26823
|
-
return _context6.abrupt("return", moduleRtn);
|
|
26824
|
-
case 162:
|
|
26825
|
-
case "end":
|
|
26826
|
-
return _context6.stop();
|
|
26827
|
-
}
|
|
26828
|
-
}, _callee6);
|
|
26829
|
-
}));
|
|
26830
|
-
return _Module.apply(this, arguments);
|
|
26831
|
-
}
|
|
26832
|
-
var noopPrint = function noopPrint() {
|
|
26833
|
-
// No-op
|
|
26834
|
-
};
|
|
26835
|
-
function defaultLocateFile(path, prefix) {
|
|
26836
|
-
try {
|
|
26837
|
-
var url = new URL(prefix);
|
|
26838
|
-
if (url.pathname === '/') {
|
|
26839
|
-
return prefix + "mediainfo.js/dist/" + path;
|
|
26840
|
-
}
|
|
26841
|
-
} catch (_unused) {
|
|
26842
|
-
// empty
|
|
26843
|
-
}
|
|
26844
|
-
return prefix + "../" + path;
|
|
26845
|
-
}
|
|
26846
|
-
|
|
26847
|
-
// TODO pass through more emscripten module options?
|
|
26848
|
-
|
|
26849
|
-
/**
|
|
26850
|
-
* Creates a {@link MediaInfo} instance with the specified options.
|
|
26851
|
-
*
|
|
26852
|
-
* @typeParam TFormat - The format type, defaults to `object`.
|
|
26853
|
-
* @param options - Configuration options for creating the {@link MediaInfo} instance.
|
|
26854
|
-
* @returns A promise that resolves to a {@link MediaInfo} instance when no callback is provided.
|
|
26855
|
-
*/
|
|
26856
|
-
|
|
26857
|
-
/**
|
|
26858
|
-
* Creates a {@link MediaInfo} instance with the specified options and executes the callback.
|
|
26859
|
-
*
|
|
26860
|
-
* @typeParam TFormat - The format type, defaults to `object`.
|
|
26861
|
-
* @param options - Configuration options for creating the {@link MediaInfo} instance.
|
|
26862
|
-
* @param callback - Function to call with the {@link MediaInfo} instance.
|
|
26863
|
-
* @param errCallback - Optional function to call on error.
|
|
26864
|
-
*/
|
|
26865
|
-
|
|
26866
|
-
function mediaInfoFactory() {
|
|
26867
|
-
var _options$format;
|
|
26868
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
26869
|
-
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
26870
|
-
var errCallback = arguments.length > 2 ? arguments[2] : undefined;
|
|
26871
|
-
if (callback === undefined) {
|
|
26872
|
-
return new Promise(function (resolve, reject) {
|
|
26873
|
-
mediaInfoFactory(options, resolve, reject);
|
|
26874
|
-
});
|
|
26875
|
-
}
|
|
26876
|
-
var _DEFAULT_OPTIONS$opti = _extends({}, DEFAULT_OPTIONS, options, {
|
|
26877
|
-
format: (_options$format = options.format) != null ? _options$format : DEFAULT_OPTIONS.format
|
|
26878
|
-
}),
|
|
26879
|
-
locateFile = _DEFAULT_OPTIONS$opti.locateFile,
|
|
26880
|
-
mergedOptions = _objectWithoutPropertiesLoose(_DEFAULT_OPTIONS$opti, _excluded);
|
|
26881
|
-
var mediaInfoModuleFactoryOpts = {
|
|
26882
|
-
// Silence all print in module
|
|
26883
|
-
print: noopPrint,
|
|
26884
|
-
printErr: noopPrint,
|
|
26885
|
-
locateFile: locateFile != null ? locateFile : defaultLocateFile,
|
|
26886
|
-
onAbort: function onAbort(err) {
|
|
26887
|
-
if (errCallback) {
|
|
26888
|
-
errCallback(err);
|
|
26889
|
-
}
|
|
26890
|
-
}
|
|
26891
|
-
};
|
|
26892
|
-
|
|
26893
|
-
// Fetch and load WASM module
|
|
26894
|
-
Module(mediaInfoModuleFactoryOpts).then(function (wasmModule) {
|
|
26895
|
-
callback(new MediaInfo(wasmModule, mergedOptions));
|
|
26896
|
-
})["catch"](function (error) {
|
|
26897
|
-
if (errCallback) {
|
|
26898
|
-
errCallback(error);
|
|
26899
|
-
}
|
|
26900
|
-
});
|
|
26901
|
-
}
|
|
26902
|
-
|
|
26903
24203
|
function makeReadChunk(file) {
|
|
26904
24204
|
var _this = this;
|
|
26905
24205
|
return function (chunkSize, offset) {
|
|
@@ -27097,7 +24397,7 @@
|
|
|
27097
24397
|
var frameCheckCanvas = React.useRef(null);
|
|
27098
24398
|
React.useEffect(function () {
|
|
27099
24399
|
if (!captureMediaInfo) return;
|
|
27100
|
-
mediaInfoFactory({
|
|
24400
|
+
mediainfo_js.mediaInfoFactory({
|
|
27101
24401
|
format: 'object',
|
|
27102
24402
|
full: true,
|
|
27103
24403
|
locateFile: function locateFile(filename) {
|