@sekyro/elements 0.1.0-rc.25 → 0.1.0-rc.27

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 (93) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cdn/chunks/capture-session-doc-BT2W22H5-TWRWJRRR.js +1 -0
  3. package/dist/cdn/chunks/{chunk-23W5VB46.js → chunk-2IYNWMYV.js} +1 -1
  4. package/dist/cdn/chunks/{chunk-YWAPDHEW.js → chunk-2PCS4H3E.js} +1 -1
  5. package/dist/cdn/chunks/{chunk-SS7SVE6O.js → chunk-2RVF3WJ3.js} +1 -1
  6. package/dist/cdn/chunks/chunk-2RXQBUDC.js +3 -0
  7. package/dist/cdn/chunks/{chunk-4EWD6VW3.js → chunk-2SXFB7OS.js} +1 -1
  8. package/dist/cdn/chunks/chunk-35AXFJCG.js +1 -0
  9. package/dist/cdn/chunks/chunk-5H2LBGA7.js +25 -0
  10. package/dist/cdn/chunks/{chunk-34QKBDWM.js → chunk-66K4ELX6.js} +1 -1
  11. package/dist/cdn/chunks/{chunk-UALTP6H4.js → chunk-ATYTAIFS.js} +1 -1
  12. package/dist/cdn/chunks/{chunk-XYXBZEKH.js → chunk-B737CEIX.js} +1 -1
  13. package/dist/cdn/chunks/{chunk-5ZUDZLHN.js → chunk-DM2IEIG4.js} +1 -1
  14. package/dist/cdn/chunks/{chunk-W5QMFEZY.js → chunk-EHVBCFRB.js} +1 -1
  15. package/dist/cdn/chunks/chunk-FCQZZSGE.js +1 -0
  16. package/dist/cdn/chunks/chunk-IJKJJDVP.js +1 -0
  17. package/dist/cdn/chunks/{chunk-B5QW2GSC.js → chunk-JPREVWIF.js} +1 -1
  18. package/dist/cdn/chunks/{chunk-53PI7QVO.js → chunk-LKG2GOWP.js} +1 -1
  19. package/dist/cdn/chunks/{chunk-PPERVFSD.js → chunk-N6TFSAF3.js} +1 -1
  20. package/dist/cdn/chunks/{chunk-43I6I3SU.js → chunk-TV7CW7VL.js} +1 -1
  21. package/dist/cdn/chunks/{chunk-AXCBMN2S.js → chunk-URRHIQLF.js} +2 -2
  22. package/dist/cdn/chunks/{chunk-YR7GTH7M.js → chunk-UYEEBLOW.js} +1 -1
  23. package/dist/cdn/chunks/chunk-ZEUQQLSO.js +1 -0
  24. package/dist/cdn/chunks/{chunk-E7S6A26U.js → chunk-ZYXKVMFC.js} +1 -1
  25. package/dist/cdn/chunks/{create-document-capture-TTMHZP7R-YI3GL7MF.js → create-document-capture-R3H5TJD5-FZDYMF5Q.js} +1 -1
  26. package/dist/cdn/chunks/document-capture-view-RR4DTGYF-DE3CFMWM.js +1 -0
  27. package/dist/cdn/chunks/{eid-view-INQTMVDU-FRHHODOC.js → eid-view-5M34JRB3-JW2ZYCJG.js} +1 -1
  28. package/dist/cdn/chunks/{email-otp-view-OO535PQT-6N2IPXEG.js → email-otp-view-ULR3QWIN-SSLNYDY6.js} +1 -1
  29. package/dist/cdn/chunks/flow-views-V3OXW6PI-COAN2VQJ.js +1 -0
  30. package/dist/cdn/chunks/{form-view-LJLYP54G-N2BB5ZXR.js → form-view-426ISA4K-AKPX7G27.js} +1 -1
  31. package/dist/cdn/chunks/overlay-de-OWNOVFUK-G2EPYZKC.js +1 -0
  32. package/dist/cdn/chunks/overlay-es-POP2QZLC-6H5GQA7F.js +1 -0
  33. package/dist/cdn/chunks/overlay-pt-IKCWBDLR-4R2H3Y7Q.js +1 -0
  34. package/dist/cdn/chunks/plan-runner-EY7VTTUP-RLLA2EQK.js +1 -0
  35. package/dist/cdn/chunks/{portrait-capture-view-N36CKIFR-JIO6P6XN.js → portrait-capture-view-6K6W3USJ-MT7SJLT2.js} +1 -1
  36. package/dist/cdn/chunks/{portrait-review-view-OG23OEMA-E4JD5Q5S.js → portrait-review-view-PZQZZCYH-NEHNS5VW.js} +1 -1
  37. package/dist/cdn/chunks/{proof-of-address-view-CHM5JRHI-PUHZCNXH.js → proof-of-address-view-MX5Q2XV2-S4FLPL4A.js} +1 -1
  38. package/dist/cdn/define.js +1 -1
  39. package/dist/cdn/index.js +1 -1
  40. package/dist/{chunk-OEZKZQC4.js → chunk-C6FGUALJ.js} +1 -1
  41. package/dist/{chunk-MLH4M6JP.js → chunk-CCJXGVIL.js} +1 -1
  42. package/dist/{chunk-JAEOFYLJ.js → chunk-FXWTWHNX.js} +1 -1
  43. package/dist/{chunk-SD4A47RM.js → chunk-G3M7C3QG.js} +1 -1
  44. package/dist/{chunk-FFRJKCZK.js → chunk-GQIZ42ZI.js} +1 -1
  45. package/dist/{chunk-RAF7Z7I3.js → chunk-JPVADGVQ.js} +1 -1
  46. package/dist/{chunk-2PJRIGH2.js → chunk-JRZE2IZT.js} +1 -1
  47. package/dist/{chunk-GDADEN5C.js → chunk-KN3AOAYL.js} +2 -2
  48. package/dist/{chunk-KEN7JBVG.js → chunk-PNC5GJ4N.js} +1 -1
  49. package/dist/{chunk-RXILZ6JM.js → chunk-R57PCZSZ.js} +1 -1
  50. package/dist/chunk-RDCMAYQA.js +1 -0
  51. package/dist/{chunk-2QEYDBI7.js → chunk-XDH4CTRQ.js} +1 -1
  52. package/dist/{chunk-RJVZHRDP.js → chunk-YQXEEIWM.js} +1 -1
  53. package/dist/chunk-Z5TRMVOP.js +25 -0
  54. package/dist/define.cjs +5 -5
  55. package/dist/define.js +1 -1
  56. package/dist/document-capture-view-RR4DTGYF-5PXLLNJY.js +1 -0
  57. package/dist/{eid-view-INQTMVDU-H7KHUN3L.js → eid-view-5M34JRB3-QXLAE3HM.js} +1 -1
  58. package/dist/{email-otp-view-OO535PQT-6EYUU43N.js → email-otp-view-ULR3QWIN-UCGDMZIL.js} +1 -1
  59. package/dist/flow-views-V3OXW6PI-BFMDN2IB.js +1 -0
  60. package/dist/{form-view-LJLYP54G-OUW66I62.js → form-view-426ISA4K-CTBMZ6MO.js} +1 -1
  61. package/dist/index.cjs +5 -5
  62. package/dist/index.d.cts +4 -0
  63. package/dist/index.d.ts +4 -0
  64. package/dist/index.js +1 -1
  65. package/dist/overlay-de-OWNOVFUK-QY6M35JN.js +1 -0
  66. package/dist/overlay-es-POP2QZLC-325Q4JIU.js +1 -0
  67. package/dist/overlay-pt-IKCWBDLR-2YDKPIHK.js +1 -0
  68. package/dist/{portrait-capture-view-N36CKIFR-S2H37PI5.js → portrait-capture-view-6K6W3USJ-IHLY62OK.js} +1 -1
  69. package/dist/{portrait-review-view-OG23OEMA-MO3FN432.js → portrait-review-view-PZQZZCYH-WJPV3V7H.js} +1 -1
  70. package/dist/{proof-of-address-view-CHM5JRHI-U6ARAGX7.js → proof-of-address-view-MX5Q2XV2-NADFPD37.js} +1 -1
  71. package/dist/styles.css +2 -0
  72. package/package.json +2 -2
  73. package/sbom.cdx.json +4 -4
  74. package/dist/cdn/chunks/capture-session-doc-56O6IQ3D-FTWOAELH.js +0 -1
  75. package/dist/cdn/chunks/chunk-4VFGV3VA.js +0 -1
  76. package/dist/cdn/chunks/chunk-F6BL7IXJ.js +0 -1
  77. package/dist/cdn/chunks/chunk-IHKI3APK.js +0 -25
  78. package/dist/cdn/chunks/chunk-PNQ5TDY5.js +0 -1
  79. package/dist/cdn/chunks/chunk-VD2BADU2.js +0 -1
  80. package/dist/cdn/chunks/chunk-VQSFTT4B.js +0 -3
  81. package/dist/cdn/chunks/document-capture-view-5EYETVEI-UMC6FOKY.js +0 -1
  82. package/dist/cdn/chunks/flow-views-EW2KEEFU-7LTB52QC.js +0 -1
  83. package/dist/cdn/chunks/overlay-de-VGC75M5R-ZUC7ZPRY.js +0 -1
  84. package/dist/cdn/chunks/overlay-es-CSXBWVAG-IQMHKRYH.js +0 -1
  85. package/dist/cdn/chunks/overlay-pt-RGTYSSOJ-EH2IJ6QI.js +0 -1
  86. package/dist/cdn/chunks/plan-runner-FW3EAJCC-H4N5NEL4.js +0 -1
  87. package/dist/chunk-JW4QXADM.js +0 -25
  88. package/dist/chunk-NMUB5C2E.js +0 -1
  89. package/dist/document-capture-view-5EYETVEI-ZQ5RAN4Y.js +0 -1
  90. package/dist/flow-views-EW2KEEFU-H7LOLIEJ.js +0 -1
  91. package/dist/overlay-de-VGC75M5R-C6XYWRT5.js +0 -1
  92. package/dist/overlay-es-CSXBWVAG-MSMVW5KX.js +0 -1
  93. package/dist/overlay-pt-RGTYSSOJ-QA5FJP3U.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @sekyro/elements
2
2
 
3
+ ## 0.1.0-rc.27
4
+
5
+ ### Patch Changes
6
+
7
+ - Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
8
+ - Updated dependencies [eead843]
9
+ - @sekyro/web@0.1.0-rc.49
10
+
11
+ ## 0.1.0-rc.26
12
+
13
+ ### Patch Changes
14
+
15
+ - Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
16
+ - Updated dependencies [19e6f46]
17
+ - Updated dependencies [39451c1]
18
+ - @sekyro/web@0.1.0-rc.48
19
+
3
20
  ## 0.1.0-rc.25
4
21
 
5
22
  ### Patch Changes
