@jaak.ai/stamps 2.5.4-dev.1 → 2.5.4-dev.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/cjs/{index-D6NBn_qu.js → index-ucw61xdq.js} +9 -2
- package/dist/cjs/{index-D6NBn_qu.js.map → index-ucw61xdq.js.map} +1 -1
- package/dist/cjs/jaak-stamps-webcomponent.cjs.js +1 -1
- package/dist/cjs/jaak-stamps.cjs.entry.js +6 -23
- package/dist/cjs/jaak-stamps.cjs.entry.js.map +1 -1
- package/dist/cjs/jaak-stamps.entry.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/powered-by-jaak.png +0 -0
- package/dist/collection/components/my-component/my-component.js +6 -5
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/collection/services/DetectionService.js +0 -18
- package/dist/collection/services/DetectionService.js.map +1 -1
- package/dist/components/jaak-stamps.js +6 -23
- package/dist/components/jaak-stamps.js.map +1 -1
- package/dist/esm/{index-BCfAsrzL.js → index-CqdAwiLj.js} +9 -3
- package/dist/esm/{index-BCfAsrzL.js.map → index-CqdAwiLj.js.map} +1 -1
- package/dist/esm/jaak-stamps-webcomponent.js +2 -2
- package/dist/esm/jaak-stamps.entry.js +6 -23
- package/dist/esm/jaak-stamps.entry.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/jaak-stamps-webcomponent/jaak-stamps-webcomponent.esm.js +1 -1
- package/dist/jaak-stamps-webcomponent/jaak-stamps.entry.esm.js.map +1 -1
- package/dist/jaak-stamps-webcomponent/{p-0f4d77b3.entry.js → p-178aea65.entry.js} +3 -3
- package/dist/jaak-stamps-webcomponent/p-178aea65.entry.js.map +1 -0
- package/dist/jaak-stamps-webcomponent/p-CqdAwiLj.js +3 -0
- package/dist/jaak-stamps-webcomponent/{p-BCfAsrzL.js.map → p-CqdAwiLj.js.map} +1 -1
- package/package.json +1 -1
- package/dist/jaak-stamps-webcomponent/p-0f4d77b3.entry.js.map +0 -1
- package/dist/jaak-stamps-webcomponent/p-BCfAsrzL.js +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-ucw61xdq.js');
|
|
4
4
|
|
|
5
5
|
class EventBusService {
|
|
6
6
|
events = new Map();
|
|
@@ -837,24 +837,12 @@ class DetectionService {
|
|
|
837
837
|
errorMsg.includes('FLOAT16') ||
|
|
838
838
|
errorMsg.includes('float16');
|
|
839
839
|
if (isFloat16Error) {
|
|
840
|
-
// El modelo fp16 no es compatible con este backend.
|
|
841
|
-
// Cargar el modelo fp32 que funciona en cualquier backend.
|
|
842
|
-
if (this.debug) {
|
|
843
|
-
console.log('[JAAK-DEBUG] float16 model not supported, loading fp32 model:', this.MODEL_PATH_FP32);
|
|
844
|
-
}
|
|
845
840
|
this.useFloat16 = false;
|
|
846
841
|
try {
|
|
847
842
|
this.session = await window.ort.InferenceSession.create(this.MODEL_PATH_FP32, sessionOptions);
|
|
848
|
-
if (this.debug) {
|
|
849
|
-
console.log('[JAAK-DEBUG] fp32 model loaded successfully');
|
|
850
|
-
}
|
|
851
843
|
}
|
|
852
844
|
catch (fp32Error) {
|
|
853
845
|
// Intentar con opciones minimas de WASM
|
|
854
|
-
if (this.debug) {
|
|
855
|
-
console.log('[JAAK-DEBUG] fp32 model failed with default options:', fp32Error.message);
|
|
856
|
-
console.log('[JAAK-DEBUG] Retrying fp32 model with WASM fallback options');
|
|
857
|
-
}
|
|
858
846
|
const wasmOptions = {
|
|
859
847
|
executionProviders: ['wasm'],
|
|
860
848
|
graphOptimizationLevel: 'all',
|
|
@@ -889,9 +877,6 @@ class DetectionService {
|
|
|
889
877
|
throw error;
|
|
890
878
|
}
|
|
891
879
|
}
|
|
892
|
-
if (this.debug) {
|
|
893
|
-
console.log('[JAAK-DEBUG] Model loaded. useFloat16:', this.useFloat16);
|
|
894
|
-
}
|
|
895
880
|
this.modelLoaded = true;
|
|
896
881
|
}
|
|
897
882
|
catch (error) {
|
|
@@ -1180,9 +1165,6 @@ class DetectionService {
|
|
|
1180
1165
|
}
|
|
1181
1166
|
catch {
|
|
1182
1167
|
this.useFloat16 = false;
|
|
1183
|
-
if (this.debug) {
|
|
1184
|
-
console.log('[JAAK-DEBUG] float16 not supported by current backend, using float32');
|
|
1185
|
-
}
|
|
1186
1168
|
}
|
|
1187
1169
|
}
|
|
1188
1170
|
float32ToFloat16(value) {
|
|
@@ -20209,7 +20191,7 @@ const JaakStamps = class {
|
|
|
20209
20191
|
isCapturing: false
|
|
20210
20192
|
};
|
|
20211
20193
|
const cameraInfo = this.cameraInfoWithAutofocus;
|
|
20212
|
-
return (index.h("div", { key: '
|
|
20194
|
+
return (index.h("div", { key: '20689d87a0b2f3ec851837a57f97b4bb79ecf10a', class: "detector-container" }, !this.licenseValid && this.licenseError && (index.h("div", { key: '3dccc3f6fd3ed0db2c2e7034d5cb0940625bade1', class: "license-error-container" }, index.h("div", { key: '5f39d0762dc5fea0f5d5402cd61f696090e96865', class: "license-error-card" }, index.h("svg", { key: '34d8290684decfe194328eba1b4af1b582f02518', class: "license-error-icon", width: "64", height: "64", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '2cc8b54522b550f127c1b05a6f8069b78156f84a', d: "M12 22C12 22 20 18 20 12V5L12 2L4 5V12C4 18 12 22 12 22Z", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { key: 'b3c7918292661cfc92fbc0d3ec237acb80364fa5', d: "M12 8V12", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" }), index.h("circle", { key: '86a258f69cdf26588436cba2056bdf7c92d08244', cx: "12", cy: "16", r: "0.5", fill: "currentColor", stroke: "currentColor", "stroke-width": "1" })), index.h("h2", { key: '06e4fbde528663e485ae9a3b04945e6c95595ab2', class: "license-error-title" }, "Licencia Requerida"), index.h("p", { key: '7466b075c8cf31d67535512e4bdaa1473e89ed47', class: "license-error-message" }, this.licenseError), index.h("p", { key: 'ba4d06029ef7e896e51ad5c6e2dd72a9a162ef08', class: "license-error-help" }, "Contacte a soporte: ", index.h("a", { key: '177832433d66cf581743d8774a055405fa1f83fc', href: "mailto:support@jaak.ai" }, "support@jaak.ai")), index.h("div", { key: 'ce1b33ae5289689c3e07cbb2a68f4411aa3ed2d2', class: "license-error-footer" }, "JAAK Stamps")))), this.licenseValid && (index.h("div", { key: '394ee2b3c487c9673c1df3b483900720beb42ea5', class: "video-container" }, index.h("video", { key: '50ba3fb80f05ed35bdc58f9d75538d083cd7af32', ref: el => this.videoRef = el, autoplay: true, muted: true, playsinline: true, class: this.shouldMirrorVideo ? 'mirror' : '', style: {
|
|
20213
20195
|
// Keep the element rendered (display: block) so the browser
|
|
20214
20196
|
// loads stream metadata and fires 'loadedmetadata'. Hiding it
|
|
20215
20197
|
// with display:none prevents metadata loading in Chrome and
|
|
@@ -20218,7 +20200,7 @@ const JaakStamps = class {
|
|
|
20218
20200
|
// render context alive.
|
|
20219
20201
|
opacity: captureState.isVideoActive ? '1' : '0',
|
|
20220
20202
|
visibility: captureState.isVideoActive ? 'visible' : 'hidden',
|
|
20221
|
-
} }), index.h("div", { key: '
|
|
20203
|
+
} }), index.h("div", { key: 'a4ff51674115afeeb2c36aedbbbdf3769bf0af96', ref: el => this.detectionContainer = el, class: `detection-overlay ${this.shouldMirrorVideo ? 'mirror' : ''}` }, this.debug && this.detectionBoxes.map((box, index$1) => (index.h("div", { key: index$1, class: "detection-box", style: {
|
|
20222
20204
|
position: 'absolute',
|
|
20223
20205
|
left: `${box.x}px`,
|
|
20224
20206
|
top: `${box.y}px`,
|
|
@@ -20227,9 +20209,9 @@ const JaakStamps = class {
|
|
|
20227
20209
|
border: '2px solid #32406C',
|
|
20228
20210
|
pointerEvents: 'none',
|
|
20229
20211
|
boxSizing: 'border-box'
|
|
20230
|
-
} })))), this.isMaskReady && (index.h("div", { key: '
|
|
20212
|
+
} })))), this.isMaskReady && (index.h("div", { key: '6c4e710e25971692bd933486f05a231b56150e5a', class: "overlay-mask" }, index.h("div", { key: 'd7ec408535cd68a5a9c12e51061f3fd61745b566', class: "card-outline" }, index.h("div", { key: '0e4c6066cf35cdb13843e54500db8e94603203fa', class: "side side-top" }), index.h("div", { key: '0c61ebf0940a01b09d509675d021051ac433ba1b', class: "side side-right" }), index.h("div", { key: 'e1c113fa666ba1ab0b77bac98ac4b08d99bea3af', class: "side side-bottom" }), index.h("div", { key: '666527c49665fe1d9d04a5d3620686b7471b8d44', class: "side side-left" })), !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: '71eae3c5e89eeaffd95bc32d7ed9139a5b741cc6', class: `guide-text ${this.showPerformanceMessage ? 'performance-warning-text' : ''}` }, this.getGuideText(captureState.step))), captureState.step === 'back' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: 'b4d6abc22c58eabd5afb6f440701f5b909bf949e', class: "back-capture-section" }, index.h("div", { key: '6d4bf99ff92829efb64d6dbc7d2d14c16b7c691c', class: "back-capture-buttons" }, (!this.useDocumentDetector || this.performanceDegradedMode || this.showManualCaptureButton) && (index.h("button", { key: 'f8965079e936e32722b5eb1f8dfb63a84160aa5d', class: "capture-button primary-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-back' && (index.h("span", { key: '7defab9f244899e188659fd07bf114897737bd48', class: "button-spinner" })), "Capturar Reverso")), index.h("button", { key: 'd5a501876ce24f25d21df5e8d47183e80be602f3', class: "skip-button", onClick: () => this.skipBackCapture(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'skip-back' && (index.h("span", { key: '54e08bed19e50abdd5f5faf9e0a21d8c2cb6a368', class: "button-spinner" })), this.enableBackDocumentTimer && this.backDocumentTimerRemaining > 0
|
|
20231
20213
|
? `Saltar reverso (${this.backDocumentTimerRemaining}s)`
|
|
20232
|
-
: 'Saltar reverso')))), captureState.isVideoActive && (index.h("div", { key: '
|
|
20214
|
+
: 'Saltar reverso')))), captureState.isVideoActive && (index.h("div", { key: '85998cae72d19792d41f94b3fa08fd7054e25c5e', class: "camera-controls" }, index.h("button", { key: 'fe0471dad8bdc5b45327da52af8b47f94fe2531a', class: `camera-selector-button ${this.isSwitchingCamera ? 'loading' : ''}`, onClick: () => this.toggleCameraSelector(), type: "button", title: "Seleccionar c\u00E1mara", disabled: this.isSwitchingCamera }, this.isSwitchingCamera ? (index.h("div", { class: "button-spinner" })) : ('Cámaras')))), this.showCameraSelector && cameraInfo.availableCameras.length > 0 && (index.h("div", { key: 'de26a8eda76aeec8e7095f793750b2336e2ff6c6', class: "camera-selector-dropdown" }, index.h("div", { key: '9b4085d7be39ab227a33d02b55dd46e96a68d330', class: "camera-selector-header" }, index.h("span", { key: '84104fb85d91ccd258c78365cad2e66b62d787b0' }, "Seleccionar C\u00E1mara"), index.h("button", { key: 'ad1d2b52e64ab8f0028e2cb083f495c2b432c054', class: "close-selector", onClick: () => this.toggleCameraSelector(), type: "button" }, "\u00D7")), index.h("div", { key: 'e9f56e92ed01afac36ad0986dc78bfc816e60520', class: "camera-list" }, cameraInfo.availableCameras.map((camera) => (index.h("button", { key: camera.id, class: `camera-option ${cameraInfo.selectedCameraId === camera.id ? 'selected' : ''}`, onClick: () => this.handleCameraSwitch(camera.id), type: "button" }, index.h("span", { class: "camera-label" }, camera.label || `Cámara ${cameraInfo.availableCameras.indexOf(camera) + 1}`, camera.hasAutofocus && (index.h("span", { class: "autofocus-icon", title: "Autofoco disponible" }, "\u29BF"))), cameraInfo.selectedCameraId === camera.id && (index.h("span", { class: "selected-indicator" }, "\u2713")))))), index.h("div", { key: '6fa215b5f99d33272cd96a27b2295c95113bc257', class: "device-info" }, index.h("small", { key: 'f8399e02a4f2a288c09df9065e138ab8def9be5f' }, "Dispositivo: ", cameraInfo.deviceType)))), this.showManualCaptureButton && captureState.step === 'front' && !captureState.showFlipAnimation && !captureState.showSuccessAnimation && (index.h("div", { key: '4a169ae520fd5ca67716f0fe190889ace448044e', class: "manual-capture-section" }, index.h("button", { key: '7d7808f0d1017f6eb4c701a8582152905a228e85', class: "manual-capture-button", onClick: () => this.takeManualScreenshot(), type: "button", disabled: this.processingButton !== null }, this.processingButton === 'capture-front' && (index.h("span", { key: '89ee5a34898a8ba78777177001fa4406531dac3e', class: "button-spinner" })), "Capturar Frente"))))), captureState.isCapturing && (index.h("div", { key: '0711e1cb5619acbade20f63f6d46bdfdf827ed12', class: "capture-animation" })), captureState.showFlipAnimation && (index.h("div", { key: '720c0b1dcdb85646b4973ae15abeaef0f3a91a95', class: "flip-animation" }, index.h("div", { key: 'a31a9500ee6f2f35f762e2f5135219ed869c6188', class: "id-card-icon" }), index.h("div", { key: '7237f4284d4a5b8fb471d8a568a9c3dd2eae6409', class: "flip-text" }, "\u00A1Voltea tu identificaci\u00F3n!"))), captureState.showSuccessAnimation && (index.h("div", { key: '94a28257187330f5aaca2302840300460f288f71', class: "success-animation" }, index.h("div", { key: 'ef9d9072507faac3ae29c31b87c9439f67576c14', class: "check-icon" }), index.h("div", { key: '7f1c077a2b3b67ebba5d12c9b69ff943b74936e9', class: "success-text" }, "\u00A1Proceso completado!"))), index.h("div", { key: 'b9cae83d9d9717728a27bd969293fe28702befe3', class: `component-status status-${this.currentStatus.type}` }, (this.currentStatus.type === 'loading' || this.currentStatus.type === 'initializing') && (index.h("div", { key: '59382426b18de9f04dcfb179acd9a49b68af45ed', class: "status-spinner" })), index.h("div", { key: 'baa1972a55d439a95b3f91f38f91d9f35eecd7bd', class: "status-content" }, index.h("div", { key: '3fac24107d04a2b0abcbe6a3a0bff6d395c096b6', class: "status-message" }, this.currentStatus.message), this.currentStatus.description && (index.h("div", { key: '196c12a4fc3e8f213b17bdd366da9e61c594a0b1', class: "status-description" }, this.currentStatus.description)))), this.debug && (index.h("div", { key: 'd5c36522d3bd46f434b19e8323a30f441d69c67c', class: "performance-monitor" }, index.h("div", { key: 'ccc8ae6b27be8d5d89e2722319cfc66a92c3a32f', class: "performance-expanded" }, index.h("div", { key: 'd7bed7384567663fafe4fa49dd24da4bdd05c9a3', class: "metrics-row" }, index.h("div", { key: 'a4409744d7d9e8a6288caf077ba5ebdc6aaa5371', class: "metric-compact" }, index.h("span", { key: '939e03d6aa0138c2b0c1cce16bebf158b9b74bd6', class: "metric-label" }, "FPS"), index.h("span", { key: '76c20f96b11725d41493b627e7a6b0fb0d594d60', class: `metric-value ${this.performanceData.fps < 15 ? 'warning' : this.performanceData.fps < 10 ? 'danger' : 'good'}` }, this.performanceData.fps)), index.h("div", { key: 'fafe6b165149f1f590a0b7e26b4001b09a5c70c5', class: "metric-compact" }, index.h("span", { key: 'a7e99f9c05aced0cb951297ce3a6011500445421', class: "metric-label" }, "MEM"), index.h("span", { key: '68bd733671a9664c4533e0b24b04ad0422053f77', class: `metric-value ${this.performanceData.memoryUsage > 100 ? 'warning' : this.performanceData.memoryUsage > 200 ? 'danger' : 'good'}` }, this.performanceData.memoryUsage, "MB"))), index.h("div", { key: 'a53f1ac37527de249425529aff022858c8d924c5', class: "metrics-row" }, index.h("div", { key: '2213e3646b22056999d29107bb32e43c61dd202f', class: "metric-compact" }, index.h("span", { key: '31d84002498094f88f71858a91828f42b7157d23', class: "metric-label" }, "INF"), index.h("span", { key: 'f0ed4e90a338a05bd5193992e7f004df9d31239a', class: `metric-value ${this.performanceData.inferenceTime > 100 ? 'warning' : this.performanceData.inferenceTime > 200 ? 'danger' : 'good'}` }, this.performanceData.inferenceTime, "ms")), index.h("div", { key: '1288cf2f5a119f146886c08f8b7f036425ead78e', class: "metric-compact" }, index.h("span", { key: 'db75cca343f7c6ea588e9b62da04fc5d444604a6', class: "metric-label" }, "FRAME"), index.h("span", { key: '40aee793f30a9cf175be6372981ce7b7be82ed07', class: `metric-value ${this.performanceData.frameProcessingTime > 50 ? 'warning' : this.performanceData.frameProcessingTime > 100 ? 'danger' : 'good'}` }, this.performanceData.frameProcessingTime, "ms"))), index.h("div", { key: 'd193a9b4c56c6a712213a779dbc6ee161b82e828', class: "metrics-row" }, index.h("div", { key: '89d060083973e1931232aac0d0c0f813b8aab7ef', class: "metric-compact" }, index.h("span", { key: '35808d7a448e3f4c6dc27b2b325adf628b9aee16', class: "metric-label" }, "DET"), index.h("span", { key: 'b60da4f5a4d56e738a65fd0bc480626d4839a048', class: "metric-value good" }, this.performanceData.successfulDetections, "/", this.performanceData.totalDetections)), index.h("div", { key: 'da779be083f58be8e914d062379b565fdbf7333d', class: "metric-compact" }, index.h("span", { key: '44645db15818eab212bc5b966213dda67f461d14', class: "metric-label" }, "RATE"), index.h("span", { key: '39209bdf5a5fa7c74718492218ff4fa404e94879', class: `metric-value ${this.performanceData.detectionRate < 30 ? 'danger' : this.performanceData.detectionRate < 60 ? 'warning' : 'good'}` }, this.performanceData.detectionRate, "%")))))), index.h("div", { key: 'bb0fb66ffefa86eb6e4b72215acb930c81cb6b01', class: "watermark" }, index.h("img", { key: '93a1812ab9a1c91c4a81cdc939ef8410170dd6b9', src: "https://static.jaak.ai/commons/powered-by-jaak.png", alt: "Powered by Jaak", onError: (e) => { e.target.src = index.getAssetPath('/assets/powered-by-jaak.png'); } }))))));
|
|
20233
20215
|
}
|
|
20234
20216
|
// Utility methods
|
|
20235
20217
|
updateDetectionBoxes(boxes) {
|
|
@@ -21045,6 +21027,7 @@ const JaakStamps = class {
|
|
|
21045
21027
|
}
|
|
21046
21028
|
// If pool is full, let the canvas be garbage collected
|
|
21047
21029
|
}
|
|
21030
|
+
static get assetsDirs() { return ["../../assets"]; }
|
|
21048
21031
|
};
|
|
21049
21032
|
JaakStamps.style = myComponentCss;
|
|
21050
21033
|
|