@sekyro/web 0.1.0-rc.13 → 0.1.0-rc.15
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/CHANGELOG.md +14 -0
- package/dist/capture-session-doc-5FHM3DSX.js +1 -0
- package/dist/{capture-session-v3-Db4n6d-k.d.cts → capture-session-v3-DVJvecJq.d.cts} +1 -1
- package/dist/{capture-session-v3-C5DRPBhM.d.ts → capture-session-v3-DsHBvxFa.d.ts} +1 -1
- package/dist/{chunk-57VOMVKM.js → chunk-23XZDY52.js} +1 -1
- package/dist/chunk-2BFYVMUU.js +1 -0
- package/dist/{chunk-WTQE6IGL.js → chunk-4SQBEKG7.js} +1 -1
- package/dist/chunk-7SJHXIM3.js +1 -0
- package/dist/{chunk-JRSIMNB5.js → chunk-EIFZSEYD.js} +1 -1
- package/dist/chunk-G6MU3B5V.js +1 -0
- package/dist/{chunk-UBDG5IAP.js → chunk-G7WHAP7L.js} +1 -1
- package/dist/{chunk-H6H2RT6M.js → chunk-M35OBPDV.js} +1 -1
- package/dist/chunk-RBDRJRXB.js +1 -0
- package/dist/{chunk-5OIC5TZS.js → chunk-RNZ4CQEC.js} +1 -1
- package/dist/{chunk-XBVSYVKA.js → chunk-ZJUA2Y22.js} +1 -1
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +4 -4
- package/dist/client/index.d.ts +4 -4
- package/dist/client/index.js +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +1 -1
- package/dist/create-document-capture-4KABJ5FV.js +1 -0
- package/dist/{create-portrait-capture-C462EIB6.js → create-portrait-capture-53XBURNT.js} +1 -1
- package/dist/{create-verification-P6i3tyce.d.ts → create-verification-2hqtJWN9.d.ts} +47 -5
- package/dist/{create-verification-BV_T0-CR.d.cts → create-verification-60S1U9Dl.d.cts} +47 -5
- package/dist/{icao-gate-BP11XO-h.d.ts → icao-gate-B2zgdb5m.d.ts} +1 -1
- package/dist/{icao-gate-B0GDH_JS.d.cts → icao-gate-sKqrgMTo.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/internal/index.cjs +1 -1
- package/dist/internal/index.d.cts +6 -6
- package/dist/internal/index.d.ts +6 -6
- package/dist/internal/index.js +1 -1
- package/dist/{plan-runner-RVVF5DJV.js → plan-runner-FZJ5KVT3.js} +1 -1
- package/dist/{types-DPWT_KMn.d.cts → types-BZXO8xhw.d.cts} +19 -4
- package/dist/{types-DPWT_KMn.d.ts → types-BZXO8xhw.d.ts} +19 -4
- package/package.json +1 -1
- package/sbom.cdx.json +7 -7
- package/dist/capture-session-doc-7LQAOCHJ.js +0 -1
- package/dist/chunk-73M7LS4H.js +0 -1
- package/dist/chunk-FHJ7HO3M.js +0 -1
- package/dist/chunk-IBA5CPDV.js +0 -1
- package/dist/chunk-VJM76LUI.js +0 -1
- package/dist/create-document-capture-RTFDQSBC.js +0 -1
package/dist/core/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var st=Object.create;var V=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var lt=Object.getPrototypeOf,ut=Object.prototype.hasOwnProperty;var dt=(r,e)=>()=>(r&&(e=r(r=0)),e);var be=(r,e)=>{for(var t in e)V(r,t,{get:e[t],enumerable:!0})},ve=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ct(e))!ut.call(r,i)&&i!==t&&V(r,i,{get:()=>e[i],enumerable:!(n=ot(e,i))||n.enumerable});return r};var mt=(r,e,t)=>(t=r!=null?st(lt(r)):{},ve(e||!r||!r.__esModule?V(t,"default",{value:r,enumerable:!0}):t,r)),pt=r=>ve(V({},"__esModule",{value:!0}),r);var je={};be(je,{RANK_CANDIDATES:()=>qt,RANK_TOLERANCE:()=>Z,RANK_WINDOW_MS:()=>Yt,ROLL_ZERO_DEG:()=>Qt,SHARPNESS_REPORT_MAX:()=>Ze,YAW_REPORT_MAX:()=>Ye,YAW_ZERO_IOD:()=>Zt,collectRankedKeyframes:()=>Qe,default:()=>$t,featuresOf:()=>Xe,frontalOf:()=>ze,rankKeyframes:()=>qe});function ze(r){let e=r.eyes;if(e===void 0)return{frontal:1,yaw:null,roll:null};let t=e.right.x-e.left.x,n=e.right.y-e.left.y,i=t*t+n*n;if(i===0)return{frontal:1,yaw:null,roll:null};let a=Math.abs(Math.atan2(n,Math.abs(t))*180/Math.PI),s=Be(1-a/30),o=null,l=r.nose;if(l!==void 0){let d=(e.left.x+e.right.x)/2,c=(e.left.y+e.right.y)/2;o=Math.abs(((l.x-d)*t+(l.y-c)*n)/i),s*=Be(1-o/.5)}return{frontal:s,yaw:o,roll:a}}function Xe(r,e){return r===null?{face:!1,frontal:0,yaw:null,roll:null,eyes:null,score:0,sharpness:e}:{face:!0,...ze(r),eyes:null,score:r.score,sharpness:e}}function qe(r){let e=r.map((i,a)=>a),t=(i,a)=>{let s=Number.NEGATIVE_INFINITY;for(let o of e)s=Math.max(s,i(r[o]));e=e.filter(o=>i(r[o])>=s-a)};t(i=>i.frontal,Z.frontal),t(i=>i.eyes??1,Z.eyes),t(i=>i.score,Z.score);let n=-1;for(let i of e)(n===-1||r[i].sharpness>r[n].sharpness)&&(n=i);return n}function jt(r){return{face:r.face,frontal:O(r.frontal),...r.yaw!==null?{yaw:Math.min(O(r.yaw),Ye)}:{},...r.roll!==null?{roll:O(r.roll)}:{},...r.eyes!==null?{eyes:O(r.eyes)}:{},score:O(r.score),sharpness:Math.min(O(r.sharpness),Ze)}}async function Qe(r,e){let{options:t}=r,n=t.video,i=t.now??(()=>performance.now()),a=t.captureKeyframe??(m=>r.defaultKeyframe(m)),s=600/3,o=[],l=[],d=0;for(let m=0;m<4;m+=1){if(e!==r.attempt)return null;let f=r.detector,p=Promise.resolve(null),h,g=0;try{if(f!==null){let k=r.profiler?.profile.inputWidth??160,I=t.makeSnapshot?.(n,k)??r.defaultSnapshot(n,k);h=a(n).then(y=>(g=i(),y));let $=i();p=f.detect(I,n.videoWidth,n.videoHeight).then(y=>(d+=i()-$,y),()=>null)}else h=a(n).then(k=>(g=i(),k));let[v,_]=await Promise.all([h,p]);o.push(v),l.push(Xe(_,v.sharpness))}catch{h?.catch(()=>{})}let E=g>0?Math.max(0,i()-g):0;m<3&&await new Promise(v=>setTimeout(v,Math.max(0,s-E)))}if(e!==r.attempt)return null;let c=qe(l);if(c===-1)return null;let u=0;l.forEach((m,f)=>{m.sharpness>l[u].sharpness&&(u=f)});try{t.telemetry?.({type:"keyframe",tier:r.detector?.tier??null,chosen:c,sharpest:u,detectMs:Math.round(d),candidates:l.map(jt)})}catch{}return o[c]??null}var qt,Yt,Zt,Qt,Z,Be,O,Ye,Ze,$t,$e=dt(()=>{"use strict";qt=4,Yt=600,Zt=.5,Qt=30,Z={frontal:.1,eyes:.1,score:.05},Be=r=>r<0?0:r>1?1:r;O=r=>Number.isFinite(r)?Math.round(r*1e3)/1e3:0,Ye=99,Ze=999999;$t=Qe});var nr={};be(nr,{CENTERED_FACTOR:()=>Mt,CIRCLE_RADIUS_FACTOR:()=>Et,CLIP_MS:()=>Se,CaptureSessionV3:()=>ye,ClipError:()=>b,ClipRecorder:()=>P,DEFAULT_CLIP_MIME:()=>W,DEFAULT_TIER_ORDER:()=>xe,DEFAULT_V3_ASSET_BASE_URL:()=>Re,DEVICE_PROFILES:()=>Oe,DetectScheduler:()=>G,DetectorLadderError:()=>C,DeviceProfiler:()=>N,EXPOSURE_BAND:()=>L,FaceGateV3:()=>w,GATE_SNAPSHOT_MS:()=>tt,GateBlockStats:()=>D,HOLD_UPRIGHT_KEY:()=>Q,IN_CIRCLE_FACTOR:()=>St,KEYFRAME_CANDIDATES:()=>j,KEYFRAME_WINDOW_MS:()=>nt,MAX_CLIP_BYTES:()=>H,MIME_CANDIDATES:()=>Ee,PHONE_MAX_SHORT_SIDE:()=>ke,PROVENANCE_WAIT_MS:()=>it,SHARP_REF:()=>br,STOP_GRACE_MS:()=>_e,TIMESLICE_MS:()=>Me,UPRIGHT_WATCH_MS:()=>rt,V3_GATE_DEFAULTS:()=>De,VIDEO_BPS:()=>ie,blockReasonOf:()=>Ue,buildCaptureConstraints:()=>ae,buildLivenessV2FormData:()=>ht,cameraPreflight:()=>re,captureMirroredKeyframe:()=>ne,classifyDevice:()=>me,createDetector:()=>R,detectFormFactor:()=>K,detectIsMobile:()=>se,errorCopy:()=>gt,exposure:()=>le,extForMime:()=>J,intrinsicSize:()=>T,isClipTooLarge:()=>A,isMediaRecorderSupported:()=>ft,mapGetUserMediaError:()=>te,meanLuma:()=>X,pickMimeType:()=>ee,probeDevice:()=>de,sharpness:()=>q,toStreamPixels:()=>F,trackFacingMode:()=>oe,uiCopy:()=>yt});module.exports=pt(nr);var Ee=["video/mp4;codecs=avc1.42E01E,mp4a.40.2","video/mp4;codecs=avc1.42E01E","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp9","video/webm;codecs=vp8,opus","video/webm;codecs=vp8","video/webm"];function ee(){let r=globalThis.MediaRecorder;return!r||typeof r.isTypeSupported!="function"?"":Ee.find(e=>r.isTypeSupported(e))??""}var W="video/webm";function te(r){if(r instanceof TypeError)return"insecure";switch(r?.name??""){case"NotAllowedError":case"PermissionDeniedError":return"permission";case"NotFoundError":case"DevicesNotFoundError":return"notfound";case"NotReadableError":case"TrackStartError":return"inuse";case"OverconstrainedError":case"ConstraintNotSatisfiedError":return"overconstrained";default:return"generic"}}function re(){let r=globalThis;if(typeof r.window<"u"&&r.window.isSecureContext===!1)return"INSECURE_CONTEXT";let e=r.navigator?.mediaDevices;return!e||typeof e.getUserMedia!="function"?"UNSUPPORTED":"OK"}function ft(){let r=globalThis.MediaRecorder;return typeof r<"u"&&typeof r.isTypeSupported=="function"}var H=8*1024*1024;function A(r){return r.size>H}function J(r){let e=(r||"").toLowerCase();return e.startsWith("image/jpeg")?"jpg":e.startsWith("video/mp4")?"mp4":(e.startsWith("video/webm"),"webm")}function ht(r){let{token:e,clip:t,keyframe:n}=r,i=r.ts??Date.now(),a=t.type||W,s=n.type||"image/jpeg",o=new FormData;return o.append("token",e),o.append("clip",new File([t],`liveness-${i}.${J(a)}`,{type:a})),o.append("keyframe",new File([n],`keyframe-${i}.${J(s)}`,{type:s})),o}function ne(r,e,t=.92){return new Promise((n,i)=>{let a=r.videoWidth,s=r.videoHeight;if(!a||!s){i(new Error("video-not-ready"));return}let o=e.getContext("2d");if(!o){i(new Error("no-2d-context"));return}e.width=a,e.height=s,o.scale(-1,1),o.drawImage(r,-a,0),e.toBlob(l=>l?n(l):i(new Error("empty-keyframe")),"image/jpeg",t)})}var gt={permission:{key:"fcv2.err.permission",fr:"Autorisez la cam\xE9ra dans les r\xE9glages du navigateur (ic\xF4ne cam\xE9ra dans la barre d\u2019adresse), puis r\xE9essayez."},notfound:{key:"fcv2.err.notfound",fr:"Aucune cam\xE9ra d\xE9tect\xE9e. Branchez ou activez une cam\xE9ra, puis r\xE9essayez."},inuse:{key:"fcv2.err.inuse",fr:"La cam\xE9ra est utilis\xE9e par une autre application. Fermez-la puis r\xE9essayez."},overconstrained:{key:"fcv2.err.overconstrained",fr:"La cam\xE9ra ne prend pas en charge les r\xE9glages demand\xE9s. Nouvel essai en cours\u2026"},insecure:{key:"fcv2.err.insecure",fr:"La cam\xE9ra n\xE9cessite une connexion s\xE9curis\xE9e (HTTPS). Ouvrez la page en HTTPS."},unsupported:{key:"fcv2.err.unsupported",fr:"Votre navigateur ne prend pas en charge l\u2019enregistrement vid\xE9o. Utilisez un navigateur r\xE9cent."},generic:{key:"fcv2.err.generic",fr:"Cam\xE9ra indisponible. R\xE9essayez ou contactez le support."}},yt={recording:{key:"fcv2.recording",fr:"Enregistrement en cours\u2026"},uploading:{key:"fcv2.uploading",fr:"Envoi en cours\u2026"},clipTooLarge:{key:"fcv2.err.cliptoolarge",fr:"La vid\xE9o est trop volumineuse. R\xE9essayez dans un endroit mieux \xE9clair\xE9."},retry:{key:"fcv2.retry",fr:"R\xE9essayer"},listen:{key:"fcv2.listen",fr:"\xC9couter"}};var Se=2500,Me=1e3,_e=1500,ie=25e5,b=class extends Error{constructor(e,t){super(t??e),this.kind=e}},P=class{constructor(){this.recorder=null;this.stream=null;this.chunks=[];this.bytes=0;this.hardStopTimer=null;this.graceTimer=null;this.settled=!1}clearTimers(){this.hardStopTimer&&clearTimeout(this.hardStopTimer),this.graceTimer&&clearTimeout(this.graceTimer),this.hardStopTimer=null,this.graceTimer=null}record(e,t,n){if(this.recorder&&!this.settled)return Promise.reject(new b("generic","record() called while a recording is in flight \u2014 ClipRecorder handles one recording at a time"));this.recorder=null,this.clearTimers(),this.chunks=[],this.bytes=0,this.settled=!1,this.stream=e;let i=ee();return new Promise((a,s)=>{let o;try{o=new MediaRecorder(e,i?{mimeType:i,videoBitsPerSecond:ie}:{videoBitsPerSecond:ie})}catch{try{o=new MediaRecorder(e)}catch{s(new b("unsupported"));return}}this.recorder=o;let l=c=>{this.settled||(this.settled=!0,this.clearTimers(),c())},d=()=>l(()=>{let c=o.mimeType||i||W,u=new Blob(this.chunks,{type:c});if(u.size===0){s(new b("generic","empty clip"));return}if(A(u)){s(new b("cliptoolarge"));return}a({blob:u,mimeType:c})});if(o.ondataavailable=c=>{c.data&&c.data.size&&(this.chunks.push(c.data),this.bytes+=c.data.size,this.bytes>H&&l(()=>{try{o.state!=="inactive"&&o.stop()}catch{}s(new b("cliptoolarge"))}))},o.onstop=d,o.onerror=()=>l(()=>s(new b("generic"))),n!==void 0){let c=!1;o.onstart=()=>{if(!(c||this.settled)){c=!0;try{n()}catch{}}}}try{o.start(Me)}catch{l(()=>s(new b("generic")));return}this.hardStopTimer=setTimeout(()=>{if(this.settled||t?.(),o.state!=="inactive"){try{o.stop()}catch{d()}this.graceTimer=setTimeout(d,_e)}else d()},Se)})}stop(e){this.clearTimers();let t=this.recorder;if(t&&t.state!=="inactive")try{t.stop()}catch{}this.recorder=null,(e??this.stream)?.getTracks().forEach(i=>i.stop()),this.stream=null}};function ae(r,e){return{video:{width:{ideal:1280,max:1280},height:{ideal:720,max:720},facingMode:e,frameRate:{ideal:24,max:30}},audio:!1}}var ke=600;function K(){if(typeof window>"u"||typeof navigator>"u")return"desktop";let r=String(navigator.userAgent??"");if(/iPhone|iPod/i.test(r))return"phone";if(/iPad/i.test(r))return"tablet";if(/Android/i.test(r))return/Mobile/i.test(r)?"phone":"tablet";if(/BlackBerry|IEMobile|Opera Mini/i.test(r))return"phone";if(Number(navigator.maxTouchPoints??0)<=1)return"desktop";if(/Macintosh/.test(r))return"tablet";if(!vt())return"desktop";let t=bt();return t>0&&t<ke?"phone":"tablet"}function se(){return K()!=="desktop"}function bt(){try{let r=window.screen,e=Number(r?.width??0),t=Number(r?.height??0);return e>0&&t>0?Math.min(e,t):0}catch{return 0}}function oe(r){try{let t=r?.getVideoTracks?.()[0]?.getSettings?.().facingMode;return t==="user"||t==="environment"?t:null}catch{return null}}function vt(){try{return typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches}catch{return!1}}var Et=.45,St=.9,Mt=.4;var Te=1e4,U=class r{constructor(e,t){this.tier="blaze";this.inner=e,t!==void 0&&(this.fallbackReason=t)}static async create(e,t){let n=await import("@mediapipe/tasks-vision"),i=await n.FilesetResolver.forVisionTasks(e),a=await n.FaceDetector.createFromOptions(i,{baseOptions:{modelAssetPath:`${e}/blaze_face_short_range.tflite`,delegate:"CPU"},runningMode:"IMAGE"});return new r(a,t)}async detect(e,t,n){let i;try{i=this.inner.detect(e).detections}catch{return null}let a=_t(i);if(a?.boundingBox===void 0)return null;let s=T(e),o=kt(a.keypoints,s),l=a.keypoints?.[2],d={box:{x:a.boundingBox.originX,y:a.boundingBox.originY,width:a.boundingBox.width,height:a.boundingBox.height},...o!==void 0?{eyes:o}:{},...l!==void 0?{nose:{x:l.x*s.width,y:l.y*s.height}}:{},score:a.categories[0]?.score??0};return F(d,e,t,n)}destroy(){try{this.inner.close()}catch{}}};function _t(r){let e,t=-1;for(let n of r){let i=n.categories[0]?.score??0;i>t&&(e=n,t=i)}return e}function kt(r,e){let t=r?.[0],n=r?.[1];if(t===void 0||n===void 0)return;let i=o=>({x:o.x*e.width,y:o.y*e.height}),[a,s]=[i(t),i(n)];return a.x<=s.x?{left:a,right:s}:{left:s,right:a}}function Tt(){if(typeof OffscreenCanvas=="function")return new OffscreenCanvas(2,2);let r=document.createElement("canvas");return r.width=2,r.height=2,r}async function Ce(){let r=globalThis.FaceDetector;if(typeof r!="function")return{ok:!1,reason:"unsupported"};try{let e=new r({fastMode:!0,maxDetectedFaces:1});return await e.detect(Tt()),{ok:!0,instance:e}}catch(e){return{ok:!1,reason:`smoke_failed:${e instanceof Error?e.message:String(e)}`}}}var B=class{constructor(e,t){this.tier="native";this.inner=e,t!==void 0&&(this.fallbackReason=t)}async detect(e,t,n){let i;try{i=await this.inner.detect(e)}catch{return null}let a=i[0];if(a===void 0)return null;let s=Ct(a.landmarks),o={box:{x:a.boundingBox.x,y:a.boundingBox.y,width:a.boundingBox.width,height:a.boundingBox.height},...s!==void 0?{eyes:s}:{},score:1};return F(o,e,t,n)}destroy(){}};function Ct(r){if(r===void 0)return;let e=r.filter(i=>i.type==="eye").map(i=>i.locations[0]).filter(i=>i!==void 0),[t,n]=e;if(!(t===void 0||n===void 0))return t.x<=n.x?{left:t,right:n}:{left:n,right:t}}var Re="/models-v3",xe=["native","blaze"],C=class extends Error{constructor(e){super(`no detector tier available (${e})`),this.name="DetectorLadderError",this.fallbackReason=e}};function T(r){let e=r;if(typeof e.videoWidth=="number"&&e.videoWidth>0)return{width:e.videoWidth,height:e.videoHeight??0};if(typeof e.naturalWidth=="number"&&e.naturalWidth>0)return{width:e.naturalWidth,height:e.naturalHeight??0};let t=typeof e.width=="number"?e.width:0,n=typeof e.height=="number"?e.height:0;return{width:t,height:n}}function F(r,e,t,n){let i=T(e),a=i.width>0?t/i.width:1,s=i.height>0?n/i.height:1,o=l=>({x:l.x*a,y:l.y*s});return{box:{x:r.box.x*a,y:r.box.y*s,width:r.box.width*a,height:r.box.height*s},...r.eyes!==void 0?{eyes:{left:o(r.eyes.left),right:o(r.eyes.right)}}:{},...r.nose!==void 0?{nose:o(r.nose)}:{},score:r.score}}function Rt(r){return r instanceof Error?r.message:String(r)}async function R(r){let e=r.preferred??xe,t=[];for(let n of e){if(n==="native"){let i=await Ce();if(i.ok)return new B(i.instance,ce(t));t.push(`native:${i.reason}`);continue}try{return await xt(U.create(r.v3AssetBaseUrl??Re,ce(t)),r.blazeInitTimeoutMs??Te)}catch(i){t.push(i instanceof z?"blaze:blaze_init_timeout":`blaze:${Rt(i)}`)}}throw new C(ce(t)??"no_tier_available")}function ce(r){return r.length>0?r.join("; "):void 0}var z=class extends Error{};function xt(r,e){return new Promise((t,n)=>{let i=setTimeout(()=>{n(new z(`init exceeded ${e}ms`)),r.then(a=>a.destroy(),()=>{})},e);r.then(a=>{clearTimeout(i),t(a)},a=>{clearTimeout(i),n(a)})})}var br=180,L=[100,190],wt=64;function we(r,e){return .299*(r[e]??0)+.587*(r[e+1]??0)+.114*(r[e+2]??0)}function X(r){let{data:e,width:t,height:n}=r,i=t*n;if(i===0)return 0;let a=0;for(let s=0;s<i;s+=1)a+=we(e,s*4);return a/i}function q(r){let{data:e,width:t,height:n}=r;if(t<3||n<3)return 0;let i=new Float32Array(t*n);for(let c=0;c<i.length;c+=1)i[c]=we(e,c*4);let a=0,s=0,o=0;for(let c=1;c<n-1;c+=1)for(let u=1;u<t-1;u+=1){let m=c*t+u,f=(i[m-t]??0)+(i[m-1]??0)+(i[m+1]??0)+(i[m+t]??0)-4*(i[m]??0);a+=f,s+=f*f,o+=1}if(o===0)return 0;let l=a/o,d=s/o-l*l;return Math.min(1,Math.max(0,d)/180)}function le(r){let e=X(r),[t,n]=L,i=e<t?t-e:e>n?e-n:0;return Math.max(0,1-i/wt)}var De=Object.freeze({Q_GOOD:.6,RISE_PER_S:.9,FALL_PER_S:.25,CENTER_FALLOFF_IOD_MULTIPLE:1.35,BOX_EYE_OFFSET_FACTOR:.12,IOD_BOX_PROXY_FACTOR:.42,SIZE_IDEAL_MIN:.12,SIZE_IDEAL_MAX:.3,SIZE_HARD_MIN:.08,SIZE_HARD_MAX:.45,ROLL_MAX_DEG:25,MOTION_VELOCITY_IOD_PER_S:.5,MOTION_TAU_S:.4,MOTION_DEADBAND_IOD_PER_S:.1,READY_WINDOW_MS:500,GUIDE_SIZE:.6,GUIDE_CENTERING:.6,GUIDE_POSE:.6,GUIDE_EXPOSURE:.6,GUIDE_SHARPNESS:.35,GUIDE_MOTION:.5}),x=r=>Math.min(1,Math.max(0,r)),w=class{constructor(e={}){this.p=0;this.lastTickAt=null;this.lastCenter=null;this.velocityEma=0;this.qWindow=[];this.lastSizeDirection="ideal";this.t={...De,...e}}reset(){this.p=0,this.lastTickAt=null,this.lastCenter=null,this.velocityEma=0,this.qWindow=[],this.lastSizeDirection="ideal"}tick(e){let{observation:t,quality:n,timestampMs:i}=e,a=this.lastTickAt===null?0:Math.max(0,(i-this.lastTickAt)/1e3);this.lastTickAt=i;let s={presence:0,centering:0,size:0,pose:0,sharpness:x(n.sharpness),exposure:x(n.exposure),motion:1};if(t!==null){s.presence=1;let c=this.geometryOf(t,e);s.centering=c.centering,s.size=c.size,s.pose=c.pose,s.motion=this.motionOf(c.center,c.iod,i)}else this.lastCenter=null,this.velocityEma=0;let o=Math.min(s.presence,s.centering,s.size,s.pose,s.sharpness,s.exposure,s.motion);this.p=x(this.p+(o>=this.t.Q_GOOD?this.t.RISE_PER_S*o:-this.t.FALL_PER_S*(1-o))*a),this.qWindow.push({at:i,q:o}),this.qWindow=this.qWindow.filter(c=>c.at>=i-this.t.READY_WINDOW_MS);let l=this.qWindow.map(c=>c.q);if(l.length>=3){let c=Math.min(...l),u=l.indexOf(c);l=l.filter((m,f)=>f!==u)}let d=this.p>=1&&l.every(c=>c>=this.t.Q_GOOD);return{at:i,q:o,p:this.p,factors:s,guidanceKey:this.guidanceOf(s,n,o),ready:d,accepted:o>=this.t.Q_GOOD}}geometryOf(e,t){let{box:n,eyes:i}=e,a={x:t.frameWidth/2,y:t.frameHeight/2},s=Math.min(t.frameWidth,t.frameHeight),o=i!==void 0?{x:(i.left.x+i.right.x)/2,y:(i.left.y+i.right.y)/2}:{x:n.x+n.width/2,y:n.y+n.height/2-this.t.BOX_EYE_OFFSET_FACTOR*n.height},l=i!==void 0?Math.hypot(i.right.x-i.left.x,i.right.y-i.left.y):this.t.IOD_BOX_PROXY_FACTOR*n.width,d=Math.hypot(o.x-a.x,o.y-a.y),c=l<=0?0:1-x(d/(this.t.CENTER_FALLOFF_IOD_MULTIPLE*l)),u=s>0?l/s:0;this.lastSizeDirection=u<this.t.SIZE_IDEAL_MIN?"far":u>this.t.SIZE_IDEAL_MAX?"close":"ideal";let m;u<this.t.SIZE_HARD_MIN||u>this.t.SIZE_HARD_MAX?m=0:u<this.t.SIZE_IDEAL_MIN?m=(u-this.t.SIZE_HARD_MIN)/(this.t.SIZE_IDEAL_MIN-this.t.SIZE_HARD_MIN):u>this.t.SIZE_IDEAL_MAX?m=(this.t.SIZE_HARD_MAX-u)/(this.t.SIZE_HARD_MAX-this.t.SIZE_IDEAL_MAX):m=1;let f=1;if(i!==void 0){let p=Math.abs(Math.atan2(i.right.y-i.left.y,i.right.x-i.left.x))*180/Math.PI;f=1-x(p/this.t.ROLL_MAX_DEG)}return{center:o,iod:l,centering:c,size:m,pose:f}}motionOf(e,t,n){let i=this.lastCenter;if(this.lastCenter={...e,at:n},i===null||t<=0)return 1;let a=(n-i.at)/1e3;if(a<=0)return 1;let s=Math.hypot(e.x-i.x,e.y-i.y)/t/a;s<=this.t.MOTION_DEADBAND_IOD_PER_S&&(s=0);let o=1-Math.exp(-a/this.t.MOTION_TAU_S);return this.velocityEma=o*s+(1-o)*this.velocityEma,1-x(this.velocityEma/this.t.MOTION_VELOCITY_IOD_PER_S)}guidanceOf(e,t,n){if(e.presence<=0)return"fcv3.no_face";if(e.size<this.t.GUIDE_SIZE)return this.sizeGuidance();if(e.centering<this.t.GUIDE_CENTERING)return"fcv3.center_face";if(e.pose<this.t.GUIDE_POSE)return"fcv3.straighten";if(e.exposure<this.t.GUIDE_EXPOSURE)return this.exposureGuidance(t);if(e.sharpness<this.t.GUIDE_SHARPNESS)return"fcv3.steady_camera";if(e.motion<this.t.GUIDE_MOTION)return"fcv3.hold_still";if(n<this.t.Q_GOOD){let i=[["size",this.sizeGuidance()],["centering","fcv3.center_face"],["pose","fcv3.straighten"],["exposure",this.exposureGuidance(t)],["sharpness","fcv3.steady_camera"],["motion","fcv3.hold_still"]],a=i[0];for(let s of i)e[s[0]]<e[a[0]]&&(a=s);return a[1]}return"fcv3.hold_still"}sizeGuidance(){return this.lastSizeDirection==="far"?"fcv3.come_closer":"fcv3.move_back"}exposureGuidance(e){let t=(L[0]+L[1])/2;return e.meanLuma<t?"fcv3.more_light":"fcv3.too_bright"}};var Oe=Object.freeze({LOW:Object.freeze({cadenceHz:5,inputWidth:128,animations:"reduced"}),MID:Object.freeze({cadenceHz:8,inputWidth:160,animations:"full"}),HIGH:Object.freeze({cadenceHz:10,inputWidth:192,animations:"full"})}),Dt=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function de(){let r=typeof navigator>"u"?void 0:navigator,e=!1;try{e=typeof WebAssembly<"u"&&WebAssembly.validate(Dt)}catch{e=!1}return{cores:r?.hardwareConcurrency??2,memGB:r?.deviceMemory??null,simd:e}}function me(r){let e=r.memGB??4;return r.cores<4||e<3?"LOW":r.cores>=8&&e>=6?"HIGH":"MID"}var ue=["LOW","MID","HIGH"],N=class{constructor(e){this.samples=[];this.adjusted=!1;this.current=e}get deviceClass(){return this.current}get profile(){return Oe[this.current]}record(e){if(this.adjusted||this.samples.length>=10)return this.current;if(this.samples.push(e),this.samples.length<10)return this.current;this.adjusted=!0;let t=this.samples.reduce((n,i)=>n+i,0)/this.samples.length;if(t>70)this.current="LOW";else if(t<25){let n=ue.indexOf(this.current);this.current=ue[Math.min(ue.length-1,n+1)]??this.current}return this.current}};var G=class{constructor(e){this.timer=null;this.frameCallbackId=null;this.running=!1;this.busy=!1;this.lastRunAt=Number.NEGATIVE_INFINITY;this.degradeCount=0;this.durations=[];this.options=e,this.periodMs=1e3/e.cadenceHz}start(){if(this.running)return;this.running=!0;let e=this.options.video;if(typeof e?.requestVideoFrameCallback=="function"){let t=()=>{this.running&&(this.frameCallbackId=e.requestVideoFrameCallback?.(()=>{this.frameCallbackId=null,this.now()-this.lastRunAt>=this.periodMs&&this.tick(),t()}))};t();return}this.timer=setInterval(()=>this.tick(),this.periodMs)}stop(){this.running=!1,this.timer!==null&&(clearInterval(this.timer),this.timer=null),this.frameCallbackId!==null&&(this.options.video?.cancelVideoFrameCallback?.(this.frameCallbackId),this.frameCallbackId=null)}stats(){let e=this.durations.length===0?0:this.durations.reduce((t,n)=>t+n,0)/this.durations.length;return{degradeCount:this.degradeCount,meanDetectMs:e}}now(){return this.options.now?.()??performance.now()}tick(){if(!this.running)return;if(this.busy){this.degradeCount+=1;return}this.busy=!0,this.lastRunAt=this.now();let e=this.now();this.options.run().catch(()=>{}).finally(()=>{this.busy=!1,this.durations.push(this.now()-e),this.durations.length>20&&this.durations.shift()})}};var Ie="0.1.0-rc.13";var Ae="sekyro.did",Pe;function Fe(){let r=globalThis.crypto;try{if(typeof r?.randomUUID=="function")return r.randomUUID()}catch{}try{if(typeof r?.getRandomValues=="function"){let e=r.getRandomValues(new Uint8Array(16));return Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}}catch{}}function Ot(){try{let r=localStorage.getItem(Ae);if(r)return r;let e=Fe();return e!==void 0&&localStorage.setItem(Ae,e),e}catch{return Pe??(Pe=Fe()),Pe}}async function It(){let r=globalThis.crypto?.subtle;if(!r)return"";let e=navigator,t=JSON.stringify([e.userAgent,e.platform,e.hardwareConcurrency??null,e.deviceMemory??null,e.maxTouchPoints??0,screen.width,screen.height,screen.colorDepth,globalThis.devicePixelRatio??1,Intl.DateTimeFormat().resolvedOptions().timeZone,e.languages?.join(",")??e.language]),n=await r.digest("SHA-256",new TextEncoder().encode(t));return Array.from(new Uint8Array(n),i=>i.toString(16).padStart(2,"0")).join("").slice(0,32)}function At(r){let e=new TextEncoder().encode(r),t="";for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Pt(r){let e,t;return{timezone(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone?.slice(0,64)||void 0}catch{return}},noteCameraLabel(n){n&&(e=n.slice(0,128))},async deviceHeader(){try{t??(t=It().catch(()=>""));let n=[];navigator.webdriver&&n.push("webdriver"),/HeadlessChrome/.test(navigator.userAgent)&&n.push("headless");let i=await t,a=Ot(),s={v:1,platform:"web",sdk:r.sdk.slice(0,64),ids:[...a?[{kind:"web_local",value:a.slice(0,128)}]:[],...i?[{kind:"web_fp",value:i}]:[]],screen:{w:screen.width,h:screen.height,dpr:globalThis.devicePixelRatio??1},...e?{cameraLabel:e}:{},...n.length?{signals:n}:{}};return At(JSON.stringify(s))}catch{return}}}}var pe=Symbol.for("sekyro.web.clientContext"),fe=globalThis,Ft=fe[pe]??(fe[pe]=Pt({sdk:`@sekyro/web@${Ie}`}));function Le(r){try{let e=r.getVideoTracks?.()[0];e&&Ft.noteCameraLabel(e.label)}catch{}}var Lt=["obs","manycam","virtual","snap camera","xsplit","droidcam","iriun","camo"],Nt=[/^(front|back|rear)( [a-z ]+)? camera$/i,/^camera2? ?\d+, facing (front|back|external)/i,/facetime/i,/\b(integrated|built-in|builtin) (web)?cam(era)?\b/i,/\b(hd )?web ?cam\b/i,/\([0-9a-f]{4}:[0-9a-f]{4}\)\s*$/i];function Gt(r){let e=(r??"").trim().toLowerCase();return e.length===0?"unknown":Lt.some(t=>e.includes(t))?"known_virtual":Nt.some(t=>t.test(e))?"platform":"unknown"}function Ne(r){if(typeof r!="function")return!1;try{return/\{\s*\[native code\]\s*\}\s*$/.test(Function.prototype.toString.call(r))}catch{return!1}}function Vt(r=globalThis){return Ne(r.navigator?.mediaDevices?.getUserMedia)&&Ne(r.MediaStreamTrack?.prototype?.getSettings)}async function Wt(r,e=globalThis){let t=e.crypto?.subtle?.digest;if(typeof t=="function")try{let n=new Uint8Array(await t.call(e.crypto?.subtle,"SHA-256",new TextEncoder().encode(r)));return Array.from(n.subarray(0,8),i=>i.toString(16).padStart(2,"0")).join("")}catch{return}}async function Ge(r,e=globalThis){let t={};try{t=typeof r.getSettings=="function"?r.getSettings()??{}:{}}catch{t={}}let n={};if((t.facingMode==="user"||t.facingMode==="environment"||t.facingMode==="left"||t.facingMode==="right")&&(n.facingMode=t.facingMode),typeof t.frameRate=="number"&&Number.isFinite(t.frameRate)&&(n.frameRate=t.frameRate),typeof t.width=="number"&&Number.isFinite(t.width)&&(n.width=t.width),typeof t.height=="number"&&Number.isFinite(t.height)&&(n.height=t.height),typeof t.deviceId=="string"&&t.deviceId.length>0){let a=await Wt(t.deviceId,e);a!==void 0&&(n.deviceIdHash=a)}let i;try{i=r.label}catch{i=void 0}return{trackSettings:n,capabilitiesPresent:typeof r.getCapabilities=="function",labelClass:Gt(i),prototypesIntact:Vt(e)}}var he=r=>Math.round(r*100)/100;function Ve(r){let e=r,t=typeof e?.requestVideoFrameCallback=="function",n=null,i=null,a=0,s=0,o=0,l=0,d=0,c=0,u=()=>{!t||e?.requestVideoFrameCallback===void 0||(n=e.requestVideoFrameCallback((m,f)=>{if(n=null,!t)return;let p=f.presentationTime;if(i!==null){let h=p-i.presentationTimeMs;s+=1;let g=h-o;o+=g/s,l+=g*(h-o)}typeof f.captureTime=="number"&&Number.isFinite(f.captureTime)&&(d+=p-f.captureTime,c+=1),a+=1,i={mediaTimeMs:f.mediaTime*1e3,presentationTimeMs:p},u()}))};return u(),{latest:()=>i,stats:()=>({n:a,meanGapMs:s===0?0:he(o),stdGapMs:s<2?0:he(Math.sqrt(l/(s-1))),captureLatencyMs:c===0?null:he(d/c)}),stop:()=>{t&&(t=!1,n!==null&&e?.cancelVideoFrameCallback?.(n),n=null)}}}function We(r,e,t){return{...r,rvfc:e,rampPainter:t}}var Ht=["rose","peach","sand","mint","sky","lilac"];var Kt=4,Ut=4;function Bt(r){if(typeof r!="object"||r===null)return!1;let e=r;if(typeof e.nonce!="string"||e.nonce.length===0||!Array.isArray(e.colours)||e.colours.length!==3||!e.colours.every(n=>Ht.includes(n))||!Array.isArray(e.onsetsMs)||e.onsetsMs.length!==3)return!1;let t=-1;for(let n of e.onsetsMs){if(typeof n!="number"||!Number.isFinite(n)||n<=t||n>=2e3)return!1;t=n}return!0}function He(r,e){let t=e.now??(()=>performance.now()),n=Bt(r)?r:void 0,i=[],a=null,s=null,o=null,l=!1,d=null,c=p=>{d=p;try{e.paint(p)}catch{}},u=p=>{let h=e.frames?.()??null;return h!==null&&o!==null?h.mediaTimeMs+(p-h.presentationTimeMs)-o:p-(s??p)},m=(p,h,g=0)=>{if(l)return;let E=Math.max(0,p-u(t()));a=setTimeout(()=>{if(a=null,!l){if(g<Kt&&u(t())<p-Ut){m(p,h,g+1);return}h()}},E)},f=p=>{if(n!==void 0){if(p>=3){m(2e3,()=>c(null));return}m(n.onsetsMs[p],()=>{let h=u(t());if(h>2e3){d!==null&&c(null);return}let g=n.colours[p];c(g);let E=i.length===0?0:i[i.length-1].tMs;i.push({tMs:Math.max(E,Math.round(h)),colour:g}),f(p+1)})}};return{started(p){if(n===void 0||l||s!==null)return;s=p;let h=e.frames?.()??null;o=h===null?null:h.mediaTimeMs+(p-h.presentationTimeMs),f(0)},stop(){l||(l=!0,a!==null&&clearTimeout(a),a=null,d!==null&&c(null))},report(){return n===void 0?void 0:{nonce:n.nonce,rendered:[...i]}}}}var M=1;function Ke(){return typeof OffscreenCanvas=="function"&&typeof createImageBitmap=="function"&&typeof Worker=="function"}function zt(r,e={}){let t=e.createDetector??R,n=null;r.onmessage=i=>{let a=i.data;if(a.v!==M){a.bitmap?.close?.();return}if(a.type==="init"){t(a.options).then(s=>{n=s;let o={v:M,type:"ready",tier:s.tier,...s.fallbackReason!==void 0?{fallbackReason:s.fallbackReason}:{}};r.postMessage(o)});return}if(a.type==="detect"){let s=o=>{let l={v:M,type:"result",id:a.id,observation:o};r.postMessage(l),a.bitmap.close?.()};if(n===null){s(null);return}n.detect(a.bitmap,a.streamWidth,a.streamHeight).then(s,()=>s(null))}}}typeof self<"u"&&typeof self.importScripts=="function"&&zt(self);var Y=class r{constructor(e,t){this.pending=new Map;this.nextId=1;this.worker=e,this.tier=t.tier,t.fallbackReason!==void 0&&(this.fallbackReason=t.fallbackReason),e.addEventListener("message",n=>{let i=n.data;if(i.v!==M||i.type!=="result")return;let a=this.pending.get(i.id);this.pending.delete(i.id),a?.(i.observation)})}static create(e,t,n=1e4){return new Promise((i,a)=>{let s=setTimeout(()=>{e.removeEventListener("message",o),e.terminate(),a(new Error(`worker detector not ready within ${n}ms`))},n),o=d=>{let c=d.data;c.v!==M||c.type!=="ready"||(clearTimeout(s),e.removeEventListener("message",o),i(new r(e,c)))};e.addEventListener("message",o);let l={v:M,type:"init",options:t};e.postMessage(l)})}async detect(e,t,n){let i;try{typeof ImageBitmap<"u"&&e instanceof ImageBitmap?i=e:typeof createImageBitmap=="function"?i=await createImageBitmap(e):i=e}catch{return null}let a=this.nextId;return this.nextId+=1,new Promise(s=>{this.pending.set(a,s);let o={v:M,type:"detect",id:a,bitmap:i,streamWidth:t,streamHeight:n};this.worker.postMessage(o,[i])})}destroy(){for(let e of this.pending.values())e(null);this.pending.clear(),this.worker.terminate()}};var Xt=["size","centering","pose","exposure","sharpness","motion"];function Ue(r){if(r.accepted)return null;if(r.factors.presence<=0)return"no_face";let e="size";for(let t of Xt)r.factors[t]<r.factors[e]&&(e=t);return e}var D=class{constructor(){this.blocked={};this.acceptedMs=0;this.ticks=0;this.lastAt=null}record(e){let t=this.lastAt===null?0:Math.max(0,e.at-this.lastAt);this.lastAt=e.at,this.ticks+=1;let n=Ue(e);if(n===null){this.acceptedMs+=t;return}let i=this.blocked[n]??{count:0,ms:0};i.count+=1,i.ms+=t,this.blocked[n]=i}summary(){let e={};for(let[t,n]of Object.entries(this.blocked))e[t]={count:n.count,ms:Math.round(n.ms)};return{blocked:e,acceptedMs:Math.round(this.acceptedMs),ticks:this.ticks}}};var tt=1e3,Q="fcv3.hold_upright",rt=200,j=4,nt=600,it=1e3,Je={sharpness:1,exposure:1,meanLuma:128};function Jt(r,e){return e.width=r.videoWidth,e.height=r.videoHeight,e.getContext("2d").drawImage(r,0,0),new Promise((t,n)=>e.toBlob(i=>i?t(i):n(new Error("empty-keyframe")),"image/jpeg",.92))}function er(){return K()==="phone"}var ye=class{constructor(e){this.handlers=new Map;this.stateValue="idle";this.attempt=0;this.stream=null;this.detector=null;this.scheduler=null;this.gate=null;this.profiler=null;this.lastGuidanceKey=null;this.positioningStartedAt=0;this.cameraRequestedAt=null;this.cameraReadyAt=null;this.faceAcquiredAt=null;this.captureCompleteAt=null;this.fired=!1;this.carriedDegrade=0;this.carriedMeans=[];this.blockStats=null;this.lastGateSnapshotAt=Number.NEGATIVE_INFINITY;this.uprightGuard=!1;this.trackProvenance=null;this.ramp=null;this.snapshotCanvas=null;this.options=e,this.facing=e.facingMode??"user"}get state(){return this.stateValue}on(e,t){let n=this.handlers.get(e);return n||(n=new Set,this.handlers.set(e,n)),n.add(t),()=>n?.delete(t)}emit(e,t){for(let n of[...this.handlers.get(e)??[]])n(t)}async start(e={}){e.facingMode!==void 0&&(this.facing=e.facingMode),this.attempt+=1,await this.run(this.attempt)}get facingMode(){return this.facing}retry(){this.teardownAttempt(),this.start()}switchCamera(){this.facing=this.facing==="user"?"environment":"user",this.teardownAttempt(),this.start()}destroy(){this.attempt+=1,this.teardownAttempt(),this.detector?.destroy(),this.detector=null,this.options.video.srcObject=null}async run(e){let{options:t}=this;this.fired=!1,this.lastGuidanceKey=null,this.carriedDegrade=0,this.carriedMeans=[],this.cameraRequestedAt=null,this.cameraReadyAt=null,this.faceAcquiredAt=null,this.captureCompleteAt=null,this.uprightGuard=(t.isPhone??er)(),this.setState("preflight");let n=re();if(n!=="OK"){this.fail(n==="INSECURE_CONTEXT"?"insecure":"unsupported");return}this.setState("acquiring");let i=t.getUserMedia??(d=>navigator.mediaDevices.getUserMedia(d)),a;this.cameraRequestedAt=this.now();try{a=await i(ae(se(),this.facing))}catch(d){if(e!==this.attempt)return;this.fail(te(d));return}if(Le(a),e!==this.attempt){for(let d of a.getTracks())d.stop();return}this.stream=a;let s=a.getVideoTracks?.()[0];if(this.trackProvenance=s===void 0?null:Ge(s).catch(()=>null),this.facing=oe(a)??this.facing,t.video.srcObject=a,await t.video.play().catch(()=>{}),e!==this.attempt)return;if(this.cameraReadyAt=this.now(),this.detector===null){let d={v3AssetBaseUrl:t.v3AssetBaseUrl},c=t.createDetector??(t.createWorker!==void 0&&Ke()?async()=>{try{return await Y.create(t.createWorker(),d)}catch{return R(d)}}:()=>R(d)),u;try{u=await c()}catch(m){e===this.attempt&&this.fail("models",m instanceof C?m.fallbackReason:rr(m));return}if(e!==this.attempt){u.destroy();return}this.detector=u,this.options.telemetry?.({type:"detector",tier:u.tier,fallbackReason:u.fallbackReason})}let o=de(),l=t.deviceClass??me(o);this.profiler=new N(l),this.options.telemetry?.({type:"profile",staticClass:l,activeClass:this.profiler.deviceClass,simd:o.simd}),this.gate=new w(t.thresholds??{}),this.blockStats=new D,this.lastGateSnapshotAt=this.now(),t.rankKeyframes?.()&&Promise.resolve().then(()=>($e(),je)).then(d=>ge=d,()=>{}),this.setState("positioning"),this.positioningStartedAt=this.now(),this.startScheduler(e)}get animations(){return this.profiler?.profile.animations??"full"}startScheduler(e){let t=this.profiler;if(t===null)return;if(this.scheduler!==null){let i=this.scheduler.stats();this.carriedDegrade+=i.degradeCount,i.meanDetectMs>0&&this.carriedMeans.push(i.meanDetectMs),this.scheduler.stop()}let n=new G({cadenceHz:t.profile.cadenceHz,video:this.options.video,now:this.options.now,run:()=>this.detectTick(e)});this.scheduler=n,n.start()}async detectTick(e){let{detector:t,gate:n,profiler:i}=this,a=this.options.video;if(e!==this.attempt||t===null||n===null||i===null||this.fired||a.videoWidth===0)return;if(this.isLandscape()){this.holdUpright(e);return}let s=i.deviceClass,o=this.now(),l=this.options.makeSnapshot?.(a,i.profile.inputWidth)??this.defaultSnapshot(a,i.profile.inputWidth),d=null;try{d=await t.detect(l,a.videoWidth,a.videoHeight)}catch{d=null}if(e!==this.attempt||this.fired)return;i.record(this.now()-o),i.deviceClass!==s&&this.startScheduler(e);let c=d===null?Je:this.options.measureQuality?.(a,d.box)??this.defaultQuality(a,d.box),u=n.tick({timestampMs:this.now(),observation:d,quality:c,frameWidth:a.videoWidth,frameHeight:a.videoHeight});u.accepted&&this.faceAcquiredAt===null&&(this.faceAcquiredAt=u.at),this.blockStats?.record(u),!u.ready&&u.at-this.lastGateSnapshotAt>=tt&&(this.lastGateSnapshotAt=u.at,this.reportGate(!1)),this.emit("checks",{engine:"v3",progress:u.p,q:u.q,factors:u.factors,attempt:e}),u.guidanceKey!==this.lastGuidanceKey&&(this.lastGuidanceKey=u.guidanceKey,this.emit("guidance",{key:u.guidanceKey})),u.ready&&this.stateValue==="positioning"&&(this.fired=!0,this.captureCompleteAt=u.at,this.fire(e))}async fire(e){let{options:t}=this,n=this.scheduler;n?.stop(),this.reportGate(!0);let i=n?.stats()??{degradeCount:0,meanDetectMs:0},a=[...this.carriedMeans,...i.meanDetectMs>0?[i.meanDetectMs]:[]];t.telemetry?.({type:"fired",timeToGateMs:this.now()-this.positioningStartedAt,degradeCount:this.carriedDegrade+i.degradeCount,meanDetectMs:a.length===0?0:a.reduce((y,S)=>y+S,0)/a.length});let s=t.mode??"clip",o=t.rankKeyframes?.()&&ge?ge.default(this,e).catch(()=>this.collectKeyframes(e)):this.collectKeyframes(e);if(s==="photo"){let y=this.watchRotation(e,null),S=await o;if(y(),e!==this.attempt)return;if(S===null){this.fail("generic");return}let at=await this.provenance({n:0,meanGapMs:0,stdGapMs:0,captureLatencyMs:null},!1);if(e!==this.attempt)return;this.finishCapture({keyframe:S.blob,previewDataUrl:S.previewDataUrl,...at});return}this.setState("recording");let l=t.createRecorder?.()??new P,d=this.stream;if(d===null){this.fail("generic");return}let c=Ve(t.video),u=t.screenRamp?.(),m=u!==void 0,f=He(u,{paint:y=>{(y===null||e===this.attempt)&&this.emit("ramp",{colour:y})},now:()=>this.now(),frames:c.latest});this.ramp=f;let p=()=>{c.stop(),f.stop(),this.ramp===f&&(this.ramp=null)},h=this.watchRotation(e,l),g=null;o.then(y=>{g=y},()=>{});let E=()=>{e===this.attempt&&g!==null&&this.emit("frozen",{previewDataUrl:g.previewDataUrl})},v,_;try{[v,_]=await Promise.all([l.record(d,E,()=>f.started(this.now())),o])}catch(y){if(h(),p(),e!==this.attempt)return;let S=y.kind;this.fail(S==="cliptoolarge"?"cliptoolarge":"recorder");return}h();let k=c.stats();if(p(),e!==this.attempt)return;if(A(v.blob)){this.fail("cliptoolarge");return}if(_===null){this.fail("generic");return}let I=f.report(),$=await this.provenance(k,m);e===this.attempt&&this.finishCapture({clip:v.blob,clipMimeType:v.mimeType,keyframe:_.blob,previewDataUrl:_.previewDataUrl,...I!==void 0&&I.rendered.length>0?{screenRamp:I}:{},...$})}async provenance(e,t){let n=this.trackProvenance;if(n===null)return{};let i,a=new Promise(o=>{i=setTimeout(()=>o(null),it)}),s=await Promise.race([n,a]);return clearTimeout(i),s===null?{}:{provenance:We(s,e,t)}}isLandscape(){let e=this.options.video;return this.uprightGuard&&e.videoWidth>e.videoHeight}holdUpright(e){this.gate?.reset(),this.emit("checks",{engine:"v3",progress:0,q:0,factors:{presence:0,centering:0,size:0,pose:0,sharpness:0,exposure:0,motion:0},attempt:e}),this.lastGuidanceKey!==Q&&(this.lastGuidanceKey=Q,this.emit("guidance",{key:Q}))}watchRotation(e,t){if(!this.uprightGuard)return()=>{};let n=this.options.video,i=()=>{if(e!==this.attempt||t!==null&&this.stateValue!=="recording"){o();return}n.videoWidth>0&&this.isLandscape()&&(o(),this.abortRecording(e,t))},a=setInterval(i,rt);n.addEventListener?.("resize",i);let s=!1;function o(){s||(s=!0,clearInterval(a),n.removeEventListener?.("resize",i))}return o}abortRecording(e,t){if(e!==this.attempt)return;this.attempt+=1;let n=this.attempt;try{t?.stop()}catch{}this.ramp?.stop(),this.ramp=null,this.fired=!1,this.captureCompleteAt=null,this.gate=new w(this.options.thresholds??{}),this.blockStats=new D,this.lastGateSnapshotAt=this.now(),this.lastGuidanceKey=null,this.setState("positioning"),this.positioningStartedAt=this.now(),this.holdUpright(n),this.startScheduler(n)}async collectKeyframes(e){let t=this.options.captureKeyframe??(a=>this.defaultKeyframe(a)),n=nt/(j-1),i=null;for(let a=0;a<j;a+=1){if(e!==this.attempt)return i;try{let s=await t(this.options.video);(i===null||s.sharpness>i.sharpness)&&(i=s)}catch{}a<j-1&&await tr(n)}return i}finishCapture(e){this.stopTracks(),this.setState("captured");let t=this.captureTiming();this.emit("artifacts",t===void 0?e:{...e,timing:t})}captureTiming(){let e={},t=(n,i,a)=>{i!==null&&a!==null&&(e[n]=Math.max(0,Math.round(a-i)))};return t("cameraReadyMs",this.cameraRequestedAt,this.cameraReadyAt),t("faceAcquireMs",this.cameraReadyAt,this.faceAcquiredAt),t("captureMs",this.faceAcquiredAt,this.captureCompleteAt),Object.keys(e).length>0?e:void 0}async defaultKeyframe(e){let t=document.createElement("canvas"),n=await(this.facing==="user"?ne:Jt)(e,t),i=t.toDataURL("image/jpeg",.92);return{blob:n,previewDataUrl:i,sharpness:this.centerSharpness(e)}}defaultSnapshot(e,t){try{let n=this.snapshotCanvas??document.createElement("canvas"),i=t/Math.max(1,e.videoWidth),a=Math.max(1,Math.round(e.videoWidth*i)),s=Math.max(1,Math.round(e.videoHeight*i)),o=n.getContext("2d");return o===null?e:(n.width!==a&&(n.width=a),n.height!==s&&(n.height=s),o.drawImage(e,0,0,a,s),this.snapshotCanvas=n,n)}catch{return e}}defaultQuality(e,t){let n=et(e,t,96);return n===null?Je:{sharpness:q(n),exposure:le(n),meanLuma:X(n)}}centerSharpness(e){let t=T(e),n=et(e,{x:t.width*.25,y:t.height*.25,width:t.width*.5,height:t.height*.5},96);return n===null?0:q(n)}teardownAttempt(){this.scheduler?.stop(),this.scheduler=null,this.reportGate(!0),this.gate=null,this.ramp?.stop(),this.ramp=null,this.stopTracks()}reportGate(e){let t=this.blockStats,n=this.profiler;if(t===null||n===null)return;let i=t.summary();e&&(this.blockStats=null),i.ticks!==0&&this.options.telemetry?.({type:"gate",final:e,activeClass:n.deviceClass,cadenceHz:n.profile.cadenceHz,...i})}stopTracks(){if(this.stream!==null){for(let e of this.stream.getTracks())e.stop();this.stream=null}}fail(e,t){this.scheduler?.stop(),this.reportGate(!0),this.stopTracks(),this.setState("error"),this.options.telemetry?.({type:"error",kind:e,fallbackReason:t}),this.emit("error",{kind:e,retryable:e!=="insecure"&&e!=="unsupported"})}setState(e){this.stateValue=e,this.emit("statechange",{state:e})}now(){return this.options.now?.()??performance.now()}},ge;function tr(r){return new Promise(e=>setTimeout(e,r))}function rr(r){return r instanceof Error?r.message:String(r)}function et(r,e,t){try{let n=document.createElement("canvas"),i=t/Math.max(1,e.width);n.width=Math.max(1,Math.round(e.width*i)),n.height=Math.max(1,Math.round(e.height*i));let a=n.getContext("2d");return a===null?null:(a.drawImage(r,e.x,e.y,e.width,e.height,0,0,n.width,n.height),a.getImageData(0,0,n.width,n.height))}catch{return null}}0&&(module.exports={CENTERED_FACTOR,CIRCLE_RADIUS_FACTOR,CLIP_MS,CaptureSessionV3,ClipError,ClipRecorder,DEFAULT_CLIP_MIME,DEFAULT_TIER_ORDER,DEFAULT_V3_ASSET_BASE_URL,DEVICE_PROFILES,DetectScheduler,DetectorLadderError,DeviceProfiler,EXPOSURE_BAND,FaceGateV3,GATE_SNAPSHOT_MS,GateBlockStats,HOLD_UPRIGHT_KEY,IN_CIRCLE_FACTOR,KEYFRAME_CANDIDATES,KEYFRAME_WINDOW_MS,MAX_CLIP_BYTES,MIME_CANDIDATES,PHONE_MAX_SHORT_SIDE,PROVENANCE_WAIT_MS,SHARP_REF,STOP_GRACE_MS,TIMESLICE_MS,UPRIGHT_WATCH_MS,V3_GATE_DEFAULTS,VIDEO_BPS,blockReasonOf,buildCaptureConstraints,buildLivenessV2FormData,cameraPreflight,captureMirroredKeyframe,classifyDevice,createDetector,detectFormFactor,detectIsMobile,errorCopy,exposure,extForMime,intrinsicSize,isClipTooLarge,isMediaRecorderSupported,mapGetUserMediaError,meanLuma,pickMimeType,probeDevice,sharpness,toStreamPixels,trackFacingMode,uiCopy});
|
|
1
|
+
"use strict";var lt=Object.create;var V=Object.defineProperty;var ut=Object.getOwnPropertyDescriptor;var dt=Object.getOwnPropertyNames;var mt=Object.getPrototypeOf,pt=Object.prototype.hasOwnProperty;var ft=(r,e)=>()=>(r&&(e=r(r=0)),e);var Se=(r,e)=>{for(var t in e)V(r,t,{get:e[t],enumerable:!0})},Ee=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of dt(e))!pt.call(r,i)&&i!==t&&V(r,i,{get:()=>e[i],enumerable:!(n=ut(e,i))||n.enumerable});return r};var ht=(r,e,t)=>(t=r!=null?lt(mt(r)):{},Ee(e||!r||!r.__esModule?V(t,"default",{value:r,enumerable:!0}):t,r)),yt=r=>Ee(V({},"__esModule",{value:!0}),r);var et={};Se(et,{RANK_CANDIDATES:()=>jt,RANK_TOLERANCE:()=>Z,RANK_WINDOW_MS:()=>$t,ROLL_ZERO_DEG:()=>er,SHARPNESS_REPORT_MAX:()=>$e,YAW_REPORT_MAX:()=>je,YAW_ZERO_IOD:()=>Jt,collectRankedKeyframes:()=>Je,default:()=>rr,featuresOf:()=>Ze,frontalOf:()=>Ye,rankKeyframes:()=>Qe});function Ye(r){let e=r.eyes;if(e===void 0)return{frontal:1,yaw:null,roll:null};let t=e.right.x-e.left.x,n=e.right.y-e.left.y,i=t*t+n*n;if(i===0)return{frontal:1,yaw:null,roll:null};let a=Math.abs(Math.atan2(n,Math.abs(t))*180/Math.PI),s=qe(1-a/30),o=null,l=r.nose;if(l!==void 0){let d=(e.left.x+e.right.x)/2,c=(e.left.y+e.right.y)/2;o=Math.abs(((l.x-d)*t+(l.y-c)*n)/i),s*=qe(1-o/.5)}return{frontal:s,yaw:o,roll:a}}function Ze(r,e){return r===null?{face:!1,frontal:0,yaw:null,roll:null,eyes:null,score:0,sharpness:e}:{face:!0,...Ye(r),eyes:null,score:r.score,sharpness:e}}function Qe(r){let e=r.map((i,a)=>a),t=(i,a)=>{let s=Number.NEGATIVE_INFINITY;for(let o of e)s=Math.max(s,i(r[o]));e=e.filter(o=>i(r[o])>=s-a)};t(i=>i.frontal,Z.frontal),t(i=>i.eyes??1,Z.eyes),t(i=>i.score,Z.score);let n=-1;for(let i of e)(n===-1||r[i].sharpness>r[n].sharpness)&&(n=i);return n}function tr(r){return{face:r.face,frontal:O(r.frontal),...r.yaw!==null?{yaw:Math.min(O(r.yaw),je)}:{},...r.roll!==null?{roll:O(r.roll)}:{},...r.eyes!==null?{eyes:O(r.eyes)}:{},score:O(r.score),sharpness:Math.min(O(r.sharpness),$e)}}async function Je(r,e){let{options:t}=r,n=t.video,i=t.now??(()=>performance.now()),a=t.captureKeyframe??(m=>r.defaultKeyframe(m)),s=600/3,o=[],l=[],d=0;for(let m=0;m<4;m+=1){if(e!==r.attempt)return null;let f=r.detector,p=Promise.resolve(null),h,y=0;try{if(f!==null){let T=r.profiler?.profile.inputWidth??160,I=t.makeSnapshot?.(n,T)??r.defaultSnapshot(n,T);h=a(n).then(g=>(y=i(),g));let $=i();p=f.detect(I,n.videoWidth,n.videoHeight).then(g=>(d+=i()-$,g),()=>null)}else h=a(n).then(T=>(y=i(),T));let[v,k]=await Promise.all([h,p]);o.push(v),l.push(Ze(k,v.sharpness))}catch{h?.catch(()=>{})}let S=y>0?Math.max(0,i()-y):0;m<3&&await new Promise(v=>setTimeout(v,Math.max(0,s-S)))}if(e!==r.attempt)return null;let c=Qe(l);if(c===-1)return null;let u=0;l.forEach((m,f)=>{m.sharpness>l[u].sharpness&&(u=f)});try{t.telemetry?.({type:"keyframe",tier:r.detector?.tier??null,chosen:c,sharpest:u,detectMs:Math.round(d),candidates:l.map(tr)})}catch{}return o[c]??null}var jt,$t,Jt,er,Z,qe,O,je,$e,rr,tt=ft(()=>{"use strict";jt=4,$t=600,Jt=.5,er=30,Z={frontal:.1,eyes:.1,score:.05},qe=r=>r<0?0:r>1?1:r;O=r=>Number.isFinite(r)?Math.round(r*1e3)/1e3:0,je=99,$e=999999;rr=Je});var or={};Se(or,{CENTERED_FACTOR:()=>_t,CIRCLE_RADIUS_FACTOR:()=>kt,CLIP_MS:()=>ke,CaptureSessionV3:()=>ve,ClipError:()=>b,ClipRecorder:()=>P,DEFAULT_CLIP_MIME:()=>W,DEFAULT_TIER_ORDER:()=>De,DEFAULT_V3_ASSET_BASE_URL:()=>we,DEVICE_PROFILES:()=>Ae,DetectScheduler:()=>G,DetectorLadderError:()=>C,DeviceProfiler:()=>N,EXPOSURE_BAND:()=>L,FaceGateV3:()=>w,GATE_SNAPSHOT_MS:()=>it,GateBlockStats:()=>D,HOLD_UPRIGHT_KEY:()=>Q,IN_CIRCLE_FACTOR:()=>Tt,KEYFRAME_CANDIDATES:()=>j,KEYFRAME_WINDOW_MS:()=>st,MAX_CLIP_BYTES:()=>H,MIME_CANDIDATES:()=>Me,PHONE_MAX_SHORT_SIDE:()=>Ce,PROVENANCE_WAIT_MS:()=>ot,SHARP_REF:()=>Mr,STOP_GRACE_MS:()=>_e,TIMESLICE_MS:()=>Te,UPRIGHT_WATCH_MS:()=>at,V3_GATE_DEFAULTS:()=>Ie,VIDEO_BPS:()=>ie,blockReasonOf:()=>Xe,buildCaptureConstraints:()=>ae,buildLivenessV2FormData:()=>bt,cameraPreflight:()=>re,captureMirroredKeyframe:()=>ne,classifyDevice:()=>me,createDetector:()=>x,detectFormFactor:()=>K,detectIsMobile:()=>se,errorCopy:()=>vt,exposure:()=>le,extForMime:()=>J,intrinsicSize:()=>_,isClipTooLarge:()=>A,isMediaRecorderSupported:()=>gt,mapGetUserMediaError:()=>te,meanLuma:()=>X,pickMimeType:()=>ee,probeDevice:()=>de,sharpness:()=>q,toStreamPixels:()=>F,trackFacingMode:()=>oe,uiCopy:()=>St});module.exports=yt(or);var Me=["video/mp4;codecs=avc1.42E01E,mp4a.40.2","video/mp4;codecs=avc1.42E01E","video/mp4","video/webm;codecs=vp9,opus","video/webm;codecs=vp9","video/webm;codecs=vp8,opus","video/webm;codecs=vp8","video/webm"];function ee(){let r=globalThis.MediaRecorder;return!r||typeof r.isTypeSupported!="function"?"":Me.find(e=>r.isTypeSupported(e))??""}var W="video/webm";function te(r){if(r instanceof TypeError)return"insecure";switch(r?.name??""){case"NotAllowedError":case"PermissionDeniedError":return"permission";case"NotFoundError":case"DevicesNotFoundError":return"notfound";case"NotReadableError":case"TrackStartError":return"inuse";case"OverconstrainedError":case"ConstraintNotSatisfiedError":return"overconstrained";default:return"generic"}}function re(){let r=globalThis;if(typeof r.window<"u"&&r.window.isSecureContext===!1)return"INSECURE_CONTEXT";let e=r.navigator?.mediaDevices;return!e||typeof e.getUserMedia!="function"?"UNSUPPORTED":"OK"}function gt(){let r=globalThis.MediaRecorder;return typeof r<"u"&&typeof r.isTypeSupported=="function"}var H=8*1024*1024;function A(r){return r.size>H}function J(r){let e=(r||"").toLowerCase();return e.startsWith("image/jpeg")?"jpg":e.startsWith("video/mp4")?"mp4":(e.startsWith("video/webm"),"webm")}function bt(r){let{token:e,clip:t,keyframe:n}=r,i=r.ts??Date.now(),a=t.type||W,s=n.type||"image/jpeg",o=new FormData;return o.append("token",e),o.append("clip",new File([t],`liveness-${i}.${J(a)}`,{type:a})),o.append("keyframe",new File([n],`keyframe-${i}.${J(s)}`,{type:s})),o}function ne(r,e,t=.92){return new Promise((n,i)=>{let a=r.videoWidth,s=r.videoHeight;if(!a||!s){i(new Error("video-not-ready"));return}let o=e.getContext("2d");if(!o){i(new Error("no-2d-context"));return}e.width=a,e.height=s,o.scale(-1,1),o.drawImage(r,-a,0),e.toBlob(l=>l?n(l):i(new Error("empty-keyframe")),"image/jpeg",t)})}var vt={permission:{key:"fcv2.err.permission",fr:"Autorisez la cam\xE9ra dans les r\xE9glages du navigateur (ic\xF4ne cam\xE9ra dans la barre d\u2019adresse), puis r\xE9essayez."},notfound:{key:"fcv2.err.notfound",fr:"Aucune cam\xE9ra d\xE9tect\xE9e. Branchez ou activez une cam\xE9ra, puis r\xE9essayez."},inuse:{key:"fcv2.err.inuse",fr:"La cam\xE9ra est utilis\xE9e par une autre application. Fermez-la puis r\xE9essayez."},overconstrained:{key:"fcv2.err.overconstrained",fr:"La cam\xE9ra ne prend pas en charge les r\xE9glages demand\xE9s. Nouvel essai en cours\u2026"},insecure:{key:"fcv2.err.insecure",fr:"La cam\xE9ra n\xE9cessite une connexion s\xE9curis\xE9e (HTTPS). Ouvrez la page en HTTPS."},unsupported:{key:"fcv2.err.unsupported",fr:"Votre navigateur ne prend pas en charge l\u2019enregistrement vid\xE9o. Utilisez un navigateur r\xE9cent."},generic:{key:"fcv2.err.generic",fr:"Cam\xE9ra indisponible. R\xE9essayez ou contactez le support."}},St={recording:{key:"fcv2.recording",fr:"Enregistrement en cours\u2026"},uploading:{key:"fcv2.uploading",fr:"Envoi en cours\u2026"},clipTooLarge:{key:"fcv2.err.cliptoolarge",fr:"La vid\xE9o est trop volumineuse. R\xE9essayez dans un endroit mieux \xE9clair\xE9."},retry:{key:"fcv2.retry",fr:"R\xE9essayer"},listen:{key:"fcv2.listen",fr:"\xC9couter"}};var ke=2500,Te=1e3,_e=1500,ie=25e5,b=class extends Error{constructor(e,t){super(t??e),this.kind=e}},P=class{constructor(){this.recorder=null;this.stream=null;this.chunks=[];this.bytes=0;this.hardStopTimer=null;this.graceTimer=null;this.settled=!1}clearTimers(){this.hardStopTimer&&clearTimeout(this.hardStopTimer),this.graceTimer&&clearTimeout(this.graceTimer),this.hardStopTimer=null,this.graceTimer=null}record(e,t,n){if(this.recorder&&!this.settled)return Promise.reject(new b("generic","record() called while a recording is in flight \u2014 ClipRecorder handles one recording at a time"));this.recorder=null,this.clearTimers(),this.chunks=[],this.bytes=0,this.settled=!1,this.stream=e;let i=ee();return new Promise((a,s)=>{let o;try{o=new MediaRecorder(e,i?{mimeType:i,videoBitsPerSecond:ie}:{videoBitsPerSecond:ie})}catch{try{o=new MediaRecorder(e)}catch{s(new b("unsupported"));return}}this.recorder=o;let l=c=>{this.settled||(this.settled=!0,this.clearTimers(),c())},d=()=>l(()=>{let c=o.mimeType||i||W,u=new Blob(this.chunks,{type:c});if(u.size===0){s(new b("generic","empty clip"));return}if(A(u)){s(new b("cliptoolarge"));return}a({blob:u,mimeType:c})});if(o.ondataavailable=c=>{c.data&&c.data.size&&(this.chunks.push(c.data),this.bytes+=c.data.size,this.bytes>H&&l(()=>{try{o.state!=="inactive"&&o.stop()}catch{}s(new b("cliptoolarge"))}))},o.onstop=d,o.onerror=()=>l(()=>s(new b("generic"))),n!==void 0){let c=!1;o.onstart=()=>{if(!(c||this.settled)){c=!0;try{n()}catch{}}}}try{o.start(Te)}catch{l(()=>s(new b("generic")));return}this.hardStopTimer=setTimeout(()=>{if(this.settled||t?.(),o.state!=="inactive"){try{o.stop()}catch{d()}this.graceTimer=setTimeout(d,_e)}else d()},ke)})}stop(e){this.clearTimers();let t=this.recorder;if(t&&t.state!=="inactive")try{t.stop()}catch{}this.recorder=null,(e??this.stream)?.getTracks().forEach(i=>i.stop()),this.stream=null}};function ae(r,e){return{video:{width:{ideal:1280,max:1280},height:{ideal:720,max:720},facingMode:e,frameRate:{ideal:24,max:30}},audio:!1}}var Ce=600;function K(){if(typeof window>"u"||typeof navigator>"u")return"desktop";let r=String(navigator.userAgent??"");if(/iPhone|iPod/i.test(r))return"phone";if(/iPad/i.test(r))return"tablet";if(/Android/i.test(r))return/Mobile/i.test(r)?"phone":"tablet";if(/BlackBerry|IEMobile|Opera Mini/i.test(r))return"phone";if(Number(navigator.maxTouchPoints??0)<=1)return"desktop";if(/Macintosh/.test(r))return"tablet";if(!Mt())return"desktop";let t=Et();return t>0&&t<Ce?"phone":"tablet"}function se(){return K()!=="desktop"}function Et(){try{let r=window.screen,e=Number(r?.width??0),t=Number(r?.height??0);return e>0&&t>0?Math.min(e,t):0}catch{return 0}}function oe(r){try{let t=r?.getVideoTracks?.()[0]?.getSettings?.().facingMode;return t==="user"||t==="environment"?t:null}catch{return null}}function Mt(){try{return typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches}catch{return!1}}var kt=.45,Tt=.9,_t=.4;var xe=1e4,U=class r{constructor(e,t){this.tier="blaze";this.inner=e,t!==void 0&&(this.fallbackReason=t)}static async create(e,t){let n=await import("@mediapipe/tasks-vision"),i=await n.FilesetResolver.forVisionTasks(e),a=await n.FaceDetector.createFromOptions(i,{baseOptions:{modelAssetPath:`${e}/blaze_face_short_range.tflite`,delegate:"CPU"},runningMode:"IMAGE"});return new r(a,t)}async detect(e,t,n){let i;try{i=this.inner.detect(e).detections}catch{return null}let a=Ct(i);if(a?.boundingBox===void 0)return null;let s=_(e),o=xt(a.keypoints,s),l=a.keypoints?.[2],d={box:{x:a.boundingBox.originX,y:a.boundingBox.originY,width:a.boundingBox.width,height:a.boundingBox.height},...o!==void 0?{eyes:o}:{},...l!==void 0?{nose:{x:l.x*s.width,y:l.y*s.height}}:{},score:a.categories[0]?.score??0};return F(d,e,t,n)}destroy(){try{this.inner.close()}catch{}}};function Ct(r){let e,t=-1;for(let n of r){let i=n.categories[0]?.score??0;i>t&&(e=n,t=i)}return e}function xt(r,e){let t=r?.[0],n=r?.[1];if(t===void 0||n===void 0)return;let i=o=>({x:o.x*e.width,y:o.y*e.height}),[a,s]=[i(t),i(n)];return a.x<=s.x?{left:a,right:s}:{left:s,right:a}}function Rt(){if(typeof OffscreenCanvas=="function")return new OffscreenCanvas(2,2);let r=document.createElement("canvas");return r.width=2,r.height=2,r}async function Re(){let r=globalThis.FaceDetector;if(typeof r!="function")return{ok:!1,reason:"unsupported"};try{let e=new r({fastMode:!0,maxDetectedFaces:1});return await e.detect(Rt()),{ok:!0,instance:e}}catch(e){return{ok:!1,reason:`smoke_failed:${e instanceof Error?e.message:String(e)}`}}}var B=class{constructor(e,t){this.tier="native";this.inner=e,t!==void 0&&(this.fallbackReason=t)}async detect(e,t,n){let i;try{i=await this.inner.detect(e)}catch{return null}let a=i[0];if(a===void 0)return null;let s=wt(a.landmarks),o={box:{x:a.boundingBox.x,y:a.boundingBox.y,width:a.boundingBox.width,height:a.boundingBox.height},...s!==void 0?{eyes:s}:{},score:1};return F(o,e,t,n)}destroy(){}};function wt(r){if(r===void 0)return;let e=r.filter(i=>i.type==="eye").map(i=>i.locations[0]).filter(i=>i!==void 0),[t,n]=e;if(!(t===void 0||n===void 0))return t.x<=n.x?{left:t,right:n}:{left:n,right:t}}var we="/models-v3",De=["native","blaze"],C=class extends Error{constructor(e){super(`no detector tier available (${e})`),this.name="DetectorLadderError",this.fallbackReason=e}};function _(r){let e=r;if(typeof e.videoWidth=="number"&&e.videoWidth>0)return{width:e.videoWidth,height:e.videoHeight??0};if(typeof e.naturalWidth=="number"&&e.naturalWidth>0)return{width:e.naturalWidth,height:e.naturalHeight??0};let t=typeof e.width=="number"?e.width:0,n=typeof e.height=="number"?e.height:0;return{width:t,height:n}}function F(r,e,t,n){let i=_(e),a=i.width>0?t/i.width:1,s=i.height>0?n/i.height:1,o=l=>({x:l.x*a,y:l.y*s});return{box:{x:r.box.x*a,y:r.box.y*s,width:r.box.width*a,height:r.box.height*s},...r.eyes!==void 0?{eyes:{left:o(r.eyes.left),right:o(r.eyes.right)}}:{},...r.nose!==void 0?{nose:o(r.nose)}:{},score:r.score}}function Dt(r){return r instanceof Error?r.message:String(r)}async function x(r){let e=r.preferred??De,t=[];for(let n of e){if(n==="native"){let i=await Re();if(i.ok)return new B(i.instance,ce(t));t.push(`native:${i.reason}`);continue}try{return await Ot(U.create(r.v3AssetBaseUrl??we,ce(t)),r.blazeInitTimeoutMs??xe)}catch(i){t.push(i instanceof z?"blaze:blaze_init_timeout":`blaze:${Dt(i)}`)}}throw new C(ce(t)??"no_tier_available")}function ce(r){return r.length>0?r.join("; "):void 0}var z=class extends Error{};function Ot(r,e){return new Promise((t,n)=>{let i=setTimeout(()=>{n(new z(`init exceeded ${e}ms`)),r.then(a=>a.destroy(),()=>{})},e);r.then(a=>{clearTimeout(i),t(a)},a=>{clearTimeout(i),n(a)})})}var Mr=180,L=[100,190],It=64;function Oe(r,e){return .299*(r[e]??0)+.587*(r[e+1]??0)+.114*(r[e+2]??0)}function X(r){let{data:e,width:t,height:n}=r,i=t*n;if(i===0)return 0;let a=0;for(let s=0;s<i;s+=1)a+=Oe(e,s*4);return a/i}function q(r){let{data:e,width:t,height:n}=r;if(t<3||n<3)return 0;let i=new Float32Array(t*n);for(let c=0;c<i.length;c+=1)i[c]=Oe(e,c*4);let a=0,s=0,o=0;for(let c=1;c<n-1;c+=1)for(let u=1;u<t-1;u+=1){let m=c*t+u,f=(i[m-t]??0)+(i[m-1]??0)+(i[m+1]??0)+(i[m+t]??0)-4*(i[m]??0);a+=f,s+=f*f,o+=1}if(o===0)return 0;let l=a/o,d=s/o-l*l;return Math.min(1,Math.max(0,d)/180)}function le(r){let e=X(r),[t,n]=L,i=e<t?t-e:e>n?e-n:0;return Math.max(0,1-i/It)}var Ie=Object.freeze({Q_GOOD:.6,RISE_PER_S:.9,FALL_PER_S:.25,CENTER_FALLOFF_IOD_MULTIPLE:1.35,BOX_EYE_OFFSET_FACTOR:.12,IOD_BOX_PROXY_FACTOR:.42,SIZE_IDEAL_MIN:.12,SIZE_IDEAL_MAX:.3,SIZE_HARD_MIN:.08,SIZE_HARD_MAX:.45,ROLL_MAX_DEG:25,MOTION_VELOCITY_IOD_PER_S:.5,MOTION_TAU_S:.4,MOTION_DEADBAND_IOD_PER_S:.1,READY_WINDOW_MS:500,GUIDE_SIZE:.6,GUIDE_CENTERING:.6,GUIDE_POSE:.6,GUIDE_EXPOSURE:.6,GUIDE_SHARPNESS:.35,GUIDE_MOTION:.5}),R=r=>Math.min(1,Math.max(0,r)),w=class{constructor(e={}){this.p=0;this.lastTickAt=null;this.lastCenter=null;this.velocityEma=0;this.qWindow=[];this.lastSizeDirection="ideal";this.t={...Ie,...e}}reset(){this.p=0,this.lastTickAt=null,this.lastCenter=null,this.velocityEma=0,this.qWindow=[],this.lastSizeDirection="ideal"}tick(e){let{observation:t,quality:n,timestampMs:i}=e,a=this.lastTickAt===null?0:Math.max(0,(i-this.lastTickAt)/1e3);this.lastTickAt=i;let s={presence:0,centering:0,size:0,pose:0,sharpness:R(n.sharpness),exposure:R(n.exposure),motion:1};if(t!==null){s.presence=1;let c=this.geometryOf(t,e);s.centering=c.centering,s.size=c.size,s.pose=c.pose,s.motion=this.motionOf(c.center,c.iod,i)}else this.lastCenter=null,this.velocityEma=0;let o=Math.min(s.presence,s.centering,s.size,s.pose,s.sharpness,s.exposure,s.motion);this.p=R(this.p+(o>=this.t.Q_GOOD?this.t.RISE_PER_S*o:-this.t.FALL_PER_S*(1-o))*a),this.qWindow.push({at:i,q:o}),this.qWindow=this.qWindow.filter(c=>c.at>=i-this.t.READY_WINDOW_MS);let l=this.qWindow.map(c=>c.q);if(l.length>=3){let c=Math.min(...l),u=l.indexOf(c);l=l.filter((m,f)=>f!==u)}let d=this.p>=1&&l.every(c=>c>=this.t.Q_GOOD);return{at:i,q:o,p:this.p,factors:s,guidanceKey:this.guidanceOf(s,n,o),ready:d,accepted:o>=this.t.Q_GOOD}}geometryOf(e,t){let{box:n,eyes:i}=e,a={x:t.frameWidth/2,y:t.frameHeight/2},s=Math.min(t.frameWidth,t.frameHeight),o=i!==void 0?{x:(i.left.x+i.right.x)/2,y:(i.left.y+i.right.y)/2}:{x:n.x+n.width/2,y:n.y+n.height/2-this.t.BOX_EYE_OFFSET_FACTOR*n.height},l=i!==void 0?Math.hypot(i.right.x-i.left.x,i.right.y-i.left.y):this.t.IOD_BOX_PROXY_FACTOR*n.width,d=Math.hypot(o.x-a.x,o.y-a.y),c=l<=0?0:1-R(d/(this.t.CENTER_FALLOFF_IOD_MULTIPLE*l)),u=s>0?l/s:0;this.lastSizeDirection=u<this.t.SIZE_IDEAL_MIN?"far":u>this.t.SIZE_IDEAL_MAX?"close":"ideal";let m;u<this.t.SIZE_HARD_MIN||u>this.t.SIZE_HARD_MAX?m=0:u<this.t.SIZE_IDEAL_MIN?m=(u-this.t.SIZE_HARD_MIN)/(this.t.SIZE_IDEAL_MIN-this.t.SIZE_HARD_MIN):u>this.t.SIZE_IDEAL_MAX?m=(this.t.SIZE_HARD_MAX-u)/(this.t.SIZE_HARD_MAX-this.t.SIZE_IDEAL_MAX):m=1;let f=1;if(i!==void 0){let p=Math.abs(Math.atan2(i.right.y-i.left.y,i.right.x-i.left.x))*180/Math.PI;f=1-R(p/this.t.ROLL_MAX_DEG)}return{center:o,iod:l,centering:c,size:m,pose:f}}motionOf(e,t,n){let i=this.lastCenter;if(this.lastCenter={...e,at:n},i===null||t<=0)return 1;let a=(n-i.at)/1e3;if(a<=0)return 1;let s=Math.hypot(e.x-i.x,e.y-i.y)/t/a;s<=this.t.MOTION_DEADBAND_IOD_PER_S&&(s=0);let o=1-Math.exp(-a/this.t.MOTION_TAU_S);return this.velocityEma=o*s+(1-o)*this.velocityEma,1-R(this.velocityEma/this.t.MOTION_VELOCITY_IOD_PER_S)}guidanceOf(e,t,n){if(e.presence<=0)return"fcv3.no_face";if(e.size<this.t.GUIDE_SIZE)return this.sizeGuidance();if(e.centering<this.t.GUIDE_CENTERING)return"fcv3.center_face";if(e.pose<this.t.GUIDE_POSE)return"fcv3.straighten";if(e.exposure<this.t.GUIDE_EXPOSURE)return this.exposureGuidance(t);if(e.sharpness<this.t.GUIDE_SHARPNESS)return"fcv3.steady_camera";if(e.motion<this.t.GUIDE_MOTION)return"fcv3.hold_still";if(n<this.t.Q_GOOD){let i=[["size",this.sizeGuidance()],["centering","fcv3.center_face"],["pose","fcv3.straighten"],["exposure",this.exposureGuidance(t)],["sharpness","fcv3.steady_camera"],["motion","fcv3.hold_still"]],a=i[0];for(let s of i)e[s[0]]<e[a[0]]&&(a=s);return a[1]}return"fcv3.hold_still"}sizeGuidance(){return this.lastSizeDirection==="far"?"fcv3.come_closer":"fcv3.move_back"}exposureGuidance(e){let t=(L[0]+L[1])/2;return e.meanLuma<t?"fcv3.more_light":"fcv3.too_bright"}};var Ae=Object.freeze({LOW:Object.freeze({cadenceHz:5,inputWidth:128,animations:"reduced"}),MID:Object.freeze({cadenceHz:8,inputWidth:160,animations:"full"}),HIGH:Object.freeze({cadenceHz:10,inputWidth:192,animations:"full"})}),At=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function de(){let r=typeof navigator>"u"?void 0:navigator,e=!1;try{e=typeof WebAssembly<"u"&&WebAssembly.validate(At)}catch{e=!1}return{cores:r?.hardwareConcurrency??2,memGB:r?.deviceMemory??null,simd:e}}function me(r){let e=r.memGB??4;return r.cores<4||e<3?"LOW":r.cores>=8&&e>=6?"HIGH":"MID"}var ue=["LOW","MID","HIGH"],N=class{constructor(e){this.samples=[];this.adjusted=!1;this.current=e}get deviceClass(){return this.current}get profile(){return Ae[this.current]}record(e){if(this.adjusted||this.samples.length>=10)return this.current;if(this.samples.push(e),this.samples.length<10)return this.current;this.adjusted=!0;let t=this.samples.reduce((n,i)=>n+i,0)/this.samples.length;if(t>70)this.current="LOW";else if(t<25){let n=ue.indexOf(this.current);this.current=ue[Math.min(ue.length-1,n+1)]??this.current}return this.current}};var G=class{constructor(e){this.timer=null;this.frameCallbackId=null;this.running=!1;this.busy=!1;this.lastRunAt=Number.NEGATIVE_INFINITY;this.degradeCount=0;this.durations=[];this.options=e,this.periodMs=1e3/e.cadenceHz}start(){if(this.running)return;this.running=!0;let e=this.options.video;if(typeof e?.requestVideoFrameCallback=="function"){let t=()=>{this.running&&(this.frameCallbackId=e.requestVideoFrameCallback?.(()=>{this.frameCallbackId=null,this.now()-this.lastRunAt>=this.periodMs&&this.tick(),t()}))};t();return}this.timer=setInterval(()=>this.tick(),this.periodMs)}stop(){this.running=!1,this.timer!==null&&(clearInterval(this.timer),this.timer=null),this.frameCallbackId!==null&&(this.options.video?.cancelVideoFrameCallback?.(this.frameCallbackId),this.frameCallbackId=null)}stats(){let e=this.durations.length===0?0:this.durations.reduce((t,n)=>t+n,0)/this.durations.length;return{degradeCount:this.degradeCount,meanDetectMs:e}}now(){return this.options.now?.()??performance.now()}tick(){if(!this.running)return;if(this.busy){this.degradeCount+=1;return}this.busy=!0,this.lastRunAt=this.now();let e=this.now();this.options.run().catch(()=>{}).finally(()=>{this.busy=!1,this.durations.push(this.now()-e),this.durations.length>20&&this.durations.shift()})}};var Pe="0.1.0-rc.15";var Fe="sekyro.did",Le;function Ne(){let r=globalThis.crypto;try{if(typeof r?.randomUUID=="function")return r.randomUUID()}catch{}try{if(typeof r?.getRandomValues=="function"){let e=r.getRandomValues(new Uint8Array(16));return Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}}catch{}}function Pt(){try{let r=localStorage.getItem(Fe);if(r)return r;let e=Ne();return e!==void 0&&localStorage.setItem(Fe,e),e}catch{return Le??(Le=Ne()),Le}}async function Ft(){let r=globalThis.crypto?.subtle;if(!r)return"";let e=navigator,t=JSON.stringify([e.userAgent,e.platform,e.hardwareConcurrency??null,e.deviceMemory??null,e.maxTouchPoints??0,screen.width,screen.height,screen.colorDepth,globalThis.devicePixelRatio??1,Intl.DateTimeFormat().resolvedOptions().timeZone,e.languages?.join(",")??e.language]),n=await r.digest("SHA-256",new TextEncoder().encode(t));return Array.from(new Uint8Array(n),i=>i.toString(16).padStart(2,"0")).join("").slice(0,32)}function Lt(r){let e=new TextEncoder().encode(r),t="";for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Nt(r){let e,t;return{timezone(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone?.slice(0,64)||void 0}catch{return}},noteCameraLabel(n){n&&(e=n.slice(0,128))},async deviceHeader(){try{t??(t=Ft().catch(()=>""));let n=[];navigator.webdriver&&n.push("webdriver"),/HeadlessChrome/.test(navigator.userAgent)&&n.push("headless");let i=await t,a=Pt(),s={v:1,platform:"web",sdk:r.sdk.slice(0,64),ids:[...a?[{kind:"web_local",value:a.slice(0,128)}]:[],...i?[{kind:"web_fp",value:i}]:[]],screen:{w:screen.width,h:screen.height,dpr:globalThis.devicePixelRatio??1},...e?{cameraLabel:e}:{},...n.length?{signals:n}:{}};return Lt(JSON.stringify(s))}catch{return}}}}var pe=Symbol.for("sekyro.web.clientContext"),fe=globalThis,Gt=fe[pe]??(fe[pe]=Nt({sdk:`@sekyro/web@${Pe}`}));function Ge(r){try{let e=r.getVideoTracks?.()[0];e&&Gt.noteCameraLabel(e.label)}catch{}}var he=Symbol.for("sekyro.web.cameraStreams"),ye=globalThis,Vt=ye[he]??(ye[he]=new Set);function Ve(r){try{Vt.add(r)}catch{}}var Wt=["obs","manycam","virtual","snap camera","xsplit","droidcam","iriun","camo"],Ht=[/^(front|back|rear)( [a-z ]+)? camera$/i,/^camera2? ?\d+, facing (front|back|external)/i,/facetime/i,/\b(integrated|built-in|builtin) (web)?cam(era)?\b/i,/\b(hd )?web ?cam\b/i,/\([0-9a-f]{4}:[0-9a-f]{4}\)\s*$/i];function Kt(r){let e=(r??"").trim().toLowerCase();return e.length===0?"unknown":Wt.some(t=>e.includes(t))?"known_virtual":Ht.some(t=>t.test(e))?"platform":"unknown"}function We(r){if(typeof r!="function")return!1;try{return/\{\s*\[native code\]\s*\}\s*$/.test(Function.prototype.toString.call(r))}catch{return!1}}function Ut(r=globalThis){return We(r.navigator?.mediaDevices?.getUserMedia)&&We(r.MediaStreamTrack?.prototype?.getSettings)}async function Bt(r,e=globalThis){let t=e.crypto?.subtle?.digest;if(typeof t=="function")try{let n=new Uint8Array(await t.call(e.crypto?.subtle,"SHA-256",new TextEncoder().encode(r)));return Array.from(n.subarray(0,8),i=>i.toString(16).padStart(2,"0")).join("")}catch{return}}async function He(r,e=globalThis){let t={};try{t=typeof r.getSettings=="function"?r.getSettings()??{}:{}}catch{t={}}let n={};if((t.facingMode==="user"||t.facingMode==="environment"||t.facingMode==="left"||t.facingMode==="right")&&(n.facingMode=t.facingMode),typeof t.frameRate=="number"&&Number.isFinite(t.frameRate)&&(n.frameRate=t.frameRate),typeof t.width=="number"&&Number.isFinite(t.width)&&(n.width=t.width),typeof t.height=="number"&&Number.isFinite(t.height)&&(n.height=t.height),typeof t.deviceId=="string"&&t.deviceId.length>0){let a=await Bt(t.deviceId,e);a!==void 0&&(n.deviceIdHash=a)}let i;try{i=r.label}catch{i=void 0}return{trackSettings:n,capabilitiesPresent:typeof r.getCapabilities=="function",labelClass:Kt(i),prototypesIntact:Ut(e)}}var ge=r=>Math.round(r*100)/100;function Ke(r){let e=r,t=typeof e?.requestVideoFrameCallback=="function",n=null,i=null,a=0,s=0,o=0,l=0,d=0,c=0,u=()=>{!t||e?.requestVideoFrameCallback===void 0||(n=e.requestVideoFrameCallback((m,f)=>{if(n=null,!t)return;let p=f.presentationTime;if(i!==null){let h=p-i.presentationTimeMs;s+=1;let y=h-o;o+=y/s,l+=y*(h-o)}typeof f.captureTime=="number"&&Number.isFinite(f.captureTime)&&(d+=p-f.captureTime,c+=1),a+=1,i={mediaTimeMs:f.mediaTime*1e3,presentationTimeMs:p},u()}))};return u(),{latest:()=>i,stats:()=>({n:a,meanGapMs:s===0?0:ge(o),stdGapMs:s<2?0:ge(Math.sqrt(l/(s-1))),captureLatencyMs:c===0?null:ge(d/c)}),stop:()=>{t&&(t=!1,n!==null&&e?.cancelVideoFrameCallback?.(n),n=null)}}}function Ue(r,e,t){return{...r,rvfc:e,rampPainter:t}}var zt=["rose","peach","sand","mint","sky","lilac"];var Xt=4,qt=4;function Yt(r){if(typeof r!="object"||r===null)return!1;let e=r;if(typeof e.nonce!="string"||e.nonce.length===0||!Array.isArray(e.colours)||e.colours.length!==3||!e.colours.every(n=>zt.includes(n))||!Array.isArray(e.onsetsMs)||e.onsetsMs.length!==3)return!1;let t=-1;for(let n of e.onsetsMs){if(typeof n!="number"||!Number.isFinite(n)||n<=t||n>=2e3)return!1;t=n}return!0}function Be(r,e){let t=e.now??(()=>performance.now()),n=Yt(r)?r:void 0,i=[],a=null,s=null,o=null,l=!1,d=null,c=p=>{d=p;try{e.paint(p)}catch{}},u=p=>{let h=e.frames?.()??null;return h!==null&&o!==null?h.mediaTimeMs+(p-h.presentationTimeMs)-o:p-(s??p)},m=(p,h,y=0)=>{if(l)return;let S=Math.max(0,p-u(t()));a=setTimeout(()=>{if(a=null,!l){if(y<Xt&&u(t())<p-qt){m(p,h,y+1);return}h()}},S)},f=p=>{if(n!==void 0){if(p>=3){m(2e3,()=>c(null));return}m(n.onsetsMs[p],()=>{let h=u(t());if(h>2e3){d!==null&&c(null);return}let y=n.colours[p];c(y);let S=i.length===0?0:i[i.length-1].tMs;i.push({tMs:Math.max(S,Math.round(h)),colour:y}),f(p+1)})}};return{started(p){if(n===void 0||l||s!==null)return;s=p;let h=e.frames?.()??null;o=h===null?null:h.mediaTimeMs+(p-h.presentationTimeMs),f(0)},stop(){l||(l=!0,a!==null&&clearTimeout(a),a=null,d!==null&&c(null))},report(){return n===void 0?void 0:{nonce:n.nonce,rendered:[...i]}}}}var M=1;function ze(){return typeof OffscreenCanvas=="function"&&typeof createImageBitmap=="function"&&typeof Worker=="function"}function Zt(r,e={}){let t=e.createDetector??x,n=null;r.onmessage=i=>{let a=i.data;if(a.v!==M){a.bitmap?.close?.();return}if(a.type==="init"){t(a.options).then(s=>{n=s;let o={v:M,type:"ready",tier:s.tier,...s.fallbackReason!==void 0?{fallbackReason:s.fallbackReason}:{}};r.postMessage(o)});return}if(a.type==="detect"){let s=o=>{let l={v:M,type:"result",id:a.id,observation:o};r.postMessage(l),a.bitmap.close?.()};if(n===null){s(null);return}n.detect(a.bitmap,a.streamWidth,a.streamHeight).then(s,()=>s(null))}}}typeof self<"u"&&typeof self.importScripts=="function"&&Zt(self);var Y=class r{constructor(e,t){this.pending=new Map;this.nextId=1;this.worker=e,this.tier=t.tier,t.fallbackReason!==void 0&&(this.fallbackReason=t.fallbackReason),e.addEventListener("message",n=>{let i=n.data;if(i.v!==M||i.type!=="result")return;let a=this.pending.get(i.id);this.pending.delete(i.id),a?.(i.observation)})}static create(e,t,n=1e4){return new Promise((i,a)=>{let s=setTimeout(()=>{e.removeEventListener("message",o),e.terminate(),a(new Error(`worker detector not ready within ${n}ms`))},n),o=d=>{let c=d.data;c.v!==M||c.type!=="ready"||(clearTimeout(s),e.removeEventListener("message",o),i(new r(e,c)))};e.addEventListener("message",o);let l={v:M,type:"init",options:t};e.postMessage(l)})}async detect(e,t,n){let i;try{typeof ImageBitmap<"u"&&e instanceof ImageBitmap?i=e:typeof createImageBitmap=="function"?i=await createImageBitmap(e):i=e}catch{return null}let a=this.nextId;return this.nextId+=1,new Promise(s=>{this.pending.set(a,s);let o={v:M,type:"detect",id:a,bitmap:i,streamWidth:t,streamHeight:n};this.worker.postMessage(o,[i])})}destroy(){for(let e of this.pending.values())e(null);this.pending.clear(),this.worker.terminate()}};var Qt=["size","centering","pose","exposure","sharpness","motion"];function Xe(r){if(r.accepted)return null;if(r.factors.presence<=0)return"no_face";let e="size";for(let t of Qt)r.factors[t]<r.factors[e]&&(e=t);return e}var D=class{constructor(){this.blocked={};this.acceptedMs=0;this.ticks=0;this.lastAt=null}record(e){let t=this.lastAt===null?0:Math.max(0,e.at-this.lastAt);this.lastAt=e.at,this.ticks+=1;let n=Xe(e);if(n===null){this.acceptedMs+=t;return}let i=this.blocked[n]??{count:0,ms:0};i.count+=1,i.ms+=t,this.blocked[n]=i}summary(){let e={};for(let[t,n]of Object.entries(this.blocked))e[t]={count:n.count,ms:Math.round(n.ms)};return{blocked:e,acceptedMs:Math.round(this.acceptedMs),ticks:this.ticks}}};var it=1e3,Q="fcv3.hold_upright",at=200,j=4,st=600,ot=1e3,rt={sharpness:1,exposure:1,meanLuma:128};function nr(r,e){return e.width=r.videoWidth,e.height=r.videoHeight,e.getContext("2d").drawImage(r,0,0),new Promise((t,n)=>e.toBlob(i=>i?t(i):n(new Error("empty-keyframe")),"image/jpeg",.92))}function ir(){return K()==="phone"}var ve=class{constructor(e){this.handlers=new Map;this.stateValue="idle";this.attempt=0;this.stream=null;this.detector=null;this.scheduler=null;this.gate=null;this.profiler=null;this.lastGuidanceKey=null;this.positioningStartedAt=0;this.cameraRequestedAt=null;this.cameraReadyAt=null;this.faceAcquiredAt=null;this.captureCompleteAt=null;this.fired=!1;this.carriedDegrade=0;this.carriedMeans=[];this.blockStats=null;this.lastGateSnapshotAt=Number.NEGATIVE_INFINITY;this.uprightGuard=!1;this.trackProvenance=null;this.ramp=null;this.snapshotCanvas=null;this.options=e,this.facing=e.facingMode??"user"}get state(){return this.stateValue}on(e,t){let n=this.handlers.get(e);return n||(n=new Set,this.handlers.set(e,n)),n.add(t),()=>n?.delete(t)}emit(e,t){for(let n of[...this.handlers.get(e)??[]])n(t)}async start(e={}){e.facingMode!==void 0&&(this.facing=e.facingMode),this.attempt+=1,await this.run(this.attempt)}get facingMode(){return this.facing}retry(){this.teardownAttempt(),this.start()}switchCamera(){this.facing=this.facing==="user"?"environment":"user",this.teardownAttempt(),this.start()}destroy(){this.attempt+=1,this.teardownAttempt(),this.detector?.destroy(),this.detector=null,this.options.video.srcObject=null}async run(e){let{options:t}=this;this.fired=!1,this.lastGuidanceKey=null,this.carriedDegrade=0,this.carriedMeans=[],this.cameraRequestedAt=null,this.cameraReadyAt=null,this.faceAcquiredAt=null,this.captureCompleteAt=null,this.uprightGuard=(t.isPhone??ir)(),this.setState("preflight");let n=re();if(n!=="OK"){this.fail(n==="INSECURE_CONTEXT"?"insecure":"unsupported");return}this.setState("acquiring");let i=t.getUserMedia??(d=>navigator.mediaDevices.getUserMedia(d)),a;this.cameraRequestedAt=this.now();try{a=await i(ae(se(),this.facing))}catch(d){if(e!==this.attempt)return;this.fail(te(d));return}if(Ge(a),Ve(a),e!==this.attempt){for(let d of a.getTracks())d.stop();return}this.stream=a;let s=a.getVideoTracks?.()[0];if(this.trackProvenance=s===void 0?null:He(s).catch(()=>null),this.facing=oe(a)??this.facing,t.video.srcObject=a,await t.video.play().catch(()=>{}),e!==this.attempt)return;if(this.cameraReadyAt=this.now(),this.detector===null){let d={v3AssetBaseUrl:t.v3AssetBaseUrl},c=t.createDetector??(t.createWorker!==void 0&&ze()?async()=>{try{return await Y.create(t.createWorker(),d)}catch{return x(d)}}:()=>x(d)),u;try{u=await c()}catch(m){e===this.attempt&&this.fail("models",m instanceof C?m.fallbackReason:sr(m));return}if(e!==this.attempt){u.destroy();return}this.detector=u,this.options.telemetry?.({type:"detector",tier:u.tier,fallbackReason:u.fallbackReason})}let o=de(),l=t.deviceClass??me(o);this.profiler=new N(l),this.options.telemetry?.({type:"profile",staticClass:l,activeClass:this.profiler.deviceClass,simd:o.simd}),this.gate=new w(t.thresholds??{}),this.blockStats=new D,this.lastGateSnapshotAt=this.now(),t.rankKeyframes?.()&&Promise.resolve().then(()=>(tt(),et)).then(d=>be=d,()=>{}),this.setState("positioning"),this.positioningStartedAt=this.now(),this.startScheduler(e)}get animations(){return this.profiler?.profile.animations??"full"}startScheduler(e){let t=this.profiler;if(t===null)return;if(this.scheduler!==null){let i=this.scheduler.stats();this.carriedDegrade+=i.degradeCount,i.meanDetectMs>0&&this.carriedMeans.push(i.meanDetectMs),this.scheduler.stop()}let n=new G({cadenceHz:t.profile.cadenceHz,video:this.options.video,now:this.options.now,run:()=>this.detectTick(e)});this.scheduler=n,n.start()}async detectTick(e){let{detector:t,gate:n,profiler:i}=this,a=this.options.video;if(e!==this.attempt||t===null||n===null||i===null||this.fired||a.videoWidth===0)return;if(this.isLandscape()){this.holdUpright(e);return}let s=i.deviceClass,o=this.now(),l=this.options.makeSnapshot?.(a,i.profile.inputWidth)??this.defaultSnapshot(a,i.profile.inputWidth),d=null;try{d=await t.detect(l,a.videoWidth,a.videoHeight)}catch{d=null}if(e!==this.attempt||this.fired)return;i.record(this.now()-o),i.deviceClass!==s&&this.startScheduler(e);let c=d===null?rt:this.options.measureQuality?.(a,d.box)??this.defaultQuality(a,d.box),u=n.tick({timestampMs:this.now(),observation:d,quality:c,frameWidth:a.videoWidth,frameHeight:a.videoHeight});u.accepted&&this.faceAcquiredAt===null&&(this.faceAcquiredAt=u.at),this.blockStats?.record(u),!u.ready&&u.at-this.lastGateSnapshotAt>=it&&(this.lastGateSnapshotAt=u.at,this.reportGate(!1)),this.emit("checks",{engine:"v3",progress:u.p,q:u.q,factors:u.factors,attempt:e}),u.guidanceKey!==this.lastGuidanceKey&&(this.lastGuidanceKey=u.guidanceKey,this.emit("guidance",{key:u.guidanceKey})),u.ready&&this.stateValue==="positioning"&&(this.fired=!0,this.captureCompleteAt=u.at,this.fire(e))}async fire(e){let{options:t}=this,n=this.scheduler;n?.stop(),this.reportGate(!0);let i=n?.stats()??{degradeCount:0,meanDetectMs:0},a=[...this.carriedMeans,...i.meanDetectMs>0?[i.meanDetectMs]:[]];t.telemetry?.({type:"fired",timeToGateMs:this.now()-this.positioningStartedAt,degradeCount:this.carriedDegrade+i.degradeCount,meanDetectMs:a.length===0?0:a.reduce((g,E)=>g+E,0)/a.length});let s=t.mode??"clip",o=t.rankKeyframes?.()&&be?be.default(this,e).catch(()=>this.collectKeyframes(e)):this.collectKeyframes(e);if(s==="photo"){let g=this.watchRotation(e,null),E=await o;if(g(),e!==this.attempt)return;if(E===null){this.fail("generic");return}let ct=await this.provenance({n:0,meanGapMs:0,stdGapMs:0,captureLatencyMs:null},!1);if(e!==this.attempt)return;this.finishCapture({keyframe:E.blob,previewDataUrl:E.previewDataUrl,...ct});return}this.setState("recording");let l=t.createRecorder?.()??new P,d=this.stream;if(d===null){this.fail("generic");return}let c=Ke(t.video),u=t.screenRamp?.(),m=u!==void 0,f=Be(u,{paint:g=>{(g===null||e===this.attempt)&&this.emit("ramp",{colour:g})},now:()=>this.now(),frames:c.latest});this.ramp=f;let p=()=>{c.stop(),f.stop(),this.ramp===f&&(this.ramp=null)},h=this.watchRotation(e,l),y=null;o.then(g=>{y=g},()=>{});let S=()=>{e===this.attempt&&y!==null&&this.emit("frozen",{previewDataUrl:y.previewDataUrl})},v,k;try{[v,k]=await Promise.all([l.record(d,S,()=>f.started(this.now())),o])}catch(g){if(h(),p(),e!==this.attempt)return;let E=g.kind;this.fail(E==="cliptoolarge"?"cliptoolarge":"recorder");return}h();let T=c.stats();if(p(),e!==this.attempt)return;if(A(v.blob)){this.fail("cliptoolarge");return}if(k===null){this.fail("generic");return}let I=f.report(),$=await this.provenance(T,m);e===this.attempt&&this.finishCapture({clip:v.blob,clipMimeType:v.mimeType,keyframe:k.blob,previewDataUrl:k.previewDataUrl,...I!==void 0&&I.rendered.length>0?{screenRamp:I}:{},...$})}async provenance(e,t){let n=this.trackProvenance;if(n===null)return{};let i,a=new Promise(o=>{i=setTimeout(()=>o(null),ot)}),s=await Promise.race([n,a]);return clearTimeout(i),s===null?{}:{provenance:Ue(s,e,t)}}isLandscape(){let e=this.options.video;return this.uprightGuard&&e.videoWidth>e.videoHeight}holdUpright(e){this.gate?.reset(),this.emit("checks",{engine:"v3",progress:0,q:0,factors:{presence:0,centering:0,size:0,pose:0,sharpness:0,exposure:0,motion:0},attempt:e}),this.lastGuidanceKey!==Q&&(this.lastGuidanceKey=Q,this.emit("guidance",{key:Q}))}watchRotation(e,t){if(!this.uprightGuard)return()=>{};let n=this.options.video,i=()=>{if(e!==this.attempt||t!==null&&this.stateValue!=="recording"){o();return}n.videoWidth>0&&this.isLandscape()&&(o(),this.abortRecording(e,t))},a=setInterval(i,at);n.addEventListener?.("resize",i);let s=!1;function o(){s||(s=!0,clearInterval(a),n.removeEventListener?.("resize",i))}return o}abortRecording(e,t){if(e!==this.attempt)return;this.attempt+=1;let n=this.attempt;try{t?.stop()}catch{}this.ramp?.stop(),this.ramp=null,this.fired=!1,this.captureCompleteAt=null,this.gate=new w(this.options.thresholds??{}),this.blockStats=new D,this.lastGateSnapshotAt=this.now(),this.lastGuidanceKey=null,this.setState("positioning"),this.positioningStartedAt=this.now(),this.holdUpright(n),this.startScheduler(n)}async collectKeyframes(e){let t=this.options.captureKeyframe??(a=>this.defaultKeyframe(a)),n=st/(j-1),i=null;for(let a=0;a<j;a+=1){if(e!==this.attempt)return i;try{let s=await t(this.options.video);(i===null||s.sharpness>i.sharpness)&&(i=s)}catch{}a<j-1&&await ar(n)}return i}finishCapture(e){this.stopTracks(),this.setState("captured");let t=this.captureTiming();this.emit("artifacts",t===void 0?e:{...e,timing:t})}captureTiming(){let e={},t=(n,i,a)=>{i!==null&&a!==null&&(e[n]=Math.max(0,Math.round(a-i)))};return t("cameraReadyMs",this.cameraRequestedAt,this.cameraReadyAt),t("faceAcquireMs",this.cameraReadyAt,this.faceAcquiredAt),t("captureMs",this.faceAcquiredAt,this.captureCompleteAt),Object.keys(e).length>0?e:void 0}async defaultKeyframe(e){let t=document.createElement("canvas"),n=await(this.facing==="user"?ne:nr)(e,t),i=t.toDataURL("image/jpeg",.92);return{blob:n,previewDataUrl:i,sharpness:this.centerSharpness(e)}}defaultSnapshot(e,t){try{let n=this.snapshotCanvas??document.createElement("canvas"),i=t/Math.max(1,e.videoWidth),a=Math.max(1,Math.round(e.videoWidth*i)),s=Math.max(1,Math.round(e.videoHeight*i)),o=n.getContext("2d");return o===null?e:(n.width!==a&&(n.width=a),n.height!==s&&(n.height=s),o.drawImage(e,0,0,a,s),this.snapshotCanvas=n,n)}catch{return e}}defaultQuality(e,t){let n=nt(e,t,96);return n===null?rt:{sharpness:q(n),exposure:le(n),meanLuma:X(n)}}centerSharpness(e){let t=_(e),n=nt(e,{x:t.width*.25,y:t.height*.25,width:t.width*.5,height:t.height*.5},96);return n===null?0:q(n)}teardownAttempt(){this.scheduler?.stop(),this.scheduler=null,this.reportGate(!0),this.gate=null,this.ramp?.stop(),this.ramp=null,this.stopTracks()}reportGate(e){let t=this.blockStats,n=this.profiler;if(t===null||n===null)return;let i=t.summary();e&&(this.blockStats=null),i.ticks!==0&&this.options.telemetry?.({type:"gate",final:e,activeClass:n.deviceClass,cadenceHz:n.profile.cadenceHz,...i})}stopTracks(){if(this.stream!==null){for(let e of this.stream.getTracks())e.stop();this.stream=null}}fail(e,t){this.scheduler?.stop(),this.reportGate(!0),this.stopTracks(),this.setState("error"),this.options.telemetry?.({type:"error",kind:e,fallbackReason:t}),this.emit("error",{kind:e,retryable:e!=="insecure"&&e!=="unsupported"})}setState(e){this.stateValue=e,this.emit("statechange",{state:e})}now(){return this.options.now?.()??performance.now()}},be;function ar(r){return new Promise(e=>setTimeout(e,r))}function sr(r){return r instanceof Error?r.message:String(r)}function nt(r,e,t){try{let n=document.createElement("canvas"),i=t/Math.max(1,e.width);n.width=Math.max(1,Math.round(e.width*i)),n.height=Math.max(1,Math.round(e.height*i));let a=n.getContext("2d");return a===null?null:(a.drawImage(r,e.x,e.y,e.width,e.height,0,0,n.width,n.height),a.getImageData(0,0,n.width,n.height))}catch{return null}}0&&(module.exports={CENTERED_FACTOR,CIRCLE_RADIUS_FACTOR,CLIP_MS,CaptureSessionV3,ClipError,ClipRecorder,DEFAULT_CLIP_MIME,DEFAULT_TIER_ORDER,DEFAULT_V3_ASSET_BASE_URL,DEVICE_PROFILES,DetectScheduler,DetectorLadderError,DeviceProfiler,EXPOSURE_BAND,FaceGateV3,GATE_SNAPSHOT_MS,GateBlockStats,HOLD_UPRIGHT_KEY,IN_CIRCLE_FACTOR,KEYFRAME_CANDIDATES,KEYFRAME_WINDOW_MS,MAX_CLIP_BYTES,MIME_CANDIDATES,PHONE_MAX_SHORT_SIDE,PROVENANCE_WAIT_MS,SHARP_REF,STOP_GRACE_MS,TIMESLICE_MS,UPRIGHT_WATCH_MS,V3_GATE_DEFAULTS,VIDEO_BPS,blockReasonOf,buildCaptureConstraints,buildLivenessV2FormData,cameraPreflight,captureMirroredKeyframe,classifyDevice,createDetector,detectFormFactor,detectIsMobile,errorCopy,exposure,extForMime,intrinsicSize,isClipTooLarge,isMediaRecorderSupported,mapGetUserMediaError,meanLuma,pickMimeType,probeDevice,sharpness,toStreamPixels,trackFacingMode,uiCopy});
|
package/dist/core/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as CameraErrorKind } from '../capture-session-v3-
|
|
2
|
-
export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipResult, D as DEFAULT_CLIP_MIME, o as DEVICE_PROFILES, p as DeviceClass, q as DeviceProbe, r as DeviceProfile, s as DeviceProfiler, E as EscalationClipArtifact, t as EscalationHook, F as FaceGateV3, G as GATE_SNAPSHOT_MS, u as GateBlockEntry, v as GateBlockReason, w as GateBlockStats, x as GateBlockSummary, y as GateChecks, H as HOLD_UPRIGHT_KEY, K as KEYFRAME_CANDIDATES, z as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, A as MIME_CANDIDATES, P as PROVENANCE_WAIT_MS, S as STOP_GRACE_MS, T as TIMESLICE_MS, U as UPRIGHT_WATCH_MS, V as V3ChecksPayload, B as V3GateFactor, I as V3GateQuality, J as V3GateThresholds, L as V3GateTick, N as V3GateTickInput, O as V3TelemetryEvent, Q as V3_GATE_DEFAULTS, R as VIDEO_BPS, W as blockReasonOf, X as buildLivenessV2FormData, Y as cameraPreflight, Z as classifyDevice, _ as extForMime, $ as isClipTooLarge, a0 as isMediaRecorderSupported, a1 as mapGetUserMediaError, a2 as pickMimeType, a3 as probeDevice } from '../capture-session-v3-
|
|
1
|
+
import { C as CameraErrorKind } from '../capture-session-v3-DVJvecJq.cjs';
|
|
2
|
+
export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipResult, D as DEFAULT_CLIP_MIME, o as DEVICE_PROFILES, p as DeviceClass, q as DeviceProbe, r as DeviceProfile, s as DeviceProfiler, E as EscalationClipArtifact, t as EscalationHook, F as FaceGateV3, G as GATE_SNAPSHOT_MS, u as GateBlockEntry, v as GateBlockReason, w as GateBlockStats, x as GateBlockSummary, y as GateChecks, H as HOLD_UPRIGHT_KEY, K as KEYFRAME_CANDIDATES, z as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, A as MIME_CANDIDATES, P as PROVENANCE_WAIT_MS, S as STOP_GRACE_MS, T as TIMESLICE_MS, U as UPRIGHT_WATCH_MS, V as V3ChecksPayload, B as V3GateFactor, I as V3GateQuality, J as V3GateThresholds, L as V3GateTick, N as V3GateTickInput, O as V3TelemetryEvent, Q as V3_GATE_DEFAULTS, R as VIDEO_BPS, W as blockReasonOf, X as buildLivenessV2FormData, Y as cameraPreflight, Z as classifyDevice, _ as extForMime, $ as isClipTooLarge, a0 as isMediaRecorderSupported, a1 as mapGetUserMediaError, a2 as pickMimeType, a3 as probeDevice } from '../capture-session-v3-DVJvecJq.cjs';
|
|
3
3
|
export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, P as PHONE_MAX_SHORT_SIDE, b as buildCaptureConstraints, d as detectFormFactor, c as detectIsMobile, t as trackFacingMode } from '../capture-constraints-B5omafmk.cjs';
|
|
4
4
|
export { C as CreateDetectorOptions, D as DEFAULT_TIER_ORDER, a as DEFAULT_V3_ASSET_BASE_URL, b as Detector, c as DetectorLadderError, F as FaceObservation, d as createDetector, i as intrinsicSize, t as toStreamPixels } from '../detect-worker-DclNxkZT.cjs';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-BZXO8xhw.cjs';
|
|
6
6
|
|
|
7
7
|
declare function captureMirroredKeyframe(video: HTMLVideoElement, canvas: HTMLCanvasElement, quality?: number): Promise<Blob>;
|
|
8
8
|
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as CameraErrorKind } from '../capture-session-v3-
|
|
2
|
-
export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipResult, D as DEFAULT_CLIP_MIME, o as DEVICE_PROFILES, p as DeviceClass, q as DeviceProbe, r as DeviceProfile, s as DeviceProfiler, E as EscalationClipArtifact, t as EscalationHook, F as FaceGateV3, G as GATE_SNAPSHOT_MS, u as GateBlockEntry, v as GateBlockReason, w as GateBlockStats, x as GateBlockSummary, y as GateChecks, H as HOLD_UPRIGHT_KEY, K as KEYFRAME_CANDIDATES, z as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, A as MIME_CANDIDATES, P as PROVENANCE_WAIT_MS, S as STOP_GRACE_MS, T as TIMESLICE_MS, U as UPRIGHT_WATCH_MS, V as V3ChecksPayload, B as V3GateFactor, I as V3GateQuality, J as V3GateThresholds, L as V3GateTick, N as V3GateTickInput, O as V3TelemetryEvent, Q as V3_GATE_DEFAULTS, R as VIDEO_BPS, W as blockReasonOf, X as buildLivenessV2FormData, Y as cameraPreflight, Z as classifyDevice, _ as extForMime, $ as isClipTooLarge, a0 as isMediaRecorderSupported, a1 as mapGetUserMediaError, a2 as pickMimeType, a3 as probeDevice } from '../capture-session-v3-
|
|
1
|
+
import { C as CameraErrorKind } from '../capture-session-v3-DsHBvxFa.js';
|
|
2
|
+
export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipResult, D as DEFAULT_CLIP_MIME, o as DEVICE_PROFILES, p as DeviceClass, q as DeviceProbe, r as DeviceProfile, s as DeviceProfiler, E as EscalationClipArtifact, t as EscalationHook, F as FaceGateV3, G as GATE_SNAPSHOT_MS, u as GateBlockEntry, v as GateBlockReason, w as GateBlockStats, x as GateBlockSummary, y as GateChecks, H as HOLD_UPRIGHT_KEY, K as KEYFRAME_CANDIDATES, z as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, A as MIME_CANDIDATES, P as PROVENANCE_WAIT_MS, S as STOP_GRACE_MS, T as TIMESLICE_MS, U as UPRIGHT_WATCH_MS, V as V3ChecksPayload, B as V3GateFactor, I as V3GateQuality, J as V3GateThresholds, L as V3GateTick, N as V3GateTickInput, O as V3TelemetryEvent, Q as V3_GATE_DEFAULTS, R as VIDEO_BPS, W as blockReasonOf, X as buildLivenessV2FormData, Y as cameraPreflight, Z as classifyDevice, _ as extForMime, $ as isClipTooLarge, a0 as isMediaRecorderSupported, a1 as mapGetUserMediaError, a2 as pickMimeType, a3 as probeDevice } from '../capture-session-v3-DsHBvxFa.js';
|
|
3
3
|
export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, P as PHONE_MAX_SHORT_SIDE, b as buildCaptureConstraints, d as detectFormFactor, c as detectIsMobile, t as trackFacingMode } from '../capture-constraints-B5omafmk.js';
|
|
4
4
|
export { C as CreateDetectorOptions, D as DEFAULT_TIER_ORDER, a as DEFAULT_V3_ASSET_BASE_URL, b as Detector, c as DetectorLadderError, F as FaceObservation, d as createDetector, i as intrinsicSize, t as toStreamPixels } from '../detect-worker-DclNxkZT.js';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-BZXO8xhw.js';
|
|
6
6
|
|
|
7
7
|
declare function captureMirroredKeyframe(video: HTMLVideoElement, canvas: HTMLCanvasElement, quality?: number): Promise<Blob>;
|
|
8
8
|
|
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x,b as k,c as z,d as C,e as L,f as T,k as E,l as N,m as w,n as D,o as G,p as I,q as J,r as M,s as Q,t as W,u as X,v as Y,w as Z}from"../chunk-
|
|
1
|
+
import{a as x,b as k,c as z,d as C,e as L,f as T,k as E,l as N,m as w,n as D,o as G,p as I,q as J,r as M,s as Q,t as W,u as X,v as Y,w as Z}from"../chunk-7SJHXIM3.js";import{a as e,b as r,c as o,d as n,e as a,f as s,g as t,h as i}from"../chunk-FUHDOEBP.js";import{a as P,b as S,c as B,d as F}from"../chunk-POIQGEZM.js";import{a as c,b as p,c as u,d as f,e as m,f as d,g as l,h as v,i as y,j as g}from"../chunk-2BFYVMUU.js";import{a as O,b as U,c as V,d as j,e as q}from"../chunk-FPXL63KZ.js";import"../chunk-RNZ4CQEC.js";import{a as R,b as h,c as b,d as A,e as H,f as K}from"../chunk-OKWG3PVH.js";var _={permission:{key:"fcv2.err.permission",fr:"Autorisez la cam\xE9ra dans les r\xE9glages du navigateur (ic\xF4ne cam\xE9ra dans la barre d\u2019adresse), puis r\xE9essayez."},notfound:{key:"fcv2.err.notfound",fr:"Aucune cam\xE9ra d\xE9tect\xE9e. Branchez ou activez une cam\xE9ra, puis r\xE9essayez."},inuse:{key:"fcv2.err.inuse",fr:"La cam\xE9ra est utilis\xE9e par une autre application. Fermez-la puis r\xE9essayez."},overconstrained:{key:"fcv2.err.overconstrained",fr:"La cam\xE9ra ne prend pas en charge les r\xE9glages demand\xE9s. Nouvel essai en cours\u2026"},insecure:{key:"fcv2.err.insecure",fr:"La cam\xE9ra n\xE9cessite une connexion s\xE9curis\xE9e (HTTPS). Ouvrez la page en HTTPS."},unsupported:{key:"fcv2.err.unsupported",fr:"Votre navigateur ne prend pas en charge l\u2019enregistrement vid\xE9o. Utilisez un navigateur r\xE9cent."},generic:{key:"fcv2.err.generic",fr:"Cam\xE9ra indisponible. R\xE9essayez ou contactez le support."}},$={recording:{key:"fcv2.recording",fr:"Enregistrement en cours\u2026"},uploading:{key:"fcv2.uploading",fr:"Envoi en cours\u2026"},clipTooLarge:{key:"fcv2.err.cliptoolarge",fr:"La vid\xE9o est trop volumineuse. R\xE9essayez dans un endroit mieux \xE9clair\xE9."},retry:{key:"fcv2.retry",fr:"R\xE9essayer"},listen:{key:"fcv2.listen",fr:"\xC9couter"}};export{i as CENTERED_FACTOR,s as CIRCLE_RADIUS_FACTOR,x as CLIP_MS,Z as CaptureSessionV3,L as ClipError,T as ClipRecorder,u as DEFAULT_CLIP_MIME,h as DEFAULT_TIER_ORDER,R as DEFAULT_V3_ASSET_BASE_URL,P as DEVICE_PROFILES,N as DetectScheduler,b as DetectorLadderError,F as DeviceProfiler,U as EXPOSURE_BAND,D as FaceGateV3,J as GATE_SNAPSHOT_MS,I as GateBlockStats,M as HOLD_UPRIGHT_KEY,t as IN_CIRCLE_FACTOR,W as KEYFRAME_CANDIDATES,X as KEYFRAME_WINDOW_MS,l as MAX_CLIP_BYTES,c as MIME_CANDIDATES,r as PHONE_MAX_SHORT_SIDE,Y as PROVENANCE_WAIT_MS,O as SHARP_REF,z as STOP_GRACE_MS,k as TIMESLICE_MS,Q as UPRIGHT_WATCH_MS,w as V3_GATE_DEFAULTS,C as VIDEO_BPS,G as blockReasonOf,e as buildCaptureConstraints,g as buildLivenessV2FormData,m as cameraPreflight,E as captureMirroredKeyframe,B as classifyDevice,K as createDetector,o as detectFormFactor,n as detectIsMobile,_ as errorCopy,q as exposure,y as extForMime,A as intrinsicSize,v as isClipTooLarge,d as isMediaRecorderSupported,f as mapGetUserMediaError,V as meanLuma,p as pickMimeType,S as probeDevice,j as sharpness,H as toStreamPixels,a as trackFacingMode,$ as uiCopy};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as a,v as b,w as c,x as d}from"./chunk-M35OBPDV.js";import"./chunk-G6LKLN4U.js";import"./chunk-TDLIXFDT.js";import"./chunk-EIFZSEYD.js";import"./chunk-GT2ZLGF7.js";import"./chunk-7SJHXIM3.js";import"./chunk-FUHDOEBP.js";import"./chunk-POIQGEZM.js";import"./chunk-2BFYVMUU.js";import"./chunk-FPXL63KZ.js";import"./chunk-RNZ4CQEC.js";import"./chunk-OKWG3PVH.js";import"./chunk-DK5YPBDQ.js";export{a as SAME_FACE_MAX_DROPS,c as createDocumentCapture,d as createDocumentCaptureInternal,b as warmDocumentCapture};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,k as b,l as c,m as d,n as e,o as f,p as g}from"./chunk-
|
|
1
|
+
import{j as a,k as b,l as c,m as d,n as e,o as f,p as g}from"./chunk-G6MU3B5V.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import"./chunk-7ZCZY3ZP.js";import"./chunk-BPE5NSQ2.js";import"./chunk-GI3UFGRQ.js";import"./chunk-GT2ZLGF7.js";import"./chunk-FUHDOEBP.js";import"./chunk-2BFYVMUU.js";export{a as ANALYSIS_LONG_EDGE,c as PORTRAIT_JPEG_QUALITY,b as STILL_MAX_HEIGHT,f as createPortraitCaptureInternal,d as defaultGrabber,e as observe,g as warmPortraitCapture};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as Detector } from './detect-worker-DclNxkZT.js';
|
|
2
|
-
import { A as AcceptedDocumentType, a4 as NationalEidOption, aq as StepSection, s as HostedBranding, ad as PlanSectionView, aa as PlanChoiceKind, m as ContactChannel, k as CheckReason, aj as RetakeHint, _ as IdentityMethod, E as EidAfterPass, $ as IdentitySummarySource, G as HostedIcaoPolicy, Z as IcaoReportEntry, Y as IcaoCaptureTuning, H as HostedSessionView, V as HostedStepView, ae as PlanStepView, i as CaptureMode, am as ScreenRampReport, j as CaptureProvenance, S as ScreenRampColour, an as SessionFailureReason, h as AgeEstimationReason, as as VerificationLevel, ar as VerificationAssurance, a3 as MethodChoiceView, b as CameraUnavailableCause, X as HostedVoiceView, ak as ScreenRampChallenge, aw as PersonMask, ax as AttestationInput, e as CheckType, ah as PortraitIcaoInput } from './types-
|
|
3
|
-
import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1, p as DeviceClass, b as CaptureArtifacts, I as V3GateQuality, O as V3TelemetryEvent } from './capture-session-v3-
|
|
4
|
-
import { c as IcaoGateSummary, d as IcaoGateUpdate, P as Point, e as Box, j as IcaoFrameObservation, N as HostedClient, k as IcaoGate } from './icao-gate-
|
|
2
|
+
import { A as AcceptedDocumentType, a4 as NationalEidOption, aq as StepSection, s as HostedBranding, ad as PlanSectionView, aa as PlanChoiceKind, m as ContactChannel, k as CheckReason, aj as RetakeHint, _ as IdentityMethod, E as EidAfterPass, $ as IdentitySummarySource, G as HostedIcaoPolicy, Z as IcaoReportEntry, Y as IcaoCaptureTuning, H as HostedSessionView, V as HostedStepView, ae as PlanStepView, i as CaptureMode, am as ScreenRampReport, j as CaptureProvenance, S as ScreenRampColour, an as SessionFailureReason, h as AgeEstimationReason, as as VerificationLevel, ar as VerificationAssurance, a3 as MethodChoiceView, b as CameraUnavailableCause, X as HostedVoiceView, ak as ScreenRampChallenge, aw as PersonMask, ax as AttestationInput, e as CheckType, ah as PortraitIcaoInput } from './types-BZXO8xhw.js';
|
|
3
|
+
import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1, p as DeviceClass, b as CaptureArtifacts, I as V3GateQuality, O as V3TelemetryEvent } from './capture-session-v3-DsHBvxFa.js';
|
|
4
|
+
import { c as IcaoGateSummary, d as IcaoGateUpdate, P as Point, e as Box, j as IcaoFrameObservation, N as HostedClient, k as IcaoGate } from './icao-gate-B2zgdb5m.js';
|
|
5
5
|
|
|
6
6
|
declare const ISSUER_CODES: readonly string[];
|
|
7
7
|
|
|
@@ -970,7 +970,7 @@ interface VerificationResult {
|
|
|
970
970
|
level?: VerificationLevel;
|
|
971
971
|
/** How the level was proved, when the API reports it. */
|
|
972
972
|
assurance?: VerificationAssurance;
|
|
973
|
-
/** The subject (person) the session is linked to,
|
|
973
|
+
/** The subject (person) the session is linked to, once that subject has passed a verification (absent before that). */
|
|
974
974
|
subjectId?: string;
|
|
975
975
|
}
|
|
976
976
|
/**
|
|
@@ -2176,6 +2176,16 @@ declare class DocAssist {
|
|
|
2176
2176
|
* latency. Fire-and-forget; failures fall back to the lazy path.
|
|
2177
2177
|
*/
|
|
2178
2178
|
declare function warmDocDetector(): void;
|
|
2179
|
+
/**
|
|
2180
|
+
* The opened camera must show a live picture within this many ms: a camera that never plays, ends, or sends black
|
|
2181
|
+
* frames is reopened once, then reported as a retryable error, so the scan view never stays dark without a word
|
|
2182
|
+
* (staging 2026-11-01). 0 = no watch.
|
|
2183
|
+
*/
|
|
2184
|
+
declare const DOC_FIRST_FRAME_MS = 4000;
|
|
2185
|
+
/** Ticks whose frame-wide mean luma stays at or under this read as a black (dead) camera picture. */
|
|
2186
|
+
declare const DOC_BLACK_FRAME_LUMA = 2;
|
|
2187
|
+
/** Black ticks in a row, with no lit frame since the camera opened, that count as a dead picture. */
|
|
2188
|
+
declare const DOC_BLACK_FRAME_TICKS = 3;
|
|
2179
2189
|
/** Doc detect cadence per device class — scanic @480px is ~3–8× a face tick,
|
|
2180
2190
|
* so the doc loop paces slower than the face profiles (findings §1: 2–5 Hz). */
|
|
2181
2191
|
declare const DOC_CADENCE_HZ: Readonly<Record<DeviceClass, number>>;
|
|
@@ -2371,6 +2381,13 @@ interface CaptureSessionDocOptions {
|
|
|
2371
2381
|
label: string;
|
|
2372
2382
|
kind?: string;
|
|
2373
2383
|
}>>;
|
|
2384
|
+
/**
|
|
2385
|
+
* Ms the opened camera has to show a live picture (default {@link DOC_FIRST_FRAME_MS}; 0 = no watch): a stream that
|
|
2386
|
+
* never plays, ends, or shows only black frames is reopened once, then reported as a retryable `generic` error.
|
|
2387
|
+
*/
|
|
2388
|
+
firstFrameMs?: number;
|
|
2389
|
+
/** (the video plays and has a decoded frame) — whether the camera shows a live picture. */
|
|
2390
|
+
hasFrames?: (video: HTMLVideoElement) => boolean;
|
|
2374
2391
|
/** (performance.now) */
|
|
2375
2392
|
now?: () => number;
|
|
2376
2393
|
/** (setTimeout/clearTimeout) — the cadence pacer. */
|
|
@@ -2414,10 +2431,35 @@ declare class CaptureSessionDoc {
|
|
|
2414
2431
|
/** Last detected quad + detect size (for a host-timed {@link captureNow}). */
|
|
2415
2432
|
private lastQuad;
|
|
2416
2433
|
private lastDetect;
|
|
2434
|
+
/** The first-frame watch of the current camera ({@link DOC_FIRST_FRAME_MS}). */
|
|
2435
|
+
private frameWatch;
|
|
2436
|
+
/** The camera was reopened once by the watch since it last showed a picture. */
|
|
2437
|
+
private reopened;
|
|
2438
|
+
/** A tick saw a lit frame since the camera opened; black ticks in a row before that. */
|
|
2439
|
+
private lit;
|
|
2440
|
+
private blackTicks;
|
|
2441
|
+
/** Unsubscribes the opened track's `ended` listener. */
|
|
2442
|
+
private offEnded;
|
|
2417
2443
|
constructor(opts: CaptureSessionDocOptions);
|
|
2418
2444
|
on<K extends keyof CaptureSessionDocEvents>(event: K, handler: Handler<K>): () => void;
|
|
2419
2445
|
private emit;
|
|
2420
2446
|
start(): Promise<void>;
|
|
2447
|
+
/** play() on the kept stream when it is still live and attached (see start()); null when there is nothing to play. */
|
|
2448
|
+
private resumePlayback;
|
|
2449
|
+
/** Whether the video shows a live picture right now (playing, with a decoded frame). */
|
|
2450
|
+
private framesNow;
|
|
2451
|
+
/** Arm the first-frame watch for this camera. */
|
|
2452
|
+
private watchFrames;
|
|
2453
|
+
private clearFrameWatch;
|
|
2454
|
+
/** The opened track ended on its own (the camera was taken or interrupted): the same path as a dead picture. */
|
|
2455
|
+
private watchEnded;
|
|
2456
|
+
/**
|
|
2457
|
+
* The camera opened but shows no live picture: reopen it once (silently), then a retryable error. A live stream the
|
|
2458
|
+
* browser would not play is kept for the retry's tap to play it ({@link resumePlayback}).
|
|
2459
|
+
*/
|
|
2460
|
+
private cameraDead;
|
|
2461
|
+
/** Stop and detach this engine's stream. */
|
|
2462
|
+
private releaseStream;
|
|
2421
2463
|
/** Restart the gate for another side / a retake (same stream). */
|
|
2422
2464
|
rearm(side?: DocSide): void;
|
|
2423
2465
|
/**
|
|
@@ -3064,4 +3106,4 @@ declare function createVerification(options: VerificationOptions): Verification;
|
|
|
3064
3106
|
/** {@link createVerification} with construction seams (tests / Sekyro AI-internal hosts). */
|
|
3065
3107
|
declare function createVerificationInternal(options: VerificationOptions, internals: VerificationInternals): Verification;
|
|
3066
3108
|
|
|
3067
|
-
export { type LivenessCaptureEvents as $, type AcceptedDocumentsLike as A, type DocumentMrzUpdate as B, type CameraFacing as C, type DocumentCaptureOptions as D, type DocumentPoint as E, type DocumentQuad as F, type DocumentReticle as G, type DocumentScanPhase as H, type DocumentScanUpdate as I, type DocumentSide as J, type DocumentSnapshot as K, type DocumentStepHandle as L, type EidSnapshot as M, type EidStepHandle as N, type EmailOtpSnapshot as O, type PortraitCaptureOptions as P, type EmailOtpStepHandle as Q, type EmailSource as R, type GateHint as S, type GateUpdate as T, ISSUER_CODES as U, type IdentitySummarySnapshot as V, type IdentitySummaryStepHandle as W, type InLaneSwitch as X, type LivePhotoGateUpdate as Y, type LivePhotoPlan as Z, type LivenessAssetsStatus as _, type DocumentCaptureHandle as a, type LiveMrzTuning as a$, type LivenessCaptureHandle as a0, type LivenessCaptureOptions as a1, type LivenessSnapshot as a2, type LivenessStartOptions as a3, type LivenessStepHandle as a4, type MethodSnapshot as a5, type MethodStepHandle as a6, type MobileRequiredSnapshot as a7, type MobileRequiredStepHandle as a8, type OtpChannel as a9, type UnsupportedSnapshot as aA, type UnsupportedStepHandle as aB, type Verification as aC, type VerificationBusy as aD, type VerificationEvents as aE, type VerificationLocale as aF, type VerificationOptions as aG, type VerificationResult as aH, type VerificationStatus as aI, type VerificationStep as aJ, WEB_IDENTITY_METHODS as aK, acceptedIssuers as aL, acceptedTypesFor as aM, cameraUnavailableCauseOf as aN, createLivenessCapture as aO, createVerification as aP, deriveStep as aQ, flagOf as aR, getLivenessAssetsStatus as aS, laneOf as aT, otherOptions as aU, preloadLivenessAssets as aV, releaseLivenessAssets as aW, resolveAcceptedDocuments as aX, sectionOf as aY, subscribeLivenessAssets as aZ, type DocCatalogEntry as a_, type OtpNumberSource as aa, PLATFORM_UNSUPPORTED as ab, type PhoneOtpSnapshot as ac, type PhoneOtpStepHandle as ad, type PlanChoiceSnapshot as ae, type PortraitCaptureEvents as af, type PortraitCaptureState as ag, type PortraitGateUpdate as ah, type PortraitSnapshot as ai, type PortraitStartOptions as aj, type PortraitStepHandle as ak, type PreloadLivenessAssetsOptions as al, type ProcessingSnapshot as am, type ProcessingStepHandle as an, type ReasonCode as ao, type RegistrySnapshot as ap, type RegistrySource as aq, type RegistryStepHandle as ar, type ResultDisplay as as, type ResultSnapshot as at, type ResultStepHandle as au, type SdkFailureReason as av, type StepAttempts as aw, type StepContext as ax, type StepSnapshot as ay, type UnsupportedReason as az, type PortraitCaptureHandle as b,
|
|
3109
|
+
export { type LivenessCaptureEvents as $, type AcceptedDocumentsLike as A, type DocumentMrzUpdate as B, type CameraFacing as C, type DocumentCaptureOptions as D, type DocumentPoint as E, type DocumentQuad as F, type DocumentReticle as G, type DocumentScanPhase as H, type DocumentScanUpdate as I, type DocumentSide as J, type DocumentSnapshot as K, type DocumentStepHandle as L, type EidSnapshot as M, type EidStepHandle as N, type EmailOtpSnapshot as O, type PortraitCaptureOptions as P, type EmailOtpStepHandle as Q, type EmailSource as R, type GateHint as S, type GateUpdate as T, ISSUER_CODES as U, type IdentitySummarySnapshot as V, type IdentitySummaryStepHandle as W, type InLaneSwitch as X, type LivePhotoGateUpdate as Y, type LivePhotoPlan as Z, type LivenessAssetsStatus as _, type DocumentCaptureHandle as a, type LiveMrzTuning as a$, type LivenessCaptureHandle as a0, type LivenessCaptureOptions as a1, type LivenessSnapshot as a2, type LivenessStartOptions as a3, type LivenessStepHandle as a4, type MethodSnapshot as a5, type MethodStepHandle as a6, type MobileRequiredSnapshot as a7, type MobileRequiredStepHandle as a8, type OtpChannel as a9, type UnsupportedSnapshot as aA, type UnsupportedStepHandle as aB, type Verification as aC, type VerificationBusy as aD, type VerificationEvents as aE, type VerificationLocale as aF, type VerificationOptions as aG, type VerificationResult as aH, type VerificationStatus as aI, type VerificationStep as aJ, WEB_IDENTITY_METHODS as aK, acceptedIssuers as aL, acceptedTypesFor as aM, cameraUnavailableCauseOf as aN, createLivenessCapture as aO, createVerification as aP, deriveStep as aQ, flagOf as aR, getLivenessAssetsStatus as aS, laneOf as aT, otherOptions as aU, preloadLivenessAssets as aV, releaseLivenessAssets as aW, resolveAcceptedDocuments as aX, sectionOf as aY, subscribeLivenessAssets as aZ, type DocCatalogEntry as a_, type OtpNumberSource as aa, PLATFORM_UNSUPPORTED as ab, type PhoneOtpSnapshot as ac, type PhoneOtpStepHandle as ad, type PlanChoiceSnapshot as ae, type PortraitCaptureEvents as af, type PortraitCaptureState as ag, type PortraitGateUpdate as ah, type PortraitSnapshot as ai, type PortraitStartOptions as aj, type PortraitStepHandle as ak, type PreloadLivenessAssetsOptions as al, type ProcessingSnapshot as am, type ProcessingStepHandle as an, type ReasonCode as ao, type RegistrySnapshot as ap, type RegistrySource as aq, type RegistryStepHandle as ar, type ResultDisplay as as, type ResultSnapshot as at, type ResultStepHandle as au, type SdkFailureReason as av, type StepAttempts as aw, type StepContext as ax, type StepSnapshot as ay, type UnsupportedReason as az, type PortraitCaptureHandle as b, FLIP_TIMEOUT_MS as b$, type TextLockTuning as b0, type OcrEngineClient as b1, type DocAssistReport as b2, type ReadyInfo as b3, type LoadFailure as b4, type OcrEngineOptions as b5, type SubmitRuntime as b6, type HostedClientLike as b7, ANALYSIS_LONG_EDGE as b8, ASPECT_BANDS as b9, type DocCameraTuning as bA, type DocCaptureReport as bB, type DocCaptureVia as bC, type DocChecksPayload as bD, type DocEngineLike as bE, DocFeedbackAggregator as bF, type DocFeedbackKey as bG, type DocFeedbackState as bH, type DocFormat as bI, type DocFrameAnalysis as bJ, type DocFrameMeasures as bK, type DocGateQuality as bL, type DocGateThresholds as bM, type DocGateTick as bN, type DocGateTickInput as bO, DocGateV1 as bP, type DocQuad as bQ, type DocQuadPoint as bR, type DocShutterReason as bS, type DocShutterTuning as bT, type DocSide as bU, type DocumentCaptureController as bV, type DocumentCaptureInternals as bW, EMPTY_GUIDE_METRICS as bX, type EncodedDocument as bY, FLIP_FILL_MIN as bZ, FLIP_GAP_MS as b_, AttestationError as ba, BLUR_REFUSE_SHARPNESS_MAX as bb, type BlurStatus as bc, CAPTURE_CANDIDATE_SPACING_MS as bd, CAPTURE_EXTRA_CANDIDATES as be, CLIP_MIME_ALLOWLIST as bf, type CaptureEngine as bg, CaptureSessionDoc as bh, type CaptureSessionDocEvents as bi, type CaptureSessionDocOptions as bj, DOC_ANALYSIS_DEFAULTS as bk, DOC_BLACK_FRAME_LUMA as bl, DOC_BLACK_FRAME_TICKS as bm, DOC_CADENCE_HZ as bn, DOC_CAMERA_TUNING_DEFAULTS as bo, DOC_CATALOG as bp, DOC_DETECT_WIDTH as bq, DOC_FEEDBACK_STATES as br, DOC_FIRST_FRAME_MS as bs, DOC_GATE_V1_DEFAULTS as bt, DOC_SHUTTER_DEFAULTS as bu, type DeviceReadHint as bv, type DocArtifacts as bw, DocAssist as bx, type DocAssistEngine as by, type DocAssistTick as bz, type CaptureChannel as c, aspectBand as c$, type FocusCaps as c0, type FramingStatus as c1, GUIDE_LOCK_DEFAULTS as c2, type GlareStatus as c3, type GrabbedFrame as c4, type GuideBlocker as c5, GuideLock as c6, type GuideLockTick as c7, type GuideLockTuning as c8, type GuideMetrics as c9, MR_DOC_CATALOG as cA, NO_REPORT_MS as cB, type OpenDocCameraDeps as cC, PORTRAIT_JPEG_QUALITY as cD, PRELOAD_BLAZE_INIT_TIMEOUT_MS as cE, PRELOAD_BUDGET_MS as cF, PROCESSING_POLL_DELAY_MS as cG, PROCESSING_POLL_MAX as cH, type PortraitCaptureController as cI, type PortraitCaptureInternals as cJ, REGISTRY_RETRY_DELAY_MS as cK, type ReticleType as cL, SAME_FACE_MAX_DROPS as cM, type ScanEvent as cN, type ScanLayout as cO, type ScanNotice as cP, type ScanPhase as cQ, type ScanReport as cR, type ScanSide as cS, type ScanState as cT, type SubmitExecutor as cU, TEXT_LOCK_DEFAULTS as cV, TRANSPORT_REPLAY_ATTEMPTS as cW, TRANSPORT_REPLAY_DELAY_MS as cX, type VerificationInternals as cY, analyzeDocFrame as cZ, analyzeGuide as c_, type GuideRect as ca, INFERENCE_RETRY_ATTEMPTS as cb, INFERENCE_RETRY_DEFAULT_S as cc, LANDMARKER_MODEL as cd, LENS_STORAGE_KEY as ce, LENS_TRY_MAX as cf, LIVE_MRZ_DEFAULTS as cg, LIVE_PHOTO_IDLE_MS as ch, LIVE_PHOTO_MAX_HZ as ci, type LandmarkedFace as cj, type LandmarkerLike as ck, type LensKind as cl, type LensSource as cm, type LightingStatus as cn, type LiveMrzCapture as co, type LiveMrzState as cp, type LivePhotoGate as cq, type LivePhotoKit as cr, type LivePhotoKitInternals as cs, type LivePhotoKitOptions as ct, type LivePhotoStill as cu, type LivenessCaptureInternalHandle as cv, type LivenessCaptureInternals as cw, type LivenessFlowDeps as cx, type LivenessFlowOutcome as cy, MANUAL_SHUTTER_MS as cz, type CaptureEngineId as d, aspectFits as d0, buildDeviceReadHint as d1, coverPointToVideo as d2, createDocumentCaptureInternal as d3, createFaceLandmarker as d4, createLivePhotoKit as d5, createLivenessCaptureInternal as d6, createPortraitCaptureInternal as d7, createVerificationInternal as d8, docZoomFor as d9, resolveDocCameraTuning as dA, resolveDocShutterTuning as dB, resolveGuideLockTuning as dC, runLivenessFlow as dD, runSubmission as dE, scannerFormatFor as dF, setPreloadLoaderForTests as dG, settledHint as dH, singleShotFocusAt as dI, specularFraction as dJ, supportsFocusMode as dK, warmDocDetector as dL, writeStoredLens as dM, encodeDocumentImage as da, facesOf as db, feedbackVoteOf as dc, focusOk as dd, guideQuad as de, guideRegionInFrame as df, initialScanState as dg, lensKindOf as dh, mapEngineState as di, mapErrorKind as dj, mapGuidanceHint as dk, nextScanState as dl, observe as dm, openDocCamera as dn, passportBandOf as dp, portraitMatchStep as dq, preloadedDetectorFactory as dr, quadAreaFrac as ds, quadBounds as dt, quadIou as du, quadTiltRatio as dv, randomUuid as dw, rankBackCameras as dx, readStoredLens as dy, resetLivenessAssetsForTests as dz, type CaptureError as e, type CaptureErrorKind as f, type CaptureState as g, type CapturedArtifacts as h, type CapturedDocument as i, type CapturedPortrait as j, type ChoiceOptionSnapshot as k, type ChoiceSnapshot as l, type ChoiceStepHandle as m, type ContactChoiceSnapshot as n, type ContactChoiceStepHandle as o, DEFAULT_API_ORIGIN as p, DOCUMENT_TYPE_ORDER as q, type DeriveStepEnv as r, type DocumentCaptureEvents as s, type DocumentCaptureState as t, type DocumentFeedback as u, type DocumentFeedbackKey as v, type DocumentGateUpdate as w, type DocumentGuide as x, type DocumentGuideMeasure as y, type DocumentLiveMrzOptions as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as Detector } from './detect-worker-DclNxkZT.cjs';
|
|
2
|
-
import { A as AcceptedDocumentType, a4 as NationalEidOption, aq as StepSection, s as HostedBranding, ad as PlanSectionView, aa as PlanChoiceKind, m as ContactChannel, k as CheckReason, aj as RetakeHint, _ as IdentityMethod, E as EidAfterPass, $ as IdentitySummarySource, G as HostedIcaoPolicy, Z as IcaoReportEntry, Y as IcaoCaptureTuning, H as HostedSessionView, V as HostedStepView, ae as PlanStepView, i as CaptureMode, am as ScreenRampReport, j as CaptureProvenance, S as ScreenRampColour, an as SessionFailureReason, h as AgeEstimationReason, as as VerificationLevel, ar as VerificationAssurance, a3 as MethodChoiceView, b as CameraUnavailableCause, X as HostedVoiceView, ak as ScreenRampChallenge, aw as PersonMask, ax as AttestationInput, e as CheckType, ah as PortraitIcaoInput } from './types-
|
|
3
|
-
import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1, p as DeviceClass, b as CaptureArtifacts, I as V3GateQuality, O as V3TelemetryEvent } from './capture-session-v3-
|
|
4
|
-
import { c as IcaoGateSummary, d as IcaoGateUpdate, P as Point, e as Box, j as IcaoFrameObservation, N as HostedClient, k as IcaoGate } from './icao-gate-
|
|
2
|
+
import { A as AcceptedDocumentType, a4 as NationalEidOption, aq as StepSection, s as HostedBranding, ad as PlanSectionView, aa as PlanChoiceKind, m as ContactChannel, k as CheckReason, aj as RetakeHint, _ as IdentityMethod, E as EidAfterPass, $ as IdentitySummarySource, G as HostedIcaoPolicy, Z as IcaoReportEntry, Y as IcaoCaptureTuning, H as HostedSessionView, V as HostedStepView, ae as PlanStepView, i as CaptureMode, am as ScreenRampReport, j as CaptureProvenance, S as ScreenRampColour, an as SessionFailureReason, h as AgeEstimationReason, as as VerificationLevel, ar as VerificationAssurance, a3 as MethodChoiceView, b as CameraUnavailableCause, X as HostedVoiceView, ak as ScreenRampChallenge, aw as PersonMask, ax as AttestationInput, e as CheckType, ah as PortraitIcaoInput } from './types-BZXO8xhw.cjs';
|
|
3
|
+
import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1, p as DeviceClass, b as CaptureArtifacts, I as V3GateQuality, O as V3TelemetryEvent } from './capture-session-v3-DVJvecJq.cjs';
|
|
4
|
+
import { c as IcaoGateSummary, d as IcaoGateUpdate, P as Point, e as Box, j as IcaoFrameObservation, N as HostedClient, k as IcaoGate } from './icao-gate-sKqrgMTo.cjs';
|
|
5
5
|
|
|
6
6
|
declare const ISSUER_CODES: readonly string[];
|
|
7
7
|
|
|
@@ -970,7 +970,7 @@ interface VerificationResult {
|
|
|
970
970
|
level?: VerificationLevel;
|
|
971
971
|
/** How the level was proved, when the API reports it. */
|
|
972
972
|
assurance?: VerificationAssurance;
|
|
973
|
-
/** The subject (person) the session is linked to,
|
|
973
|
+
/** The subject (person) the session is linked to, once that subject has passed a verification (absent before that). */
|
|
974
974
|
subjectId?: string;
|
|
975
975
|
}
|
|
976
976
|
/**
|
|
@@ -2176,6 +2176,16 @@ declare class DocAssist {
|
|
|
2176
2176
|
* latency. Fire-and-forget; failures fall back to the lazy path.
|
|
2177
2177
|
*/
|
|
2178
2178
|
declare function warmDocDetector(): void;
|
|
2179
|
+
/**
|
|
2180
|
+
* The opened camera must show a live picture within this many ms: a camera that never plays, ends, or sends black
|
|
2181
|
+
* frames is reopened once, then reported as a retryable error, so the scan view never stays dark without a word
|
|
2182
|
+
* (staging 2026-11-01). 0 = no watch.
|
|
2183
|
+
*/
|
|
2184
|
+
declare const DOC_FIRST_FRAME_MS = 4000;
|
|
2185
|
+
/** Ticks whose frame-wide mean luma stays at or under this read as a black (dead) camera picture. */
|
|
2186
|
+
declare const DOC_BLACK_FRAME_LUMA = 2;
|
|
2187
|
+
/** Black ticks in a row, with no lit frame since the camera opened, that count as a dead picture. */
|
|
2188
|
+
declare const DOC_BLACK_FRAME_TICKS = 3;
|
|
2179
2189
|
/** Doc detect cadence per device class — scanic @480px is ~3–8× a face tick,
|
|
2180
2190
|
* so the doc loop paces slower than the face profiles (findings §1: 2–5 Hz). */
|
|
2181
2191
|
declare const DOC_CADENCE_HZ: Readonly<Record<DeviceClass, number>>;
|
|
@@ -2371,6 +2381,13 @@ interface CaptureSessionDocOptions {
|
|
|
2371
2381
|
label: string;
|
|
2372
2382
|
kind?: string;
|
|
2373
2383
|
}>>;
|
|
2384
|
+
/**
|
|
2385
|
+
* Ms the opened camera has to show a live picture (default {@link DOC_FIRST_FRAME_MS}; 0 = no watch): a stream that
|
|
2386
|
+
* never plays, ends, or shows only black frames is reopened once, then reported as a retryable `generic` error.
|
|
2387
|
+
*/
|
|
2388
|
+
firstFrameMs?: number;
|
|
2389
|
+
/** (the video plays and has a decoded frame) — whether the camera shows a live picture. */
|
|
2390
|
+
hasFrames?: (video: HTMLVideoElement) => boolean;
|
|
2374
2391
|
/** (performance.now) */
|
|
2375
2392
|
now?: () => number;
|
|
2376
2393
|
/** (setTimeout/clearTimeout) — the cadence pacer. */
|
|
@@ -2414,10 +2431,35 @@ declare class CaptureSessionDoc {
|
|
|
2414
2431
|
/** Last detected quad + detect size (for a host-timed {@link captureNow}). */
|
|
2415
2432
|
private lastQuad;
|
|
2416
2433
|
private lastDetect;
|
|
2434
|
+
/** The first-frame watch of the current camera ({@link DOC_FIRST_FRAME_MS}). */
|
|
2435
|
+
private frameWatch;
|
|
2436
|
+
/** The camera was reopened once by the watch since it last showed a picture. */
|
|
2437
|
+
private reopened;
|
|
2438
|
+
/** A tick saw a lit frame since the camera opened; black ticks in a row before that. */
|
|
2439
|
+
private lit;
|
|
2440
|
+
private blackTicks;
|
|
2441
|
+
/** Unsubscribes the opened track's `ended` listener. */
|
|
2442
|
+
private offEnded;
|
|
2417
2443
|
constructor(opts: CaptureSessionDocOptions);
|
|
2418
2444
|
on<K extends keyof CaptureSessionDocEvents>(event: K, handler: Handler<K>): () => void;
|
|
2419
2445
|
private emit;
|
|
2420
2446
|
start(): Promise<void>;
|
|
2447
|
+
/** play() on the kept stream when it is still live and attached (see start()); null when there is nothing to play. */
|
|
2448
|
+
private resumePlayback;
|
|
2449
|
+
/** Whether the video shows a live picture right now (playing, with a decoded frame). */
|
|
2450
|
+
private framesNow;
|
|
2451
|
+
/** Arm the first-frame watch for this camera. */
|
|
2452
|
+
private watchFrames;
|
|
2453
|
+
private clearFrameWatch;
|
|
2454
|
+
/** The opened track ended on its own (the camera was taken or interrupted): the same path as a dead picture. */
|
|
2455
|
+
private watchEnded;
|
|
2456
|
+
/**
|
|
2457
|
+
* The camera opened but shows no live picture: reopen it once (silently), then a retryable error. A live stream the
|
|
2458
|
+
* browser would not play is kept for the retry's tap to play it ({@link resumePlayback}).
|
|
2459
|
+
*/
|
|
2460
|
+
private cameraDead;
|
|
2461
|
+
/** Stop and detach this engine's stream. */
|
|
2462
|
+
private releaseStream;
|
|
2421
2463
|
/** Restart the gate for another side / a retake (same stream). */
|
|
2422
2464
|
rearm(side?: DocSide): void;
|
|
2423
2465
|
/**
|
|
@@ -3064,4 +3106,4 @@ declare function createVerification(options: VerificationOptions): Verification;
|
|
|
3064
3106
|
/** {@link createVerification} with construction seams (tests / Sekyro AI-internal hosts). */
|
|
3065
3107
|
declare function createVerificationInternal(options: VerificationOptions, internals: VerificationInternals): Verification;
|
|
3066
3108
|
|
|
3067
|
-
export { type LivenessCaptureEvents as $, type AcceptedDocumentsLike as A, type DocumentMrzUpdate as B, type CameraFacing as C, type DocumentCaptureOptions as D, type DocumentPoint as E, type DocumentQuad as F, type DocumentReticle as G, type DocumentScanPhase as H, type DocumentScanUpdate as I, type DocumentSide as J, type DocumentSnapshot as K, type DocumentStepHandle as L, type EidSnapshot as M, type EidStepHandle as N, type EmailOtpSnapshot as O, type PortraitCaptureOptions as P, type EmailOtpStepHandle as Q, type EmailSource as R, type GateHint as S, type GateUpdate as T, ISSUER_CODES as U, type IdentitySummarySnapshot as V, type IdentitySummaryStepHandle as W, type InLaneSwitch as X, type LivePhotoGateUpdate as Y, type LivePhotoPlan as Z, type LivenessAssetsStatus as _, type DocumentCaptureHandle as a, type LiveMrzTuning as a$, type LivenessCaptureHandle as a0, type LivenessCaptureOptions as a1, type LivenessSnapshot as a2, type LivenessStartOptions as a3, type LivenessStepHandle as a4, type MethodSnapshot as a5, type MethodStepHandle as a6, type MobileRequiredSnapshot as a7, type MobileRequiredStepHandle as a8, type OtpChannel as a9, type UnsupportedSnapshot as aA, type UnsupportedStepHandle as aB, type Verification as aC, type VerificationBusy as aD, type VerificationEvents as aE, type VerificationLocale as aF, type VerificationOptions as aG, type VerificationResult as aH, type VerificationStatus as aI, type VerificationStep as aJ, WEB_IDENTITY_METHODS as aK, acceptedIssuers as aL, acceptedTypesFor as aM, cameraUnavailableCauseOf as aN, createLivenessCapture as aO, createVerification as aP, deriveStep as aQ, flagOf as aR, getLivenessAssetsStatus as aS, laneOf as aT, otherOptions as aU, preloadLivenessAssets as aV, releaseLivenessAssets as aW, resolveAcceptedDocuments as aX, sectionOf as aY, subscribeLivenessAssets as aZ, type DocCatalogEntry as a_, type OtpNumberSource as aa, PLATFORM_UNSUPPORTED as ab, type PhoneOtpSnapshot as ac, type PhoneOtpStepHandle as ad, type PlanChoiceSnapshot as ae, type PortraitCaptureEvents as af, type PortraitCaptureState as ag, type PortraitGateUpdate as ah, type PortraitSnapshot as ai, type PortraitStartOptions as aj, type PortraitStepHandle as ak, type PreloadLivenessAssetsOptions as al, type ProcessingSnapshot as am, type ProcessingStepHandle as an, type ReasonCode as ao, type RegistrySnapshot as ap, type RegistrySource as aq, type RegistryStepHandle as ar, type ResultDisplay as as, type ResultSnapshot as at, type ResultStepHandle as au, type SdkFailureReason as av, type StepAttempts as aw, type StepContext as ax, type StepSnapshot as ay, type UnsupportedReason as az, type PortraitCaptureHandle as b,
|
|
3109
|
+
export { type LivenessCaptureEvents as $, type AcceptedDocumentsLike as A, type DocumentMrzUpdate as B, type CameraFacing as C, type DocumentCaptureOptions as D, type DocumentPoint as E, type DocumentQuad as F, type DocumentReticle as G, type DocumentScanPhase as H, type DocumentScanUpdate as I, type DocumentSide as J, type DocumentSnapshot as K, type DocumentStepHandle as L, type EidSnapshot as M, type EidStepHandle as N, type EmailOtpSnapshot as O, type PortraitCaptureOptions as P, type EmailOtpStepHandle as Q, type EmailSource as R, type GateHint as S, type GateUpdate as T, ISSUER_CODES as U, type IdentitySummarySnapshot as V, type IdentitySummaryStepHandle as W, type InLaneSwitch as X, type LivePhotoGateUpdate as Y, type LivePhotoPlan as Z, type LivenessAssetsStatus as _, type DocumentCaptureHandle as a, type LiveMrzTuning as a$, type LivenessCaptureHandle as a0, type LivenessCaptureOptions as a1, type LivenessSnapshot as a2, type LivenessStartOptions as a3, type LivenessStepHandle as a4, type MethodSnapshot as a5, type MethodStepHandle as a6, type MobileRequiredSnapshot as a7, type MobileRequiredStepHandle as a8, type OtpChannel as a9, type UnsupportedSnapshot as aA, type UnsupportedStepHandle as aB, type Verification as aC, type VerificationBusy as aD, type VerificationEvents as aE, type VerificationLocale as aF, type VerificationOptions as aG, type VerificationResult as aH, type VerificationStatus as aI, type VerificationStep as aJ, WEB_IDENTITY_METHODS as aK, acceptedIssuers as aL, acceptedTypesFor as aM, cameraUnavailableCauseOf as aN, createLivenessCapture as aO, createVerification as aP, deriveStep as aQ, flagOf as aR, getLivenessAssetsStatus as aS, laneOf as aT, otherOptions as aU, preloadLivenessAssets as aV, releaseLivenessAssets as aW, resolveAcceptedDocuments as aX, sectionOf as aY, subscribeLivenessAssets as aZ, type DocCatalogEntry as a_, type OtpNumberSource as aa, PLATFORM_UNSUPPORTED as ab, type PhoneOtpSnapshot as ac, type PhoneOtpStepHandle as ad, type PlanChoiceSnapshot as ae, type PortraitCaptureEvents as af, type PortraitCaptureState as ag, type PortraitGateUpdate as ah, type PortraitSnapshot as ai, type PortraitStartOptions as aj, type PortraitStepHandle as ak, type PreloadLivenessAssetsOptions as al, type ProcessingSnapshot as am, type ProcessingStepHandle as an, type ReasonCode as ao, type RegistrySnapshot as ap, type RegistrySource as aq, type RegistryStepHandle as ar, type ResultDisplay as as, type ResultSnapshot as at, type ResultStepHandle as au, type SdkFailureReason as av, type StepAttempts as aw, type StepContext as ax, type StepSnapshot as ay, type UnsupportedReason as az, type PortraitCaptureHandle as b, FLIP_TIMEOUT_MS as b$, type TextLockTuning as b0, type OcrEngineClient as b1, type DocAssistReport as b2, type ReadyInfo as b3, type LoadFailure as b4, type OcrEngineOptions as b5, type SubmitRuntime as b6, type HostedClientLike as b7, ANALYSIS_LONG_EDGE as b8, ASPECT_BANDS as b9, type DocCameraTuning as bA, type DocCaptureReport as bB, type DocCaptureVia as bC, type DocChecksPayload as bD, type DocEngineLike as bE, DocFeedbackAggregator as bF, type DocFeedbackKey as bG, type DocFeedbackState as bH, type DocFormat as bI, type DocFrameAnalysis as bJ, type DocFrameMeasures as bK, type DocGateQuality as bL, type DocGateThresholds as bM, type DocGateTick as bN, type DocGateTickInput as bO, DocGateV1 as bP, type DocQuad as bQ, type DocQuadPoint as bR, type DocShutterReason as bS, type DocShutterTuning as bT, type DocSide as bU, type DocumentCaptureController as bV, type DocumentCaptureInternals as bW, EMPTY_GUIDE_METRICS as bX, type EncodedDocument as bY, FLIP_FILL_MIN as bZ, FLIP_GAP_MS as b_, AttestationError as ba, BLUR_REFUSE_SHARPNESS_MAX as bb, type BlurStatus as bc, CAPTURE_CANDIDATE_SPACING_MS as bd, CAPTURE_EXTRA_CANDIDATES as be, CLIP_MIME_ALLOWLIST as bf, type CaptureEngine as bg, CaptureSessionDoc as bh, type CaptureSessionDocEvents as bi, type CaptureSessionDocOptions as bj, DOC_ANALYSIS_DEFAULTS as bk, DOC_BLACK_FRAME_LUMA as bl, DOC_BLACK_FRAME_TICKS as bm, DOC_CADENCE_HZ as bn, DOC_CAMERA_TUNING_DEFAULTS as bo, DOC_CATALOG as bp, DOC_DETECT_WIDTH as bq, DOC_FEEDBACK_STATES as br, DOC_FIRST_FRAME_MS as bs, DOC_GATE_V1_DEFAULTS as bt, DOC_SHUTTER_DEFAULTS as bu, type DeviceReadHint as bv, type DocArtifacts as bw, DocAssist as bx, type DocAssistEngine as by, type DocAssistTick as bz, type CaptureChannel as c, aspectBand as c$, type FocusCaps as c0, type FramingStatus as c1, GUIDE_LOCK_DEFAULTS as c2, type GlareStatus as c3, type GrabbedFrame as c4, type GuideBlocker as c5, GuideLock as c6, type GuideLockTick as c7, type GuideLockTuning as c8, type GuideMetrics as c9, MR_DOC_CATALOG as cA, NO_REPORT_MS as cB, type OpenDocCameraDeps as cC, PORTRAIT_JPEG_QUALITY as cD, PRELOAD_BLAZE_INIT_TIMEOUT_MS as cE, PRELOAD_BUDGET_MS as cF, PROCESSING_POLL_DELAY_MS as cG, PROCESSING_POLL_MAX as cH, type PortraitCaptureController as cI, type PortraitCaptureInternals as cJ, REGISTRY_RETRY_DELAY_MS as cK, type ReticleType as cL, SAME_FACE_MAX_DROPS as cM, type ScanEvent as cN, type ScanLayout as cO, type ScanNotice as cP, type ScanPhase as cQ, type ScanReport as cR, type ScanSide as cS, type ScanState as cT, type SubmitExecutor as cU, TEXT_LOCK_DEFAULTS as cV, TRANSPORT_REPLAY_ATTEMPTS as cW, TRANSPORT_REPLAY_DELAY_MS as cX, type VerificationInternals as cY, analyzeDocFrame as cZ, analyzeGuide as c_, type GuideRect as ca, INFERENCE_RETRY_ATTEMPTS as cb, INFERENCE_RETRY_DEFAULT_S as cc, LANDMARKER_MODEL as cd, LENS_STORAGE_KEY as ce, LENS_TRY_MAX as cf, LIVE_MRZ_DEFAULTS as cg, LIVE_PHOTO_IDLE_MS as ch, LIVE_PHOTO_MAX_HZ as ci, type LandmarkedFace as cj, type LandmarkerLike as ck, type LensKind as cl, type LensSource as cm, type LightingStatus as cn, type LiveMrzCapture as co, type LiveMrzState as cp, type LivePhotoGate as cq, type LivePhotoKit as cr, type LivePhotoKitInternals as cs, type LivePhotoKitOptions as ct, type LivePhotoStill as cu, type LivenessCaptureInternalHandle as cv, type LivenessCaptureInternals as cw, type LivenessFlowDeps as cx, type LivenessFlowOutcome as cy, MANUAL_SHUTTER_MS as cz, type CaptureEngineId as d, aspectFits as d0, buildDeviceReadHint as d1, coverPointToVideo as d2, createDocumentCaptureInternal as d3, createFaceLandmarker as d4, createLivePhotoKit as d5, createLivenessCaptureInternal as d6, createPortraitCaptureInternal as d7, createVerificationInternal as d8, docZoomFor as d9, resolveDocCameraTuning as dA, resolveDocShutterTuning as dB, resolveGuideLockTuning as dC, runLivenessFlow as dD, runSubmission as dE, scannerFormatFor as dF, setPreloadLoaderForTests as dG, settledHint as dH, singleShotFocusAt as dI, specularFraction as dJ, supportsFocusMode as dK, warmDocDetector as dL, writeStoredLens as dM, encodeDocumentImage as da, facesOf as db, feedbackVoteOf as dc, focusOk as dd, guideQuad as de, guideRegionInFrame as df, initialScanState as dg, lensKindOf as dh, mapEngineState as di, mapErrorKind as dj, mapGuidanceHint as dk, nextScanState as dl, observe as dm, openDocCamera as dn, passportBandOf as dp, portraitMatchStep as dq, preloadedDetectorFactory as dr, quadAreaFrac as ds, quadBounds as dt, quadIou as du, quadTiltRatio as dv, randomUuid as dw, rankBackCameras as dx, readStoredLens as dy, resetLivenessAssetsForTests as dz, type CaptureError as e, type CaptureErrorKind as f, type CaptureState as g, type CapturedArtifacts as h, type CapturedDocument as i, type CapturedPortrait as j, type ChoiceOptionSnapshot as k, type ChoiceSnapshot as l, type ChoiceStepHandle as m, type ContactChoiceSnapshot as n, type ContactChoiceStepHandle as o, DEFAULT_API_ORIGIN as p, DOCUMENT_TYPE_ORDER as q, type DeriveStepEnv as r, type DocumentCaptureEvents as s, type DocumentCaptureState as t, type DocumentFeedback as u, type DocumentFeedbackKey as v, type DocumentGateUpdate as w, type DocumentGuide as x, type DocumentGuideMeasure as y, type DocumentLiveMrzOptions as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HostedSessionView, C as ConsentLocale, a as HostedConsentView, b as CameraUnavailableCause, I as IdentityConfirmDecision, M as MediaKind, P as PresignUploadResult, c as CaptureContext, d as CompleteMediaResult, e as CheckType, f as CheckInputByType, g as IcaoCriterion, B as BackgroundUniformity, R as ResolvedIcaoTuning } from './types-
|
|
1
|
+
import { H as HostedSessionView, C as ConsentLocale, a as HostedConsentView, b as CameraUnavailableCause, I as IdentityConfirmDecision, M as MediaKind, P as PresignUploadResult, c as CaptureContext, d as CompleteMediaResult, e as CheckType, f as CheckInputByType, g as IcaoCriterion, B as BackgroundUniformity, R as ResolvedIcaoTuning } from './types-BZXO8xhw.js';
|
|
2
2
|
|
|
3
3
|
interface Point {
|
|
4
4
|
x: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as HostedSessionView, C as ConsentLocale, a as HostedConsentView, b as CameraUnavailableCause, I as IdentityConfirmDecision, M as MediaKind, P as PresignUploadResult, c as CaptureContext, d as CompleteMediaResult, e as CheckType, f as CheckInputByType, g as IcaoCriterion, B as BackgroundUniformity, R as ResolvedIcaoTuning } from './types-
|
|
1
|
+
import { H as HostedSessionView, C as ConsentLocale, a as HostedConsentView, b as CameraUnavailableCause, I as IdentityConfirmDecision, M as MediaKind, P as PresignUploadResult, c as CaptureContext, d as CompleteMediaResult, e as CheckType, f as CheckInputByType, g as IcaoCriterion, B as BackgroundUniformity, R as ResolvedIcaoTuning } from './types-BZXO8xhw.cjs';
|
|
2
2
|
|
|
3
3
|
interface Point {
|
|
4
4
|
x: number;
|