@saasquatch/squatch-js 2.6.2-0 → 2.6.3-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/squatch.js CHANGED
@@ -837,7 +837,7 @@ class EmbedWidget extends Widget {
837
837
  this._loadEvent(_sqh);
838
838
 
839
839
  _log$7("loaded");
840
- } else {
840
+ } else if (frameDoc) {
841
841
  this._attachLoadEventListener(frameDoc, _sqh);
842
842
  }
843
843
  });
@@ -1558,6 +1558,379 @@ function asyncLoad() {
1558
1558
  }, 0);
1559
1559
  }
1560
1560
 
1561
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1562
+
1563
+ function createCommonjsModule(fn) {
1564
+ var module = { exports: {} };
1565
+ return fn(module, module.exports), module.exports;
1566
+ }
1567
+
1568
+ /*! https://mths.be/utf8js v3.0.0 by @mathias */
1569
+
1570
+ var utf8 = createCommonjsModule(function (module, exports) {
1571
+ (function(root) {
1572
+
1573
+ var stringFromCharCode = String.fromCharCode;
1574
+
1575
+ // Taken from https://mths.be/punycode
1576
+ function ucs2decode(string) {
1577
+ var output = [];
1578
+ var counter = 0;
1579
+ var length = string.length;
1580
+ var value;
1581
+ var extra;
1582
+ while (counter < length) {
1583
+ value = string.charCodeAt(counter++);
1584
+ if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
1585
+ // high surrogate, and there is a next character
1586
+ extra = string.charCodeAt(counter++);
1587
+ if ((extra & 0xFC00) == 0xDC00) { // low surrogate
1588
+ output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
1589
+ } else {
1590
+ // unmatched surrogate; only append this code unit, in case the next
1591
+ // code unit is the high surrogate of a surrogate pair
1592
+ output.push(value);
1593
+ counter--;
1594
+ }
1595
+ } else {
1596
+ output.push(value);
1597
+ }
1598
+ }
1599
+ return output;
1600
+ }
1601
+
1602
+ // Taken from https://mths.be/punycode
1603
+ function ucs2encode(array) {
1604
+ var length = array.length;
1605
+ var index = -1;
1606
+ var value;
1607
+ var output = '';
1608
+ while (++index < length) {
1609
+ value = array[index];
1610
+ if (value > 0xFFFF) {
1611
+ value -= 0x10000;
1612
+ output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
1613
+ value = 0xDC00 | value & 0x3FF;
1614
+ }
1615
+ output += stringFromCharCode(value);
1616
+ }
1617
+ return output;
1618
+ }
1619
+
1620
+ function checkScalarValue(codePoint) {
1621
+ if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
1622
+ throw Error(
1623
+ 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
1624
+ ' is not a scalar value'
1625
+ );
1626
+ }
1627
+ }
1628
+ /*--------------------------------------------------------------------------*/
1629
+
1630
+ function createByte(codePoint, shift) {
1631
+ return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);
1632
+ }
1633
+
1634
+ function encodeCodePoint(codePoint) {
1635
+ if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence
1636
+ return stringFromCharCode(codePoint);
1637
+ }
1638
+ var symbol = '';
1639
+ if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence
1640
+ symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);
1641
+ }
1642
+ else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence
1643
+ checkScalarValue(codePoint);
1644
+ symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);
1645
+ symbol += createByte(codePoint, 6);
1646
+ }
1647
+ else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence
1648
+ symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);
1649
+ symbol += createByte(codePoint, 12);
1650
+ symbol += createByte(codePoint, 6);
1651
+ }
1652
+ symbol += stringFromCharCode((codePoint & 0x3F) | 0x80);
1653
+ return symbol;
1654
+ }
1655
+
1656
+ function utf8encode(string) {
1657
+ var codePoints = ucs2decode(string);
1658
+ var length = codePoints.length;
1659
+ var index = -1;
1660
+ var codePoint;
1661
+ var byteString = '';
1662
+ while (++index < length) {
1663
+ codePoint = codePoints[index];
1664
+ byteString += encodeCodePoint(codePoint);
1665
+ }
1666
+ return byteString;
1667
+ }
1668
+
1669
+ /*--------------------------------------------------------------------------*/
1670
+
1671
+ function readContinuationByte() {
1672
+ if (byteIndex >= byteCount) {
1673
+ throw Error('Invalid byte index');
1674
+ }
1675
+
1676
+ var continuationByte = byteArray[byteIndex] & 0xFF;
1677
+ byteIndex++;
1678
+
1679
+ if ((continuationByte & 0xC0) == 0x80) {
1680
+ return continuationByte & 0x3F;
1681
+ }
1682
+
1683
+ // If we end up here, it’s not a continuation byte
1684
+ throw Error('Invalid continuation byte');
1685
+ }
1686
+
1687
+ function decodeSymbol() {
1688
+ var byte1;
1689
+ var byte2;
1690
+ var byte3;
1691
+ var byte4;
1692
+ var codePoint;
1693
+
1694
+ if (byteIndex > byteCount) {
1695
+ throw Error('Invalid byte index');
1696
+ }
1697
+
1698
+ if (byteIndex == byteCount) {
1699
+ return false;
1700
+ }
1701
+
1702
+ // Read first byte
1703
+ byte1 = byteArray[byteIndex] & 0xFF;
1704
+ byteIndex++;
1705
+
1706
+ // 1-byte sequence (no continuation bytes)
1707
+ if ((byte1 & 0x80) == 0) {
1708
+ return byte1;
1709
+ }
1710
+
1711
+ // 2-byte sequence
1712
+ if ((byte1 & 0xE0) == 0xC0) {
1713
+ byte2 = readContinuationByte();
1714
+ codePoint = ((byte1 & 0x1F) << 6) | byte2;
1715
+ if (codePoint >= 0x80) {
1716
+ return codePoint;
1717
+ } else {
1718
+ throw Error('Invalid continuation byte');
1719
+ }
1720
+ }
1721
+
1722
+ // 3-byte sequence (may include unpaired surrogates)
1723
+ if ((byte1 & 0xF0) == 0xE0) {
1724
+ byte2 = readContinuationByte();
1725
+ byte3 = readContinuationByte();
1726
+ codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;
1727
+ if (codePoint >= 0x0800) {
1728
+ checkScalarValue(codePoint);
1729
+ return codePoint;
1730
+ } else {
1731
+ throw Error('Invalid continuation byte');
1732
+ }
1733
+ }
1734
+
1735
+ // 4-byte sequence
1736
+ if ((byte1 & 0xF8) == 0xF0) {
1737
+ byte2 = readContinuationByte();
1738
+ byte3 = readContinuationByte();
1739
+ byte4 = readContinuationByte();
1740
+ codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |
1741
+ (byte3 << 0x06) | byte4;
1742
+ if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {
1743
+ return codePoint;
1744
+ }
1745
+ }
1746
+
1747
+ throw Error('Invalid UTF-8 detected');
1748
+ }
1749
+
1750
+ var byteArray;
1751
+ var byteCount;
1752
+ var byteIndex;
1753
+ function utf8decode(byteString) {
1754
+ byteArray = ucs2decode(byteString);
1755
+ byteCount = byteArray.length;
1756
+ byteIndex = 0;
1757
+ var codePoints = [];
1758
+ var tmp;
1759
+ while ((tmp = decodeSymbol()) !== false) {
1760
+ codePoints.push(tmp);
1761
+ }
1762
+ return ucs2encode(codePoints);
1763
+ }
1764
+
1765
+ /*--------------------------------------------------------------------------*/
1766
+
1767
+ root.version = '3.0.0';
1768
+ root.encode = utf8encode;
1769
+ root.decode = utf8decode;
1770
+
1771
+ }(exports));
1772
+ });
1773
+
1774
+ /*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */
1775
+
1776
+ var base64 = createCommonjsModule(function (module, exports) {
1777
+ (function(root) {
1778
+
1779
+ // Detect free variables `exports`.
1780
+ var freeExports = exports;
1781
+
1782
+ // Detect free variable `module`.
1783
+ var freeModule = module &&
1784
+ module.exports == freeExports && module;
1785
+
1786
+ // Detect free variable `global`, from Node.js or Browserified code, and use
1787
+ // it as `root`.
1788
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
1789
+ if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
1790
+ root = freeGlobal;
1791
+ }
1792
+
1793
+ /*--------------------------------------------------------------------------*/
1794
+
1795
+ var InvalidCharacterError = function(message) {
1796
+ this.message = message;
1797
+ };
1798
+ InvalidCharacterError.prototype = new Error;
1799
+ InvalidCharacterError.prototype.name = 'InvalidCharacterError';
1800
+
1801
+ var error = function(message) {
1802
+ // Note: the error messages used throughout this file match those used by
1803
+ // the native `atob`/`btoa` implementation in Chromium.
1804
+ throw new InvalidCharacterError(message);
1805
+ };
1806
+
1807
+ var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
1808
+ // http://whatwg.org/html/common-microsyntaxes.html#space-character
1809
+ var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g;
1810
+
1811
+ // `decode` is designed to be fully compatible with `atob` as described in the
1812
+ // HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob
1813
+ // The optimized base64-decoding algorithm used is based on @atk’s excellent
1814
+ // implementation. https://gist.github.com/atk/1020396
1815
+ var decode = function(input) {
1816
+ input = String(input)
1817
+ .replace(REGEX_SPACE_CHARACTERS, '');
1818
+ var length = input.length;
1819
+ if (length % 4 == 0) {
1820
+ input = input.replace(/==?$/, '');
1821
+ length = input.length;
1822
+ }
1823
+ if (
1824
+ length % 4 == 1 ||
1825
+ // http://whatwg.org/C#alphanumeric-ascii-characters
1826
+ /[^+a-zA-Z0-9/]/.test(input)
1827
+ ) {
1828
+ error(
1829
+ 'Invalid character: the string to be decoded is not correctly encoded.'
1830
+ );
1831
+ }
1832
+ var bitCounter = 0;
1833
+ var bitStorage;
1834
+ var buffer;
1835
+ var output = '';
1836
+ var position = -1;
1837
+ while (++position < length) {
1838
+ buffer = TABLE.indexOf(input.charAt(position));
1839
+ bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;
1840
+ // Unless this is the first of a group of 4 characters…
1841
+ if (bitCounter++ % 4) {
1842
+ // …convert the first 8 bits to a single ASCII character.
1843
+ output += String.fromCharCode(
1844
+ 0xFF & bitStorage >> (-2 * bitCounter & 6)
1845
+ );
1846
+ }
1847
+ }
1848
+ return output;
1849
+ };
1850
+
1851
+ // `encode` is designed to be fully compatible with `btoa` as described in the
1852
+ // HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa
1853
+ var encode = function(input) {
1854
+ input = String(input);
1855
+ if (/[^\0-\xFF]/.test(input)) {
1856
+ // Note: no need to special-case astral symbols here, as surrogates are
1857
+ // matched, and the input is supposed to only contain ASCII anyway.
1858
+ error(
1859
+ 'The string to be encoded contains characters outside of the ' +
1860
+ 'Latin1 range.'
1861
+ );
1862
+ }
1863
+ var padding = input.length % 3;
1864
+ var output = '';
1865
+ var position = -1;
1866
+ var a;
1867
+ var b;
1868
+ var c;
1869
+ var buffer;
1870
+ // Make sure any padding is handled outside of the loop.
1871
+ var length = input.length - padding;
1872
+
1873
+ while (++position < length) {
1874
+ // Read three bytes, i.e. 24 bits.
1875
+ a = input.charCodeAt(position) << 16;
1876
+ b = input.charCodeAt(++position) << 8;
1877
+ c = input.charCodeAt(++position);
1878
+ buffer = a + b + c;
1879
+ // Turn the 24 bits into four chunks of 6 bits each, and append the
1880
+ // matching character for each of them to the output.
1881
+ output += (
1882
+ TABLE.charAt(buffer >> 18 & 0x3F) +
1883
+ TABLE.charAt(buffer >> 12 & 0x3F) +
1884
+ TABLE.charAt(buffer >> 6 & 0x3F) +
1885
+ TABLE.charAt(buffer & 0x3F)
1886
+ );
1887
+ }
1888
+
1889
+ if (padding == 2) {
1890
+ a = input.charCodeAt(position) << 8;
1891
+ b = input.charCodeAt(++position);
1892
+ buffer = a + b;
1893
+ output += (
1894
+ TABLE.charAt(buffer >> 10) +
1895
+ TABLE.charAt((buffer >> 4) & 0x3F) +
1896
+ TABLE.charAt((buffer << 2) & 0x3F) +
1897
+ '='
1898
+ );
1899
+ } else if (padding == 1) {
1900
+ buffer = input.charCodeAt(position);
1901
+ output += (
1902
+ TABLE.charAt(buffer >> 2) +
1903
+ TABLE.charAt((buffer << 4) & 0x3F) +
1904
+ '=='
1905
+ );
1906
+ }
1907
+
1908
+ return output;
1909
+ };
1910
+
1911
+ var base64 = {
1912
+ 'encode': encode,
1913
+ 'decode': decode,
1914
+ 'version': '1.0.0'
1915
+ };
1916
+
1917
+ // Some AMD build optimizers, like r.js, check for specific condition patterns
1918
+ // like the following:
1919
+ if (freeExports && !freeExports.nodeType) {
1920
+ if (freeModule) { // in Node.js or RingoJS v0.8.0+
1921
+ freeModule.exports = base64;
1922
+ } else { // in Narwhal or RingoJS v0.7.0-
1923
+ for (var key in base64) {
1924
+ base64.hasOwnProperty(key) && (freeExports[key] = base64[key]);
1925
+ }
1926
+ }
1927
+ } else { // in Rhino or a web browser
1928
+ root.base64 = base64;
1929
+ }
1930
+
1931
+ }(commonjsGlobal));
1932
+ });
1933
+
1561
1934
  /** @hidden */
1562
1935
 
1563
1936
  var _log$4 = debug.debug("squatch-js");
@@ -1574,7 +1947,7 @@ var deepMerge = (target, source) => {
1574
1947
  };
1575
1948
 
1576
1949
  function b64decode(input) {
1577
- return atob(input.replace(/_/g, "/").replace(/-/g, "+"));
1950
+ return utf8.decode(base64.decode(input));
1578
1951
  }
1579
1952
 
1580
1953
  function b64encode(input) {