@plattar/plattar-ar-adapter 1.155.1 → 1.155.2

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.
@@ -2201,28 +2201,101 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2201
2201
  return reject(new Error("ProductController.startQRCode() - minimum required attributes not set, use product-id as a minimum"));
2202
2202
  });
2203
2203
  }
2204
+ /**
2205
+ * Displays a QR Code that sends the user direct to AR
2206
+ * @param options
2207
+ * @returns
2208
+ */
2204
2209
  }, {
2205
- key: "startRenderer",
2206
- value: function startRenderer() {
2210
+ key: "startARQRCode",
2211
+ value: function startARQRCode(options) {
2207
2212
  var _this19 = this;
2208
2213
  return new Promise(function (accept, reject) {
2209
2214
  // remove the old renderer instance if any
2210
2215
  _this19.removeRenderer();
2216
+ var opt = options || _this19._GetDefaultQROptions();
2217
+ var viewer = document.createElement("plattar-qrcode");
2218
+ // required attributes with defaults for plattar-viewer node
2219
+ var width = _this19.getAttribute("width") || "500px";
2220
+ var height = _this19.getAttribute("height") || "500px";
2221
+ viewer.setAttribute("width", width);
2222
+ viewer.setAttribute("height", height);
2223
+ if (opt.color) {
2224
+ viewer.setAttribute("color", opt.color);
2225
+ }
2226
+ if (opt.margin) {
2227
+ viewer.setAttribute("margin", "" + opt.margin);
2228
+ }
2229
+ if (opt.qrType) {
2230
+ viewer.setAttribute("qr-type", opt.qrType);
2231
+ }
2232
+ viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false");
2233
+ var qrOptions = btoa(JSON.stringify(opt));
2234
+ var dst = plattar_api_1.Server.location().base + "renderer/launcher.html?qr_options=" + qrOptions;
2235
+ var sceneID = _this19.getAttribute("scene-id");
2236
+ var configState = _this19.getAttribute("config-state");
2237
+ var embedType = _this19.getAttribute("embed-type");
2211
2238
  var productID = _this19.getAttribute("product-id");
2239
+ var sceneProductID = _this19.getAttribute("scene-product-id");
2240
+ var variationID = _this19.getAttribute("variation-id");
2241
+ var variationSKU = _this19.getAttribute("variation-sku");
2242
+ var arMode = _this19.getAttribute("ar-mode");
2243
+ if (configState) {
2244
+ dst += "&config_state=" + configState;
2245
+ }
2246
+ if (embedType) {
2247
+ dst += "&embed_type=" + embedType;
2248
+ }
2249
+ if (productID) {
2250
+ dst += "&product_id=" + productID;
2251
+ }
2252
+ if (sceneProductID) {
2253
+ dst += "&scene_product_id=" + sceneProductID;
2254
+ }
2255
+ if (variationID) {
2256
+ dst += "&variation_id=" + variationID;
2257
+ }
2258
+ if (variationSKU) {
2259
+ dst += "&variation_sku=" + variationSKU;
2260
+ }
2261
+ if (arMode) {
2262
+ dst += "&ar_mode=" + arMode;
2263
+ }
2264
+ if (sceneID) {
2265
+ dst += "&scene_id=" + sceneID;
2266
+ }
2267
+ viewer.setAttribute("url", opt.url || dst);
2268
+ viewer.onload = function () {
2269
+ return accept(viewer);
2270
+ };
2271
+ _this19._element = viewer;
2272
+ _this19._state = plattar_controller_1.ControllerState.QRCode;
2273
+ _this19._prevQROpt = opt;
2274
+ _this19.append(viewer);
2275
+ });
2276
+ }
2277
+ }, {
2278
+ key: "startRenderer",
2279
+ value: function startRenderer() {
2280
+ var _this20 = this;
2281
+ return new Promise(function (accept, reject) {
2282
+ // remove the old renderer instance if any
2283
+ _this20.removeRenderer();
2284
+ var productID = _this20.getAttribute("product-id");
2212
2285
  if (productID) {
2213
2286
  // required attributes with defaults for plattar-product node
2214
- var width = _this19.getAttribute("width") || "500px";
2215
- var height = _this19.getAttribute("height") || "500px";
2216
- var server = _this19.getAttribute("server") || "production";
2287
+ var width = _this20.getAttribute("width") || "500px";
2288
+ var height = _this20.getAttribute("height") || "500px";
2289
+ var server = _this20.getAttribute("server") || "production";
2217
2290
  var viewer = document.createElement("plattar-product");
2218
2291
  viewer.setAttribute("width", width);
2219
2292
  viewer.setAttribute("height", height);
2220
2293
  viewer.setAttribute("server", server);
2221
2294
  viewer.setAttribute("product-id", productID);
2222
2295
  // optional attributes
2223
- var variationID = _this19.getAttribute("variation-id");
2224
- var variationSKU = _this19.getAttribute("variation-sku");
2225
- var showAR = _this19.getAttribute("show-ar");
2296
+ var variationID = _this20.getAttribute("variation-id");
2297
+ var variationSKU = _this20.getAttribute("variation-sku");
2298
+ var showAR = _this20.getAttribute("show-ar");
2226
2299
  if (variationID) {
2227
2300
  viewer.setAttribute("variation-id", variationID);
2228
2301
  }
@@ -2235,9 +2308,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2235
2308
  viewer.onload = function () {
2236
2309
  return accept(viewer);
2237
2310
  };
2238
- _this19.append(viewer);
2239
- _this19._element = viewer;
2240
- _this19._state = plattar_controller_1.ControllerState.Renderer;
2311
+ _this20.append(viewer);
2312
+ _this20._element = viewer;
2313
+ _this20._state = plattar_controller_1.ControllerState.Renderer;
2241
2314
  return;
2242
2315
  }
2243
2316
  return reject(new Error("ProductController.startRenderer() - minimum required attributes not set, use scene-id as a minimum"));
@@ -2246,15 +2319,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2246
2319
  }, {
2247
2320
  key: "initAR",
2248
2321
  value: function initAR() {
2249
- var _this20 = this;
2322
+ var _this21 = this;
2250
2323
  return new Promise(function (accept, reject) {
2251
2324
  if (!util_1.Util.canAugment()) {
2252
2325
  return reject(new Error("ProductController.initAR() - cannot proceed as AR not available in context"));
2253
2326
  }
2254
- var productID = _this20.getAttribute("product-id");
2327
+ var productID = _this21.getAttribute("product-id");
2255
2328
  if (productID) {
2256
- var variationID = _this20.getAttribute("variation-id");
2257
- var variationSKU = _this20.getAttribute("variation-sku");
2329
+ var variationID = _this21.getAttribute("variation-id");
2330
+ var variationSKU = _this21.getAttribute("variation-sku");
2258
2331
  var product = new product_ar_1.ProductAR(productID, variationID, variationSKU);
2259
2332
  return product.init().then(accept)["catch"](reject);
2260
2333
  }
@@ -2305,11 +2378,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2305
2378
  _inherits(VTOController, _plattar_controller_3);
2306
2379
  var _super9 = _createSuper(VTOController);
2307
2380
  function VTOController() {
2308
- var _this21;
2381
+ var _this22;
2309
2382
  _classCallCheck(this, VTOController);
2310
- _this21 = _super9.apply(this, arguments);
2311
- _this21._cachedConfigState = null;
2312
- return _this21;
2383
+ _this22 = _super9.apply(this, arguments);
2384
+ _this22._cachedConfigState = null;
2385
+ return _this22;
2313
2386
  }
2314
2387
  _createClass(VTOController, [{
2315
2388
  key: "getConfiguratorState",
@@ -2432,7 +2505,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2432
2505
  key: "startViewerQRCode",
2433
2506
  value: function () {
2434
2507
  var _startViewerQRCode2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(options) {
2435
- var _this22 = this;
2508
+ var _this23 = this;
2436
2509
  var sceneID, opt, viewer, width, height, dst, configState, showAR, productID, sceneProductID, variationID;
2437
2510
  return _regeneratorRuntime().wrap(function _callee19$(_context19) {
2438
2511
  while (1) switch (_context19.prev = _context19.next) {
@@ -2505,7 +2578,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2505
2578
  viewer.onload = function () {
2506
2579
  return accept(viewer);
2507
2580
  };
2508
- _this22.append(viewer);
2581
+ _this23.append(viewer);
2509
2582
  }));
2510
2583
  case 39:
2511
2584
  case "end":
@@ -2522,7 +2595,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2522
2595
  key: "startRenderer",
2523
2596
  value: function () {
2524
2597
  var _startRenderer2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
2525
- var _this23 = this;
2598
+ var _this24 = this;
2526
2599
  var sceneID, width, height, server, viewer, configState, showAR, productID, sceneProductID, variationID;
2527
2600
  return _regeneratorRuntime().wrap(function _callee20$(_context20) {
2528
2601
  while (1) switch (_context20.prev = _context20.next) {
@@ -2582,9 +2655,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2582
2655
  }
2583
2656
  this._state = plattar_controller_1.ControllerState.Renderer;
2584
2657
  return _context20.abrupt("return", new Promise(function (accept, reject) {
2585
- _this23.append(viewer);
2658
+ _this24.append(viewer);
2586
2659
  if (configState) {
2587
- _this23.setupMessengerObservers(viewer, configState);
2660
+ _this24.setupMessengerObservers(viewer, configState);
2588
2661
  }
2589
2662
  return accept(viewer);
2590
2663
  }));
@@ -2771,15 +2844,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2771
2844
  _inherits(PlattarEmbed, _HTMLElement);
2772
2845
  var _super10 = _createSuper(PlattarEmbed);
2773
2846
  function PlattarEmbed() {
2774
- var _this24;
2847
+ var _this25;
2775
2848
  _classCallCheck(this, PlattarEmbed);
2776
- _this24 = _super10.call(this);
2849
+ _this25 = _super10.call(this);
2777
2850
  // this is the current embed type, viewer by default
2778
- _this24._currentType = EmbedType.None;
2779
- _this24._controller = null;
2780
- _this24._currentSceneID = null;
2781
- _this24._observer = null;
2782
- return _this24;
2851
+ _this25._currentType = EmbedType.None;
2852
+ _this25._controller = null;
2853
+ _this25._currentSceneID = null;
2854
+ _this25._observer = null;
2855
+ return _this25;
2783
2856
  }
2784
2857
  _createClass(PlattarEmbed, [{
2785
2858
  key: "viewer",
@@ -2800,7 +2873,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2800
2873
  }, {
2801
2874
  key: "create",
2802
2875
  value: function create() {
2803
- var _this25 = this;
2876
+ var _this26 = this;
2804
2877
  // server cannot be changed once its set - defaults to production
2805
2878
  var server = this.hasAttribute("server") ? this.getAttribute("server") : "production";
2806
2879
  plattar_api_1.Server.create(plattar_api_1.Server.match(server || "production"));
@@ -2809,10 +2882,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2809
2882
  mutations.forEach(function (mutation) {
2810
2883
  if (mutation.type === "attributes") {
2811
2884
  var attributeName = mutation.attributeName ? mutation.attributeName : "none";
2812
- if (_this25._currentType !== EmbedType.Legacy) {
2813
- _this25._CreateEmbed(attributeName);
2885
+ if (_this26._currentType !== EmbedType.Legacy) {
2886
+ _this26._CreateEmbed(attributeName);
2814
2887
  } else {
2815
- _this25._OnAttributesUpdated(attributeName);
2888
+ _this26._OnAttributesUpdated(attributeName);
2816
2889
  }
2817
2890
  }
2818
2891
  });
@@ -2821,9 +2894,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2821
2894
  attributes: true
2822
2895
  });
2823
2896
  }
2824
- var sceneID = this.hasAttribute("scene-id") ? this.getAttribute("scene-id") : null;
2825
2897
  var productID = this.hasAttribute("product-id") ? this.getAttribute("product-id") : null;
2826
- if (!sceneID && productID) {
2898
+ if (productID) {
2827
2899
  this._currentType = EmbedType.Legacy;
2828
2900
  this._CreateLegacyEmbed();
2829
2901
  return;
@@ -2850,6 +2922,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2850
2922
  key: "_CreateLegacyEmbed",
2851
2923
  value: function _CreateLegacyEmbed() {
2852
2924
  this._controller = new product_controller_1.ProductController(this);
2925
+ var init = this.hasAttribute("init") ? this.getAttribute("init") : null;
2926
+ switch (init) {
2927
+ case "viewer":
2928
+ this.startViewer();
2929
+ break;
2930
+ case "qrcode":
2931
+ this.startQRCode();
2932
+ break;
2933
+ }
2853
2934
  }
2854
2935
  /**
2855
2936
  * creates the embed
@@ -3729,7 +3810,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3729
3810
  Object.defineProperty(exports, "__esModule", {
3730
3811
  value: true
3731
3812
  });
3732
- exports["default"] = "1.155.1";
3813
+ exports["default"] = "1.155.2";
3733
3814
  }, {}],
3734
3815
  17: [function (require, module, exports) {
3735
3816
  "use strict";
@@ -3760,13 +3841,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3760
3841
  _inherits(QuicklookViewer, _ar_viewer_1$default);
3761
3842
  var _super11 = _createSuper(QuicklookViewer);
3762
3843
  function QuicklookViewer() {
3763
- var _this26;
3844
+ var _this27;
3764
3845
  _classCallCheck(this, QuicklookViewer);
3765
- _this26 = _super11.call(this);
3766
- _this26.araction = null;
3767
- _this26.titleHTML = "&checkoutTitle=" + document.title + "&checkoutSubtitle=" + document.title;
3768
- _this26.arcallback = function () {};
3769
- return _this26;
3846
+ _this27 = _super11.call(this);
3847
+ _this27.araction = null;
3848
+ _this27.titleHTML = "&checkoutTitle=" + document.title + "&checkoutSubtitle=" + document.title;
3849
+ _this27.arcallback = function () {};
3850
+ return _this27;
3770
3851
  }
3771
3852
  _createClass(QuicklookViewer, [{
3772
3853
  key: "nodeType",
@@ -3781,7 +3862,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3781
3862
  }, {
3782
3863
  key: "start",
3783
3864
  value: function start() {
3784
- var _this27 = this;
3865
+ var _this28 = this;
3785
3866
  if (!this.modelUrl) {
3786
3867
  throw new Error("QuicklookViewer.start() - model url not set, use QuicklookViewer.modelUrl");
3787
3868
  }
@@ -3793,7 +3874,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3793
3874
  if (araction) {
3794
3875
  var handleQuicklook = function handleQuicklook(event) {
3795
3876
  if (event.data === "_apple_ar_quicklook_button_tapped") {
3796
- _this27.arcallback();
3877
+ _this28.arcallback();
3797
3878
  }
3798
3879
  document.body.removeChild(anchor);
3799
3880
  anchor.removeEventListener("message", handleQuicklook, false);
@@ -3879,14 +3960,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3879
3960
  _inherits(SceneViewer, _ar_viewer_1$default3);
3880
3961
  var _super13 = _createSuper(SceneViewer);
3881
3962
  function SceneViewer() {
3882
- var _this28;
3963
+ var _this29;
3883
3964
  _classCallCheck(this, SceneViewer);
3884
- _this28 = _super13.call(this);
3885
- _this28.araction = null;
3886
- _this28.isVertical = false;
3887
- _this28.titleHTML = "<b>" + document.title;
3888
- _this28.isVertical = false;
3889
- return _this28;
3965
+ _this29 = _super13.call(this);
3966
+ _this29.araction = null;
3967
+ _this29.isVertical = false;
3968
+ _this29.titleHTML = "<b>" + document.title;
3969
+ _this29.isVertical = false;
3970
+ return _this29;
3890
3971
  }
3891
3972
  _createClass(SceneViewer, [{
3892
3973
  key: "nodeType",
@@ -3983,16 +4064,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3983
4064
  */
3984
4065
  var Memory = /*#__PURE__*/function () {
3985
4066
  function Memory(messengerInstance) {
3986
- var _this29 = this;
4067
+ var _this30 = this;
3987
4068
  _classCallCheck(this, Memory);
3988
4069
  this._messenger = messengerInstance;
3989
4070
  this._tempMemory = new TemporaryMemory(messengerInstance);
3990
4071
  this._permMemory = new PermanentMemory(messengerInstance);
3991
4072
  this._messenger.self.__memory__set_temp_var = function (name, data) {
3992
- _this29._tempMemory[name] = data;
4073
+ _this30._tempMemory[name] = data;
3993
4074
  };
3994
4075
  this._messenger.self.__memory__set_perm_var = function (name, data) {
3995
- _this29._permMemory[name] = data;
4076
+ _this30._permMemory[name] = data;
3996
4077
  };
3997
4078
  }
3998
4079
  _createClass(Memory, [{
@@ -4439,17 +4520,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4439
4520
  }, {
4440
4521
  key: "exec",
4441
4522
  value: function exec() {
4442
- var _this30 = this;
4523
+ var _this31 = this;
4443
4524
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
4444
4525
  args[_key3] = arguments[_key3];
4445
4526
  }
4446
4527
  return new Promise(function (accept, reject) {
4447
- if (!_this30._value) {
4448
- return reject(new Error("WrappedLocalFunction.exec() function with name " + _this30._funcName + "() is not defined"));
4528
+ if (!_this31._value) {
4529
+ return reject(new Error("WrappedLocalFunction.exec() function with name " + _this31._funcName + "() is not defined"));
4449
4530
  }
4450
4531
  try {
4451
4532
  // otherwise execute the function
4452
- var rObject = _this30._execute.apply(_this30, args);
4533
+ var rObject = _this31._execute.apply(_this31, args);
4453
4534
 
4454
4535
  // we need to check if the returned object is a Promise, if so, handle it
4455
4536
  // differently. This can happen if the function wants to execute asyn
@@ -4515,7 +4596,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4515
4596
  _createClass(FunctionObserver, [{
4516
4597
  key: "subscribe",
4517
4598
  value: function subscribe(functionName, callback) {
4518
- var _this31 = this;
4599
+ var _this32 = this;
4519
4600
  if (!functionName || !Util.isFunction(callback)) {
4520
4601
  return function () {};
4521
4602
  }
@@ -4529,7 +4610,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4529
4610
  }
4530
4611
  list.push(callback);
4531
4612
  return function () {
4532
- return _this31.unsubscribe(functionName, callback);
4613
+ return _this32.unsubscribe(functionName, callback);
4533
4614
  };
4534
4615
  }
4535
4616
 
@@ -4596,7 +4677,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4596
4677
  */
4597
4678
  var GlobalEventHandler = /*#__PURE__*/function () {
4598
4679
  function GlobalEventHandler() {
4599
- var _this32 = this;
4680
+ var _this33 = this;
4600
4681
  _classCallCheck(this, GlobalEventHandler);
4601
4682
  this._eventListeners = {};
4602
4683
 
@@ -4616,11 +4697,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4616
4697
  // make sure the event is properly formatted
4617
4698
  if (jsonData && jsonData.event && jsonData.data) {
4618
4699
  // see if there are any listeners for this
4619
- if (_this32._eventListeners[jsonData.event]) {
4700
+ if (_this33._eventListeners[jsonData.event]) {
4620
4701
  var remoteInterface = new RemoteInterface(evt.source, evt.origin);
4621
4702
 
4622
4703
  // loop through and call all the event handlers
4623
- _this32._eventListeners[jsonData.event].forEach(function (callback) {
4704
+ _this33._eventListeners[jsonData.event].forEach(function (callback) {
4624
4705
  try {
4625
4706
  callback(remoteInterface, jsonData.data);
4626
4707
  } catch (e) {
@@ -4812,33 +4893,33 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4812
4893
  }, {
4813
4894
  key: "_registerListeners",
4814
4895
  value: function _registerListeners() {
4815
- var _this33 = this;
4896
+ var _this34 = this;
4816
4897
  GlobalEventHandler.instance().listen("__messenger__child_init", function (src, data) {
4817
4898
  var iframeID = src.id;
4818
4899
 
4819
4900
  // check reserved key list
4820
4901
  switch (iframeID) {
4821
4902
  case undefined:
4822
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID cannot be undefined");
4903
+ throw new Error("Messenger[" + _this34._id + "].setup() Component ID cannot be undefined");
4823
4904
  case "self":
4824
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
4905
+ throw new Error("Messenger[" + _this34._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
4825
4906
  case "parent":
4826
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
4907
+ throw new Error("Messenger[" + _this34._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
4827
4908
  case "id":
4828
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
4909
+ throw new Error("Messenger[" + _this34._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
4829
4910
  case "onload":
4830
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
4911
+ throw new Error("Messenger[" + _this34._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
4831
4912
  default:
4832
4913
  break;
4833
4914
  }
4834
4915
 
4835
4916
  // initialise the child iframe as a messenger pipe
4836
- _this33[iframeID] = new RemoteFunctionList(iframeID, _this33._functionObserver);
4837
- _this33[iframeID].setup(new RemoteInterface(src.source, src.origin));
4917
+ _this34[iframeID] = new RemoteFunctionList(iframeID, _this34._functionObserver);
4918
+ _this34[iframeID].setup(new RemoteInterface(src.source, src.origin));
4838
4919
 
4839
4920
  // add the interface to the broadcaster
4840
- _this33._broadcaster._push(iframeID);
4841
- var callbacks = _this33._callbacks;
4921
+ _this34._broadcaster._push(iframeID);
4922
+ var callbacks = _this34._callbacks;
4842
4923
 
4843
4924
  // we have registered callbacks, begin execution
4844
4925
  if (callbacks.has(iframeID)) {
@@ -4862,26 +4943,26 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4862
4943
  // check reserved key list
4863
4944
  switch (iframeID) {
4864
4945
  case undefined:
4865
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID cannot be undefined");
4946
+ throw new Error("Messenger[" + _this34._id + "].setup() Component ID cannot be undefined");
4866
4947
  case "self":
4867
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
4948
+ throw new Error("Messenger[" + _this34._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
4868
4949
  case "parent":
4869
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
4950
+ throw new Error("Messenger[" + _this34._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
4870
4951
  case "id":
4871
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
4952
+ throw new Error("Messenger[" + _this34._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
4872
4953
  case "onload":
4873
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
4954
+ throw new Error("Messenger[" + _this34._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
4874
4955
  default:
4875
4956
  break;
4876
4957
  }
4877
4958
 
4878
4959
  // initialise the child iframe as a messenger pipe
4879
- _this33[iframeID] = new RemoteFunctionList(iframeID, _this33._functionObserver);
4880
- _this33[iframeID].setup(new RemoteInterface(src.source, src.origin));
4960
+ _this34[iframeID] = new RemoteFunctionList(iframeID, _this34._functionObserver);
4961
+ _this34[iframeID].setup(new RemoteInterface(src.source, src.origin));
4881
4962
 
4882
4963
  // add the interface to the broadcaster
4883
- _this33._broadcaster._push(iframeID);
4884
- var callbacks = _this33._callbacks;
4964
+ _this34._broadcaster._push(iframeID);
4965
+ var callbacks = _this34._callbacks;
4885
4966
 
4886
4967
  // we have registered callbacks, begin execution
4887
4968
  if (callbacks.has(iframeID)) {
@@ -4900,9 +4981,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4900
4981
  });
4901
4982
  GlobalEventHandler.instance().listen("__messenger__parent_init", function (src, data) {
4902
4983
  var iframeID = "parent";
4903
- _this33[iframeID] = new RemoteFunctionList(iframeID, _this33._functionObserver);
4904
- _this33[iframeID].setup(new RemoteInterface(src.source, src.origin));
4905
- var callbacks = _this33._callbacks;
4984
+ _this34[iframeID] = new RemoteFunctionList(iframeID, _this34._functionObserver);
4985
+ _this34[iframeID].setup(new RemoteInterface(src.source, src.origin));
4986
+ var callbacks = _this34._callbacks;
4906
4987
 
4907
4988
  // we have registered callbacks, begin execution
4908
4989
  if (callbacks.has(iframeID)) {
@@ -4926,9 +5007,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4926
5007
  */
4927
5008
  GlobalEventHandler.instance().listen("__messenger__parent_init_inv", function (src, data) {
4928
5009
  var iframeID = "parent";
4929
- _this33[iframeID] = new RemoteFunctionList(iframeID, _this33._functionObserver);
4930
- _this33[iframeID].setup(new RemoteInterface(src.source, src.origin));
4931
- var callbacks = _this33._callbacks;
5010
+ _this34[iframeID] = new RemoteFunctionList(iframeID, _this34._functionObserver);
5011
+ _this34[iframeID].setup(new RemoteInterface(src.source, src.origin));
5012
+ var callbacks = _this34._callbacks;
4932
5013
 
4933
5014
  // we have registered callbacks, begin execution
4934
5015
  if (callbacks.has(iframeID)) {
@@ -5150,7 +5231,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5150
5231
  */
5151
5232
  var WrappedRemoteFunction = /*#__PURE__*/function () {
5152
5233
  function WrappedRemoteFunction(funcName, remoteInterface, functionObserver) {
5153
- var _this34 = this;
5234
+ var _this35 = this;
5154
5235
  _classCallCheck(this, WrappedRemoteFunction);
5155
5236
  this._funcName = funcName;
5156
5237
  this._remoteInterface = remoteInterface;
@@ -5162,24 +5243,24 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5162
5243
  var instanceID = data.instance_id;
5163
5244
 
5164
5245
  // the function name must match
5165
- if (data.function_name !== _this34._funcName) {
5246
+ if (data.function_name !== _this35._funcName) {
5166
5247
  return;
5167
5248
  }
5168
5249
 
5169
5250
  // the instance ID must be found, otherwise this is a rogue execution
5170
5251
  // that can be ignored (should not happen)
5171
- if (!_this34._callInstances[instanceID]) {
5252
+ if (!_this35._callInstances[instanceID]) {
5172
5253
  return;
5173
5254
  }
5174
- var promise = _this34._callInstances[instanceID];
5255
+ var promise = _this35._callInstances[instanceID];
5175
5256
 
5176
5257
  // remove the old instance
5177
- delete _this34._callInstances[instanceID];
5258
+ delete _this35._callInstances[instanceID];
5178
5259
 
5179
5260
  // perform the promise callbacks
5180
5261
  if (data.function_status === "success") {
5181
5262
  // execute the observers
5182
- _this34._functionObserver.call(_this34._funcName, {
5263
+ _this35._functionObserver.call(_this35._funcName, {
5183
5264
  type: "return",
5184
5265
  state: "success",
5185
5266
  data: data.function_args
@@ -5187,7 +5268,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5187
5268
  promise.accept(data.function_args);
5188
5269
  } else {
5189
5270
  // execute the observers
5190
- _this34._functionObserver.call(_this34._funcName, {
5271
+ _this35._functionObserver.call(_this35._funcName, {
5191
5272
  type: "return",
5192
5273
  state: "exception",
5193
5274
  data: new Error(data.function_args)
@@ -5203,7 +5284,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5203
5284
  _createClass(WrappedRemoteFunction, [{
5204
5285
  key: "exec",
5205
5286
  value: function exec() {
5206
- var _this35 = this;
5287
+ var _this36 = this;
5207
5288
  for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
5208
5289
  args[_key4] = arguments[_key4];
5209
5290
  }
@@ -5222,20 +5303,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5222
5303
  // to be executed later
5223
5304
  return new Promise(function (accept, reject) {
5224
5305
  // save this promise to be executed later
5225
- _this35._callInstances[instanceID] = {
5306
+ _this36._callInstances[instanceID] = {
5226
5307
  accept: accept,
5227
5308
  reject: reject
5228
5309
  };
5229
5310
 
5230
5311
  // execute this event in another context
5231
- _this35._remoteInterface.send("__messenger__exec_fnc", {
5312
+ _this36._remoteInterface.send("__messenger__exec_fnc", {
5232
5313
  instance_id: instanceID,
5233
- function_name: _this35._funcName,
5314
+ function_name: _this36._funcName,
5234
5315
  function_args: args
5235
5316
  });
5236
5317
 
5237
5318
  // execute the observers
5238
- _this35._functionObserver.call(_this35._funcName, {
5319
+ _this36._functionObserver.call(_this36._funcName, {
5239
5320
  type: "call",
5240
5321
  state: "success",
5241
5322
  data: args
@@ -5384,7 +5465,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5384
5465
  var google_analytics_1 = require("./google/google-analytics");
5385
5466
  var Analytics = /*#__PURE__*/function () {
5386
5467
  function Analytics(applicationID) {
5387
- var _this36 = this;
5468
+ var _this37 = this;
5388
5469
  _classCallCheck(this, Analytics);
5389
5470
  this._pageTime = null;
5390
5471
  this.origin = "production";
@@ -5398,17 +5479,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5398
5479
  this._ga = new google_analytics_1.GoogleAnalytics();
5399
5480
  this._handlePageHide = function () {
5400
5481
  if (document.visibilityState === "hidden") {
5401
- _this36._pageTime = new Date();
5402
- } else if (_this36._pageTime) {
5482
+ _this37._pageTime = new Date();
5483
+ } else if (_this37._pageTime) {
5403
5484
  var time2 = new Date();
5404
- var diff = time2.getTime() - _this36._pageTime.getTime();
5405
- var data = _this36.data;
5485
+ var diff = time2.getTime() - _this37._pageTime.getTime();
5486
+ var data = _this37.data;
5406
5487
  data.push("eventAction", "View Time");
5407
5488
  data.push("viewTime", diff);
5408
5489
  data.push("eventLabel", diff);
5409
- _this36.write();
5410
- _this36._pageTime = null;
5411
- document.removeEventListener("visibilitychange", _this36._handlePageHide, false);
5490
+ _this37.write();
5491
+ _this37._pageTime = null;
5492
+ document.removeEventListener("visibilitychange", _this37._handlePageHide, false);
5412
5493
  }
5413
5494
  };
5414
5495
  }
@@ -5420,18 +5501,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5420
5501
  }, {
5421
5502
  key: "query",
5422
5503
  value: function query() {
5423
- var _this37 = this;
5504
+ var _this38 = this;
5424
5505
  var _query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5425
5506
  return new Promise(function (accept, reject) {
5426
5507
  if (!_query) {
5427
5508
  return reject(new Error("Analytics.query() - provided query was null"));
5428
5509
  }
5429
- var url = _this37.origin === "dev" ? "https://localhost:3008/v3/read" : "https://analytics.plattar.com/v3/read";
5510
+ var url = _this38.origin === "dev" ? "https://localhost:3008/v3/read" : "https://analytics.plattar.com/v3/read";
5430
5511
  var data = {
5431
5512
  data: {
5432
5513
  attributes: {
5433
- application_id: _this37._applicationID,
5434
- event: _this37.event,
5514
+ application_id: _this38._applicationID,
5515
+ event: _this38.event,
5435
5516
  query: _query
5436
5517
  }
5437
5518
  }
@@ -5444,22 +5525,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5444
5525
  }, {
5445
5526
  key: "write",
5446
5527
  value: function write() {
5447
- var _this38 = this;
5528
+ var _this39 = this;
5448
5529
  return new Promise(function (accept, reject) {
5449
- var data = _this38._data;
5450
- var url = _this38.origin === "dev" ? "https://localhost:3008/v3/write" : "https://analytics.plattar.com/v3/write";
5451
- data.push("applicationId", _this38._applicationID);
5530
+ var data = _this39._data;
5531
+ var url = _this39.origin === "dev" ? "https://localhost:3008/v3/write" : "https://analytics.plattar.com/v3/write";
5532
+ data.push("applicationId", _this39._applicationID);
5452
5533
  var sendData = {
5453
5534
  data: {
5454
5535
  attributes: {
5455
- application_id: _this38._applicationID,
5456
- event: _this38.event,
5457
- origin: _this38.origin,
5536
+ application_id: _this39._applicationID,
5537
+ event: _this39.event,
5538
+ origin: _this39.origin,
5458
5539
  fields: data.data
5459
5540
  }
5460
5541
  }
5461
5542
  };
5462
- if (_this38.isBeacon === false) {
5543
+ if (_this39.isBeacon === false) {
5463
5544
  basic_http_1["default"].exec("POST", url, sendData).then(function (result) {
5464
5545
  accept(result ? result : {});
5465
5546
  })["catch"](reject);
@@ -5468,7 +5549,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5468
5549
  accept(result ? result : {});
5469
5550
  })["catch"](reject);
5470
5551
  }
5471
- _this38.googleAnalytics.write(_this38.event, _this38.data);
5552
+ _this39.googleAnalytics.write(_this39.event, _this39.data);
5472
5553
  });
5473
5554
  }
5474
5555
  }, {
@@ -6020,10 +6101,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6020
6101
  }, {
6021
6102
  key: "_get",
6022
6103
  value: function _get(opt) {
6023
- var _this39 = this;
6104
+ var _this40 = this;
6024
6105
  return new Promise(function (resolve, reject) {
6025
- var target = _this39.target;
6026
- var server = _this39.server;
6106
+ var target = _this40.target;
6107
+ var server = _this40.server;
6027
6108
 
6028
6109
  // we cannot perform a GET request without an ID
6029
6110
  if (!target.id) {
@@ -6048,15 +6129,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6048
6129
  var origin = server.originLocation.api_read;
6049
6130
  var auth = server.authToken;
6050
6131
  var headers = {
6051
- 'cookie': 'laravel_session=' + _this39.getCookie('laravel_session')
6132
+ 'cookie': 'laravel_session=' + _this40.getCookie('laravel_session')
6052
6133
  };
6053
6134
  Object.assign(headers, auth);
6054
6135
  var reqopts = {
6055
6136
  method: "GET",
6056
6137
  headers: headers
6057
6138
  };
6058
- var includeQuery = _this39._IncludeQuery;
6059
- var params = _this39._ParamFor("get");
6139
+ var includeQuery = _this40._IncludeQuery;
6140
+ var params = _this40._ParamFor("get");
6060
6141
  var endpoint = origin + target.type() + "/" + target.id;
6061
6142
  if (includeQuery) {
6062
6143
  endpoint = endpoint + "?include=" + includeQuery;
@@ -6091,10 +6172,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6091
6172
  }, {
6092
6173
  key: "_update",
6093
6174
  value: function _update() {
6094
- var _this40 = this;
6175
+ var _this41 = this;
6095
6176
  return new Promise(function (resolve, reject) {
6096
- var target = _this40.target;
6097
- var server = _this40.server;
6177
+ var target = _this41.target;
6178
+ var server = _this41.server;
6098
6179
 
6099
6180
  // we cannot perform a GET request without an ID
6100
6181
  if (!target.id) {
@@ -6108,7 +6189,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6108
6189
  var headers = {
6109
6190
  'Accept': 'application/json',
6110
6191
  'Content-Type': 'application/json',
6111
- 'cookie': 'laravel_session=' + _this40.getCookie('laravel_session')
6192
+ 'cookie': 'laravel_session=' + _this41.getCookie('laravel_session')
6112
6193
  };
6113
6194
  Object.assign(headers, auth);
6114
6195
  var reqopts = {
@@ -6122,7 +6203,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6122
6203
  meta: target.meta || {}
6123
6204
  })
6124
6205
  };
6125
- var params = _this40._ParamFor("update");
6206
+ var params = _this41._ParamFor("update");
6126
6207
  var endpoint = origin + target.type() + "/" + target.id;
6127
6208
  if (params) {
6128
6209
  var appender = "?";
@@ -6158,10 +6239,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6158
6239
  }, {
6159
6240
  key: "_create",
6160
6241
  value: function _create() {
6161
- var _this41 = this;
6242
+ var _this42 = this;
6162
6243
  return new Promise(function (resolve, reject) {
6163
- var target = _this41.target;
6164
- var server = _this41.server;
6244
+ var target = _this42.target;
6245
+ var server = _this42.server;
6165
6246
 
6166
6247
  // otherwise, proceed with the fetching op
6167
6248
  var origin = server.originLocation.api_write;
@@ -6169,7 +6250,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6169
6250
  var headers = {
6170
6251
  'Accept': 'application/json',
6171
6252
  'Content-Type': 'application/json',
6172
- 'cookie': 'laravel_session=' + _this41.getCookie('laravel_session')
6253
+ 'cookie': 'laravel_session=' + _this42.getCookie('laravel_session')
6173
6254
  };
6174
6255
  Object.assign(headers, auth);
6175
6256
  var reqopts = {
@@ -6182,7 +6263,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6182
6263
  meta: target.meta || {}
6183
6264
  })
6184
6265
  };
6185
- var params = _this41._ParamFor("create");
6266
+ var params = _this42._ParamFor("create");
6186
6267
  var endpoint = origin + target.type();
6187
6268
  if (params) {
6188
6269
  var appender = "?";
@@ -6219,10 +6300,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6219
6300
  }, {
6220
6301
  key: "_delete",
6221
6302
  value: function _delete() {
6222
- var _this42 = this;
6303
+ var _this43 = this;
6223
6304
  return new Promise(function (resolve, reject) {
6224
- var target = _this42.target;
6225
- var server = _this42.server;
6305
+ var target = _this43.target;
6306
+ var server = _this43.server;
6226
6307
 
6227
6308
  // we cannot perform a GET request without an ID
6228
6309
  if (!target.id) {
@@ -6236,7 +6317,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6236
6317
  var headers = {
6237
6318
  'Accept': 'application/json',
6238
6319
  'Content-Type': 'application/json',
6239
- 'cookie': 'laravel_session=' + _this42.getCookie('laravel_session')
6320
+ 'cookie': 'laravel_session=' + _this43.getCookie('laravel_session')
6240
6321
  };
6241
6322
  Object.assign(headers, auth);
6242
6323
  var reqopts = {
@@ -6250,7 +6331,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6250
6331
  meta: target.meta || {}
6251
6332
  })
6252
6333
  };
6253
- var params = _this42._ParamFor("delete");
6334
+ var params = _this43._ParamFor("delete");
6254
6335
  var endpoint = origin + target.type() + "/" + target.id;
6255
6336
  if (params) {
6256
6337
  var appender = "?";
@@ -6305,7 +6386,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6305
6386
  }, {
6306
6387
  key: "_include",
6307
6388
  value: function _include(args) {
6308
- var _this43 = this;
6389
+ var _this44 = this;
6309
6390
  if (!args || args.length <= 0) {
6310
6391
  return this;
6311
6392
  }
@@ -6315,20 +6396,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6315
6396
  if (Array.isArray(obj)) {
6316
6397
  obj.forEach(function (strObject) {
6317
6398
  if (typeof strObject === "string" || strObject instanceof String) {
6318
- _this43._getIncludeQuery.push(strObject);
6399
+ _this44._getIncludeQuery.push(strObject);
6319
6400
  } else {
6320
- throw new Error("PlattarQuery." + _this43.target.type() + ".include(...args) - argument of Array must only include Strings");
6401
+ throw new Error("PlattarQuery." + _this44.target.type() + ".include(...args) - argument of Array must only include Strings");
6321
6402
  }
6322
6403
  });
6323
6404
  } else if (PlattarUtil.isPlattarObject(obj)) {
6324
6405
  var type = obj.type();
6325
6406
  if (Array.isArray(type)) {
6326
- _this43._include(type);
6407
+ _this44._include(type);
6327
6408
  } else {
6328
- _this43._getIncludeQuery.push(type);
6409
+ _this44._getIncludeQuery.push(type);
6329
6410
  }
6330
6411
  } else {
6331
- throw new Error("PlattarQuery." + _this43.target.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
6412
+ throw new Error("PlattarQuery." + _this44.target.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
6332
6413
  }
6333
6414
  });
6334
6415
  return this;
@@ -6463,12 +6544,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6463
6544
  }, {
6464
6545
  key: "auth",
6465
6546
  value: function auth(token, opt) {
6466
- var _this44 = this;
6547
+ var _this45 = this;
6467
6548
  var copt = opt || {
6468
6549
  validate: false
6469
6550
  };
6470
6551
  return new Promise(function (resolve, reject) {
6471
- var server = _this44.originLocation.api_write;
6552
+ var server = _this45.originLocation.api_write;
6472
6553
  if (!server) {
6473
6554
  reject(new Error("Plattar.auth(token) - cannot authenticate as server not set via Plattar.origin(server)"));
6474
6555
  return;
@@ -6478,10 +6559,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6478
6559
  return;
6479
6560
  }
6480
6561
  if (!copt.validate) {
6481
- _this44._authToken = {
6562
+ _this45._authToken = {
6482
6563
  "plattar-auth-token": token
6483
6564
  };
6484
- resolve(_this44);
6565
+ resolve(_this45);
6485
6566
  return;
6486
6567
  }
6487
6568
  var endpoint = server + "plattaruser/xauth/validate";
@@ -6493,10 +6574,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6493
6574
  };
6494
6575
  fetch(endpoint, options).then(function (res) {
6495
6576
  if (res.ok) {
6496
- _this44._authToken = {
6577
+ _this45._authToken = {
6497
6578
  "plattar-auth-token": token
6498
6579
  };
6499
- resolve(_this44);
6580
+ resolve(_this45);
6500
6581
  } else {
6501
6582
  reject(new Error("Plattar.auth(token) - failed to validate authentication token at " + endpoint));
6502
6583
  }
@@ -6506,7 +6587,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6506
6587
  }, {
6507
6588
  key: "origin",
6508
6589
  value: function origin(server, opt) {
6509
- var _this45 = this;
6590
+ var _this46 = this;
6510
6591
  var copt = opt || {
6511
6592
  validate: false
6512
6593
  };
@@ -6516,8 +6597,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6516
6597
  return;
6517
6598
  }
6518
6599
  if (!copt.validate) {
6519
- _this45._serverLocation = server;
6520
- resolve(_this45);
6600
+ _this46._serverLocation = server;
6601
+ resolve(_this46);
6521
6602
  return;
6522
6603
  }
6523
6604
  var endpoint = server.api_read + "ping";
@@ -6526,8 +6607,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6526
6607
  };
6527
6608
  fetch(endpoint, options).then(function (res) {
6528
6609
  if (res.ok) {
6529
- _this45._serverLocation = server;
6530
- resolve(_this45);
6610
+ _this46._serverLocation = server;
6611
+ resolve(_this46);
6531
6612
  } else {
6532
6613
  reject(new Error("Plattar.origin(server) - failed to ping server at " + endpoint));
6533
6614
  }
@@ -6861,13 +6942,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6861
6942
  _inherits(FileBase, _PlattarBase11);
6862
6943
  var _super25 = _createSuper(FileBase);
6863
6944
  function FileBase(id, server) {
6864
- var _this46;
6945
+ var _this47;
6865
6946
  _classCallCheck(this, FileBase);
6866
- _this46 = _super25.call(this, id, server || Server["default"]());
6867
- if (_this46.constructor === FileBase) {
6947
+ _this47 = _super25.call(this, id, server || Server["default"]());
6948
+ if (_this47.constructor === FileBase) {
6868
6949
  throw new Error("FileBase is abstract and cannot be created");
6869
6950
  }
6870
- return _this46;
6951
+ return _this47;
6871
6952
  }
6872
6953
  _createClass(FileBase, [{
6873
6954
  key: "sourcePath",
@@ -7020,13 +7101,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7020
7101
  _inherits(PlattarBase, _PlattarObject);
7021
7102
  var _super30 = _createSuper(PlattarBase);
7022
7103
  function PlattarBase(id, server) {
7023
- var _this47;
7104
+ var _this48;
7024
7105
  _classCallCheck(this, PlattarBase);
7025
- _this47 = _super30.call(this, id, server || Server["default"]());
7026
- if (_this47.constructor === PlattarBase) {
7106
+ _this48 = _super30.call(this, id, server || Server["default"]());
7107
+ if (_this48.constructor === PlattarBase) {
7027
7108
  throw new Error("PlattarBase is abstract and cannot be created");
7028
7109
  }
7029
- return _this47;
7110
+ return _this48;
7030
7111
  }
7031
7112
  return _createClass(PlattarBase);
7032
7113
  }(PlattarObject);
@@ -7093,7 +7174,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7093
7174
  }, {
7094
7175
  key: "filter",
7095
7176
  value: function filter(obj, id) {
7096
- var _this48 = this;
7177
+ var _this49 = this;
7097
7178
  if (!obj) {
7098
7179
  return [];
7099
7180
  }
@@ -7109,7 +7190,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7109
7190
  if (Array.isArray(type)) {
7110
7191
  var compiledList = [];
7111
7192
  type.forEach(function (inObject) {
7112
- var retArray = _this48.filter(inObject, id);
7193
+ var retArray = _this49.filter(inObject, id);
7113
7194
  if (retArray.length > 0) {
7114
7195
  compiledList = compiledList.concat(retArray);
7115
7196
  }
@@ -7297,7 +7378,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7297
7378
  }, {
7298
7379
  key: "include",
7299
7380
  value: function include() {
7300
- var _this49 = this;
7381
+ var _this50 = this;
7301
7382
  for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
7302
7383
  args[_key6] = arguments[_key6];
7303
7384
  }
@@ -7310,15 +7391,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7310
7391
  if (Array.isArray(obj)) {
7311
7392
  obj.forEach(function (strObject) {
7312
7393
  if (typeof strObject === "string" || strObject instanceof String) {
7313
- includes.push("".concat(_this49.type(), ".").concat(strObject));
7394
+ includes.push("".concat(_this50.type(), ".").concat(strObject));
7314
7395
  } else {
7315
- throw new Error("PlattarObject." + _this49.type() + ".include(...args) - argument of Array must only include Strings");
7396
+ throw new Error("PlattarObject." + _this50.type() + ".include(...args) - argument of Array must only include Strings");
7316
7397
  }
7317
7398
  });
7318
7399
  } else if (obj.prototype instanceof PlattarObject) {
7319
- includes.push("".concat(_this49.type(), ".").concat(obj.type()));
7400
+ includes.push("".concat(_this50.type(), ".").concat(obj.type()));
7320
7401
  } else {
7321
- throw new Error("PlattarObject." + _this49.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
7402
+ throw new Error("PlattarObject." + _this50.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
7322
7403
  }
7323
7404
  });
7324
7405
  return includes;
@@ -7448,13 +7529,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7448
7529
  _inherits(CardBase, _PlattarBase17);
7449
7530
  var _super36 = _createSuper(CardBase);
7450
7531
  function CardBase(id, server) {
7451
- var _this50;
7532
+ var _this51;
7452
7533
  _classCallCheck(this, CardBase);
7453
- _this50 = _super36.call(this, id, server || Server["default"]());
7454
- if (_this50.constructor === CardBase) {
7534
+ _this51 = _super36.call(this, id, server || Server["default"]());
7535
+ if (_this51.constructor === CardBase) {
7455
7536
  throw new Error("CardBase is abstract and cannot be created");
7456
7537
  }
7457
- return _this50;
7538
+ return _this51;
7458
7539
  }
7459
7540
  _createClass(CardBase, null, [{
7460
7541
  key: "type",
@@ -7771,13 +7852,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7771
7852
  _inherits(ProductBase, _PlattarBase19);
7772
7853
  var _super50 = _createSuper(ProductBase);
7773
7854
  function ProductBase(id, server) {
7774
- var _this51;
7855
+ var _this52;
7775
7856
  _classCallCheck(this, ProductBase);
7776
- _this51 = _super50.call(this, id, server || Server["default"]());
7777
- if (_this51.constructor === ProductBase) {
7857
+ _this52 = _super50.call(this, id, server || Server["default"]());
7858
+ if (_this52.constructor === ProductBase) {
7778
7859
  throw new Error("ProductBase is abstract and cannot be created");
7779
7860
  }
7780
- return _this51;
7861
+ return _this52;
7781
7862
  }
7782
7863
  _createClass(ProductBase, null, [{
7783
7864
  key: "type",
@@ -7887,13 +7968,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7887
7968
  _inherits(SceneBase, _PlattarBase21);
7888
7969
  var _super55 = _createSuper(SceneBase);
7889
7970
  function SceneBase(id, server) {
7890
- var _this52;
7971
+ var _this53;
7891
7972
  _classCallCheck(this, SceneBase);
7892
- _this52 = _super55.call(this, id, server || Server["default"]());
7893
- if (_this52.constructor === SceneBase) {
7973
+ _this53 = _super55.call(this, id, server || Server["default"]());
7974
+ if (_this53.constructor === SceneBase) {
7894
7975
  throw new Error("SceneBase is abstract and cannot be created");
7895
7976
  }
7896
- return _this52;
7977
+ return _this53;
7897
7978
  }
7898
7979
  _createClass(SceneBase, null, [{
7899
7980
  key: "type",
@@ -8596,15 +8677,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
8596
8677
  _createClass(BaseElement, [{
8597
8678
  key: "connectedCallback",
8598
8679
  value: function connectedCallback() {
8599
- var _this53 = this;
8680
+ var _this54 = this;
8600
8681
  if (this.hasAttribute("url")) {
8601
8682
  this.renderQRCode();
8602
8683
  }
8603
8684
  var observer = new MutationObserver(function (mutations) {
8604
8685
  mutations.forEach(function (mutation) {
8605
8686
  if (mutation.type === "attributes") {
8606
- if (_this53.hasAttribute("url")) {
8607
- _this53.renderQRCode();
8687
+ if (_this54.hasAttribute("url")) {
8688
+ _this54.renderQRCode();
8608
8689
  }
8609
8690
  }
8610
8691
  });
@@ -8627,7 +8708,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
8627
8708
  }, {
8628
8709
  key: "renderQRCode",
8629
8710
  value: function renderQRCode() {
8630
- var _this54 = this;
8711
+ var _this55 = this;
8631
8712
  var url = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
8632
8713
  if (!url) {
8633
8714
  console.warn("PlattarQR.renderQRCode() - required attribute \"url\" is missing or invalid, QR Code will not render");
@@ -8735,11 +8816,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
8735
8816
  var shortenURL = this.hasAttribute("shorten") ? this.getAttribute("shorten") : "false";
8736
8817
  if (shortenURL && shortenURL.toLowerCase() === "true") {
8737
8818
  this._ShortenURL(url).then(function (newURL) {
8738
- _this54._GenerateQRCode(newURL, width, height);
8819
+ _this55._GenerateQRCode(newURL, width, height);
8739
8820
  })["catch"](function (_err) {
8740
8821
  console.warn(_err);
8741
8822
  // ignore error and just generate normal QR Code
8742
- _this54._GenerateQRCode(url, width, height);
8823
+ _this55._GenerateQRCode(url, width, height);
8743
8824
  });
8744
8825
  } else {
8745
8826
  this._GenerateQRCode(url, width, height);
@@ -8808,9 +8889,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
8808
8889
  }, {
8809
8890
  key: "_ShortenURL",
8810
8891
  value: function _ShortenURL(url) {
8811
- var _this55 = this;
8892
+ var _this56 = this;
8812
8893
  return new Promise(function (accept, reject) {
8813
- if (!_this55._IsFetchAPISupported()) {
8894
+ if (!_this56._IsFetchAPISupported()) {
8814
8895
  return reject(new Error("PlattarQR._ShortenURL() - fetch api not supported, cannot proceed"));
8815
8896
  }
8816
8897
  try {
@@ -9003,10 +9084,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
9003
9084
  }, {
9004
9085
  key: "get",
9005
9086
  value: function get() {
9006
- var _this56 = this;
9087
+ var _this57 = this;
9007
9088
  return new Promise(function (accept, reject) {
9008
- _this56._CalculateHash().then(function () {
9009
- remote_request_1.RemoteRequest.request(_this56._GetPayload(), _this56.retry < 0 ? 0 : _this56.retry).then(accept)["catch"](reject);
9089
+ _this57._CalculateHash().then(function () {
9090
+ remote_request_1.RemoteRequest.request(_this57._GetPayload(), _this57.retry < 0 ? 0 : _this57.retry).then(accept)["catch"](reject);
9010
9091
  })["catch"](function (_err) {
9011
9092
  reject(new Error("Configurator.get() - one of the objects does not exist in Plattar API"));
9012
9093
  });
@@ -9015,12 +9096,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
9015
9096
  }, {
9016
9097
  key: "_CalculateHash",
9017
9098
  value: function _CalculateHash() {
9018
- var _this57 = this;
9099
+ var _this58 = this;
9019
9100
  return new Promise(function (accept, reject) {
9020
9101
  var promises = [];
9021
9102
  var oldOrigin = plattar_api_1.Server["default"]().originLocation.type;
9022
- plattar_api_1.Server.create(plattar_api_1.Server.match(_this57.server));
9023
- _this57._maps.forEach(function (map) {
9103
+ plattar_api_1.Server.create(plattar_api_1.Server.match(_this58.server));
9104
+ _this58._maps.forEach(function (map) {
9024
9105
  if (map.productvariation) {
9025
9106
  promises.push(new plattar_api_1.ProductVariation(map.productvariation).get());
9026
9107
  }
@@ -9036,7 +9117,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
9036
9117
  });
9037
9118
  Promise.all(promises).then(function (values) {
9038
9119
  values.forEach(function (value) {
9039
- _this57._attrHash.push(value.attributes);
9120
+ _this58._attrHash.push(value.attributes);
9040
9121
  });
9041
9122
  // reset server back
9042
9123
  plattar_api_1.Server.create(plattar_api_1.Server.match(oldOrigin));
@@ -9123,12 +9204,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
9123
9204
  }, {
9124
9205
  key: "get",
9125
9206
  value: function get() {
9126
- var _this58 = this;
9207
+ var _this59 = this;
9127
9208
  return new Promise(function (accept, reject) {
9128
- if (!_this58._model) {
9209
+ if (!_this59._model) {
9129
9210
  return reject(new Error("ModelConverter.get() - required .model attribute was not set"));
9130
9211
  }
9131
- remote_request_1.RemoteRequest.request(_this58._Payload, _this58.retry < 0 ? 0 : _this58.retry).then(accept)["catch"](reject);
9212
+ remote_request_1.RemoteRequest.request(_this59._Payload, _this59.retry < 0 ? 0 : _this59.retry).then(accept)["catch"](reject);
9132
9213
  });
9133
9214
  }
9134
9215
  }, {
@@ -10493,18 +10574,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10493
10574
  }, {
10494
10575
  key: "allMappedAttributes",
10495
10576
  get: function get() {
10496
- var _this59 = this;
10577
+ var _this60 = this;
10497
10578
  var map = new Map();
10498
10579
  var coreAttr = this.coreAttributes;
10499
10580
  var optAttr = this.optionalAttributes;
10500
10581
  coreAttr.forEach(function (ele) {
10501
- if (_this59.hasAttribute(ele.key)) {
10502
- map.set(ele.map, _this59.getAttribute(ele.key));
10582
+ if (_this60.hasAttribute(ele.key)) {
10583
+ map.set(ele.map, _this60.getAttribute(ele.key));
10503
10584
  }
10504
10585
  });
10505
10586
  optAttr.forEach(function (ele) {
10506
- if (_this59.hasAttribute(ele.key)) {
10507
- map.set(ele.map, _this59.getAttribute(ele.key));
10587
+ if (_this60.hasAttribute(ele.key)) {
10588
+ map.set(ele.map, _this60.getAttribute(ele.key));
10508
10589
  }
10509
10590
  });
10510
10591
  return map;
@@ -10604,7 +10685,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10604
10685
  var IFrameController = require("./iframe-controller.js");
10605
10686
  var ElementController = /*#__PURE__*/function () {
10606
10687
  function ElementController(element) {
10607
- var _this60 = this;
10688
+ var _this61 = this;
10608
10689
  _classCallCheck(this, ElementController);
10609
10690
  this._element = element;
10610
10691
 
@@ -10617,7 +10698,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10617
10698
  var mutation = _step8.value;
10618
10699
  if (mutation.type === 'attributes' && element.usesAttribute(mutation.attributeName)) {
10619
10700
  if (element.hasAllCoreAttributes) {
10620
- _this60._load();
10701
+ _this61._load();
10621
10702
  }
10622
10703
  }
10623
10704
  }
@@ -10712,7 +10793,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10712
10793
  var Util = require("../../util/util.js");
10713
10794
  var IFrameController = /*#__PURE__*/function () {
10714
10795
  function IFrameController(element, src, id) {
10715
- var _this61 = this;
10796
+ var _this62 = this;
10716
10797
  var onelemload = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
10717
10798
  _classCallCheck(this, IFrameController);
10718
10799
  this._iframe = document.createElement("iframe");
@@ -10722,7 +10803,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10722
10803
  if (!element.hasAttribute("sameorigin")) {
10723
10804
  this._iframe.onload = function () {
10724
10805
  if (onelemload) {
10725
- onelemload(_this61._iframe);
10806
+ onelemload(_this62._iframe);
10726
10807
  }
10727
10808
  };
10728
10809
  }
@@ -10839,13 +10920,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10839
10920
  _inherits(EWallElement, _BaseElement4);
10840
10921
  var _super76 = _createSuper(EWallElement);
10841
10922
  function EWallElement() {
10842
- var _this62;
10923
+ var _this63;
10843
10924
  _classCallCheck(this, EWallElement);
10844
- _this62 = _super76.call(this);
10925
+ _this63 = _super76.call(this);
10845
10926
  var tag = document.createElement("script");
10846
10927
  tag.src = "https://cdn.8thwall.com/web/iframe/iframe.js";
10847
10928
  tag.defer = true;
10848
- return _this62;
10929
+ return _this63;
10849
10930
  }
10850
10931
  _createClass(EWallElement, [{
10851
10932
  key: "connectedCallback",