@plattar/plattar-ar-adapter 1.128.1 → 1.129.1
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/build/es2015/plattar-ar-adapter.js +439 -342
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +90 -18
- package/build/es2019/plattar-ar-adapter.min.js +1 -1
- package/dist/embed/controllers/configurator-controller.d.ts +1 -4
- package/dist/embed/controllers/configurator-controller.js +1 -4
- package/dist/embed/controllers/plattar-controller.d.ts +20 -5
- package/dist/embed/controllers/plattar-controller.js +84 -0
- package/dist/embed/controllers/product-controller.d.ts +1 -4
- package/dist/embed/controllers/product-controller.js +1 -4
- package/dist/embed/controllers/viewer-controller.d.ts +1 -4
- package/dist/embed/controllers/viewer-controller.js +1 -4
- package/dist/embed/controllers/vto-controller.d.ts +1 -4
- package/dist/embed/controllers/vto-controller.js +1 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
|
@@ -1106,15 +1106,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1106
1106
|
var _super6 = _createSuper(ConfiguratorController);
|
|
1107
1107
|
|
|
1108
1108
|
function ConfiguratorController(parent) {
|
|
1109
|
-
var _this12;
|
|
1110
|
-
|
|
1111
1109
|
_classCallCheck(this, ConfiguratorController);
|
|
1112
1110
|
|
|
1113
|
-
|
|
1114
|
-
_this12._state = plattar_controller_1.ControllerState.None;
|
|
1115
|
-
_this12._element = null;
|
|
1116
|
-
_this12._prevQROpt = null;
|
|
1117
|
-
return _this12;
|
|
1111
|
+
return _super6.call(this, parent);
|
|
1118
1112
|
}
|
|
1119
1113
|
|
|
1120
1114
|
_createClass(ConfiguratorController, [{
|
|
@@ -1128,22 +1122,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1128
1122
|
}
|
|
1129
1123
|
}
|
|
1130
1124
|
}, {
|
|
1131
|
-
key: "
|
|
1132
|
-
value: function
|
|
1133
|
-
var
|
|
1125
|
+
key: "startViewerQRCode",
|
|
1126
|
+
value: function startViewerQRCode(options) {
|
|
1127
|
+
var _this12 = this;
|
|
1134
1128
|
|
|
1135
1129
|
return new Promise(function (accept, reject) {
|
|
1136
1130
|
// remove the old renderer instance if any
|
|
1137
|
-
|
|
1131
|
+
_this12.removeRenderer();
|
|
1138
1132
|
|
|
1139
|
-
var sceneID =
|
|
1133
|
+
var sceneID = _this12.getAttribute("scene-id");
|
|
1140
1134
|
|
|
1141
1135
|
if (sceneID) {
|
|
1142
1136
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
1143
1137
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1144
1138
|
|
|
1145
|
-
var width =
|
|
1146
|
-
var height =
|
|
1139
|
+
var width = _this12.getAttribute("width") || "500px";
|
|
1140
|
+
var height = _this12.getAttribute("height") || "500px";
|
|
1147
1141
|
viewer.setAttribute("width", width);
|
|
1148
1142
|
viewer.setAttribute("height", height);
|
|
1149
1143
|
|
|
@@ -1161,9 +1155,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1161
1155
|
|
|
1162
1156
|
var dst = plattar_api_1.Server.location().base + "renderer/configurator.html?scene_id=" + sceneID; // optional attributes
|
|
1163
1157
|
|
|
1164
|
-
var configState =
|
|
1158
|
+
var configState = _this12.getAttribute("config-state");
|
|
1165
1159
|
|
|
1166
|
-
var showAR =
|
|
1160
|
+
var showAR = _this12.getAttribute("show-ar");
|
|
1167
1161
|
|
|
1168
1162
|
if (configState) {
|
|
1169
1163
|
dst += "&config_state=" + configState;
|
|
@@ -1179,11 +1173,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1179
1173
|
return accept(viewer);
|
|
1180
1174
|
};
|
|
1181
1175
|
|
|
1182
|
-
|
|
1176
|
+
_this12.append(viewer);
|
|
1183
1177
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1178
|
+
_this12._element = viewer;
|
|
1179
|
+
_this12._state = plattar_controller_1.ControllerState.QRCode;
|
|
1180
|
+
_this12._prevQROpt = opt;
|
|
1187
1181
|
return;
|
|
1188
1182
|
}
|
|
1189
1183
|
|
|
@@ -1193,28 +1187,28 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1193
1187
|
}, {
|
|
1194
1188
|
key: "startRenderer",
|
|
1195
1189
|
value: function startRenderer() {
|
|
1196
|
-
var
|
|
1190
|
+
var _this13 = this;
|
|
1197
1191
|
|
|
1198
1192
|
return new Promise(function (accept, reject) {
|
|
1199
1193
|
// remove the old renderer instance if any
|
|
1200
|
-
|
|
1194
|
+
_this13.removeRenderer();
|
|
1201
1195
|
|
|
1202
|
-
var sceneID =
|
|
1196
|
+
var sceneID = _this13.getAttribute("scene-id");
|
|
1203
1197
|
|
|
1204
1198
|
if (sceneID) {
|
|
1205
1199
|
// required attributes with defaults for plattar-configurator node
|
|
1206
|
-
var width =
|
|
1207
|
-
var height =
|
|
1208
|
-
var server =
|
|
1200
|
+
var width = _this13.getAttribute("width") || "500px";
|
|
1201
|
+
var height = _this13.getAttribute("height") || "500px";
|
|
1202
|
+
var server = _this13.getAttribute("server") || "production";
|
|
1209
1203
|
var viewer = document.createElement("plattar-configurator");
|
|
1210
1204
|
viewer.setAttribute("width", width);
|
|
1211
1205
|
viewer.setAttribute("height", height);
|
|
1212
1206
|
viewer.setAttribute("server", server);
|
|
1213
1207
|
viewer.setAttribute("scene-id", sceneID); // optional attributes
|
|
1214
1208
|
|
|
1215
|
-
var configState =
|
|
1209
|
+
var configState = _this13.getAttribute("config-state");
|
|
1216
1210
|
|
|
1217
|
-
var showAR =
|
|
1211
|
+
var showAR = _this13.getAttribute("show-ar");
|
|
1218
1212
|
|
|
1219
1213
|
if (configState) {
|
|
1220
1214
|
viewer.setAttribute("config-state", configState);
|
|
@@ -1228,10 +1222,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1228
1222
|
return accept(viewer);
|
|
1229
1223
|
};
|
|
1230
1224
|
|
|
1231
|
-
|
|
1225
|
+
_this13.append(viewer);
|
|
1232
1226
|
|
|
1233
|
-
|
|
1234
|
-
|
|
1227
|
+
_this13._element = viewer;
|
|
1228
|
+
_this13._state = plattar_controller_1.ControllerState.Renderer;
|
|
1235
1229
|
return;
|
|
1236
1230
|
}
|
|
1237
1231
|
|
|
@@ -1241,24 +1235,24 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1241
1235
|
}, {
|
|
1242
1236
|
key: "initAR",
|
|
1243
1237
|
value: function initAR() {
|
|
1244
|
-
var
|
|
1238
|
+
var _this14 = this;
|
|
1245
1239
|
|
|
1246
1240
|
return new Promise(function (accept, reject) {
|
|
1247
1241
|
if (!util_1.Util.canAugment()) {
|
|
1248
1242
|
return reject(new Error("ConfiguratorController.initAR() - cannot proceed as AR not available in context"));
|
|
1249
1243
|
}
|
|
1250
1244
|
|
|
1251
|
-
var arMode =
|
|
1245
|
+
var arMode = _this14.getAttribute("ar-mode") || "generated";
|
|
1252
1246
|
|
|
1253
1247
|
switch (arMode.toLowerCase()) {
|
|
1254
1248
|
case "inherited":
|
|
1255
|
-
|
|
1249
|
+
_this14._InitARInherited(accept, reject);
|
|
1256
1250
|
|
|
1257
1251
|
return;
|
|
1258
1252
|
|
|
1259
1253
|
case "generated":
|
|
1260
1254
|
default:
|
|
1261
|
-
|
|
1255
|
+
_this14._InitARGenerated(accept, reject);
|
|
1262
1256
|
|
|
1263
1257
|
}
|
|
1264
1258
|
});
|
|
@@ -1414,6 +1408,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1414
1408
|
value: true
|
|
1415
1409
|
});
|
|
1416
1410
|
exports.PlattarController = exports.ControllerState = void 0;
|
|
1411
|
+
|
|
1412
|
+
var plattar_api_1 = require("@plattar/plattar-api");
|
|
1413
|
+
|
|
1417
1414
|
var ControllerState;
|
|
1418
1415
|
|
|
1419
1416
|
(function (ControllerState) {
|
|
@@ -1430,6 +1427,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1430
1427
|
function PlattarController(parent) {
|
|
1431
1428
|
_classCallCheck(this, PlattarController);
|
|
1432
1429
|
|
|
1430
|
+
this._state = ControllerState.None;
|
|
1431
|
+
this._element = null;
|
|
1432
|
+
this._prevQROpt = null;
|
|
1433
1433
|
this._parent = parent;
|
|
1434
1434
|
}
|
|
1435
1435
|
/**
|
|
@@ -1444,15 +1444,128 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1444
1444
|
* Initialise and start AR mode if available
|
|
1445
1445
|
*/
|
|
1446
1446
|
function startAR() {
|
|
1447
|
-
var
|
|
1447
|
+
var _this15 = this;
|
|
1448
1448
|
|
|
1449
1449
|
return new Promise(function (accept, reject) {
|
|
1450
|
-
|
|
1450
|
+
_this15.initAR().then(function (launcher) {
|
|
1451
1451
|
launcher.start();
|
|
1452
1452
|
accept();
|
|
1453
1453
|
})["catch"](reject);
|
|
1454
1454
|
});
|
|
1455
1455
|
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Decide which QR Code to render according to the qr-type attribute
|
|
1458
|
+
* @param options
|
|
1459
|
+
* @returns
|
|
1460
|
+
*/
|
|
1461
|
+
|
|
1462
|
+
}, {
|
|
1463
|
+
key: "startQRCode",
|
|
1464
|
+
value: function startQRCode(options) {
|
|
1465
|
+
var qrType = this.getAttribute("qr-type") || "viewer";
|
|
1466
|
+
|
|
1467
|
+
switch (qrType.toLowerCase()) {
|
|
1468
|
+
case "ar":
|
|
1469
|
+
return this.startARQRCode(options);
|
|
1470
|
+
|
|
1471
|
+
case "viewer":
|
|
1472
|
+
default:
|
|
1473
|
+
return this.startViewerQRCode(options);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* Displays a QR Code that sends the user direct to AR
|
|
1478
|
+
* @param options
|
|
1479
|
+
* @returns
|
|
1480
|
+
*/
|
|
1481
|
+
|
|
1482
|
+
}, {
|
|
1483
|
+
key: "startARQRCode",
|
|
1484
|
+
value: function startARQRCode(options) {
|
|
1485
|
+
var _this16 = this;
|
|
1486
|
+
|
|
1487
|
+
return new Promise(function (accept, reject) {
|
|
1488
|
+
// remove the old renderer instance if any
|
|
1489
|
+
_this16.removeRenderer();
|
|
1490
|
+
|
|
1491
|
+
var opt = options || PlattarController.DEFAULT_QR_OPTIONS;
|
|
1492
|
+
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1493
|
+
|
|
1494
|
+
var width = _this16.getAttribute("width") || "500px";
|
|
1495
|
+
var height = _this16.getAttribute("height") || "500px";
|
|
1496
|
+
viewer.setAttribute("width", width);
|
|
1497
|
+
viewer.setAttribute("height", height);
|
|
1498
|
+
|
|
1499
|
+
if (opt.color) {
|
|
1500
|
+
viewer.setAttribute("color", opt.color);
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
if (opt.margin) {
|
|
1504
|
+
viewer.setAttribute("margin", "" + opt.margin);
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
if (opt.qrType) {
|
|
1508
|
+
viewer.setAttribute("qr-type", opt.qrType);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
var qrOptions = btoa(JSON.stringify(opt));
|
|
1512
|
+
var dst = plattar_api_1.Server.location().base + "renderer/launcher.html?qr_options=" + qrOptions;
|
|
1513
|
+
|
|
1514
|
+
var sceneID = _this16.getAttribute("scene-id");
|
|
1515
|
+
|
|
1516
|
+
var configState = _this16.getAttribute("config-state");
|
|
1517
|
+
|
|
1518
|
+
var embedType = _this16.getAttribute("embed-type");
|
|
1519
|
+
|
|
1520
|
+
var productID = _this16.getAttribute("product-id");
|
|
1521
|
+
|
|
1522
|
+
var sceneProductID = _this16.getAttribute("scene-product-id");
|
|
1523
|
+
|
|
1524
|
+
var variationID = _this16.getAttribute("variation-id");
|
|
1525
|
+
|
|
1526
|
+
var arMode = _this16.getAttribute("ar-mode");
|
|
1527
|
+
|
|
1528
|
+
if (configState) {
|
|
1529
|
+
dst += "&config_state=" + configState;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
if (embedType) {
|
|
1533
|
+
dst += "&embed_type=" + embedType;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
if (productID) {
|
|
1537
|
+
dst += "&product_id=" + productID;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
if (sceneProductID) {
|
|
1541
|
+
dst += "&scene_product_id=" + sceneProductID;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
if (variationID) {
|
|
1545
|
+
dst += "&variation_id=" + variationID;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
if (arMode) {
|
|
1549
|
+
dst += "&ar_mode=" + arMode;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
if (sceneID) {
|
|
1553
|
+
dst += "&scene_id=" + sceneID;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
viewer.setAttribute("url", opt.url || dst);
|
|
1557
|
+
|
|
1558
|
+
viewer.onload = function () {
|
|
1559
|
+
return accept(viewer);
|
|
1560
|
+
};
|
|
1561
|
+
|
|
1562
|
+
_this16._element = viewer;
|
|
1563
|
+
_this16._state = ControllerState.QRCode;
|
|
1564
|
+
_this16._prevQROpt = opt;
|
|
1565
|
+
|
|
1566
|
+
_this16.append(viewer);
|
|
1567
|
+
});
|
|
1568
|
+
}
|
|
1456
1569
|
/**
|
|
1457
1570
|
* Returns the Parent Instance
|
|
1458
1571
|
*/
|
|
@@ -1501,7 +1614,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1501
1614
|
}();
|
|
1502
1615
|
|
|
1503
1616
|
exports.PlattarController = PlattarController;
|
|
1504
|
-
}, {
|
|
1617
|
+
}, {
|
|
1618
|
+
"@plattar/plattar-api": 42
|
|
1619
|
+
}],
|
|
1505
1620
|
9: [function (require, module, exports) {
|
|
1506
1621
|
"use strict";
|
|
1507
1622
|
|
|
@@ -1528,15 +1643,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1528
1643
|
var _super7 = _createSuper(ProductController);
|
|
1529
1644
|
|
|
1530
1645
|
function ProductController(parent) {
|
|
1531
|
-
var _this17;
|
|
1532
|
-
|
|
1533
1646
|
_classCallCheck(this, ProductController);
|
|
1534
1647
|
|
|
1535
|
-
|
|
1536
|
-
_this17._state = plattar_controller_1.ControllerState.None;
|
|
1537
|
-
_this17._element = null;
|
|
1538
|
-
_this17._prevQROpt = null;
|
|
1539
|
-
return _this17;
|
|
1648
|
+
return _super7.call(this, parent);
|
|
1540
1649
|
}
|
|
1541
1650
|
|
|
1542
1651
|
_createClass(ProductController, [{
|
|
@@ -1565,22 +1674,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1565
1674
|
}
|
|
1566
1675
|
}
|
|
1567
1676
|
}, {
|
|
1568
|
-
key: "
|
|
1569
|
-
value: function
|
|
1570
|
-
var
|
|
1677
|
+
key: "startViewerQRCode",
|
|
1678
|
+
value: function startViewerQRCode(options) {
|
|
1679
|
+
var _this17 = this;
|
|
1571
1680
|
|
|
1572
1681
|
return new Promise(function (accept, reject) {
|
|
1573
1682
|
// remove the old renderer instance if any
|
|
1574
|
-
|
|
1683
|
+
_this17.removeRenderer();
|
|
1575
1684
|
|
|
1576
|
-
var productID =
|
|
1685
|
+
var productID = _this17.getAttribute("product-id");
|
|
1577
1686
|
|
|
1578
1687
|
if (productID) {
|
|
1579
1688
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
1580
1689
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1581
1690
|
|
|
1582
|
-
var width =
|
|
1583
|
-
var height =
|
|
1691
|
+
var width = _this17.getAttribute("width") || "500px";
|
|
1692
|
+
var height = _this17.getAttribute("height") || "500px";
|
|
1584
1693
|
viewer.setAttribute("width", width);
|
|
1585
1694
|
viewer.setAttribute("height", height);
|
|
1586
1695
|
|
|
@@ -1597,9 +1706,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1597
1706
|
} // optional attributes
|
|
1598
1707
|
|
|
1599
1708
|
|
|
1600
|
-
var variationID =
|
|
1709
|
+
var variationID = _this17.getAttribute("variation-id");
|
|
1601
1710
|
|
|
1602
|
-
var showAR =
|
|
1711
|
+
var showAR = _this17.getAttribute("show-ar");
|
|
1603
1712
|
|
|
1604
1713
|
var dst = plattar_api_1.Server.location().base + "renderer/product.html?product_id=" + productID;
|
|
1605
1714
|
|
|
@@ -1617,11 +1726,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1617
1726
|
return accept(viewer);
|
|
1618
1727
|
};
|
|
1619
1728
|
|
|
1620
|
-
|
|
1729
|
+
_this17.append(viewer);
|
|
1621
1730
|
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1731
|
+
_this17._element = viewer;
|
|
1732
|
+
_this17._state = plattar_controller_1.ControllerState.QRCode;
|
|
1733
|
+
_this17._prevQROpt = opt;
|
|
1625
1734
|
return;
|
|
1626
1735
|
}
|
|
1627
1736
|
|
|
@@ -1631,28 +1740,28 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1631
1740
|
}, {
|
|
1632
1741
|
key: "startRenderer",
|
|
1633
1742
|
value: function startRenderer() {
|
|
1634
|
-
var
|
|
1743
|
+
var _this18 = this;
|
|
1635
1744
|
|
|
1636
1745
|
return new Promise(function (accept, reject) {
|
|
1637
1746
|
// remove the old renderer instance if any
|
|
1638
|
-
|
|
1747
|
+
_this18.removeRenderer();
|
|
1639
1748
|
|
|
1640
|
-
var productID =
|
|
1749
|
+
var productID = _this18.getAttribute("product-id");
|
|
1641
1750
|
|
|
1642
1751
|
if (productID) {
|
|
1643
1752
|
// required attributes with defaults for plattar-product node
|
|
1644
|
-
var width =
|
|
1645
|
-
var height =
|
|
1646
|
-
var server =
|
|
1753
|
+
var width = _this18.getAttribute("width") || "500px";
|
|
1754
|
+
var height = _this18.getAttribute("height") || "500px";
|
|
1755
|
+
var server = _this18.getAttribute("server") || "production";
|
|
1647
1756
|
var viewer = document.createElement("plattar-product");
|
|
1648
1757
|
viewer.setAttribute("width", width);
|
|
1649
1758
|
viewer.setAttribute("height", height);
|
|
1650
1759
|
viewer.setAttribute("server", server);
|
|
1651
1760
|
viewer.setAttribute("product-id", productID); // optional attributes
|
|
1652
1761
|
|
|
1653
|
-
var variationID =
|
|
1762
|
+
var variationID = _this18.getAttribute("variation-id");
|
|
1654
1763
|
|
|
1655
|
-
var showAR =
|
|
1764
|
+
var showAR = _this18.getAttribute("show-ar");
|
|
1656
1765
|
|
|
1657
1766
|
if (variationID) {
|
|
1658
1767
|
viewer.setAttribute("variation-id", variationID);
|
|
@@ -1666,10 +1775,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1666
1775
|
return accept(viewer);
|
|
1667
1776
|
};
|
|
1668
1777
|
|
|
1669
|
-
|
|
1778
|
+
_this18.append(viewer);
|
|
1670
1779
|
|
|
1671
|
-
|
|
1672
|
-
|
|
1780
|
+
_this18._element = viewer;
|
|
1781
|
+
_this18._state = plattar_controller_1.ControllerState.Renderer;
|
|
1673
1782
|
return;
|
|
1674
1783
|
}
|
|
1675
1784
|
|
|
@@ -1679,17 +1788,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1679
1788
|
}, {
|
|
1680
1789
|
key: "initAR",
|
|
1681
1790
|
value: function initAR() {
|
|
1682
|
-
var
|
|
1791
|
+
var _this19 = this;
|
|
1683
1792
|
|
|
1684
1793
|
return new Promise(function (accept, reject) {
|
|
1685
1794
|
if (!util_1.Util.canAugment()) {
|
|
1686
1795
|
return reject(new Error("ProductController.initAR() - cannot proceed as AR not available in context"));
|
|
1687
1796
|
}
|
|
1688
1797
|
|
|
1689
|
-
var productID =
|
|
1798
|
+
var productID = _this19.getAttribute("product-id");
|
|
1690
1799
|
|
|
1691
1800
|
if (productID) {
|
|
1692
|
-
var variationID =
|
|
1801
|
+
var variationID = _this19.getAttribute("variation-id");
|
|
1693
1802
|
|
|
1694
1803
|
var product = new product_ar_1.ProductAR(productID, variationID);
|
|
1695
1804
|
return product.init().then(accept)["catch"](reject);
|
|
@@ -1757,15 +1866,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1757
1866
|
var _super8 = _createSuper(ViewerController);
|
|
1758
1867
|
|
|
1759
1868
|
function ViewerController(parent) {
|
|
1760
|
-
var _this21;
|
|
1761
|
-
|
|
1762
1869
|
_classCallCheck(this, ViewerController);
|
|
1763
1870
|
|
|
1764
|
-
|
|
1765
|
-
_this21._state = plattar_controller_1.ControllerState.None;
|
|
1766
|
-
_this21._element = null;
|
|
1767
|
-
_this21._prevQROpt = null;
|
|
1768
|
-
return _this21;
|
|
1871
|
+
return _super8.call(this, parent);
|
|
1769
1872
|
}
|
|
1770
1873
|
|
|
1771
1874
|
_createClass(ViewerController, [{
|
|
@@ -1795,22 +1898,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1795
1898
|
}
|
|
1796
1899
|
}
|
|
1797
1900
|
}, {
|
|
1798
|
-
key: "
|
|
1799
|
-
value: function
|
|
1800
|
-
var
|
|
1901
|
+
key: "startViewerQRCode",
|
|
1902
|
+
value: function startViewerQRCode(options) {
|
|
1903
|
+
var _this20 = this;
|
|
1801
1904
|
|
|
1802
1905
|
return new Promise(function (accept, reject) {
|
|
1803
1906
|
// remove the old renderer instance if any
|
|
1804
|
-
|
|
1907
|
+
_this20.removeRenderer();
|
|
1805
1908
|
|
|
1806
|
-
var sceneID =
|
|
1909
|
+
var sceneID = _this20.getAttribute("scene-id");
|
|
1807
1910
|
|
|
1808
1911
|
if (sceneID) {
|
|
1809
1912
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
1810
1913
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1811
1914
|
|
|
1812
|
-
var width =
|
|
1813
|
-
var height =
|
|
1915
|
+
var width = _this20.getAttribute("width") || "500px";
|
|
1916
|
+
var height = _this20.getAttribute("height") || "500px";
|
|
1814
1917
|
viewer.setAttribute("width", width);
|
|
1815
1918
|
viewer.setAttribute("height", height);
|
|
1816
1919
|
|
|
@@ -1828,11 +1931,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1828
1931
|
|
|
1829
1932
|
var dst = plattar_api_1.Server.location().base + "renderer/viewer.html?scene_id=" + sceneID; // optional attributes
|
|
1830
1933
|
|
|
1831
|
-
var productID =
|
|
1934
|
+
var productID = _this20.getAttribute("product-id") || _this20.getAttribute("scene-product-id");
|
|
1832
1935
|
|
|
1833
|
-
var variationID =
|
|
1936
|
+
var variationID = _this20.getAttribute("variation-id");
|
|
1834
1937
|
|
|
1835
|
-
var showAR =
|
|
1938
|
+
var showAR = _this20.getAttribute("show-ar");
|
|
1836
1939
|
|
|
1837
1940
|
if (productID) {
|
|
1838
1941
|
dst += "&productId=" + productID;
|
|
@@ -1852,11 +1955,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1852
1955
|
return accept(viewer);
|
|
1853
1956
|
};
|
|
1854
1957
|
|
|
1855
|
-
|
|
1958
|
+
_this20.append(viewer);
|
|
1856
1959
|
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1960
|
+
_this20._element = viewer;
|
|
1961
|
+
_this20._state = plattar_controller_1.ControllerState.QRCode;
|
|
1962
|
+
_this20._prevQROpt = opt;
|
|
1860
1963
|
return;
|
|
1861
1964
|
}
|
|
1862
1965
|
|
|
@@ -1866,30 +1969,30 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1866
1969
|
}, {
|
|
1867
1970
|
key: "startRenderer",
|
|
1868
1971
|
value: function startRenderer() {
|
|
1869
|
-
var
|
|
1972
|
+
var _this21 = this;
|
|
1870
1973
|
|
|
1871
1974
|
return new Promise(function (accept, reject) {
|
|
1872
1975
|
// remove the old renderer instance if any
|
|
1873
|
-
|
|
1976
|
+
_this21.removeRenderer();
|
|
1874
1977
|
|
|
1875
|
-
var sceneID =
|
|
1978
|
+
var sceneID = _this21.getAttribute("scene-id");
|
|
1876
1979
|
|
|
1877
1980
|
if (sceneID) {
|
|
1878
1981
|
// required attributes with defaults for plattar-viewer node
|
|
1879
|
-
var width =
|
|
1880
|
-
var height =
|
|
1881
|
-
var server =
|
|
1982
|
+
var width = _this21.getAttribute("width") || "500px";
|
|
1983
|
+
var height = _this21.getAttribute("height") || "500px";
|
|
1984
|
+
var server = _this21.getAttribute("server") || "production";
|
|
1882
1985
|
var viewer = document.createElement("plattar-viewer");
|
|
1883
1986
|
viewer.setAttribute("width", width);
|
|
1884
1987
|
viewer.setAttribute("height", height);
|
|
1885
1988
|
viewer.setAttribute("server", server);
|
|
1886
1989
|
viewer.setAttribute("scene-id", sceneID); // optional attributes
|
|
1887
1990
|
|
|
1888
|
-
var productID =
|
|
1991
|
+
var productID = _this21.getAttribute("product-id") || _this21.getAttribute("scene-product-id");
|
|
1889
1992
|
|
|
1890
|
-
var variationID =
|
|
1993
|
+
var variationID = _this21.getAttribute("variation-id");
|
|
1891
1994
|
|
|
1892
|
-
var showAR =
|
|
1995
|
+
var showAR = _this21.getAttribute("show-ar");
|
|
1893
1996
|
|
|
1894
1997
|
if (productID) {
|
|
1895
1998
|
viewer.setAttribute("product-id", productID);
|
|
@@ -1907,10 +2010,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1907
2010
|
return accept(viewer);
|
|
1908
2011
|
};
|
|
1909
2012
|
|
|
1910
|
-
|
|
2013
|
+
_this21.append(viewer);
|
|
1911
2014
|
|
|
1912
|
-
|
|
1913
|
-
|
|
2015
|
+
_this21._element = viewer;
|
|
2016
|
+
_this21._state = plattar_controller_1.ControllerState.Renderer;
|
|
1914
2017
|
return;
|
|
1915
2018
|
}
|
|
1916
2019
|
|
|
@@ -1920,35 +2023,35 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1920
2023
|
}, {
|
|
1921
2024
|
key: "initAR",
|
|
1922
2025
|
value: function initAR() {
|
|
1923
|
-
var
|
|
2026
|
+
var _this22 = this;
|
|
1924
2027
|
|
|
1925
2028
|
return new Promise(function (accept, reject) {
|
|
1926
2029
|
if (!util_1.Util.canAugment()) {
|
|
1927
2030
|
return reject(new Error("ViewerController.initAR() - cannot proceed as AR not available in context"));
|
|
1928
2031
|
}
|
|
1929
2032
|
|
|
1930
|
-
var productID =
|
|
2033
|
+
var productID = _this22.getAttribute("product-id"); // use product-id if available
|
|
1931
2034
|
|
|
1932
2035
|
|
|
1933
2036
|
if (productID) {
|
|
1934
|
-
var variationID =
|
|
2037
|
+
var variationID = _this22.getAttribute("variation-id");
|
|
1935
2038
|
|
|
1936
2039
|
var product = new product_ar_1.ProductAR(productID, variationID);
|
|
1937
2040
|
return product.init().then(accept)["catch"](reject);
|
|
1938
2041
|
}
|
|
1939
2042
|
|
|
1940
|
-
var sceneProductID =
|
|
2043
|
+
var sceneProductID = _this22.getAttribute("scene-product-id"); // use scene-product-id if available
|
|
1941
2044
|
|
|
1942
2045
|
|
|
1943
2046
|
if (sceneProductID) {
|
|
1944
|
-
var _variationID =
|
|
2047
|
+
var _variationID = _this22.getAttribute("variation-id");
|
|
1945
2048
|
|
|
1946
2049
|
var _product = new scene_product_ar_1.SceneProductAR(sceneProductID, _variationID);
|
|
1947
2050
|
|
|
1948
2051
|
return _product.init().then(accept)["catch"](reject);
|
|
1949
2052
|
}
|
|
1950
2053
|
|
|
1951
|
-
var sceneID =
|
|
2054
|
+
var sceneID = _this22.getAttribute("scene-id"); // use the first default product-variation id if available
|
|
1952
2055
|
|
|
1953
2056
|
|
|
1954
2057
|
if (sceneID) {
|
|
@@ -2028,15 +2131,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2028
2131
|
var _super9 = _createSuper(VTOController);
|
|
2029
2132
|
|
|
2030
2133
|
function VTOController(parent) {
|
|
2031
|
-
var _this25;
|
|
2032
|
-
|
|
2033
2134
|
_classCallCheck(this, VTOController);
|
|
2034
2135
|
|
|
2035
|
-
|
|
2036
|
-
_this25._state = plattar_controller_1.ControllerState.None;
|
|
2037
|
-
_this25._element = null;
|
|
2038
|
-
_this25._prevQROpt = null;
|
|
2039
|
-
return _this25;
|
|
2136
|
+
return _super9.call(this, parent);
|
|
2040
2137
|
}
|
|
2041
2138
|
|
|
2042
2139
|
_createClass(VTOController, [{
|
|
@@ -2050,22 +2147,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2050
2147
|
}
|
|
2051
2148
|
}
|
|
2052
2149
|
}, {
|
|
2053
|
-
key: "
|
|
2054
|
-
value: function
|
|
2055
|
-
var
|
|
2150
|
+
key: "startViewerQRCode",
|
|
2151
|
+
value: function startViewerQRCode(options) {
|
|
2152
|
+
var _this23 = this;
|
|
2056
2153
|
|
|
2057
2154
|
return new Promise(function (accept, reject) {
|
|
2058
2155
|
// remove the old renderer instance if any
|
|
2059
|
-
|
|
2156
|
+
_this23.removeRenderer();
|
|
2060
2157
|
|
|
2061
|
-
var sceneID =
|
|
2158
|
+
var sceneID = _this23.getAttribute("scene-id");
|
|
2062
2159
|
|
|
2063
2160
|
if (sceneID) {
|
|
2064
2161
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
2065
2162
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
2066
2163
|
|
|
2067
|
-
var width =
|
|
2068
|
-
var height =
|
|
2164
|
+
var width = _this23.getAttribute("width") || "500px";
|
|
2165
|
+
var height = _this23.getAttribute("height") || "500px";
|
|
2069
2166
|
viewer.setAttribute("width", width);
|
|
2070
2167
|
viewer.setAttribute("height", height);
|
|
2071
2168
|
|
|
@@ -2083,9 +2180,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2083
2180
|
|
|
2084
2181
|
var dst = plattar_api_1.Server.location().base + "renderer/facear.html?scene_id=" + sceneID; // optional attributes
|
|
2085
2182
|
|
|
2086
|
-
var configState =
|
|
2183
|
+
var configState = _this23.getAttribute("config-state");
|
|
2087
2184
|
|
|
2088
|
-
var showAR =
|
|
2185
|
+
var showAR = _this23.getAttribute("show-ar");
|
|
2089
2186
|
|
|
2090
2187
|
if (configState) {
|
|
2091
2188
|
dst += "&config_state=" + configState;
|
|
@@ -2101,11 +2198,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2101
2198
|
return accept(viewer);
|
|
2102
2199
|
};
|
|
2103
2200
|
|
|
2104
|
-
|
|
2201
|
+
_this23.append(viewer);
|
|
2105
2202
|
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2203
|
+
_this23._element = viewer;
|
|
2204
|
+
_this23._state = plattar_controller_1.ControllerState.QRCode;
|
|
2205
|
+
_this23._prevQROpt = opt;
|
|
2109
2206
|
return;
|
|
2110
2207
|
}
|
|
2111
2208
|
|
|
@@ -2115,28 +2212,28 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2115
2212
|
}, {
|
|
2116
2213
|
key: "startRenderer",
|
|
2117
2214
|
value: function startRenderer() {
|
|
2118
|
-
var
|
|
2215
|
+
var _this24 = this;
|
|
2119
2216
|
|
|
2120
2217
|
return new Promise(function (accept, reject) {
|
|
2121
2218
|
// remove the old renderer instance if any
|
|
2122
|
-
|
|
2219
|
+
_this24.removeRenderer();
|
|
2123
2220
|
|
|
2124
|
-
var sceneID =
|
|
2221
|
+
var sceneID = _this24.getAttribute("scene-id");
|
|
2125
2222
|
|
|
2126
2223
|
if (sceneID) {
|
|
2127
2224
|
// required attributes with defaults for plattar-facear node
|
|
2128
|
-
var width =
|
|
2129
|
-
var height =
|
|
2130
|
-
var server =
|
|
2225
|
+
var width = _this24.getAttribute("width") || "500px";
|
|
2226
|
+
var height = _this24.getAttribute("height") || "500px";
|
|
2227
|
+
var server = _this24.getAttribute("server") || "production";
|
|
2131
2228
|
var viewer = document.createElement("plattar-facear");
|
|
2132
2229
|
viewer.setAttribute("width", width);
|
|
2133
2230
|
viewer.setAttribute("height", height);
|
|
2134
2231
|
viewer.setAttribute("server", server);
|
|
2135
2232
|
viewer.setAttribute("scene-id", sceneID); // optional attributes
|
|
2136
2233
|
|
|
2137
|
-
var configState =
|
|
2234
|
+
var configState = _this24.getAttribute("config-state");
|
|
2138
2235
|
|
|
2139
|
-
var showAR =
|
|
2236
|
+
var showAR = _this24.getAttribute("show-ar");
|
|
2140
2237
|
|
|
2141
2238
|
if (configState) {
|
|
2142
2239
|
viewer.setAttribute("config-state", configState);
|
|
@@ -2150,10 +2247,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2150
2247
|
return accept(viewer);
|
|
2151
2248
|
};
|
|
2152
2249
|
|
|
2153
|
-
|
|
2250
|
+
_this24.append(viewer);
|
|
2154
2251
|
|
|
2155
|
-
|
|
2156
|
-
|
|
2252
|
+
_this24._element = viewer;
|
|
2253
|
+
_this24._state = plattar_controller_1.ControllerState.Renderer;
|
|
2157
2254
|
return;
|
|
2158
2255
|
}
|
|
2159
2256
|
|
|
@@ -2163,7 +2260,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2163
2260
|
}, {
|
|
2164
2261
|
key: "initAR",
|
|
2165
2262
|
value: function initAR() {
|
|
2166
|
-
var
|
|
2263
|
+
var _this25 = this;
|
|
2167
2264
|
|
|
2168
2265
|
return new Promise(function (accept, reject) {
|
|
2169
2266
|
if (!util_1.Util.canAugment()) {
|
|
@@ -2174,17 +2271,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2174
2271
|
return reject(new Error("VTOController.initAR() - cannot proceed as VTO AR only available on IOS Mobile devices"));
|
|
2175
2272
|
}
|
|
2176
2273
|
|
|
2177
|
-
var arMode =
|
|
2274
|
+
var arMode = _this25.getAttribute("ar-mode") || "generated";
|
|
2178
2275
|
|
|
2179
2276
|
switch (arMode.toLowerCase()) {
|
|
2180
2277
|
case "inherited":
|
|
2181
|
-
|
|
2278
|
+
_this25._InitARInherited(accept, reject);
|
|
2182
2279
|
|
|
2183
2280
|
return;
|
|
2184
2281
|
|
|
2185
2282
|
case "generated":
|
|
2186
2283
|
default:
|
|
2187
|
-
|
|
2284
|
+
_this25._InitARGenerated(accept, reject);
|
|
2188
2285
|
|
|
2189
2286
|
}
|
|
2190
2287
|
});
|
|
@@ -2359,15 +2456,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2359
2456
|
var _super10 = _createSuper(PlattarEmbed);
|
|
2360
2457
|
|
|
2361
2458
|
function PlattarEmbed() {
|
|
2362
|
-
var
|
|
2459
|
+
var _this26;
|
|
2363
2460
|
|
|
2364
2461
|
_classCallCheck(this, PlattarEmbed);
|
|
2365
2462
|
|
|
2366
|
-
|
|
2463
|
+
_this26 = _super10.call(this); // this is the current embed type, viewer by default
|
|
2367
2464
|
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
return
|
|
2465
|
+
_this26._currentType = EmbedType.Viewer;
|
|
2466
|
+
_this26._controller = null;
|
|
2467
|
+
return _this26;
|
|
2371
2468
|
}
|
|
2372
2469
|
|
|
2373
2470
|
_createClass(PlattarEmbed, [{
|
|
@@ -2378,7 +2475,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2378
2475
|
}, {
|
|
2379
2476
|
key: "connectedCallback",
|
|
2380
2477
|
value: function connectedCallback() {
|
|
2381
|
-
var
|
|
2478
|
+
var _this27 = this;
|
|
2382
2479
|
|
|
2383
2480
|
var embedType = this.hasAttribute("embed-type") ? this.getAttribute("embed-type") : "viewer";
|
|
2384
2481
|
|
|
@@ -2404,7 +2501,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2404
2501
|
var observer = new MutationObserver(function (mutations) {
|
|
2405
2502
|
mutations.forEach(function (mutation) {
|
|
2406
2503
|
if (mutation.type === "attributes") {
|
|
2407
|
-
|
|
2504
|
+
_this27._OnAttributesUpdated();
|
|
2408
2505
|
}
|
|
2409
2506
|
});
|
|
2410
2507
|
});
|
|
@@ -2440,66 +2537,66 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2440
2537
|
} else if (init === "ar-fallback-qrcode") {
|
|
2441
2538
|
this.startAR().then(function () {// nothing to do, launched successfully
|
|
2442
2539
|
})["catch"](function (_err) {
|
|
2443
|
-
|
|
2540
|
+
_this27.startQRCode();
|
|
2444
2541
|
});
|
|
2445
2542
|
} else if (init === "ar-fallback-viewer") {
|
|
2446
2543
|
this.startAR().then(function () {// nothing to do, launched successfully
|
|
2447
2544
|
})["catch"](function (_err) {
|
|
2448
|
-
|
|
2545
|
+
_this27.startViewer();
|
|
2449
2546
|
});
|
|
2450
2547
|
}
|
|
2451
2548
|
}
|
|
2452
2549
|
}, {
|
|
2453
2550
|
key: "initAR",
|
|
2454
2551
|
value: function initAR() {
|
|
2455
|
-
var
|
|
2552
|
+
var _this28 = this;
|
|
2456
2553
|
|
|
2457
2554
|
return new Promise(function (accept, reject) {
|
|
2458
|
-
if (!
|
|
2555
|
+
if (!_this28._controller) {
|
|
2459
2556
|
return reject(new Error("PlattarEmbed.initAR() - cannot execute as controller has not loaded yet"));
|
|
2460
2557
|
}
|
|
2461
2558
|
|
|
2462
|
-
return
|
|
2559
|
+
return _this28._controller.initAR().then(accept)["catch"](reject);
|
|
2463
2560
|
});
|
|
2464
2561
|
}
|
|
2465
2562
|
}, {
|
|
2466
2563
|
key: "startAR",
|
|
2467
2564
|
value: function startAR() {
|
|
2468
|
-
var
|
|
2565
|
+
var _this29 = this;
|
|
2469
2566
|
|
|
2470
2567
|
return new Promise(function (accept, reject) {
|
|
2471
|
-
if (!
|
|
2568
|
+
if (!_this29._controller) {
|
|
2472
2569
|
return reject(new Error("PlattarEmbed.startAR() - cannot execute as controller has not loaded yet"));
|
|
2473
2570
|
}
|
|
2474
2571
|
|
|
2475
|
-
return
|
|
2572
|
+
return _this29._controller.startAR().then(accept)["catch"](reject);
|
|
2476
2573
|
});
|
|
2477
2574
|
}
|
|
2478
2575
|
}, {
|
|
2479
2576
|
key: "startViewer",
|
|
2480
2577
|
value: function startViewer() {
|
|
2481
|
-
var
|
|
2578
|
+
var _this30 = this;
|
|
2482
2579
|
|
|
2483
2580
|
return new Promise(function (accept, reject) {
|
|
2484
|
-
if (!
|
|
2581
|
+
if (!_this30._controller) {
|
|
2485
2582
|
return reject(new Error("PlattarEmbed.startViewer() - cannot execute as controller has not loaded yet"));
|
|
2486
2583
|
}
|
|
2487
2584
|
|
|
2488
|
-
return
|
|
2585
|
+
return _this30._controller.startRenderer().then(accept)["catch"](reject);
|
|
2489
2586
|
});
|
|
2490
2587
|
}
|
|
2491
2588
|
}, {
|
|
2492
2589
|
key: "startQRCode",
|
|
2493
2590
|
value: function startQRCode() {
|
|
2494
|
-
var
|
|
2591
|
+
var _this31 = this;
|
|
2495
2592
|
|
|
2496
2593
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
2497
2594
|
return new Promise(function (accept, reject) {
|
|
2498
|
-
if (!
|
|
2595
|
+
if (!_this31._controller) {
|
|
2499
2596
|
return reject(new Error("PlattarEmbed.startQRCode() - cannot execute as controller has not loaded yet"));
|
|
2500
2597
|
}
|
|
2501
2598
|
|
|
2502
|
-
return
|
|
2599
|
+
return _this31._controller.startQRCode(options).then(accept)["catch"](reject);
|
|
2503
2600
|
});
|
|
2504
2601
|
}
|
|
2505
2602
|
/**
|
|
@@ -3108,7 +3205,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3108
3205
|
Object.defineProperty(exports, "__esModule", {
|
|
3109
3206
|
value: true
|
|
3110
3207
|
});
|
|
3111
|
-
exports["default"] = "1.
|
|
3208
|
+
exports["default"] = "1.129.1";
|
|
3112
3209
|
}, {}],
|
|
3113
3210
|
17: [function (require, module, exports) {
|
|
3114
3211
|
"use strict";
|
|
@@ -3147,17 +3244,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3147
3244
|
var _super11 = _createSuper(QuicklookViewer);
|
|
3148
3245
|
|
|
3149
3246
|
function QuicklookViewer() {
|
|
3150
|
-
var
|
|
3247
|
+
var _this32;
|
|
3151
3248
|
|
|
3152
3249
|
_classCallCheck(this, QuicklookViewer);
|
|
3153
3250
|
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3251
|
+
_this32 = _super11.call(this);
|
|
3252
|
+
_this32.araction = null;
|
|
3253
|
+
_this32.titleHTML = "&checkoutTitle=" + document.title + "&checkoutSubtitle=" + document.title;
|
|
3157
3254
|
|
|
3158
|
-
|
|
3255
|
+
_this32.arcallback = function () {};
|
|
3159
3256
|
|
|
3160
|
-
return
|
|
3257
|
+
return _this32;
|
|
3161
3258
|
}
|
|
3162
3259
|
|
|
3163
3260
|
_createClass(QuicklookViewer, [{
|
|
@@ -3173,7 +3270,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3173
3270
|
}, {
|
|
3174
3271
|
key: "start",
|
|
3175
3272
|
value: function start() {
|
|
3176
|
-
var
|
|
3273
|
+
var _this33 = this;
|
|
3177
3274
|
|
|
3178
3275
|
if (!this.modelUrl) {
|
|
3179
3276
|
throw new Error("QuicklookViewer.start() - model url not set, use QuicklookViewer.modelUrl");
|
|
@@ -3188,7 +3285,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3188
3285
|
if (araction) {
|
|
3189
3286
|
var handleQuicklook = function handleQuicklook(event) {
|
|
3190
3287
|
if (event.data === "_apple_ar_quicklook_button_tapped") {
|
|
3191
|
-
|
|
3288
|
+
_this33.arcallback();
|
|
3192
3289
|
}
|
|
3193
3290
|
|
|
3194
3291
|
document.body.removeChild(anchor);
|
|
@@ -3295,16 +3392,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3295
3392
|
var _super13 = _createSuper(SceneViewer);
|
|
3296
3393
|
|
|
3297
3394
|
function SceneViewer() {
|
|
3298
|
-
var
|
|
3395
|
+
var _this34;
|
|
3299
3396
|
|
|
3300
3397
|
_classCallCheck(this, SceneViewer);
|
|
3301
3398
|
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
return
|
|
3399
|
+
_this34 = _super13.call(this);
|
|
3400
|
+
_this34.araction = null;
|
|
3401
|
+
_this34.isVertical = false;
|
|
3402
|
+
_this34.titleHTML = "<b>" + document.title;
|
|
3403
|
+
_this34.isVertical = false;
|
|
3404
|
+
return _this34;
|
|
3308
3405
|
}
|
|
3309
3406
|
|
|
3310
3407
|
_createClass(SceneViewer, [{
|
|
@@ -3416,7 +3513,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3416
3513
|
|
|
3417
3514
|
var Memory = /*#__PURE__*/function () {
|
|
3418
3515
|
function Memory(messengerInstance) {
|
|
3419
|
-
var
|
|
3516
|
+
var _this35 = this;
|
|
3420
3517
|
|
|
3421
3518
|
_classCallCheck(this, Memory);
|
|
3422
3519
|
|
|
@@ -3425,11 +3522,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3425
3522
|
this._permMemory = new PermanentMemory(messengerInstance);
|
|
3426
3523
|
|
|
3427
3524
|
this._messenger.self.__memory__set_temp_var = function (name, data) {
|
|
3428
|
-
|
|
3525
|
+
_this35._tempMemory[name] = data;
|
|
3429
3526
|
};
|
|
3430
3527
|
|
|
3431
3528
|
this._messenger.self.__memory__set_perm_var = function (name, data) {
|
|
3432
|
-
|
|
3529
|
+
_this35._permMemory[name] = data;
|
|
3433
3530
|
};
|
|
3434
3531
|
}
|
|
3435
3532
|
|
|
@@ -3927,20 +4024,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3927
4024
|
}, {
|
|
3928
4025
|
key: "exec",
|
|
3929
4026
|
value: function exec() {
|
|
3930
|
-
var
|
|
4027
|
+
var _this36 = this;
|
|
3931
4028
|
|
|
3932
4029
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
3933
4030
|
args[_key3] = arguments[_key3];
|
|
3934
4031
|
}
|
|
3935
4032
|
|
|
3936
4033
|
return new Promise(function (accept, reject) {
|
|
3937
|
-
if (!
|
|
3938
|
-
return reject(new Error("WrappedLocalFunction.exec() function with name " +
|
|
4034
|
+
if (!_this36._value) {
|
|
4035
|
+
return reject(new Error("WrappedLocalFunction.exec() function with name " + _this36._funcName + "() is not defined"));
|
|
3939
4036
|
}
|
|
3940
4037
|
|
|
3941
4038
|
try {
|
|
3942
4039
|
// otherwise execute the function
|
|
3943
|
-
var rObject =
|
|
4040
|
+
var rObject = _this36._execute.apply(_this36, args); // we need to check if the returned object is a Promise, if so, handle it
|
|
3944
4041
|
// differently. This can happen if the function wants to execute asyn
|
|
3945
4042
|
|
|
3946
4043
|
|
|
@@ -4004,7 +4101,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4004
4101
|
|
|
4005
4102
|
var GlobalEventHandler = /*#__PURE__*/function () {
|
|
4006
4103
|
function GlobalEventHandler() {
|
|
4007
|
-
var
|
|
4104
|
+
var _this37 = this;
|
|
4008
4105
|
|
|
4009
4106
|
_classCallCheck(this, GlobalEventHandler);
|
|
4010
4107
|
|
|
@@ -4026,10 +4123,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4026
4123
|
|
|
4027
4124
|
if (jsonData && jsonData.event && jsonData.data) {
|
|
4028
4125
|
// see if there are any listeners for this
|
|
4029
|
-
if (
|
|
4126
|
+
if (_this37._eventListeners[jsonData.event]) {
|
|
4030
4127
|
var remoteInterface = new RemoteInterface(evt.source, evt.origin); // loop through and call all the event handlers
|
|
4031
4128
|
|
|
4032
|
-
|
|
4129
|
+
_this37._eventListeners[jsonData.event].forEach(function (callback) {
|
|
4033
4130
|
try {
|
|
4034
4131
|
callback(remoteInterface, jsonData.data);
|
|
4035
4132
|
} catch (e) {
|
|
@@ -4225,40 +4322,40 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4225
4322
|
}, {
|
|
4226
4323
|
key: "_registerListeners",
|
|
4227
4324
|
value: function _registerListeners() {
|
|
4228
|
-
var
|
|
4325
|
+
var _this38 = this;
|
|
4229
4326
|
|
|
4230
4327
|
GlobalEventHandler.instance().listen("__messenger__child_init", function (src, data) {
|
|
4231
4328
|
var iframeID = src.id; // check reserved key list
|
|
4232
4329
|
|
|
4233
4330
|
switch (iframeID) {
|
|
4234
4331
|
case undefined:
|
|
4235
|
-
throw new Error("Messenger[" +
|
|
4332
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID cannot be undefined");
|
|
4236
4333
|
|
|
4237
4334
|
case "self":
|
|
4238
|
-
throw new Error("Messenger[" +
|
|
4335
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
|
|
4239
4336
|
|
|
4240
4337
|
case "parent":
|
|
4241
|
-
throw new Error("Messenger[" +
|
|
4338
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
|
|
4242
4339
|
|
|
4243
4340
|
case "id":
|
|
4244
|
-
throw new Error("Messenger[" +
|
|
4341
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
|
|
4245
4342
|
|
|
4246
4343
|
case "onload":
|
|
4247
|
-
throw new Error("Messenger[" +
|
|
4344
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
|
|
4248
4345
|
|
|
4249
4346
|
default:
|
|
4250
4347
|
break;
|
|
4251
4348
|
} // initialise the child iframe as a messenger pipe
|
|
4252
4349
|
|
|
4253
4350
|
|
|
4254
|
-
|
|
4351
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4255
4352
|
|
|
4256
|
-
|
|
4353
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin)); // add the interface to the broadcaster
|
|
4257
4354
|
|
|
4258
4355
|
|
|
4259
|
-
|
|
4356
|
+
_this38._broadcaster._push(iframeID);
|
|
4260
4357
|
|
|
4261
|
-
var callbacks =
|
|
4358
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4262
4359
|
|
|
4263
4360
|
if (callbacks.has(iframeID)) {
|
|
4264
4361
|
var array = callbacks.get(iframeID);
|
|
@@ -4282,33 +4379,33 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4282
4379
|
|
|
4283
4380
|
switch (iframeID) {
|
|
4284
4381
|
case undefined:
|
|
4285
|
-
throw new Error("Messenger[" +
|
|
4382
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID cannot be undefined");
|
|
4286
4383
|
|
|
4287
4384
|
case "self":
|
|
4288
|
-
throw new Error("Messenger[" +
|
|
4385
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
|
|
4289
4386
|
|
|
4290
4387
|
case "parent":
|
|
4291
|
-
throw new Error("Messenger[" +
|
|
4388
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
|
|
4292
4389
|
|
|
4293
4390
|
case "id":
|
|
4294
|
-
throw new Error("Messenger[" +
|
|
4391
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
|
|
4295
4392
|
|
|
4296
4393
|
case "onload":
|
|
4297
|
-
throw new Error("Messenger[" +
|
|
4394
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
|
|
4298
4395
|
|
|
4299
4396
|
default:
|
|
4300
4397
|
break;
|
|
4301
4398
|
} // initialise the child iframe as a messenger pipe
|
|
4302
4399
|
|
|
4303
4400
|
|
|
4304
|
-
|
|
4401
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4305
4402
|
|
|
4306
|
-
|
|
4403
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin)); // add the interface to the broadcaster
|
|
4307
4404
|
|
|
4308
4405
|
|
|
4309
|
-
|
|
4406
|
+
_this38._broadcaster._push(iframeID);
|
|
4310
4407
|
|
|
4311
|
-
var callbacks =
|
|
4408
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4312
4409
|
|
|
4313
4410
|
if (callbacks.has(iframeID)) {
|
|
4314
4411
|
var array = callbacks.get(iframeID);
|
|
@@ -4328,11 +4425,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4328
4425
|
});
|
|
4329
4426
|
GlobalEventHandler.instance().listen("__messenger__parent_init", function (src, data) {
|
|
4330
4427
|
var iframeID = "parent";
|
|
4331
|
-
|
|
4428
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4332
4429
|
|
|
4333
|
-
|
|
4430
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin));
|
|
4334
4431
|
|
|
4335
|
-
var callbacks =
|
|
4432
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4336
4433
|
|
|
4337
4434
|
if (callbacks.has(iframeID)) {
|
|
4338
4435
|
var array = callbacks.get(iframeID);
|
|
@@ -4357,11 +4454,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4357
4454
|
|
|
4358
4455
|
GlobalEventHandler.instance().listen("__messenger__parent_init_inv", function (src, data) {
|
|
4359
4456
|
var iframeID = "parent";
|
|
4360
|
-
|
|
4457
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4361
4458
|
|
|
4362
|
-
|
|
4459
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin));
|
|
4363
4460
|
|
|
4364
|
-
var callbacks =
|
|
4461
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4365
4462
|
|
|
4366
4463
|
if (callbacks.has(iframeID)) {
|
|
4367
4464
|
var array = callbacks.get(iframeID);
|
|
@@ -4599,7 +4696,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4599
4696
|
|
|
4600
4697
|
var WrappedRemoteFunction = /*#__PURE__*/function () {
|
|
4601
4698
|
function WrappedRemoteFunction(funcName, remoteInterface) {
|
|
4602
|
-
var
|
|
4699
|
+
var _this39 = this;
|
|
4603
4700
|
|
|
4604
4701
|
_classCallCheck(this, WrappedRemoteFunction);
|
|
4605
4702
|
|
|
@@ -4610,19 +4707,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4610
4707
|
GlobalEventHandler.instance().listen("__messenger__exec_fnc_result", function (src, data) {
|
|
4611
4708
|
var instanceID = data.instance_id; // the function name must match
|
|
4612
4709
|
|
|
4613
|
-
if (data.function_name !==
|
|
4710
|
+
if (data.function_name !== _this39._funcName) {
|
|
4614
4711
|
return;
|
|
4615
4712
|
} // the instance ID must be found, otherwise this is a rogue execution
|
|
4616
4713
|
// that can be ignored (should not happen)
|
|
4617
4714
|
|
|
4618
4715
|
|
|
4619
|
-
if (!
|
|
4716
|
+
if (!_this39._callInstances[instanceID]) {
|
|
4620
4717
|
return;
|
|
4621
4718
|
}
|
|
4622
4719
|
|
|
4623
|
-
var promise =
|
|
4720
|
+
var promise = _this39._callInstances[instanceID]; // remove the old instance
|
|
4624
4721
|
|
|
4625
|
-
delete
|
|
4722
|
+
delete _this39._callInstances[instanceID]; // perform the promise callbacks
|
|
4626
4723
|
|
|
4627
4724
|
if (data.function_status === "success") {
|
|
4628
4725
|
promise.accept(data.function_args);
|
|
@@ -4639,7 +4736,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4639
4736
|
_createClass(WrappedRemoteFunction, [{
|
|
4640
4737
|
key: "exec",
|
|
4641
4738
|
value: function exec() {
|
|
4642
|
-
var
|
|
4739
|
+
var _this40 = this;
|
|
4643
4740
|
|
|
4644
4741
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
4645
4742
|
args[_key4] = arguments[_key4];
|
|
@@ -4659,14 +4756,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4659
4756
|
|
|
4660
4757
|
return new Promise(function (accept, reject) {
|
|
4661
4758
|
// save this promise to be executed later
|
|
4662
|
-
|
|
4759
|
+
_this40._callInstances[instanceID] = {
|
|
4663
4760
|
accept: accept,
|
|
4664
4761
|
reject: reject
|
|
4665
4762
|
}; // execute this event in another context
|
|
4666
4763
|
|
|
4667
|
-
|
|
4764
|
+
_this40._remoteInterface.send("__messenger__exec_fnc", {
|
|
4668
4765
|
instance_id: instanceID,
|
|
4669
|
-
function_name:
|
|
4766
|
+
function_name: _this40._funcName,
|
|
4670
4767
|
function_args: args
|
|
4671
4768
|
});
|
|
4672
4769
|
});
|
|
@@ -4815,7 +4912,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4815
4912
|
|
|
4816
4913
|
var Analytics = /*#__PURE__*/function () {
|
|
4817
4914
|
function Analytics(applicationID) {
|
|
4818
|
-
var
|
|
4915
|
+
var _this41 = this;
|
|
4819
4916
|
|
|
4820
4917
|
_classCallCheck(this, Analytics);
|
|
4821
4918
|
|
|
@@ -4832,21 +4929,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4832
4929
|
|
|
4833
4930
|
this._handlePageHide = function () {
|
|
4834
4931
|
if (document.visibilityState === "hidden") {
|
|
4835
|
-
|
|
4836
|
-
} else if (
|
|
4932
|
+
_this41._pageTime = new Date();
|
|
4933
|
+
} else if (_this41._pageTime) {
|
|
4837
4934
|
var time2 = new Date();
|
|
4838
4935
|
|
|
4839
|
-
var diff = time2.getTime() -
|
|
4936
|
+
var diff = time2.getTime() - _this41._pageTime.getTime();
|
|
4840
4937
|
|
|
4841
|
-
var data =
|
|
4938
|
+
var data = _this41.data;
|
|
4842
4939
|
data.push("eventAction", "View Time");
|
|
4843
4940
|
data.push("viewTime", diff);
|
|
4844
4941
|
data.push("eventLabel", diff);
|
|
4845
4942
|
|
|
4846
|
-
|
|
4943
|
+
_this41.write();
|
|
4847
4944
|
|
|
4848
|
-
|
|
4849
|
-
document.removeEventListener("visibilitychange",
|
|
4945
|
+
_this41._pageTime = null;
|
|
4946
|
+
document.removeEventListener("visibilitychange", _this41._handlePageHide, false);
|
|
4850
4947
|
}
|
|
4851
4948
|
};
|
|
4852
4949
|
}
|
|
@@ -4854,7 +4951,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4854
4951
|
_createClass(Analytics, [{
|
|
4855
4952
|
key: "query",
|
|
4856
4953
|
value: function query() {
|
|
4857
|
-
var
|
|
4954
|
+
var _this42 = this;
|
|
4858
4955
|
|
|
4859
4956
|
var _query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
4860
4957
|
|
|
@@ -4863,11 +4960,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4863
4960
|
return reject(new Error("Analytics.query() - provided query was null"));
|
|
4864
4961
|
}
|
|
4865
4962
|
|
|
4866
|
-
var url =
|
|
4963
|
+
var url = _this42.origin === "dev" ? "http://localhost:9000/2015-03-31/functions/function/invocations" : "https://oyywgrj9ki.execute-api.ap-southeast-2.amazonaws.com/main/analytics";
|
|
4867
4964
|
var data = {
|
|
4868
4965
|
type: "read",
|
|
4869
|
-
application_id:
|
|
4870
|
-
event:
|
|
4966
|
+
application_id: _this42._applicationID,
|
|
4967
|
+
event: _this42.event,
|
|
4871
4968
|
data: _query
|
|
4872
4969
|
};
|
|
4873
4970
|
basic_http_1["default"].exec("POST", url, data).then(function (result) {
|
|
@@ -4878,21 +4975,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4878
4975
|
}, {
|
|
4879
4976
|
key: "write",
|
|
4880
4977
|
value: function write() {
|
|
4881
|
-
var
|
|
4978
|
+
var _this43 = this;
|
|
4882
4979
|
|
|
4883
4980
|
return new Promise(function (accept, reject) {
|
|
4884
|
-
var data =
|
|
4885
|
-
var url =
|
|
4886
|
-
data.push("applicationId",
|
|
4981
|
+
var data = _this43._data;
|
|
4982
|
+
var url = _this43.origin === "dev" ? "http://localhost:9000/2015-03-31/functions/function/invocations" : "https://oyywgrj9ki.execute-api.ap-southeast-2.amazonaws.com/main/analytics";
|
|
4983
|
+
data.push("applicationId", _this43._applicationID);
|
|
4887
4984
|
var sendData = {
|
|
4888
4985
|
type: "write",
|
|
4889
|
-
application_id:
|
|
4890
|
-
origin:
|
|
4891
|
-
event:
|
|
4986
|
+
application_id: _this43._applicationID,
|
|
4987
|
+
origin: _this43.origin,
|
|
4988
|
+
event: _this43.event,
|
|
4892
4989
|
data: data.data
|
|
4893
4990
|
};
|
|
4894
4991
|
|
|
4895
|
-
if (
|
|
4992
|
+
if (_this43.isBeacon === false) {
|
|
4896
4993
|
basic_http_1["default"].exec("POST", url, sendData).then(function (result) {
|
|
4897
4994
|
accept(result && result.results ? result.results : {});
|
|
4898
4995
|
})["catch"](reject);
|
|
@@ -5449,11 +5546,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5449
5546
|
}, {
|
|
5450
5547
|
key: "_get",
|
|
5451
5548
|
value: function _get(opt) {
|
|
5452
|
-
var
|
|
5549
|
+
var _this44 = this;
|
|
5453
5550
|
|
|
5454
5551
|
return new Promise(function (resolve, reject) {
|
|
5455
|
-
var target =
|
|
5456
|
-
var server =
|
|
5552
|
+
var target = _this44.target;
|
|
5553
|
+
var server = _this44.server; // we cannot perform a GET request without an ID
|
|
5457
5554
|
|
|
5458
5555
|
if (!target.id) {
|
|
5459
5556
|
reject(new Error("PlattarQuery." + target.type() + ".get() - object id is missing"));
|
|
@@ -5478,16 +5575,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5478
5575
|
var origin = server.originLocation.api_read;
|
|
5479
5576
|
var auth = server.authToken;
|
|
5480
5577
|
var headers = {
|
|
5481
|
-
'cookie': 'laravel_session=' +
|
|
5578
|
+
'cookie': 'laravel_session=' + _this44.getCookie('laravel_session')
|
|
5482
5579
|
};
|
|
5483
5580
|
Object.assign(headers, auth);
|
|
5484
5581
|
var reqopts = {
|
|
5485
5582
|
method: "GET",
|
|
5486
5583
|
headers: headers
|
|
5487
5584
|
};
|
|
5488
|
-
var includeQuery =
|
|
5585
|
+
var includeQuery = _this44._IncludeQuery;
|
|
5489
5586
|
|
|
5490
|
-
var params =
|
|
5587
|
+
var params = _this44._ParamFor("get");
|
|
5491
5588
|
|
|
5492
5589
|
var endpoint = origin + target.type() + "/" + target.id;
|
|
5493
5590
|
|
|
@@ -5528,11 +5625,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5528
5625
|
}, {
|
|
5529
5626
|
key: "_update",
|
|
5530
5627
|
value: function _update() {
|
|
5531
|
-
var
|
|
5628
|
+
var _this45 = this;
|
|
5532
5629
|
|
|
5533
5630
|
return new Promise(function (resolve, reject) {
|
|
5534
|
-
var target =
|
|
5535
|
-
var server =
|
|
5631
|
+
var target = _this45.target;
|
|
5632
|
+
var server = _this45.server; // we cannot perform a GET request without an ID
|
|
5536
5633
|
|
|
5537
5634
|
if (!target.id) {
|
|
5538
5635
|
reject(new Error("PlattarQuery." + target.type() + ".update() - object id is missing"));
|
|
@@ -5545,7 +5642,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5545
5642
|
var headers = {
|
|
5546
5643
|
'Accept': 'application/json',
|
|
5547
5644
|
'Content-Type': 'application/json',
|
|
5548
|
-
'cookie': 'laravel_session=' +
|
|
5645
|
+
'cookie': 'laravel_session=' + _this45.getCookie('laravel_session')
|
|
5549
5646
|
};
|
|
5550
5647
|
Object.assign(headers, auth);
|
|
5551
5648
|
var reqopts = {
|
|
@@ -5560,7 +5657,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5560
5657
|
})
|
|
5561
5658
|
};
|
|
5562
5659
|
|
|
5563
|
-
var params =
|
|
5660
|
+
var params = _this45._ParamFor("update");
|
|
5564
5661
|
|
|
5565
5662
|
var endpoint = origin + target.type() + "/" + target.id;
|
|
5566
5663
|
|
|
@@ -5602,18 +5699,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5602
5699
|
}, {
|
|
5603
5700
|
key: "_create",
|
|
5604
5701
|
value: function _create() {
|
|
5605
|
-
var
|
|
5702
|
+
var _this46 = this;
|
|
5606
5703
|
|
|
5607
5704
|
return new Promise(function (resolve, reject) {
|
|
5608
|
-
var target =
|
|
5609
|
-
var server =
|
|
5705
|
+
var target = _this46.target;
|
|
5706
|
+
var server = _this46.server; // otherwise, proceed with the fetching op
|
|
5610
5707
|
|
|
5611
5708
|
var origin = server.originLocation.api_write;
|
|
5612
5709
|
var auth = server.authToken;
|
|
5613
5710
|
var headers = {
|
|
5614
5711
|
'Accept': 'application/json',
|
|
5615
5712
|
'Content-Type': 'application/json',
|
|
5616
|
-
'cookie': 'laravel_session=' +
|
|
5713
|
+
'cookie': 'laravel_session=' + _this46.getCookie('laravel_session')
|
|
5617
5714
|
};
|
|
5618
5715
|
Object.assign(headers, auth);
|
|
5619
5716
|
var reqopts = {
|
|
@@ -5627,7 +5724,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5627
5724
|
})
|
|
5628
5725
|
};
|
|
5629
5726
|
|
|
5630
|
-
var params =
|
|
5727
|
+
var params = _this46._ParamFor("create");
|
|
5631
5728
|
|
|
5632
5729
|
var endpoint = origin + target.type();
|
|
5633
5730
|
|
|
@@ -5671,11 +5768,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5671
5768
|
}, {
|
|
5672
5769
|
key: "_delete",
|
|
5673
5770
|
value: function _delete() {
|
|
5674
|
-
var
|
|
5771
|
+
var _this47 = this;
|
|
5675
5772
|
|
|
5676
5773
|
return new Promise(function (resolve, reject) {
|
|
5677
|
-
var target =
|
|
5678
|
-
var server =
|
|
5774
|
+
var target = _this47.target;
|
|
5775
|
+
var server = _this47.server; // we cannot perform a GET request without an ID
|
|
5679
5776
|
|
|
5680
5777
|
if (!target.id) {
|
|
5681
5778
|
reject(new Error("PlattarQuery." + target.type() + ".delete() - object id is missing"));
|
|
@@ -5688,7 +5785,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5688
5785
|
var headers = {
|
|
5689
5786
|
'Accept': 'application/json',
|
|
5690
5787
|
'Content-Type': 'application/json',
|
|
5691
|
-
'cookie': 'laravel_session=' +
|
|
5788
|
+
'cookie': 'laravel_session=' + _this47.getCookie('laravel_session')
|
|
5692
5789
|
};
|
|
5693
5790
|
Object.assign(headers, auth);
|
|
5694
5791
|
var reqopts = {
|
|
@@ -5703,7 +5800,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5703
5800
|
})
|
|
5704
5801
|
};
|
|
5705
5802
|
|
|
5706
|
-
var params =
|
|
5803
|
+
var params = _this47._ParamFor("delete");
|
|
5707
5804
|
|
|
5708
5805
|
var endpoint = origin + target.type() + "/" + target.id;
|
|
5709
5806
|
|
|
@@ -5766,7 +5863,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5766
5863
|
}, {
|
|
5767
5864
|
key: "_include",
|
|
5768
5865
|
value: function _include(args) {
|
|
5769
|
-
var
|
|
5866
|
+
var _this48 = this;
|
|
5770
5867
|
|
|
5771
5868
|
if (!args || args.length <= 0) {
|
|
5772
5869
|
return this;
|
|
@@ -5779,21 +5876,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5779
5876
|
if (Array.isArray(obj)) {
|
|
5780
5877
|
obj.forEach(function (strObject) {
|
|
5781
5878
|
if (typeof strObject === "string" || strObject instanceof String) {
|
|
5782
|
-
|
|
5879
|
+
_this48._getIncludeQuery.push(strObject);
|
|
5783
5880
|
} else {
|
|
5784
|
-
throw new Error("PlattarQuery." +
|
|
5881
|
+
throw new Error("PlattarQuery." + _this48.target.type() + ".include(...args) - argument of Array must only include Strings");
|
|
5785
5882
|
}
|
|
5786
5883
|
});
|
|
5787
5884
|
} else if (PlattarUtil.isPlattarObject(obj)) {
|
|
5788
5885
|
var type = obj.type();
|
|
5789
5886
|
|
|
5790
5887
|
if (Array.isArray(type)) {
|
|
5791
|
-
|
|
5888
|
+
_this48._include(type);
|
|
5792
5889
|
} else {
|
|
5793
|
-
|
|
5890
|
+
_this48._getIncludeQuery.push(type);
|
|
5794
5891
|
}
|
|
5795
5892
|
} else {
|
|
5796
|
-
throw new Error("PlattarQuery." +
|
|
5893
|
+
throw new Error("PlattarQuery." + _this48.target.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
|
|
5797
5894
|
}
|
|
5798
5895
|
});
|
|
5799
5896
|
return this;
|
|
@@ -5933,13 +6030,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5933
6030
|
}, {
|
|
5934
6031
|
key: "auth",
|
|
5935
6032
|
value: function auth(token, opt) {
|
|
5936
|
-
var
|
|
6033
|
+
var _this49 = this;
|
|
5937
6034
|
|
|
5938
6035
|
var copt = opt || {
|
|
5939
6036
|
validate: false
|
|
5940
6037
|
};
|
|
5941
6038
|
return new Promise(function (resolve, reject) {
|
|
5942
|
-
var server =
|
|
6039
|
+
var server = _this49.originLocation.api_write;
|
|
5943
6040
|
|
|
5944
6041
|
if (!server) {
|
|
5945
6042
|
reject(new Error("Plattar.auth(token) - cannot authenticate as server not set via Plattar.origin(server)"));
|
|
@@ -5952,10 +6049,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5952
6049
|
}
|
|
5953
6050
|
|
|
5954
6051
|
if (!copt.validate) {
|
|
5955
|
-
|
|
6052
|
+
_this49._authToken = {
|
|
5956
6053
|
"plattar-auth-token": token
|
|
5957
6054
|
};
|
|
5958
|
-
resolve(
|
|
6055
|
+
resolve(_this49);
|
|
5959
6056
|
return;
|
|
5960
6057
|
}
|
|
5961
6058
|
|
|
@@ -5968,10 +6065,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5968
6065
|
};
|
|
5969
6066
|
fetch(endpoint, options).then(function (res) {
|
|
5970
6067
|
if (res.ok) {
|
|
5971
|
-
|
|
6068
|
+
_this49._authToken = {
|
|
5972
6069
|
"plattar-auth-token": token
|
|
5973
6070
|
};
|
|
5974
|
-
resolve(
|
|
6071
|
+
resolve(_this49);
|
|
5975
6072
|
} else {
|
|
5976
6073
|
reject(new Error("Plattar.auth(token) - failed to validate authentication token at " + endpoint));
|
|
5977
6074
|
}
|
|
@@ -5981,7 +6078,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5981
6078
|
}, {
|
|
5982
6079
|
key: "origin",
|
|
5983
6080
|
value: function origin(server, opt) {
|
|
5984
|
-
var
|
|
6081
|
+
var _this50 = this;
|
|
5985
6082
|
|
|
5986
6083
|
var copt = opt || {
|
|
5987
6084
|
validate: false
|
|
@@ -5993,8 +6090,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5993
6090
|
}
|
|
5994
6091
|
|
|
5995
6092
|
if (!copt.validate) {
|
|
5996
|
-
|
|
5997
|
-
resolve(
|
|
6093
|
+
_this50._serverLocation = server;
|
|
6094
|
+
resolve(_this50);
|
|
5998
6095
|
return;
|
|
5999
6096
|
}
|
|
6000
6097
|
|
|
@@ -6004,8 +6101,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6004
6101
|
};
|
|
6005
6102
|
fetch(endpoint, options).then(function (res) {
|
|
6006
6103
|
if (res.ok) {
|
|
6007
|
-
|
|
6008
|
-
resolve(
|
|
6104
|
+
_this50._serverLocation = server;
|
|
6105
|
+
resolve(_this50);
|
|
6009
6106
|
} else {
|
|
6010
6107
|
reject(new Error("Plattar.origin(server) - failed to ping server at " + endpoint));
|
|
6011
6108
|
}
|
|
@@ -6421,17 +6518,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6421
6518
|
var _super25 = _createSuper(FileBase);
|
|
6422
6519
|
|
|
6423
6520
|
function FileBase(id, server) {
|
|
6424
|
-
var
|
|
6521
|
+
var _this51;
|
|
6425
6522
|
|
|
6426
6523
|
_classCallCheck(this, FileBase);
|
|
6427
6524
|
|
|
6428
|
-
|
|
6525
|
+
_this51 = _super25.call(this, id, server || Server["default"]());
|
|
6429
6526
|
|
|
6430
|
-
if (
|
|
6527
|
+
if (_this51.constructor === FileBase) {
|
|
6431
6528
|
throw new Error("FileBase is abstract and cannot be created");
|
|
6432
6529
|
}
|
|
6433
6530
|
|
|
6434
|
-
return
|
|
6531
|
+
return _this51;
|
|
6435
6532
|
}
|
|
6436
6533
|
|
|
6437
6534
|
_createClass(FileBase, [{
|
|
@@ -6626,17 +6723,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6626
6723
|
var _super30 = _createSuper(PlattarBase);
|
|
6627
6724
|
|
|
6628
6725
|
function PlattarBase(id, server) {
|
|
6629
|
-
var
|
|
6726
|
+
var _this52;
|
|
6630
6727
|
|
|
6631
6728
|
_classCallCheck(this, PlattarBase);
|
|
6632
6729
|
|
|
6633
|
-
|
|
6730
|
+
_this52 = _super30.call(this, id, server || Server["default"]());
|
|
6634
6731
|
|
|
6635
|
-
if (
|
|
6732
|
+
if (_this52.constructor === PlattarBase) {
|
|
6636
6733
|
throw new Error("PlattarBase is abstract and cannot be created");
|
|
6637
6734
|
}
|
|
6638
6735
|
|
|
6639
|
-
return
|
|
6736
|
+
return _this52;
|
|
6640
6737
|
}
|
|
6641
6738
|
|
|
6642
6739
|
return _createClass(PlattarBase);
|
|
@@ -6708,7 +6805,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6708
6805
|
}, {
|
|
6709
6806
|
key: "filter",
|
|
6710
6807
|
value: function filter(obj, id) {
|
|
6711
|
-
var
|
|
6808
|
+
var _this53 = this;
|
|
6712
6809
|
|
|
6713
6810
|
if (!obj) {
|
|
6714
6811
|
return [];
|
|
@@ -6726,7 +6823,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6726
6823
|
if (Array.isArray(type)) {
|
|
6727
6824
|
var compiledList = [];
|
|
6728
6825
|
type.forEach(function (inObject) {
|
|
6729
|
-
var retArray =
|
|
6826
|
+
var retArray = _this53.filter(inObject, id);
|
|
6730
6827
|
|
|
6731
6828
|
if (retArray.length > 0) {
|
|
6732
6829
|
compiledList = compiledList.concat(retArray);
|
|
@@ -6929,7 +7026,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6929
7026
|
}, {
|
|
6930
7027
|
key: "include",
|
|
6931
7028
|
value: function include() {
|
|
6932
|
-
var
|
|
7029
|
+
var _this54 = this;
|
|
6933
7030
|
|
|
6934
7031
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
6935
7032
|
args[_key6] = arguments[_key6];
|
|
@@ -6945,15 +7042,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6945
7042
|
if (Array.isArray(obj)) {
|
|
6946
7043
|
obj.forEach(function (strObject) {
|
|
6947
7044
|
if (typeof strObject === "string" || strObject instanceof String) {
|
|
6948
|
-
includes.push("".concat(
|
|
7045
|
+
includes.push("".concat(_this54.type(), ".").concat(strObject));
|
|
6949
7046
|
} else {
|
|
6950
|
-
throw new Error("PlattarObject." +
|
|
7047
|
+
throw new Error("PlattarObject." + _this54.type() + ".include(...args) - argument of Array must only include Strings");
|
|
6951
7048
|
}
|
|
6952
7049
|
});
|
|
6953
7050
|
} else if (obj.prototype instanceof PlattarObject) {
|
|
6954
|
-
includes.push("".concat(
|
|
7051
|
+
includes.push("".concat(_this54.type(), ".").concat(obj.type()));
|
|
6955
7052
|
} else {
|
|
6956
|
-
throw new Error("PlattarObject." +
|
|
7053
|
+
throw new Error("PlattarObject." + _this54.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
|
|
6957
7054
|
}
|
|
6958
7055
|
});
|
|
6959
7056
|
return includes;
|
|
@@ -7124,17 +7221,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
7124
7221
|
var _super36 = _createSuper(CardBase);
|
|
7125
7222
|
|
|
7126
7223
|
function CardBase(id, server) {
|
|
7127
|
-
var
|
|
7224
|
+
var _this55;
|
|
7128
7225
|
|
|
7129
7226
|
_classCallCheck(this, CardBase);
|
|
7130
7227
|
|
|
7131
|
-
|
|
7228
|
+
_this55 = _super36.call(this, id, server || Server["default"]());
|
|
7132
7229
|
|
|
7133
|
-
if (
|
|
7230
|
+
if (_this55.constructor === CardBase) {
|
|
7134
7231
|
throw new Error("CardBase is abstract and cannot be created");
|
|
7135
7232
|
}
|
|
7136
7233
|
|
|
7137
|
-
return
|
|
7234
|
+
return _this55;
|
|
7138
7235
|
}
|
|
7139
7236
|
|
|
7140
7237
|
_createClass(CardBase, null, [{
|
|
@@ -7560,17 +7657,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
7560
7657
|
var _super50 = _createSuper(ProductBase);
|
|
7561
7658
|
|
|
7562
7659
|
function ProductBase(id, server) {
|
|
7563
|
-
var
|
|
7660
|
+
var _this56;
|
|
7564
7661
|
|
|
7565
7662
|
_classCallCheck(this, ProductBase);
|
|
7566
7663
|
|
|
7567
|
-
|
|
7664
|
+
_this56 = _super50.call(this, id, server || Server["default"]());
|
|
7568
7665
|
|
|
7569
|
-
if (
|
|
7666
|
+
if (_this56.constructor === ProductBase) {
|
|
7570
7667
|
throw new Error("ProductBase is abstract and cannot be created");
|
|
7571
7668
|
}
|
|
7572
7669
|
|
|
7573
|
-
return
|
|
7670
|
+
return _this56;
|
|
7574
7671
|
}
|
|
7575
7672
|
|
|
7576
7673
|
_createClass(ProductBase, null, [{
|
|
@@ -7717,17 +7814,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
7717
7814
|
var _super55 = _createSuper(SceneBase);
|
|
7718
7815
|
|
|
7719
7816
|
function SceneBase(id, server) {
|
|
7720
|
-
var
|
|
7817
|
+
var _this57;
|
|
7721
7818
|
|
|
7722
7819
|
_classCallCheck(this, SceneBase);
|
|
7723
7820
|
|
|
7724
|
-
|
|
7821
|
+
_this57 = _super55.call(this, id, server || Server["default"]());
|
|
7725
7822
|
|
|
7726
|
-
if (
|
|
7823
|
+
if (_this57.constructor === SceneBase) {
|
|
7727
7824
|
throw new Error("SceneBase is abstract and cannot be created");
|
|
7728
7825
|
}
|
|
7729
7826
|
|
|
7730
|
-
return
|
|
7827
|
+
return _this57;
|
|
7731
7828
|
}
|
|
7732
7829
|
|
|
7733
7830
|
_createClass(SceneBase, null, [{
|
|
@@ -8668,7 +8765,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8668
8765
|
_createClass(BaseElement, [{
|
|
8669
8766
|
key: "connectedCallback",
|
|
8670
8767
|
value: function connectedCallback() {
|
|
8671
|
-
var
|
|
8768
|
+
var _this58 = this;
|
|
8672
8769
|
|
|
8673
8770
|
if (this.hasAttribute("url")) {
|
|
8674
8771
|
this.renderQRCode();
|
|
@@ -8677,8 +8774,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8677
8774
|
var observer = new MutationObserver(function (mutations) {
|
|
8678
8775
|
mutations.forEach(function (mutation) {
|
|
8679
8776
|
if (mutation.type === "attributes") {
|
|
8680
|
-
if (
|
|
8681
|
-
|
|
8777
|
+
if (_this58.hasAttribute("url")) {
|
|
8778
|
+
_this58.renderQRCode();
|
|
8682
8779
|
}
|
|
8683
8780
|
}
|
|
8684
8781
|
});
|
|
@@ -8702,7 +8799,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8702
8799
|
}, {
|
|
8703
8800
|
key: "renderQRCode",
|
|
8704
8801
|
value: function renderQRCode() {
|
|
8705
|
-
var
|
|
8802
|
+
var _this59 = this;
|
|
8706
8803
|
|
|
8707
8804
|
var url = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
|
|
8708
8805
|
|
|
@@ -8812,11 +8909,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8812
8909
|
|
|
8813
8910
|
if (shortenURL && shortenURL.toLowerCase() === "true") {
|
|
8814
8911
|
this._ShortenURL(url).then(function (newURL) {
|
|
8815
|
-
|
|
8912
|
+
_this59._GenerateQRCode(newURL, width, height);
|
|
8816
8913
|
})["catch"](function (_err) {
|
|
8817
8914
|
console.warn(_err); // ignore error and just generate normal QR Code
|
|
8818
8915
|
|
|
8819
|
-
|
|
8916
|
+
_this59._GenerateQRCode(url, width, height);
|
|
8820
8917
|
});
|
|
8821
8918
|
} else {
|
|
8822
8919
|
this._GenerateQRCode(url, width, height);
|
|
@@ -8876,10 +8973,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8876
8973
|
}, {
|
|
8877
8974
|
key: "_ShortenURL",
|
|
8878
8975
|
value: function _ShortenURL(url) {
|
|
8879
|
-
var
|
|
8976
|
+
var _this60 = this;
|
|
8880
8977
|
|
|
8881
8978
|
return new Promise(function (accept, reject) {
|
|
8882
|
-
if (!
|
|
8979
|
+
if (!_this60._IsFetchAPISupported()) {
|
|
8883
8980
|
return reject(new Error("PlattarQR._ShortenURL() - fetch api not supported, cannot proceed"));
|
|
8884
8981
|
}
|
|
8885
8982
|
|
|
@@ -9107,11 +9204,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9107
9204
|
}, {
|
|
9108
9205
|
key: "get",
|
|
9109
9206
|
value: function get() {
|
|
9110
|
-
var
|
|
9207
|
+
var _this61 = this;
|
|
9111
9208
|
|
|
9112
9209
|
return new Promise(function (accept, reject) {
|
|
9113
|
-
|
|
9114
|
-
remote_request_1.RemoteRequest.request(
|
|
9210
|
+
_this61._CalculateHash().then(function () {
|
|
9211
|
+
remote_request_1.RemoteRequest.request(_this61._GetPayload(), _this61.retry < 0 ? 0 : _this61.retry).then(accept)["catch"](reject);
|
|
9115
9212
|
})["catch"](function (_err) {
|
|
9116
9213
|
reject(new Error("Configurator.get() - one of the objects does not exist in Plattar API"));
|
|
9117
9214
|
});
|
|
@@ -9120,14 +9217,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9120
9217
|
}, {
|
|
9121
9218
|
key: "_CalculateHash",
|
|
9122
9219
|
value: function _CalculateHash() {
|
|
9123
|
-
var
|
|
9220
|
+
var _this62 = this;
|
|
9124
9221
|
|
|
9125
9222
|
return new Promise(function (accept, reject) {
|
|
9126
9223
|
var promises = [];
|
|
9127
9224
|
var oldOrigin = plattar_api_1.Server["default"]().originLocation.type;
|
|
9128
|
-
plattar_api_1.Server.create(plattar_api_1.Server.match(
|
|
9225
|
+
plattar_api_1.Server.create(plattar_api_1.Server.match(_this62.server));
|
|
9129
9226
|
|
|
9130
|
-
|
|
9227
|
+
_this62._maps.forEach(function (map) {
|
|
9131
9228
|
if (map.productvariation) {
|
|
9132
9229
|
promises.push(new plattar_api_1.ProductVariation(map.productvariation).get());
|
|
9133
9230
|
}
|
|
@@ -9147,7 +9244,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9147
9244
|
|
|
9148
9245
|
Promise.all(promises).then(function (values) {
|
|
9149
9246
|
values.forEach(function (value) {
|
|
9150
|
-
|
|
9247
|
+
_this62._attrHash.push(value.attributes);
|
|
9151
9248
|
}); // reset server back
|
|
9152
9249
|
|
|
9153
9250
|
plattar_api_1.Server.create(plattar_api_1.Server.match(oldOrigin));
|
|
@@ -9249,14 +9346,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9249
9346
|
}, {
|
|
9250
9347
|
key: "get",
|
|
9251
9348
|
value: function get() {
|
|
9252
|
-
var
|
|
9349
|
+
var _this63 = this;
|
|
9253
9350
|
|
|
9254
9351
|
return new Promise(function (accept, reject) {
|
|
9255
|
-
if (!
|
|
9352
|
+
if (!_this63._model) {
|
|
9256
9353
|
return reject(new Error("ModelConverter.get() - required .model attribute was not set"));
|
|
9257
9354
|
}
|
|
9258
9355
|
|
|
9259
|
-
remote_request_1.RemoteRequest.request(
|
|
9356
|
+
remote_request_1.RemoteRequest.request(_this63._Payload, _this63.retry < 0 ? 0 : _this63.retry).then(accept)["catch"](reject);
|
|
9260
9357
|
});
|
|
9261
9358
|
}
|
|
9262
9359
|
}, {
|
|
@@ -9577,19 +9674,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9577
9674
|
}, {
|
|
9578
9675
|
key: "allMappedAttributes",
|
|
9579
9676
|
get: function get() {
|
|
9580
|
-
var
|
|
9677
|
+
var _this64 = this;
|
|
9581
9678
|
|
|
9582
9679
|
var map = new Map();
|
|
9583
9680
|
var coreAttr = this.coreAttributes;
|
|
9584
9681
|
var optAttr = this.optionalAttributes;
|
|
9585
9682
|
coreAttr.forEach(function (ele) {
|
|
9586
|
-
if (
|
|
9587
|
-
map.set(ele.map,
|
|
9683
|
+
if (_this64.hasAttribute(ele.key)) {
|
|
9684
|
+
map.set(ele.map, _this64.getAttribute(ele.key));
|
|
9588
9685
|
}
|
|
9589
9686
|
});
|
|
9590
9687
|
optAttr.forEach(function (ele) {
|
|
9591
|
-
if (
|
|
9592
|
-
map.set(ele.map,
|
|
9688
|
+
if (_this64.hasAttribute(ele.key)) {
|
|
9689
|
+
map.set(ele.map, _this64.getAttribute(ele.key));
|
|
9593
9690
|
}
|
|
9594
9691
|
});
|
|
9595
9692
|
return map;
|
|
@@ -9689,7 +9786,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9689
9786
|
|
|
9690
9787
|
var ElementController = /*#__PURE__*/function () {
|
|
9691
9788
|
function ElementController(element) {
|
|
9692
|
-
var
|
|
9789
|
+
var _this65 = this;
|
|
9693
9790
|
|
|
9694
9791
|
_classCallCheck(this, ElementController);
|
|
9695
9792
|
|
|
@@ -9705,7 +9802,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9705
9802
|
|
|
9706
9803
|
if (mutation.type === 'attributes' && element.usesCoreAttribute(mutation.attributeName)) {
|
|
9707
9804
|
if (element.hasAllCoreAttributes) {
|
|
9708
|
-
|
|
9805
|
+
_this65._load();
|
|
9709
9806
|
}
|
|
9710
9807
|
}
|
|
9711
9808
|
}
|
|
@@ -9805,7 +9902,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9805
9902
|
|
|
9806
9903
|
var IFrameController = /*#__PURE__*/function () {
|
|
9807
9904
|
function IFrameController(element, src, id) {
|
|
9808
|
-
var
|
|
9905
|
+
var _this66 = this;
|
|
9809
9906
|
|
|
9810
9907
|
var onelemload = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
9811
9908
|
|
|
@@ -9817,7 +9914,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9817
9914
|
if (!element.hasAttribute("sameorigin")) {
|
|
9818
9915
|
this._iframe.onload = function () {
|
|
9819
9916
|
if (onelemload) {
|
|
9820
|
-
onelemload(
|
|
9917
|
+
onelemload(_this66._iframe);
|
|
9821
9918
|
}
|
|
9822
9919
|
};
|
|
9823
9920
|
}
|
|
@@ -9958,15 +10055,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9958
10055
|
var _super76 = _createSuper(EWallElement);
|
|
9959
10056
|
|
|
9960
10057
|
function EWallElement() {
|
|
9961
|
-
var
|
|
10058
|
+
var _this67;
|
|
9962
10059
|
|
|
9963
10060
|
_classCallCheck(this, EWallElement);
|
|
9964
10061
|
|
|
9965
|
-
|
|
10062
|
+
_this67 = _super76.call(this);
|
|
9966
10063
|
var tag = document.createElement("script");
|
|
9967
10064
|
tag.src = "https://cdn.8thwall.com/web/iframe/iframe.js";
|
|
9968
10065
|
tag.defer = true;
|
|
9969
|
-
return
|
|
10066
|
+
return _this67;
|
|
9970
10067
|
}
|
|
9971
10068
|
|
|
9972
10069
|
_createClass(EWallElement, [{
|