var _____WB$wombat$assign$function_____=function(name){return (globalThis._wb_wombat && globalThis._wb_wombat.local_init && globalThis._wb_wombat.local_init(name))||globalThis[name];};if(!globalThis.__WB_pmw){globalThis.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}var window = _____WB$wombat$assign$function_____("window");
var self = _____WB$wombat$assign$function_____("self");
var document = _____WB$wombat$assign$function_____("document");
var location = _____WB$wombat$assign$function_____("location");
var top = _____WB$wombat$assign$function_____("top");
var parent = _____WB$wombat$assign$function_____("parent");
var frames = _____WB$wombat$assign$function_____("frames");
var opener = _____WB$wombat$assign$function_____("opener");
import{i as L,aj as V,ak as A,a0 as T,K as k,e as E,al as S,a7 as C,am as H,an as I,ao as b,ap as J,aq as w,a as n,ar as z,as as B,U as O,$ as U,at as j}from"./app.ZXowmuNl.js";import{H as q}from"./ShopPayCaptcha.D5PhqOQa.js";let m=!1;function D(){const p=L(),a=V(),c=a.value,t=A(),{captcha:o}=T(),e=o.value,[f,l]=k(e?.sitekey),{negotiate:d}=E(),r=S(null),[i,h]=k(m),[y]=k(!!e?.token),v=p("captcha.errors.not_solved","Complete the CAPTCHA to continue");C(()=>{e?e?.sitekey&&l(e.sitekey):l(void 0)},[e]),C(()=>{const s=t.type==="error"?t.violations.map(R=>R.code):[];e&&e.violationCode&&s.includes(e.violationCode)?(r?.current?.resetCaptcha(),a.value=v):e?.token&&(a.value=void 0)},[e,a,v,t,r]);const P=s=>{e&&(o.value={...e,token:s,violationCode:void 0},d({progression:!1,include:["captcha"],skipStateUpdates:!0}))};H(o,a,s=>{if(s&&!s.token)return v},I.InvalidCaptcha);const u=S(null),g=b({active:!!c});return C(()=>{e&&i&&u.current&&(g.current=u.current.querySelector("iframe"))},[e,u,i,g]),{captcha:e,sitekey:f,error:c,handleVerify:P,handleLoad:()=>{m=!0,h(!0)},isLoaded:i,captchaRef:r,captchaContainerRef:u,solvedOnLoad:y}}const M={Error:"MTtRU"};function _(){const p=J(),a=L(),c=w("worker-version")!=="fast",{captcha:t,sitekey:o,error:e,handleVerify:f,handleLoad:l,isLoaded:d,captchaRef:r,captchaContainerRef:i,solvedOnLoad:h}=D(),y=h&&!t?.sitekey;return!t||t.provider!=="hcaptcha"||y||!o?null:n("div",{children:[d?null:n(z,{delay:c,contentDisplay:"block",inlineSize:302,blockSize:83}),n(B,{accessibilityLabel:a("captcha.title","Complete the CAPTCHA to continue"),display:d?void 0:"none",children:n(O,{spacing:"small400",children:[n("div",{className:e&&U(M.Error),ref:i,children:n(q,{sitekey:o,onVerify:f,languageOverride:p,ref:r,onLoad:l})}),e&&n(j,{children:e?.message??e})]})})]})}export{_ as default};