@sekyro/web 0.1.0-rc.21 → 0.1.0-rc.22

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +12 -11
  3. package/dist/camera-trait-V4UAOPIQ.js +1 -0
  4. package/dist/{capture-constraints-B5omafmk.d.cts → capture-constraints-CVqpMNGA.d.cts} +7 -3
  5. package/dist/{capture-constraints-B5omafmk.d.ts → capture-constraints-CVqpMNGA.d.ts} +7 -3
  6. package/dist/{capture-session-doc-XBZGXWOP.js → capture-session-doc-YDUKUN3P.js} +1 -1
  7. package/dist/{capture-session-v3-26FgzBIl.d.cts → capture-session-v3-CkcuPKSD.d.ts} +90 -13
  8. package/dist/{capture-session-v3-ZO0QOeQH.d.ts → capture-session-v3-TJL-0Muv.d.cts} +90 -13
  9. package/dist/chunk-2KTSNAVR.js +1 -0
  10. package/dist/chunk-2LDOXGY3.js +1 -0
  11. package/dist/chunk-32ELI5BZ.js +1 -0
  12. package/dist/chunk-7QZWBDI5.js +1 -0
  13. package/dist/chunk-7XT5YDSC.js +1 -0
  14. package/dist/chunk-BATJN3VQ.js +1 -0
  15. package/dist/chunk-CPUECYAJ.js +1 -0
  16. package/dist/chunk-FSSMUAKC.js +1 -0
  17. package/dist/{chunk-QYYJLXKA.js → chunk-HYGINGDC.js} +1 -1
  18. package/dist/chunk-LJYMZQY2.js +1 -0
  19. package/dist/chunk-PZYVSLPG.js +1 -0
  20. package/dist/chunk-RALQBQPT.js +1 -0
  21. package/dist/chunk-SX7TUC3V.js +1 -0
  22. package/dist/chunk-TJUM65FN.js +1 -0
  23. package/dist/chunk-TSA6GHUG.js +1 -0
  24. package/dist/chunk-VWGKUQ3C.js +1 -0
  25. package/dist/chunk-Z2BIZYZQ.js +1 -0
  26. package/dist/chunk-Z5D7SZUW.js +1 -0
  27. package/dist/client/index.cjs +1 -1
  28. package/dist/client/index.d.cts +3 -3
  29. package/dist/client/index.d.ts +3 -3
  30. package/dist/client/index.js +1 -1
  31. package/dist/clip-inspect-DLJXVKV6.js +1 -0
  32. package/dist/core/index.cjs +1 -1
  33. package/dist/core/index.d.cts +5 -5
  34. package/dist/core/index.d.ts +5 -5
  35. package/dist/core/index.js +1 -1
  36. package/dist/core/v3/detect-worker.cjs +1 -1
  37. package/dist/core/v3/detect-worker.d.cts +1 -1
  38. package/dist/core/v3/detect-worker.d.ts +1 -1
  39. package/dist/core/v3/detect-worker.js +1 -1
  40. package/dist/create-document-capture-K6EHRCWN.js +1 -0
  41. package/dist/create-portrait-capture-5VGYZUOK.js +1 -0
  42. package/dist/{create-verification-KlHIU4Fy.d.ts → create-verification-DnyHCSu6.d.cts} +175 -80
  43. package/dist/{create-verification-CXhXxknV.d.cts → create-verification-DoISHOqL.d.ts} +175 -80
  44. package/dist/{detect-worker-DclNxkZT.d.cts → detect-worker-CHqsPJoM.d.cts} +19 -2
  45. package/dist/{detect-worker-DclNxkZT.d.ts → detect-worker-CHqsPJoM.d.ts} +19 -2
  46. package/dist/{icao-gate-DvzOzHq6.d.cts → icao-gate-BFlSZYCZ.d.cts} +1 -1
  47. package/dist/{icao-gate-DI8VePWd.d.ts → icao-gate-lZ_fHE7k.d.ts} +1 -1
  48. package/dist/{icao-policy-DztbA50-.d.ts → icao-policy-BOcutYdD.d.ts} +2 -2
  49. package/dist/{icao-policy-MRB8NMAu.d.cts → icao-policy-JZH0UdmD.d.cts} +2 -2
  50. package/dist/index.cjs +1 -1
  51. package/dist/index.d.cts +11 -15
  52. package/dist/index.d.ts +11 -15
  53. package/dist/index.js +1 -1
  54. package/dist/internal/index.cjs +1 -1
  55. package/dist/internal/index.d.cts +49 -34
  56. package/dist/internal/index.d.ts +49 -34
  57. package/dist/internal/index.js +1 -1
  58. package/dist/plan-runner-3ZMV7SFQ.js +1 -0
  59. package/dist/popup/index.cjs +1 -1
  60. package/dist/popup/index.d.cts +2 -2
  61. package/dist/popup/index.d.ts +2 -2
  62. package/dist/popup/index.js +1 -1
  63. package/dist/{print-AYSCRSZB.js → print-SEWS3VHQ.js} +1 -1
  64. package/dist/{turnstile-FATNZ4AG.js → turnstile-2J3LUHCG.js} +1 -1
  65. package/dist/{types-C_XP92JQ.d.cts → types-DwfyBTte.d.cts} +129 -74
  66. package/dist/{types-C_XP92JQ.d.ts → types-DwfyBTte.d.ts} +129 -74
  67. package/package.json +1 -1
  68. package/sbom.cdx.json +10 -10
  69. package/dist/camera-trait-45MJTW4K.js +0 -1
  70. package/dist/chunk-234OZEDB.js +0 -1
  71. package/dist/chunk-7Q4YPMAF.js +0 -1
  72. package/dist/chunk-B2X33ZW2.js +0 -1
  73. package/dist/chunk-CQ7SKLMC.js +0 -1
  74. package/dist/chunk-FUHDOEBP.js +0 -1
  75. package/dist/chunk-GT2ZLGF7.js +0 -1
  76. package/dist/chunk-H3HVCWLF.js +0 -1
  77. package/dist/chunk-O5WKNZ2C.js +0 -1
  78. package/dist/chunk-OKWG3PVH.js +0 -1
  79. package/dist/chunk-P3H3D33O.js +0 -1
  80. package/dist/chunk-P6UP4UQY.js +0 -1
  81. package/dist/chunk-SNACCYTL.js +0 -1
  82. package/dist/chunk-TQB3URP2.js +0 -1
  83. package/dist/chunk-VIAT4DEA.js +0 -1
  84. package/dist/chunk-ZADZTM3M.js +0 -1
  85. package/dist/chunk-ZNIZACXD.js +0 -1
  86. package/dist/create-document-capture-23R2F47A.js +0 -1
  87. package/dist/create-portrait-capture-AGFHECK7.js +0 -1
  88. package/dist/plan-runner-NUWONT7F.js +0 -1