@@ -0,0 +1 @@
1
+ import{b as s,c as a,d as _,e as C,f as A,g as D,h as o,i as S,j as r,k as t,l as E,m as p,n as T,o as O,p as i,q as m,r as R}from"./chunk-IJKJJDVP.js";import"./chunk-IWZRAEUN.js";import"./chunk-ZEUQQLSO.js";import"./chunk-F4Q2Q4OC.js";import"./chunk-W5WWCOOW.js";import"./chunk-TV7CW7VL.js";import"./chunk-P7K7ELYZ.js";import"./chunk-JS2IXPNL.js";import"./chunk-4FHWXBOB.js";export{i as CAPTURE_CANDIDATE_SPACING_MS,O as CAPTURE_EXTRA_CANDIDATES,m as CAPTURE_WINDOW_MS,p as CaptureSessionDoc,_ as DOC_BLACK_FRAME_LUMA,C as DOC_BLACK_FRAME_TICKS,A as DOC_CADENCE_HZ,a as DOC_FIRST_FRAME_MS,o as DOC_PROFILE_TICKS,t as DOC_SHUTTER_DEFAULTS,r as DOC_SLOW_TICK_MS,S as DOC_WARMUP_TICKS,R as REFOCUS_APPLY_MAX_MS,D as SIDE_PROBE_MS,T as passportBandOf,E as resolveDocShutterTuning,s as warmDocDetector};
@@ -1,4 +1,4 @@
1
- import{d as I}from"./chunk-YR7GTH7M.js";import{a as C,b as P,c as H}from"./chunk-IHKI3APK.js";import{a as T}from"./chunk-B5QW2GSC.js";import{a as u}from"./chunk-5QL6W6FW.js";import{a as s,b as D,c as N}from"./chunk-4FHWXBOB.js";var j=D(l=>{"use strict";var Q=C();function V(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}s(V,"formatProdErrorMessage");function h(){}s(h,"noop");var c={d:{f:h,r:s(function(){throw Error(V(522))},"r"),D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},ee=Symbol.for("react.portal");function re(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ee,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}s(re,"createPortal$1");var O=Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function M(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}s(M,"getCrossOriginStringAs");l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c;l.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(V(299));return re(r,e,null,t)};l.flushSync=function(r){var e=O.T,t=c.p;try{if(O.T=null,c.p=2,r)return r()}finally{O.T=e,c.p=t,c.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,c.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&c.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin),o=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?c.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:o,fetchPriority:i}):t==="script"&&c.d.X(r,{crossOrigin:n,integrity:o,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=M(e.as,e.crossOrigin);c.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&c.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin);c.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=M(e.as,e.crossOrigin);c.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else c.d.m(r)};l.requestFormReset=function(r){c.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,t){return O.H.useFormState(r,e,t)};l.useFormStatus=function(){return O.H.useHostTransitionStatus()};l.version="19.2.0"});var W=D((de,B)=>{"use strict";function U(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U)}catch(r){console.error(r)}}s(U,"checkDCE");U(),B.exports=j()});var z=N(C(),1),f=N(P(),1),a=N(P(),1);var E=N(C(),1),Z=N(W(),1),v=N(P(),1);var te=Array.from({length:56},(r,e)=>{let t=e/56*2*Math.PI-Math.PI/2,n=Math.cos(t),o=Math.sin(t);return{id:`tick-${e}`,frac:e/55,x1:150+108*n,y1:150+108*o,x2:150+138*n,y2:150+138*o,style:{transitionDelay:`${e*6}ms`}}});function F(r,e,t,n){return t?"var(--sekyro-color-success)":r?n?"color-mix(in srgb, var(--sekyro-color-warning) 75%, transparent)":e<.33?"color-mix(in srgb, var(--sekyro-color-brand) 55%, transparent)":e<.66?"color-mix(in srgb, var(--sekyro-color-brand) 80%, transparent)":"var(--sekyro-color-brand)":"color-mix(in srgb, var(--sekyro-color-surface) 32%, transparent)"}s(F,"T");u(F,"tickColor");var ae="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function G({progress:r,phase:e,draining:t=!1}){let n=Math.min(1,Math.max(0,r)),o=Math.round(n*56),i=e==="checking",y=e==="recording",d=e==="frozen",m=i||d,p=i||y||d,k=e==="locked"||p,S=t&&!k;return(0,f.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 300 300",preserveAspectRatio:"xMidYMid meet",className:"sekyro-stage__arc","data-testid":"sekyro-capture-arc","data-phase":e,"data-filled":o,"data-recording":y?"":void 0,"data-draining":S?"":void 0,children:[(0,f.jsx)("path",{fillRule:"evenodd",d:ae,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":m?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),(0,f.jsxs)("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[(0,f.jsx)("g",{className:m?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:te.map((g,x)=>(0,f.jsx)("line",{x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:F(x<o,g.frac,k,S),strokeWidth:3,strokeLinecap:"round",style:g.style,className:"sekyro-arc__tick"},g.id))}),(0,f.jsx)("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:(0,f.jsx)("circle",{cx:150,cy:150,r:100,fill:"none",stroke:k?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:k?3.5:2.5,className:p?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}s(G,"x");u(G,"CaptureArc");function ne({videoRef:r,guidanceText:e,guidanceHint:t,guidanceKey:n,progress:o,phase:i,draining:y=!1,stillUrl:d,showChecking:m,operatorText:p=null,voicePrompt:k,overlay:S,reduceMotion:g=!1,modeSwitch:x=null}){let b=I(),w=i==="checking",_=w||i==="frozen",A=_&&m?b("capture.checking"):e,L=k?.(t,A,n);return(0,a.jsxs)("div",{className:g?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[(0,a.jsx)("video",{ref:r,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),d!==null&&_?(0,a.jsx)("img",{src:d,alt:b("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,(0,a.jsx)(G,{progress:o,phase:i,draining:y}),S?.(r),L!=null&&!_?(0,a.jsx)("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:L}):null,x!==null&&!_?(0,a.jsx)($,{view:x,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,w&&m?(0,a.jsxs)("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[(0,a.jsx)(Y,{}),b("capture.cameraOff")]}):null,(0,a.jsxs)("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[(0,a.jsx)("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:A},A),_&&m?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint",children:b("capture.checkingHint")}):p!==null&&!_?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}s(ne,"ne");u(ne,"CaptureStage");function $({view:r,className:e,kind:t}){let n=(0,z.useId)(),o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K,{}),(0,a.jsx)("span",{children:r.label})]}),i={onClick:r.onSwitch,"aria-describedby":n,"data-testid":"sekyro-capture-mode-switch","data-mode":r.to};return(0,a.jsxs)(a.Fragment,{children:[t==="chip"?(0,a.jsx)(H,{kind:"chip",className:e,...i,children:o}):(0,a.jsx)("button",{type:"button",className:e,...i,children:o}),(0,a.jsx)("span",{id:n,className:"sekyro-visually-hidden",children:r.description})]})}s($,"H");u($,"ModeSwitchChip");function K(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),(0,a.jsx)("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}s(K,"D");u(K,"FlipCameraIcon");function Y(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon sekyro-icon--sm",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M3 3l18 18"})]})}s(Y,"G");u(Y,"CameraOffIcon");var ie=typeof window>"u"?E.useEffect:E.useLayoutEffect,R="data-sekyro-ramp",se=[["background-color","transparent"],["background-image","none"]];function q(r){let e=[],t=r.ownerDocument;for(let i=r;i!==null&&i!==t.documentElement;i=i.parentElement){if(!(i instanceof HTMLElement)&&!(i instanceof SVGElement))continue;let y=i.style;for(let[d,m]of se){let p=y.getPropertyValue(d),k=y.getPropertyPriority(d);y.setProperty(d,m,"important"),e.push(()=>{p===""?y.removeProperty(d):y.setProperty(d,p,k)})}}let n=t.documentElement,o=n.hasAttribute(R);return n.setAttribute(R,""),o||e.push(()=>n.removeAttribute(R)),()=>{for(let i of e.reverse())i()}}s(q,"z");u(q,"clearAncestorBackdrops");function X(r){return{position:"fixed",inset:0,minWidth:"100vw",minHeight:"100lvh",margin:0,padding:0,border:0,zIndex:-1,pointerEvents:"none",backgroundColor:T(r)}}s(X,"B");u(X,"washStyle");function J(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:T(r)}}s(J,"Y");u(J,"coverStyle");function oe({colour:r}){let e=(0,E.useRef)(null),t=r!==null;return ie(()=>{let n=e.current?.parentElement;if(!(!t||n===null||n===void 0))return q(n)},[t]),r===null||typeof document>"u"?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{ref:e,"aria-hidden":"true","data-testid":"sekyro-screen-ramp-cover","data-colour":r,style:J(r)}),(0,Z.createPortal)((0,v.jsx)("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":r,style:X(r)}),document.body)]})}s(oe,"de");u(oe,"ScreenRampLayer");export{W as a,ne as b,$ as c,oe as d};
1
+ import{d as I}from"./chunk-UYEEBLOW.js";import{a as C,b as P,c as H}from"./chunk-5H2LBGA7.js";import{a as T}from"./chunk-JPREVWIF.js";import{a as u}from"./chunk-5QL6W6FW.js";import{a as s,b as D,c as N}from"./chunk-4FHWXBOB.js";var j=D(l=>{"use strict";var Q=C();function V(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}s(V,"formatProdErrorMessage");function h(){}s(h,"noop");var c={d:{f:h,r:s(function(){throw Error(V(522))},"r"),D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},ee=Symbol.for("react.portal");function re(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ee,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}s(re,"createPortal$1");var O=Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function M(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}s(M,"getCrossOriginStringAs");l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c;l.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(V(299));return re(r,e,null,t)};l.flushSync=function(r){var e=O.T,t=c.p;try{if(O.T=null,c.p=2,r)return r()}finally{O.T=e,c.p=t,c.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,c.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&c.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin),o=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?c.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:o,fetchPriority:i}):t==="script"&&c.d.X(r,{crossOrigin:n,integrity:o,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=M(e.as,e.crossOrigin);c.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&c.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin);c.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=M(e.as,e.crossOrigin);c.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else c.d.m(r)};l.requestFormReset=function(r){c.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,t){return O.H.useFormState(r,e,t)};l.useFormStatus=function(){return O.H.useHostTransitionStatus()};l.version="19.2.0"});var W=D((de,B)=>{"use strict";function U(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U)}catch(r){console.error(r)}}s(U,"checkDCE");U(),B.exports=j()});var z=N(C(),1),f=N(P(),1),a=N(P(),1);var E=N(C(),1),Z=N(W(),1),v=N(P(),1);var te=Array.from({length:56},(r,e)=>{let t=e/56*2*Math.PI-Math.PI/2,n=Math.cos(t),o=Math.sin(t);return{id:`tick-${e}`,frac:e/55,x1:150+108*n,y1:150+108*o,x2:150+138*n,y2:150+138*o,style:{transitionDelay:`${e*6}ms`}}});function F(r,e,t,n){return t?"var(--sekyro-color-success)":r?n?"color-mix(in srgb, var(--sekyro-color-warning) 75%, transparent)":e<.33?"color-mix(in srgb, var(--sekyro-color-brand) 55%, transparent)":e<.66?"color-mix(in srgb, var(--sekyro-color-brand) 80%, transparent)":"var(--sekyro-color-brand)":"color-mix(in srgb, var(--sekyro-color-surface) 32%, transparent)"}s(F,"T");u(F,"tickColor");var ae="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function G({progress:r,phase:e,draining:t=!1}){let n=Math.min(1,Math.max(0,r)),o=Math.round(n*56),i=e==="checking",y=e==="recording",d=e==="frozen",m=i||d,p=i||y||d,k=e==="locked"||p,S=t&&!k;return(0,f.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 300 300",preserveAspectRatio:"xMidYMid meet",className:"sekyro-stage__arc","data-testid":"sekyro-capture-arc","data-phase":e,"data-filled":o,"data-recording":y?"":void 0,"data-draining":S?"":void 0,children:[(0,f.jsx)("path",{fillRule:"evenodd",d:ae,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":m?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),(0,f.jsxs)("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[(0,f.jsx)("g",{className:m?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:te.map((g,x)=>(0,f.jsx)("line",{x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:F(x<o,g.frac,k,S),strokeWidth:3,strokeLinecap:"round",style:g.style,className:"sekyro-arc__tick"},g.id))}),(0,f.jsx)("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:(0,f.jsx)("circle",{cx:150,cy:150,r:100,fill:"none",stroke:k?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:k?3.5:2.5,className:p?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}s(G,"x");u(G,"CaptureArc");function ne({videoRef:r,guidanceText:e,guidanceHint:t,guidanceKey:n,progress:o,phase:i,draining:y=!1,stillUrl:d,showChecking:m,operatorText:p=null,voicePrompt:k,overlay:S,reduceMotion:g=!1,modeSwitch:x=null}){let b=I(),w=i==="checking",_=w||i==="frozen",A=_&&m?b("capture.checking"):e,L=k?.(t,A,n);return(0,a.jsxs)("div",{className:g?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[(0,a.jsx)("video",{ref:r,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),d!==null&&_?(0,a.jsx)("img",{src:d,alt:b("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,(0,a.jsx)(G,{progress:o,phase:i,draining:y}),S?.(r),L!=null&&!_?(0,a.jsx)("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:L}):null,x!==null&&!_?(0,a.jsx)($,{view:x,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,w&&m?(0,a.jsxs)("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[(0,a.jsx)(Y,{}),b("capture.cameraOff")]}):null,(0,a.jsxs)("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[(0,a.jsx)("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:A},A),_&&m?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint",children:b("capture.checkingHint")}):p!==null&&!_?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}s(ne,"ne");u(ne,"CaptureStage");function $({view:r,className:e,kind:t}){let n=(0,z.useId)(),o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K,{}),(0,a.jsx)("span",{children:r.label})]}),i={onClick:r.onSwitch,"aria-describedby":n,"data-testid":"sekyro-capture-mode-switch","data-mode":r.to};return(0,a.jsxs)(a.Fragment,{children:[t==="chip"?(0,a.jsx)(H,{kind:"chip",className:e,...i,children:o}):(0,a.jsx)("button",{type:"button",className:e,...i,children:o}),(0,a.jsx)("span",{id:n,className:"sekyro-visually-hidden",children:r.description})]})}s($,"H");u($,"ModeSwitchChip");function K(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),(0,a.jsx)("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}s(K,"D");u(K,"FlipCameraIcon");function Y(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon sekyro-icon--sm",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M3 3l18 18"})]})}s(Y,"G");u(Y,"CameraOffIcon");var ie=typeof window>"u"?E.useEffect:E.useLayoutEffect,R="data-sekyro-ramp",se=[["background-color","transparent"],["background-image","none"]];function q(r){let e=[],t=r.ownerDocument;for(let i=r;i!==null&&i!==t.documentElement;i=i.parentElement){if(!(i instanceof HTMLElement)&&!(i instanceof SVGElement))continue;let y=i.style;for(let[d,m]of se){let p=y.getPropertyValue(d),k=y.getPropertyPriority(d);y.setProperty(d,m,"important"),e.push(()=>{p===""?y.removeProperty(d):y.setProperty(d,p,k)})}}let n=t.documentElement,o=n.hasAttribute(R);return n.setAttribute(R,""),o||e.push(()=>n.removeAttribute(R)),()=>{for(let i of e.reverse())i()}}s(q,"z");u(q,"clearAncestorBackdrops");function X(r){return{position:"fixed",inset:0,minWidth:"100vw",minHeight:"100lvh",margin:0,padding:0,border:0,zIndex:-1,pointerEvents:"none",backgroundColor:T(r)}}s(X,"B");u(X,"washStyle");function J(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:T(r)}}s(J,"Y");u(J,"coverStyle");function oe({colour:r}){let e=(0,E.useRef)(null),t=r!==null;return ie(()=>{let n=e.current?.parentElement;if(!(!t||n===null||n===void 0))return q(n)},[t]),r===null||typeof document>"u"?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{ref:e,"aria-hidden":"true","data-testid":"sekyro-screen-ramp-cover","data-colour":r,style:J(r)}),(0,Z.createPortal)((0,v.jsx)("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":r,style:X(r)}),document.body)]})}s(oe,"de");u(oe,"ScreenRampLayer");export{W as a,ne as b,$ as c,oe as d};
2
2
  /*! Bundled license information:
3
3
 
4
4
  react-dom/cjs/react-dom.production.js:
@@ -1 +1 @@
1
- import{g as X}from"./chunk-VQSFTT4B.js";import{a as z,b as ee}from"./chunk-IHKI3APK.js";import{a as n}from"./chunk-5QL6W6FW.js";import{a,c as Z}from"./chunk-4FHWXBOB.js";var u=Z(z(),1),J=Z(z(),1),s=Z(ee(),1);var h=Z(ee(),1);var he="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",j;function Q(e){return j??(j=new Map(he.split(" ").map(l=>{let[r,t]=l.slice(2).split("/");return[l.slice(0,2),[r,t]]}))),j.get(e.toUpperCase())}a(Q,"z");n(Q,"entryOf");function pe(e){return Q(e)?.[0]}a(pe,"Ne");n(pe,"dialCodeOf");function ne(e){return Q(e)?.[1]}a(ne,"ee");n(ne,"nationalPrefixOf");var le=n(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold");function ae(e,l){let r=le(l.trim());return r===""?e:e.filter(t=>le(t.name).includes(r)||t.code.toLowerCase()===r)}a(ae,"ce");n(ae,"matchCountries");function oe({countries:e,label:l,searchPlaceholder:r,noMatch:t,onPick:v,selected:P,searchRef:f,scroll:E=!1,searchable:w=!0,detail:D,extra:y}){let[M,b]=(0,J.useState)(""),c=(0,J.useId)(),T=ae(e,M),N=(0,s.jsxs)("ul",{className:`sekyro-rows${E?" sekyro-rows--scroll":""}`,children:[T.map(d=>{let S=D?.(d.code);return(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"sekyro-row-btn","aria-current":P===d.code||void 0,onClick:a(()=>v(d.code),"onClick"),children:[(0,s.jsx)("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:ce(d.code)}),(0,s.jsx)("span",{className:"sekyro-row-btn__name",children:d.name}),S!==void 0?(0,s.jsx)("bdi",{className:"sekyro-row-btn__detail",dir:"ltr",children:S}):null]})},d.code)}),y!==void 0?(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"sekyro-row-btn","aria-current":y.current||void 0,onClick:y.onPick,children:[(0,s.jsx)("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:"🌐"}),(0,s.jsx)("span",{className:"sekyro-row-btn__name",children:y.label})]})}):null]});return w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"sekyro-field",children:[(0,s.jsx)("label",{className:"sekyro-label",htmlFor:c,children:l}),(0,s.jsx)("input",{ref:f,id:c,type:"search",className:"sekyro-input",placeholder:r,value:M,onChange:a(d=>b(d.target.value),"onChange")})]}),T.length===0&&y===void 0?(0,s.jsx)("p",{className:"sekyro-text-muted",children:t}):N]}):N}a(oe,"te");n(oe,"CountryList");function U(e){let l=X(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${l}`:l.startsWith("00")?`+${l.slice(2)}`:l}a(U,"H");n(U,"digitsOf");var te=n((e,l)=>(l.trunk!==void 0&&e.startsWith(l.trunk)?e.slice(l.trunk.length):e).slice(0,Math.max(...l.lengths)),"fitDigits");function Y(e,l){let r="",t=0;for(let v of l?.formats?.find(P=>new RegExp(`^(?:${P.leading})`).test(e))?.groups??[])t<e.length&&(r+=(t>0?" ":"")+e.slice(t,t+v)),t+=v;return r+e.slice(t)}a(Y,"Z");n(Y,"groupDigits");function ie(e,l){let r=0;for(let t=l;t>0&&r<e.length;r+=1)e[r]!==" "&&(t-=1);return r}a(ie,"oe");n(ie,"caretAfter");var se=n((e,l)=>l.find(r=>e.startsWith(r.dial)),"countryOfNumber"),me=n((e,l)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${l} $1`),"lengthsLabel");function q(e){let l=U(e).replace("+","");return/^\d{8,15}$/.test(l)?`+${l}`:null}a(q,"le");n(q,"normalizedPhone");var ce=n(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),l=>127397+l.charCodeAt(0))),"flagOf");function de(e,l){if(l===null||!e.startsWith(l.dial))return q(e);let r=e.slice(l.dial.length).replace(/\D/g,""),t=ne(l.code);return t!==void 0&&r.startsWith(t)&&(r=r.slice(t.length)),q(l.dial+r)}a(de,"ye");n(de,"e164Of");var re=n((e,l)=>(se(e,l)??l[0])?.code??null,"countryFor");function ue(e){let l=null;try{l=new Intl.DisplayNames([e],{type:"region"})}catch{}return r=>`${l?.of(r.code)??r.code} (${r.dial})`}a(ue,"me");n(ue,"countryLabels");var fe="other",ye=8;function ge({countries:e,international:l,closed:r,defaultPhone:t}){let[v,P]=(0,u.useState)(()=>re(t,e)),[f,E]=(0,u.useState)(t),[w,D]=(0,u.useState)(!1),[y,M]=(0,u.useState)(!1),b=e.map(o=>o.code).join(","),c=e.find(o=>o.code===v)??null,T=(0,u.useRef)(c);c!==null&&(T.current=c),(0,u.useEffect)(()=>{if(v===null||!e.some(o=>o.code===v)){let o=re(t,e);P(o);let i=T.current,k=e.find(C=>C.code===o)?.dial;k!==void 0&&E(C=>i!==null&&C.startsWith(i.dial)?k+C.slice(i.dial.length):C.startsWith("+")?C:k)}},[b,t]);let N=w||c===null,d=N||f.startsWith("+")&&!f.startsWith(c.dial),S=d?void 0:c.rule,x=d?f:f.replace(c.dial,"").replace(/\D/g,""),p=S?te(x,S):x,W=d&&!N&&!l&&r&&!e.some(o=>o.dial.startsWith(f)),I=W?null:S?S.lengths.includes(p.length)?c.dial+p:null:N&&!f.startsWith("+")?null:de(f,w?null:c),H=d||c===null?I??f:`${c.dial} ${Y(p,S)}`,B=d?U(f).replace("+","")==="":p==="";return{countries:e,international:l,phone:f,selected:c,other:w,whole:d,free:N,rule:S,national:p,refused:W,typed:I,shown:H,empty:B,lengthShown:y,setLengthShown:M,onNumber:n(o=>{let i=o.target,k=o.nativeEvent.inputType,C=Math.max(0,i.value.lastIndexOf("+")),G=U(i.value.slice(C)),A=se(G,e),_=U(i.value.slice(C,i.selectionStart)).length,F=G,V=G;if(M(!1),!A&&(N||G.startsWith("+")))l&&D(!0);else{let R=A??c,g=A?G.slice(A.dial.length):G;if(P(R.code),D(!1),g===p&&k?.startsWith("delete")&&(k.endsWith("Forward")||(_-=1),g=g.slice(0,_)+g.slice(_+1)),R.rule){let $=te(g,R.rule),O=g.length-$.length;_-=O,g=O>0&&!A&&p.length===$.length?p:$}V=R.dial+g,F=Y(g,R.rule)}E(V),i.value=F;let K=ie(F,_);i.setSelectionRange(K,K)},"onNumber"),onCountry:n(o=>{M(!1);let i=e.find(k=>k.code===o);D(i===void 0),i!==void 0&&P(i.code),E(i===void 0?"":i.dial+(d?"":p))},"onCountry")}}a(ge,"_e");n(ge,"usePhoneField");function Ne({field:e,id:l,locale:r,t,inputRef:v,invalid:P=!1,describedby:f,required:E,compact:w=!1,ready:D}){let{selected:y,whole:M,other:b,free:c,national:T,rule:N,phone:d,refused:S,typed:x,countries:p,international:W}=e,[I,H]=(0,u.useState)(!1),B=(0,u.useRef)(null),o=(0,u.useRef)(null),i=(0,u.useRef)(null),k=(0,u.useRef)(null),C=v??k,G=(0,u.useId)(),A=S?t("otp.reason_otp_destination_not_allowed"):e.lengthShown&&N?t("otp.phoneLengthError",{digits:me(N,t("otp.or"))}):"",_=p.length>1||W,F=ue(r),V=(0,u.useMemo)(()=>{let m=null;try{m=new Intl.DisplayNames([r],{type:"region"})}catch{}return p.map(L=>({code:L.code,name:m?.of(L.code)??L.code}))},[p,r]),K=p.length>ye,R=[M?"":`${l}-dial ${l}-hint`,A?`${l}-error`:"",f??""].join(" ").trim()||void 0,g=n(m=>{H(!1),requestAnimationFrame(()=>(m==="lead"?B.current:C.current)?.focus())},"close"),$=n(()=>{if(I)return g("lead");H(!0),requestAnimationFrame(()=>(i.current??o.current?.querySelector('[aria-current="true"]')??o.current?.querySelector("button"))?.focus())},"toggle"),O=n(()=>(0,h.jsxs)("span",{className:"sekyro-phone__dial",id:`${l}-dial`,"aria-hidden":_||void 0,children:[(0,h.jsx)("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:b?"🌐":ce(y.code)}),b?null:y.dial]}),"dial");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:`sekyro-phone${w?" sekyro-phone--compact":""}`,dir:"ltr",children:[y===null||M&&!b?null:_?(0,h.jsx)("button",{ref:B,type:"button",className:"sekyro-phone__lead sekyro-phone__pick","aria-label":`${t("otp.countryLabel")}: ${b?t("otp.otherCountry"):F(y)}`,"aria-expanded":I,"aria-controls":I?G:void 0,onClick:$,children:O()}):(0,h.jsx)("div",{className:"sekyro-phone__lead",children:O()}),(0,h.jsx)("input",{ref:C,id:l,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",required:E,"aria-describedby":R,"aria-invalid":!!A||P||void 0,placeholder:c?"+":void 0,value:M?d:Y(T,N),onChange:e.onNumber,onKeyDown:a(m=>{m.key==="Enter"&&D===!1&&e.setLengthShown(!0)},"onKeyDown"),onBlur:a(m=>{let L=m.relatedTarget;L!==null&&(B.current?.contains(L)||o.current?.contains(L))||e.setLengthShown(T!==""&&x===null)},"onBlur")})]}),I?(0,h.jsx)("div",{ref:o,id:G,className:"sekyro-phone__list",onKeyDown:a(m=>{m.key==="Escape"&&(m.preventDefault(),g("lead"))},"onKeyDown"),children:(0,h.jsx)(oe,{countries:V,label:(0,h.jsx)("span",{className:"sekyro-visually-hidden",children:t("otp.countrySearch")}),searchPlaceholder:t("otp.countrySearch"),noMatch:t("doc.noCountryMatch"),searchable:K,scroll:!0,...K?{searchRef:i}:{},...!b&&y!==null?{selected:y.code}:{},detail:a(m=>p.find(L=>L.code===m)?.dial,"detail"),onPick:a(m=>{e.onCountry(m),g("number")},"onPick"),...W?{extra:{label:t("otp.otherCountry"),current:b,onPick:n(()=>{e.onCountry(fe),g("number")},"onPick")}}:{}})}):null,M?null:(0,h.jsx)("span",{className:"sekyro-help",id:`${l}-hint`,children:t("otp.phonePlaceholderGeneric")}),A?(0,h.jsx)("span",{className:"sekyro-help is-danger",id:`${l}-error`,role:"alert",children:A}):null]})}a(Ne,"xe");n(Ne,"PhoneField");export{pe as a,oe as b,ce as c,ge as d,Ne as e};
1
+ import{g as X}from"./chunk-2RXQBUDC.js";import{a as z,b as ee}from"./chunk-5H2LBGA7.js";import{a as n}from"./chunk-5QL6W6FW.js";import{a,c as Z}from"./chunk-4FHWXBOB.js";var u=Z(z(),1),J=Z(z(),1),s=Z(ee(),1);var h=Z(ee(),1);var he="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",j;function Q(e){return j??(j=new Map(he.split(" ").map(l=>{let[r,t]=l.slice(2).split("/");return[l.slice(0,2),[r,t]]}))),j.get(e.toUpperCase())}a(Q,"z");n(Q,"entryOf");function pe(e){return Q(e)?.[0]}a(pe,"Ne");n(pe,"dialCodeOf");function ne(e){return Q(e)?.[1]}a(ne,"ee");n(ne,"nationalPrefixOf");var le=n(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold");function ae(e,l){let r=le(l.trim());return r===""?e:e.filter(t=>le(t.name).includes(r)||t.code.toLowerCase()===r)}a(ae,"ce");n(ae,"matchCountries");function oe({countries:e,label:l,searchPlaceholder:r,noMatch:t,onPick:v,selected:P,searchRef:f,scroll:E=!1,searchable:w=!0,detail:D,extra:y}){let[M,b]=(0,J.useState)(""),c=(0,J.useId)(),T=ae(e,M),N=(0,s.jsxs)("ul",{className:`sekyro-rows${E?" sekyro-rows--scroll":""}`,children:[T.map(d=>{let S=D?.(d.code);return(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"sekyro-row-btn","aria-current":P===d.code||void 0,onClick:a(()=>v(d.code),"onClick"),children:[(0,s.jsx)("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:ce(d.code)}),(0,s.jsx)("span",{className:"sekyro-row-btn__name",children:d.name}),S!==void 0?(0,s.jsx)("bdi",{className:"sekyro-row-btn__detail",dir:"ltr",children:S}):null]})},d.code)}),y!==void 0?(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"sekyro-row-btn","aria-current":y.current||void 0,onClick:y.onPick,children:[(0,s.jsx)("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:"🌐"}),(0,s.jsx)("span",{className:"sekyro-row-btn__name",children:y.label})]})}):null]});return w?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"sekyro-field",children:[(0,s.jsx)("label",{className:"sekyro-label",htmlFor:c,children:l}),(0,s.jsx)("input",{ref:f,id:c,type:"search",className:"sekyro-input",placeholder:r,value:M,onChange:a(d=>b(d.target.value),"onChange")})]}),T.length===0&&y===void 0?(0,s.jsx)("p",{className:"sekyro-text-muted",children:t}):N]}):N}a(oe,"te");n(oe,"CountryList");function U(e){let l=X(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${l}`:l.startsWith("00")?`+${l.slice(2)}`:l}a(U,"H");n(U,"digitsOf");var te=n((e,l)=>(l.trunk!==void 0&&e.startsWith(l.trunk)?e.slice(l.trunk.length):e).slice(0,Math.max(...l.lengths)),"fitDigits");function Y(e,l){let r="",t=0;for(let v of l?.formats?.find(P=>new RegExp(`^(?:${P.leading})`).test(e))?.groups??[])t<e.length&&(r+=(t>0?" ":"")+e.slice(t,t+v)),t+=v;return r+e.slice(t)}a(Y,"Z");n(Y,"groupDigits");function ie(e,l){let r=0;for(let t=l;t>0&&r<e.length;r+=1)e[r]!==" "&&(t-=1);return r}a(ie,"oe");n(ie,"caretAfter");var se=n((e,l)=>l.find(r=>e.startsWith(r.dial)),"countryOfNumber"),me=n((e,l)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${l} $1`),"lengthsLabel");function q(e){let l=U(e).replace("+","");return/^\d{8,15}$/.test(l)?`+${l}`:null}a(q,"le");n(q,"normalizedPhone");var ce=n(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),l=>127397+l.charCodeAt(0))),"flagOf");function de(e,l){if(l===null||!e.startsWith(l.dial))return q(e);let r=e.slice(l.dial.length).replace(/\D/g,""),t=ne(l.code);return t!==void 0&&r.startsWith(t)&&(r=r.slice(t.length)),q(l.dial+r)}a(de,"ye");n(de,"e164Of");var re=n((e,l)=>(se(e,l)??l[0])?.code??null,"countryFor");function ue(e){let l=null;try{l=new Intl.DisplayNames([e],{type:"region"})}catch{}return r=>`${l?.of(r.code)??r.code} (${r.dial})`}a(ue,"me");n(ue,"countryLabels");var fe="other",ye=8;function ge({countries:e,international:l,closed:r,defaultPhone:t}){let[v,P]=(0,u.useState)(()=>re(t,e)),[f,E]=(0,u.useState)(t),[w,D]=(0,u.useState)(!1),[y,M]=(0,u.useState)(!1),b=e.map(o=>o.code).join(","),c=e.find(o=>o.code===v)??null,T=(0,u.useRef)(c);c!==null&&(T.current=c),(0,u.useEffect)(()=>{if(v===null||!e.some(o=>o.code===v)){let o=re(t,e);P(o);let i=T.current,k=e.find(C=>C.code===o)?.dial;k!==void 0&&E(C=>i!==null&&C.startsWith(i.dial)?k+C.slice(i.dial.length):C.startsWith("+")?C:k)}},[b,t]);let N=w||c===null,d=N||f.startsWith("+")&&!f.startsWith(c.dial),S=d?void 0:c.rule,x=d?f:f.replace(c.dial,"").replace(/\D/g,""),p=S?te(x,S):x,W=d&&!N&&!l&&r&&!e.some(o=>o.dial.startsWith(f)),I=W?null:S?S.lengths.includes(p.length)?c.dial+p:null:N&&!f.startsWith("+")?null:de(f,w?null:c),H=d||c===null?I??f:`${c.dial} ${Y(p,S)}`,B=d?U(f).replace("+","")==="":p==="";return{countries:e,international:l,phone:f,selected:c,other:w,whole:d,free:N,rule:S,national:p,refused:W,typed:I,shown:H,empty:B,lengthShown:y,setLengthShown:M,onNumber:n(o=>{let i=o.target,k=o.nativeEvent.inputType,C=Math.max(0,i.value.lastIndexOf("+")),G=U(i.value.slice(C)),A=se(G,e),_=U(i.value.slice(C,i.selectionStart)).length,F=G,V=G;if(M(!1),!A&&(N||G.startsWith("+")))l&&D(!0);else{let R=A??c,g=A?G.slice(A.dial.length):G;if(P(R.code),D(!1),g===p&&k?.startsWith("delete")&&(k.endsWith("Forward")||(_-=1),g=g.slice(0,_)+g.slice(_+1)),R.rule){let $=te(g,R.rule),O=g.length-$.length;_-=O,g=O>0&&!A&&p.length===$.length?p:$}V=R.dial+g,F=Y(g,R.rule)}E(V),i.value=F;let K=ie(F,_);i.setSelectionRange(K,K)},"onNumber"),onCountry:n(o=>{M(!1);let i=e.find(k=>k.code===o);D(i===void 0),i!==void 0&&P(i.code),E(i===void 0?"":i.dial+(d?"":p))},"onCountry")}}a(ge,"_e");n(ge,"usePhoneField");function Ne({field:e,id:l,locale:r,t,inputRef:v,invalid:P=!1,describedby:f,required:E,compact:w=!1,ready:D}){let{selected:y,whole:M,other:b,free:c,national:T,rule:N,phone:d,refused:S,typed:x,countries:p,international:W}=e,[I,H]=(0,u.useState)(!1),B=(0,u.useRef)(null),o=(0,u.useRef)(null),i=(0,u.useRef)(null),k=(0,u.useRef)(null),C=v??k,G=(0,u.useId)(),A=S?t("otp.reason_otp_destination_not_allowed"):e.lengthShown&&N?t("otp.phoneLengthError",{digits:me(N,t("otp.or"))}):"",_=p.length>1||W,F=ue(r),V=(0,u.useMemo)(()=>{let m=null;try{m=new Intl.DisplayNames([r],{type:"region"})}catch{}return p.map(L=>({code:L.code,name:m?.of(L.code)??L.code}))},[p,r]),K=p.length>ye,R=[M?"":`${l}-dial ${l}-hint`,A?`${l}-error`:"",f??""].join(" ").trim()||void 0,g=n(m=>{H(!1),requestAnimationFrame(()=>(m==="lead"?B.current:C.current)?.focus())},"close"),$=n(()=>{if(I)return g("lead");H(!0),requestAnimationFrame(()=>(i.current??o.current?.querySelector('[aria-current="true"]')??o.current?.querySelector("button"))?.focus())},"toggle"),O=n(()=>(0,h.jsxs)("span",{className:"sekyro-phone__dial",id:`${l}-dial`,"aria-hidden":_||void 0,children:[(0,h.jsx)("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:b?"🌐":ce(y.code)}),b?null:y.dial]}),"dial");return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("div",{className:`sekyro-phone${w?" sekyro-phone--compact":""}`,dir:"ltr",children:[y===null||M&&!b?null:_?(0,h.jsx)("button",{ref:B,type:"button",className:"sekyro-phone__lead sekyro-phone__pick","aria-label":`${t("otp.countryLabel")}: ${b?t("otp.otherCountry"):F(y)}`,"aria-expanded":I,"aria-controls":I?G:void 0,onClick:$,children:O()}):(0,h.jsx)("div",{className:"sekyro-phone__lead",children:O()}),(0,h.jsx)("input",{ref:C,id:l,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",required:E,"aria-describedby":R,"aria-invalid":!!A||P||void 0,placeholder:c?"+":void 0,value:M?d:Y(T,N),onChange:e.onNumber,onKeyDown:a(m=>{m.key==="Enter"&&D===!1&&e.setLengthShown(!0)},"onKeyDown"),onBlur:a(m=>{let L=m.relatedTarget;L!==null&&(B.current?.contains(L)||o.current?.contains(L))||e.setLengthShown(T!==""&&x===null)},"onBlur")})]}),I?(0,h.jsx)("div",{ref:o,id:G,className:"sekyro-phone__list",onKeyDown:a(m=>{m.key==="Escape"&&(m.preventDefault(),g("lead"))},"onKeyDown"),children:(0,h.jsx)(oe,{countries:V,label:(0,h.jsx)("span",{className:"sekyro-visually-hidden",children:t("otp.countrySearch")}),searchPlaceholder:t("otp.countrySearch"),noMatch:t("doc.noCountryMatch"),searchable:K,scroll:!0,...K?{searchRef:i}:{},...!b&&y!==null?{selected:y.code}:{},detail:a(m=>p.find(L=>L.code===m)?.dial,"detail"),onPick:a(m=>{e.onCountry(m),g("number")},"onPick"),...W?{extra:{label:t("otp.otherCountry"),current:b,onPick:n(()=>{e.onCountry(fe),g("number")},"onPick")}}:{}})}):null,M?null:(0,h.jsx)("span",{className:"sekyro-help",id:`${l}-hint`,children:t("otp.phonePlaceholderGeneric")}),A?(0,h.jsx)("span",{className:"sekyro-help is-danger",id:`${l}-error`,role:"alert",children:A}):null]})}a(Ne,"xe");n(Ne,"PhoneField");export{pe as a,oe as b,ce as c,ge as d,Ne as e};
@@ -1 +1 @@
1
- import{F as t,G as a,a as i}from"./chunk-XYXBZEKH.js";import{a as n}from"./chunk-5QL6W6FW.js";import{a as o}from"./chunk-4FHWXBOB.js";function d(r,c){if(r instanceof t)return r.field==="phone"?"otp.phoneInvalid":r.field==="code"?"otp.codeInvalid":r.kind==="check_digit"?"population.reason_id_number_invalid":"population.invalid";if(r instanceof a&&r.field==="channel")return"otp.reason_otp_channel_unavailable";if(r instanceof i){if(r.code==="attestation_invalid"&&r.details?.browserCheck==="clock_wrong")return"errors.device_clock";let e=`errors.${r.code}`;if(Object.hasOwn(c,e))return e}return"errors.network_error"}o(d,"d");n(d,"errorKey");export{d as a};
1
+ import{F as t,G as a,a as i}from"./chunk-B737CEIX.js";import{a as n}from"./chunk-5QL6W6FW.js";import{a as o}from"./chunk-4FHWXBOB.js";function d(r,c){if(r instanceof t)return r.field==="phone"?"otp.phoneInvalid":r.field==="code"?"otp.codeInvalid":r.kind==="check_digit"?"population.reason_id_number_invalid":"population.invalid";if(r instanceof a&&r.field==="channel")return"otp.reason_otp_channel_unavailable";if(r instanceof i){if(r.code==="attestation_invalid"&&r.details?.browserCheck==="clock_wrong")return"errors.device_clock";let e=`errors.${r.code}`;if(Object.hasOwn(c,e))return e}return"errors.network_error"}o(d,"d");n(d,"errorKey");export{d as a};
@@ -0,0 +1,3 @@
1
+ import{A as ot,B as st,C as lt,H as ve,I as oe,J as ut,K as ct,L as dt,a as G,b as We,c as Je,f as Ye,g as Qe,h as Xe,i as et,j as he,k as tt,m as K,o as N,p as L,q as J,r as ae,s as D,t as ye,v as nt,w as rt,x as it,y as at}from"./chunk-B737CEIX.js";import{g as ft}from"./chunk-JPREVWIF.js";import{b as Ze}from"./chunk-TV7CW7VL.js";import{b as ze,c as me,e as pt}from"./chunk-6MYG4HWP.js";import{a as t}from"./chunk-4FHWXBOB.js";function Vt(n){let a=n.now??(()=>Date.now()),f=n.setTimer??((w,u)=>setTimeout(w,u)),p=n.clearTimer??(w=>clearTimeout(w)),A=null,M=!1,g=!1,x=!1,B=0,P=null,C=t(()=>{P!==null&&p(P),P=null},"_"),T=t(()=>{let w=n.armRamp;w===void 0||M||g||x||a()<B||(M=!0,w().catch(()=>{}).then(u=>{if(M=!1,!x){if(u===void 0){B=a()+2e3;return}if(u.challenge===void 0){g=!0;return}A={challenge:u.challenge,expiresAt:u.expiresAt},C(),P=f(()=>{P=null,!x&&A!==null&&n.waiting()&&T()},Math.max(1e3,u.expiresAt-a()-2e4))}}))},"x");return{arm(){A!==null&&A.expiresAt-a()>2e4||T()},take(){let w=A;return A=null,C(),w!==null&&w.expiresAt-a()>=12e3?w.challenge:void 0},stop(){x=!0,A=null,C()}}}t(Vt,"Rt");function $t(n){return n.idNumberBound??n.nniBound}t($t,"he");function mt(n){return n===void 0?void 0:n.idNumberFromDocument??n.nniFromDocument}t(mt,"re");var yt="https://api.sekyro.ai",Ht=5e3,zt=24e4,vt=3e4,Zt=15e4,gt=9e4;function ht(n,a){return n==="portrait_icao"||n==="poa"||n==="doc_ocr"&&a.source==="upload"?gt:vt}t(ht,"Pt");var Wt=25*6e4,Jt=30*6e4,Nn=20*6e4,Yt=1,Qt=3e3,Xt=1500,en=10;function ge(n){return n instanceof Error&&n.name==="ChallengeError"&&n.code||"challenge_failed"}t(ge,"Ae");var _e=new Set(["aborted","embedder_opaque","site_key_rejected","clock_wrong"]);function tn(n){return new Promise(a=>setTimeout(a,n))}t(tn,"Rn");function nn(){let n=globalThis.crypto;if(n!==void 0&&typeof n.randomUUID=="function")return n.randomUUID();let a=new Uint8Array(16);if(n!==void 0&&typeof n.getRandomValues=="function")n.getRandomValues(a);else for(let p=0;p<16;p+=1)a[p]=Math.floor(Math.random()*256);a[6]=(a[6]??0)&15|64,a[8]=(a[8]??0)&63|128;let f=[...a].map(p=>p.toString(16).padStart(2,"0")).join("");return`${f.slice(0,8)}-${f.slice(8,12)}-${f.slice(12,16)}-${f.slice(16,20)}-${f.slice(20)}`}t(nn,"xn");function rn(n){return an(n,{})}t(rn,"jo");function an(n,a){let f=n.apiOrigin??yt,p=n.autoRetry??!0,A=n.rearm??"auto",M=a.client??new Je({apiOrigin:f,sessionToken:n.clientToken,fetch:n.fetch,locale:n.locale}),g=new Proxy(M,{get(e,r){if(r==="submitCheck")return Rt;let i=Reflect.get(e,r,e);return typeof i=="function"?i.bind(e):i}}),x=a.sleep??tn,B=a.uuid??nn,P=a.getChallengeToken??((e,r)=>import("./challenge-frame-LWDSKM5K-J3CNO3XT.js").then(i=>i.executeChallenge({frameUrl:e.url,siteKey:e.siteKey,action:"liveness",subject:r.subject,signal:r.signal,...n.locale!==void 0?{locale:n.locale}:{},...r.onInteractive!==void 0?{onInteractive:r.onInteractive}:{},...r.onRuns!==void 0?{onRuns:r.onRuns}:{}}))),C=pt(),T=null,w=null,u=!1,Ae=new AbortController,h=null,Y=null,Q=null,X=t(()=>Q??ut(h),"ae"),ee=t(()=>ct(oe(h),X()),"ue"),I=t(e=>{h=e,N(e)||It(e),C.emit("view",e),T?.onView(e)},"T"),b=t(()=>h!==null?Promise.resolve(h):(Y??(Y=g.getSession().then(e=>(I(e),e)).finally(()=>{Y=null})),Y),"M"),O=t(async()=>{let e=await g.getSession();return I(e),e},"V"),se=t(async(e,r)=>{e.plan!==void 0?I(e):await O()},"ge"),te=null,Me=t(async e=>{let r=await b();if(e||!r.consentRecorded){let i=await g.recordConsent(n.locale);i.plan!==void 0?I(i):h!==null&&I({...h,consentRecorded:!0})}z()&&re(r)},"Te"),E=t(e=>e?.force===!0?Me(!0):(te??(te=Me(!1).finally(()=>{te=null})),te),"L"),le={client:g,ensureConsent:t(e=>E(e),"ensureConsent"),sleep:x,uuid:B,...a.random!==void 0?{random:a.random}:{},onBusy:t(e=>{u||C.emit("busy",e)},"onBusy")},Ce=!1,Se=null,ue=t(e=>{if(e.status==="verified"||e.status==="not_verified"||e.status==="review"){if(Ce)return;Ce=!0}Se=JSON.stringify(e),C.emit("result",e)},"ke"),At=t(e=>{Se!==JSON.stringify(e)&&ue(e)},"$t"),xe=t(async e=>{let r=h;e&&(r=await O().catch(()=>h));let i=r===null?null:K(r);return i!==null&&!u&&C.emit("method",i),i!==null},"Fe"),ce=null,Te=!1,Ie=!1,Oe=t(()=>ot(le,(e,r)=>e.submitCheck("population_registry",{},{idempotencyKey:r})),"Ue"),Re=t(e=>$t(e)===!0||mt(J(e,"population_registry"))===!0,"Be"),Mt=t(async()=>{try{let e=await b();if(N(e)||K(e)!==null||L(e)?.checkType!=="population_registry")return;if(!Re(e)&&mt(J(e,"population_registry"))===void 0&&(e=await O()),!Re(e)){Ie=!0;return}await E(),await se(await Oe(),"population_registry");let r=h===null?void 0:J(h,"population_registry");if(r?.state==="input_required"&&r.reason==="registry_unavailable"&&tt(r)>0){if(await x(Ht),u)return;await se(await Oe(),"population_registry")}}catch(e){if(e instanceof G&&(e.code==="check_not_active"||e.code==="step_not_on_path")){await O().catch(()=>{});return}Te=!0;return}h!==null&&N(h)&&ue(ye(h,{autoRetry:p}))},"Qt"),Ee=t(()=>(ce??(ce=Mt()),ce),"qe"),S=a.now??Date.now,U=null,V,Ct=0,de=t((e,r)=>`${e.url}
2
+ ${e.siteKey}
3
+ ${r}`,"be"),Ne=0,$=0,ne,F=0,H=0,St=0,Pe=t(()=>{u||C.emit("browserCheck",{pending:H>0,...F>0?{interactive:!0}:{}})},"Ke"),pe=t((e,r)=>{Ne+=1;let i=S(),o=!1,s=!1,d=t(m=>{if(o===m)return;o=m,m&&(s=!0);let k=F>0;F=Math.max(0,F+(m?1:-1)),k!==F>0&&Pe()},"S");$+=1;let c=0,v=t(m=>{$+=c===0?Math.max(0,m-1):m,c+=m},"A"),l=P(e,{signal:Ae.signal,subject:r,onInteractive:d,onRuns:v}),y={key:de(e,r),at:i,token:l};return l.then(()=>{y.issuedAt=S(),d(!1),s&&!u&&q({check:"attestation",kind:"generic",engineKind:"interactive_passed",attempt:St++,challengeMs:S()-i,interactive:!0,checks:Math.min(50,$)})},m=>{let k=ge(m);if(y.failed=k,d(!1),u||k==="aborted")return;let{detail:ie,readyMs:Kt}=m;q({check:"attestation",kind:"unavailable",engineKind:k,attempt:Ct++,challengeMs:S()-i,readyMs:Kt,detail:ie,inApp:Ze(),...s?{interactive:!0}:{},checks:Math.min(50,$)})}),l.catch(()=>{}),y},"Ce"),Le=t((e,r)=>e!==null&&e.key===r&&(e.issuedAt===void 0||S()-e.issuedAt<zt),"je"),re=t((e,r={})=>{let i=e?.challenge??null;if(e===null||i===null||u)return;let o=ae(e.sessionId),s=U;(r.replaceFailed===!0&&s?.failed!==void 0&&!_e.has(s.failed)||!Le(s,de(i,o)))&&(U=pe(i,o))},"de"),De=t(e=>{let r=H>0;H=Math.max(0,H+e),r!==H>0&&Pe()},"Ye"),xt=t(async e=>{De(1);let r;try{let i=e.token.then(o=>({token:o}),o=>({error:ge(o)}));for(;;){let o=await Promise.race([i,new Promise(s=>{r=setTimeout(()=>s(void 0),Zt)})]);if(u)return{error:"aborted"};if(!(o===void 0&&F>0))return o}}finally{clearTimeout(r),De(-1)}},"Jt"),je=t(async(e,r,i)=>{let o=de(e,r),s=U;U=null;let d=Le(s,o)&&(s.failed===void 0||_e.has(s.failed))?s:pe(e,r),c=d===s?0:1,v,l=new Promise(y=>{v=setTimeout(()=>y("late"),i)});try{for(;;){let y=await Promise.race([d.token.then(m=>({token:m}),m=>({error:ge(m)})),l]);if(y==="late"){let m=u?void 0:await xt(d);return m===void 0?(!u&&U===null&&(U=d),{error:"timeout"}):("token"in m&&(ne=Math.max(0,Math.round((d.issuedAt??S())-d.at))),m)}if("token"in y)return ne=Math.max(0,Math.round((d.issuedAt??S())-d.at)),y;if(u||_e.has(y.error)||c>=Yt||c>0&&await Promise.race([x(Qt*c),l])==="late")return y;if(u)return{error:"aborted"};c+=1,d=pe(e,r)}}finally{clearTimeout(v)}},"We"),R=null,Tt=t(e=>R===null||S()-R>=e,"zt"),z=t(()=>Tt(Wt),"Z"),Ue=!1,Fe=null,It=t(e=>{let r=e.challenge?.provenMs;R===null&&typeof r=="number"&&r>0&&(R=S()-Math.max(0,Jt-r)),Ue||(Ue=!0,z()&&re(e));let i=L(e),o=i!==void 0&&(i.checkType==="phone_otp"||i.checkType==="email_otp")?`${i.checkType}:${he(e).indexOf(i)}`:null;o!==null&&o!==Fe&&(Fe=o,re(e))},"en"),Ot=t(e=>{let r=e.attestation;return typeof r?.turnstileToken=="string"&&r.turnstileToken.length>0},"tn"),qe=new Map,Ge=t(async e=>{let r=await b(),i=r.challenge;if(i==null||r.simulation!==void 0)return;let o=await je(i,ae(r.sessionId),e);if(!("token"in o))throw at(o.error);return o.token},"Xe"),Rt=t(async(e,r,i={})=>{let o=r;if("attestation"in o)try{let l=await M.submitCheck(e,r,i);return Ot(o)&&(R=S()),l}catch(l){throw l instanceof G&&l.code==="attestation_invalid"&&(R=null),l}let s=(e==="phone_otp"||e==="email_otp")&&o.action!=="verify",d=i.idempotencyKey,c=d!==void 0?qe.get(d):void 0;c===void 0&&(s||z())&&(c=await Ge(ht(e,o)),d!==void 0&&c!==void 0&&qe.set(d,c));let v=t((l,y)=>l!==void 0?{...y,browserCheckToken:l}:y,"A");try{let l=await M.submitCheck(e,r,v(c,i));return c!==void 0&&(R=S()),l}catch(l){if(!(l instanceof G)||l.code!=="attestation_invalid"||(R=null,c!==void 0))throw l;let y=await Ge(ht(e,o)),m=d!==void 0?{...i,idempotencyKey:B()}:i,k=await M.submitCheck(e,r,v(y,m));return y!==void 0&&(R=S()),k}},"nn"),Ke=t(async(e={})=>{if(V=void 0,e.always!==!0&&!z())return{};let r=await b(),i=r.challenge;if(i==null)return{};let o=e.always===!0?gt:vt,s=await je(i,ae(r.sessionId),o);if("token"in s)return{channel:"hosted_web",turnstileToken:s.token};if(V=s.error,r.simulation!==void 0&&e.always!==!0)return{channel:"hosted_web"};throw new it(s.error)},"Je"),Et=t(()=>V,"on"),Nt=t(()=>({checks:Math.min(50,Math.max(Ne,$)),...ne!==void 0?{challengeMs:Math.min(6e5,ne)}:{}}),"rn"),q=t(e=>{if(u)return;let r=g.reportCaptureIssue;if(r===void 0)return;let i=e.formFactor;try{i??(i=ze())}catch{}try{Promise.resolve(r.call(g,{...e,...i!==void 0?{formFactor:i}:{}})).catch(()=>{})}catch{}},"j"),_=null,Z=null,Be=new WeakMap,Ve=Promise.resolve(),W=0,Pt=t(async()=>{let e=await b();for(let r=0;r<en&&!u&&!N(e)&&L(e)===void 0&&he(e).some(i=>i.state==="processing")&&(await x(Xt),!u);r+=1)e=await O();return e},"sn"),Lt=t(async(e,r,i)=>{let{capture:o}=e,s=t(()=>u,"m"),d=t(()=>e.alive&&e.attempt===i,"S"),c=t(l=>{d()&&o.setFlowState(l)},"g"),v=t(l=>{if(!s()&&(l.status==="unavailable"&&l.reasonCode!==void 0&&!Ye(l.reasonCode)&&q({check:"liveness",kind:"unavailable",phase:"upload",engineKind:l.reasonCode,attempt:Math.max(0,e.issues.value)}),ue(l),!!d())){if(l.status==="retry"&&A==="auto"){o.handle.retry();return}o.setFlowState("done")}},"A");if(r.degraded==="NO_RECORDER"){let l=h?.sessionId??(await b().catch(()=>null))?.sessionId??"";v(D(l,"no_recorder"));return}c("uploading");try{if(await Ee(),s())return;let l=await b(),y;if(!N(l)&&K(l)!==null){await xe(!1),v(D(l.sessionId,"method_required"));return}if(!N(l)){if(L(l)?.checkType==="population_registry"){v(D(l.sessionId,Ie?"nni_unbound":Te?"network":"registry_unavailable"));return}if(await E(),s())return;y=h??l;let m=await st({...le,artifacts:r,getAttestation:Ke,attestationError:Et,attestationFacts:Nt,clipKeys:{get:t(()=>Be.get(r)??null,"get"),set:t(k=>{Be.set(r,k)},"set")},getView:t(()=>h??l,"getView"),refreshView:O,applySubmit:se,onPhase:c,isCancelled:s,onKeyframePromoted:t(k=>{w=k},"onKeyframePromoted")});if(s())return;if(m.kind==="unavailable"){m.reason==="attestation"&&(Z={bound:e,artifacts:r});let k=D(l.sessionId,m.reason),ie=m.reason==="attestation"?V:void 0;v(ie!==void 0?{...k,attestationError:ie}:k);return}if(m.kind==="resync"&&await O(),h!==null&&K(h)!==null){await xe(!1),v(D(l.sessionId,"method_required"));return}l=await Pt()}v(ye(l,{autoRetry:p,previous:y}))}catch{if(s())return;v(D(h?.sessionId??"","network"))}},"an"),$e=t((e,r)=>{let i=e.attempt;W>0&&e.alive&&e.capture.setFlowState("uploading"),W+=1,Ve=Ve.then(()=>Lt(e,r,i)).finally(()=>{W-=1,W===0&&T?.onChainIdle()}).catch(()=>{})},"tt"),He=t(e=>{_?.capture.handle.destroy(),_!==null&&(_.alive=!1,_.ramp.stop());let r=Vt({armRamp:typeof g.armRamp=="function"?()=>g.armRamp():void 0,waiting:t(()=>s.alive&&ee()==="self"&&(o.handle.state==="starting"||o.handle.state==="gating"),"waiting")}),i=Promise.resolve(),o=ft(e,T?.captureInternals?.(e)??a.capture,()=>h?.capture?.liveness?.keyframe?.rank===!0,ee,()=>r.take()??h?.capture?.liveness?.screenRamp,{session:t(()=>oe(h),"session"),onModeChange:t(c=>{Q=c},"onModeChange")}),s={capture:o,alive:!0,ramp:r,attempt:0,issues:Xe()};_=s,o.handle.on("error",c=>{q(Qe("liveness",c,s.issues.value))}),o.handle.on("state",c=>{if(s.issues.note(c),c==="starting"){s.attempt+=1,Z?.bound===s&&(Z=null),z()&&re(h,{replaceFailed:!0});let v=h===null?void 0:L(h)?.checkType;i=v==="liveness"||v==="face_match"?E().catch(()=>{}):Promise.resolve()}(c==="starting"||c==="gating")&&ee()==="self"&&i.then(()=>{s.alive&&r.arm()})}),o.handle.on("captured",c=>{Promise.resolve().then(()=>$e(s,c))});let d=o.handle;return{get state(){return d.state},get captureMode(){return d.captureMode},get facingMode(){return d.facingMode},on:t((c,v)=>d.on(c,v),"on"),start:t(async c=>{if(h===null&&await b().catch(()=>{}),!!s.alive)return d.start(c)},"start"),retry:t(()=>{let c=Z;if(c!==null&&c.bound===s&&s.alive){Z=null,$e(s,c.artifacts);return}d.retry()},"retry"),switchCamera:t(()=>d.switchCamera(),"switchCamera"),canSwitchCaptureMode:t(()=>d.canSwitchCaptureMode(),"canSwitchCaptureMode"),setCaptureMode:t(c=>d.setCaptureMode(c),"setCaptureMode"),destroy:t(()=>{s.alive=!1,r.stop(),_===s&&(_=null),d.destroy()},"destroy")}},"nt"),Dt=t(async()=>{if(u)return null;try{let e=await b();return u?null:K(e)}catch{return null}},"un"),jt=t(async()=>{if(u)return"self";try{let e=await b();if(u)return"self";let r=oe(e);return r==="choice"?X()??r:r}catch{return"self"}},"cn"),Ut=t(async()=>{if(u)return!1;try{let e=await b();return u||N(e)||me()?!1:ve(e,L(e))==="phone"||ve(e,J(e,"liveness"))==="phone"}catch{return!1}},"dn"),Ft=t(async()=>{if(u)return!1;try{let e=await b();return!u&&e.returning===!0}catch{return!1}},"ln"),qt=t(async e=>{let r=(await b()).plan?.choice,i=r?.options.find(s=>et[s.service]===e);if(!i)throw new RangeError(`method ${String(e)} is not offered`);let o=await g.choose(r.nodeId,i.id);u||I(o)},"pn"),fe=null,Gt=t(()=>(fe??(fe=import("./plan-runner-EY7VTTUP-RLLA2EQK.js").then(e=>{let r=e.createPlanRunner({runtime:le,currentView:t(()=>h,"currentView"),cameraMode:ee,captureModeSwitch:{pick:X,choose:t(i=>{Q=i},"choose")},ensureView:b,refreshView:O,ensureConsent:t(()=>E(),"ensureConsent"),liveness:He,stopLiveness:t(()=>{_!==null&&(_.alive=!1,_.ramp.stop(),_.capture.handle.destroy(),_=null)},"stopLiveness"),chainBusy:t(()=>W>0,"chainBusy"),destroyed:t(()=>u,"destroyed"),sleep:x,isMobile:me,now:a.now??Date.now,keptFaceKey:t(()=>w,"keptFaceKey"),setView:I,baseCapture:a.capture,emitStep:t(i=>{u||C.emit("step",i)},"emitStep"),emitResult:At,reportCaptureIssue:q,documentInternals:a.document,documentFacts:a.documentFacts,portraitInternals:a.portrait,livePhotoInternals:a.livePhoto,uploadInternals:a.upload,pageCameraInternals:a.pageCamera});return T=r,r})),fe),"fn");return{consent:t(()=>E(),"consent"),startRegistry:Ee,methodChoice:Dt,selectMethod:qt,reportCameraUnavailable:t(async e=>{await E();let r=g.reportCameraUnavailable;if(r===void 0)throw new TypeError("this client cannot report a missing camera");let i=await r.call(g,e).catch(o=>{if(o instanceof G&&o.code==="check_out_of_order")return g.getSession();throw o});u||I(i)},"reportCameraUnavailable"),reportCaptureIssue:q,testerGate:t(async e=>{let r=g.testerGate;if(r===void 0)throw new TypeError("this client cannot run the tester gate");let i=e.clip,o=We(e.clipMime??"");if(i===void 0||!rt.includes(o))throw new TypeError("the capture has no clip");await E();let s=await Ke({always:!0}),d=await nt(g,"clip",o,i.size,{engine:e.engine,durationMs:e.clipMs});await g.uploadToSpaces(d.uploadUrl,i,o);let{key:c}=await g.completeMedia(d.key),v=await r.call(g,{clipKey:c,attestation:s,captureChannel:e.captureChannel,capture:{...lt(e),attestationError:V}}),{bound:l,missReason:y,...m}=v;return u||(m.plan!==void 0?I(m):await O()),l===!0||y===void 0?{bound:l===!0}:{bound:!1,missReason:y}},"testerGate"),mobileRequired:Ut,captureMode:jt,chooseCaptureMode:t(e=>{Q=e},"chooseCaptureMode"),get captureChoice(){return X()},returning:Ft,liveness:He,run:t(async()=>{if(u)throw new Error("verification destroyed");return(await Gt()).run()},"run"),currentStep:t(()=>T?.current()??null,"currentStep"),voiceClips:t(async()=>{if(u)return null;try{let e=await b();return u?null:e.voice??null}catch{return null}},"voiceClips"),on:t((e,r)=>C.on(e,r),"on"),destroy:t(()=>{u=!0,Ae.abort(),T?.destroy(),_!==null&&(_.alive=!1,_.capture.handle.destroy(),_=null),C.clear()},"destroy")}}t(an,"Pn");var _t=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"],bt=["carte_identite","passport","residence_permit","drivers_license"],on=["carte_identite","passport","residence_permit"];function ke(n,a){let f=n.byIssuer?.[a]??n.default;return bt.filter(p=>f==="*"?on.includes(p):f.includes(p))}t(ke,"En");function kt(n,a=_t){return[...new Set([...a,...Object.keys(n.byIssuer??{})])].filter(f=>ke(n,f).length>0).sort()}t(kt,"Qo");var j={fullNameMin:2,fullName:200,email:254,occupation:120,shortText:120,longText:1e3,addressLine:120,addressLines:4,city:80,postcode:16,number:1e12,dateMin:"1900-01-01",dateMax:"2100-12-31",remoteOptions:30,remoteFilterAbove:12,remoteOther:120,remoteValue:128};function sn(n,a){let f=be(a);return f===""?[...n]:n.filter(p=>be([p.title,p.label,p.description].filter(Boolean).join(" ")).includes(f))}t(sn,"Jo");function be(n){return n.normalize("NFKD").replace(/[\u0300-\u036f\u064b-\u065f\u0670\u0640]/g,"").toLowerCase().replace(/\s+/g," ").trim()}t(be,"vt");var Pn={remote_choice:j.remoteOther,full_name:j.fullName,occupation:j.occupation,email:j.email,short_text:j.shortText,long_text:j.longText},wt=Object.freeze({nni_invalid:"id_number_invalid",nni_not_found:"registry_record_not_found",nni_recheck:"id_number_recheck",document_nni_mismatch:"document_id_number_mismatch",nni_locked:"id_number_locked",nni_unbound:"id_number_unbound",missing_nni:"missing_id_number",registry_needs_nni_source:"registry_needs_id_number_source"}),Ln=new Map(Object.entries(wt)),Dn=new Map(Object.entries(wt).map(([n,a])=>[a,n]));function ln(n,a){let f=Object.keys(n.names??{});if(f.length===1){let A=n.names?.[f[0]],M=A?.[a]??A?.en;if(M!==void 0&&M!=="")return M}if(f.length>1)return;let p=n.nationalEid?.providerName;return p!==void 0&&p!==""?p:void 0}t(ln,"pr");var jn=10*1024*1024;function Ar(n){if(n==="permission")return"denied";if(n==="notfound"||n==="insecure"||n==="unsupported")return"no_camera"}t(Ar,"Se");var un=/^[A-Z0-9][A-Z0-9 -]{0,39}$/,cn=Object.freeze({normalize:t(n=>n.trim().toUpperCase().replace(/\s+/g," "),"normalize"),check:t(n=>un.test(n),"check"),registrySources:Object.freeze([]),describe:"number must be 1 to 40 letters, digits, spaces or hyphens"}),dn=/^[A-Z0-9]{4,20}$/,we=t(n=>n.trim().toUpperCase().replace(/[\s-]+/g,""),"m"),pn=Object.freeze({normalize:we,check:t(n=>dn.test(we(n)),"check"),registrySources:Object.freeze([]),describe:"number must be 4 to 20 letters or digits"});function fn(n){return typeof n=="string"&&/^\d{10}$/.test(n)&&Number(n)%97===1}t(fn,"Re");var mn={trim:t(n=>n.trim(),"trim"),upper_single_space:t(n=>n.trim().toUpperCase().replace(/\s+/g," "),"upper_single_space"),upper_no_space_or_hyphen:we},hn={mr_nni_mod97:t(n=>fn(n),"mr_nni_mod97")};function yn(n){let a=new RegExp(n.pattern,"u"),f=n.check===null?void 0:hn[n.check];return Object.freeze({normalize:mn[n.normalize],check:t(p=>a.test(p.trim())&&(f===void 0||f(p)),"check"),registrySources:Object.freeze([...n.registrySources]),describe:n.describe})}t(yn,"Me");var vn=Object.freeze(Object.fromEntries(Object.entries(dt).map(([n,a])=>[n,yn(a)])));function gn(n,a){return vn[`${n.toUpperCase()}:${a}`]??(a==="drivers_license"?pn:cn)}t(gn,"C");var Mr=Object.freeze({JPN:"JP",MRT:"MR"});function Cr(n){return gn("MR","national_id").check(n)}t(Cr,"Oe");function _n(n){let a="";for(let f of n){let p=f.codePointAt(0)??0;p>=1632&&p<=1641?a+=String(p-1632):p>=1776&&p<=1785?a+=String(p-1776):f!==" "&&f!=="-"&&f!==" "&&(a+=f)}return a}t(_n,"H");function Sr(n){return _n(n)}t(Sr,"De");var xr=ke,Tr=kt;var bn=t(()=>import("./create-document-capture-R3H5TJD5-FZDYMF5Q.js"),"E");function kn(){bn().then(n=>n.warmDocumentCapture()).catch(()=>{})}t(kn,"O");function Ir(){kn()}t(Ir,"nt");var wn=t(()=>import("./create-portrait-capture-5VGYZUOK-KTCFCHTN.js"),"D");function An(){wn().then(n=>n.warmPortraitCapture()).catch(()=>{})}t(An,"L");function Or(){An()}t(Or,"ut");export{rn as a,j as b,sn as c,ln as d,Ar as e,Cr as f,Sr as g,xr as h,Tr as i,Ir as j,Or as k};
@@ -1 +1 @@
1
- import{d as U}from"./chunk-23W5VB46.js";import{E as C,I as H,a as Z,b as E,v as B}from"./chunk-IHKI3APK.js";import{a as d}from"./chunk-5QL6W6FW.js";import{a as N,c as R}from"./chunk-4FHWXBOB.js";var y=R(Z(),1),s=R(E(),1);var b=72;function P(c,t){let r=c*.72,a=r*1.32;return{cx:c/2,cy:(t-a)/2.1+a/2,a:r/2,b:a/2}}N(P,"B");d(P,"faceOval");function z({cx:c,cy:t,a:r,b:a}){return Array.from({length:b},(j,M)=>{let m=-Math.PI/2+M/b*2*Math.PI,h=Math.cos(m),i=Math.sin(m),u=c+r*h,f=t+a*i,k=Math.hypot(a*h,r*i),p=a*h/k,$=r*i/k,o=d(v=>Math.round(v*10)/10,"r");return`M${o(u+p*16)} ${o(f+$*16)}L${o(u+p*28)} ${o(f+$*28)}`})}N(z,"E");d(z,"ticks");function F({video:c,instruction:t,note:r,status:a,busy:j,progress:M,still:m,overlay:h,ramp:i,onClose:u,closeLabel:f,end:k,live:p=!0,children:$,testId:o}){C(p);let v=(0,y.useRef)(null),[l,A]=(0,y.useState)({w:0,h:0});(0,y.useLayoutEffect)(()=>{let x=v.current;if(x===null)return;let I=d(()=>A({w:x.clientWidth,h:x.clientHeight}),"measure");if(I(),typeof ResizeObserver>"u")return;let L=new ResizeObserver(I);return L.observe(x),()=>L.disconnect()},[]);let e=P(l.w,l.h),g=l.w>0?z(e):[],w=Math.round(Math.min(1,Math.max(0,M))*b),S=e.cy-e.b,n=Math.max(e.a,e.b)+40,O=70*Math.PI/180;return(0,s.jsx)("section",{className:"sekyro-lm sekyro-fc","aria-label":t,"data-testid":o,"data-ramp":i?"":void 0,children:(0,s.jsxs)("div",{ref:v,className:"sekyro-lm-stage",children:[c,m?(0,s.jsx)("img",{className:"sekyro-lm-video sekyro-fc-still",src:m,alt:""}):null,h,(0,s.jsx)(U,{colour:i??null}),l.w>0?(0,s.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${l.w} ${l.h}`,"aria-hidden":"true",focusable:"false",children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:"sekyro-fc-fade",gradientUnits:"userSpaceOnUse",x1:e.cx-n*Math.sin(O),y1:e.cy,x2:e.cx,y2:e.cy,children:[(0,s.jsx)("stop",{offset:"0",className:"sekyro-fc-fade",stopOpacity:"0"}),(0,s.jsx)("stop",{offset:"1",className:"sekyro-fc-fade"})]}),(0,s.jsx)("mask",{id:"sekyro-fc-light",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:l.w,height:l.h,children:(0,s.jsx)("path",{className:"sekyro-fc-sweep",style:{transformOrigin:`${e.cx}px ${e.cy}px`},d:`M${e.cx} ${e.cy}L${e.cx-n*Math.sin(O)} ${e.cy-n*Math.cos(O)}A${n} ${n} 0 0 1 ${e.cx} ${e.cy-n}Z`,fill:"url(#sekyro-fc-fade)"})})]}),(0,s.jsx)("path",{className:"sekyro-fc-scrim",fillRule:"evenodd",d:`M0 0H${l.w}V${l.h}H0Z M${e.cx-e.a} ${e.cy}a${e.a} ${e.b} 0 1 0 ${2*e.a} 0a${e.a} ${e.b} 0 1 0 ${-2*e.a} 0Z`}),(0,s.jsx)("ellipse",{className:"sekyro-fc-rim",cx:e.cx,cy:e.cy,rx:e.a,ry:e.b}),(0,s.jsx)("path",{className:"sekyro-fc-ticks",d:g.join("")}),w>0?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-done",d:g.slice(0,w).join("")}):null,w<b?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-light",d:g.join(""),mask:"url(#sekyro-fc-light)"}):null]}):null,(0,s.jsx)("div",{className:"sekyro-lm-instruction sekyro-fc-instruction",style:{insetBlockStart:S-80},children:(0,s.jsx)("div",{role:"status","aria-live":"polite",children:(0,s.jsx)(H,{swapKey:t,className:"sekyro-lm-line",children:t})})}),a!==void 0?(0,s.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-camera-status",children:a??""}):null,r?(0,s.jsxs)("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:S+2*e.b+48},children:[j?(0,s.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}):null,(0,s.jsx)("span",{children:r})]}):null,(0,s.jsxs)("div",{className:"sekyro-lm-controls",children:[(0,s.jsxs)("div",{className:"sekyro-lm-bar",children:[u!==void 0?(0,s.jsx)("button",{type:"button",className:"sekyro-glass","aria-label":f,onClick:u,children:(0,s.jsx)(B,{name:"close"})}):null,k]}),$]})]})})}N(F,"T");d(F,"FaceCamera");export{F as a};
1
+ import{d as U}from"./chunk-2IYNWMYV.js";import{E as C,I as H,a as Z,b as E,v as B}from"./chunk-5H2LBGA7.js";import{a as d}from"./chunk-5QL6W6FW.js";import{a as N,c as R}from"./chunk-4FHWXBOB.js";var y=R(Z(),1),s=R(E(),1);var b=72;function P(c,t){let r=c*.72,a=r*1.32;return{cx:c/2,cy:(t-a)/2.1+a/2,a:r/2,b:a/2}}N(P,"B");d(P,"faceOval");function z({cx:c,cy:t,a:r,b:a}){return Array.from({length:b},(j,M)=>{let m=-Math.PI/2+M/b*2*Math.PI,h=Math.cos(m),i=Math.sin(m),u=c+r*h,f=t+a*i,k=Math.hypot(a*h,r*i),p=a*h/k,$=r*i/k,o=d(v=>Math.round(v*10)/10,"r");return`M${o(u+p*16)} ${o(f+$*16)}L${o(u+p*28)} ${o(f+$*28)}`})}N(z,"E");d(z,"ticks");function F({video:c,instruction:t,note:r,status:a,busy:j,progress:M,still:m,overlay:h,ramp:i,onClose:u,closeLabel:f,end:k,live:p=!0,children:$,testId:o}){C(p);let v=(0,y.useRef)(null),[l,A]=(0,y.useState)({w:0,h:0});(0,y.useLayoutEffect)(()=>{let x=v.current;if(x===null)return;let I=d(()=>A({w:x.clientWidth,h:x.clientHeight}),"measure");if(I(),typeof ResizeObserver>"u")return;let L=new ResizeObserver(I);return L.observe(x),()=>L.disconnect()},[]);let e=P(l.w,l.h),g=l.w>0?z(e):[],w=Math.round(Math.min(1,Math.max(0,M))*b),S=e.cy-e.b,n=Math.max(e.a,e.b)+40,O=70*Math.PI/180;return(0,s.jsx)("section",{className:"sekyro-lm sekyro-fc","aria-label":t,"data-testid":o,"data-ramp":i?"":void 0,children:(0,s.jsxs)("div",{ref:v,className:"sekyro-lm-stage",children:[c,m?(0,s.jsx)("img",{className:"sekyro-lm-video sekyro-fc-still",src:m,alt:""}):null,h,(0,s.jsx)(U,{colour:i??null}),l.w>0?(0,s.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${l.w} ${l.h}`,"aria-hidden":"true",focusable:"false",children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:"sekyro-fc-fade",gradientUnits:"userSpaceOnUse",x1:e.cx-n*Math.sin(O),y1:e.cy,x2:e.cx,y2:e.cy,children:[(0,s.jsx)("stop",{offset:"0",className:"sekyro-fc-fade",stopOpacity:"0"}),(0,s.jsx)("stop",{offset:"1",className:"sekyro-fc-fade"})]}),(0,s.jsx)("mask",{id:"sekyro-fc-light",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:l.w,height:l.h,children:(0,s.jsx)("path",{className:"sekyro-fc-sweep",style:{transformOrigin:`${e.cx}px ${e.cy}px`},d:`M${e.cx} ${e.cy}L${e.cx-n*Math.sin(O)} ${e.cy-n*Math.cos(O)}A${n} ${n} 0 0 1 ${e.cx} ${e.cy-n}Z`,fill:"url(#sekyro-fc-fade)"})})]}),(0,s.jsx)("path",{className:"sekyro-fc-scrim",fillRule:"evenodd",d:`M0 0H${l.w}V${l.h}H0Z M${e.cx-e.a} ${e.cy}a${e.a} ${e.b} 0 1 0 ${2*e.a} 0a${e.a} ${e.b} 0 1 0 ${-2*e.a} 0Z`}),(0,s.jsx)("ellipse",{className:"sekyro-fc-rim",cx:e.cx,cy:e.cy,rx:e.a,ry:e.b}),(0,s.jsx)("path",{className:"sekyro-fc-ticks",d:g.join("")}),w>0?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-done",d:g.slice(0,w).join("")}):null,w<b?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-light",d:g.join(""),mask:"url(#sekyro-fc-light)"}):null]}):null,(0,s.jsx)("div",{className:"sekyro-lm-instruction sekyro-fc-instruction",style:{insetBlockStart:S-80},children:(0,s.jsx)("div",{role:"status","aria-live":"polite",children:(0,s.jsx)(H,{swapKey:t,className:"sekyro-lm-line",children:t})})}),a!==void 0?(0,s.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-camera-status",children:a??""}):null,r?(0,s.jsxs)("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:S+2*e.b+48},children:[j?(0,s.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}):null,(0,s.jsx)("span",{children:r})]}):null,(0,s.jsxs)("div",{className:"sekyro-lm-controls",children:[(0,s.jsxs)("div",{className:"sekyro-lm-bar",children:[u!==void 0?(0,s.jsx)("button",{type:"button",className:"sekyro-glass","aria-label":f,onClick:u,children:(0,s.jsx)(B,{name:"close"})}):null,k]}),$]})]})})}N(F,"T");d(F,"FaceCamera");export{F as a};
@@ -0,0 +1 @@
1
+ import{a as Ze,b as Ke,c as ze,d as et,f as tt,g as rt,h as it,r as at,w as ot,x as nt,z as st}from"./chunk-ZEUQQLSO.js";import{a as Ee,d as dt,e as lt}from"./chunk-F4Q2Q4OC.js";import{f as ge}from"./chunk-JPREVWIF.js";import{e as Je,k as Qe}from"./chunk-6MYG4HWP.js";import{g as Le}from"./chunk-JS2IXPNL.js";import{a}from"./chunk-4FHWXBOB.js";function ut(e,t){let r=new Set(e.flatMap(o=>o.sides.filter(s=>s[t]!==null).map(s=>s.side)));return r.size===1?[...r][0]:null}a(ut,"lt");function zt(e){let t=dt.find(o=>o.docType===e),r=t.mrz==="none"?null:t.mrz==="td3"?"single":"verso";return{sides:t.sides,format:lt(e),mrz:t.mrz==="none"?"none":"required",mrzSide:r,barcodeSide:null,portraitSide:t.portraitSide,scripts:null}}a(zt,"Yt");function Et(e){let t=[];for(let r of e)for(let o of r.sides){if(!Array.isArray(o.scripts))return null;for(let s of o.scripts)t.includes(s)||t.push(s)}return t}a(Et,"jt");function Ft(e,t){if(t.length===0)return zt(e);let r=t.some(l=>l.sides.length>1),o=new Set(t.map(l=>l.format)),s=o.size===1?[...o][0]:"card",u=t.filter(l=>l.sides.some(f=>f.mrz!==null)).length,c=t.find(l=>l.sides.length>1===r)?.sides.find(l=>l.portrait)?.side;return{sides:r?["recto","verso"]:["single"],format:s,mrz:u===t.length?"required":u===0?"none":"optional",mrzSide:ut(t,"mrz"),barcodeSide:ut(t,"barcode"),portraitSide:c??(r?"recto":"single"),scripts:Et(t)}}a(Ft,"ft");function Bt(e,t){if(e===void 0)return[];let r=e.toUpperCase();return Object.prototype.hasOwnProperty.call(Ee,r)?Ee[r]?.[t]??[]:[]}a(Bt,"mt");async function Wt(e,t,r){return await e(t)?r:r==="recto"?"verso":"recto"}a(Wt,"pt");function qt(e,t,r){return e!==t&&t==="verso"&&r.recto!==void 0&&r.verso===void 0?"verso":e}a(qt,"ht");var Dt={low:{maxLongEdge:1920,payloadTargetBytes:7e5,qMin:.7,qMax:.92},mid:{maxLongEdge:2240,payloadTargetBytes:12e5,qMin:.7,qMax:.92},good:{maxLongEdge:2560,payloadTargetBytes:16e5,qMin:.7,qMax:.92}};function Ot(e){let{deviceMemory:t,effectiveType:r,saveData:o,downlinkMbps:s,sourceLongEdge:u}=e,c=o===!0||r==="slow-2g"||r==="2g"||s!=null&&s>0&&s<1,l=t!=null&&t<=2,f=r==="4g"||s!=null&&s>=5,p=t!=null&&t>=6,M;c||l?M="low":f&&p?M="good":M="mid";let d=Dt[M],z=u&&u>0?Math.min(d.maxLongEdge,u):d.maxLongEdge;return{tier:M,...d,maxLongEdge:z}}a(Ot,"Kt");function Nt(e){let t={};try{let r=navigator;typeof r.deviceMemory=="number"&&(t.deviceMemory=r.deviceMemory);let o=r.connection;o&&(t.effectiveType=o.effectiveType,t.saveData=o.saveData,t.downlinkMbps=o.downlink)}catch{}return typeof e=="number"&&e>0&&(t.sourceLongEdge=e),Ot(t)}a(Nt,"St");function Ht(e,t,r){let o=Math.min(1,Math.max(0,(e-.28)/.21999999999999997)),s=(t+r)/2;return Math.max(t,r-o*(r-s))}a(Ht,"$t");function It(e,t,r){let o=Math.max(e,t),s=o>0?Math.min(1,r/o):1;return{width:Math.max(1,Math.round(e*s)),height:Math.max(1,Math.round(t*s))}}a(It,"Jt");async function Vt(e,t){let r=t.startQ,o=await e(r);for(let s=0;s<4&&!(o.size<=t.budgetBytes||r<=t.qMin);s++)r=Math.max(t.qMin,r-.08),o=await e(r);return{blob:o,quality:r}}a(Vt,"Zt");async function Ut(e,t,r,o,s){if(t<=0||r<=0)return null;let{width:u,height:c}=It(t,r,o.maxLongEdge),l=document.createElement("canvas");l.width=u,l.height=c;let f=l.getContext("2d");if(!f)return null;f.drawImage(e,0,0,u,c);let p=a(g=>new Promise((E,m)=>{l.toBlob(C=>C?E(C):m(new Error("canvas toBlob returned null")),"image/jpeg",g)}),"l"),M=Ht(s,o.qMin,o.qMax),{blob:d,quality:z}=await Vt(p,{startQ:M,qMin:o.qMin,budgetBytes:o.payloadTargetBytes}).finally(()=>{l.width=0,l.height=0});if(d.size>5242880)throw new Error("encoded document exceeds the 5242880-byte media cap");return{blob:d,quality:z,width:u,height:c}}a(Ut,"gt");async function _t(e){let t=Nt(Math.max(e.width,e.height)),r=await Ut(e,e.width,e.height,t,.5);if(r===null)throw new Error("canvas encode unavailable");return{blob:r.blob,width:r.width,height:r.height}}a(_t,"xe");function gt(e,t,r={safetyNetMs:null,sideChangeMs:null}){return{layout:e,phase:"framing",captured:{},pending:[],lastCaptureAt:t,lastReportAt:t,manualShutter:!1,restPhase:"framing",readSides:[],needFlip:!1,flipped:!1,flipTimeoutSpent:!1,timeoutCapture:!1,lastShotByTimeout:!1,tuning:r,safetyNetSpent:!1,sideHits:0,turnSeen:!1}}a(gt,"Le");var Oe=a(e=>e==="recto"?"verso":"recto","Oe"),yt=a(e=>e.phase==="framing"||e.phase==="locking"||e.phase==="flipCue"||e.phase==="reaskRecto","Mt"),Z=a(e=>(e.captured.recto!==void 0?1:0)+(e.captured.verso!==void 0?1:0)+e.pending.length,"$");function Fe(e,t){return e.lastCaptureAt>=0&&e.lastReportAt>=0?e:{...e,lastCaptureAt:e.lastCaptureAt<0?t:e.lastCaptureAt,lastReportAt:e.lastReportAt<0?t:e.lastReportAt}}a(Fe,"ve");function jt(e){if(Z(e)===1)return e.captured.recto!==void 0?"recto":e.captured.verso!==void 0?"verso":void 0}a(jt,"en");function Gt(e,t,r){if(e.phase==="result")return{...e,lastReportAt:r};let o=!t.present||e.captureArea!==void 0&&t.areaFrac<.6*e.captureArea,{flipped:s,awaySince:u}=e,c=e.sideSince,l=e.sideHits,f=jt(e),p=e.tuning.sideChangeMs!==null&&e.needFlip&&f!==void 0,M=!1;p&&f==="recto"&&t.side==="verso"?(c=c??r,l+=1,M=l>=2&&r-c>=e.tuning.sideChangeMs,M&&(s=!0)):(!p||t.side!==void 0)&&(c=void 0,l=0),o&&(u=u??r),u!==void 0&&r-u>=250&&(s=!0,M=!0),o||(u=void 0);let d=p&&f==="verso"&&t.side==="verso";d&&(s=!1);let z=d?!1:e.turnSeen||M,g=e.flipTimeoutSpent&&!(s&&!e.flipped),E=e.notice==="same_face"&&s&&!e.flipped?void 0:e.notice,m=t.present&&t.steady!==!1&&t.dark!==!0&&!d,C=s&&!e.flipped||z&&!e.turnSeen,A=m?C?r:e.presentSince??r:void 0,k={...e,lastReportAt:r,flipped:s,awaySince:u,sideSince:c,sideHits:l,presentSince:A,turnSeen:z,flipTimeoutSpent:g,notice:E,lastArea:t.areaFrac};if(!yt(e))return k;let O=Yt(e,k,t,r,s,g),V=e.tuning.safetyNetMs;return V!==null&&e.layout==="twoSided"&&Z(e)===1&&!e.safetyNetSpent&&z&&A!==void 0&&r-A>=V&&O.phase!=="capturing"?{...O,phase:"capturing",safetyNetSpent:!0,shotVia:"safety_net"}:O}a(Gt,"tn");function Yt(e,t,r,o,s,u){if(e.needFlip&&!s){if(!r.ready)return{...t,phase:e.restPhase,goodSince:void 0};let c=e.lastShot!==void 0&&e.pending.includes(e.lastShot);if(u||c)return{...t,goodSince:void 0,phase:e.restPhase};let l=e.goodSince??o;return o-l>=1800?{...t,goodSince:l,phase:"capturing",flipTimeoutSpent:!0,timeoutCapture:!0}:{...t,goodSince:l,phase:e.restPhase}}return r.ready?{...t,phase:"capturing",goodSince:e.goodSince??o}:{...t,goodSince:void 0,phase:r.locking?"locking":e.restPhase}}a(Yt,"nn");function Xt(e,t){if(!yt(e)||e.manualShutter)return e;let r=t-e.lastReportAt>=2e3,o=t-e.lastCaptureAt>=6e3;return r||o?{...e,manualShutter:!0}:e}a(Xt,"rn");function $t(e,t,r){let o=e.layout==="singlePage",s=o?{recto:t}:e.captured,u=o?[]:[...e.pending,t],c={...e,captured:s,pending:u,lastShot:t,lastCaptureAt:r,lastReportAt:-1,manualShutter:!1,goodSince:void 0,notice:void 0,awaySince:void 0,flipped:!1,lastShotByTimeout:e.timeoutCapture,timeoutCapture:!1,captureArea:e.lastArea,sideSince:void 0,sideHits:0,presentSince:void 0,turnSeen:!1,shotVia:void 0,lastShotVia:e.phase==="capturing"?e.timeoutCapture?"flip_timeout":e.shotVia??"ready":"manual"};return o||Z({captured:s,pending:u})>=2?{...c,phase:"reading",restPhase:"framing",current:void 0,needFlip:!1}:{...c,phase:"flipCue",restPhase:"flipCue",current:void 0,needFlip:!0}}a($t,"on");function wt(e,t,r){return e.pending.includes(t)?{...e,pending:e.pending.filter(o=>o!==t),lastShot:e.lastShot===t?void 0:e.lastShot,phase:e.phase==="capturing"?e.phase:"flipCue",restPhase:"flipCue",current:Oe(r),needFlip:!0,flipTimeoutSpent:!1,goodSince:void 0,manualShutter:!0,notice:"same_face",lastCaptureAt:-1,lastReportAt:-1,turnSeen:!1,presentSince:void 0}:e}a(wt,"wt");function Jt(e,t,r,o=!1){if(!e.pending.includes(t))return e;if(e.captured[r]!==void 0)return wt(e,t,r);let s=e.pending.filter(p=>p!==t),u={...e,pending:s,captured:{...e.captured,[r]:t}};if(Z(u)!==1||e.layout==="singlePage")return u;if(o)return{...u,unsure:t,phase:"reading",restPhase:"flipCue",current:void 0,needFlip:!1};let c=Oe(r),l=c==="recto"&&e.restPhase==="reaskRecto"?"reaskRecto":"flipCue",f=e.phase==="flipCue"||e.phase==="reaskRecto"||e.phase==="framing";return{...u,restPhase:l,current:c,phase:f?l:e.phase}}a(Jt,"an");function Qt(e,t,r){let o=e.captured.recto===t?"recto":e.captured.verso===t?"verso":void 0;if(o===void 0||o===r&&e.unsure!==t)return e;let s=Oe(r),u={[r]:t};e.captured[s]!==void 0&&e.captured[s]!==t&&(u[s]=e.captured[s]);let c=[u.recto,u.verso,...e.pending],l={...e,captured:u,unsure:void 0,readSides:e.readSides.filter(f=>u[f]!==void 0&&u[f]===e.captured[f]),lastShot:e.lastShot!==void 0&&c.includes(e.lastShot)?e.lastShot:void 0};return e.layout==="singlePage"||Z(l)!==1||e.phase!=="reading"&&e.phase!=="result"?l:{...l,phase:"flipCue",restPhase:"flipCue",current:s,needFlip:!0,flipped:!1,flipTimeoutSpent:!1,goodSince:void 0,awaySince:void 0,turnSeen:!1,safetyNetSpent:!1,presentSince:void 0,sideSince:void 0,sideHits:0,captureArea:e.lastArea,lastCaptureAt:-1,lastReportAt:-1,manualShutter:!1}}a(Qt,"sn");var ct="server";function Zt(e,t,r){if(e.layout==="singlePage")return e;let o={...e.captured},s=e.readSides,u=!1;for(let p of["recto","verso"]){let M=o[p];t.includes(p)?(M===void 0&&(o[p]=ct,u=!0),s.includes(p)||(s=[...s,p],u=!0)):M!==void 0&&(M===ct||r.includes(M))&&(delete o[p],s=s.filter(d=>d!==p),u=!0)}if(!u)return e;let c=[o.recto,o.verso,...e.pending],l={...e,captured:o,readSides:s,unsure:e.unsure!==void 0&&c.includes(e.unsure)?e.unsure:void 0,lastShot:e.lastShot!==void 0&&c.includes(e.lastShot)?e.lastShot:void 0};if(Z(l)>=2||e.phase!=="reading"&&e.phase!=="result")return l;if(Z(l)===0)return{...l,phase:"framing",restPhase:"framing",current:void 0,needFlip:!1,goodSince:void 0,lastCaptureAt:-1,lastReportAt:-1};let f=o.recto===void 0?"recto":"verso";return{...l,phase:"flipCue",restPhase:"flipCue",current:f,needFlip:!0,flipped:!1,flipTimeoutSpent:!1,goodSince:void 0,awaySince:void 0,turnSeen:!1,safetyNetSpent:!1,presentSince:void 0,sideSince:void 0,sideHits:0,captureArea:e.lastArea,lastCaptureAt:-1,lastReportAt:-1,manualShutter:!1}}a(Zt,"dn");function Kt(e,t){if(t.id!==void 0&&e.captured.recto!==t.id&&e.captured.verso!==t.id&&!e.pending.includes(t.id))return e;let r=t.id??e.captured[t.side],o={...e.captured};(t.id===void 0||o[t.side]===t.id)&&delete o[t.side];let s=e.pending.filter(p=>p!==r),u=e.layout==="twoSided"&&Z({captured:o,pending:s})>0,c=e.lastShotByTimeout||r===e.lastShot!==e.flipped,l=u&&!c,f=l?t.side==="recto"?"reaskRecto":"flipCue":"framing";return{...e,captured:o,pending:s,readSides:e.readSides.filter(p=>p!==t.side),unsure:e.unsure===r?void 0:e.unsure,lastShot:e.lastShot===r?void 0:e.lastShot,notice:t.issue,goodSince:void 0,manualShutter:!1,phase:f,restPhase:f,current:t.side,needFlip:l,flipped:!1,flipTimeoutSpent:!1,awaySince:void 0,lastCaptureAt:-1,lastReportAt:-1,safetyNetSpent:!1,sideSince:void 0,sideHits:0,presentSince:void 0,turnSeen:u&&!l&&r===e.lastShot&&!e.flipped&&!e.lastShotByTimeout}}a(Kt,"un");function er(e,t){switch(t.type){case"report":return Gt(Fe(e,t.at),t.report,t.at);case"tick":return Xt(Fe(e,t.at),t.at);case"captured":return $t(Fe(e,t.at),t.id,t.at);case"captureFailed":return{...e,phase:e.restPhase,goodSince:void 0,lastCaptureAt:t.at,manualShutter:!0,timeoutCapture:!1,shotVia:void 0,...e.shotVia==="safety_net"?{safetyNetSpent:!1,presentSince:void 0}:{}};case"classified":return Jt(e,t.id,t.side,t.unsure===!0);case"held":return Qt(e,t.id,t.side);case"serverHeld":return Zt(e,t.sides,t.answered);case"duplicate":return wt(e,t.id,t.side);case"readOk":{let r=e.readSides.includes(t.side)?e.readSides:[...e.readSides,t.side],o=e.layout==="twoSided"?["recto","verso"]:["recto","verso"].filter(u=>e.captured[u]!==void 0),s=e.phase==="reading"&&e.pending.length===0&&o.every(u=>r.includes(u));return{...e,readSides:r,flipTimeoutSpent:!1,phase:s?"result":e.phase}}case"readFailed":return Kt(e,t);case"clockRestart":return e.lastCaptureAt<0&&e.lastReportAt<0&&e.awaySince===void 0&&e.presentSince===void 0&&e.sideSince===void 0&&e.sideHits===0?e:{...e,awaySince:void 0,presentSince:void 0,sideSince:void 0,sideHits:0,lastCaptureAt:-1,lastReportAt:-1};case"retake":return{...gt(e.layout,-1,e.tuning),lastCaptureAt:-1,lastReportAt:-1};default:return e}}a(er,"Ct");var tr={card:80,probe:40,phase:160,hold:80},Be=36e5,rr=0;function j(e){if(e===void 0||!e.startsWith("shot-"))return 0;let t=Number(e.slice(5));return Number.isInteger(t)&&t>0?Math.min(t,999):0}a(j,"U");var ce=a(e=>Math.round(Math.min(1,Math.max(0,e))*1e3)/1e3,"ue"),X=a((e,t)=>Math.max(0,Math.min(t,Math.round(e))),"Q");function ir(e){return e.mrzFace!==null?"live_mrz":e.byBarcode!==null?"barcode":e.banded===null?"order":e.verdict==="recto"&&e.confirmed===void 0&&e.seen==="verso"?"turn":e.confirmed!==void 0?"reader":"band"}a(ir,"kt");function ar(e){let t=Math.min(rr+=1,999),r=null,o=0,s=0,u=[],c=new Map,l=new Set,f=null,p=null,M,d=null,z="{}",g=!1,E=a(()=>r===null?0:X(e.now()-r,Be),"W"),m=!1,C=a(()=>m?E():(m=!0,0),"M"),A=a(()=>{if(u.length===0)return;let y=u;if(u=[],o>=20||e.sink===void 0){s+=y.length;return}let b={kind:"capture_trace",platform:"web",step:"document",run:t,seq:o++,events:y,...s>0?{dropped:Math.min(s,1e5)}:{}};s=0;try{e.sink([b])}catch{}},"C"),k=a((y,b=E())=>{if(g)return;let h=tr[y.e];if(h!==void 0){let R=(c.get(y.e)??0)+1;if(c.set(y.e,R),R>h){s+=1;return}}if(o>=20){s+=1;return}u.push({t:b,...y}),u.length>=40&&A()},"b"),O=a(y=>{if(y.layout==="singlePage")return y.captured.recto!==void 0?{single:j(y.captured.recto)}:{};let b={};for(let h of["recto","verso"]){let R=y.captured[h];R!==void 0&&R!==y.unsure&&(b[h]=j(R))}return b},"A"),V={start(y,b){r===null&&(r=e.now()),k({e:"start",layout:y,...b==="recto"||b==="verso"?{expect:b}:{}},C())},observe(y,b,h){if(h.type==="report"){let{present:P,steady:N,side:W}=h.report;P!==p&&(k({e:"card",present:P,...N!==void 0?{steady:N}:{}}),p=P),M=N,(W==="recto"||W==="verso")&&W!==d&&(d=W,k({e:"probe",side:W}))}if(b===y)return;if(!y.flipped&&b.flipped&&k({e:"turn",by:b.awaySince!==void 0?"away":"probe"}),!y.manualShutter&&b.manualShutter){let P=h.type==="tick"?"timer":h.type==="duplicate"?"same_side":h.type==="captureFailed"?"no_photo":"other";k({e:"shutter",why:P})}if(h.type==="classified")k({e:"filed",photo:j(h.id),side:b.layout==="singlePage"?"single":h.side,...h.unsure===!0?{unsure:!0}:{}});else if(h.type==="duplicate"){let P=j(h.id);k({e:"same_side",photo:P,side:h.side,why:l.has(P)?"classifier":"mrz_twin"})}else if(h.type==="held")k({e:"held",photo:j(h.id),side:h.side});else if(h.type==="serverHeld")for(let P of h.sides)y.captured[P]===void 0&&b.captured[P]!==void 0&&k({e:"held",photo:j(b.captured[P]),side:P});else h.type==="readFailed"&&k({e:"refused",...h.id!==void 0?{photo:j(h.id)}:{},side:h.side,issue:h.issue});if(y.phase!==b.phase){let P=E();y.phase==="locking"&&f!==null&&(k({e:"hold",ms:X(P-f,Be),end:b.phase==="capturing"?"shot":"lost"}),f=null),b.phase==="locking"&&(f=P),k({e:"phase",phase:b.phase,...b.current!==void 0?{expect:b.current}:{}})}let R=O(b),w=JSON.stringify(R);w!==z&&(z=w,k({e:"tray",...R})),b.phase==="result"&&y.phase!=="result"&&Promise.resolve().then(A)},shot(y,b,h,R){let w=b,P={};for(let[N,W]of Object.entries(w?.guideBlockers??{}))or.has(N)&&typeof W=="number"&&W>0&&(P[N]=X(W,1e5));k({e:"shot",photo:y,...h!==void 0?{via:h}:{},...w?.via!==void 0?{engineVia:w.via}:{},...w?.stillSource==="photo"||w?.stillSource==="video"?{still:w.stillSource}:{},...R!==void 0?{expect:R}:{},...M!==void 0?{steady:M}:{},...w?.msToCapture!==void 0?{ms:X(w.msToCapture,Be)}:{},...typeof w?.ticks=="number"?{ticks:X(w.ticks,1e5)}:{},...w?.shotGlare!==void 0?{glare:ce(w.shotGlare)}:{},...w?.shotSharpness!==void 0?{sharpness:X(w.shotSharpness,1e6)}:{},...w?.deviceClass!==void 0?{deviceClass:w.deviceClass}:{},...w?.demotedFrom!==void 0?{demotedFrom:w.demotedFrom}:{},...w?.demotedBy!==void 0?{demotedBy:w.demotedBy}:{},...w?.tickMedianMs!==void 0?{tickMedianMs:X(w.tickMedianMs,6e4)}:{},...w?.video!==void 0?{videoWidth:X(w.video.width,16384),videoHeight:X(w.video.height,16384)}:{},...typeof w?.zoom=="number"?{zoom:Math.round(Math.min(Math.max(w.zoom,0),20)*100)/100}:{},...Object.keys(P).length>0?{blockers:P}:{}})},band(y){return b=>(h,R={})=>{let w=b(h,R),P=R.EDGE_LUMA_DELTA!==void 0?"soft":R.MAX_HEIGHT_FRAC!==void 0?"td1":R.LONE_EDGE_PX!==void 0?"default":"plain",N=h.width||1,W=h.height||1;return k({e:"band",photo:y,pass:P,px:X(h.width,16384),found:w!==null,...w!==null?{x:ce(w.x/N),y:ce(w.y/W),w:ce(w.width/N),h:ce(w.height/W)}:{}}),w}},reader(y,b){k({e:"reader",photo:y,lines:X(b.lineCount,9),valid:b.valid===!0,...b.format!==void 0?{format:b.format}:{}})},side(y,b,h,R){l.add(y),k({e:"side",photo:y,side:b,path:h,...R!==void 0?{format:R}:{}})},answer(y,b,h,R){let w=typeof R=="string"?R.split("/")[2]?.split(".")[0]:void 0;k({e:"answer",photo:y,accepted:(b??[]).filter(P=>P==="recto"||P==="verso"),...b===null?{done:!0}:{},...w!==void 0&&/^[0-9a-f-]{8,64}$/i.test(w)?{media:w.toLowerCase()}:{},...h!==void 0&&/^[a-z][a-z0-9_]{0,63}$/.test(h)?{reason:h}:{}})},settle(y,b,h){k({e:"settle",...y!==void 0?{photo:y}:{},sent:b,ok:h.ok,...h.ok&&h.heldAs!==void 0?{keptAs:h.heldAs}:{},...h.ok?{}:{issue:h.issue}}),Promise.resolve().then(A)},end(y){k({e:"end",outcome:y}),g=!0,A()},flush:A},K={};for(let[y,b]of Object.entries(V))K[y]=y==="band"?h=>R=>{let w;try{w=V.band(h)(R)}catch{return R}return(P,N)=>{try{return w(P,N)}catch{return R(P,N)}}}:(...h)=>{try{return b(...h)}catch{return}};return K}a(ar,"Dt");var or=new Set(["no_card","too_small","too_big","off_center","glare","blurry","steadying","locking","surface","dark"]),We=a((e,t,r)=>Math.min(r,Math.max(t,Math.round(e))),"Be"),ye=a(e=>Math.round(Math.min(1,Math.max(0,e))*1e4)/1e4,"ge");async function nr(e,t,r,o){let s=o.decode??(f=>createImageBitmap(f)),u=a(async()=>e.stillRead(await s(t),o.region??[0,0,1,1],o.detectorLimit),"u"),c;try{c=await u()}catch{try{await new Promise(f=>setTimeout(f,o.retryMs??300)),c=await u()}catch{return null}}let l=c.mrzBox;return l===void 0?null:{engine:o.engine,source:"live_mrz",format:r.format,lineCount:We(r.lineCount,2,3),checkDigitsValid:!0,stillConfirmed:c.valid&&c.digest===r.digest,band:[ye(l[0]),ye(l[1]),ye(Math.min(l[2],1-l[0])),ye(Math.min(l[3],1-l[1]))],digest:r.digest,framesToValid:We(r.framesToValid,1,1e3),msToValid:We(r.msToValid,0,12e4)}}a(nr,"Tt");var sr=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]),dr=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,6,64,11,11]);function lr(e=globalThis){let t=e.WebAssembly?.validate;if(typeof t!="function")return{ok:!1,reason:"simd"};try{if(!t.call(e.WebAssembly,sr)||!t.call(e.WebAssembly,dr))return{ok:!1,reason:"simd"}}catch{return{ok:!1,reason:"simd"}}return typeof e.Worker!="function"?{ok:!1,reason:"worker"}:typeof e.createImageBitmap!="function"?{ok:!1,reason:"bitmap"}:{ok:!0}}a(lr,"Rt");function ur(e=globalThis){let t=e.navigator?.connection;return t?.saveData===!0||["slow-2g","2g","3g"].includes(t?.effectiveType??"")}a(ur,"_t");var ne,$=(ne=class extends Error{constructor(t){super(t),this.name="OcrEngineError",this.code=t}},a(ne,"j"),ne);function pt(){let e=a(t=>(t.close(),Promise.reject(new $("unsupported"))),"e");return{ready:Promise.resolve("unsupported"),busy:!1,bandRead:e,stillRead:e,layoutRead:e,dispose:a(()=>{},"dispose")}}a(pt,"Pt");function cr(e){let t;try{if(e.createWorker)t=e.createWorker();else if(e.workerUrl!==void 0)t=new Worker(e.workerUrl,{type:"module",name:"sekyro-ocr"});else return pt()}catch{return pt()}let r=new Map,o=0,s=!1,u=!1,c=!1;t.addEventListener("message",m=>{let C=m.data,A=r.get(C.id);A&&(r.delete(C.id),A.resolve(C))});let l=a(()=>{for(let m of r.values())m.reject(new $("error"));r.clear(),p()},"d");t.addEventListener("error",l),t.addEventListener("messageerror",l);function f(m,C=[]){if(s)return Promise.reject(new $("disposed"));let A=++o;return new Promise((k,O)=>{r.set(A,{resolve:k,reject:O});try{t.postMessage({...m,id:A},C)}catch{r.delete(A),O(new $("error"))}})}a(f,"m");function p(){if(!s){s=!0;try{t.postMessage({id:++o,kind:"dispose"})}catch{}t.terminate();for(let m of r.values())m.reject(new $("disposed"));r.clear()}}a(p,"l");let M=(async()=>{let m=await f({kind:"init",baseUrl:e.baseUrl,salt:e.salt,detectorLimit:e.tuning.detectorLimit,maxDownloadMs:e.tuning.maxDownloadMs});if(m.kind==="failed")return m.reason;if(m.kind!=="ready")return"error";let C=await f({kind:"warmup"});if(C.kind!=="ready")return"error";let A=C.benchMs??C.warmupMs,k=e.deviceMemoryGb===void 0?Ke():e.deviceMemoryGb;return{warmupMs:C.warmupMs,downloadMs:m.downloadMs,cached:m.cached,benchMs:A,tier:Ze(A,k)}})().catch(()=>"error"),d,z=new Promise(m=>{d=setTimeout(()=>m("timeout"),e.tuning.loadTimeoutMs)}),g=Promise.race([M,z]).then(m=>(clearTimeout(d),typeof m=="string"?p():c=!0,s&&typeof m!="string"?"error":m));(e.page===void 0?globalThis.addEventListener?globalThis:null:e.page)?.addEventListener("pagehide",p,{once:!0});async function E(m,C,A){if(s)throw C.close(),new $("disposed");if(!c)throw C.close(),new $("not_ready");if(u)throw C.close(),new $("busy");u=!0;let k;try{let O=new Promise((K,y)=>{k=setTimeout(()=>{y(new $("timeout")),p()},e.tuning.readTimeoutMs??1e4)}),V=await Promise.race([f(m,[C]),O]);if(V.kind===A){let{id:K,...y}=V;return y}throw new $(V.kind==="error"?V.code:V.kind==="failed"?V.reason:"error")}finally{clearTimeout(k),u=!1}}return a(E,"P"),{ready:g,get busy(){return u},bandRead:a((m,C=e.tuning.detectorLimit,A)=>E({kind:"band",bitmap:m,detectorLimit:C,...A!==void 0?{expiredBefore:A}:{}},m,"band"),"bandRead"),stillRead:a((m,C,A=e.tuning.detectorLimit)=>E({kind:"still",bitmap:m,region:C,detectorLimit:A},m,"band"),"stillRead"),layoutRead:a((m,C)=>E({kind:"layout",bitmap:m,detectorLimit:C},m,"layout"),"layoutRead"),dispose:p}}a(cr,"Et");var we="sekyro-ocr-1",qe=a(e=>e!==null&&typeof e=="object"?e:{},"Fe"),G=a((e,t,r,o)=>typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=r?e:o,"X"),ht=a((e,t)=>typeof e=="boolean"?e:t,"xt"),mt=a(e=>{let t=typeof e=="string"?/^sekyro-ocr-(\d{1,4})$/.exec(e):null;return t?Number(t[1]):Number.POSITIVE_INFINITY},"vt");function pr(e,t={}){let r=qe(e),o=qe(r.liveMrz),s=qe(r.frontLock),u=mt(t.engine??we),c=t.mode==="off",l=o.enabled===!0,f=s.enabled===!0,p=a((m,C)=>!c&&C&&mt(m.minEngine??we)<=u,"l"),M=nt,d=p(o,l)?{detectorLimit:G(o.detectorLimit,320,1600,M.detectorLimit),bandMaxWidthPx:G(o.bandMaxWidthPx,320,4096,M.bandMaxWidthPx),minBandWidthPx:G(o.minBandWidthPx,0,4096,M.minBandWidthPx),bandTop:G(o.bandTop,0,.95,M.bandTop),minIntervalMs:G(o.minIntervalMs,0,5e3,M.minIntervalMs),stableReads:Math.round(G(o.stableReads,1,10,M.stableReads)),profileReads:Math.round(G(o.profileReads,1,100,M.profileReads)),maxReadMs:G(o.maxReadMs,50,6e4,M.maxReadMs),searchTimeoutMs:G(o.searchTimeoutMs,1e3,12e4,M.searchTimeoutMs),hint:ht(o.hint,!0),stillConfirm:ht(o.stillConfirm,!0)}:null,z=ot,g=a((m,C,A)=>G(s[m],C,A,z[m]),"S"),E=p(s,f)?{minLines:Math.round(g("minLines",1,50)),fillMin:g("fillMin",0,1),fillMax:g("fillMax",0,2),offsetMax:g("offsetMax",0,1),steadyFillDelta:g("steadyFillDelta",0,1),steadyOffsetDelta:g("steadyOffsetDelta",0,1),layoutShiftMax:g("layoutShiftMax",0,1),lineCountDelta:Math.round(g("lineCountDelta",0,50)),lockMs:g("lockMs",0,3e4),steadyMs:g("steadyMs",0,3e4),minFrames:Math.round(g("minFrames",1,100)),minIntervalMs:g("minIntervalMs",0,5e3),maxWidthPx:g("maxWidthPx",160,2048),detectorLimit:g("detectorLimit",320,1600),searchTimeoutMs:g("searchTimeoutMs",1e3,12e4)}:null;return{enabled:d!==null||E!==null,liveMrz:d,textLock:E,liveMrzOn:l,frontLockOn:f,load:{detectorLimit:d?.detectorLimit??E?.detectorLimit??M.detectorLimit,loadTimeoutMs:G(o.loadTimeoutMs,1e3,12e4,2e4),maxDownloadMs:G(o.maxDownloadMs,1e3,12e4,2e4)},reportSampleRate:G(o.reportSampleRate,0,1,1)}}a(pr,"Lt");function hr(e,t){return e.enabled?!(t.probe??lr)().ok||(t.slow??ur)()?{ok:!1,reason:"unsupported"}:{ok:!0,engine:cr({baseUrl:t.baseUrl,salt:t.salt,tuning:{detectorLimit:e.load.detectorLimit,maxDownloadMs:e.load.maxDownloadMs,loadTimeoutMs:e.load.loadTimeoutMs},...t.workerUrl!==void 0?{workerUrl:t.workerUrl}:{},...t.createWorker!==void 0?{createWorker:t.createWorker}:{},...t.page!==void 0?{page:t.page}:{},...t.deviceMemoryGb!==void 0?{deviceMemoryGb:t.deviceMemoryGb}:{}})}:{ok:!1,reason:"off"}}a(hr,"Ot");function mr(e=typeof navigator<"u"?navigator.userAgent:""){return/SamsungBrowser\//.test(e)?"samsung":/Firefox\/|FxiOS\//.test(e)?"firefox":/Chrome\/|CriOS\/|Chromium\//.test(e)&&!/Edg\/|OPR\//.test(e)?"chrome":/Safari\//.test(e)&&/Version\/|Mobile\//.test(e)&&!/Chrome\/|CriOS\//.test(e)?"safari":"other"}a(mr,"hn");var Q=a(e=>e===void 0||!Number.isFinite(e)?void 0:Math.min(6e5,Math.max(0,Math.round(e))),"J"),De=a((e,t,r)=>e===void 0||!Number.isFinite(e)?void 0:Math.min(r,Math.max(t,Math.round(e))),"Ie");function fr(e){let t=e.assist??null,r=e.load!==null&&e.load!==void 0&&typeof e.load=="object"?e.load:null,o=typeof e.load=="string"?e.load:null,s=t!==null?t.outcome:o==="unsupported"||o==="download"||o==="integrity"?o:o==="error"||o==="timeout"?"error":"off",u={kind:"live_mrz",platform:"web",engine:e.engine??we,capture:e.capture,outcome:s,reads:De(t?.reads??0,0,1e4)??0,browser:e.browser??mr()},c=a((l,f)=>{f!==void 0&&(u[l]=f)},"c");return c("format",t?.format),c("framesToValid",De(t?.framesToValid,1,1e4)),c("msToValid",Q(t?.msToValid)),c("framesToLock",De(t?.framesToLock,1,1e4)),c("msToLock",Q(t?.msToLock)),c("msToCapture",Q(e.msToCapture)),c("readP50Ms",Q(t?.readP50Ms)),c("readP90Ms",Q(t?.readP90Ms)),c("deviceClass",t?.deviceClass),r!==null&&(c("warmupMs",Q(r.warmupMs)),c("downloadMs",Q(r.downloadMs)),c("cached",r.cached),c("tier",r.tier),c("benchMs",Q(r.benchMs))),c("stillConfirmed",e.stillConfirmed),c("typeMismatch",e.typeMismatch),u}a(fr,"At");function ft(e,t){return e===void 0?!1:t==="passport"?e!=="TD3":e==="TD3"}a(ft,"ze");var vr=2,gr=1500,yr=2500;async function wr(e){let t=await import("./capture-session-doc-BT2W22H5-TWRWJRRR.js");return new t.CaptureSessionDoc(e)}a(wr,"yn");function br(e){return{topLeft:{x:e.x,y:e.y},topRight:{x:e.x+e.width,y:e.y},bottomRight:{x:e.x+e.width,y:e.y+e.height},bottomLeft:{x:e.x,y:e.y+e.height}}}a(br,"Mn");function vt(e){let t=[e.topLeft.x,e.topRight.x,e.bottomRight.x,e.bottomLeft.x],r=[e.topLeft.y,e.topRight.y,e.bottomRight.y,e.bottomLeft.y],o=Math.min(...t),s=Math.min(...r);return{x:o,y:s,width:Math.max(...t)-o,height:Math.max(...r)-s}}a(vt,"Bt");function Sr(e,t,r){let o=[e.topLeft,e.topRight,e.bottomRight,e.bottomLeft],s=0;for(let u=0;u<o.length;u+=1){let c=o[u],l=o[(u+1)%o.length];s+=c.x*l.y-l.x*c.y}return t>0&&r>0?Math.abs(s)/2/(t*r):0}a(Sr,"wn");function Mr(e,t){return t==="verso"?"verso":t==="recto"?e==="recto"||e===null?"recto":"unsure":t===null?"unsure":e??"unsure"}a(Mr,"Cn");function pe(e){return e.startsWith("shot-")?Number(e.slice(5)):0}a(pe,"le");function Lr(){import("./capture-session-doc-BT2W22H5-TWRWJRRR.js").then(e=>e.warmDocDetector()).catch(()=>{})}a(Lr,"hr");function zr(e){return kr(e,{}).handle}a(zr,"Sr");function kr(e,t){let r=Je(),o=Qe({enabled:e.keepScreenAwake!==!1}),s=t.decode??(i=>createImageBitmap(i)),u=t.blurRefuseSharpnessMax??.16,c=t.now??(()=>performance.now()),l=ar({now:c,sink:t.traceSink});r.on("captured",()=>l.flush());let f=Ft(e.documentType,t.catalogCapture===!0?t.captureSeries??Bt(e.issuer,e.documentType):[]),p=f.sides.length===1||e.side==="single",M=t.secondSide,d=gt(p?"singlePage":"twoSided",c(),M!==void 0?{safetyNetMs:M.safetyNetMs,sideChangeMs:M.sideChangeMs}:void 0);if(!p&&(e.side==="recto"||e.side==="verso")){let i=e.side==="recto"?"verso":"recto";d={...d,captured:{[i]:"server"},readSides:[i],current:e.side,phase:"flipCue",restPhase:"flipCue"}}let z="idle",g=null,E=null,m=!0,C=0,A=0,k=null,O=!1,V=!1,K="",y=null,b,h=null,R=[],w="base",P=a(i=>{M===void 0||g===null||i===w||(w=i,g.setLockTuning?.(i==="second"?M.guide:t.engineOptions?.guideLock??at))},"R"),N=a(()=>!p&&(d.captured.recto!==void 0?1:0)+(d.captured.verso!==void 0?1:0)==1,"N"),W=a(()=>P(N()?"second":"base"),"B"),Ne=f.mrz==="none",bt=f.barcodeSide==="recto"||f.barcodeSide==="verso"?f.barcodeSide:null,oe=Ne&&!p?t.barcode?.side??bt:null,He=e.barcodeAssetBaseUrl??t.barcode?.assetBaseUrl,be=null,Ie=a(()=>oe===null||He===void 0||t.barcode?.seen!==void 0?Promise.resolve(null):(be??(be=import("./barcode-detect-C5IOXMKI-ZOZ2WOWU.js").then(i=>i.loadBarcodeDetect(He)).catch(()=>null)),be),"He"),St=a((i,n)=>{if(oe===null)return Promise.resolve(null);let v,T=new Promise(S=>{v=setTimeout(()=>S(null),t.barcode?.budgetMs??gr)});return Promise.race([Mt(i,n,oe),T]).finally(()=>clearTimeout(v))},"It"),Mt=a(async(i,n,v)=>{let T=v==="recto"?"verso":"recto";try{let S=t.barcode?.seen;if(S!==void 0)return await S(i)?v:T;let[B,L]=await Promise.all([Ie(),n()]);if(B===null||L===null)return null;let _=Math.min(1600,L.width),x=document.createElement("canvas");x.width=_,x.height=Math.max(1,Math.round(L.height/L.width*_));try{let I=x.getContext("2d");return I===null?null:(I.drawImage(L,0,0,x.width,x.height),await Wt(B,I.getImageData(0,0,x.width,x.height),v))}finally{x.width=0,x.height=0}}catch{return null}},"zt"),H=t.webOcr!==void 0&&!Ne?pr(t.webOcr.captureDocument,{mode:e.liveMrz?.mode??"auto"}):null,ee=null,U=H===null||!H.enabled?"off":null,he=null,me=null,Ve=new WeakMap,fe=new WeakMap,Se=new Set,Ue=new Map,kt=a(async(i,n,v=0)=>{let T=ee;if(T===null||U===null||typeof U!="object"||!("tier"in U))return null;let S=a(async()=>{let x=await s(i),I=n?.inStill===!0?rt(vt(n.quad),x)[0]:{x:0,y:0,width:x.width,height:x.height},Y=[I.x/x.width,I.y/x.height,I.width/x.width,I.height/x.height];return T.stillRead(x,Y,H?.liveMrz?.detectorLimit)},"k"),B,L=new Promise(x=>{B=setTimeout(()=>x(null),yr)}),_=S().catch(()=>new Promise(x=>setTimeout(x,300)).then(S)).then(x=>(l.reader(v,x),x)).then(x=>x.valid&&x.digest!==void 0?{side:"verso",digest:x.digest}:x.lineCount===0?{side:"recto"}:null).catch(()=>null);return Promise.race([_,L]).finally(()=>clearTimeout(B))},"Wt"),Me="";if(H!==null&&H.enabled&&t.webOcr!==void 0){let i=t.webOcr,n=hr(H,{baseUrl:e.liveMrz?.assetBaseUrl??i.baseUrl,salt:i.salt,...e.liveMrz?.workerUrl!==void 0?{workerUrl:e.liveMrz.workerUrl}:{},...i.createWorker!==void 0?{createWorker:i.createWorker}:{}});if(n.ok){ee=n.engine;let v=new st({textLock:H.textLock,liveMrz:H.liveMrz,...t.expiredBefore!==void 0?{expiredBefore:t.expiredBefore}:{}});he=v;let T=n.engine;T.ready.then(S=>{U=S,typeof S!="string"&&m&&v.setEngine(T,S.tier)})}else U=n.reason}let te=a(i=>{let n=JSON.stringify(i);n!==Me&&(Me=n,r.emit("mrz",i))},"ee"),_e=a((i,n)=>{let v=t.webOcr?.reports;if(v===void 0||H===null||i===void 0)return;let T=i.format==="ID-3"||i.side==="single"?"single":i.side==="verso"?"verso":"recto";if(!(T!=="recto"&&H.liveMrzOn||H.frontLockOn)||Math.random()>=H.reportSampleRate)return;let S=i.via==="live_mrz"?me:null,B=a(()=>{let L=S?.value??null;v([fr({capture:T,assist:i.ocr??null,load:U,...i.msToCapture!==void 0?{msToCapture:i.msToCapture}:{},...L!==null&&L.stillConfirmed!==void 0?{stillConfirmed:L.stillConfirmed}:{},...n!==void 0?{typeMismatch:ft(n.format,f.format==="ID-3"?"passport":"card")}:{}})])},"v");S!==null&&S.value===null?Promise.race([S.promise,new Promise(L=>setTimeout(L,3e3))]).then(B):B()},"qe"),re=a(i=>{!m||i===z||(z=i,o.setActive(i==="starting"||i==="scanning"),r.emit("state",i))},"te"),xt=a((i,n)=>n===void 0?null:p?"single":i.captured.recto===n?"recto":i.captured.verso===n?"verso":null,"Nt"),Tt=a(i=>({phase:i.phase,captured:p?i.captured.recto!==void 0?["single"]:[]:["recto","verso"].filter(n=>i.captured[n]!==void 0&&i.captured[n]!==i.unsure),photos:p?i.captured.recto!==void 0&&pe(i.captured.recto)>0?{single:pe(i.captured.recto)}:{}:Object.fromEntries(["recto","verso"].filter(n=>i.captured[n]!==void 0&&i.captured[n]!==i.unsure&&pe(i.captured[n])>0).map(n=>[n,pe(i.captured[n])])),expected:p?null:i.current??null,notice:i.notice??null,lastShot:xt(i,i.lastShot),manualShutter:i.manualShutter,torchAvailable:g?.torchAvailable()??!1,torch:V}),"Gt"),je=a(()=>{let i=g;if(i===null)return;let n=C,v=a(()=>{m&&g===i&&C===n&&d.phase==="capturing"&&F({type:"captureFailed",at:c()})},"p");i.captureNow().then(v,v)},"Xe");function F(i){if(!m)return;let n=d;d=er(d,i),l.observe(n,d,i),d.phase==="capturing"&&n.phase!=="capturing"&&Promise.resolve().then(je),d.phase==="result"&&n.phase!=="result"&&(re("done"),Ge());let v=Tt(d),T=JSON.stringify(v);T!==K&&(K=T,r.emit("scan",v))}a(F,"O");function Ge(){h!==null&&clearInterval(h),h=null;for(let i of R.splice(0))i();g?.destroy(),g=null,o.setActive(!1)}a(Ge,"Ye");let Ye=a(()=>g?.captureReport?.(),"je"),ke=!1,Xe=a((i,n)=>{if(!(i===void 0||t.onFaceReport===void 0))try{t.onFaceReport(i,n)}catch{}},"Qe"),ie=a(i=>{Me="",!(g===null||d.phase==="reading"||d.phase==="result")&&(ke=!1,k=p?"single":d.current??i,g.rearm(k))},"ne"),Ct=a(async(i,n,v,T)=>{me=null;let S=U!==null&&typeof U=="object"&&U.tier==="low";if(T!==void 0&&ee!==null&&H?.liveMrz?.hint===!0&&!S){let q={promise:nr(ee,i,T,{engine:we,detectorLimit:H.liveMrz.detectorLimit}).catch(()=>null),value:null};q.promise.then(se=>{q.value=se}),me=q}T!==void 0&&ft(T.format,f.format==="ID-3"?"passport":"card")&&te({state:"mismatch",format:T.format});let B=`shot-${C+=1}`,L=d.current;F({type:"captured",id:B,at:c()});let _=d.lastShotVia,x=Ye();l.shot(j(B),x,_,L),Xe(x===void 0||d.lastShotVia===void 0?x:{...x,shotVia:d.lastShotVia},"captured"),ke=!0,_e(x,T);let I=v===void 0?y:v===null?null:{quad:br(v),frameWidth:0,frameHeight:0,inStill:!0},Y={decoded:null},D=a(()=>(Y.decoded??(Y.decoded=Promise.resolve().then(()=>s(i)).catch(()=>null)),Y.decoded),"z");try{await At(B,L,i,n,I,D,me,T,_)}finally{Y.decoded!==null&&(await Y.decoded)?.close()}},"Ht"),At=a(async(i,n,v,T,S,B,L,_,x)=>{if(e.haptics!==!1)try{globalThis.navigator?.vibrate?.(30)}catch{}if(!O&&u>0){let D=await(t.measureSharpness!==void 0?t.measureSharpness(v,S):B().then(q=>q===null?-1:et(q,ze(S?.quad??null,S?.inStill===!0?q:{width:S?.frameWidth??0,height:S?.frameHeight??0},q)))).catch(()=>-1);if(!m)return;if(Number.isFinite(D)&&D>=0&&D<u){O=!0;let q=p?"recto":d.current??(d.captured.recto===void 0?"recto":"verso");F({type:"readFailed",side:q,id:i,issue:"blurry"}),W(),ie(q);return}}O=!1;let I;if(p)I="single";else{let D=_!==void 0&&_.format!=="TD3"&&(f.mrzSide==="recto"||f.mrzSide==="verso")?f.mrzSide:null,q=D===null&&t.classify===void 0?await St(v,B):null,se=q===null||oe===null?q:qt(q,oe,d.captured),Te=D??se??(se===null&&oe!==null&&n!==void 0?n:null),de=Te!==null?null:await(t.classify!==void 0?t.classify(v):B().then(J=>J===null?"unsure":S?.inStill===!0?tt(J,vt(S.quad),480,l.band(j(i))):it(J,480,ze(S?.quad??null,{width:S?.frameWidth??0,height:S?.frameHeight??0},J),void 0,void 0,l.band(j(i))))).catch(()=>"unsure"),Ce=d.captured.recto===void 0&&d.captured.verso===void 0,Rt=ee!==null&&(U===null||typeof U=="object"&&"tier"in U),le,$e;if(de!==null&&Rt&&f.mrzSide==="verso"&&(Ce||de!=="recto"&&d.captured.verso!==void 0)){let J=await kt(v,S,j(i));if(!m)return;le=J?.side??null,$e=J?.digest}let ue=Mr(de,le),ve=_?.digest??$e;ve!==void 0&&Ue.set(i,ve);let Ae=ve===void 0?void 0:["recto","verso"].find(J=>{let Re=d.captured[J];return Re!==void 0&&Re!==i&&Ue.get(Re)===ve});if(Ae!==void 0){F({type:"duplicate",id:i,side:Ae}),ie(Ae==="recto"?"verso":"recto");return}let Pe=d.captured.recto===void 0?"recto":d.captured.verso===void 0?"verso":void 0,Lt=Ce&&Te===null&&ue==="unsure"&&t.deferRead===!0,ae=Te??(ue==="unsure"?Ce?de==="verso"&&le!=="recto"?"verso":"recto":Pe??"recto":ue==="recto"&&le===void 0&&x!=="flip_timeout"&&d.captured.recto!==void 0&&d.captured.verso===void 0?"verso":ue);if(l.side(j(i),ae,ir({mrzFace:D,byBarcode:se,banded:de,confirmed:le,verdict:ue,seen:ae}),_?.format),!m)return;if(d.captured[ae]!==void 0&&A<vr){A+=1,F({type:"duplicate",id:i,side:ae}),ie(ae==="recto"?"verso":"recto");return}I=d.captured[ae]!==void 0&&Pe!==void 0?Pe:ae,A=0,F({type:"classified",id:i,side:I,...Lt?{unsure:!0}:{}}),N()&&P("second")}let Y=I==="verso"?"verso":"recto";try{let D=t.encode!==void 0?await t.encode(v):await B().then(q=>{if(q===null)throw new Error("the still could not be decoded");return _t(q)});if(!m)return;L!==null&&Ve.set(D.blob,L),fe.set(D.blob,i),r.emit("captured",{image:D.blob,side:I,photo:pe(i),documentType:e.documentType,...e.issuer!==void 0?{issuer:e.issuer}:{},width:D.width,height:D.height,previewDataUrl:T}),t.deferRead!==!0&&F({type:"readOk",side:Y})}catch(D){F({type:"readFailed",side:Y,id:i,issue:"technical"}),W(),r.emit("error",ge("generic",!0,{phase:"keyframes",name:Le(D)}))}ie(Y==="recto"?"verso":"recto")},"Ut"),Pt=a(i=>{R.push(i.on("statechange",({state:n})=>{n==="preflight"||n==="acquiring"?re("starting"):n==="positioning"?re("scanning"):n==="captured"?re("captured"):n==="error"&&re("error")}),i.on("feedback",({key:n,reticle:v})=>r.emit("feedback",{key:n,reticle:v})),i.on("checks",n=>{r.emit("gate",{progress:n.p,quad:n.quad,frameWidth:n.frameWidth,frameHeight:n.frameHeight,...n.guide!==void 0?{guide:{detected:n.guide.detected,fill:n.guide.fill,offsetX:n.guide.offsetX??0,offsetY:n.guide.offsetY??0}}:{}});let v=n.ocr?.mrz;v!==void 0&&(v.state==="fallback"?te({state:"fallback",reason:v.reason}):v.state==="valid"?te({state:"valid",format:v.format}):v.state==="expired"?te({state:"expired",format:v.format}):v.state==="reading"?te({state:"reading",...v.format?{format:v.format}:{},...v.coach?{coach:v.coach}:{}}):te({state:"searching"}));let T=n.quad===null?0:Sr(n.quad,n.frameWidth,n.frameHeight);y=n.quad===null?null:{quad:n.quad,frameWidth:n.frameWidth,frameHeight:n.frameHeight},F({type:"report",report:{present:n.quad!==null&&n.plausible||n.guide?.detected===!0,ready:n.ready===!0,locking:n.ready===!0||n.locking===!0,areaFrac:T,...n.side!==void 0?{side:n.side}:{},...n.guide?.still!==void 0?{steady:n.guide.detected&&n.guide.still}:{},...n.dark===!0?{dark:!0}:{}},at:c()})}),i.on("error",({kind:n,retryable:v,detail:T})=>r.emit("error",ge(n,v,T))),i.on("artifacts",n=>{Ct(n.keyframe,n.previewDataUrl,n.docRegion,n.liveMrz)}))},"Vt"),xe=a(()=>(E??(E=(async()=>{if(m){if(Ie(),g===null){let i;try{i=await(t.createEngine??wr)({...t.engineOptions??{},...b!==void 0?{guide:b}:{},video:e.video,format:f.format,side:p?"single":e.side??"recto",autoCapture:!1,...he!==null?{ocr:he}:{},...M!==void 0&&!p&&f.mrzSide==="verso"?{sideProbe:!0}:{}})}catch(v){re("error"),r.emit("error",ge("models",!0,{phase:"models",name:Le(v)}));return}if(!m){i.destroy();return}g=i,l.start(p?"singlePage":"twoSided",e.side),w="base",k=p?"single":e.side??"recto",Pt(i),N()&&P("second");let n=t.tickMs??500;n>0&&(h=setInterval(()=>F({type:"tick",at:c()}),n))}F({type:"clockRestart"}),H!==null&&H.liveMrzOn&&(U==="unsupported"||U==="off")&&te({state:"fallback",reason:U}),await g.start()}})().finally(()=>{E=null})),E),"we");return{handle:{get state(){return z},on:a((i,n)=>r.on(i,n),"on"),start:xe,retry:a(()=>{if(g===null&&d.phase==="result"){F({type:"retake"}),A=0,O=!1,xe();return}if(g!==null&&z!=="error"){F({type:"retake"}),A=0,O=!1,P("base"),k=p?"single":e.side??"recto",g.rearm(k);return}xe()},"retry"),setSide:a(i=>{p||i==="single"||g!==null&&d.current===i&&k===i&&d.phase!=="reading"&&d.phase!=="result"||(d.current!==i&&(d={...d,current:i}),F({type:"clockRestart"}),d.phase!=="reading"&&d.phase!=="result"&&g!==null&&(k=i,g.rearm(i)))},"setSide"),shutter:je,focusAt:a((i,n)=>{g?.focusAt?.(i,n)},"focusAt"),setGuide:a(i=>{b=i,g?.setGuide?.(i)},"setGuide"),setTorch:a(i=>{V=i,g?.setTorch(i),F({type:"tick",at:c()})},"setTorch"),destroy:a(()=>{if(m&&l.end(z==="done"?"done":"abandoned"),m&&g!==null&&z!=="done"){let i=Ye();!ke&&i!==void 0&&i.ticks>0&&Xe(i,"abandoned"),_e(i,void 0)}m=!1,Ge(),he?.setEngine(null),ee?.dispose(),ee=null,r.clear()},"destroy")},plan:f,setFlowState:a(i=>{(d.phase==="reading"||d.phase==="result")&&re(i==="done"&&d.phase!=="result"?"scanning":i)},"setFlowState"),settle:a((i,n,v)=>{let T=i==="verso"?"verso":"recto",S=v!==void 0?fe.get(v.image):d.unsure;if(S!==void 0&&d.captured.recto!==S&&d.captured.verso!==S&&!d.pending.includes(S))return;if(S!==void 0&&Se.add(S),l.settle(S!==void 0?j(S):void 0,p?"single":T,n),n.ok){let L=p?T:n.heldAs??T,_=d.phase;S!==void 0&&!p&&F({type:"held",id:S,side:L}),n.held!==void 0&&!p&&F({type:"serverHeld",sides:n.held,answered:[...Se]}),(p||n.held===void 0||n.held.includes(L))&&F({type:"readOk",side:L}),(_==="reading"||_==="result")&&d.phase!=="reading"&&d.phase!=="result"&&(W(),ie(d.current??(L==="recto"?"verso":"recto")));return}let B=d;F({type:"readFailed",side:T,...S!==void 0?{id:S}:{},issue:n.issue}),d!==B&&(W(),ie(T))},"settle"),takeDeviceRead:a(i=>Ve.get(i.image)?.value??null,"takeDeviceRead"),traceAnswer:a((i,n,v,T)=>l.answer(j(fe.get(i.image)),n,v,T),"traceAnswer"),serverHeld:a(i=>{if(p)return;let n=d.phase;F({type:"serverHeld",sides:i,answered:[...Se]}),(n==="reading"||n==="result")&&d.phase!=="reading"&&d.phase!=="result"&&(W(),ie(d.current??"recto"))},"serverHeld"),dropped:a(i=>{let n=fe.get(i.image);return n!==void 0&&!p&&d.captured.recto!==n&&d.captured.verso!==n&&!d.pending.includes(n)},"dropped")}}a(kr,"kn");export{vr as a,gr as b,yr as c,Mr as d,Lr as e,zr as f,kr as g};