@saasquatch/squatch-js 2.8.2-35 → 2.8.2-37
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.cjs.js +27 -370
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +27 -370
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +27 -370
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +2 -2
- package/dist/widgets/PopupWidget.d.ts +2 -2
- package/dist/widgets/Widget.d.ts +0 -1
- package/dist/widgets/declarative/DeclarativeWidget.d.ts +0 -1
- package/package.json +1 -1
- package/dist/widgets/SkeletonTemplate.d.ts +0 -13
package/dist/squatch.js
CHANGED
|
@@ -704,7 +704,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
704
704
|
const raw = params;
|
|
705
705
|
const clean = validatePasswordlessConfig(raw);
|
|
706
706
|
const { widgetType, engagementMedium = "POPUP", jwt, user } = clean;
|
|
707
|
-
console.log({ params });
|
|
708
707
|
const tenantAlias = encodeURIComponent(this.tenantAlias);
|
|
709
708
|
const accountId = (user == null ? void 0 : user.accountId) ? encodeURIComponent(user.accountId) : null;
|
|
710
709
|
const userId = (user == null ? void 0 : user.id) ? encodeURIComponent(user.id) : null;
|
|
@@ -893,9 +892,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
893
892
|
if ((options == null ? void 0 : options.maxWidth) || (options == null ? void 0 : options.minWidth)) {
|
|
894
893
|
frame.style.width = "100%";
|
|
895
894
|
}
|
|
896
|
-
if (options == null ? void 0 : options.initialHeight) {
|
|
897
|
-
frame.height = options.initialHeight;
|
|
898
|
-
}
|
|
899
895
|
return frame;
|
|
900
896
|
}
|
|
901
897
|
_findFrame() {
|
|
@@ -1116,22 +1112,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1116
1112
|
super(params);
|
|
1117
1113
|
__publicField(this, "show", this.open);
|
|
1118
1114
|
__publicField(this, "hide", this.close);
|
|
1119
|
-
if (container)
|
|
1120
|
-
this.container = container;
|
|
1121
|
-
}
|
|
1115
|
+
if (container) this.container = container;
|
|
1122
1116
|
}
|
|
1123
1117
|
async load() {
|
|
1124
|
-
var _a2, _b, _c, _d, _e
|
|
1118
|
+
var _a2, _b, _c, _d, _e;
|
|
1125
1119
|
const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.brandingConfig;
|
|
1126
|
-
const initialHeight = brandingConfig == null ? void 0 : brandingConfig.loadingHeight;
|
|
1127
1120
|
const sizes = (_c = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _c.embeddedWidgets;
|
|
1128
1121
|
const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "";
|
|
1129
1122
|
const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "";
|
|
1130
|
-
const frame = this._createFrame({
|
|
1131
|
-
minWidth,
|
|
1132
|
-
maxWidth,
|
|
1133
|
-
initialHeight
|
|
1134
|
-
});
|
|
1123
|
+
const frame = this._createFrame({ minWidth, maxWidth });
|
|
1135
1124
|
const element = this._findElement();
|
|
1136
1125
|
if ((_d = this.context) == null ? void 0 : _d.container) {
|
|
1137
1126
|
element.style.visibility = "hidden";
|
|
@@ -1159,29 +1148,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1159
1148
|
}
|
|
1160
1149
|
const frameDoc = contentWindow.document;
|
|
1161
1150
|
frameDoc.open();
|
|
1162
|
-
|
|
1163
|
-
frameDoc.write(
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
1167
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
1168
|
-
<link rel="preload" href="https://fonts.googleapis.com/css2?family=${encodeURIComponent(
|
|
1169
|
-
(_g = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _g.brandFont
|
|
1170
|
-
)}" as="style">` : ""}
|
|
1171
|
-
<link rel="dns-prefetch" href="https://res.cloudinary.com">
|
|
1172
|
-
<link rel="preconnect" href="https://res.cloudinary.com" crossorigin>
|
|
1173
|
-
<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>
|
|
1174
|
-
<style data-styles>
|
|
1175
|
-
html { visibility:hidden;}
|
|
1176
|
-
</style>
|
|
1177
|
-
${this.content}
|
|
1178
|
-
|
|
1179
|
-
`);
|
|
1151
|
+
frameDoc.write(this.content);
|
|
1152
|
+
frameDoc.write(
|
|
1153
|
+
`<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>`
|
|
1154
|
+
);
|
|
1180
1155
|
frameDoc.close();
|
|
1181
1156
|
domready(frameDoc, async () => {
|
|
1182
1157
|
const _sqh = contentWindow.squatch || contentWindow.widgetIdent;
|
|
1183
|
-
frame.height =
|
|
1184
|
-
console.log({ height: frameDoc.body.scrollHeight });
|
|
1158
|
+
frame.height = frameDoc.body.scrollHeight;
|
|
1185
1159
|
const ro = new contentWindow["ResizeObserver"]((entries) => {
|
|
1186
1160
|
for (const entry of entries) {
|
|
1187
1161
|
const { height } = entry.contentRect;
|
|
@@ -1277,10 +1251,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1277
1251
|
};
|
|
1278
1252
|
}
|
|
1279
1253
|
}
|
|
1280
|
-
_createPopupDialog(
|
|
1281
|
-
var _a2;
|
|
1254
|
+
_createPopupDialog() {
|
|
1255
|
+
var _a2, _b, _c;
|
|
1282
1256
|
const dialog = document.createElement("dialog");
|
|
1283
|
-
const
|
|
1257
|
+
const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.brandingConfig;
|
|
1258
|
+
const sizes = (_c = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _c.popupWidgets;
|
|
1284
1259
|
const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "auto";
|
|
1285
1260
|
const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "500px";
|
|
1286
1261
|
dialog.id = this.id;
|
|
@@ -1296,16 +1271,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1296
1271
|
return dialog;
|
|
1297
1272
|
}
|
|
1298
1273
|
async load() {
|
|
1299
|
-
var _a2
|
|
1300
|
-
const
|
|
1301
|
-
const initialHeight = brandingConfig == null ? void 0 : brandingConfig.loadingHeight;
|
|
1302
|
-
const frame = this._createFrame({ initialHeight });
|
|
1274
|
+
var _a2;
|
|
1275
|
+
const frame = this._createFrame();
|
|
1303
1276
|
this._initialiseCTA();
|
|
1304
1277
|
const element = this.container ? this._findElement() : document.body;
|
|
1305
1278
|
const dialogParent = element.shadowRoot || element;
|
|
1306
|
-
const dialog = this._createPopupDialog(
|
|
1279
|
+
const dialog = this._createPopupDialog();
|
|
1307
1280
|
dialog.appendChild(frame);
|
|
1308
|
-
if (((
|
|
1281
|
+
if (((_a2 = dialogParent.lastChild) == null ? void 0 : _a2.nodeName) === "DIALOG") {
|
|
1309
1282
|
dialogParent.replaceChild(dialog, dialogParent.lastChild);
|
|
1310
1283
|
} else {
|
|
1311
1284
|
dialogParent.appendChild(dialog);
|
|
@@ -1316,29 +1289,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1316
1289
|
}
|
|
1317
1290
|
const frameDoc = contentWindow.document;
|
|
1318
1291
|
frameDoc.open();
|
|
1319
|
-
|
|
1320
|
-
frameDoc.write(
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
<link rel="preconnect" href="https://fonts.gstatic.com">
|
|
1324
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
1325
|
-
<link rel="preload" href="https://fonts.googleapis.com/css2?family=${encodeURIComponent(
|
|
1326
|
-
(_e = brandingConfig == null ? void 0 : brandingConfig.main) == null ? void 0 : _e.brandFont
|
|
1327
|
-
)}" as="style">` : ""}
|
|
1328
|
-
<link rel="dns-prefetch" href="https://res.cloudinary.com">
|
|
1329
|
-
<link rel="preconnect" href="https://res.cloudinary.com" crossorigin>
|
|
1330
|
-
<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>
|
|
1331
|
-
<style data-styles>
|
|
1332
|
-
html { visibility:hidden;}
|
|
1333
|
-
</style>
|
|
1334
|
-
${this.content}
|
|
1335
|
-
|
|
1336
|
-
`);
|
|
1292
|
+
frameDoc.write(this.content);
|
|
1293
|
+
frameDoc.write(
|
|
1294
|
+
`<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>`
|
|
1295
|
+
);
|
|
1337
1296
|
frameDoc.close();
|
|
1338
1297
|
_log$6("Popup template loaded into iframe");
|
|
1339
|
-
await this._setupResizeHandler(frame
|
|
1298
|
+
await this._setupResizeHandler(frame);
|
|
1340
1299
|
}
|
|
1341
|
-
async _setupResizeHandler(frame
|
|
1300
|
+
async _setupResizeHandler(frame) {
|
|
1342
1301
|
const { contentWindow } = frame;
|
|
1343
1302
|
if (!contentWindow) {
|
|
1344
1303
|
throw new Error("Frame needs a content window");
|
|
@@ -1346,7 +1305,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1346
1305
|
const frameDoc = contentWindow.document;
|
|
1347
1306
|
domready(frameDoc, async () => {
|
|
1348
1307
|
frameDoc.body.style.overflowY = "hidden";
|
|
1349
|
-
frame.height =
|
|
1308
|
+
frame.height = `${frameDoc.body.offsetHeight}px`;
|
|
1350
1309
|
const ro = new contentWindow["ResizeObserver"]((entries) => {
|
|
1351
1310
|
for (const entry of entries) {
|
|
1352
1311
|
const { top, bottom } = entry.contentRect;
|
|
@@ -1512,11 +1471,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1512
1471
|
engagementMedium: clean.engagementMedium,
|
|
1513
1472
|
container: clean.container,
|
|
1514
1473
|
trigger: clean.trigger,
|
|
1515
|
-
widgetConfig:
|
|
1516
|
-
values: {
|
|
1517
|
-
brandingConfig: response == null ? void 0 : response.brandingConfig
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1474
|
+
widgetConfig: response == null ? void 0 : response.widgetConfig
|
|
1520
1475
|
}),
|
|
1521
1476
|
user: response.user
|
|
1522
1477
|
};
|
|
@@ -1878,264 +1833,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1878
1833
|
}
|
|
1879
1834
|
};
|
|
1880
1835
|
}
|
|
1881
|
-
const getSkeleton = ({
|
|
1882
|
-
type = "verified-access",
|
|
1883
|
-
height = "500px",
|
|
1884
|
-
skeletonBackgroundColor = "#e0e0e0",
|
|
1885
|
-
skeletonShimmerColor = "#f5f5f5"
|
|
1886
|
-
}) => {
|
|
1887
|
-
const referrerHTML = `
|
|
1888
|
-
<div class="hero-section">
|
|
1889
|
-
<div class="hero-content">
|
|
1890
|
-
<div class="skeleton sk-title-lg"></div>
|
|
1891
|
-
<div class="skeleton sk-text"></div>
|
|
1892
|
-
<div class="skeleton sk-text sk-text-short"></div>
|
|
1893
|
-
</div>
|
|
1894
|
-
<div class="skeleton hero-image"></div>
|
|
1895
|
-
</div>
|
|
1896
|
-
|
|
1897
|
-
<div class="share-section">
|
|
1898
|
-
<div class="skeleton sk-label"></div>
|
|
1899
|
-
<div class="skeleton sk-input"></div>
|
|
1900
|
-
<div class="social-buttons">
|
|
1901
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1902
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1903
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1904
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1905
|
-
</div>
|
|
1906
|
-
</div>
|
|
1907
|
-
|
|
1908
|
-
<div class="skeleton sk-title-md" style="margin-top: 0; width: 30%; margin-left: auto; margin-right: auto"></div>
|
|
1909
|
-
<div class="skeleton sk-text" style="width: 60%; margin-left: auto; margin-right: auto"></div>
|
|
1910
|
-
|
|
1911
|
-
<div class="stats-section">
|
|
1912
|
-
<div class="stat-card">
|
|
1913
|
-
<div class="skeleton sk-stat-num"></div>
|
|
1914
|
-
<div class="skeleton sk-stat-label"></div>
|
|
1915
|
-
</div>
|
|
1916
|
-
<div class="stat-card stat-divider">
|
|
1917
|
-
<div class="skeleton sk-stat-num"></div>
|
|
1918
|
-
<div class="skeleton sk-stat-label"></div>
|
|
1919
|
-
</div>
|
|
1920
|
-
</div>
|
|
1921
|
-
|
|
1922
|
-
<div class="skeleton sk-title-md"></div>
|
|
1923
|
-
|
|
1924
|
-
<div class="table-header">
|
|
1925
|
-
<div class="skeleton sk-th col-user"></div>
|
|
1926
|
-
<div class="skeleton sk-th col-status"></div>
|
|
1927
|
-
<div class="skeleton sk-th col-reward"></div>
|
|
1928
|
-
<div class="skeleton sk-th col-date"></div>
|
|
1929
|
-
</div>
|
|
1930
|
-
|
|
1931
|
-
<div class="table-row">
|
|
1932
|
-
<div class="col-user"><div class="skeleton sk-text" style="width: 70%; margin: 0"></div></div>
|
|
1933
|
-
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1934
|
-
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1935
|
-
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1936
|
-
</div>
|
|
1937
|
-
|
|
1938
|
-
<div class="table-row">
|
|
1939
|
-
<div class="col-user"><div class="skeleton sk-text" style="width: 60%; margin: 0"></div></div>
|
|
1940
|
-
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1941
|
-
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1942
|
-
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1943
|
-
</div>
|
|
1944
|
-
|
|
1945
|
-
<div class="table-row">
|
|
1946
|
-
<div class="col-user"><div class="skeleton sk-text" style="width: 75%; margin: 0"></div></div>
|
|
1947
|
-
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1948
|
-
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1949
|
-
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1950
|
-
</div>
|
|
1951
|
-
|
|
1952
|
-
<div class="pagination">
|
|
1953
|
-
<div class="skeleton sk-btn-page"></div>
|
|
1954
|
-
<div class="skeleton sk-btn-page"></div>
|
|
1955
|
-
</div>
|
|
1956
|
-
`;
|
|
1957
|
-
const instantAccessHTML = `
|
|
1958
|
-
<div class="hero-section instant-access-layout">
|
|
1959
|
-
<div class="skeleton hero-image ia-image"></div>
|
|
1960
|
-
|
|
1961
|
-
<div class="hero-content ia-content">
|
|
1962
|
-
<div class="skeleton sk-title-lg ia-center"></div>
|
|
1963
|
-
<div class="skeleton sk-text ia-center"></div>
|
|
1964
|
-
|
|
1965
|
-
<div class="skeleton sk-btn-action"></div>
|
|
1966
|
-
|
|
1967
|
-
<div class="skeleton sk-label"></div>
|
|
1968
|
-
<div class="input-group">
|
|
1969
|
-
<div class="skeleton sk-input"></div>
|
|
1970
|
-
<div class="skeleton sk-btn-copy"></div>
|
|
1971
|
-
</div>
|
|
1972
|
-
|
|
1973
|
-
<div class="skeleton sk-text-short ia-center" style="margin-top: 20px; width: 30%"></div>
|
|
1974
|
-
<div class="skeleton sk-text-short ia-center" style="width: 20%"></div>
|
|
1975
|
-
</div>
|
|
1976
|
-
</div>
|
|
1977
|
-
`;
|
|
1978
|
-
return `
|
|
1979
|
-
<style>
|
|
1980
|
-
* {
|
|
1981
|
-
box-sizing: border-box;
|
|
1982
|
-
padding: 0;
|
|
1983
|
-
margin: 0;
|
|
1984
|
-
}
|
|
1985
|
-
|
|
1986
|
-
.widget-container {
|
|
1987
|
-
background: white;
|
|
1988
|
-
width: 100%;
|
|
1989
|
-
padding: 40px;
|
|
1990
|
-
box-sizing: border-box;
|
|
1991
|
-
overflow: hidden;
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
@keyframes shimmer {
|
|
1995
|
-
0% { background-position: -100% 0; }
|
|
1996
|
-
100% { background-position: 100% 0; }
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
.skeleton {
|
|
2000
|
-
background: ${skeletonBackgroundColor};
|
|
2001
|
-
background: linear-gradient(
|
|
2002
|
-
90deg,
|
|
2003
|
-
${skeletonBackgroundColor} 25%,
|
|
2004
|
-
${skeletonShimmerColor} 50%,
|
|
2005
|
-
${skeletonBackgroundColor} 75%
|
|
2006
|
-
);
|
|
2007
|
-
background-size: 200% 100%;
|
|
2008
|
-
animation: shimmer 1.5s infinite linear;
|
|
2009
|
-
border-radius: 6px;
|
|
2010
|
-
margin-bottom: 12px;
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
/* Typography Skeletons */
|
|
2014
|
-
.sk-title-lg { height: 36px; width: 80%; margin-bottom: 16px; }
|
|
2015
|
-
.sk-title-md { height: 28px; width: 30%; margin-bottom: 20px; margin-top: 40px; }
|
|
2016
|
-
.sk-text { height: 16px; width: 90%; margin-bottom: 8px; }
|
|
2017
|
-
.sk-text-short { width: 40%; }
|
|
2018
|
-
.sk-label { height: 14px; width: 25%; margin-bottom: 10px; }
|
|
2019
|
-
|
|
2020
|
-
/* Layouts */
|
|
2021
|
-
.hero-section {
|
|
2022
|
-
display: flex;
|
|
2023
|
-
gap: 40px;
|
|
2024
|
-
margin-bottom: 40px;
|
|
2025
|
-
padding-bottom: 40px;
|
|
2026
|
-
flex-direction: row;
|
|
2027
|
-
height: 100%;
|
|
2028
|
-
/* Removed border-bottom */
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
|
-
.hero-content {
|
|
2032
|
-
flex: 1;
|
|
2033
|
-
display: flex;
|
|
2034
|
-
flex-direction: column;
|
|
2035
|
-
justify-content: center;
|
|
2036
|
-
}
|
|
2037
|
-
|
|
2038
|
-
.hero-image {
|
|
2039
|
-
flex: 1;
|
|
2040
|
-
height: 300px;
|
|
2041
|
-
border-radius: 12px;
|
|
2042
|
-
}
|
|
2043
|
-
|
|
2044
|
-
/* -- Specific Instant Access Overrides -- */
|
|
2045
|
-
.instant-access-layout {
|
|
2046
|
-
margin-bottom: 0;
|
|
2047
|
-
padding-bottom: 0;
|
|
2048
|
-
align-items: center;
|
|
2049
|
-
}
|
|
2050
|
-
.ia-image {
|
|
2051
|
-
height: 400px;
|
|
2052
|
-
}
|
|
2053
|
-
.ia-center {
|
|
2054
|
-
margin-left: auto;
|
|
2055
|
-
margin-right: auto;
|
|
2056
|
-
}
|
|
2057
|
-
.ia-content {
|
|
2058
|
-
align-items: center;
|
|
2059
|
-
text-align: center;
|
|
2060
|
-
}
|
|
2061
|
-
.sk-btn-action {
|
|
2062
|
-
height: 45px;
|
|
2063
|
-
width: 140px;
|
|
2064
|
-
border-radius: 6px;
|
|
2065
|
-
margin: 24px auto;
|
|
2066
|
-
}
|
|
2067
|
-
.input-group {
|
|
2068
|
-
display: flex;
|
|
2069
|
-
gap: 10px;
|
|
2070
|
-
width: 100%;
|
|
2071
|
-
max-width: 400px;
|
|
2072
|
-
}
|
|
2073
|
-
.sk-btn-copy {
|
|
2074
|
-
height: 50px;
|
|
2075
|
-
width: 120px;
|
|
2076
|
-
border-radius: 8px;
|
|
2077
|
-
}
|
|
2078
|
-
/* ------------------------------------- */
|
|
2079
|
-
|
|
2080
|
-
.share-section { margin-bottom: 40px; }
|
|
2081
|
-
.sk-input { height: 50px; width: 100%; border-radius: 8px; margin-bottom: 16px; }
|
|
2082
|
-
|
|
2083
|
-
.social-buttons { display: flex; gap: 12px; }
|
|
2084
|
-
.sk-btn-social { flex: 1; height: 50px; border-radius: 8px; }
|
|
2085
|
-
|
|
2086
|
-
.stats-section {
|
|
2087
|
-
display: flex;
|
|
2088
|
-
gap: 24px;
|
|
2089
|
-
margin-bottom: 40px;
|
|
2090
|
-
padding: 30px 0;
|
|
2091
|
-
/* Removed border-top and border-bottom */
|
|
2092
|
-
}
|
|
2093
|
-
.stat-card { flex: 1; display: flex; flex-direction: column; align-items: center; }
|
|
2094
|
-
.stat-divider { padding-left: 24px; }
|
|
2095
|
-
.sk-stat-num { height: 48px; width: 120px; margin-bottom: 8px; }
|
|
2096
|
-
.sk-stat-label { height: 18px; width: 80px; }
|
|
2097
|
-
|
|
2098
|
-
/* Table Styles */
|
|
2099
|
-
.table-header { display: flex; gap: 16px; margin-bottom: 16px; }
|
|
2100
|
-
.sk-th { height: 16px; }
|
|
2101
|
-
.table-row {
|
|
2102
|
-
display: flex;
|
|
2103
|
-
align-items: center;
|
|
2104
|
-
gap: 16px;
|
|
2105
|
-
padding: 16px 0;
|
|
2106
|
-
/* Removed border-bottom */
|
|
2107
|
-
}
|
|
2108
|
-
|
|
2109
|
-
.col-user { flex: 2; }
|
|
2110
|
-
.col-status { flex: 1; }
|
|
2111
|
-
.col-reward { flex: 2; }
|
|
2112
|
-
.col-date { flex: 1; }
|
|
2113
|
-
|
|
2114
|
-
.sk-badge { height: 28px; width: 90px; border-radius: 14px; }
|
|
2115
|
-
.sk-reward-block { height: 36px; width: 100%; border-radius: 6px; }
|
|
2116
|
-
|
|
2117
|
-
.pagination { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
|
|
2118
|
-
.sk-btn-page { height: 36px; width: 64px; border-radius: 6px; margin-bottom: 0; }
|
|
2119
|
-
|
|
2120
|
-
@media (max-width: 768px) {
|
|
2121
|
-
body { padding: 20px; }
|
|
2122
|
-
.widget-container { padding: 24px; }
|
|
2123
|
-
|
|
2124
|
-
.hero-section { flex-direction: column-reverse; gap: 24px; }
|
|
2125
|
-
.instant-access-layout { flex-direction: column; }
|
|
2126
|
-
|
|
2127
|
-
.hero-image { height: 220px; width: 100%; }
|
|
2128
|
-
.sk-title-lg { width: 100%; }
|
|
2129
|
-
|
|
2130
|
-
.col-date { display: none; }
|
|
2131
|
-
}
|
|
2132
|
-
</style>
|
|
2133
|
-
|
|
2134
|
-
<div class="widget-container">
|
|
2135
|
-
${type === "verified-access" ? referrerHTML : instantAccessHTML}
|
|
2136
|
-
</div>
|
|
2137
|
-
`;
|
|
2138
|
-
};
|
|
2139
1836
|
const _log$2 = browserExports.debug("squatch-js:decodeUserJwt");
|
|
2140
1837
|
function decodeUserJwt(tokenStr) {
|
|
2141
1838
|
var _a2;
|
|
@@ -2274,12 +1971,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2274
1971
|
domain: (config == null ? void 0 : config.domain) || ((_b = this.config) == null ? void 0 : _b.domain) || DEFAULT_DOMAIN
|
|
2275
1972
|
});
|
|
2276
1973
|
}
|
|
2277
|
-
getWidgetType(widgetType) {
|
|
2278
|
-
if (widgetType && (widgetType.includes("websiteReferralWidget") || widgetType.includes("friendWidget"))) {
|
|
2279
|
-
return "instant-access";
|
|
2280
|
-
}
|
|
2281
|
-
return "verified-access";
|
|
2282
|
-
}
|
|
2283
1974
|
async renderPasswordlessVariant() {
|
|
2284
1975
|
this._setupApis();
|
|
2285
1976
|
_log$1("Rendering as an Instant Access widget");
|
|
@@ -2375,26 +2066,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2375
2066
|
}
|
|
2376
2067
|
}
|
|
2377
2068
|
async connectedCallback() {
|
|
2069
|
+
var _a2, _b;
|
|
2378
2070
|
this.loaded = true;
|
|
2379
2071
|
this.container = this.getAttribute("container");
|
|
2380
|
-
this.widgetType = this.getAttribute("widget") || void 0;
|
|
2381
|
-
console.log("widget type", this.widgetType);
|
|
2382
|
-
const skeletonWidgetType = this.getWidgetType(this.widgetType);
|
|
2383
|
-
const skeletonHTML = getSkeleton({
|
|
2384
|
-
height: "100%",
|
|
2385
|
-
type: skeletonWidgetType
|
|
2386
|
-
});
|
|
2387
|
-
const skeletonContainer = document.createElement("div");
|
|
2388
|
-
skeletonContainer.id = "loading-skeleton";
|
|
2389
|
-
skeletonContainer.innerHTML = skeletonHTML;
|
|
2390
|
-
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2391
|
-
root.innerHTML = "";
|
|
2392
|
-
root.appendChild(skeletonContainer);
|
|
2393
2072
|
await this.renderWidget();
|
|
2394
|
-
const
|
|
2395
|
-
if (
|
|
2396
|
-
loadingElement.remove();
|
|
2397
|
-
}
|
|
2073
|
+
const slot = (_a2 = this.shadowRoot && Array.from(this.shadowRoot.children)) == null ? void 0 : _a2.find((c) => c.tagName === "SLOT");
|
|
2074
|
+
if (slot) (_b = this.shadowRoot) == null ? void 0 : _b.removeChild(slot);
|
|
2398
2075
|
if (this.getAttribute("open") !== null) this.open();
|
|
2399
2076
|
}
|
|
2400
2077
|
}
|
|
@@ -2423,27 +2100,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2423
2100
|
async connectedCallback() {
|
|
2424
2101
|
this.loaded = true;
|
|
2425
2102
|
this.container = this.getAttribute("container");
|
|
2426
|
-
this.widgetType = this.getAttribute("widget") || void 0;
|
|
2427
|
-
const skeletonWidgetType = this.getWidgetType(this.widgetType);
|
|
2428
|
-
const skeletonHTML = getSkeleton({
|
|
2429
|
-
height: "100%",
|
|
2430
|
-
type: skeletonWidgetType
|
|
2431
|
-
});
|
|
2432
|
-
const skeletonContainer = document.createElement("div");
|
|
2433
|
-
skeletonContainer.id = "loading-skeleton";
|
|
2434
|
-
skeletonContainer.innerHTML = skeletonHTML;
|
|
2435
|
-
const root = this.shadowRoot || this.attachShadow({ mode: "open" });
|
|
2436
|
-
const container = root.getElementById("#squatchModal");
|
|
2437
|
-
console.log("Container is ", container);
|
|
2438
|
-
if (container) {
|
|
2439
|
-
container.innerHTML = "";
|
|
2440
|
-
container.appendChild(skeletonContainer);
|
|
2441
|
-
}
|
|
2442
2103
|
await this.renderWidget();
|
|
2443
|
-
const loadingElement = root.getElementById("loading-skeleton");
|
|
2444
|
-
if (loadingElement) {
|
|
2445
|
-
loadingElement.remove();
|
|
2446
|
-
}
|
|
2447
2104
|
if (this.getAttribute("open") !== null) this.open();
|
|
2448
2105
|
}
|
|
2449
2106
|
}
|