@@ -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-7Q4YPMAF.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-CQ7SKLMC.js";import{a as O,b as U,c as V,d as j,e as q}from"../chunk-FPXL63KZ.js";import"../chunk-VIAT4DEA.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};
1
+ import{A as ae,B as se,C as te,b as x,c as k,d as z,e as C,f as L,g as T,h as E,i as R,j as h,k as b,l as A,m as H,n as K,q as P,r as I,s as Y,t as Z,u as _,v as $,w as ee,x as re,y as oe,z as ne}from"../chunk-7XT5YDSC.js";import"../chunk-SX7TUC3V.js";import{a as q,b as w,c as D,d as G}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-CPUECYAJ.js";import{a as J,b as M,c as Q,d as W,e as X}from"../chunk-FPXL63KZ.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-TSA6GHUG.js";import"../chunk-BATJN3VQ.js";import{a as S,b as B,c as F,d as N,e as O,f as U,g as V,h as j}from"../chunk-FSSMUAKC.js";var ie={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."}},ce={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,te as CaptureSessionV3,h as ClipError,K as ClipRecorder,u as DEFAULT_CLIP_MIME,N as DEFAULT_TIER_ORDER,F as DEFAULT_V3_ASSET_BASE_URL,q as DEVICE_PROFILES,I as DetectScheduler,O as DetectorLadderError,G as DeviceProfiler,L as ENCODER_TAIL_MS,M as EXPOSURE_BAND,E as FRAME_POLL_MS,Z as FaceGateV3,ee as GATE_SNAPSHOT_MS,$ as GateBlockStats,re as HOLD_UPRIGHT_KEY,R as INSPECT_WAIT_MS,t as IN_CIRCLE_FACTOR,ne as KEYFRAME_CANDIDATES,ae as KEYFRAME_WINDOW_MS,l as MAX_CLIP_BYTES,T as MAX_OVERRUN_MS,c as MIME_CANDIDATES,r as PHONE_MAX_SHORT_SIDE,se as PROVENANCE_WAIT_MS,S as SECOND_FACE_AREA_RATIO,J as SHARP_REF,b as SHORT_CLIP_TOLERANCE_MS,z as STOP_GRACE_MS,k as TIMESLICE_MS,oe as UPRIGHT_WATCH_MS,Y as V3_GATE_DEFAULTS,C as VIDEO_BPS,H as betterTake,_ as blockReasonOf,e as buildCaptureConstraints,g as buildLivenessV2FormData,m as cameraPreflight,P as captureMirroredKeyframe,D as classifyDevice,B as countExtraFaces,j as createDetector,o as detectFormFactor,n as detectIsMobile,ie as errorCopy,X as exposure,y as extForMime,U as intrinsicSize,v as isClipTooLarge,d as isMediaRecorderSupported,f as mapGetUserMediaError,Q as meanLuma,A as needsRetake,p as pickMimeType,w as probeDevice,W as sharpness,V as toStreamPixels,a as trackFacingMode,ce as uiCopy};
@@ -1 +1 @@
1
- "use strict";var T=Object.create;var u=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var M=(t,e)=>{for(var r in e)u(t,r,{get:e[r],enumerable:!0})},k=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of I(e))!S.call(t,n)&&n!==r&&u(t,n,{get:()=>e[n],enumerable:!(o=F(e,n))||o.enumerable});return t};var L=(t,e,r)=>(r=t!=null?T(E(t)):{},k(e||!t||!t.__esModule?u(r,"default",{value:t,enumerable:!0}):r,t)),_=t=>k(u({},"__esModule",{value:!0}),t);var U={};M(U,{WORKER_PROTOCOL_VERSION:()=>d,WorkerDetectorProxy:()=>x,installWorkerDetectorHost:()=>R,workerOffloadSupported:()=>H});module.exports=_(U);var D=1e4,l=class t{constructor(e,r){this.tier="blaze";this.inner=e,r!==void 0&&(this.fallbackReason=r)}static async create(e,r){let o=await import("@mediapipe/tasks-vision"),n=await o.FilesetResolver.forVisionTasks(e),i=await o.FaceDetector.createFromOptions(n,{baseOptions:{modelAssetPath:`${e}/blaze_face_short_range.tflite`,delegate:"CPU"},runningMode:"IMAGE"});return new t(i,r)}async detect(e,r,o){let n;try{n=this.inner.detect(e).detections}catch{return null}let i=W(n);if(i?.boundingBox===void 0)return null;let a=h(e),s=P(i.keypoints,a),c=i.keypoints?.[2],p={box:{x:i.boundingBox.originX,y:i.boundingBox.originY,width:i.boundingBox.width,height:i.boundingBox.height},...s!==void 0?{eyes:s}:{},...c!==void 0?{nose:{x:c.x*a.width,y:c.y*a.height}}:{},score:i.categories[0]?.score??0};return m(p,e,r,o)}destroy(){try{this.inner.close()}catch{}}};function W(t){let e,r=-1;for(let o of t){let n=o.categories[0]?.score??0;n>r&&(e=o,r=n)}return e}function P(t,e){let r=t?.[0],o=t?.[1];if(r===void 0||o===void 0)return;let n=s=>({x:s.x*e.width,y:s.y*e.height}),[i,a]=[n(r),n(o)];return i.x<=a.x?{left:i,right:a}:{left:a,right:i}}function B(){if(typeof OffscreenCanvas=="function")return new OffscreenCanvas(2,2);let t=document.createElement("canvas");return t.width=2,t.height=2,t}async function O(){let t=globalThis.FaceDetector;if(typeof t!="function")return{ok:!1,reason:"unsupported"};try{let e=new t({fastMode:!0,maxDetectedFaces:1});return await e.detect(B()),{ok:!0,instance:e}}catch(e){return{ok:!1,reason:`smoke_failed:${e instanceof Error?e.message:String(e)}`}}}var f=class{constructor(e,r){this.tier="native";this.inner=e,r!==void 0&&(this.fallbackReason=r)}async detect(e,r,o){let n;try{n=await this.inner.detect(e)}catch{return null}let i=n[0];if(i===void 0)return null;let a=C(i.landmarks),s={box:{x:i.boundingBox.x,y:i.boundingBox.y,width:i.boundingBox.width,height:i.boundingBox.height},...a!==void 0?{eyes:a}:{},score:1};return m(s,e,r,o)}destroy(){}};function C(t){if(t===void 0)return;let e=t.filter(n=>n.type==="eye").map(n=>n.locations[0]).filter(n=>n!==void 0),[r,o]=e;if(!(r===void 0||o===void 0))return r.x<=o.x?{left:r,right:o}:{left:o,right:r}}var N="/models-v3",V=["native","blaze"],v=class extends Error{constructor(e){super(`no detector tier available (${e})`),this.name="DetectorLadderError",this.fallbackReason=e}};function h(t){let e=t;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 r=typeof e.width=="number"?e.width:0,o=typeof e.height=="number"?e.height:0;return{width:r,height:o}}function m(t,e,r,o){let n=h(e),i=n.width>0?r/n.width:1,a=n.height>0?o/n.height:1,s=c=>({x:c.x*i,y:c.y*a});return{box:{x:t.box.x*i,y:t.box.y*a,width:t.box.width*i,height:t.box.height*a},...t.eyes!==void 0?{eyes:{left:s(t.eyes.left),right:s(t.eyes.right)}}:{},...t.nose!==void 0?{nose:s(t.nose)}:{},score:t.score}}function A(t){return t instanceof Error?t.message:String(t)}async function w(t){let e=t.preferred??V,r=[];for(let o of e){if(o==="native"){let n=await O();if(n.ok)return new f(n.instance,y(r));r.push(`native:${n.reason}`);continue}try{return await z(l.create(t.v3AssetBaseUrl??N,y(r)),t.blazeInitTimeoutMs??D)}catch(n){r.push(n instanceof b?"blaze:blaze_init_timeout":`blaze:${A(n)}`)}}throw new v(y(r)??"no_tier_available")}function y(t){return t.length>0?t.join("; "):void 0}var b=class extends Error{};function z(t,e){return new Promise((r,o)=>{let n=setTimeout(()=>{o(new b(`init exceeded ${e}ms`)),t.then(i=>i.destroy(),()=>{})},e);t.then(i=>{clearTimeout(n),r(i)},i=>{clearTimeout(n),o(i)})})}var d=1;function H(){return typeof OffscreenCanvas=="function"&&typeof createImageBitmap=="function"&&typeof Worker=="function"}function R(t,e={}){let r=e.createDetector??w,o=null;t.onmessage=n=>{let i=n.data;if(i.v!==d){i.bitmap?.close?.();return}if(i.type==="init"){r(i.options).then(a=>{o=a;let s={v:d,type:"ready",tier:a.tier,...a.fallbackReason!==void 0?{fallbackReason:a.fallbackReason}:{}};t.postMessage(s)});return}if(i.type==="detect"){let a=s=>{let c={v:d,type:"result",id:i.id,observation:s};t.postMessage(c),i.bitmap.close?.()};if(o===null){a(null);return}o.detect(i.bitmap,i.streamWidth,i.streamHeight).then(a,()=>a(null))}}}typeof self<"u"&&typeof self.importScripts=="function"&&R(self);var x=class t{constructor(e,r){this.pending=new Map;this.nextId=1;this.worker=e,this.tier=r.tier,r.fallbackReason!==void 0&&(this.fallbackReason=r.fallbackReason),e.addEventListener("message",o=>{let n=o.data;if(n.v!==d||n.type!=="result")return;let i=this.pending.get(n.id);this.pending.delete(n.id),i?.(n.observation)})}static create(e,r,o=1e4){return new Promise((n,i)=>{let a=setTimeout(()=>{e.removeEventListener("message",s),e.terminate(),i(new Error(`worker detector not ready within ${o}ms`))},o),s=p=>{let g=p.data;g.v!==d||g.type!=="ready"||(clearTimeout(a),e.removeEventListener("message",s),n(new t(e,g)))};e.addEventListener("message",s);let c={v:d,type:"init",options:r};e.postMessage(c)})}async detect(e,r,o){let n;try{typeof ImageBitmap<"u"&&e instanceof ImageBitmap?n=e:typeof createImageBitmap=="function"?n=await createImageBitmap(e):n=e}catch{return null}let i=this.nextId;return this.nextId+=1,new Promise(a=>{this.pending.set(i,a);let s={v:d,type:"detect",id:i,bitmap:n,streamWidth:r,streamHeight:o};this.worker.postMessage(s,[n])})}destroy(){for(let e of this.pending.values())e(null);this.pending.clear(),this.worker.terminate()}};0&&(module.exports={WORKER_PROTOCOL_VERSION,WorkerDetectorProxy,installWorkerDetectorHost,workerOffloadSupported});
1
+ "use strict";var I=Object.create;var l=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},O=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _(e))!L.call(t,n)&&n!==r&&l(t,n,{get:()=>e[n],enumerable:!(o=S(e,n))||o.enumerable});return t};var W=(t,e,r)=>(r=t!=null?I(M(t)):{},O(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),B=t=>O(l({},"__esModule",{value:!0}),t);var Y={};C(Y,{WORKER_PROTOCOL_VERSION:()=>d,WorkerDetectorProxy:()=>w,installWorkerDetectorHost:()=>T,workerOffloadSupported:()=>G});module.exports=B(Y);var D=1e4,f=class t{constructor(e,r){this.tier="blaze";this.inner=e,r!==void 0&&(this.fallbackReason=r)}static async create(e,r){let o=await import("@mediapipe/tasks-vision"),n=await o.FilesetResolver.forVisionTasks(e),i=await o.FaceDetector.createFromOptions(n,{baseOptions:{modelAssetPath:`${e}/blaze_face_short_range.tflite`,delegate:"CPU"},runningMode:"IMAGE"});return new t(i,r)}async detect(e,r,o){let n;try{n=this.inner.detect(e).detections}catch{return null}let i=P(n);if(i?.boundingBox===void 0)return null;let a=v(e),s=N(i.keypoints,a),c=i.keypoints?.[2],m={box:{x:i.boundingBox.originX,y:i.boundingBox.originY,width:i.boundingBox.width,height:i.boundingBox.height},...s!==void 0?{eyes:s}:{},...c!==void 0?{nose:{x:c.x*a.width,y:c.y*a.height}}:{},score:i.categories[0]?.score??0,extraFaces:h(n.map(u=>u.boundingBox??{width:0,height:0}),n.indexOf(i))};return b(m,e,r,o)}destroy(){try{this.inner.close()}catch{}}};function P(t){let e,r=-1;for(let o of t){let n=o.categories[0]?.score??0;n>r&&(e=o,r=n)}return e}function N(t,e){let r=t?.[0],o=t?.[1];if(r===void 0||o===void 0)return;let n=s=>({x:s.x*e.width,y:s.y*e.height}),[i,a]=[n(r),n(o)];return i.x<=a.x?{left:i,right:a}:{left:a,right:i}}function A(){if(typeof OffscreenCanvas=="function")return new OffscreenCanvas(2,2);let t=document.createElement("canvas");return t.width=2,t.height=2,t}var V=4;async function F(){let t=globalThis.FaceDetector;if(typeof t!="function")return{ok:!1,reason:"unsupported"};try{let e=new t({fastMode:!0,maxDetectedFaces:V});return await e.detect(A()),{ok:!0,instance:e}}catch(e){return{ok:!1,reason:`smoke_failed:${e instanceof Error?e.message:String(e)}`}}}var g=class{constructor(e,r){this.tier="native";this.inner=e,r!==void 0&&(this.fallbackReason=r)}async detect(e,r,o){let n;try{n=await this.inner.detect(e)}catch{return null}let i=n.map(u=>u.boundingBox),a=-1;i.forEach((u,E)=>{let y=i[a];(y===void 0||u.width*u.height>y.width*y.height)&&(a=E)});let s=n[a];if(s===void 0)return null;let c=z(s.landmarks),m={box:{x:s.boundingBox.x,y:s.boundingBox.y,width:s.boundingBox.width,height:s.boundingBox.height},...c!==void 0?{eyes:c}:{},score:1,extraFaces:h(i,a)};return b(m,e,r,o)}destroy(){}};function z(t){if(t===void 0)return;let e=t.filter(n=>n.type==="eye").map(n=>n.locations[0]).filter(n=>n!==void 0),[r,o]=e;if(!(r===void 0||o===void 0))return r.x<=o.x?{left:r,right:o}:{left:o,right:r}}var H=.25;function h(t,e){let r=t[e],o=r===void 0?0:r.width*r.height;if(!(o>0))return 0;let n=0;return t.forEach((i,a)=>{a!==e&&i.width*i.height>=H*o&&(n+=1)}),n}var U="/models-v3",$=["native","blaze"],k=class extends Error{constructor(e){super(`no detector tier available (${e})`),this.name="DetectorLadderError",this.fallbackReason=e}};function v(t){let e=t;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 r=typeof e.width=="number"?e.width:0,o=typeof e.height=="number"?e.height:0;return{width:r,height:o}}function b(t,e,r,o){let n=v(e),i=n.width>0?r/n.width:1,a=n.height>0?o/n.height:1,s=c=>({x:c.x*i,y:c.y*a});return{box:{x:t.box.x*i,y:t.box.y*a,width:t.box.width*i,height:t.box.height*a},...t.eyes!==void 0?{eyes:{left:s(t.eyes.left),right:s(t.eyes.right)}}:{},...t.nose!==void 0?{nose:s(t.nose)}:{},score:t.score,...t.extraFaces!==void 0?{extraFaces:t.extraFaces}:{}}}function K(t){return t instanceof Error?t.message:String(t)}async function R(t){let e=t.preferred??$,r=[];for(let o of e){if(o==="native"){let n=await F();if(n.ok)return new g(n.instance,x(r));r.push(`native:${n.reason}`);continue}try{return await X(f.create(t.v3AssetBaseUrl??U,x(r)),t.blazeInitTimeoutMs??D)}catch(n){r.push(n instanceof p?"blaze:blaze_init_timeout":`blaze:${K(n)}`)}}throw new k(x(r)??"no_tier_available")}function x(t){return t.length>0?t.join("; "):void 0}var p=class extends Error{};function X(t,e){return new Promise((r,o)=>{let n=setTimeout(()=>{o(new p(`init exceeded ${e}ms`)),t.then(i=>i.destroy(),()=>{})},e);t.then(i=>{clearTimeout(n),r(i)},i=>{clearTimeout(n),o(i)})})}var d=1;function G(){return typeof OffscreenCanvas=="function"&&typeof createImageBitmap=="function"&&typeof Worker=="function"}function T(t,e={}){let r=e.createDetector??R,o=null;t.onmessage=n=>{let i=n.data;if(i.v!==d){i.bitmap?.close?.();return}if(i.type==="init"){r(i.options).then(a=>{o=a;let s={v:d,type:"ready",tier:a.tier,...a.fallbackReason!==void 0?{fallbackReason:a.fallbackReason}:{}};t.postMessage(s)});return}if(i.type==="detect"){let a=s=>{let c={v:d,type:"result",id:i.id,observation:s};t.postMessage(c),i.bitmap.close?.()};if(o===null){a(null);return}o.detect(i.bitmap,i.streamWidth,i.streamHeight).then(a,()=>a(null))}}}typeof self<"u"&&typeof self.importScripts=="function"&&T(self);var w=class t{constructor(e,r){this.pending=new Map;this.nextId=1;this.worker=e,this.tier=r.tier,r.fallbackReason!==void 0&&(this.fallbackReason=r.fallbackReason),e.addEventListener("message",o=>{let n=o.data;if(n.v!==d||n.type!=="result")return;let i=this.pending.get(n.id);this.pending.delete(n.id),i?.(n.observation)})}static create(e,r,o=1e4){return new Promise((n,i)=>{let a=setTimeout(()=>{e.removeEventListener("message",s),e.terminate(),i(new Error(`worker detector not ready within ${o}ms`))},o),s=m=>{let u=m.data;u.v!==d||u.type!=="ready"||(clearTimeout(a),e.removeEventListener("message",s),n(new t(e,u)))};e.addEventListener("message",s);let c={v:d,type:"init",options:r};e.postMessage(c)})}async detect(e,r,o){let n;try{typeof ImageBitmap<"u"&&e instanceof ImageBitmap?n=e:typeof createImageBitmap=="function"?n=await createImageBitmap(e):n=e}catch{return null}let i=this.nextId;return this.nextId+=1,new Promise(a=>{this.pending.set(i,a);let s={v:d,type:"detect",id:i,bitmap:n,streamWidth:r,streamHeight:o};this.worker.postMessage(s,[n])})}destroy(){for(let e of this.pending.values())e(null);this.pending.clear(),this.worker.terminate()}};0&&(module.exports={WORKER_PROTOCOL_VERSION,WorkerDetectorProxy,installWorkerDetectorHost,workerOffloadSupported});
@@ -1 +1 @@
1
- export { e as WORKER_PROTOCOL_VERSION, f as WorkerDetectorProxy, W as WorkerLike, g as WorkerScopeLike, h as installWorkerDetectorHost, w as workerOffloadSupported } from '../../detect-worker-DclNxkZT.cjs';
1
+ export { f as WORKER_PROTOCOL_VERSION, g as WorkerDetectorProxy, W as WorkerLike, h as WorkerScopeLike, j as installWorkerDetectorHost, w as workerOffloadSupported } from '../../detect-worker-CHqsPJoM.cjs';
@@ -1 +1 @@
1
- export { e as WORKER_PROTOCOL_VERSION, f as WorkerDetectorProxy, W as WorkerLike, g as WorkerScopeLike, h as installWorkerDetectorHost, w as workerOffloadSupported } from '../../detect-worker-DclNxkZT.js';
1
+ export { f as WORKER_PROTOCOL_VERSION, g as WorkerDetectorProxy, W as WorkerLike, h as WorkerScopeLike, j as installWorkerDetectorHost, w as workerOffloadSupported } from '../../detect-worker-CHqsPJoM.js';
@@ -1 +1 @@
1
- import{g as a,h as b,i as c,j as d}from"../../chunk-OKWG3PVH.js";export{a as WORKER_PROTOCOL_VERSION,d as WorkerDetectorProxy,c as installWorkerDetectorHost,b as workerOffloadSupported};
1
+ import{i as a,j as b,k as c,l as d}from"../../chunk-FSSMUAKC.js";export{a as WORKER_PROTOCOL_VERSION,d as WorkerDetectorProxy,c as installWorkerDetectorHost,b as workerOffloadSupported};
@@ -0,0 +1 @@
1
+ import{u as a,v as b,w as c,x as d}from"./chunk-HYGINGDC.js";import"./chunk-G6LKLN4U.js";import"./chunk-TDLIXFDT.js";import"./chunk-RALQBQPT.js";import"./chunk-7QZWBDI5.js";import"./chunk-7XT5YDSC.js";import"./chunk-SX7TUC3V.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import"./chunk-TSA6GHUG.js";import"./chunk-BATJN3VQ.js";import"./chunk-FSSMUAKC.js";import"./chunk-DK5YPBDQ.js";export{a as SAME_FACE_MAX_DROPS,c as createDocumentCapture,d as createDocumentCaptureInternal,b as warmDocumentCapture};
@@ -0,0 +1 @@
1
+ import{j as a,k as b,l as c,m as d,n as e,o as f}from"./chunk-VWGKUQ3C.js";import"./chunk-53POX7U4.js";import"./chunk-33KKMPJ5.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import"./chunk-GI3UFGRQ.js";import"./chunk-7QZWBDI5.js";import"./chunk-SX7TUC3V.js";import"./chunk-CPUECYAJ.js";import"./chunk-TSA6GHUG.js";export{a as ANALYSIS_LONG_EDGE,b as PORTRAIT_JPEG_QUALITY,e as createPortraitCaptureInternal,c as defaultGrabber,d as observe,f as warmPortraitCapture};