@sekyro/elements 0.1.0-rc.10 → 0.1.0-rc.11

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 (94) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cdn/chunks/{capture-session-doc-2LIRRKFX-GZQBYOR3.js → capture-session-doc-2XRGB6AO-ZURBQ4YP.js} +1 -1
  3. package/dist/cdn/chunks/{chunk-X7QE75V5.js → chunk-3CEJV42Q.js} +1 -1
  4. package/dist/cdn/chunks/{chunk-UQKRYXN5.js → chunk-5JSOPXYS.js} +1 -1
  5. package/dist/cdn/chunks/chunk-6MYG4HWP.js +1 -0
  6. package/dist/cdn/chunks/chunk-ADYI7APR.js +1 -0
  7. package/dist/cdn/chunks/{chunk-NNYJYD3Q.js → chunk-BMOSAKXR.js} +1 -1
  8. package/dist/cdn/chunks/{chunk-52CHUGVC.js → chunk-C6HZ7TYS.js} +2 -2
  9. package/dist/cdn/chunks/{chunk-PH7RJ5GZ.js → chunk-DW3VKKDE.js} +1 -1
  10. package/dist/cdn/chunks/{chunk-MDDGAHO6.js → chunk-E7OQJP4I.js} +1 -1
  11. package/dist/cdn/chunks/chunk-FQYXVP54.js +1 -0
  12. package/dist/cdn/chunks/{chunk-SVROKIYG.js → chunk-JI5WT66H.js} +1 -1
  13. package/dist/cdn/chunks/{chunk-ZRL6E7XH.js → chunk-K5SATFJY.js} +1 -1
  14. package/dist/cdn/chunks/{chunk-YPIQ6IU7.js → chunk-O23O5AAH.js} +1 -1
  15. package/dist/cdn/chunks/chunk-QMBS54J5.js +33 -0
  16. package/dist/cdn/chunks/chunk-QXWWOMOK.js +1 -0
  17. package/dist/cdn/chunks/{chunk-SJAQ7DUY.js → chunk-R3P75ZRR.js} +1 -1
  18. package/dist/cdn/chunks/{chunk-FVMJYXGV.js → chunk-RH3APX6G.js} +1 -1
  19. package/dist/cdn/chunks/{chunk-MZ6WG3QQ.js → chunk-RKNAZPA7.js} +1 -1
  20. package/dist/cdn/chunks/{chunk-Q6GRUOR3.js → chunk-S4ABXV4B.js} +1 -1
  21. package/dist/cdn/chunks/{chunk-BZDKXIWD.js → chunk-S774ZMGH.js} +1 -1
  22. package/dist/cdn/chunks/{chunk-WKQRKYX4.js → chunk-SOI356LX.js} +1 -1
  23. package/dist/cdn/chunks/{chunk-JDANRDDK.js → chunk-TPDANNML.js} +1 -1
  24. package/dist/cdn/chunks/{chunk-6N4AXKCS.js → chunk-TXDGBMD4.js} +1 -1
  25. package/dist/cdn/chunks/{chunk-NT7PZPBW.js → chunk-VPJEUYYP.js} +1 -1
  26. package/dist/cdn/chunks/{chunk-YGXNL7S2.js → chunk-XSGAV3PT.js} +1 -1
  27. package/dist/cdn/chunks/chunk-XSGZY4JI.js +1 -0
  28. package/dist/cdn/chunks/create-document-capture-XWNBUC55-FZGHPB6L.js +1 -0
  29. package/dist/cdn/chunks/{create-portrait-capture-5VGYZUOK-N3333DJC.js → create-portrait-capture-5VGYZUOK-KTCFCHTN.js} +1 -1
  30. package/dist/cdn/chunks/{detector-scanic-KMAVOHGF-NFYSZ7GU.js → detector-scanic-S4PB2RNW-3KSM3MW5.js} +1 -1
  31. package/dist/cdn/chunks/{document-capture-view-QMXAAYA2-5HJJKIZ4.js → document-capture-view-2NFKF44N-4F3CP2ZO.js} +1 -1
  32. package/dist/cdn/chunks/{eid-view-3QTJORA7-S7APLLOM.js → eid-view-UGYVZ5NM-NQLRT4US.js} +1 -1
  33. package/dist/cdn/chunks/{email-otp-view-6MD74OFN-PRYGFOHY.js → email-otp-view-ENQVRS66-DCCJA246.js} +1 -1
  34. package/dist/cdn/chunks/flow-views-HNJPDQ63-ER7B4XJF.js +1 -0
  35. package/dist/cdn/chunks/{form-view-YAGVGWMI-7BEAIBSC.js → form-view-6ERKUFVD-2JHV2SHY.js} +1 -1
  36. package/dist/cdn/chunks/overlay-de-2DL4MNC7-5CBBHT7P.js +1 -0
  37. package/dist/cdn/chunks/overlay-es-FMHWRKQW-REFKUX4J.js +1 -0
  38. package/dist/cdn/chunks/overlay-pt-OGIELLCM-GU2A32BS.js +1 -0
  39. package/dist/cdn/chunks/{plan-runner-T2ZTSBI4-SEXJ6KJP.js → plan-runner-KX7KUS3M-CECACJOR.js} +1 -1
  40. package/dist/cdn/chunks/{portrait-capture-view-6EUUL2QA-7F2WSHIW.js → portrait-capture-view-ARRN3JW6-XRLTO3JS.js} +1 -1
  41. package/dist/cdn/chunks/{portrait-review-view-TTVTYGLG-SVRXTB4Q.js → portrait-review-view-JF6TYNBU-57HERUGH.js} +1 -1
  42. package/dist/cdn/chunks/{proof-of-address-view-5WWGRXJL-JQWHMWVI.js → proof-of-address-view-46Q6F7H5-7ES2ZRQL.js} +1 -1
  43. package/dist/cdn/define.js +1 -1
  44. package/dist/cdn/index.js +1 -1
  45. package/dist/{chunk-M3SKGQUG.js → chunk-37I3KKNR.js} +1 -1
  46. package/dist/{chunk-DMESMWZ7.js → chunk-43AFSR5C.js} +1 -1
  47. package/dist/chunk-5MQUCOFK.js +1 -0
  48. package/dist/{chunk-F2IYM4GV.js → chunk-DXR3ZGW2.js} +1 -1
  49. package/dist/{chunk-NQQZCBHQ.js → chunk-FHAN7WFM.js} +1 -1
  50. package/dist/chunk-GBOZODQT.js +33 -0
  51. package/dist/{chunk-GIMNUGVE.js → chunk-JQOJI5Z3.js} +1 -1
  52. package/dist/{chunk-XJJ3KCLT.js → chunk-NC6MJEKS.js} +1 -1
  53. package/dist/{chunk-F67N4IZQ.js → chunk-OCLSIGRD.js} +1 -1
  54. package/dist/{chunk-YC4IK7VG.js → chunk-PNZPHUSG.js} +1 -1
  55. package/dist/{chunk-PCLZBE2D.js → chunk-Q5HUTAIF.js} +1 -1
  56. package/dist/{chunk-K5DAJSLX.js → chunk-VD7QSFUC.js} +1 -1
  57. package/dist/{chunk-2WPZFQUP.js → chunk-Y6IZDRYW.js} +1 -1
  58. package/dist/{chunk-SSSIPHG7.js → chunk-ZDYBRXXU.js} +1 -1
  59. package/dist/define.cjs +5 -5
  60. package/dist/define.js +1 -1
  61. package/dist/{document-capture-view-QMXAAYA2-62JPLXV7.js → document-capture-view-2NFKF44N-4JPWTBPF.js} +1 -1
  62. package/dist/{eid-view-3QTJORA7-TLA52WL7.js → eid-view-UGYVZ5NM-H7FHAGGG.js} +1 -1
  63. package/dist/{email-otp-view-6MD74OFN-WVIWSE4A.js → email-otp-view-ENQVRS66-5ZB3UKOO.js} +1 -1
  64. package/dist/flow-views-HNJPDQ63-RAX3SDYO.js +1 -0
  65. package/dist/{form-view-YAGVGWMI-CWM5GSJJ.js → form-view-6ERKUFVD-Q2C54SUQ.js} +1 -1
  66. package/dist/index.cjs +5 -5
  67. package/dist/index.d.cts +10 -0
  68. package/dist/index.d.ts +10 -0
  69. package/dist/index.js +1 -1
  70. package/dist/overlay-de-2DL4MNC7-ELIZ2XHC.js +1 -0
  71. package/dist/overlay-es-FMHWRKQW-5PQ3EGK2.js +1 -0
  72. package/dist/overlay-pt-OGIELLCM-QT53YCS2.js +1 -0
  73. package/dist/{portrait-capture-view-6EUUL2QA-ZTAGMPU2.js → portrait-capture-view-ARRN3JW6-RZYLVCCJ.js} +1 -1
  74. package/dist/{portrait-review-view-TTVTYGLG-HVTGBDRR.js → portrait-review-view-JF6TYNBU-NHMROJU3.js} +1 -1
  75. package/dist/{proof-of-address-view-5WWGRXJL-3BWMP23I.js → proof-of-address-view-46Q6F7H5-TPLEKAFW.js} +1 -1
  76. package/package.json +2 -2
  77. package/sbom.cdx.json +4 -4
  78. package/dist/cdn/chunks/chunk-574O5HZZ.js +0 -1
  79. package/dist/cdn/chunks/chunk-5FPDMYLD.js +0 -33
  80. package/dist/cdn/chunks/chunk-BIK4PGBE.js +0 -1
  81. package/dist/cdn/chunks/chunk-CW56KMMH.js +0 -1
  82. package/dist/cdn/chunks/chunk-LAF6JZRH.js +0 -1
  83. package/dist/cdn/chunks/chunk-X42LECG5.js +0 -1
  84. package/dist/cdn/chunks/create-document-capture-X35M4UAK-BB2SCTPK.js +0 -1
  85. package/dist/cdn/chunks/flow-views-AEVFAZOT-DUBO6WU5.js +0 -1
  86. package/dist/cdn/chunks/overlay-de-U5AM34SS-UPJSNTKZ.js +0 -1
  87. package/dist/cdn/chunks/overlay-es-LS4JWU5J-UFZMJAU6.js +0 -1
  88. package/dist/cdn/chunks/overlay-pt-M4ZJJRFE-HJIXIX5G.js +0 -1
  89. package/dist/chunk-BCDTYNQ3.js +0 -1
  90. package/dist/chunk-W23RACX3.js +0 -33
  91. package/dist/flow-views-AEVFAZOT-PKXWQC2K.js +0 -1
  92. package/dist/overlay-de-U5AM34SS-ISYPWAT7.js +0 -1
  93. package/dist/overlay-es-LS4JWU5J-2VRTV7R4.js +0 -1
  94. package/dist/overlay-pt-M4ZJJRFE-UCQAZFCI.js +0 -1
