surveysparrow-ionic-plugin 2.0.2-beta.1 → 2.0.2-beta.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.
- package/dist/angular-ui/esm2022/spotchecks/SpotCheckComponent.mjs +81 -100
- package/dist/angular-ui/esm2022/spotchecks/SpotCheckEventListener.mjs +26 -0
- package/dist/angular-ui/esm2022/spotchecks/SpotcheckStateService.mjs +1 -3
- package/dist/angular-ui/esm2022/spotchecks/api.mjs +3 -3
- package/dist/angular-ui/esm2022/spotchecks/helpers.mjs +14 -18
- package/dist/angular-ui/esm2022/spotchecks/index.mjs +2 -1
- package/dist/angular-ui/esm2022/spotchecks/types.mjs +1 -1
- package/dist/angular-ui/fesm2022/angular-ui.mjs +120 -122
- package/dist/angular-ui/fesm2022/angular-ui.mjs.map +1 -1
- package/dist/angular-ui/spotchecks/SpotCheckComponent.d.ts +10 -5
- package/dist/angular-ui/spotchecks/SpotCheckEventListener.d.ts +16 -0
- package/dist/angular-ui/spotchecks/helpers.d.ts +1 -2
- package/dist/angular-ui/spotchecks/index.d.ts +1 -0
- package/dist/angular-ui/spotchecks/types.d.ts +0 -2
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.d.ts +10 -5
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.js +75 -95
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckEventListener.d.ts +16 -0
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckEventListener.js +28 -0
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckEventListener.js.map +1 -0
- package/dist/esm/angular-ui/lib/spotchecks/SpotcheckStateService.js +0 -2
- package/dist/esm/angular-ui/lib/spotchecks/SpotcheckStateService.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/api.js +3 -4
- package/dist/esm/angular-ui/lib/spotchecks/api.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/helpers.d.ts +1 -2
- package/dist/esm/angular-ui/lib/spotchecks/helpers.js +15 -18
- package/dist/esm/angular-ui/lib/spotchecks/helpers.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/index.d.ts +1 -0
- package/dist/esm/angular-ui/lib/spotchecks/index.js +1 -0
- package/dist/esm/angular-ui/lib/spotchecks/index.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/types.d.ts +0 -2
- package/dist/esm/angular-ui/lib/spotchecks/types.js.map +1 -1
- package/dist/plugin.cjs.js +116 -116
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +116 -116
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
- package/src/angular-ui/lib/spotchecks/SpotCheckComponent.ts +76 -98
- package/src/angular-ui/lib/spotchecks/SpotCheckEventListener.ts +50 -0
- package/src/angular-ui/lib/spotchecks/SpotcheckStateService.ts +0 -2
- package/src/angular-ui/lib/spotchecks/api.ts +4 -4
- package/src/angular-ui/lib/spotchecks/helpers.ts +14 -23
- package/src/angular-ui/lib/spotchecks/index.ts +3 -0
- package/src/angular-ui/lib/spotchecks/types.ts +0 -2
package/dist/plugin.js
CHANGED
|
@@ -51098,8 +51098,6 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51098
51098
|
traceId: '',
|
|
51099
51099
|
isClassicLoading: true,
|
|
51100
51100
|
isChatLoading: true,
|
|
51101
|
-
isClassicLoadEventReceived: false,
|
|
51102
|
-
isChatLoadEventReceived: false,
|
|
51103
51101
|
classicUrl: '',
|
|
51104
51102
|
chatUrl: '',
|
|
51105
51103
|
classicWebViewRef: null,
|
|
@@ -51134,8 +51132,34 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51134
51132
|
})
|
|
51135
51133
|
], SpotcheckStateService);
|
|
51136
51134
|
|
|
51135
|
+
class SpotCheckEventListenerService {
|
|
51136
|
+
constructor() {
|
|
51137
|
+
this.eventSubject = new Subject();
|
|
51138
|
+
this.event$ = this.eventSubject.asObservable();
|
|
51139
|
+
}
|
|
51140
|
+
emit(type, data) {
|
|
51141
|
+
this.eventSubject.next({ type, data });
|
|
51142
|
+
}
|
|
51143
|
+
addListener(eventType, callback) {
|
|
51144
|
+
return this.event$.subscribe((event) => {
|
|
51145
|
+
if (event.type === eventType) {
|
|
51146
|
+
callback(event.data);
|
|
51147
|
+
}
|
|
51148
|
+
});
|
|
51149
|
+
}
|
|
51150
|
+
}
|
|
51151
|
+
let globalInstance;
|
|
51152
|
+
const getSpotCheckEventListener = () => {
|
|
51153
|
+
if (!globalInstance) {
|
|
51154
|
+
globalInstance = new SpotCheckEventListenerService();
|
|
51155
|
+
}
|
|
51156
|
+
return globalInstance;
|
|
51157
|
+
};
|
|
51158
|
+
const addSpotCheckListener = (eventType, callback) => {
|
|
51159
|
+
return getSpotCheckEventListener().addListener(eventType, callback);
|
|
51160
|
+
};
|
|
51161
|
+
|
|
51137
51162
|
let globalSpotcheckStateService;
|
|
51138
|
-
let globalOS = null;
|
|
51139
51163
|
const getSpotcheckStateService = () => {
|
|
51140
51164
|
if (!globalSpotcheckStateService) {
|
|
51141
51165
|
globalSpotcheckStateService = new SpotcheckStateService();
|
|
@@ -51155,11 +51179,10 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51155
51179
|
};
|
|
51156
51180
|
const getOS = async () => {
|
|
51157
51181
|
const info = await device.Device.getInfo();
|
|
51158
|
-
|
|
51159
|
-
return globalOS;
|
|
51182
|
+
return info.operatingSystem;
|
|
51160
51183
|
};
|
|
51161
51184
|
const setAppearance = async (responseJson, screen, domainName, traceId, variables) => {
|
|
51162
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
51185
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
51163
51186
|
try {
|
|
51164
51187
|
const spotcheckStateService = getSpotcheckStateService();
|
|
51165
51188
|
let state = spotcheckStateService.getState();
|
|
@@ -51206,11 +51229,11 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51206
51229
|
spotcheckStateService.setState(updatedState);
|
|
51207
51230
|
try {
|
|
51208
51231
|
const response = await axios.get(fullSpotcheckURL);
|
|
51209
|
-
const themeInfo =
|
|
51232
|
+
const themeInfo = response.data.config.generatedCSS;
|
|
51210
51233
|
const theme_payload = { type: 'THEME_UPDATE_SPOTCHECK', themeInfo };
|
|
51211
51234
|
state = spotcheckStateService.getState();
|
|
51212
51235
|
let webViewRef = chat ? state.chatWebViewRef : state.classicWebViewRef;
|
|
51213
|
-
let isLoading = chat ? state.isChatLoading
|
|
51236
|
+
let isLoading = chat ? state.isChatLoading : state.isClassicLoading;
|
|
51214
51237
|
const resetStateData = {
|
|
51215
51238
|
type: 'RESET_STATE',
|
|
51216
51239
|
state: Object.assign(Object.assign({}, (response.data || {})), { skip: true, spotCheckAppearance: Object.assign(Object.assign({}, (appearance || {})), { targetType: 'MOBILE' }), spotcheckUrl: screen, traceId, elementBuilderParams: Object.assign({}, (variables || {})) }),
|
|
@@ -51241,8 +51264,8 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51241
51264
|
else {
|
|
51242
51265
|
// todo: recheck this
|
|
51243
51266
|
const unsubscribe = spotcheckStateService.state$.subscribe((currentState) => {
|
|
51244
|
-
const { isChatLoading, isClassicLoading, chatWebViewRef, classicWebViewRef,
|
|
51245
|
-
if ((!isChatLoading && chat
|
|
51267
|
+
const { isChatLoading, isClassicLoading, chatWebViewRef, classicWebViewRef, } = currentState;
|
|
51268
|
+
if ((!isChatLoading && chat) || (!isClassicLoading && !chat)) {
|
|
51246
51269
|
unsubscribe.unsubscribe();
|
|
51247
51270
|
const activeWebViewRef = chat
|
|
51248
51271
|
? chatWebViewRef
|
|
@@ -51265,8 +51288,8 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51265
51288
|
? currentState.chatWebViewRef
|
|
51266
51289
|
: currentState.classicWebViewRef;
|
|
51267
51290
|
const updatedIsLoading = chat
|
|
51268
|
-
? currentState.isChatLoading
|
|
51269
|
-
: currentState.isClassicLoading
|
|
51291
|
+
? currentState.isChatLoading
|
|
51292
|
+
: currentState.isClassicLoading;
|
|
51270
51293
|
if (updatedWebViewRef) {
|
|
51271
51294
|
if (!updatedIsLoading) {
|
|
51272
51295
|
unsubscribeWebView.unsubscribe();
|
|
@@ -51312,7 +51335,10 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51312
51335
|
},
|
|
51313
51336
|
body: JSON.stringify(payload),
|
|
51314
51337
|
});
|
|
51315
|
-
if (response.status
|
|
51338
|
+
if (response.status == 200) {
|
|
51339
|
+
getSpotCheckEventListener().emit('surveyDismissed');
|
|
51340
|
+
}
|
|
51341
|
+
else {
|
|
51316
51342
|
console.log(`Error: ${response.status}`);
|
|
51317
51343
|
}
|
|
51318
51344
|
}
|
|
@@ -51369,15 +51395,11 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51369
51395
|
height: '100%',
|
|
51370
51396
|
};
|
|
51371
51397
|
}
|
|
51372
|
-
let marginBottom = globalOS !== 'ios' ? 18 : 0;
|
|
51373
51398
|
if (state.isVisible && state.isMounted) {
|
|
51374
51399
|
let height = Math.min(state.currentQuestionHeight, (state.maxHeight * window.innerHeight));
|
|
51375
51400
|
if (state.spotChecksMode === 'miniCard') {
|
|
51376
51401
|
if (state.avatarEnabled) {
|
|
51377
51402
|
height = height - 56;
|
|
51378
|
-
if (state.spotcheckPosition === 'bottom') {
|
|
51379
|
-
marginBottom += 56;
|
|
51380
|
-
}
|
|
51381
51403
|
}
|
|
51382
51404
|
if (state.isCloseButtonEnabled) {
|
|
51383
51405
|
height = height - 40;
|
|
@@ -51420,12 +51442,11 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51420
51442
|
}
|
|
51421
51443
|
}
|
|
51422
51444
|
return {
|
|
51423
|
-
wrapperStyles: Object.assign({ position: 'fixed', width: '100%', height: '100%', top: '0', left: '0', backgroundColor: 'rgba(0, 0, 0, 0.3)', zIndex: '
|
|
51424
|
-
styles: Object.assign({ display: 'none', flexDirection: 'column', paddingTop: extraPaddingForMiniCardCloseButtonIfTopPosition + 'px'
|
|
51445
|
+
wrapperStyles: Object.assign({ position: 'fixed', width: '100%', height: '100%', top: '0', left: '0', backgroundColor: 'rgba(0, 0, 0, 0.3)', zIndex: '99999999', display: 'none', flexDirection: 'column' }, wrapperStyles),
|
|
51446
|
+
styles: Object.assign({ display: 'none', flexDirection: 'column', paddingTop: extraPaddingForMiniCardCloseButtonIfTopPosition + 'px' }, styles)
|
|
51425
51447
|
};
|
|
51426
51448
|
};
|
|
51427
51449
|
const closeSpotCheckAndHandleSurveyEnd = async () => {
|
|
51428
|
-
await closeSpotCheck();
|
|
51429
51450
|
handleSurveyEnd();
|
|
51430
51451
|
};
|
|
51431
51452
|
|
|
@@ -51439,8 +51460,10 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51439
51460
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
51440
51461
|
};
|
|
51441
51462
|
let WebViewComponent = class WebViewComponent {
|
|
51442
|
-
constructor(sanitizer) {
|
|
51463
|
+
constructor(sanitizer, ngZone, cdr) {
|
|
51443
51464
|
this.sanitizer = sanitizer;
|
|
51465
|
+
this.ngZone = ngZone;
|
|
51466
|
+
this.cdr = cdr;
|
|
51444
51467
|
this.url = '';
|
|
51445
51468
|
this.webviewType = 'classic';
|
|
51446
51469
|
this.isMiniCard = false;
|
|
@@ -51471,90 +51494,51 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51471
51494
|
setupIframeLoadListener() {
|
|
51472
51495
|
const iframe = this.iframe.nativeElement;
|
|
51473
51496
|
iframe.addEventListener('load', () => {
|
|
51474
|
-
this.
|
|
51475
|
-
|
|
51476
|
-
|
|
51477
|
-
|
|
51478
|
-
}
|
|
51479
|
-
else {
|
|
51480
|
-
stateService.setState({ isChatLoading: false });
|
|
51481
|
-
}
|
|
51482
|
-
});
|
|
51483
|
-
}
|
|
51484
|
-
injectNativeBridgeAdapters(iframe) {
|
|
51485
|
-
if (iframe && iframe.contentWindow) {
|
|
51486
|
-
try {
|
|
51487
|
-
const iframeWindow = iframe.contentWindow;
|
|
51488
|
-
if (!iframeWindow.SsAndroidSdk) {
|
|
51489
|
-
iframeWindow.SsAndroidSdk = {
|
|
51490
|
-
shareData: function () { },
|
|
51491
|
-
sendPartialSubmissionData: function () { }
|
|
51492
|
-
};
|
|
51493
|
-
}
|
|
51494
|
-
if (!iframeWindow.Android) {
|
|
51495
|
-
iframeWindow.Android = {
|
|
51496
|
-
onMessageReceive: function () { }
|
|
51497
|
-
};
|
|
51498
|
-
}
|
|
51499
|
-
if (!iframeWindow.webkit) {
|
|
51500
|
-
iframeWindow.webkit = {
|
|
51501
|
-
messageHandlers: {
|
|
51502
|
-
surveyResponse: {
|
|
51503
|
-
postMessage: function () { }
|
|
51504
|
-
},
|
|
51505
|
-
spotCheckData: {
|
|
51506
|
-
postMessage: function () { }
|
|
51507
|
-
},
|
|
51508
|
-
flutterSpotCheckData: {
|
|
51509
|
-
postMessage: function () { }
|
|
51510
|
-
}
|
|
51511
|
-
}
|
|
51512
|
-
};
|
|
51497
|
+
this.ngZone.run(() => {
|
|
51498
|
+
const stateService = getSpotcheckStateService();
|
|
51499
|
+
if (this.webviewType === 'classic') {
|
|
51500
|
+
stateService.setState({ isClassicLoading: false });
|
|
51513
51501
|
}
|
|
51514
|
-
|
|
51515
|
-
|
|
51516
|
-
postMessage: function () { }
|
|
51517
|
-
};
|
|
51502
|
+
else {
|
|
51503
|
+
stateService.setState({ isChatLoading: false });
|
|
51518
51504
|
}
|
|
51519
|
-
}
|
|
51520
|
-
|
|
51521
|
-
}
|
|
51505
|
+
});
|
|
51506
|
+
});
|
|
51522
51507
|
}
|
|
51523
51508
|
onMessage(event) {
|
|
51524
|
-
|
|
51525
|
-
|
|
51526
|
-
|
|
51527
|
-
|
|
51528
|
-
|
|
51529
|
-
|
|
51530
|
-
|
|
51531
|
-
|
|
51532
|
-
|
|
51533
|
-
|
|
51534
|
-
|
|
51535
|
-
|
|
51536
|
-
|
|
51537
|
-
|
|
51538
|
-
|
|
51539
|
-
|
|
51540
|
-
|
|
51509
|
+
this.ngZone.run(() => {
|
|
51510
|
+
const stateService = getSpotcheckStateService();
|
|
51511
|
+
const { data } = event;
|
|
51512
|
+
switch (data.type) {
|
|
51513
|
+
case 'slideInFrame':
|
|
51514
|
+
if (data.mounted) {
|
|
51515
|
+
stateService.setState({ isMounted: true });
|
|
51516
|
+
}
|
|
51517
|
+
break;
|
|
51518
|
+
case 'resizeWindow':
|
|
51519
|
+
if (data.size) {
|
|
51520
|
+
stateService.setState({
|
|
51521
|
+
currentQuestionHeight: data.size.height,
|
|
51522
|
+
});
|
|
51523
|
+
}
|
|
51524
|
+
else if (data.isCloseButtonEnabled) {
|
|
51525
|
+
stateService.setState({
|
|
51526
|
+
isCloseButtonEnabled: data.isCloseButtonEnabled,
|
|
51527
|
+
});
|
|
51528
|
+
}
|
|
51529
|
+
break;
|
|
51530
|
+
case 'surveyCompleted':
|
|
51531
|
+
closeSpotCheckAndHandleSurveyEnd().then(() => {
|
|
51532
|
+
getSpotCheckEventListener().emit('surveyCompleted', data.response);
|
|
51533
|
+
this.cdr.detectChanges();
|
|
51541
51534
|
});
|
|
51542
|
-
|
|
51543
|
-
|
|
51544
|
-
|
|
51545
|
-
|
|
51546
|
-
|
|
51547
|
-
|
|
51548
|
-
|
|
51549
|
-
// spotchecksListener.emitSurveyLoadStarted(data.surveyDetails);
|
|
51550
|
-
break;
|
|
51551
|
-
case 'classicLoadEvent':
|
|
51552
|
-
stateService.setState({ isClassicLoadEventReceived: true });
|
|
51553
|
-
break;
|
|
51554
|
-
case 'chatLoadEvent':
|
|
51555
|
-
stateService.setState({ isChatLoadEventReceived: true });
|
|
51556
|
-
break;
|
|
51557
|
-
}
|
|
51535
|
+
break;
|
|
51536
|
+
case 'surveyLoadStarted':
|
|
51537
|
+
getSpotCheckEventListener().emit('surveyLoadStarted', data.surveyDetails);
|
|
51538
|
+
break;
|
|
51539
|
+
}
|
|
51540
|
+
this.cdr.detectChanges();
|
|
51541
|
+
});
|
|
51558
51542
|
}
|
|
51559
51543
|
};
|
|
51560
51544
|
__decorate$1([
|
|
@@ -51585,8 +51569,7 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51585
51569
|
template: `
|
|
51586
51570
|
<div style="overflow: hidden; height: 100%; border-radius: {{isMiniCard ? 12 : 0}}px; padding-left: {{isMiniCard ? 12 : 0}}px; padding-right: {{isMiniCard ? 12 : 0}}px; box-sizing: border-box;">
|
|
51587
51571
|
<iframe
|
|
51588
|
-
allow="camera; microphone; geolocation; display-capture; autoplay; clipboard-read; clipboard-write;
|
|
51589
|
-
allowfullscreen
|
|
51572
|
+
allow="camera; microphone; geolocation; display-capture; autoplay; clipboard-read; clipboard-write;"
|
|
51590
51573
|
#iframeRef
|
|
51591
51574
|
[src]="safeUrl"
|
|
51592
51575
|
style="width: 100%; height: 100%; display: block; border-radius: {{isMiniCard ? 12 : 0}}px;"
|
|
@@ -51598,7 +51581,9 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51598
51581
|
standalone: true,
|
|
51599
51582
|
imports: [CommonModule],
|
|
51600
51583
|
}),
|
|
51601
|
-
__metadata("design:paramtypes", [DomSanitizer
|
|
51584
|
+
__metadata("design:paramtypes", [DomSanitizer,
|
|
51585
|
+
NgZone,
|
|
51586
|
+
ChangeDetectorRef])
|
|
51602
51587
|
], WebViewComponent);
|
|
51603
51588
|
let CloseSVGComponent = class CloseSVGComponent {
|
|
51604
51589
|
constructor() {
|
|
@@ -51644,7 +51629,9 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51644
51629
|
})
|
|
51645
51630
|
], CloseSVGComponent);
|
|
51646
51631
|
let CloseButtonComponent = class CloseButtonComponent {
|
|
51647
|
-
constructor() {
|
|
51632
|
+
constructor(ngZone, cdr) {
|
|
51633
|
+
this.ngZone = ngZone;
|
|
51634
|
+
this.cdr = cdr;
|
|
51648
51635
|
this.size = 30;
|
|
51649
51636
|
this.strokeWidth = 1.2;
|
|
51650
51637
|
this.isVisible = false;
|
|
@@ -51653,13 +51640,19 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51653
51640
|
this.onClick = async () => {
|
|
51654
51641
|
await closeSpotCheck();
|
|
51655
51642
|
handleSurveyEnd();
|
|
51643
|
+
this.ngZone.run(() => {
|
|
51644
|
+
this.cdr.detectChanges();
|
|
51645
|
+
});
|
|
51656
51646
|
};
|
|
51657
51647
|
this.stateService = getSpotcheckStateService();
|
|
51658
51648
|
this.state = this.stateService.getState();
|
|
51659
51649
|
this.updateComponentState();
|
|
51660
51650
|
this.stateSubscription = this.stateService.state$.subscribe((newState) => {
|
|
51661
|
-
this.
|
|
51662
|
-
|
|
51651
|
+
this.ngZone.run(() => {
|
|
51652
|
+
this.state = newState;
|
|
51653
|
+
this.updateComponentState();
|
|
51654
|
+
this.cdr.detectChanges();
|
|
51655
|
+
});
|
|
51663
51656
|
});
|
|
51664
51657
|
}
|
|
51665
51658
|
ngOnDestroy() {
|
|
@@ -51703,10 +51696,13 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51703
51696
|
standalone: true,
|
|
51704
51697
|
imports: [CommonModule, CloseSVGComponent],
|
|
51705
51698
|
}),
|
|
51706
|
-
__metadata("design:paramtypes", [
|
|
51699
|
+
__metadata("design:paramtypes", [NgZone,
|
|
51700
|
+
ChangeDetectorRef])
|
|
51707
51701
|
], CloseButtonComponent);
|
|
51708
51702
|
let SpotCheckComponent = class SpotCheckComponent {
|
|
51709
|
-
constructor() {
|
|
51703
|
+
constructor(ngZone, cdr) {
|
|
51704
|
+
this.ngZone = ngZone;
|
|
51705
|
+
this.cdr = cdr;
|
|
51710
51706
|
this.componentStyles = {};
|
|
51711
51707
|
this.avatarUrl = '';
|
|
51712
51708
|
this.initializeComponent = async () => {
|
|
@@ -51749,9 +51745,12 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51749
51745
|
this.state = this.spotcheckStateService.getState();
|
|
51750
51746
|
this.updateComponentStyles();
|
|
51751
51747
|
this.stateSubscription = this.spotcheckStateService.state$.subscribe((newState) => {
|
|
51752
|
-
this.
|
|
51753
|
-
|
|
51754
|
-
|
|
51748
|
+
this.ngZone.run(() => {
|
|
51749
|
+
this.state = newState;
|
|
51750
|
+
this.updateComponentStyles();
|
|
51751
|
+
this.avatarUrl = this.state.avatarUrl || "https://static.surveysparrow.com/application/images/profile.png";
|
|
51752
|
+
this.cdr.detectChanges();
|
|
51753
|
+
});
|
|
51755
51754
|
});
|
|
51756
51755
|
}
|
|
51757
51756
|
ngOnInit() {
|
|
@@ -51774,7 +51773,8 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51774
51773
|
standalone: true,
|
|
51775
51774
|
imports: [CommonModule, WebViewComponent, CloseButtonComponent],
|
|
51776
51775
|
}),
|
|
51777
|
-
__metadata("design:paramtypes", [
|
|
51776
|
+
__metadata("design:paramtypes", [NgZone,
|
|
51777
|
+
ChangeDetectorRef])
|
|
51778
51778
|
], SpotCheckComponent);
|
|
51779
51779
|
|
|
51780
51780
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -51802,7 +51802,6 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51802
51802
|
};
|
|
51803
51803
|
|
|
51804
51804
|
const sendTrackScreenRequest = async ({ screen, options, }) => {
|
|
51805
|
-
var _a, _b;
|
|
51806
51805
|
try {
|
|
51807
51806
|
const spotcheckStateService = getSpotcheckStateService();
|
|
51808
51807
|
const oldState = spotcheckStateService.getState();
|
|
@@ -51921,7 +51920,7 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51921
51920
|
}
|
|
51922
51921
|
}
|
|
51923
51922
|
}
|
|
51924
|
-
throw new Error(
|
|
51923
|
+
throw new Error(responseJson === null || responseJson === void 0 ? void 0 : responseJson.reason.toString());
|
|
51925
51924
|
}
|
|
51926
51925
|
else {
|
|
51927
51926
|
throw new Error(`Received status code ${response.status}`);
|
|
@@ -51932,7 +51931,7 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
51932
51931
|
}
|
|
51933
51932
|
};
|
|
51934
51933
|
const sendTrackEventRequest = async ({ screen, event }) => {
|
|
51935
|
-
var _a, _b, _c, _d, _e, _f
|
|
51934
|
+
var _a, _b, _c, _d, _e, _f;
|
|
51936
51935
|
try {
|
|
51937
51936
|
const intMax = Number.POSITIVE_INFINITY;
|
|
51938
51937
|
const state = getSpotcheckStateService().getState();
|
|
@@ -52005,7 +52004,7 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
52005
52004
|
return { valid: true };
|
|
52006
52005
|
}
|
|
52007
52006
|
}
|
|
52008
|
-
throw new Error(
|
|
52007
|
+
throw new Error(responseJson === null || responseJson === void 0 ? void 0 : responseJson.reason.toString());
|
|
52009
52008
|
}
|
|
52010
52009
|
else {
|
|
52011
52010
|
throw new Error(`Received status code ${response.status}`);
|
|
@@ -52081,6 +52080,7 @@ Please check that 1) the type for the parameter at index ${index} is correct and
|
|
|
52081
52080
|
const SurveySparrowIonicPlugin = core.registerPlugin('SurveySparrowIonicPlugin');
|
|
52082
52081
|
|
|
52083
52082
|
exports.SurveySparrowIonicPlugin = SurveySparrowIonicPlugin;
|
|
52083
|
+
exports.addSpotCheckListener = addSpotCheckListener;
|
|
52084
52084
|
exports.initializeSpotChecks = initializeSpotChecks;
|
|
52085
52085
|
exports.trackEvent = trackEvent;
|
|
52086
52086
|
exports.trackScreen = trackScreen;
|