smartcomply-web-sdk 1.0.34 → 1.0.36
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/esm/flow/DocumentCapture.d.ts +2 -0
- package/dist/esm/flow/DocumentCapture.d.ts.map +1 -1
- package/dist/esm/flow/DocumentCapture.js +128 -114
- package/dist/esm/flow/DocumentCapture.js.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/esm/flow/SmartComplyFlow.js +56 -42
- package/dist/esm/flow/SmartComplyFlow.js.map +1 -1
- package/dist/esm/modules/liveness/LivenessUI.js +11 -7
- package/dist/esm/modules/liveness/LivenessUI.js.map +1 -1
- package/dist/flow/DocumentCapture.d.ts +2 -0
- package/dist/flow/DocumentCapture.d.ts.map +1 -1
- package/dist/flow/DocumentCapture.js +128 -114
- package/dist/flow/DocumentCapture.js.map +1 -1
- package/dist/flow/SmartComplyFlow.d.ts.map +1 -1
- package/dist/flow/SmartComplyFlow.js +56 -42
- package/dist/flow/SmartComplyFlow.js.map +1 -1
- package/dist/modules/liveness/LivenessUI.js +11 -7
- package/dist/modules/liveness/LivenessUI.js.map +1 -1
- package/dist/smartcomply.browser.js +163 -152
- package/dist/smartcomply.browser.js.map +3 -3
- package/package.json +1 -1
|
@@ -4925,7 +4925,10 @@ var SmartComplySDK = (() => {
|
|
|
4925
4925
|
docVideo.play().catch(() => {
|
|
4926
4926
|
});
|
|
4927
4927
|
const cleanup = () => {
|
|
4928
|
-
|
|
4928
|
+
try {
|
|
4929
|
+
docRoot.remove();
|
|
4930
|
+
} catch (_2) {
|
|
4931
|
+
}
|
|
4929
4932
|
this.docCaptureRoot = null;
|
|
4930
4933
|
};
|
|
4931
4934
|
const captureBtn = bottomPanel.querySelector("#sc-capture-doc-btn");
|
|
@@ -4968,12 +4971,14 @@ var SmartComplySDK = (() => {
|
|
|
4968
4971
|
}
|
|
4969
4972
|
unmount() {
|
|
4970
4973
|
this.stopTimer();
|
|
4971
|
-
|
|
4972
|
-
this.docCaptureRoot
|
|
4973
|
-
|
|
4974
|
+
try {
|
|
4975
|
+
this.docCaptureRoot?.remove();
|
|
4976
|
+
} catch (_2) {
|
|
4974
4977
|
}
|
|
4975
|
-
|
|
4976
|
-
|
|
4978
|
+
this.docCaptureRoot = null;
|
|
4979
|
+
try {
|
|
4980
|
+
this.root?.remove();
|
|
4981
|
+
} catch (_2) {
|
|
4977
4982
|
}
|
|
4978
4983
|
this.root = null;
|
|
4979
4984
|
this.videoEl = null;
|
|
@@ -5655,133 +5660,135 @@ var SmartComplySDK = (() => {
|
|
|
5655
5660
|
}
|
|
5656
5661
|
requiresBackSide(documentType) {
|
|
5657
5662
|
const type = documentType.toLowerCase();
|
|
5658
|
-
return type.includes("voter") || type.includes("
|
|
5663
|
+
return type.includes("voter") || type.includes("driver") || type.includes("license") || type.includes("national id") || type.includes("national id card") || type.includes("ghana");
|
|
5659
5664
|
}
|
|
5660
5665
|
shouldCaptureBackSide(documentType) {
|
|
5661
5666
|
return this.requiresBackOverride !== void 0 ? this.requiresBackOverride : this.requiresBackSide(documentType);
|
|
5662
5667
|
}
|
|
5663
5668
|
renderChoiceScreen(container, theme, documentType) {
|
|
5664
5669
|
this.root = document.createElement("div");
|
|
5665
|
-
this.root.style.cssText =
|
|
5670
|
+
this.root.style.cssText = `
|
|
5671
|
+
display:flex;flex-direction:column;gap:0;padding:0;width:100%;
|
|
5672
|
+
font-family:system-ui,-apple-system,sans-serif;
|
|
5673
|
+
`;
|
|
5666
5674
|
const docLabel = this.getDocumentLabel(documentType);
|
|
5667
5675
|
const requiresBack = this.shouldCaptureBackSide(documentType);
|
|
5668
5676
|
const isCapturingFront = this.currentSide === "front";
|
|
5669
|
-
const
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5677
|
+
const sideLabel = requiresBack ? isCapturingFront ? " \u2014 Front side" : " \u2014 Back side" : "";
|
|
5678
|
+
const headerRow = document.createElement("div");
|
|
5679
|
+
headerRow.style.cssText = `
|
|
5680
|
+
display:flex;align-items:center;gap:14px;
|
|
5681
|
+
padding:16px 20px 14px;
|
|
5682
|
+
`;
|
|
5683
|
+
const iconBox = document.createElement("div");
|
|
5684
|
+
iconBox.style.cssText = `
|
|
5685
|
+
width:48px;height:48px;border-radius:14px;flex-shrink:0;
|
|
5674
5686
|
display:flex;align-items:center;justify-content:center;
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
box-shadow:0 8px 32px ${theme.primary}20;
|
|
5687
|
+
font-size:24px;
|
|
5688
|
+
background:${theme.primary}15;
|
|
5689
|
+
border:1.5px solid ${theme.primary}30;
|
|
5679
5690
|
`;
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
<div style="display:flex;gap:8px;align-items:center;">
|
|
5718
|
-
<div style="width:12px;height:12px;border-radius:50%;background:${isCapturingFront ? theme.primary : theme.border};transition:all 0.3s ease;"></div>
|
|
5719
|
-
<div style="width:32px;height:2px;background:${theme.border};border-radius:1px;"></div>
|
|
5720
|
-
<div style="width:12px;height:12px;border-radius:50%;background:${!isCapturingFront ? theme.primary : theme.border};transition:all 0.3s ease;"></div>
|
|
5721
|
-
</div>
|
|
5722
|
-
<span style="color:${theme.text};font-size:13px;font-weight:600;">${isCapturingFront ? "Step 1 of 2" : "Step 2 of 2"}</span>
|
|
5723
|
-
`;
|
|
5724
|
-
this.root.appendChild(progress);
|
|
5725
|
-
}
|
|
5726
|
-
const actionsContainer = document.createElement("div");
|
|
5727
|
-
actionsContainer.style.cssText = "display:flex;flex-direction:column;gap:16px;width:100%;max-width:320px;";
|
|
5728
|
-
const cameraBtn = this.createEnhancedButton(
|
|
5729
|
-
"\u{1F4F7} Take Photo with Camera",
|
|
5730
|
-
theme,
|
|
5731
|
-
true,
|
|
5732
|
-
"Open camera to capture document"
|
|
5733
|
-
);
|
|
5691
|
+
iconBox.textContent = this._docIcon(documentType);
|
|
5692
|
+
const titleBlock = document.createElement("div");
|
|
5693
|
+
const titleEl = document.createElement("div");
|
|
5694
|
+
titleEl.style.cssText = `color:${theme.text};font-size:16px;font-weight:700;line-height:1.3;`;
|
|
5695
|
+
titleEl.textContent = `Capture your ${docLabel}`;
|
|
5696
|
+
const subEl = document.createElement("div");
|
|
5697
|
+
subEl.style.cssText = `color:${theme.textSecondary};font-size:12px;margin-top:2px;`;
|
|
5698
|
+
subEl.textContent = requiresBack ? isCapturingFront ? "Step 1 of 2 \u2014 front side" : "Step 2 of 2 \u2014 back side" : "Choose how to provide your document";
|
|
5699
|
+
titleBlock.appendChild(titleEl);
|
|
5700
|
+
titleBlock.appendChild(subEl);
|
|
5701
|
+
headerRow.appendChild(iconBox);
|
|
5702
|
+
headerRow.appendChild(titleBlock);
|
|
5703
|
+
this.root.appendChild(headerRow);
|
|
5704
|
+
const btnRow = document.createElement("div");
|
|
5705
|
+
btnRow.style.cssText = `
|
|
5706
|
+
display:grid;grid-template-columns:1fr 1fr;gap:10px;
|
|
5707
|
+
padding:0 20px 14px;
|
|
5708
|
+
`;
|
|
5709
|
+
const cameraBtn = document.createElement("button");
|
|
5710
|
+
cameraBtn.style.cssText = `
|
|
5711
|
+
display:flex;flex-direction:column;align-items:center;justify-content:center;
|
|
5712
|
+
gap:8px;padding:16px 12px;
|
|
5713
|
+
background:${theme.primary};color:#fff;
|
|
5714
|
+
border:none;border-radius:14px;cursor:pointer;
|
|
5715
|
+
font-size:13px;font-weight:600;font-family:inherit;
|
|
5716
|
+
transition:all 0.15s ease;min-height:80px;
|
|
5717
|
+
box-shadow:0 4px 14px ${theme.primary}30;
|
|
5718
|
+
`;
|
|
5719
|
+
cameraBtn.innerHTML = `<span style="font-size:26px;">\u{1F4F7}</span><span>Take Photo</span><span style="font-size:10px;opacity:0.8;font-weight:500;">Use camera</span>`;
|
|
5720
|
+
cameraBtn.addEventListener("mouseenter", () => {
|
|
5721
|
+
cameraBtn.style.opacity = "0.9";
|
|
5722
|
+
cameraBtn.style.transform = "translateY(-1px)";
|
|
5723
|
+
});
|
|
5724
|
+
cameraBtn.addEventListener("mouseleave", () => {
|
|
5725
|
+
cameraBtn.style.opacity = "1";
|
|
5726
|
+
cameraBtn.style.transform = "none";
|
|
5727
|
+
});
|
|
5734
5728
|
cameraBtn.addEventListener("click", () => {
|
|
5735
|
-
this.showLoadingState("Opening camera...", theme);
|
|
5736
5729
|
this.root.innerHTML = "";
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5730
|
+
this.renderCameraView(this.root, theme, documentType);
|
|
5731
|
+
});
|
|
5732
|
+
const uploadBtn = document.createElement("button");
|
|
5733
|
+
uploadBtn.style.cssText = `
|
|
5734
|
+
display:flex;flex-direction:column;align-items:center;justify-content:center;
|
|
5735
|
+
gap:8px;padding:16px 12px;
|
|
5736
|
+
background:${theme.cardBg || theme.inputBg};color:${theme.text};
|
|
5737
|
+
border:2px solid ${theme.border};border-radius:14px;cursor:pointer;
|
|
5738
|
+
font-size:13px;font-weight:600;font-family:inherit;
|
|
5739
|
+
transition:all 0.15s ease;min-height:80px;
|
|
5740
|
+
`;
|
|
5741
|
+
uploadBtn.innerHTML = `<span style="font-size:26px;">\u{1F5BC}\uFE0F</span><span>From Gallery</span><span style="font-size:10px;color:${theme.textMuted || theme.textSecondary};font-weight:500;">Upload file</span>`;
|
|
5742
|
+
uploadBtn.addEventListener("mouseenter", () => {
|
|
5743
|
+
uploadBtn.style.borderColor = theme.primary;
|
|
5744
|
+
uploadBtn.style.transform = "translateY(-1px)";
|
|
5745
|
+
});
|
|
5746
|
+
uploadBtn.addEventListener("mouseleave", () => {
|
|
5747
|
+
uploadBtn.style.borderColor = theme.border;
|
|
5748
|
+
uploadBtn.style.transform = "none";
|
|
5740
5749
|
});
|
|
5741
|
-
actionsContainer.appendChild(cameraBtn);
|
|
5742
|
-
const uploadBtn = this.createEnhancedButton(
|
|
5743
|
-
"\u{1F4C1} Choose from Gallery",
|
|
5744
|
-
theme,
|
|
5745
|
-
false,
|
|
5746
|
-
"Upload document image from device"
|
|
5747
|
-
);
|
|
5748
5750
|
uploadBtn.addEventListener("click", () => {
|
|
5749
5751
|
this.handleFileUpload(container, theme);
|
|
5750
5752
|
});
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
+
btnRow.appendChild(cameraBtn);
|
|
5754
|
+
btnRow.appendChild(uploadBtn);
|
|
5755
|
+
this.root.appendChild(btnRow);
|
|
5753
5756
|
const tips = document.createElement("div");
|
|
5754
5757
|
tips.style.cssText = `
|
|
5755
|
-
|
|
5756
|
-
background:${theme.shimmer
|
|
5757
|
-
|
|
5758
|
+
margin:0 20px 16px;padding:12px 14px;
|
|
5759
|
+
background:${theme.shimmer || theme.cardBg};
|
|
5760
|
+
border:1px solid ${theme.border};border-radius:12px;
|
|
5758
5761
|
`;
|
|
5759
|
-
const
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
tips.appendChild(tipsTitle);
|
|
5763
|
-
const tipsList = document.createElement("div");
|
|
5764
|
-
tipsList.style.cssText = `display:grid;gap:8px;font-size:13px;color:${theme.textSecondary};line-height:1.6;`;
|
|
5765
|
-
tipsList.innerHTML = `
|
|
5766
|
-
<div style="display:flex;gap:8px;align-items:flex-start;">
|
|
5767
|
-
<span style="color:${theme.primary};font-weight:bold;">\u2713</span>
|
|
5768
|
-
<span>Lay document flat on a solid surface</span>
|
|
5769
|
-
</div>
|
|
5770
|
-
<div style="display:flex;gap:8px;align-items:flex-start;">
|
|
5771
|
-
<span style="color:${theme.primary};font-weight:bold;">\u2713</span>
|
|
5772
|
-
<span>Ensure all four corners are visible</span>
|
|
5773
|
-
</div>
|
|
5774
|
-
<div style="display:flex;gap:8px;align-items:flex-start;">
|
|
5775
|
-
<span style="color:${theme.primary};font-weight:bold;">\u2713</span>
|
|
5776
|
-
<span>Use good lighting, avoid glare</span>
|
|
5777
|
-
</div>
|
|
5778
|
-
<div style="display:flex;gap:8px;align-items:flex-start;">
|
|
5779
|
-
<span style="color:${theme.primary};font-weight:bold;">\u2713</span>
|
|
5780
|
-
<span>Make sure all text is clearly readable</span>
|
|
5781
|
-
</div>
|
|
5762
|
+
const tipsGrid = document.createElement("div");
|
|
5763
|
+
tipsGrid.style.cssText = `
|
|
5764
|
+
display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;
|
|
5782
5765
|
`;
|
|
5783
|
-
|
|
5766
|
+
const tipItems = [
|
|
5767
|
+
"Lay document flat",
|
|
5768
|
+
"All 4 corners visible",
|
|
5769
|
+
"Good lighting, no glare",
|
|
5770
|
+
"All text clearly readable"
|
|
5771
|
+
];
|
|
5772
|
+
tipItems.forEach((t2) => {
|
|
5773
|
+
const row = document.createElement("div");
|
|
5774
|
+
row.style.cssText = `display:flex;align-items:center;gap:5px;font-size:11px;color:${theme.textSecondary};`;
|
|
5775
|
+
row.innerHTML = `<span style="color:${theme.primary};font-weight:700;flex-shrink:0;">\u2713</span><span>${t2}</span>`;
|
|
5776
|
+
tipsGrid.appendChild(row);
|
|
5777
|
+
});
|
|
5778
|
+
tips.appendChild(tipsGrid);
|
|
5784
5779
|
this.root.appendChild(tips);
|
|
5780
|
+
if (requiresBack && isCapturingFront) {
|
|
5781
|
+
const notice = document.createElement("div");
|
|
5782
|
+
notice.style.cssText = `
|
|
5783
|
+
margin:0 20px 16px;padding:10px 14px;
|
|
5784
|
+
background:${theme.primary}0D;
|
|
5785
|
+
border:1px solid ${theme.primary}25;border-radius:10px;
|
|
5786
|
+
display:flex;align-items:center;gap:8px;
|
|
5787
|
+
font-size:12px;color:${theme.textSecondary};line-height:1.5;
|
|
5788
|
+
`;
|
|
5789
|
+
notice.innerHTML = `<span style="font-size:16px;flex-shrink:0;">\u2139\uFE0F</span><span>You'll capture both the <strong style="color:${theme.text}">front</strong> and <strong style="color:${theme.text}">back</strong> of this document.</span>`;
|
|
5790
|
+
this.root.appendChild(notice);
|
|
5791
|
+
}
|
|
5785
5792
|
const fileInput = document.createElement("input");
|
|
5786
5793
|
fileInput.type = "file";
|
|
5787
5794
|
fileInput.accept = "image/jpeg,image/png";
|
|
@@ -5790,18 +5797,26 @@ var SmartComplySDK = (() => {
|
|
|
5790
5797
|
fileInput.addEventListener("change", (e2) => {
|
|
5791
5798
|
const file = e2.target.files?.[0];
|
|
5792
5799
|
if (file) {
|
|
5793
|
-
const
|
|
5794
|
-
if (
|
|
5795
|
-
this.showError(
|
|
5800
|
+
const err = this.validateFile(file);
|
|
5801
|
+
if (err) {
|
|
5802
|
+
this.showError(err);
|
|
5796
5803
|
return;
|
|
5797
5804
|
}
|
|
5798
5805
|
this.showLoadingState("Processing image...", theme);
|
|
5799
|
-
this.compressImage(file, 1280, 960, 0.85).then((
|
|
5806
|
+
this.compressImage(file, 1280, 960, 0.85).then((c2) => this.handleFileUploadComplete(c2, container, theme, documentType)).catch(() => this.handleFileUploadComplete(file, container, theme, documentType));
|
|
5800
5807
|
}
|
|
5801
5808
|
});
|
|
5802
5809
|
this.root.appendChild(fileInput);
|
|
5803
5810
|
container.appendChild(this.root);
|
|
5804
5811
|
}
|
|
5812
|
+
/** Returns an appropriate emoji icon for the document type. */
|
|
5813
|
+
_docIcon(documentType) {
|
|
5814
|
+
const t2 = documentType.toLowerCase();
|
|
5815
|
+
if (t2.includes("passport")) return "\u{1F4D8}";
|
|
5816
|
+
if (t2.includes("driver") || t2.includes("licen")) return "\u{1F697}";
|
|
5817
|
+
if (t2.includes("voter") || t2.includes("pvc")) return "\u{1F5F3}\uFE0F";
|
|
5818
|
+
return "\u{1FAAA}";
|
|
5819
|
+
}
|
|
5805
5820
|
renderCameraView(container, theme, documentType) {
|
|
5806
5821
|
const wrapper = document.createElement("div");
|
|
5807
5822
|
wrapper.style.cssText = "position:relative;width:100%;border-radius:12px;overflow:hidden;background:#000;";
|
|
@@ -6349,24 +6364,21 @@ var SmartComplySDK = (() => {
|
|
|
6349
6364
|
};
|
|
6350
6365
|
function resolveIdTypeInfo(typeName, isDocumentFlow) {
|
|
6351
6366
|
const u2 = typeName.toUpperCase();
|
|
6352
|
-
const withFace = u2.includes("WITH FACE") || u2.includes("FACE");
|
|
6353
6367
|
const advanced = u2.includes("ADVANCED");
|
|
6368
|
+
const cleanName = typeName.replace(/\s*with\s+face\s*/gi, " ").replace(/\s*\(NIN\)\s*/gi, " ").replace(/\s*\(BVN\)\s*/gi, " ").replace(/\s{2,}/g, " ").trim();
|
|
6354
6369
|
const requiresBackSide = (type) => {
|
|
6355
6370
|
const t2 = type.toLowerCase();
|
|
6356
|
-
return t2.includes("voter") || t2.includes("
|
|
6371
|
+
return t2.includes("voter") || t2.includes("driver") || t2.includes("license") || t2.includes("national id") || t2.includes("national id card");
|
|
6357
6372
|
};
|
|
6358
6373
|
if (u2.includes("BVN") || u2.includes("BANK VERIFICATION")) {
|
|
6359
|
-
|
|
6360
|
-
return { icon: "\u{1F3E6}", desc: `Enter your 11-digit BVN${extra}`, requiresBack: false };
|
|
6374
|
+
return { icon: "\u{1F3E6}", desc: "Enter your 11-digit Bank Verification Number (BVN)", requiresBack: false };
|
|
6361
6375
|
}
|
|
6362
6376
|
if (u2.includes("NIN") || u2.includes("NATIONAL IDENTITY NUMBER")) {
|
|
6363
|
-
|
|
6364
|
-
return { icon: "\u{1F194}", desc: `Enter your 11-digit NIN${extra}`, requiresBack: false };
|
|
6377
|
+
return { icon: "\u{1F194}", desc: "Enter your 11-digit National Identification Number (NIN)", requiresBack: false };
|
|
6365
6378
|
}
|
|
6366
6379
|
if (u2.includes("GHANA")) {
|
|
6367
6380
|
if (isDocumentFlow) return { icon: "\u{1FAAA}", desc: "Capture or upload your Ghana Card", requiresBack: true };
|
|
6368
|
-
|
|
6369
|
-
return { icon: "\u{1FAAA}", desc: `Enter your Ghana Card number${extra}`, requiresBack: false };
|
|
6381
|
+
return { icon: "\u{1FAAA}", desc: "Enter your Ghana Card number", requiresBack: false };
|
|
6370
6382
|
}
|
|
6371
6383
|
if (u2.includes("SSNIT"))
|
|
6372
6384
|
return { icon: "\u{1F3DB}\uFE0F", desc: "Enter your SSNIT number", requiresBack: false };
|
|
@@ -6502,8 +6514,9 @@ var SmartComplySDK = (() => {
|
|
|
6502
6514
|
if (this.overlay) {
|
|
6503
6515
|
this.overlay.style.opacity = "0";
|
|
6504
6516
|
setTimeout(() => {
|
|
6505
|
-
|
|
6506
|
-
this.overlay
|
|
6517
|
+
try {
|
|
6518
|
+
this.overlay?.remove();
|
|
6519
|
+
} catch (_2) {
|
|
6507
6520
|
}
|
|
6508
6521
|
this.overlay = null;
|
|
6509
6522
|
this.modal = null;
|
|
@@ -6839,8 +6852,9 @@ var SmartComplySDK = (() => {
|
|
|
6839
6852
|
if (requiresBack && isThisDocFlow) {
|
|
6840
6853
|
subtitle2 += " \u26A0\uFE0F Both sides required";
|
|
6841
6854
|
}
|
|
6855
|
+
const displayName = typeName.replace(/\s*with\s+face\s*/gi, " ").replace(/\s*\(NIN\)\s*/gi, " ").replace(/\s*\(BVN\)\s*/gi, " ").replace(/\s{2,}/g, " ").trim();
|
|
6842
6856
|
const card = this.createOptionCard(
|
|
6843
|
-
`${info.icon} ${
|
|
6857
|
+
`${info.icon} ${displayName}`,
|
|
6844
6858
|
subtitle2,
|
|
6845
6859
|
() => {
|
|
6846
6860
|
const idTypeChanged = this.selectedIdType !== typeCode;
|
|
@@ -6874,7 +6888,8 @@ var SmartComplySDK = (() => {
|
|
|
6874
6888
|
container.style.cssText += "display:flex;flex-direction:column;gap:16px;";
|
|
6875
6889
|
const dataFields = this.selectedChannelFields.filter((f2) => f2.type !== "upload");
|
|
6876
6890
|
const info = resolveIdTypeInfo(this.selectedIdTypeName || this.selectedIdType, false);
|
|
6877
|
-
const
|
|
6891
|
+
const cleanStepTitle = (this.selectedIdTypeName || this.selectedIdType).replace(/\s*with\s+face\s*/gi, " ").replace(/\s*\(NIN\)\s*/gi, " ").replace(/\s*\(BVN\)\s*/gi, " ").replace(/\s{2,}/g, " ").trim();
|
|
6892
|
+
const title = this.createStepTitle(`${info.icon} ${cleanStepTitle}`);
|
|
6878
6893
|
container.appendChild(title);
|
|
6879
6894
|
const subtitle = document.createElement("div");
|
|
6880
6895
|
subtitle.style.cssText = `color:${this.theme.textSecondary};font-size:13px;margin-top:-8px;`;
|
|
@@ -7093,69 +7108,65 @@ var SmartComplySDK = (() => {
|
|
|
7093
7108
|
}
|
|
7094
7109
|
// ── Processing ────────────────────────────────────────────────────
|
|
7095
7110
|
renderProcessing(container) {
|
|
7096
|
-
container.style.cssText += "display:flex;flex-direction:column;align-items:center;gap:
|
|
7111
|
+
container.style.cssText += "display:flex;flex-direction:column;align-items:center;gap:14px;padding:16px;";
|
|
7097
7112
|
const animationWrap = document.createElement("div");
|
|
7098
|
-
animationWrap.style.cssText = "position:relative;width:
|
|
7113
|
+
animationWrap.style.cssText = "position:relative;width:52px;height:52px;flex-shrink:0;";
|
|
7099
7114
|
const spinner = document.createElement("div");
|
|
7100
7115
|
spinner.style.cssText = `
|
|
7101
7116
|
position:absolute;inset:0;border-radius:50%;
|
|
7102
|
-
border:
|
|
7117
|
+
border:3px solid ${this.theme.border};
|
|
7103
7118
|
border-top-color:${this.theme.primary};
|
|
7104
|
-
animation:sc-spin
|
|
7119
|
+
animation:sc-spin 0.9s linear infinite;
|
|
7105
7120
|
`;
|
|
7106
7121
|
animationWrap.appendChild(spinner);
|
|
7107
7122
|
const centerIcon = document.createElement("div");
|
|
7108
7123
|
centerIcon.style.cssText = `
|
|
7109
7124
|
position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
|
|
7110
|
-
font-size:
|
|
7125
|
+
font-size:20px;
|
|
7111
7126
|
`;
|
|
7112
7127
|
centerIcon.textContent = "\u{1F50D}";
|
|
7113
7128
|
animationWrap.appendChild(centerIcon);
|
|
7114
7129
|
container.appendChild(animationWrap);
|
|
7115
7130
|
const title = document.createElement("div");
|
|
7116
|
-
title.style.cssText = `color:${this.theme.text};font-size:
|
|
7117
|
-
title.textContent = "Processing
|
|
7131
|
+
title.style.cssText = `color:${this.theme.text};font-size:15px;font-weight:700;text-align:center;`;
|
|
7132
|
+
title.textContent = "Processing your document";
|
|
7118
7133
|
container.appendChild(title);
|
|
7119
7134
|
const subtitle = document.createElement("div");
|
|
7120
|
-
subtitle.style.cssText = `color:${this.theme.textSecondary};font-size:
|
|
7121
|
-
subtitle.textContent = "Scanning and verifying your
|
|
7135
|
+
subtitle.style.cssText = `color:${this.theme.textSecondary};font-size:12px;text-align:center;max-width:260px;line-height:1.5;`;
|
|
7136
|
+
subtitle.textContent = "Scanning and verifying your ID. This usually takes a few seconds.";
|
|
7122
7137
|
container.appendChild(subtitle);
|
|
7123
7138
|
const stepsContainer = document.createElement("div");
|
|
7124
7139
|
stepsContainer.style.cssText = `
|
|
7125
|
-
width:100%;
|
|
7126
|
-
margin-top:16px;
|
|
7140
|
+
width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px;
|
|
7127
7141
|
`;
|
|
7128
7142
|
const steps = [
|
|
7129
|
-
{ id: "uploading", text: "Uploading
|
|
7130
|
-
{ id: "scanning", text: "Scanning
|
|
7131
|
-
{ id: "verifying", text: "Verifying
|
|
7132
|
-
{ id: "analyzing", text: "
|
|
7143
|
+
{ id: "uploading", text: "Uploading", icon: "\u{1F4E4}" },
|
|
7144
|
+
{ id: "scanning", text: "Scanning", icon: "\u{1F50D}" },
|
|
7145
|
+
{ id: "verifying", text: "Verifying", icon: "\u2713" },
|
|
7146
|
+
{ id: "analyzing", text: "Checking quality", icon: "\u{1F52C}" }
|
|
7133
7147
|
];
|
|
7134
|
-
steps.forEach((step
|
|
7148
|
+
steps.forEach((step) => {
|
|
7135
7149
|
const stepEl = document.createElement("div");
|
|
7136
7150
|
stepEl.style.cssText = `
|
|
7137
|
-
display:flex;align-items:center;gap:
|
|
7151
|
+
display:flex;align-items:center;gap:8px;padding:9px 10px;border-radius:10px;
|
|
7138
7152
|
background:${this.theme.cardBg};border:1px solid ${this.theme.border};
|
|
7139
7153
|
transition:all 0.3s ease;
|
|
7140
7154
|
`;
|
|
7141
7155
|
stepEl.id = `processing-step-${step.id}`;
|
|
7142
7156
|
const iconEl = document.createElement("div");
|
|
7143
7157
|
iconEl.style.cssText = `
|
|
7144
|
-
width:
|
|
7145
|
-
|
|
7158
|
+
width:26px;height:26px;border-radius:7px;flex-shrink:0;
|
|
7159
|
+
display:flex;align-items:center;justify-content:center;
|
|
7160
|
+
font-size:12px;background:${this.theme.shimmer};
|
|
7146
7161
|
`;
|
|
7147
7162
|
iconEl.textContent = step.icon;
|
|
7148
7163
|
iconEl.id = `step-icon-${step.id}`;
|
|
7149
7164
|
const textEl = document.createElement("div");
|
|
7150
|
-
textEl.style.cssText = `flex:1;color:${this.theme.textSecondary};font-size:
|
|
7165
|
+
textEl.style.cssText = `flex:1;color:${this.theme.textSecondary};font-size:11px;font-weight:500;`;
|
|
7151
7166
|
textEl.textContent = step.text;
|
|
7152
7167
|
textEl.id = `step-text-${step.id}`;
|
|
7153
7168
|
const statusEl = document.createElement("div");
|
|
7154
|
-
statusEl.style.cssText = `
|
|
7155
|
-
width:20px;height:20px;border-radius:50%;
|
|
7156
|
-
border:2px solid ${this.theme.border};
|
|
7157
|
-
position:relative;
|
|
7158
|
-
`;
|
|
7169
|
+
statusEl.style.cssText = `width:16px;height:16px;border-radius:50%;border:2px solid ${this.theme.border};position:relative;flex-shrink:0;`;
|
|
7159
7170
|
statusEl.id = `step-status-${step.id}`;
|
|
7160
7171
|
stepEl.appendChild(iconEl);
|
|
7161
7172
|
stepEl.appendChild(textEl);
|