@subiz/widget-v4 4.1.39 → 4.1.40

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.
Files changed (45) hide show
  1. package/compiled_src/chatbox/Typing.js +2 -2
  2. package/compiled_src/popup/popup.js +4 -0
  3. package/compiled_src/util/campaign.js +6 -2
  4. package/compiled_src/util/common.js +6 -2
  5. package/compiled_src/util/order.js +4 -2
  6. package/compiled_src/util/pubsub.js +6 -3
  7. package/dist/132.js +524 -524
  8. package/dist/18a02a9c54e.132.js +1 -0
  9. package/dist/18a02a9c54e.213.js +1 -0
  10. package/dist/18a02a9c54e.335.js +1 -0
  11. package/dist/18a02a9c54e.441.js +1 -0
  12. package/dist/18a02a9c54e.605.js +1 -0
  13. package/dist/18a02a9c54e.app.js +1 -0
  14. package/dist/{18a02605dff.index.html → 18a02a9c54e.index.html} +1 -1
  15. package/dist/{18a02605dff.library.html → 18a02a9c54e.library.html} +1 -1
  16. package/dist/18a02a9c54e.library.js +1 -0
  17. package/dist/{18a02605dff.preview.html → 18a02a9c54e.preview.html} +1 -1
  18. package/dist/18a02a9c54e.preview.js +1 -0
  19. package/dist/18a02a9c54e.screenshoot.js +1 -0
  20. package/dist/18a02a9c54e.webview.js +1 -0
  21. package/dist/213.js +98 -98
  22. package/dist/335.js +25 -25
  23. package/dist/441.js +1484 -886
  24. package/dist/605.js +50 -50
  25. package/dist/HASH +1 -1
  26. package/dist/screenshoot.html +1 -1
  27. package/dist/screenshoot.js +409 -393
  28. package/index.html +3 -3
  29. package/package.json +1 -1
  30. package/src/chatbox/Typing.js +2 -3
  31. package/src/popup/popup.js +4 -0
  32. package/dist/18a02605dff.132.js +0 -1
  33. package/dist/18a02605dff.213.js +0 -1
  34. package/dist/18a02605dff.335.js +0 -1
  35. package/dist/18a02605dff.441.js +0 -1
  36. package/dist/18a02605dff.605.js +0 -1
  37. package/dist/18a02605dff.app.js +0 -1
  38. package/dist/18a02605dff.library.js +0 -1
  39. package/dist/18a02605dff.preview.js +0 -1
  40. package/dist/18a02605dff.screenshoot.js +0 -1
  41. package/dist/18a02605dff.webview.js +0 -1
  42. /package/dist/{18a02605dff.178.js → 18a02a9c54e.178.js} +0 -0
  43. /package/dist/{18a02605dff.362.js → 18a02a9c54e.362.js} +0 -0
  44. /package/dist/{18a02605dff.678.js → 18a02a9c54e.678.js} +0 -0
  45. /package/dist/{18a02605dff.782.js → 18a02a9c54e.782.js} +0 -0
package/dist/213.js CHANGED
@@ -1054,7 +1054,7 @@ let obj = function () {
1054
1054
  };
1055
1055
  var clone = function clone(obj) {
1056
1056
  if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) {
1057
- return util/* default */.Z.parseJSON(util/* default */.Z.stringify(obj));
1057
+ return util/* default.parseJSON */.Z.parseJSON(util/* default.stringify */.Z.stringify(obj));
1058
1058
  }
1059
1059
  return obj;
1060
1060
  };