@@ -1 +1 @@
1
- import{a as g}from"./chunk-2WPZFQUP.js";import{K as b,a as k,b as y,c as x}from"./chunk-K5DAJSLX.js";import{a as c,c as f,i as n}from"./chunk-SSU37LFQ.js";var l=f(k(),1),t=f(k(),1),w=f(k(),1),r=f(y(),1),e=f(y(),1);var i,C=(i=class extends w.Component{constructor(){super(...arguments),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}},c(i,"c"),i);n(C,"LoadBoundary");var j=C,F={load:n(()=>import("./flow-views-AEVFAZOT-PKXWQC2K.js"),"load")};function S({view:s,i18n:a,quiet:o,...m}){let[d,h]=(0,t.useState)(0),u=(0,t.useMemo)(()=>(0,t.lazy)(()=>F.load().then(v=>({default:v[s]}))),[s,d]),p=(0,r.jsxs)(b,{tone:"danger",children:[(0,r.jsx)("span",{children:a.t("errors.network_error")}),(0,r.jsx)(x,{kind:"secondary",onClick:c(()=>h(v=>v+1),"onClick"),children:a.t("common.retry")})]});return(0,r.jsx)(j,{fallback:p,children:(0,r.jsx)(t.Suspense,{fallback:o===!0?null:(0,r.jsx)("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:a.t("common.loading")}),children:(0,r.jsx)(u,{...m,i18n:a})})},d)}c(S,"k");n(S,"Flow");var B=(0,l.createContext)(void 0);function H({i18n:s,lead:a,refresh:o,actions:m}){let d=(0,l.useContext)(B),[h,u]=(0,l.useState)(!1);if(d!==void 0)return(0,e.jsx)(S,{view:"HandoffView",i18n:s,url:d,lead:a,...o!==void 0?{refresh:o}:{},footer:m});let p=n(()=>{o!==void 0&&(u(!0),o().catch(()=>{}).finally(()=>u(!1)))},"again");return(0,e.jsx)(g,{tone:"brand",icon:"smartphone",title:s.t("handoff.title"),testId:"sekyro-phone-handoff",actions:(0,e.jsxs)(e.Fragment,{children:[m,o!==void 0?(0,e.jsx)(x,{kind:"secondary",full:!0,disabled:h,onClick:p,children:s.t("common.refresh")}):null]}),children:(0,e.jsx)("p",{children:a})})}c(H,"K");n(H,"PhoneHandoff");export{j as a,S as b,B as c,H as d};
1
+ import{a as g}from"./chunk-Y6IZDRYW.js";import{K as b,a as k,b as y,c as x}from"./chunk-VD7QSFUC.js";import{a as c,c as f,i as n}from"./chunk-SSU37LFQ.js";var l=f(k(),1),t=f(k(),1),w=f(k(),1),r=f(y(),1),e=f(y(),1);var i,C=(i=class extends w.Component{constructor(){super(...arguments),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}},c(i,"c"),i);n(C,"LoadBoundary");var j=C,F={load:n(()=>import("./flow-views-HNJPDQ63-RAX3SDYO.js"),"load")};function S({view:s,i18n:a,quiet:o,...m}){let[d,h]=(0,t.useState)(0),u=(0,t.useMemo)(()=>(0,t.lazy)(()=>F.load().then(v=>({default:v[s]}))),[s,d]),p=(0,r.jsxs)(b,{tone:"danger",children:[(0,r.jsx)("span",{children:a.t("errors.network_error")}),(0,r.jsx)(x,{kind:"secondary",onClick:c(()=>h(v=>v+1),"onClick"),children:a.t("common.retry")})]});return(0,r.jsx)(j,{fallback:p,children:(0,r.jsx)(t.Suspense,{fallback:o===!0?null:(0,r.jsx)("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:a.t("common.loading")}),children:(0,r.jsx)(u,{...m,i18n:a})})},d)}c(S,"k");n(S,"Flow");var B=(0,l.createContext)(void 0);function H({i18n:s,lead:a,refresh:o,actions:m}){let d=(0,l.useContext)(B),[h,u]=(0,l.useState)(!1);if(d!==void 0)return(0,e.jsx)(S,{view:"HandoffView",i18n:s,url:d,lead:a,...o!==void 0?{refresh:o}:{},footer:m});let p=n(()=>{o!==void 0&&(u(!0),o().catch(()=>{}).finally(()=>u(!1)))},"again");return(0,e.jsx)(g,{tone:"brand",icon:"smartphone",title:s.t("handoff.title"),testId:"sekyro-phone-handoff",actions:(0,e.jsxs)(e.Fragment,{children:[m,o!==void 0?(0,e.jsx)(x,{kind:"secondary",full:!0,disabled:h,onClick:p,children:s.t("common.refresh")}):null]}),children:(0,e.jsx)("p",{children:a})})}c(H,"K");n(H,"PhoneHandoff");export{j as a,S as b,B as c,H as d};
@@ -1,4 +1,4 @@
1
- import{d as H}from"./chunk-YC4IK7VG.js";import{a as T,b as C,c as D}from"./chunk-K5DAJSLX.js";import{a as s,b as L,c as N,i as u}from"./chunk-SSU37LFQ.js";var V=L(l=>{"use strict";var Q=T();function I(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(I,"formatProdErrorMessage");function h(){}s(h,"noop");var c={d:{f:h,r:s(function(){throw Error(I(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(I(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 B=L((de,U)=>{"use strict";function j(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j)}catch(r){console.error(r)}}s(j,"checkDCE");j(),U.exports=V()});var W=N(T(),1),f=N(C(),1),a=N(C(),1),E=N(T(),1),Z=N(B(),1),v=N(C(),1);import{screenRampColourValue as Y}from"@sekyro/web";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 z(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(z,"T");u(z,"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 F({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:z(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(F,"x");u(F,"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=H(),R=i==="checking",_=R||i==="frozen",A=_&&m?b("capture.checking"):e,w=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)(F,{progress:o,phase:i,draining:y}),S?.(r),w!=null&&!_?(0,a.jsx)("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:w}):null,x!==null&&!_?(0,a.jsx)(G,{view:x,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,R&&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)(K,{}),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 G({view:r,className:e,kind:t}){let n=(0,W.useId)(),o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)($,{}),(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)(D,{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(G,"H");u(G,"ModeSwitchChip");function $(){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($,"D");u($,"FlipCameraIcon");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 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(K,"G");u(K,"CameraOffIcon");var ie=typeof window>"u"?E.useEffect:E.useLayoutEffect,P="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(P);return n.setAttribute(P,""),o||e.push(()=>n.removeAttribute(P)),()=>{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:Y(r)}}s(X,"B");u(X,"washStyle");function J(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:Y(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{B as a,ne as b,G as c,oe as d};
1
+ import{d as H}from"./chunk-PNZPHUSG.js";import{a as T,b as C,c as D}from"./chunk-VD7QSFUC.js";import{a as s,b as L,c as N,i as u}from"./chunk-SSU37LFQ.js";var V=L(l=>{"use strict";var Q=T();function I(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(I,"formatProdErrorMessage");function h(){}s(h,"noop");var c={d:{f:h,r:s(function(){throw Error(I(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(I(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 B=L((de,U)=>{"use strict";function j(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j)}catch(r){console.error(r)}}s(j,"checkDCE");j(),U.exports=V()});var W=N(T(),1),f=N(C(),1),a=N(C(),1),E=N(T(),1),Z=N(B(),1),v=N(C(),1);import{screenRampColourValue as Y}from"@sekyro/web";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 z(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(z,"T");u(z,"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 F({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:z(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(F,"x");u(F,"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=H(),R=i==="checking",_=R||i==="frozen",A=_&&m?b("capture.checking"):e,w=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)(F,{progress:o,phase:i,draining:y}),S?.(r),w!=null&&!_?(0,a.jsx)("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:w}):null,x!==null&&!_?(0,a.jsx)(G,{view:x,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,R&&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)(K,{}),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 G({view:r,className:e,kind:t}){let n=(0,W.useId)(),o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)($,{}),(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)(D,{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(G,"H");u(G,"ModeSwitchChip");function $(){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($,"D");u($,"FlipCameraIcon");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 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(K,"G");u(K,"CameraOffIcon");var ie=typeof window>"u"?E.useEffect:E.useLayoutEffect,P="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(P);return n.setAttribute(P,""),o||e.push(()=>n.removeAttribute(P)),()=>{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:Y(r)}}s(X,"B");u(X,"washStyle");function J(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:Y(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{B as a,ne as b,G 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{b as hr,d as fr}from"./chunk-XJJ3KCLT.js";import{b as kr,c as bt}from"./chunk-DMESMWZ7.js";import{a as br}from"./chunk-YZ6YGLNN.js";import{c as Ct}from"./chunk-BCDTYNQ3.js";import{a as ur,b as dr,c as pr,d as Re}from"./chunk-YC4IK7VG.js";import{F as yr,K as vr,L as gr,a as H,b as de,c as X,m as or,n as Xe,p as ir,q as et,r as lr,s as cr,t as kt,u as se,v as Ae,w as tt,y as mr}from"./chunk-K5DAJSLX.js";import{a as o,c as E,i as s}from"./chunk-SSU37LFQ.js";var _r=E(H(),1),v=E(de(),1),ee=E(de(),1),ye=E(H(),1),O=E(de(),1),C=E(H(),1),y=E(H(),1),at=E(H(),1),fe=E(de(),1),Dr=E(H(),1),J=E(H(),1),it=E(H(),1),we=E(de(),1),Se=E(de(),1),U=E(de(),1),lt=E(H(),1),pe=E(H(),1),Q=E(H(),1),M=E(H(),1),me=E(H(),1),Pe=E(H(),1),Mt=E(de(),1),k=E(de(),1);import{subscribeCameraPermission as jn}from"@sekyro/web";import{getLivenessAssetsStatus as Pn,preloadLivenessAssets as Tn,subscribeLivenessAssets as Bn}from"@sekyro/web";import{createLivenessCapture as qn}from"@sekyro/web";function oe({className:e,children:t}){return(0,v.jsx)("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}o(oe,"te");s(oe,"Svg");var Lt="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";function wr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,v.jsx)("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}o(wr,"ln");s(wr,"SunIcon");function Sr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,v.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}o(Sr,"un");s(Sr,"FaceUncoveredIcon");function xr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,v.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,v.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}o(xr,"dn");s(xr,"PhoneEyeLevelIcon");function Nr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,v.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}o(Nr,"pn");s(Nr,"LookStraightIcon");function Mr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:Lt}),(0,v.jsx)("path",{d:"M9 13l2 2 4-4"})]})}o(Mr,"fn");s(Mr,"CameraCheckIcon");function Lr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:Lt}),(0,v.jsx)("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}o(Lr,"mn");s(Lr,"CameraAskIcon");function Rr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:Lt}),(0,v.jsx)("path",{d:"M3 3l18 18"})]})}o(Rr,"yn");s(Rr,"CameraBlockedIcon");function nt({off:e,className:t}){return(0,v.jsxs)(oe,{className:t,children:[(0,v.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,v.jsx)("path",{d:"M4 4l16 16"}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,v.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}o(nt,"Ve");s(nt,"SpeakerIcon");function Ar(e){return(0,v.jsx)(oe,{...e,children:(0,v.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}o(Ar,"gn");s(Ar,"CheckIcon");function Er(e){return(0,v.jsxs)(oe,{className:e.className??"sekyro-spinner",children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,v.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}o(Er,"hn");s(Er,"SpinnerIcon");var _t=["light","uncover","eyeLevel","straight"],xn={light:{key:"capture.tips.light",icon:s(()=>(0,ee.jsx)(wr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,ee.jsx)(Sr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,ee.jsx)(xr,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,ee.jsx)(Nr,{}),"icon")}};function Ir({tips:e}){let t=Re(),n=(0,_r.useId)();return e.length===0?null:(0,ee.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,ee.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,ee.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?xn[r]:void 0,i=typeof r=="string"?r:r.id,l=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,u=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,ee.jsxs)("li",{className:"sekyro-tips__item",children:[l!=null?(0,ee.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:l}):null,(0,ee.jsx)("span",{children:u})]},i)})})]})}o(Ir,"Cn");s(Ir,"TipList");var Nn=220;function Ur({title:e,description:t,options:n,busy:r,error:a,focus:i,testId:l,look:u="cards",marked:S,onChoose:h}){let w=(0,ye.useId)(),x=kt(),[I,d]=(0,ye.useState)(null),N=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&d(null)},[a]),(0,ye.useEffect)(()=>()=>{N.current!==null&&clearTimeout(N.current)},[]);let L=s(p=>{r||I!==null||(d(p),N.current=setTimeout(()=>{N.current=null,d(null),h(p)},Nn))},"choose");return(0,O.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":l,children:[(0,O.jsxs)("div",{className:u==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,O.jsx)("h2",{id:w,ref:i?x:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,O.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,O.jsx)(se,{tone:"danger",children:(0,O.jsx)("span",{children:a})}):null,u==="buttons"?(0,O.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((p,j)=>(0,O.jsx)(X,{kind:j===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:o(()=>h(p.id),"onClick"),children:p.label},p.id))}):(0,O.jsx)("div",{className:"sekyro-choices",children:n.map(p=>(0,O.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(I??S)===p.id,"aria-busy":r||void 0,disabled:r||I!==null&&I!==p.id,onClick:o(()=>L(p.id),"onClick"),children:[p.glyph!==void 0?(0,O.jsx)("span",{className:"sekyro-card__tile",children:p.glyph}):null,(0,O.jsxs)("span",{className:"sekyro-card__body",children:[(0,O.jsx)("span",{className:"sekyro-card__title",children:p.label}),p.sub!==void 0?(0,O.jsx)("span",{className:"sekyro-card__sub",children:p.sub}):null]}),(0,O.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},p.id))})]})}o(Ur,"bn");s(Ur,"ChoiceScreen");var jr=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary","capture.lookAtColours"];function st(e){return e!==null&&jr.includes(e)}o(st,"he");s(st,"isVoiceKey");var Mn=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&Mn(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}o(je,"Me");s(je,"resolveClip");var Ln="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Rn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ae(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}o(ae,"ne");s(ae,"synth");function Pr(){return ae()!==null&&typeof SpeechSynthesisUtterance=="function"}o(Pr,"Lr");s(Pr,"speechAvailable");function wt(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}o(wt,"Sn");s(wt,"baseLang");function Rt(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=wt(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>wt(a.lang)===r)}o(Rt,"Mn");s(Rt,"pickVoice");function Tr(e){if(!Pr())return!1;let t=[];try{t=ae()?.getVoices()??[]}catch{return!0}return t.length===0||Rt(t,e)!==void 0}o(Tr,"wn");s(Tr,"speechUsable");function Br(e){let t=ae();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}o(Br,"Ln");s(Br,"subscribeVoices");function Fe(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}o(Fe,"Ke");s(Fe,"clipIdentity");function St(e){e.pause(),e.removeAttribute("src"),e.load()}o(St,"Rn");s(St,"release");function Or(){let e=null,t=null,n=0,r=null,a=[],i=new Map,l=s(()=>{a=ae()?.getVoices()??[]},"loadVoices"),u=!1,S=s(()=>{let d=ae();u||d===null||(u=!0,l(),d.addEventListener?.("voiceschanged",l))},"bindVoices"),h=s(()=>(e??(e=new Audio),e),"element"),w=s((d,N,L)=>{let p=ae();if(p!==null&&d!==""&&typeof SpeechSynthesisUtterance=="function"){S();let j=Rt(a,N);if(a.length===0||j!==void 0){p.cancel();let _=new SpeechSynthesisUtterance(d);_.lang=N,j!==void 0&&(_.voice=j),_.rate=.95,L!==void 0&&(_.onend=_.onerror=L),p.speak(_);return}}L?.()},"speak"),x=s(()=>{n+=1,r=null,e!==null&&(e.pause(),e.currentTime=0),ae()?.cancel()},"stop"),I=s(d=>{for(let N of d){let L=Fe(N);if(i.has(L))continue;let p=new Audio;p.preload="auto",p.src=N,i.set(L,p)}},"warmClips");return{say(d){let N=d.url!==null?Fe(d.url):`tts:${d.lang}:${d.text}`;if(N===r)return;r=N,n+=1;let L=n,p=d.onEnd,j=p!==void 0?()=>{L===n&&p()}:void 0;if(ae()?.cancel(),d.url!==null){let _=h();_.pause(),_.muted=!1,_.src=d.url,_.currentTime=0,_.onended=j??null,_.play()?.catch(A=>{L===n&&A?.name!=="AbortError"&&(d.speech?w(d.text,d.lang,j):j?.())});return}d.speech?w(d.text,d.lang,j):j?.()},unlock({lang:d,speech:N,prefetch:L}){let p=h();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let A=Uint8Array.from(atob(Ln),q=>q.charCodeAt(0));t=URL.createObjectURL(new Blob([A],{type:"audio/wav"}))}let j=p.paused===!1&&t!==null&&p.src!==t;t!==null&&!j&&(p.muted=!0,p.onended=null,p.src=t,p.play()?.catch(()=>{}));let _=ae();if(N&&_!==null&&typeof SpeechSynthesisUtterance=="function"){S();let A=new SpeechSynthesisUtterance(" ");A.volume=0,A.lang=d,_.speak(A)}I(L??[])},prefetch:I,stop:x,dispose(){x(),u&&ae()?.removeEventListener?.("voiceschanged",l),u=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&St(e),e=null;for(let d of i.values())St(d);i.clear()}}}o(Or,"_n");s(Or,"createVoicePlayer");var An="sekyro.voiceGuidance";function qr(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}o(qr,"xn");s(qr,"readVoicePreference");function Vr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}o(Vr,"En");s(Vr,"writeVoicePreference");var Ve="capture.tips.summary",En=typeof window<"u"?C.useLayoutEffect:C.useEffect,In=Object.freeze({});function rt(e,t){let n=new Set,r=[];for(let a of jr){let i=a===Ve?null:je(e,a,t);i===null||n.has(Fe(i))||(n.add(Fe(i)),r.push(i))}return r}o(rt,"ht");s(rt,"resolvedClipUrls");function Fr({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},i=a.storageKey===void 0?An:a.storageKey,[l,u]=(0,C.useState)(a.defaultEnabled??!0),S=(0,C.useRef)(l),[h,w]=(0,C.useState)(!1),[x,I]=(0,C.useState)("none"),[d,N]=(0,C.useState)(!1),L=(0,C.useRef)(!1),[p,j]=(0,C.useState)(0),_=(0,C.useRef)(null),A=(0,C.useCallback)(()=>(_.current??(_.current=Or()),_.current),[]),q=Rn[e],$=a.speechFallback,f=$===void 0||$===!0?!0:$===!1?!1:$.includes(e),G=a.clips??t??In,ie=(0,C.useRef)(!1),le=(0,C.useRef)(G);En(()=>{le.current=G,S.current=l}),(0,C.useEffect)(()=>{if(r||i===null)return;let R=qr(i);R!==null&&(S.current=R,u(R))},[r,i]),(0,C.useEffect)(()=>{if(!(r||!f))return Br(()=>j(R=>R+1))},[r,f]);let c=a.clips;(0,C.useEffect)(()=>{if(r)return;let R=f&&Tr(q);w(rt(G,e).length>0||R),I(c!==void 0&&je(c,Ve,e)!==null?"partner":je(G,Ve,e)!==null||R?"default":"none")},[r,G,c,e,f,q,p]),(0,C.useEffect)(()=>{if(r||!l||!ie.current)return;let R=rt(G,e);R.length>0&&A().prefetch(R)},[r,l,G,e,A]),(0,C.useEffect)(()=>()=>{_.current?.dispose(),_.current=null,ie.current=!1},[]);let V=(0,C.useCallback)(R=>{r||(ie.current=!0,A().unlock({lang:q,speech:f,...R?{prefetch:rt(le.current,e)}:{}}))},[r,A,q,f,e]),P=(0,C.useCallback)(()=>V(S.current),[V]),K=(0,C.useCallback)(()=>{L.current=!1,N(!1)},[]),B=(0,C.useCallback)(()=>{K(),_.current?.stop()},[K]),ve=(0,C.useCallback)(()=>{L.current&&B()},[B]),he=(0,C.useCallback)((R,xe)=>{if(r)return;if(L.current){B();return}let ge=A();ge.stop(),L.current=!0,N(!0);let T=xe?.clip===!1?null:je(le.current,Ve,e);ge.say({url:T,text:R,lang:q,speech:f,onEnd:K})},[r,B,A,e,q,f,K]),z=(0,C.useCallback)(R=>{r||(R?V(!0):B(),i!==null&&Vr(i,R),S.current=R,u(R))},[r,V,B,i]),Z=(0,C.useCallback)(()=>z(!S.current),[z]),te=(0,C.useCallback)((R,xe)=>{if(r||!l)return;L.current&&K();let ge=je(le.current,R,e);A().say({url:ge,text:xe,lang:q,speech:f})},[r,l,e,A,q,f,K]);return(0,C.useMemo)(()=>({supported:!r&&h,enabled:!r&&l,setEnabled:z,toggle:Z,unlock:P,speakKey:te,stop:B,summary:r?"none":x,summaryPlaying:d,toggleSummary:he,stopSummary:ve}),[r,h,l,z,Z,P,te,B,x,d,he,ve])}o(Fr,"vt");s(Fr,"useVoiceGuidance");function Hr(e,t,n,r){let{speakKey:a,stop:i,enabled:l}=e,u=(0,C.useRef)(!1);(0,C.useEffect)(()=>{if(!r||!l){u.current&&i(),u.current=!1;return}u.current=!0,st(t)&&t!==Ve&&n!==""&&a(t,n)},[r,l,t,n,a,i])}o(Hr,"Ct");s(Hr,"useSpeakGuidance");function ot(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}o(ot,"Pn");s(ot,"retryCoachingOf");var He={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function $r({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let i=Re(),l=(0,at.useRef)(null);return(0,at.useEffect)(()=>{r&&l.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:i(He[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:He[t].tips.map(u=>(0,fe.jsx)("li",{children:i(u)},u))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(X,{ref:l,className:"sekyro-btn--start",onClick:a,children:i("capture.recordAgain")}):null]})}o($r,"Tn");s($r,"CapturedPanel");function At(){try{return!1}catch{return!1}}o(At,"nt");s(At,"isDevBuild");var Un=(0,Dr.createContext)(null);function Gr({state:e}){let t=Re(),[n,r]=(0,it.useState)(!1);(0,it.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Mr,{}):e==="denied"?(0,we.jsx)(Rr,{}):(0,we.jsx)(Lr,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}o(Gr,"On");s(Gr,"PermissionRow");function Kr({voice:e}){let t=Re();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:o(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(nt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Ar,{className:"sekyro-switch__check"}):null})})]})}o(Kr,"Hn");s(Kr,"VoiceSwitch");function zr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:i,summary:l,startLabel:u,startDisabled:S,onStart:h}){let w=Re(),x=(0,J.useRef)(l?.stop);x.current=l?.stop,(0,J.useEffect)(()=>()=>x.current?.(),[]);let I=(0,J.useRef)(null),d=(0,J.useRef)(null),N=(0,J.useRef)(null),L=(0,J.useRef)(e),p=(0,J.useRef)(!1);(0,J.useEffect)(()=>{let f=L.current;if(L.current=e,f===e)return;let G=p.current;e!=="loading"&&(p.current=!1),Zr(I.current)&&(e==="failed"?N.current?.focus():G&&d.current?.focus())},[e]);let j=(0,J.useCallback)(()=>{p.current=!0,t()},[t]),_=e==="loading",A=_||S,q=(0,J.useCallback)(()=>{A||(x.current?.(),h())},[A,h]),$;return e==="failed"?$=(0,U.jsxs)(se,{tone:"danger",testId:"sekyro-assets-error",children:[(0,U.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,U.jsx)(X,{kind:"ghost",ref:N,className:"sekyro-btn--start",onClick:j,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):$=(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,U.jsx)(X,{ref:d,full:!0,"data-testid":"sekyro-start","aria-disabled":A?"true":void 0,"aria-busy":_?"true":void 0,onClick:q,children:_?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Er,{}),w("capture.preparing.title")]}):u??w("capture.start")}),_?(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,U.jsxs)("div",{ref:I,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,U.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,i!==!1?(0,U.jsx)(Ir,{tips:i}):null,l!==void 0?(0,U.jsxs)(X,{kind:"ghost",className:"sekyro-btn--start",onClick:l.toggle,"data-testid":"sekyro-tips-listen",children:[(0,U.jsx)(nt,{off:!1}),w(l.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,U.jsx)(Gr,{state:n}),(0,U.jsx)(Kr,{voice:a}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),$,(0,U.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}o(zr,"Fn");s(zr,"PreCaptureScreen");function Zr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}o(Zr,"Ur");s(Zr,"focusIsOurs");function Qr(){let[e,t]=(0,lt.useState)({state:"unknown",settled:!1});return(0,lt.useEffect)(()=>jn(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}o(Qr,"Dn");s(Qr,"useCameraStatus");function Wr(e){return Et(e,"mobileRequired")}o(Wr,"qn");s(Wr,"useMobileRequired");function Jr(e){return Et(e,"returning").required}o(Jr,"jn");s(Jr,"useReturning");function Et(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let i=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(l=>{i&&r({required:l===!0,settled:!0})},()=>{i&&r({required:!1,settled:!0})}),()=>{i=!1}},[e,t]),n}o(Et,"Yn");s(Et,"useFlag");function Yr(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let i=e?.captureMode,l=e?.captureChoice??null;if(e===void 0||typeof i!="function"){r({session:"self",choice:l,settled:!0});return}let u=!0;return r({session:"self",choice:l,settled:!1}),Promise.resolve().then(()=>i.call(e)).then(S=>{let h=e.captureChoice??null;u&&r({session:h!==null&&S===h?"choice":S==="assisted"||S==="choice"?S:"self",choice:h,settled:!0})},()=>{u&&r({session:"self",choice:null,settled:!0})}),()=>{u=!1}},[e]);let a=(0,pe.useCallback)(i=>{e?.chooseCaptureMode?.(i),r(l=>({...l,choice:i}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}o(Yr,"$n");s(Yr,"useCaptureMode");function Xr(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}o(Xr,"zn");s(Xr,"useBusy");var On=s(()=>"idle","serverSnapshot");function xt(e){return Tn(e!==void 0?{assetBaseUrl:e}:{})}o(xt,"Qn");s(xt,"preload");function en(e,t=!0){let n=(0,Q.useSyncExternalStore)((0,Q.useCallback)(h=>Bn(h,e),[e]),()=>Pn(e),On),[r,a]=(0,Q.useState)(null),i=(0,Q.useRef)(!1),l=(0,Q.useCallback)(()=>{xt(e).then(h=>{i.current&&h==="idle"&&a({base:e})})},[e]);(0,Q.useEffect)(()=>(i.current=!0,l(),()=>{i.current=!1}),[l]);let u=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{if(n!=="idle"){u.current={base:e};return}!t||u.current===null||u.current.base!==e||(u.current=null,l())},[n,e,l,t]);let S=(0,Q.useCallback)(()=>{xt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}o(en,"Jn");s(en,"useLivenessAssets");var Cr={progress:0,hint:null,faceDetected:!1};function tn(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,M.useRef)(e.verification).current,a=(0,M.useRef)(!1);e.verification!==r&&!a.current&&At()&&(a.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let i=(0,M.useRef)(null),[l,u]=(0,M.useState)("idle"),[S,h]=(0,M.useState)(Cr),[w,x]=(0,M.useState)(!1),[I,d]=(0,M.useState)(!1),[N,L]=(0,M.useState)(null),[p,j]=(0,M.useState)(!1),[_,A]=(0,M.useState)(null),[q,$]=(0,M.useState)(null),[f,G]=(0,M.useState)(null),[ie,le]=(0,M.useState)(null),[c,V]=(0,M.useState)(null),[P,K]=(0,M.useState)(!1),B=(0,M.useRef)(null),ve=(0,M.useRef)("idle"),he=(0,M.useRef)(-1),[z,Z]=(0,M.useState)(0),te=(0,M.useRef)(e);te.current=e,(0,M.useEffect)(()=>{let Y=t.current;if(Y===null)return;let ce={video:Y,...n!==void 0?{assetBaseUrl:n}:{}},F=r!==void 0?r.liveness(ce):qn(ce);i.current=F;let Ne=s(()=>V(F.facingMode??null),"readFacing");Ne();let $e=[F.on("state",b=>{b==="mode_switch"?K(!0):b!=="starting"&&b!=="gating"&&K(!1),b==="starting"?(ve.current!=="starting"&&(he.current+=1,Z(Math.max(0,he.current))),$(null),G(null),h(Cr),d(!1),x(!1),L(null),A(null),B.current=null):b==="gating"&&ve.current==="recording"&&(d(!1),x(!1),L(null),B.current=null),ve.current=b,Ne(),u(b),te.current.onStateChange?.(b)}),F.on("gate",b=>{let ke=B.current;B.current=b.progress,x(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&d(!0),h(b)}),F.on("frozen",({previewDataUrl:b})=>L(b)),F.on("profile",({animations:b})=>j(b==="reduced")),F.on("ramp",({colour:b})=>A(b)),F.on("captured",b=>{$(b),le(null),te.current.onCaptured?.(b)}),F.on("error",b=>{G(b);let ke=r?.reportCaptureIssue;ke!==void 0&&bt(Ee=>ke.call(r,Ee),kr("liveness",b,Math.max(0,he.current))),te.current.onError?.(b)}),r?.on("result",b=>{le(b),te.current.onResult?.(b)})];return()=>{for(let b of $e)b?.();i.current=null,F.destroy()}},[r,t,n]);let R=(0,M.useCallback)(()=>{i.current?.start()},[]),xe=(0,M.useCallback)(()=>{i.current?.retry()},[]),ge=(0,M.useCallback)(async()=>{let Y=i.current;return Y===null||typeof Y.canSwitchCaptureMode!="function"?!1:await Y.canSwitchCaptureMode().catch(()=>!1)===!0},[]),T=(0,M.useCallback)(async Y=>{let ce=i.current;if(ce===null||typeof ce.setCaptureMode!="function")return!1;let F=await ce.setCaptureMode(Y).catch(()=>!1)===!0;return F&&V(ce.facingMode??null),F},[]);return{state:l,gate:S,draining:w,gateLocked:I,frozenPreview:N,reduceMotion:p,rampColour:_,artifacts:q,error:f,result:ie,facingMode:c,start:R,retry:xe,canSwitchCaptureMode:ge,setCaptureMode:T,modeRestarted:P,attempt:z}}o(tn,"er");s(tn,"useLivenessHandle");var Vn=new Set(["national_number"]);function Nt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>Vn.has(n));return t.length>0?{...e,options:t}:null}o(Nt,"tr");s(Nt,"pending");function rn(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[i,l]=(0,me.useState)(!1),[u,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let x=!0,I=e.methodChoice;typeof I=="function"?(a(!1),Promise.resolve().then(()=>I.call(e)).then(N=>{x&&n(Nt(N))},()=>{}).finally(()=>{x&&a(!0)})):a(!0);let d=e.on("method",N=>n(Nt(N)));return()=>{x=!1,d()}},[e]);let h=(0,me.useCallback)(async x=>{if(e===void 0)return!1;l(!0),S(!1);try{return await e.selectMethod(x),n(null),!0}catch{return S(!0),!1}finally{l(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!u?w:null,settled:r,busy:i,failed:u,select:h}}o(rn,"nr");s(rn,"useMethodChoice");var Fn=["ar","fr","en"];function nn(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}o(nn,"so");s(nn,"isClipUrl");function sn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Fn){let a=t[r];if(!(typeof a!="object"||a===null))for(let[i,l]of Object.entries(a))!st(i)||!nn(l)||((n[r]??(n[r]={}))[i]=l)}return Object.keys(n).length>0?n:null}o(sn,"io");s(sn,"toVoiceClipMap");function an(e){let[t,n]=(0,Pe.useState)(null);(0,Pe.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,i=s(u=>{if(!a)return;let S=typeof u=="object"&&u!==null&&typeof u.setId=="string"?u:null;n(h=>h?.setId===S?.setId?h:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(i,()=>i(null))}catch{i(null)}let l=e.on("view",u=>i(u.voice));return()=>{a=!1,l()}},[e]);let r=(0,Pe.useMemo)(()=>t!==null?sn(t):null,[t]);return e===void 0?null:r}o(an,"rr");s(an,"useServerVoiceClips");function on({voice:e}){let t=Re();return(0,Mt.jsx)(X,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:o(()=>e.toggle(),"onClick"),children:(0,Mt.jsx)(nt,{off:!e.enabled,className:"sekyro-icon"})})}o(on,"sr");s(on,"VoiceChip");var Hn=new Set(["abandoned","not_opened","cancelled","superseded"]),$n=800,Dn="capture.lookAtColours";function ln(e){return e===void 0||e!==!1&&e.length===_t.length&&_t.every(t=>e.includes(t))}o(ln,"fo");s(ln,"isDefaultTips");function cn(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}o(cn,"mo");s(cn,"carriesActivation");function un(e){return typeof e=="object"&&e!==null&&!(0,y.isValidElement)(e)&&"tone"in e&&"text"in e}o(un,"yo");s(un,"isNoticeObject");var Gn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function dn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}o(dn,"ho");s(dn,"isCapturing");function pn(e){return e==="captured"||e==="uploading"||e==="checking"}o(pn,"vo");s(pn,"isPostCapture");function Kn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:i=!1,notice:l,startDisabled:u=!1,startLabel:S,tips:h,tipsSummary:w,coach:x,voice:I,onGuidance:d,onCaptured:N,onResult:L,onError:p,onStateChange:j,assetBaseUrl:_,className:A}){let q=dr(t),$=(0,y.useMemo)(()=>ur(t,r),[t,r,q]),f=(0,y.useMemo)(()=>g=>$[g]??"",[$]),G=n??(t==="ar"?"rtl":"ltr"),ie=(0,y.useRef)(null),le=(0,y.useContext)(Un),c=tn({verification:e,videoRef:ie,assetBaseUrl:_,onCaptured:N,onResult:L,onError:p,onStateChange:j}),V=en(_,c.state==="idle"&&c.error===null),P=rn(e),K=P.choice!==null,B=Wr(e),ve=Jr(e),he=Xr(e),z=Qr(),Z=Yr(e),te=Z.session==="choice",R=Z.mode==="assisted",xe=I!==!1&&I?.clips===void 0,ge=an(xe?e:void 0),T=Fr({locale:t,defaultClips:ge,options:I}),Y=R?"environment":"user",ce=Z.settled,F=(0,y.useRef)(null),Ne=(0,y.useRef)(!1),$e=(0,y.useRef)(T.unlock);$e.current=T.unlock,(0,y.useEffect)(()=>{let g=F.current;if(g===null)return;let ne=["pointerup","touchend","click","keydown"],_e=s(()=>{for(let qe of ne)g.removeEventListener(qe,Le,!0)},"disarm");function Le(qe){if(Ne.current){_e();return}cn(qe)&&(Ne.current=!0,_e(),$e.current())}o(Le,"Re"),s(Le,"onGesture");for(let qe of ne)g.addEventListener(qe,Le,{capture:!0,passive:!0});return _e},[]);let b=(0,y.useCallback)(()=>{Ne.current||(Ne.current=!0,T.unlock()),c.start()},[T.unlock,c.start]),ke=(0,y.useCallback)(()=>c.start(),[c.start]),Ee=(0,y.useRef)(!1),Te=c.state==="idle"&&c.error===null,Ut=!K&&!B.required&&(i===!0||i==="when-permitted"&&z.permission==="granted"),jt=Ut&&P.settled&&B.settled&&ce,mn=i==="when-permitted"&&!z.permissionSettled&&!Ee.current,Pt=Ut&&Te&&!Ee.current,ut=(mn||Pt||!ce)&&V.gate==="ready"?"loading":V.gate;(0,y.useEffect)(()=>{!jt||!Te||V.gate!=="ready"||Ee.current||(Ee.current=!0,ke())},[jt,Te,V.gate,ke]);let yn=Te&&!K&&!B.required&&!(Pt&&V.gate==="ready"),[Tt,Bt]=(0,y.useState)(!1),{canSwitchCaptureMode:Ot,setCaptureMode:qt}=c;(0,y.useEffect)(()=>{if(!Z.settled||!te){Bt(!1);return}let g=!0;return Ot().then(ne=>{g&&Bt(ne)}),()=>{g=!1}},[Z.settled,te,Ot]);let{choose:Vt}=Z,Ie=R?"self":"assisted",vn=(0,y.useCallback)(async()=>{await qt(Ie)&&Vt(Ie)},[qt,Vt,Ie]),Ft=c.state!=="idle"&&c.facingMode!==null?c.facingMode:Y;(0,y.useEffect)(()=>{let g=ie.current?.style;Ft==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[Ft]);let De=(0,y.useMemo)(()=>c.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(c.artifacts.keyframe):null,[c.artifacts]);(0,y.useEffect)(()=>{if(De!==null)return()=>URL.revokeObjectURL(De)},[De]);let Ht=c.frozenPreview??De,Ue=e!==void 0,D=dn(c.state),be=pn(c.state),Ge=D||be,re=c.result,$t=c.state==="done"&&re!==null,Ke=D&&c.rampColour!==null,dt=c.state==="recording"&&c.frozenPreview!==null&&!Ke,ze=le!==null,Dt=Tt&&D&&!dt?{to:Ie,label:f(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:f(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{vn()},"onSwitch")}:null,Ze=c.modeRestarted&&D?f("capture.modeSwitch.restarted"):null,Be=be||dt,Gt=be?"checking":dt?"frozen":c.state==="recording"||Ke?"recording":c.gateLocked||c.gate.progress>=1?"locked":c.gate.faceDetected?"aligning":"seeking",Qe=D?c.gate.hint:null,We=c.state==="starting"?"capture.preparing.title":Qe===null?null:Qe==="center"&&!c.gate.faceDetected?"fcv3.no_face":or(Qe),[gn,Kt]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(We!=="fcv3.no_face"){Kt(We);return}if(!D)return;let g=setTimeout(()=>Kt(We),$n);return()=>clearTimeout(g)},[We,D]);let pt=D&&!Ke&&typeof x=="string"&&x!=="",zt=R&&D?f("capture.assisted.stage"):null,Me=D&&!pt?Ke?Dn:gn:null,ht=pt?x:Me===null?"":f(Me);Hr(T,Me,ht,D);let Zt=(0,y.useRef)(d);Zt.current=d,(0,y.useEffect)(()=>{if(st(Me))try{Zt.current?.(Me)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Me]);let Oe=(0,y.useMemo)(()=>({supported:T.supported,enabled:T.enabled,setEnabled:T.setEnabled,toggle:T.toggle}),[T.supported,T.enabled,T.setEnabled,T.toggle]),ft=a?.voicePrompt,Qt=ft!==void 0,Wt=I===void 0,Jt=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!Qt||!Wt||Jt.current||!At()||(Jt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[Qt,Wt]);let kn=ft!==void 0?(g,ne,_e)=>ft(g,ne,_e,Oe):T.supported?()=>(0,k.jsx)(on,{voice:Oe}):void 0,{summary:mt,summaryPlaying:Yt,toggleSummary:Xt,stopSummary:er}=T,Je=w!==void 0&&w!=="",tr=Je?w:f("capture.tips.summary"),rr=Je?mt!=="none":mt==="partner"||mt==="default"&&ln(h),bn=(0,y.useMemo)(()=>rr?{playing:Yt,toggle:s(()=>Xt(tr,{clip:!Je}),"toggle"),stop:er}:void 0,[rr,Yt,Xt,tr,er,Je]),Cn=(0,y.useMemo)(()=>({assets:ut,retryAssets:V.retry,permission:z.permission,permissionSettled:z.permissionSettled,captureMode:Z.mode,facing:Y,voice:Oe}),[ut,V.retry,z.permission,z.permissionSettled,Z.mode,Y,Oe]),_n=un(l)?(0,k.jsx)(se,{tone:l.tone,testId:"sekyro-host-notice",children:(0,k.jsx)("span",{children:l.text})}):l??null,ue=re!==null&&re.status==="retry"?re:null,W=$t&&re.status==="unavailable"&&!K&&re.reasonCode!=="portrait_required"?re:null,Ce=$t&&(re.status==="verified"||re.status==="not_verified"||re.status==="review")?re:null,yt=s((g,ne)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Le=lr(t,ne);if(Le!==null)return f(Le.key).replace("{time}",Le.time)}let _e=et(g);return _e===null?null:f(_e)},"reasonText"),vt=s(g=>{let ne=g.retakeHint===void 0?null:Xe(g.retakeHint);return ne===null?yt(g.reasonCode):f(ne)},"retryText"),nr=Ce===null?null:yt(Ce.reasonCode,Ce.retryAfter)??(Ce.status==="not_verified"&&Ce.reason!==void 0&&Hn.has(Ce.reason)?f("errors.session_expired"):null),wn=W!==null&&W.reasonCode!==void 0&&W.reasonCode!=="nni_unbound"&&W.reasonCode!=="id_number_unbound"&&W.reasonCode!=="method_required"&&W.reasonCode!=="mobile_required"&&!(W.reasonCode==="no_recorder"&&c.artifacts?.degraded==="NO_RECORDER"),Ye=W?.reasonCode,sr=c.attempt;(0,y.useEffect)(()=>{W===null||Ye===void 0||e?.reportCaptureIssue===void 0||Gn.has(Ye)||bt(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Ye,attempt:Math.min(1e3,sr)})},[W,Ye,sr,e]);let ar=kt(),Sn=K&&P.auto===null&&!D&&!be&&c.error===null,gt=(0,y.useCallback)(async g=>{await P.select(g)&&c.state==="done"&&c.retry()},[P.select,c.state,c.retry]);return(0,y.useEffect)(()=>{P.auto!==null&&!P.busy&&!D&&!be&&gt(P.auto)},[P.auto,P.busy,D,be,gt]),(0,k.jsx)(pr,{value:f,children:(0,k.jsxs)("div",{ref:F,className:A===void 0?"sekyro-capture":`sekyro-capture ${A}`,dir:G,lang:t,"data-testid":"sekyro-liveness-capture","data-state":c.state,children:[a?.header,ue!==null&&vt(ue)!==null&&!(ze&&Ge)?(0,k.jsx)(se,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,k.jsx)("span",{children:vt(ue)})}):null,Ze!==null&&!ze?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,k.jsx)("span",{children:Ze})}):null,he&&be&&!ze?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,k.jsx)("span",{children:f("capture.busy")})}):null,B.required&&Te?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,k.jsx)("span",{children:f("reasons.mobile_required")})}):null,c.error!==null?a?.errorPanel!==void 0?a.errorPanel(c.error,c.retry):(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-error-notice",children:[(0,k.jsx)("span",{children:f(ir(c.error))}),c.error.retryable?(0,k.jsx)(X,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("common.retry")}):null]}):null,W!==null?(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,k.jsx)("span",{children:yt(W.reasonCode)??f(W.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),wn?(0,k.jsx)(X,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("capture.recordAgain")}):null]}):null,nr!==null&&Ce!==null?(0,k.jsx)(se,{tone:Ce.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,k.jsx)("span",{children:nr})}):null,(0,k.jsx)("div",{className:Ge?void 0:"sekyro-hidden","data-capture-live":Ge?"":void 0,children:ze?le({videoRef:ie,guidance:Be&&Ue?f("capture.checking"):ht,coached:pt&&!(Be&&Ue),note:Be?Ue?f(he?"capture.busy":"capture.checkingHint"):null:Ze??(ue!==null?vt(ue):zt),settled:Be&&Ue,progress:c.gate.progress,phase:Gt,still:Be?Ht:null,live:Ge,modeSwitch:Dt,...Tt?{status:Ze}:{},ramp:c.rampColour===null?null:{colour:c.rampColour}}):(0,k.jsx)(hr,{videoRef:ie,guidanceText:ht,guidanceHint:Qe,guidanceKey:Me,progress:c.gate.progress,phase:Gt,draining:c.draining,stillUrl:Ht,showChecking:Ue,operatorText:zt,voicePrompt:kn,overlay:o(g=>(0,k.jsxs)(k.Fragment,{children:[a?.stageOverlay?.(g),(0,k.jsx)(fr,{colour:c.rampColour})]}),"overlay"),reduceMotion:c.reduceMotion,modeSwitch:Dt})}),Sn&&P.choice!==null?(0,k.jsx)(Ur,{title:f("method.title"),description:f("method.description"),options:P.choice.options.map(g=>({id:g,label:f(`method.${g}`)})),busy:P.busy,error:P.failed?f("errors.network_error"):null,focus:c.state==="done",testId:"sekyro-method",look:"buttons",onChoose:o(g=>{gt(g)},"onChoose")}):null,yn?(0,k.jsxs)(k.Fragment,{children:[ve&&a?.header===void 0&&a?.intro===void 0?(0,k.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,k.jsx)("h2",{className:"sekyro-text-body",children:f("returning.title")}),(0,k.jsx)("p",{className:"sekyro-text-muted",children:f("returning.description")})]}):null,_n,a?.intro!==void 0?a.intro(b,Cn):(0,k.jsx)(zr,{assets:ut,onRetryAssets:V.retry,permission:z.permission,captureMode:Z.mode,voice:Oe,tips:h??_t,summary:bn,startLabel:S,startDisabled:u,onStart:b})]}):null,(0,k.jsx)($r,{showCoaching:ue!==null,coaching:ot(ue?.reasonCode),attemptsText:ue?.attemptsRemaining!==void 0?cr($,t,ue.attemptsRemaining):null,showRetake:ue!==null&&!D&&!be||!Ue&&c.state==="captured",onRetake:c.retry}),a?.footer]})})}o(Kn,"xi");s(Kn,"LivenessCapture");var It=E(H(),1),ct=E(H(),1),m=E(de(),1);import{isInAppBrowser as es}from"@sekyro/web/client";var ks={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function zn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}o(zn,"Y");s(zn,"identityLabel");function Zn(e,t){let[n,r]=(0,It.useState)(!1),[a,i]=(0,It.useState)(null);return{busy:n,error:a,run:s(l=>{r(!0),i(null),l().then(()=>r(!1),u=>{r(!1),i(e.t(br(u,e.strings))),t?.(u)})},"run")}}o(Zn,"q");s(Zn,"useChoiceAction");function hn(){let e=`sekyro-face-light-${(0,ct.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,m.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,m.jsx)("defs",{children:(0,m.jsx)("mask",{id:e,children:(0,m.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,m.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,m.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}o(hn,"O");s(hn,"FaceMark");var Qn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Wn(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}o(Wn,"te");s(Wn,"faceIntroRetryOf");var Jn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function Yn({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:i=!1,notice:l,retry:u}){let S=Ct(),{t:h}=S,w=u===void 0?"face":ot(u.reason),x=w==="face"?null:He[w].tips,I=(0,ct.useContext)(yr)?.busy===!0;return(0,m.jsxs)("section",{className:"sekyro-step",children:[(0,m.jsx)(hn,{}),t.captureMode==="assisted"?(0,m.jsx)(tt,{title:h("capture.assisted.heading"),lead:h("capture.assisted.lead")}):i?(0,m.jsx)(tt,{title:h("returning.heading"),lead:h("returning.description")}):(0,m.jsx)(tt,{title:h(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:h(a?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?(0,m.jsx)(fn,{retry:u,title:He[w].title}):null,r!==void 0&&x===null?(0,m.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,m.jsx)("ul",{className:"sekyro-tiprows",children:x!==null?x.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:Jn[d]??"face"}),h(d)]},d)):n!==void 0?n.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:Qn[d.id]??"face"}),d.text]},d.id)):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"light"}),h("capture.tips.light")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"jGlasses"}),h("capture.tips.uncover")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"smartphone"}),h("capture.tips.eyeLevel")]})]})}),l??null,l!==void 0?null:t.assets==="failed"?(0,m.jsx)(X,{kind:"secondary",full:!0,onClick:t.retryAssets,children:h("common.retry")}):null,l!==void 0?null:(0,m.jsx)(mr,{children:(0,m.jsxs)(X,{full:!0,disabled:t.assets!=="ready"||I,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,m.jsx)(Ae,{name:"camera"}),h("capture.start")]})})]})}o(Yn,"ne");s(Yn,"FaceIntro");var Xn=new Set(["match_inconclusive","no_face_source","below_threshold"]);function fn({retry:e,title:t}){let n=Ct(),r=e.retakeHint===void 0?null:Xe(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":Xn.has(e.reason)?"capture.retryMatch.message":et(e.reason);return(0,m.jsxs)(vr,{tone:"warning",children:[r!==null?(0,m.jsx)("span",{children:n.t(r)}):a!==null?(0,m.jsx)("span",{children:n.t(a)}):null,r===null?(0,m.jsx)("span",{children:n.t(t)}):null,(0,m.jsx)("span",{children:gr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}o(fn,"T");s(fn,"RetryNotice");function ts(e){return es(e)}o(ts,"se");s(ts,"isInAppBrowser");function rs(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}o(rs,"ce");s(rs,"androidBrowserIntent");export{Ur as a,At as b,Un as c,Yr as d,Kn as e,ks as f,zn as g,Zn as h,Wn as i,Yn as j,ts as k,rs as l};
1
+ import{b as hr,d as fr}from"./chunk-NC6MJEKS.js";import{b as kr,c as bt}from"./chunk-43AFSR5C.js";import{a as br}from"./chunk-YZ6YGLNN.js";import{c as Ct}from"./chunk-5MQUCOFK.js";import{a as ur,b as dr,c as pr,d as Re}from"./chunk-PNZPHUSG.js";import{F as yr,K as vr,L as gr,a as H,b as de,c as X,m as or,n as Xe,p as ir,q as et,r as lr,s as cr,t as kt,u as se,v as Ae,w as tt,y as mr}from"./chunk-VD7QSFUC.js";import{a as o,c as E,i as s}from"./chunk-SSU37LFQ.js";var _r=E(H(),1),v=E(de(),1),ee=E(de(),1),ye=E(H(),1),O=E(de(),1),C=E(H(),1),y=E(H(),1),at=E(H(),1),fe=E(de(),1),Dr=E(H(),1),J=E(H(),1),it=E(H(),1),we=E(de(),1),Se=E(de(),1),U=E(de(),1),lt=E(H(),1),pe=E(H(),1),Q=E(H(),1),M=E(H(),1),me=E(H(),1),Pe=E(H(),1),Mt=E(de(),1),k=E(de(),1);import{subscribeCameraPermission as jn}from"@sekyro/web";import{getLivenessAssetsStatus as Pn,preloadLivenessAssets as Tn,subscribeLivenessAssets as Bn}from"@sekyro/web";import{createLivenessCapture as qn}from"@sekyro/web";function oe({className:e,children:t}){return(0,v.jsx)("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}o(oe,"te");s(oe,"Svg");var Lt="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";function wr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,v.jsx)("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}o(wr,"ln");s(wr,"SunIcon");function Sr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,v.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}o(Sr,"un");s(Sr,"FaceUncoveredIcon");function xr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,v.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,v.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}o(xr,"dn");s(xr,"PhoneEyeLevelIcon");function Nr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,v.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}o(Nr,"pn");s(Nr,"LookStraightIcon");function Mr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:Lt}),(0,v.jsx)("path",{d:"M9 13l2 2 4-4"})]})}o(Mr,"fn");s(Mr,"CameraCheckIcon");function Lr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:Lt}),(0,v.jsx)("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}o(Lr,"mn");s(Lr,"CameraAskIcon");function Rr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:Lt}),(0,v.jsx)("path",{d:"M3 3l18 18"})]})}o(Rr,"yn");s(Rr,"CameraBlockedIcon");function nt({off:e,className:t}){return(0,v.jsxs)(oe,{className:t,children:[(0,v.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,v.jsx)("path",{d:"M4 4l16 16"}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,v.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}o(nt,"Ve");s(nt,"SpeakerIcon");function Ar(e){return(0,v.jsx)(oe,{...e,children:(0,v.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}o(Ar,"gn");s(Ar,"CheckIcon");function Er(e){return(0,v.jsxs)(oe,{className:e.className??"sekyro-spinner",children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,v.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}o(Er,"hn");s(Er,"SpinnerIcon");var _t=["light","uncover","eyeLevel","straight"],xn={light:{key:"capture.tips.light",icon:s(()=>(0,ee.jsx)(wr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,ee.jsx)(Sr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,ee.jsx)(xr,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,ee.jsx)(Nr,{}),"icon")}};function Ir({tips:e}){let t=Re(),n=(0,_r.useId)();return e.length===0?null:(0,ee.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,ee.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,ee.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?xn[r]:void 0,i=typeof r=="string"?r:r.id,l=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,u=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,ee.jsxs)("li",{className:"sekyro-tips__item",children:[l!=null?(0,ee.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:l}):null,(0,ee.jsx)("span",{children:u})]},i)})})]})}o(Ir,"Cn");s(Ir,"TipList");var Nn=220;function Ur({title:e,description:t,options:n,busy:r,error:a,focus:i,testId:l,look:u="cards",marked:S,onChoose:h}){let w=(0,ye.useId)(),x=kt(),[I,d]=(0,ye.useState)(null),N=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&d(null)},[a]),(0,ye.useEffect)(()=>()=>{N.current!==null&&clearTimeout(N.current)},[]);let L=s(p=>{r||I!==null||(d(p),N.current=setTimeout(()=>{N.current=null,d(null),h(p)},Nn))},"choose");return(0,O.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":l,children:[(0,O.jsxs)("div",{className:u==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,O.jsx)("h2",{id:w,ref:i?x:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,O.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,O.jsx)(se,{tone:"danger",children:(0,O.jsx)("span",{children:a})}):null,u==="buttons"?(0,O.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((p,j)=>(0,O.jsx)(X,{kind:j===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:o(()=>h(p.id),"onClick"),children:p.label},p.id))}):(0,O.jsx)("div",{className:"sekyro-choices",children:n.map(p=>(0,O.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(I??S)===p.id,"aria-busy":r||void 0,disabled:r||I!==null&&I!==p.id,onClick:o(()=>L(p.id),"onClick"),children:[p.glyph!==void 0?(0,O.jsx)("span",{className:"sekyro-card__tile",children:p.glyph}):null,(0,O.jsxs)("span",{className:"sekyro-card__body",children:[(0,O.jsx)("span",{className:"sekyro-card__title",children:p.label}),p.sub!==void 0?(0,O.jsx)("span",{className:"sekyro-card__sub",children:p.sub}):null]}),(0,O.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},p.id))})]})}o(Ur,"bn");s(Ur,"ChoiceScreen");var jr=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary","capture.lookAtColours"];function st(e){return e!==null&&jr.includes(e)}o(st,"he");s(st,"isVoiceKey");var Mn=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&Mn(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}o(je,"Me");s(je,"resolveClip");var Ln="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Rn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ae(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}o(ae,"ne");s(ae,"synth");function Pr(){return ae()!==null&&typeof SpeechSynthesisUtterance=="function"}o(Pr,"Lr");s(Pr,"speechAvailable");function wt(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}o(wt,"Sn");s(wt,"baseLang");function Rt(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=wt(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>wt(a.lang)===r)}o(Rt,"Mn");s(Rt,"pickVoice");function Tr(e){if(!Pr())return!1;let t=[];try{t=ae()?.getVoices()??[]}catch{return!0}return t.length===0||Rt(t,e)!==void 0}o(Tr,"wn");s(Tr,"speechUsable");function Br(e){let t=ae();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}o(Br,"Ln");s(Br,"subscribeVoices");function Fe(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}o(Fe,"Ke");s(Fe,"clipIdentity");function St(e){e.pause(),e.removeAttribute("src"),e.load()}o(St,"Rn");s(St,"release");function Or(){let e=null,t=null,n=0,r=null,a=[],i=new Map,l=s(()=>{a=ae()?.getVoices()??[]},"loadVoices"),u=!1,S=s(()=>{let d=ae();u||d===null||(u=!0,l(),d.addEventListener?.("voiceschanged",l))},"bindVoices"),h=s(()=>(e??(e=new Audio),e),"element"),w=s((d,N,L)=>{let p=ae();if(p!==null&&d!==""&&typeof SpeechSynthesisUtterance=="function"){S();let j=Rt(a,N);if(a.length===0||j!==void 0){p.cancel();let _=new SpeechSynthesisUtterance(d);_.lang=N,j!==void 0&&(_.voice=j),_.rate=.95,L!==void 0&&(_.onend=_.onerror=L),p.speak(_);return}}L?.()},"speak"),x=s(()=>{n+=1,r=null,e!==null&&(e.pause(),e.currentTime=0),ae()?.cancel()},"stop"),I=s(d=>{for(let N of d){let L=Fe(N);if(i.has(L))continue;let p=new Audio;p.preload="auto",p.src=N,i.set(L,p)}},"warmClips");return{say(d){let N=d.url!==null?Fe(d.url):`tts:${d.lang}:${d.text}`;if(N===r)return;r=N,n+=1;let L=n,p=d.onEnd,j=p!==void 0?()=>{L===n&&p()}:void 0;if(ae()?.cancel(),d.url!==null){let _=h();_.pause(),_.muted=!1,_.src=d.url,_.currentTime=0,_.onended=j??null,_.play()?.catch(A=>{L===n&&A?.name!=="AbortError"&&(d.speech?w(d.text,d.lang,j):j?.())});return}d.speech?w(d.text,d.lang,j):j?.()},unlock({lang:d,speech:N,prefetch:L}){let p=h();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let A=Uint8Array.from(atob(Ln),q=>q.charCodeAt(0));t=URL.createObjectURL(new Blob([A],{type:"audio/wav"}))}let j=p.paused===!1&&t!==null&&p.src!==t;t!==null&&!j&&(p.muted=!0,p.onended=null,p.src=t,p.play()?.catch(()=>{}));let _=ae();if(N&&_!==null&&typeof SpeechSynthesisUtterance=="function"){S();let A=new SpeechSynthesisUtterance(" ");A.volume=0,A.lang=d,_.speak(A)}I(L??[])},prefetch:I,stop:x,dispose(){x(),u&&ae()?.removeEventListener?.("voiceschanged",l),u=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&St(e),e=null;for(let d of i.values())St(d);i.clear()}}}o(Or,"_n");s(Or,"createVoicePlayer");var An="sekyro.voiceGuidance";function qr(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}o(qr,"xn");s(qr,"readVoicePreference");function Vr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}o(Vr,"En");s(Vr,"writeVoicePreference");var Ve="capture.tips.summary",En=typeof window<"u"?C.useLayoutEffect:C.useEffect,In=Object.freeze({});function rt(e,t){let n=new Set,r=[];for(let a of jr){let i=a===Ve?null:je(e,a,t);i===null||n.has(Fe(i))||(n.add(Fe(i)),r.push(i))}return r}o(rt,"ht");s(rt,"resolvedClipUrls");function Fr({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},i=a.storageKey===void 0?An:a.storageKey,[l,u]=(0,C.useState)(a.defaultEnabled??!0),S=(0,C.useRef)(l),[h,w]=(0,C.useState)(!1),[x,I]=(0,C.useState)("none"),[d,N]=(0,C.useState)(!1),L=(0,C.useRef)(!1),[p,j]=(0,C.useState)(0),_=(0,C.useRef)(null),A=(0,C.useCallback)(()=>(_.current??(_.current=Or()),_.current),[]),q=Rn[e],$=a.speechFallback,f=$===void 0||$===!0?!0:$===!1?!1:$.includes(e),G=a.clips??t??In,ie=(0,C.useRef)(!1),le=(0,C.useRef)(G);En(()=>{le.current=G,S.current=l}),(0,C.useEffect)(()=>{if(r||i===null)return;let R=qr(i);R!==null&&(S.current=R,u(R))},[r,i]),(0,C.useEffect)(()=>{if(!(r||!f))return Br(()=>j(R=>R+1))},[r,f]);let c=a.clips;(0,C.useEffect)(()=>{if(r)return;let R=f&&Tr(q);w(rt(G,e).length>0||R),I(c!==void 0&&je(c,Ve,e)!==null?"partner":je(G,Ve,e)!==null||R?"default":"none")},[r,G,c,e,f,q,p]),(0,C.useEffect)(()=>{if(r||!l||!ie.current)return;let R=rt(G,e);R.length>0&&A().prefetch(R)},[r,l,G,e,A]),(0,C.useEffect)(()=>()=>{_.current?.dispose(),_.current=null,ie.current=!1},[]);let V=(0,C.useCallback)(R=>{r||(ie.current=!0,A().unlock({lang:q,speech:f,...R?{prefetch:rt(le.current,e)}:{}}))},[r,A,q,f,e]),P=(0,C.useCallback)(()=>V(S.current),[V]),K=(0,C.useCallback)(()=>{L.current=!1,N(!1)},[]),B=(0,C.useCallback)(()=>{K(),_.current?.stop()},[K]),ve=(0,C.useCallback)(()=>{L.current&&B()},[B]),he=(0,C.useCallback)((R,xe)=>{if(r)return;if(L.current){B();return}let ge=A();ge.stop(),L.current=!0,N(!0);let T=xe?.clip===!1?null:je(le.current,Ve,e);ge.say({url:T,text:R,lang:q,speech:f,onEnd:K})},[r,B,A,e,q,f,K]),z=(0,C.useCallback)(R=>{r||(R?V(!0):B(),i!==null&&Vr(i,R),S.current=R,u(R))},[r,V,B,i]),Z=(0,C.useCallback)(()=>z(!S.current),[z]),te=(0,C.useCallback)((R,xe)=>{if(r||!l)return;L.current&&K();let ge=je(le.current,R,e);A().say({url:ge,text:xe,lang:q,speech:f})},[r,l,e,A,q,f,K]);return(0,C.useMemo)(()=>({supported:!r&&h,enabled:!r&&l,setEnabled:z,toggle:Z,unlock:P,speakKey:te,stop:B,summary:r?"none":x,summaryPlaying:d,toggleSummary:he,stopSummary:ve}),[r,h,l,z,Z,P,te,B,x,d,he,ve])}o(Fr,"vt");s(Fr,"useVoiceGuidance");function Hr(e,t,n,r){let{speakKey:a,stop:i,enabled:l}=e,u=(0,C.useRef)(!1);(0,C.useEffect)(()=>{if(!r||!l){u.current&&i(),u.current=!1;return}u.current=!0,st(t)&&t!==Ve&&n!==""&&a(t,n)},[r,l,t,n,a,i])}o(Hr,"Ct");s(Hr,"useSpeakGuidance");function ot(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}o(ot,"Pn");s(ot,"retryCoachingOf");var He={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function $r({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let i=Re(),l=(0,at.useRef)(null);return(0,at.useEffect)(()=>{r&&l.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:i(He[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:He[t].tips.map(u=>(0,fe.jsx)("li",{children:i(u)},u))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(X,{ref:l,className:"sekyro-btn--start",onClick:a,children:i("capture.recordAgain")}):null]})}o($r,"Tn");s($r,"CapturedPanel");function At(){try{return!1}catch{return!1}}o(At,"nt");s(At,"isDevBuild");var Un=(0,Dr.createContext)(null);function Gr({state:e}){let t=Re(),[n,r]=(0,it.useState)(!1);(0,it.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Mr,{}):e==="denied"?(0,we.jsx)(Rr,{}):(0,we.jsx)(Lr,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}o(Gr,"On");s(Gr,"PermissionRow");function Kr({voice:e}){let t=Re();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:o(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(nt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Ar,{className:"sekyro-switch__check"}):null})})]})}o(Kr,"Hn");s(Kr,"VoiceSwitch");function zr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:i,summary:l,startLabel:u,startDisabled:S,onStart:h}){let w=Re(),x=(0,J.useRef)(l?.stop);x.current=l?.stop,(0,J.useEffect)(()=>()=>x.current?.(),[]);let I=(0,J.useRef)(null),d=(0,J.useRef)(null),N=(0,J.useRef)(null),L=(0,J.useRef)(e),p=(0,J.useRef)(!1);(0,J.useEffect)(()=>{let f=L.current;if(L.current=e,f===e)return;let G=p.current;e!=="loading"&&(p.current=!1),Zr(I.current)&&(e==="failed"?N.current?.focus():G&&d.current?.focus())},[e]);let j=(0,J.useCallback)(()=>{p.current=!0,t()},[t]),_=e==="loading",A=_||S,q=(0,J.useCallback)(()=>{A||(x.current?.(),h())},[A,h]),$;return e==="failed"?$=(0,U.jsxs)(se,{tone:"danger",testId:"sekyro-assets-error",children:[(0,U.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,U.jsx)(X,{kind:"ghost",ref:N,className:"sekyro-btn--start",onClick:j,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):$=(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,U.jsx)(X,{ref:d,full:!0,"data-testid":"sekyro-start","aria-disabled":A?"true":void 0,"aria-busy":_?"true":void 0,onClick:q,children:_?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Er,{}),w("capture.preparing.title")]}):u??w("capture.start")}),_?(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,U.jsxs)("div",{ref:I,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,U.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,i!==!1?(0,U.jsx)(Ir,{tips:i}):null,l!==void 0?(0,U.jsxs)(X,{kind:"ghost",className:"sekyro-btn--start",onClick:l.toggle,"data-testid":"sekyro-tips-listen",children:[(0,U.jsx)(nt,{off:!1}),w(l.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,U.jsx)(Gr,{state:n}),(0,U.jsx)(Kr,{voice:a}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),$,(0,U.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}o(zr,"Fn");s(zr,"PreCaptureScreen");function Zr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}o(Zr,"Ur");s(Zr,"focusIsOurs");function Qr(){let[e,t]=(0,lt.useState)({state:"unknown",settled:!1});return(0,lt.useEffect)(()=>jn(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}o(Qr,"Dn");s(Qr,"useCameraStatus");function Wr(e){return Et(e,"mobileRequired")}o(Wr,"qn");s(Wr,"useMobileRequired");function Jr(e){return Et(e,"returning").required}o(Jr,"jn");s(Jr,"useReturning");function Et(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let i=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(l=>{i&&r({required:l===!0,settled:!0})},()=>{i&&r({required:!1,settled:!0})}),()=>{i=!1}},[e,t]),n}o(Et,"Yn");s(Et,"useFlag");function Yr(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let i=e?.captureMode,l=e?.captureChoice??null;if(e===void 0||typeof i!="function"){r({session:"self",choice:l,settled:!0});return}let u=!0;return r({session:"self",choice:l,settled:!1}),Promise.resolve().then(()=>i.call(e)).then(S=>{let h=e.captureChoice??null;u&&r({session:h!==null&&S===h?"choice":S==="assisted"||S==="choice"?S:"self",choice:h,settled:!0})},()=>{u&&r({session:"self",choice:null,settled:!0})}),()=>{u=!1}},[e]);let a=(0,pe.useCallback)(i=>{e?.chooseCaptureMode?.(i),r(l=>({...l,choice:i}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}o(Yr,"$n");s(Yr,"useCaptureMode");function Xr(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}o(Xr,"zn");s(Xr,"useBusy");var On=s(()=>"idle","serverSnapshot");function xt(e){return Tn(e!==void 0?{assetBaseUrl:e}:{})}o(xt,"Qn");s(xt,"preload");function en(e,t=!0){let n=(0,Q.useSyncExternalStore)((0,Q.useCallback)(h=>Bn(h,e),[e]),()=>Pn(e),On),[r,a]=(0,Q.useState)(null),i=(0,Q.useRef)(!1),l=(0,Q.useCallback)(()=>{xt(e).then(h=>{i.current&&h==="idle"&&a({base:e})})},[e]);(0,Q.useEffect)(()=>(i.current=!0,l(),()=>{i.current=!1}),[l]);let u=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{if(n!=="idle"){u.current={base:e};return}!t||u.current===null||u.current.base!==e||(u.current=null,l())},[n,e,l,t]);let S=(0,Q.useCallback)(()=>{xt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}o(en,"Jn");s(en,"useLivenessAssets");var Cr={progress:0,hint:null,faceDetected:!1};function tn(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,M.useRef)(e.verification).current,a=(0,M.useRef)(!1);e.verification!==r&&!a.current&&At()&&(a.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let i=(0,M.useRef)(null),[l,u]=(0,M.useState)("idle"),[S,h]=(0,M.useState)(Cr),[w,x]=(0,M.useState)(!1),[I,d]=(0,M.useState)(!1),[N,L]=(0,M.useState)(null),[p,j]=(0,M.useState)(!1),[_,A]=(0,M.useState)(null),[q,$]=(0,M.useState)(null),[f,G]=(0,M.useState)(null),[ie,le]=(0,M.useState)(null),[c,V]=(0,M.useState)(null),[P,K]=(0,M.useState)(!1),B=(0,M.useRef)(null),ve=(0,M.useRef)("idle"),he=(0,M.useRef)(-1),[z,Z]=(0,M.useState)(0),te=(0,M.useRef)(e);te.current=e,(0,M.useEffect)(()=>{let Y=t.current;if(Y===null)return;let ce={video:Y,...n!==void 0?{assetBaseUrl:n}:{}},F=r!==void 0?r.liveness(ce):qn(ce);i.current=F;let Ne=s(()=>V(F.facingMode??null),"readFacing");Ne();let $e=[F.on("state",b=>{b==="mode_switch"?K(!0):b!=="starting"&&b!=="gating"&&K(!1),b==="starting"?(ve.current!=="starting"&&(he.current+=1,Z(Math.max(0,he.current))),$(null),G(null),h(Cr),d(!1),x(!1),L(null),A(null),B.current=null):b==="gating"&&ve.current==="recording"&&(d(!1),x(!1),L(null),B.current=null),ve.current=b,Ne(),u(b),te.current.onStateChange?.(b)}),F.on("gate",b=>{let ke=B.current;B.current=b.progress,x(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&d(!0),h(b)}),F.on("frozen",({previewDataUrl:b})=>L(b)),F.on("profile",({animations:b})=>j(b==="reduced")),F.on("ramp",({colour:b})=>A(b)),F.on("captured",b=>{$(b),le(null),te.current.onCaptured?.(b)}),F.on("error",b=>{G(b);let ke=r?.reportCaptureIssue;ke!==void 0&&bt(Ee=>ke.call(r,Ee),kr("liveness",b,Math.max(0,he.current))),te.current.onError?.(b)}),r?.on("result",b=>{le(b),te.current.onResult?.(b)})];return()=>{for(let b of $e)b?.();i.current=null,F.destroy()}},[r,t,n]);let R=(0,M.useCallback)(()=>{i.current?.start()},[]),xe=(0,M.useCallback)(()=>{i.current?.retry()},[]),ge=(0,M.useCallback)(async()=>{let Y=i.current;return Y===null||typeof Y.canSwitchCaptureMode!="function"?!1:await Y.canSwitchCaptureMode().catch(()=>!1)===!0},[]),T=(0,M.useCallback)(async Y=>{let ce=i.current;if(ce===null||typeof ce.setCaptureMode!="function")return!1;let F=await ce.setCaptureMode(Y).catch(()=>!1)===!0;return F&&V(ce.facingMode??null),F},[]);return{state:l,gate:S,draining:w,gateLocked:I,frozenPreview:N,reduceMotion:p,rampColour:_,artifacts:q,error:f,result:ie,facingMode:c,start:R,retry:xe,canSwitchCaptureMode:ge,setCaptureMode:T,modeRestarted:P,attempt:z}}o(tn,"er");s(tn,"useLivenessHandle");var Vn=new Set(["national_number"]);function Nt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>Vn.has(n));return t.length>0?{...e,options:t}:null}o(Nt,"tr");s(Nt,"pending");function rn(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[i,l]=(0,me.useState)(!1),[u,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let x=!0,I=e.methodChoice;typeof I=="function"?(a(!1),Promise.resolve().then(()=>I.call(e)).then(N=>{x&&n(Nt(N))},()=>{}).finally(()=>{x&&a(!0)})):a(!0);let d=e.on("method",N=>n(Nt(N)));return()=>{x=!1,d()}},[e]);let h=(0,me.useCallback)(async x=>{if(e===void 0)return!1;l(!0),S(!1);try{return await e.selectMethod(x),n(null),!0}catch{return S(!0),!1}finally{l(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!u?w:null,settled:r,busy:i,failed:u,select:h}}o(rn,"nr");s(rn,"useMethodChoice");var Fn=["ar","fr","en"];function nn(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}o(nn,"so");s(nn,"isClipUrl");function sn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Fn){let a=t[r];if(!(typeof a!="object"||a===null))for(let[i,l]of Object.entries(a))!st(i)||!nn(l)||((n[r]??(n[r]={}))[i]=l)}return Object.keys(n).length>0?n:null}o(sn,"io");s(sn,"toVoiceClipMap");function an(e){let[t,n]=(0,Pe.useState)(null);(0,Pe.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,i=s(u=>{if(!a)return;let S=typeof u=="object"&&u!==null&&typeof u.setId=="string"?u:null;n(h=>h?.setId===S?.setId?h:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(i,()=>i(null))}catch{i(null)}let l=e.on("view",u=>i(u.voice));return()=>{a=!1,l()}},[e]);let r=(0,Pe.useMemo)(()=>t!==null?sn(t):null,[t]);return e===void 0?null:r}o(an,"rr");s(an,"useServerVoiceClips");function on({voice:e}){let t=Re();return(0,Mt.jsx)(X,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:o(()=>e.toggle(),"onClick"),children:(0,Mt.jsx)(nt,{off:!e.enabled,className:"sekyro-icon"})})}o(on,"sr");s(on,"VoiceChip");var Hn=new Set(["abandoned","not_opened","cancelled","superseded"]),$n=800,Dn="capture.lookAtColours";function ln(e){return e===void 0||e!==!1&&e.length===_t.length&&_t.every(t=>e.includes(t))}o(ln,"fo");s(ln,"isDefaultTips");function cn(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}o(cn,"mo");s(cn,"carriesActivation");function un(e){return typeof e=="object"&&e!==null&&!(0,y.isValidElement)(e)&&"tone"in e&&"text"in e}o(un,"yo");s(un,"isNoticeObject");var Gn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function dn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}o(dn,"ho");s(dn,"isCapturing");function pn(e){return e==="captured"||e==="uploading"||e==="checking"}o(pn,"vo");s(pn,"isPostCapture");function Kn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:i=!1,notice:l,startDisabled:u=!1,startLabel:S,tips:h,tipsSummary:w,coach:x,voice:I,onGuidance:d,onCaptured:N,onResult:L,onError:p,onStateChange:j,assetBaseUrl:_,className:A}){let q=dr(t),$=(0,y.useMemo)(()=>ur(t,r),[t,r,q]),f=(0,y.useMemo)(()=>g=>$[g]??"",[$]),G=n??(t==="ar"?"rtl":"ltr"),ie=(0,y.useRef)(null),le=(0,y.useContext)(Un),c=tn({verification:e,videoRef:ie,assetBaseUrl:_,onCaptured:N,onResult:L,onError:p,onStateChange:j}),V=en(_,c.state==="idle"&&c.error===null),P=rn(e),K=P.choice!==null,B=Wr(e),ve=Jr(e),he=Xr(e),z=Qr(),Z=Yr(e),te=Z.session==="choice",R=Z.mode==="assisted",xe=I!==!1&&I?.clips===void 0,ge=an(xe?e:void 0),T=Fr({locale:t,defaultClips:ge,options:I}),Y=R?"environment":"user",ce=Z.settled,F=(0,y.useRef)(null),Ne=(0,y.useRef)(!1),$e=(0,y.useRef)(T.unlock);$e.current=T.unlock,(0,y.useEffect)(()=>{let g=F.current;if(g===null)return;let ne=["pointerup","touchend","click","keydown"],_e=s(()=>{for(let qe of ne)g.removeEventListener(qe,Le,!0)},"disarm");function Le(qe){if(Ne.current){_e();return}cn(qe)&&(Ne.current=!0,_e(),$e.current())}o(Le,"Re"),s(Le,"onGesture");for(let qe of ne)g.addEventListener(qe,Le,{capture:!0,passive:!0});return _e},[]);let b=(0,y.useCallback)(()=>{Ne.current||(Ne.current=!0,T.unlock()),c.start()},[T.unlock,c.start]),ke=(0,y.useCallback)(()=>c.start(),[c.start]),Ee=(0,y.useRef)(!1),Te=c.state==="idle"&&c.error===null,Ut=!K&&!B.required&&(i===!0||i==="when-permitted"&&z.permission==="granted"),jt=Ut&&P.settled&&B.settled&&ce,mn=i==="when-permitted"&&!z.permissionSettled&&!Ee.current,Pt=Ut&&Te&&!Ee.current,ut=(mn||Pt||!ce)&&V.gate==="ready"?"loading":V.gate;(0,y.useEffect)(()=>{!jt||!Te||V.gate!=="ready"||Ee.current||(Ee.current=!0,ke())},[jt,Te,V.gate,ke]);let yn=Te&&!K&&!B.required&&!(Pt&&V.gate==="ready"),[Tt,Bt]=(0,y.useState)(!1),{canSwitchCaptureMode:Ot,setCaptureMode:qt}=c;(0,y.useEffect)(()=>{if(!Z.settled||!te){Bt(!1);return}let g=!0;return Ot().then(ne=>{g&&Bt(ne)}),()=>{g=!1}},[Z.settled,te,Ot]);let{choose:Vt}=Z,Ie=R?"self":"assisted",vn=(0,y.useCallback)(async()=>{await qt(Ie)&&Vt(Ie)},[qt,Vt,Ie]),Ft=c.state!=="idle"&&c.facingMode!==null?c.facingMode:Y;(0,y.useEffect)(()=>{let g=ie.current?.style;Ft==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[Ft]);let De=(0,y.useMemo)(()=>c.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(c.artifacts.keyframe):null,[c.artifacts]);(0,y.useEffect)(()=>{if(De!==null)return()=>URL.revokeObjectURL(De)},[De]);let Ht=c.frozenPreview??De,Ue=e!==void 0,D=dn(c.state),be=pn(c.state),Ge=D||be,re=c.result,$t=c.state==="done"&&re!==null,Ke=D&&c.rampColour!==null,dt=c.state==="recording"&&c.frozenPreview!==null&&!Ke,ze=le!==null,Dt=Tt&&D&&!dt?{to:Ie,label:f(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:f(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{vn()},"onSwitch")}:null,Ze=c.modeRestarted&&D?f("capture.modeSwitch.restarted"):null,Be=be||dt,Gt=be?"checking":dt?"frozen":c.state==="recording"||Ke?"recording":c.gateLocked||c.gate.progress>=1?"locked":c.gate.faceDetected?"aligning":"seeking",Qe=D?c.gate.hint:null,We=c.state==="starting"?"capture.preparing.title":Qe===null?null:Qe==="center"&&!c.gate.faceDetected?"fcv3.no_face":or(Qe),[gn,Kt]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(We!=="fcv3.no_face"){Kt(We);return}if(!D)return;let g=setTimeout(()=>Kt(We),$n);return()=>clearTimeout(g)},[We,D]);let pt=D&&!Ke&&typeof x=="string"&&x!=="",zt=R&&D?f("capture.assisted.stage"):null,Me=D&&!pt?Ke?Dn:gn:null,ht=pt?x:Me===null?"":f(Me);Hr(T,Me,ht,D);let Zt=(0,y.useRef)(d);Zt.current=d,(0,y.useEffect)(()=>{if(st(Me))try{Zt.current?.(Me)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Me]);let Oe=(0,y.useMemo)(()=>({supported:T.supported,enabled:T.enabled,setEnabled:T.setEnabled,toggle:T.toggle}),[T.supported,T.enabled,T.setEnabled,T.toggle]),ft=a?.voicePrompt,Qt=ft!==void 0,Wt=I===void 0,Jt=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!Qt||!Wt||Jt.current||!At()||(Jt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[Qt,Wt]);let kn=ft!==void 0?(g,ne,_e)=>ft(g,ne,_e,Oe):T.supported?()=>(0,k.jsx)(on,{voice:Oe}):void 0,{summary:mt,summaryPlaying:Yt,toggleSummary:Xt,stopSummary:er}=T,Je=w!==void 0&&w!=="",tr=Je?w:f("capture.tips.summary"),rr=Je?mt!=="none":mt==="partner"||mt==="default"&&ln(h),bn=(0,y.useMemo)(()=>rr?{playing:Yt,toggle:s(()=>Xt(tr,{clip:!Je}),"toggle"),stop:er}:void 0,[rr,Yt,Xt,tr,er,Je]),Cn=(0,y.useMemo)(()=>({assets:ut,retryAssets:V.retry,permission:z.permission,permissionSettled:z.permissionSettled,captureMode:Z.mode,facing:Y,voice:Oe}),[ut,V.retry,z.permission,z.permissionSettled,Z.mode,Y,Oe]),_n=un(l)?(0,k.jsx)(se,{tone:l.tone,testId:"sekyro-host-notice",children:(0,k.jsx)("span",{children:l.text})}):l??null,ue=re!==null&&re.status==="retry"?re:null,W=$t&&re.status==="unavailable"&&!K&&re.reasonCode!=="portrait_required"?re:null,Ce=$t&&(re.status==="verified"||re.status==="not_verified"||re.status==="review")?re:null,yt=s((g,ne)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Le=lr(t,ne);if(Le!==null)return f(Le.key).replace("{time}",Le.time)}let _e=et(g);return _e===null?null:f(_e)},"reasonText"),vt=s(g=>{let ne=g.retakeHint===void 0?null:Xe(g.retakeHint);return ne===null?yt(g.reasonCode):f(ne)},"retryText"),nr=Ce===null?null:yt(Ce.reasonCode,Ce.retryAfter)??(Ce.status==="not_verified"&&Ce.reason!==void 0&&Hn.has(Ce.reason)?f("errors.session_expired"):null),wn=W!==null&&W.reasonCode!==void 0&&W.reasonCode!=="nni_unbound"&&W.reasonCode!=="id_number_unbound"&&W.reasonCode!=="method_required"&&W.reasonCode!=="mobile_required"&&!(W.reasonCode==="no_recorder"&&c.artifacts?.degraded==="NO_RECORDER"),Ye=W?.reasonCode,sr=c.attempt;(0,y.useEffect)(()=>{W===null||Ye===void 0||e?.reportCaptureIssue===void 0||Gn.has(Ye)||bt(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Ye,attempt:Math.min(1e3,sr)})},[W,Ye,sr,e]);let ar=kt(),Sn=K&&P.auto===null&&!D&&!be&&c.error===null,gt=(0,y.useCallback)(async g=>{await P.select(g)&&c.state==="done"&&c.retry()},[P.select,c.state,c.retry]);return(0,y.useEffect)(()=>{P.auto!==null&&!P.busy&&!D&&!be&&gt(P.auto)},[P.auto,P.busy,D,be,gt]),(0,k.jsx)(pr,{value:f,children:(0,k.jsxs)("div",{ref:F,className:A===void 0?"sekyro-capture":`sekyro-capture ${A}`,dir:G,lang:t,"data-testid":"sekyro-liveness-capture","data-state":c.state,children:[a?.header,ue!==null&&vt(ue)!==null&&!(ze&&Ge)?(0,k.jsx)(se,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,k.jsx)("span",{children:vt(ue)})}):null,Ze!==null&&!ze?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,k.jsx)("span",{children:Ze})}):null,he&&be&&!ze?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,k.jsx)("span",{children:f("capture.busy")})}):null,B.required&&Te?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,k.jsx)("span",{children:f("reasons.mobile_required")})}):null,c.error!==null?a?.errorPanel!==void 0?a.errorPanel(c.error,c.retry):(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-error-notice",children:[(0,k.jsx)("span",{children:f(ir(c.error))}),c.error.retryable?(0,k.jsx)(X,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("common.retry")}):null]}):null,W!==null?(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,k.jsx)("span",{children:yt(W.reasonCode)??f(W.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),wn?(0,k.jsx)(X,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("capture.recordAgain")}):null]}):null,nr!==null&&Ce!==null?(0,k.jsx)(se,{tone:Ce.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,k.jsx)("span",{children:nr})}):null,(0,k.jsx)("div",{className:Ge?void 0:"sekyro-hidden","data-capture-live":Ge?"":void 0,children:ze?le({videoRef:ie,guidance:Be&&Ue?f("capture.checking"):ht,coached:pt&&!(Be&&Ue),note:Be?Ue?f(he?"capture.busy":"capture.checkingHint"):null:Ze??(ue!==null?vt(ue):zt),settled:Be&&Ue,progress:c.gate.progress,phase:Gt,still:Be?Ht:null,live:Ge,modeSwitch:Dt,...Tt?{status:Ze}:{},ramp:c.rampColour===null?null:{colour:c.rampColour}}):(0,k.jsx)(hr,{videoRef:ie,guidanceText:ht,guidanceHint:Qe,guidanceKey:Me,progress:c.gate.progress,phase:Gt,draining:c.draining,stillUrl:Ht,showChecking:Ue,operatorText:zt,voicePrompt:kn,overlay:o(g=>(0,k.jsxs)(k.Fragment,{children:[a?.stageOverlay?.(g),(0,k.jsx)(fr,{colour:c.rampColour})]}),"overlay"),reduceMotion:c.reduceMotion,modeSwitch:Dt})}),Sn&&P.choice!==null?(0,k.jsx)(Ur,{title:f("method.title"),description:f("method.description"),options:P.choice.options.map(g=>({id:g,label:f(`method.${g}`)})),busy:P.busy,error:P.failed?f("errors.network_error"):null,focus:c.state==="done",testId:"sekyro-method",look:"buttons",onChoose:o(g=>{gt(g)},"onChoose")}):null,yn?(0,k.jsxs)(k.Fragment,{children:[ve&&a?.header===void 0&&a?.intro===void 0?(0,k.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,k.jsx)("h2",{className:"sekyro-text-body",children:f("returning.title")}),(0,k.jsx)("p",{className:"sekyro-text-muted",children:f("returning.description")})]}):null,_n,a?.intro!==void 0?a.intro(b,Cn):(0,k.jsx)(zr,{assets:ut,onRetryAssets:V.retry,permission:z.permission,captureMode:Z.mode,voice:Oe,tips:h??_t,summary:bn,startLabel:S,startDisabled:u,onStart:b})]}):null,(0,k.jsx)($r,{showCoaching:ue!==null,coaching:ot(ue?.reasonCode),attemptsText:ue?.attemptsRemaining!==void 0?cr($,t,ue.attemptsRemaining):null,showRetake:ue!==null&&!D&&!be||!Ue&&c.state==="captured",onRetake:c.retry}),a?.footer]})})}o(Kn,"xi");s(Kn,"LivenessCapture");var It=E(H(),1),ct=E(H(),1),m=E(de(),1);import{isInAppBrowser as es}from"@sekyro/web/client";var ks={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function zn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}o(zn,"Y");s(zn,"identityLabel");function Zn(e,t){let[n,r]=(0,It.useState)(!1),[a,i]=(0,It.useState)(null);return{busy:n,error:a,run:s(l=>{r(!0),i(null),l().then(()=>r(!1),u=>{r(!1),i(e.t(br(u,e.strings))),t?.(u)})},"run")}}o(Zn,"q");s(Zn,"useChoiceAction");function hn(){let e=`sekyro-face-light-${(0,ct.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,m.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,m.jsx)("defs",{children:(0,m.jsx)("mask",{id:e,children:(0,m.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,m.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,m.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}o(hn,"O");s(hn,"FaceMark");var Qn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Wn(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}o(Wn,"te");s(Wn,"faceIntroRetryOf");var Jn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function Yn({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:i=!1,notice:l,retry:u}){let S=Ct(),{t:h}=S,w=u===void 0?"face":ot(u.reason),x=w==="face"?null:He[w].tips,I=(0,ct.useContext)(yr)?.busy===!0;return(0,m.jsxs)("section",{className:"sekyro-step",children:[(0,m.jsx)(hn,{}),t.captureMode==="assisted"?(0,m.jsx)(tt,{title:h("capture.assisted.heading"),lead:h("capture.assisted.lead")}):i?(0,m.jsx)(tt,{title:h("returning.heading"),lead:h("returning.description")}):(0,m.jsx)(tt,{title:h(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:h(a?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?(0,m.jsx)(fn,{retry:u,title:He[w].title}):null,r!==void 0&&x===null?(0,m.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,m.jsx)("ul",{className:"sekyro-tiprows",children:x!==null?x.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:Jn[d]??"face"}),h(d)]},d)):n!==void 0?n.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:Qn[d.id]??"face"}),d.text]},d.id)):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"light"}),h("capture.tips.light")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"jGlasses"}),h("capture.tips.uncover")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"smartphone"}),h("capture.tips.eyeLevel")]})]})}),l??null,l!==void 0?null:t.assets==="failed"?(0,m.jsx)(X,{kind:"secondary",full:!0,onClick:t.retryAssets,children:h("common.retry")}):null,l!==void 0?null:(0,m.jsx)(mr,{children:(0,m.jsxs)(X,{full:!0,disabled:t.assets!=="ready"||I,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,m.jsx)(Ae,{name:"camera"}),h("capture.start")]})})]})}o(Yn,"ne");s(Yn,"FaceIntro");var Xn=new Set(["match_inconclusive","no_face_source","below_threshold"]);function fn({retry:e,title:t}){let n=Ct(),r=e.retakeHint===void 0?null:Xe(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":Xn.has(e.reason)?"capture.retryMatch.message":et(e.reason);return(0,m.jsxs)(vr,{tone:"warning",children:[r!==null?(0,m.jsx)("span",{children:n.t(r)}):a!==null?(0,m.jsx)("span",{children:n.t(a)}):null,r===null?(0,m.jsx)("span",{children:n.t(t)}):null,(0,m.jsx)("span",{children:gr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}o(fn,"T");s(fn,"RetryNotice");function ts(e){return es(e)}o(ts,"se");s(ts,"isInAppBrowser");function rs(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}o(rs,"ce");s(rs,"androidBrowserIntent");export{Ur as a,At as b,Un as c,Yr as d,Kn as e,ks as f,zn as g,Zn as h,Wn as i,Yn as j,ts as k,rs as l};
@@ -1 +1 @@
1
- import{a as C,d as f,e as l,f as d,g as m,h as v,i as p,j as g,l as x}from"./chunk-K5DAJSLX.js";import{a as o,c as b,i}from"./chunk-SSU37LFQ.js";var r=b(C(),1);var y={ar:l,fr:d,en:f};function h(e,t){let s=v(e),a=s===void 0?y[m(e)]:{...y.en,...s};if(t===void 0)return a;let n={...a};for(let u of Object.keys(t)){let c=t[u];typeof c=="string"&&(n[u]=c)}return x(n,t),n}o(h,"T");i(h,"resolveStrings");function j(e){let[,t]=(0,r.useState)(0),s=p(e);return(0,r.useEffect)(()=>{if(!s)return;let a=!0;return g(e).then(()=>a&&t(n=>n+1)),()=>{a=!1}},[e,s]),!s}o(j,"w");i(j,"useLocaleReady");var S=(0,r.createContext)(e=>f[e]??""),E=S.Provider;function k(){return(0,r.useContext)(S)}o(k,"I");i(k,"useStrings");export{h as a,j as b,E as c,k as d};
1
+ import{a as C,d as f,e as l,f as d,g as m,h as v,i as p,j as g,l as x}from"./chunk-VD7QSFUC.js";import{a as o,c as b,i}from"./chunk-SSU37LFQ.js";var r=b(C(),1);var y={ar:l,fr:d,en:f};function h(e,t){let s=v(e),a=s===void 0?y[m(e)]:{...y.en,...s};if(t===void 0)return a;let n={...a};for(let u of Object.keys(t)){let c=t[u];typeof c=="string"&&(n[u]=c)}return x(n,t),n}o(h,"T");i(h,"resolveStrings");function j(e){let[,t]=(0,r.useState)(0),s=p(e);return(0,r.useEffect)(()=>{if(!s)return;let a=!0;return g(e).then(()=>a&&t(n=>n+1)),()=>{a=!1}},[e,s]),!s}o(j,"w");i(j,"useLocaleReady");var S=(0,r.createContext)(e=>f[e]??""),E=S.Provider;function k(){return(0,r.useContext)(S)}o(k,"I");i(k,"useStrings");export{h as a,j as b,E as c,k as d};
@@ -1 +1 @@
1
- import{d as U}from"./chunk-XJJ3KCLT.js";import{E as C,I as H,a as Z,b as E,v as B}from"./chunk-K5DAJSLX.js";import{a as N,c as R,i as d}from"./chunk-SSU37LFQ.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-NC6MJEKS.js";import{E as C,I as H,a as Z,b as E,v as B}from"./chunk-VD7QSFUC.js";import{a as N,c as R,i as d}from"./chunk-SSU37LFQ.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};