@@ -1367,7 +1367,7 @@ class Countdown extends common/* Com */.up {
1367
1367
  _defineProperty(this, "state", {
1368
1368
  flipKey: '43'
1369
1369
  });
1370
- this.timer = util/* default */.Z.setInterval(() => {
1370
+ this.timer = util/* default.setInterval */.Z.setInterval(() => {
1371
1371
  if (this.props._destroy) return this.componentWillUnmount();
1372
1372
  let cd = this.props.com.countdown || {};
1373
1373
  let newFlipKey = 'cd' + ':' + cd.skin + ':' + cd.size + ':' + this.props.plugin.popup.font_family + ':';
@@ -1378,25 +1378,25 @@ class Countdown extends common/* Com */.up {
1378
1378
  }, 500);
1379
1379
  }
1380
1380
  componentWillUnmount() {
1381
- util/* default */.Z.clearInterval(this.timer);
1381
+ util/* default.clearInterval */.Z.clearInterval(this.timer);
1382
1382
  }
1383
1383
  getCountDownDeltaSec(countdown) {
1384
1384
  let dest;
1385
1385
  if (countdown.expire_time_type === 'fixed_time') dest = countdown.fixed_time;
1386
1386
  if (countdown.expire_time_type === 'visit_time') dest = this.props.store.pageLoaded() + countdown.visit_time * 60000;
1387
1387
  if (countdown.expire_time_type === 'repeat_daily') {
1388
- var start = new util/* default */.Z.Date();
1388
+ var start = new util/* default.Date */.Z.Date();
1389
1389
  start.setHours(0, 0, 0, 0);
1390
1390
  dest = start.getTime() + countdown.repeat_daily * 60000;
1391
1391
  }
1392
1392
  if (countdown.expire_time_type === 'repeat_weekly') {
1393
1393
  let daytill = 0;
1394
- let todayweekday = new util/* default */.Z.Date().getDay();
1394
+ let todayweekday = new util/* default.Date */.Z.Date().getDay();
1395
1395
  if (todayweekday === 0) {
1396
1396
  if (countdown.repeat_weekly_weekday === 'sunday') {
1397
1397
  daytill = 0;
1398
1398
  } else {
1399
- daytill = 7 - new util/* default */.Z.Date().getDay();
1399
+ daytill = 7 - new util/* default.Date */.Z.Date().getDay();
1400
1400
  }
1401
1401
  } else {
1402
1402
  if (countdown.repeat_weekly_weekday === 'sunday') {
@@ -1406,16 +1406,16 @@ class Countdown extends common/* Com */.up {
1406
1406
  }
1407
1407
  }
1408
1408
  if (daytill < 0) delta = 0;else if (daytill == 0) {
1409
- var start = new util/* default */.Z.Date();
1409
+ var start = new util/* default.Date */.Z.Date();
1410
1410
  start.setHours(0, 0, 0, 0);
1411
1411
  dest = start.getTime() + countdown.repeat_weekly_min * 60000;
1412
1412
  } else {
1413
- var start = new util/* default */.Z.Date();
1413
+ var start = new util/* default.Date */.Z.Date();
1414
1414
  start.setHours(0, 0, 0, 0);
1415
1415
  dest = start.getTime() + countdown.repeat_weekly_min * 60000 + daytill * 86400000;
1416
1416
  }
1417
1417
  }
1418
- let delta = dest - util/* default */.Z.Date.now();
1418
+ let delta = dest - util/* default.Date.now */.Z.Date.now();
1419
1419
  if (delta < 0) delta = 0;
1420
1420
  return Math.floor(delta / 1000) || 0;
1421
1421
  }
@@ -1433,13 +1433,13 @@ class Countdown extends common/* Com */.up {
1433
1433
  class: "countdown_electric_numbers"
1434
1434
  }, (0,preact_module.h)("div", {
1435
1435
  class: "countdown_electric_number",
1436
- style: util/* default */.Z.js2css({
1436
+ style: util/* default.js2css */.Z.js2css({
1437
1437
  font_size: fs,
1438
1438
  font_family: this.props.plugin.popup.font_family
1439
1439
  })
1440
1440
  }, hour0), (0,preact_module.h)("div", {
1441
1441
  class: "countdown_electric_number",
1442
- style: util/* default */.Z.js2css({
1442
+ style: util/* default.js2css */.Z.js2css({
1443
1443
  font_size: fs,
1444
1444
  font_family: this.props.plugin.popup.font_family
1445
1445
  })
@@ -1451,13 +1451,13 @@ class Countdown extends common/* Com */.up {
1451
1451
  class: "countdown_electric_numbers"
1452
1452
  }, (0,preact_module.h)("div", {
1453
1453
  class: "countdown_electric_number",
1454
- style: util/* default */.Z.js2css({
1454
+ style: util/* default.js2css */.Z.js2css({
1455
1455
  font_size: fs,
1456
1456
  font_family: this.props.plugin.popup.font_family
1457
1457
  })
1458
1458
  }, min0), (0,preact_module.h)("div", {
1459
1459
  class: "countdown_electric_number",
1460
- style: util/* default */.Z.js2css({
1460
+ style: util/* default.js2css */.Z.js2css({
1461
1461
  font_size: fs,
1462
1462
  font_family: this.props.plugin.popup.font_family
1463
1463
  })
@@ -1469,13 +1469,13 @@ class Countdown extends common/* Com */.up {
1469
1469
  class: "countdown_electric_numbers"
1470
1470
  }, (0,preact_module.h)("div", {
1471
1471
  class: "countdown_electric_number",
1472
- style: util/* default */.Z.js2css({
1472
+ style: util/* default.js2css */.Z.js2css({
1473
1473
  font_size: fs,
1474
1474
  font_family: this.props.plugin.popup.font_family
1475
1475
  })
1476
1476
  }, sec0), (0,preact_module.h)("div", {
1477
1477
  class: "countdown_electric_number",
1478
- style: util/* default */.Z.js2css({
1478
+ style: util/* default.js2css */.Z.js2css({
1479
1479
  font_size: fs,
1480
1480
  font_family: this.props.plugin.popup.font_family
1481
1481
  })
@@ -1586,7 +1586,7 @@ class Flip extends common/* Com */.up {
1586
1586
  "aria-hidden": "true"
1587
1587
  }, (0,preact_module.h)("span", {
1588
1588
  "data-view": "flip",
1589
- style: util/* default */.Z.js2css({
1589
+ style: util/* default.js2css */.Z.js2css({
1590
1590
  font_size: fs,
1591
1591
  font_family: this.props.plugin.popup.font_family
1592
1592
  })
@@ -1614,22 +1614,22 @@ class Popup extends common/* Com */.up {
1614
1614
  fontReady: false
1615
1615
  });
1616
1616
  this._formRef = (0,preact_module/* createRef */.Vf)();
1617
- util/* default */.Z.setTimeout(() => this.fillForm(), 1000);
1618
- util/* default */.Z.setTimeout(async () => {
1617
+ util/* default.setTimeout */.Z.setTimeout(() => this.fillForm(), 1000);
1618
+ util/* default.setTimeout */.Z.setTimeout(async () => {
1619
1619
  let {
1620
1620
  body: impression
1621
1621
  } = await this.props.store.sendImpression(this.props.plugin.id);
1622
- this.impressionToken = util/* default */.Z.get(impression, 'impression_token') || '';
1622
+ this.impressionToken = util/* default.get */.Z.get(impression, 'impression_token') || '';
1623
1623
  }, 10);
1624
- util/* default */.Z.setTimeout(() => {
1624
+ util/* default.setTimeout */.Z.setTimeout(() => {
1625
1625
  let fonts = {};
1626
1626
  fonts[this.props.plugin.popup.font_family] = true;
1627
1627
  let images = {};
1628
- util/* default */.Z.map(this.props.plugin.popup.pages, page => {
1628
+ util/* default.map */.Z.map(this.props.plugin.popup.pages, page => {
1629
1629
  if (!page) return;
1630
- util/* default */.Z.map(page.components, com => {
1631
- fonts[util/* default */.Z.get(com, 'style.font_family')] = true;
1632
- fonts[util/* default */.Z.get(com, 'mobile_style.font_family')] = true;
1630
+ util/* default.map */.Z.map(page.components, com => {
1631
+ fonts[util/* default.get */.Z.get(com, 'style.font_family')] = true;
1632
+ fonts[util/* default.get */.Z.get(com, 'mobile_style.font_family')] = true;
1633
1633
  if (com.type === 'image' && com.image && com.image.url && com.image.url.startsWith('http')) {
1634
1634
  images[com.image.url] = true;
1635
1635
  }
@@ -1638,14 +1638,14 @@ class Popup extends common/* Com */.up {
1638
1638
  delete fonts.undefined;
1639
1639
  delete fonts.null;
1640
1640
  delete fonts[''];
1641
- if (util/* default */.Z.size(images) == 0) this.setState({
1641
+ if (util/* default.size */.Z.size(images) == 0) this.setState({
1642
1642
  imageReady: true
1643
1643
  });
1644
- util/* default */.Z.map(images, (_, image) => util/* default */.Z.preloadImg(image, () => this.setState({
1644
+ util/* default.map */.Z.map(images, (_, image) => util/* default.preloadImg */.Z.preloadImg(image, () => this.setState({
1645
1645
  imageReady: true
1646
1646
  })));
1647
- util/* default */.Z.preloadWebfonts(Object.keys(fonts));
1648
- util/* default */.Z.setTimeout(async () => {
1647
+ util/* default.preloadWebfonts */.Z.preloadWebfonts(Object.keys(fonts));
1648
+ util/* default.setTimeout */.Z.setTimeout(async () => {
1649
1649
  await this.waitForFont(Object.keys(fonts));
1650
1650
  this.setState({
1651
1651
  fontReady: true
@@ -1654,7 +1654,7 @@ class Popup extends common/* Com */.up {
1654
1654
  });
1655
1655
  }
1656
1656
  async waitForFont(fonts) {
1657
- if (util/* default */.Z.size(fonts) == 0) return;
1657
+ if (util/* default.size */.Z.size(fonts) == 0) return;
1658
1658
  let ready = {};
1659
1659
  for (var t = 0; t < 10; t++) {
1660
1660
  for (var i = 0; i < fonts.length; i++) {
@@ -1663,7 +1663,7 @@ class Popup extends common/* Com */.up {
1663
1663
  if (Object.keys(readycount) == fonts.length) return;
1664
1664
  } catch (e) {}
1665
1665
  }
1666
- await util/* default */.Z.sleep(200);
1666
+ await util/* default.sleep */.Z.sleep(200);
1667
1667
  }
1668
1668
  return;
1669
1669
  }
@@ -1677,11 +1677,11 @@ class Popup extends common/* Com */.up {
1677
1677
  return this.props.pageIndex;
1678
1678
  }
1679
1679
  isFormFilled() {
1680
- let page = util/* default */.Z.get(this.props.plugin.popup, `pages.${this.getPageIndex()}`);
1681
- let form = util/* default */.Z.find(page.components, com => com.type === 'form');
1680
+ let page = util/* default.get */.Z.get(this.props.plugin.popup, `pages.${this.getPageIndex()}`);
1681
+ let form = util/* default.find */.Z.find(page.components, com => com.type === 'form');
1682
1682
  if (!form || !form.form) return true;
1683
- let fields = util/* default */.Z.get(form, 'form.fields', []);
1684
- let wrong = util/* default */.Z.find(fields, field => {
1683
+ let fields = util/* default.get */.Z.get(form, 'form.fields', []);
1684
+ let wrong = util/* default.find */.Z.find(fields, field => {
1685
1685
  if (!field.is_required) return false;
1686
1686
  if (!this.isFieldValid(field.key, field.validate)) return true;
1687
1687
  return this.isFieldEmpty(field.key);
@@ -1689,18 +1689,18 @@ class Popup extends common/* Com */.up {
1689
1689
  return !wrong;
1690
1690
  }
1691
1691
  fillForm() {
1692
- let page = util/* default */.Z.get(this.props.plugin.popup, `pages.${this.getPageIndex()}`);
1693
- let form = util/* default */.Z.find(page.components, com => com.type === 'form');
1692
+ let page = util/* default.get */.Z.get(this.props.plugin.popup, `pages.${this.getPageIndex()}`);
1693
+ let form = util/* default.find */.Z.find(page.components, com => com.type === 'form');
1694
1694
  if (!form) return;
1695
1695
  let user = this.props.store.matchUser();
1696
- let userAttributes = util/* default */.Z.get(user, 'attributes');
1697
- let fields = util/* default */.Z.get(form, 'form.fields', []);
1698
- util/* default */.Z.each(fields, field => {
1696
+ let userAttributes = util/* default.get */.Z.get(user, 'attributes');
1697
+ let fields = util/* default.get */.Z.get(form, 'form.fields', []);
1698
+ util/* default.each */.Z.each(fields, field => {
1699
1699
  let fieldkey = field.key;
1700
1700
  if (fieldkey === 'email') fieldkey = 'emails';
1701
1701
  if (fieldkey === 'phone') fieldkey = 'phones';
1702
1702
  if (fieldkey !== 'emails' || fieldkey != 'phones' || fieldkey !== 'fullname') return;
1703
- util/* default */.Z.map(userAttributes, attr => {
1703
+ util/* default.map */.Z.map(userAttributes, attr => {
1704
1704
  if (fieldkey !== attr.key) return;
1705
1705
  var input = this._formRef.current.elements[field.key];
1706
1706
  if (!input) return;
@@ -1714,10 +1714,10 @@ class Popup extends common/* Com */.up {
1714
1714
  var formData = new FormData(this._formRef.current);
1715
1715
  for (var pair of formData.entries()) {
1716
1716
  if (pair[0] !== key) continue;
1717
- if (validate === 'email') return util/* default */.Z.isEmail(pair[1]);
1718
- if (validate === 'phone') return util/* default */.Z.isPhone(pair[1]);
1719
- if (validate === 'url') return util/* default */.Z.isURL(pair[1]);
1720
- if (validate === 'number') return util/* default */.Z.isNumber(pair[1]);
1717
+ if (validate === 'email') return util/* default.isEmail */.Z.isEmail(pair[1]);
1718
+ if (validate === 'phone') return util/* default.isPhone */.Z.isPhone(pair[1]);
1719
+ if (validate === 'url') return util/* default.isURL */.Z.isURL(pair[1]);
1720
+ if (validate === 'number') return util/* default.isNumber */.Z.isNumber(pair[1]);
1721
1721
  return true;
1722
1722
  }
1723
1723
  return true;
@@ -1764,11 +1764,11 @@ class Popup extends common/* Com */.up {
1764
1764
  this.setState({
1765
1765
  closeAnimation: true
1766
1766
  });
1767
- util/* default */.Z.setTimeout(() => this.setState({
1767
+ util/* default.setTimeout */.Z.setTimeout(() => this.setState({
1768
1768
  close: true,
1769
1769
  closeAnimation: false
1770
1770
  }), 150);
1771
- if (this.props.plugin._dont_close) util/* default */.Z.setTimeout(() => {
1771
+ if (this.props.plugin._dont_close) util/* default.setTimeout */.Z.setTimeout(() => {
1772
1772
  this.lastoverflow = window.getComputedStyle(document.body).getPropertyValue('overflow');
1773
1773
  document.body.style.setProperty('overflow', 'hidden', 'important');
1774
1774
  this.setState({
@@ -1786,11 +1786,11 @@ class Popup extends common/* Com */.up {
1786
1786
  }
1787
1787
  onButtonClick(e, buttontype) {
1788
1788
  e.stopPropagation();
1789
- let popup = util/* default */.Z.get(this.props.plugin, 'popup', {});
1790
- let page = util/* default */.Z.get(this.props.plugin.popup, `pages.${this.getPageIndex()}`);
1789
+ let popup = util/* default.get */.Z.get(this.props.plugin, 'popup', {});
1790
+ let page = util/* default.get */.Z.get(this.props.plugin.popup, `pages.${this.getPageIndex()}`);
1791
1791
  let actions = [];
1792
- let buttons = util/* default */.Z.find(page.components, com => com.type === 'buttons');
1793
- if (buttontype === 'background') actions = util/* default */.Z.get(page, 'background_click.actions') || [];
1792
+ let buttons = util/* default.find */.Z.find(page.components, com => com.type === 'buttons');
1793
+ if (buttontype === 'background') actions = util/* default.get */.Z.get(page, 'background_click.actions') || [];
1794
1794
  if (buttontype === 'primary' && buttons.buttons.primary_enabled) actions = buttons.buttons.primary_actions || [];
1795
1795
  if (buttontype === 'secondary' && buttons.buttons.secondary_enabled) actions = buttons.buttons.secondary_actions || [];
1796
1796
  let mustfillform = false;
@@ -1810,39 +1810,39 @@ class Popup extends common/* Com */.up {
1810
1810
  if (hasConversion) {
1811
1811
  var formData = this._formRef.current ? new FormData(this._formRef.current) : new FormData();
1812
1812
  var summitFields = [];
1813
- let user = util/* default */.Z.cloneDeep(this.props.store.matchUser());
1813
+ let user = util/* default.cloneDeep */.Z.cloneDeep(this.props.store.matchUser());
1814
1814
  let is_lead = false;
1815
1815
  let modifiedPairs = {};
1816
1816
  for (var pair of formData.entries()) {
1817
1817
  if (modifiedPairs[pair[0]]) {
1818
- let currentValue = util/* default */.Z.get(modifiedPairs, `${pair[0]}.1`, '');
1818
+ let currentValue = util/* default.get */.Z.get(modifiedPairs, `${pair[0]}.1`, '');
1819
1819
  currentValue += `,${pair[1]}`;
1820
- util/* default */.Z.set(modifiedPairs, `${pair[0]}.1`, currentValue);
1820
+ util/* default.set */.Z.set(modifiedPairs, `${pair[0]}.1`, currentValue);
1821
1821
  } else {
1822
1822
  modifiedPairs[pair[0]] = [pair[0], pair[1]];
1823
1823
  }
1824
1824
  }
1825
1825
  for (const [_, pair] of Object.entries(modifiedPairs)) {
1826
- let page = util/* default */.Z.get(this.props.plugin.popup, `pages.${this.getPageIndex()}`);
1827
- let form = util/* default */.Z.find(page.components, com => com.type === 'form');
1828
- let fields = util/* default */.Z.get(form, 'form.fields', []);
1829
- let field = util/* default */.Z.find(fields, field => field.key === pair[0]) || {};
1826
+ let page = util/* default.get */.Z.get(this.props.plugin.popup, `pages.${this.getPageIndex()}`);
1827
+ let form = util/* default.find */.Z.find(page.components, com => com.type === 'form');
1828
+ let fields = util/* default.get */.Z.get(form, 'form.fields', []);
1829
+ let field = util/* default.find */.Z.find(fields, field => field.key === pair[0]) || {};
1830
1830
  if (!field.type) return;
1831
1831
  summitFields.push({
1832
1832
  key: pair[0],
1833
1833
  type: field.type,
1834
- value: util/* default */.Z.stringify(pair[1])
1834
+ value: util/* default.stringify */.Z.stringify(pair[1])
1835
1835
  });
1836
1836
  let key = pair[0];
1837
1837
  if (key === 'email') key = 'emails';
1838
1838
  if (key === 'phone') key = 'phones';
1839
1839
  is_lead = is_lead || key == 'emails' || key == 'phones';
1840
- util/* default */.Z.setUserAttr(user, {
1840
+ util/* default.setUserAttr */.Z.setUserAttr(user, {
1841
1841
  key: key,
1842
1842
  text: pair[1]
1843
1843
  });
1844
1844
  }
1845
- if (is_lead) util/* default */.Z.setUserAttr(user, {
1845
+ if (is_lead) util/* default.setUserAttr */.Z.setUserAttr(user, {
1846
1846
  key: 'lead_source',
1847
1847
  text: 'plugin.' + this.props.plugin.id
1848
1848
  });
@@ -1853,7 +1853,7 @@ class Popup extends common/* Com */.up {
1853
1853
  if (a.action === 'open_widget') this.props.showWidget('list');
1854
1854
  }
1855
1855
  for (let a of actions) {
1856
- if (a.action === 'close') util/* default */.Z.setTimeout(() => this.setClose(true), 100);
1856
+ if (a.action === 'close') util/* default.setTimeout */.Z.setTimeout(() => this.setClose(true), 100);
1857
1857
  if (a.action === 'next_page') this.props.nextPage();
1858
1858
  }
1859
1859
  for (let a of actions) {
@@ -1868,7 +1868,7 @@ class Popup extends common/* Com */.up {
1868
1868
  }
1869
1869
  }
1870
1870
  renderButtons(com, page) {
1871
- let popup = util/* default */.Z.get(this.props.plugin, 'popup', {});
1871
+ let popup = util/* default.get */.Z.get(this.props.plugin, 'popup', {});
1872
1872
  let buttonsstyle = com.style || {};
1873
1873
  let primarystyle = Object.assign({}, buttonsstyle);
1874
1874
  delete primarystyle.justify_content;
@@ -1887,8 +1887,8 @@ class Popup extends common/* Com */.up {
1887
1887
  let style = Object.assign({
1888
1888
  font_size: popup.font_size || '14px'
1889
1889
  }, page.primary_button);
1890
- if (util/* default */.Z.get(com, 'style.background')) style.background = com.style.background;
1891
- if (util/* default */.Z.get(com, 'style.color')) style.color = com.style.color;
1890
+ if (util/* default.get */.Z.get(com, 'style.background')) style.background = com.style.background;
1891
+ if (util/* default.get */.Z.get(com, 'style.color')) style.color = com.style.color;
1892
1892
  $primary = (0,preact_module.h)("div", {
1893
1893
  class: 'btn btn__primary ',
1894
1894
  style: this.js2css(primarystyle),
@@ -1925,7 +1925,7 @@ class Popup extends common/* Com */.up {
1925
1925
  }
1926
1926
  js2css(js, onlyProps) {
1927
1927
  let spacer = this.props.plugin.popup.spacer || 10;
1928
- return util/* default */.Z.js2css(js, onlyProps, {
1928
+ return util/* default.js2css */.Z.js2css(js, onlyProps, {
1929
1929
  '@font_size': this.props.plugin.popup.font_size,
1930
1930
  '@font_family': this.props.plugin.popup.font_family,
1931
1931
  '@text_color': this.props.plugin.popup.text_color,
@@ -1939,7 +1939,7 @@ class Popup extends common/* Com */.up {
1939
1939
  }
1940
1940
  renderSingleChoiceField(field) {
1941
1941
  var cls = 'form-control form-control__select ' + this.props.plugin.popup.theme;
1942
- let $options = util/* default */.Z.map(field.options, option => {
1942
+ let $options = util/* default.map */.Z.map(field.options, option => {
1943
1943
  return (0,preact_module.h)("label", {
1944
1944
  class: cls
1945
1945
  }, (0,preact_module.h)("input", {
@@ -1951,12 +1951,12 @@ class Popup extends common/* Com */.up {
1951
1951
  return (0,preact_module.h)(preact_module/* Fragment */.HY, null, $options);
1952
1952
  }
1953
1953
  renderDropdownField(field) {
1954
- let $options = util/* default */.Z.map(field.options, option => {
1954
+ let $options = util/* default.map */.Z.map(field.options, option => {
1955
1955
  return (0,preact_module.h)("option", {
1956
1956
  value: option.value
1957
1957
  }, option.value);
1958
1958
  });
1959
- let theme = util/* default */.Z.get(this.props.plugin, 'popup.theme');
1959
+ let theme = util/* default.get */.Z.get(this.props.plugin, 'popup.theme');
1960
1960
  var cls = 'form-control form-control__select ' + theme;
1961
1961
  if (theme === 'vintage') {
1962
1962
  return (0,preact_module.h)("div", {
@@ -1975,7 +1975,7 @@ class Popup extends common/* Com */.up {
1975
1975
  }
1976
1976
  renderMutiChoiceField(field) {
1977
1977
  var cls = 'form-control form-control__check ' + this.props.plugin.popup.theme;
1978
- let $options = util/* default */.Z.map(field.options, option => {
1978
+ let $options = util/* default.map */.Z.map(field.options, option => {
1979
1979
  return (0,preact_module.h)("label", {
1980
1980
  class: cls
1981
1981
  }, (0,preact_module.h)("input", {
@@ -1988,7 +1988,7 @@ class Popup extends common/* Com */.up {
1988
1988
  return (0,preact_module.h)(preact_module/* Fragment */.HY, null, $options);
1989
1989
  }
1990
1990
  renderTextField(field) {
1991
- let theme = util/* default */.Z.get(this.props.plugin, 'popup.theme');
1991
+ let theme = util/* default.get */.Z.get(this.props.plugin, 'popup.theme');
1992
1992
  var cls = 'form-control form-control__text ' + theme;
1993
1993
  if (theme === 'simple') {
1994
1994
  return (0,preact_module.h)("input", {
@@ -2021,7 +2021,7 @@ class Popup extends common/* Com */.up {
2021
2021
  });
2022
2022
  }
2023
2023
  renderMultilineTextField(field) {
2024
- let theme = util/* default */.Z.get(this.props.plugin, 'popup.theme');
2024
+ let theme = util/* default.get */.Z.get(this.props.plugin, 'popup.theme');
2025
2025
  var cls = 'form-control form-control__text ' + theme;
2026
2026
  if (theme === 'simple') {
2027
2027
  return (0,preact_module.h)("textarea", {
@@ -2069,8 +2069,8 @@ class Popup extends common/* Com */.up {
2069
2069
  });
2070
2070
  }
2071
2071
  renderFormComponent(com) {
2072
- let popup = util/* default */.Z.get(this.props.plugin, 'popup', {});
2073
- let $fields = util/* default */.Z.map(com.form.fields, field => {
2072
+ let popup = util/* default.get */.Z.get(this.props.plugin, 'popup', {});
2073
+ let $fields = util/* default.map */.Z.map(com.form.fields, field => {
2074
2074
  if (field.type === 'email') return this.renderTextField(field);
2075
2075
  if (field.type === 'single-choice') return this.renderSingleChoiceField(field);
2076
2076
  if (field.type === 'multiple-choice') return this.renderMutiChoiceField(field);
@@ -2079,8 +2079,8 @@ class Popup extends common/* Com */.up {
2079
2079
  if (field.type === 'dropdown') return this.renderDropdownField(field);
2080
2080
  return;
2081
2081
  });
2082
- let theme = util/* default */.Z.get(popup, 'theme');
2083
- $fields = util/* default */.Z.map($fields, ($field, i) => {
2082
+ let theme = util/* default.get */.Z.get(popup, 'theme');
2083
+ $fields = util/* default.map */.Z.map($fields, ($field, i) => {
2084
2084
  let $label = null;
2085
2085
  let field = com.form.fields[i];
2086
2086
  $label = (0,preact_module.h)("div", {
@@ -2128,11 +2128,11 @@ class Popup extends common/* Com */.up {
2128
2128
  }, $fields);
2129
2129
  }
2130
2130
  renderComponents(page) {
2131
- let buttons = util/* default */.Z.find(page.components, com => com.type === 'buttons');
2131
+ let buttons = util/* default.find */.Z.find(page.components, com => com.type === 'buttons');
2132
2132
  let $buttons = null;
2133
2133
  if (buttons) $buttons = this.renderButtons(buttons, page);
2134
2134
  let comIndexWithoutImg = 0;
2135
- return util/* default */.Z.map(page.components, (com, i) => {
2135
+ return util/* default.map */.Z.map(page.components, (com, i) => {
2136
2136
  if (com.type === 'image') return null;
2137
2137
  comIndexWithoutImg++;
2138
2138
  if (com.type === 'buttons') return $buttons;
@@ -2154,7 +2154,7 @@ class Popup extends common/* Com */.up {
2154
2154
  });
2155
2155
  }
2156
2156
  renderFollowFacebook(com) {
2157
- let fburl = util/* default */.Z.get(com, 'follow_facebook.url');
2157
+ let fburl = util/* default.get */.Z.get(com, 'follow_facebook.url');
2158
2158
  if (!fburl) return null;
2159
2159
  let style = this.props.mobile && com.mobile_style || com.style;
2160
2160
  let containerstyle = {
@@ -2183,7 +2183,7 @@ class Popup extends common/* Com */.up {
2183
2183
  }, this.props.t('follow_us_on_facebook'))));
2184
2184
  }
2185
2185
  renderSocialButtons(com) {
2186
- let fburl = util/* default */.Z.get(com, 'social_buttons.facebook');
2186
+ let fburl = util/* default.get */.Z.get(com, 'social_buttons.facebook');
2187
2187
  let $fb = null;
2188
2188
  if (fburl) {
2189
2189
  $fb = (0,preact_module.h)("a", {
@@ -2196,7 +2196,7 @@ class Popup extends common/* Com */.up {
2196
2196
  src: __webpack_require__(7435)
2197
2197
  }));
2198
2198
  }
2199
- let zlurl = util/* default */.Z.get(com, 'social_buttons.zalo');
2199
+ let zlurl = util/* default.get */.Z.get(com, 'social_buttons.zalo');
2200
2200
  let $zl = null;
2201
2201
  if (zlurl) {
2202
2202
  $zl = (0,preact_module.h)("a", {
@@ -2230,7 +2230,7 @@ class Popup extends common/* Com */.up {
2230
2230
  style: this.js2css({
2231
2231
  width: '100%',
2232
2232
  height: '100%',
2233
- background_image: `url("${encodeURI(util/* default */.Z.get(com, 'image.url'))}")`,
2233
+ background_image: `url("${encodeURI(util/* default.get */.Z.get(com, 'image.url'))}")`,
2234
2234
  background_size: style.background_size || 'cover',
2235
2235
  background_position: style.background_position || 'auto'
2236
2236
  })
@@ -2244,7 +2244,7 @@ class Popup extends common/* Com */.up {
2244
2244
  });
2245
2245
  }
2246
2246
  renderTextComponent(com, isFirst) {
2247
- let popup = util/* default */.Z.get(this.props.plugin, 'popup', {});
2247
+ let popup = util/* default.get */.Z.get(this.props.plugin, 'popup', {});
2248
2248
  let style = Object.assign({
2249
2249
  color: popup.text_color,
2250
2250
  font_family: popup.font_family,
@@ -2256,21 +2256,21 @@ class Popup extends common/* Com */.up {
2256
2256
  class: "text popup_component",
2257
2257
  style: this.js2css(style),
2258
2258
  onClick: e => e.stopPropagation()
2259
- }, this.props.t.i18n(util/* default */.Z.get(com, 'text.i18n_html')) || util/* default */.Z.get(com, 'text.html'));
2259
+ }, this.props.t.i18n(util/* default.get */.Z.get(com, 'text.i18n_html')) || util/* default.get */.Z.get(com, 'text.html'));
2260
2260
  }
2261
2261
  async refreshCSS() {
2262
2262
  let plugins = this.props.store.matchPlugin();
2263
- let found = util/* default */.Z.find(plugins, plugin => plugin.id === this.props.plugin.id);
2263
+ let found = util/* default.find */.Z.find(plugins, plugin => plugin.id === this.props.plugin.id);
2264
2264
  if (!found) return;
2265
2265
  let css = (await popupCSS).default.default.toString();
2266
- var outcss = util/* default */.Z.replaceCssVariablePlugin(css, this.props.plugin.popup);
2267
- let extra_css = util/* default */.Z.get(this.props.plugin, `popup.pages.0.extra_css`, []);
2268
- let extra_css_string = util/* default */.Z.map(extra_css, css => `#sbz92 ${css.selector} { ${this.js2css(css.style)}}`).join('\n');
2266
+ var outcss = util/* default.replaceCssVariablePlugin */.Z.replaceCssVariablePlugin(css, this.props.plugin.popup);
2267
+ let extra_css = util/* default.get */.Z.get(this.props.plugin, `popup.pages.0.extra_css`, []);
2268
+ let extra_css_string = util/* default.map */.Z.map(extra_css, css => `#sbz92 ${css.selector} { ${this.js2css(css.style)}}`).join('\n');
2269
2269
  outcss += extra_css_string;
2270
- util/* default */.Z.setCss(this.props.plugin.id, this.$cssStyleDiv, outcss);
2270
+ util/* default.setCss */.Z.setCss(this.props.plugin.id, this.$cssStyleDiv, outcss);
2271
2271
  }
2272
2272
  componentWillUnmount() {
2273
- util/* default */.Z.setCss(this.props.plugin.id, this.$cssStyleDiv, '');
2273
+ util/* default.setCss */.Z.setCss(this.props.plugin.id, this.$cssStyleDiv, '');
2274
2274
  }
2275
2275
  async componentDidMount() {
2276
2276
  this.$cssStyleDiv = document.getElementById('subiz-style-for-' + this.props.plugin.id);
@@ -2282,7 +2282,7 @@ class Popup extends common/* Com */.up {
2282
2282
  }
2283
2283
  this.props.store.onResetCSS(this, () => this.refreshCSS());
2284
2284
  await this.refreshCSS();
2285
- util/* default */.Z.setTimeout(() => {
2285
+ util/* default.setTimeout */.Z.setTimeout(() => {
2286
2286
  this.setState({
2287
2287
  cssready: true
2288
2288
  });
@@ -2298,7 +2298,7 @@ class Popup extends common/* Com */.up {
2298
2298
  max_height: '85%'
2299
2299
  });
2300
2300
  let containercss = {};
2301
- util/* default */.Z.map(['left', 'top', 'right', 'bottom', 'box_shadow', 'transform'], prop => {
2301
+ util/* default.map */.Z.map(['left', 'top', 'right', 'bottom', 'box_shadow', 'transform'], prop => {
2302
2302
  containercss[prop] = pagestyle[prop];
2303
2303
  });
2304
2304
  containercss.position = 'absolute';
@@ -2407,13 +2407,13 @@ class Popup extends common/* Com */.up {
2407
2407
  if (!this.state.imageReady) return null;
2408
2408
  if (!this.state.fontReady) return null;
2409
2409
  if (this.state.close) return null;
2410
- let popup = util/* default */.Z.get(this.props.plugin, 'popup', {});
2411
- let page = util/* default */.Z.get(popup, `pages.${this.getPageIndex()}`);
2410
+ let popup = util/* default.get */.Z.get(this.props.plugin, 'popup', {});
2411
+ let page = util/* default.get */.Z.get(popup, `pages.${this.getPageIndex()}`);
2412
2412
  if (!page) return null;
2413
2413
  let pagestyle = Object.assign({}, this.props.mobile && page.mobile_style || page.style);
2414
2414
  let containercss = this.calculateContainerCss(popup, page);
2415
2415
  let animation = '';
2416
- let pos = util/* default */.Z.get(this.props.plugin, 'popup.position', 'center');
2416
+ let pos = util/* default.get */.Z.get(this.props.plugin, 'popup.position', 'center');
2417
2417
  if (pos === 'center' || !pos) {
2418
2418
  animation = 'zoomInCenter';
2419
2419
  if (this.state.closeAnimation) animation = 'zoomOutCenter';
@@ -2424,8 +2424,8 @@ class Popup extends common/* Com */.up {
2424
2424
  if (pos === 'middle-left') animation = 'fadeInLeftBig';
2425
2425
  if (pos === 'middle-right') animation = 'fadeInRightBig';
2426
2426
  if (pos === 'bottom-center') animation = 'fadeInUpCenter';
2427
- let layout = util/* default */.Z.get(page, 'layout');
2428
- if (this.props.mobile) layout = util/* default */.Z.get(page, 'mobile_layout');
2427
+ let layout = util/* default.get */.Z.get(page, 'layout');
2428
+ if (this.props.mobile) layout = util/* default.get */.Z.get(page, 'mobile_layout');
2429
2429
  let formcss = {
2430
2430
  display: pagestyle.display,
2431
2431
  align_items: pagestyle.align_items,
@@ -2457,10 +2457,10 @@ class Popup extends common/* Com */.up {
2457
2457
  let overlaystyle = 'position: fixed !important;';
2458
2458
  if (this.props.plugin._preview) overlaystyle = 'position: absolute !important;';
2459
2459
  if (popup.overlay) overlaystyle += ' background: #000c !important;';
2460
- let $imgs = util/* default */.Z.map(page.components, (com, i) => {
2460
+ let $imgs = util/* default.map */.Z.map(page.components, (com, i) => {
2461
2461
  if (com.type === 'image') return this.renderImageComponent(com, i);
2462
2462
  });
2463
- let formComponents = util/* default */.Z.filter(page.components, com => com.type !== 'image');
2463
+ let formComponents = util/* default.filter */.Z.filter(page.components, com => com.type !== 'image');
2464
2464
  if (!formComponents.length) {
2465
2465
  formcss.background = 'transparent';
2466
2466
  formcss.padding_top = '0';