PageSourceSearch

https://shopaiti.com/cdn/shopifycloud/checkout-web/assets/c1/7fd9930c.CHr2qvQF.js

js shopaiti.com collected 2026-10-07 03:29:40 UTC 6,708 bytes, 1 lines download raw bytes

1import{z as e,g as n,h as a,u as t,J as o,q as i,T as l,S as s}from"./2c1ab0fe.Bywc2Brn.js";import{r,f as c,s as d,b as m,ab as p,S as h,B as u,a1 as g,d as _,M as b,bR as f}from"./164ad2e3.Bn4mVc0u.js";import{Q as y,C as w}from"./3e6029dd.BF2hZY3-.js";import"./app.B7Ohb9rB.js";import{bm as x,c as S,v as k,bn as M}from"./9dba8418.nSn06qNc.js";import"./d0bb51ec.up41EQh6.js";import"./f67abd2c.BiDTv4D9.js";import"./60a453ce.BI5dm7PK.js";import"./e12db40c.xtsrYBcz.js";var v="var(--_1cm3fw00)";const z=d("Countdown");function C({duration:i=0,defaultValue:l=i,label:s,onEnd:d}){const m=r(void 0,z),[p]=e(()=>Date.now()+l),[h,u]=e(()=>Math.max(l,0)),g=n(d),_=n(!1);g.current=d,a(()=>{let e;const n=()=>{const a=Math.max(p-Date.now(),0);u(a),0!==a?e=setTimeout(n,a%1e3||1e3):_.current||(_.current=!0,g.current?.())};return n(),()=>clearTimeout(e)},[p]);const b=i>0?Math.min(Math.max((i-h)/i*100,0),100):0;return t("div",{role:s?"timer":void 0,"aria-labelledby":s?m:void 0,className:"_1cm3fw02 _1cm3fw01 _1fragem6t _1fragemzf _1fragem82",children:[t("div",{"aria-hidden":!0,className:"_1cm3fw04 _1cm3fw03 _1fragemup _1fragemv4 _1fragemzf _1fragem32",style:o({[v]:`${b}%`}),children:t("div",{className:"_1cm3fw06 _1cm3fw05 _1fragem4q"})}),s&&t(c,{id:m,accessibilityVisibility:"hidden",type:"small",textAlign:"center",color:"subdued",children:s(h)})]})}function I(e=navigator.userAgent,n){return x(e)||/Shop App\/[^/]+\/iOS\//.test(e)||null!=n&&"WEB"!==n}const R=new Set(["alipay","bancontact","blik","eps","ideal","klarna","mobilepay","multibanco","paypal","przelewy24","satispay","sofort","swish","twint","usdc","wechatpay"]);function E(e){return e.toLowerCase().replace(/[\s_-]+/gu,"")}const D=e=>{const n=Math.floor(e/36e5),a=String(Math.floor(e%36e5/6e4)).padStart(2,"0"),t=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return n>0?`${n}:${a}:${t}`:`${a}:${t}`},A={bogus_app_coin:"/cdn/shopifycloud/checkout-web/assets/c1/assets/bogus.Dgqxw51f.svg",pix:"/cdn/shopifycloud/checkout-web/assets/c1/assets/pix.D3fYfWH5.svg",blik:"/cdn/shopifycloud/checkout-web/assets/c1/assets/blik.DVGmDGpj.svg",swish:"/cdn/shopifycloud/checkout-web/assets/c1/assets/swish.Bmk5gRpD.svg"},T=["wechat_pay","paynow"];function q({challengeType:n,challengeData:o,receipt:r,paymentMethod:d,onModalRender:x,challengeExpiresAt:v}){const z=((e,n)=>null!=n?Math.max(n-Date.now(),0):e&&f(e)&&e.timeout?.millisecondsRemaining||0)(r,v),[q,j]=e(!1),[N,O]=e(),[$]=e(z),{i18n:L,client:Q,embed:B}=S(),V=function(e){const{paymentMethod:n}=e,{userEvents:a,shop:{id:t},source:o}=S(),s=i(e=>a.monorailEvent({schemaId:"checkout_buyer_action_required_events/1.0",payload:{eventTriggerReason:e,paymentMethodDisplayName:n.name,checkoutSessionIdentifier:o.checkoutSessionIdentifier||"",shopId:parseInt(k(t),10)}}),[n.name,t,o.checkoutSessionIdentifier,a]);return l(()=>({onModalRendered:()=>s("modal_rendered"),onModalTimeout:()=>s("buyer_action_timeout"),onModalExit:()=>s("buyer_closes_modal"),onCopiedToClipboard:()=>s("buyer_copies_to_clipboard"),onChallengeRendered:e=>{switch(e){case"QR_CODE":s("qr_code_rendered");break;case"EXTERNAL":s("external_action_rendered")}}}),[s])}({paymentMethod:d});l(()=>{q&&x&&setTimeout(()=>{x()},1e3)},[q,x]);const J=i(()=>r?(V.onModalTimeout(),j(!1),null):null,[r,V]);let W,F;a(()=>{n&&o&&$&&(O(JSON.parse(o)),j(!0))},[n,o,$]);let G,X=!1;switch(n){case"QR_CODE":if(W=L.translate("payment_challenge_modal.qr_code.instructions",{paymentMethod:d.name}),N){const e=JSON.parse(N.data);F=e?.mobile_app_universal_url,G=e?.instruction,X=T.includes(e?.instruction),"wechat_pay"===e?.instruction?W=I(Q.userAgent,B?.platform)?L.translate("payment_challenge_modal.qr_code.wechat_instructions_mobile"):L.translate("payment_challenge_modal.qr_code.wechat_instructions"):"paynow"===e?.instruction&&(W=I(Q.userAgent,B?.platform)?L.translate("payment_challenge_modal.qr_code.paynow_instructions_mobile"):L.translate("payment_challenge_modal.qr_code.paynow_instructions"))}break;case"EXTERNAL":W=L.translate("payment_challenge_modal.external.instructions",{paymentMethod:d.name});break;default:W=L.translate("payment_challenge_modal.instructions",{paymentMethod:d.name})}a(()=>{q&&N&&V.onModalRendered()},[q,N,V]),a(()=>{N&&V.onChallengeRendered(n)},[V,N,n]);const H=L.translate("payment_challenge_modal.copy_text",{paymentMethod:d.name}),Y=L.translate("payment_challenge_modal.open_app_text",{paymentMethod:d.name}),K=F?Y:H,P=L.translate("payment_challenge_modal.header",{paymentMethod:d.name}),U=L.translate("payment_challenge_modal.close"),Z=(e=>{const n=M(e);return n?A[n]:null})(d),ee="QR_CODE"===n?function(e){for(const n of e){if("string"!=typeof n||""===n)continue;const e=E(n);if(R.has(e))return`https://cdn.shopify.com/static/retail/lpm-icons/png/square-icons/${e}.png`}}([G,...d.paymentBrands??[]]):void 0;return r&&t(b,{open:q,blocking:!0,accessibilityLabel:P,size:"base",children:t(m,{children:[t(p,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"large-300",alignItems:"center",alignContent:"center",children:[t(c,{size:"large",textAlign:"start",children:P}),t(h,{gap:"small-400",alignItems:"end",children:t(u,{onClick:()=>(V.onModalExit(),void window.location.reload()),variant:"plain",tone:"monochrome",inlineAlignment:"end",accessibilityLabel:U,children:t(g,{type:"x"})})})]}),t(m,{children:[t(_,{blockSize:"base"}),Z&&!ee&&t(s,{children:[t(h,{gap:"large-300",alignItems:"center",children:t("img",{src:Z,alt:d.name})}),t(_,{blockSize:"small-400"})]}),t(h,{gap:"large-300",alignItems:"center",children:t(c,{size:"base",textAlign:"center",textWrap:"pretty",children:W})}),"QR_CODE"===n&&N&&t(s,{children:[t(_,{blockSize:"base"}),t(h,{gap:"base",alignItems:"center",children:[t(h,{gap:"base",maxInlineSize:"150px",minInlineSize:"150px",alignItems:"center",children:t(y,{content:N?.code,size:"fill",logo:ee},ee)}),!X&&t(s,{children:[t(_,{blockSize:"large-200"}),t(h,{gap:"base",alignItems:"center",maxInlineSize:"400px",minInlineSize:"@media (inline-size >= extraSmall) 400px, 100%",children:t(u,{commandFor:"qr-code-challenge-data-code",command:F?void 0:"--copy",inlineSize:"fill",inlineAlignment:"center",onClick:()=>{F&&(window.open(F,"_blank"),V.onChallengeRendered("QR_CODE"))},children:K})}),!F&&t(w,{text:N?.code,id:"qr-code-challenge-data-code",onCopy:()=>V.onCopiedToClipboard()})]})]})]}),t(_,{blockSize:"large-200"}),t(h,{alignItems:"center",children:t(m,{maxInlineSize:"150px",minInlineSize:"150px",children:t(C,{duration:$,defaultValue:z,label:e=>L.translate("payment_challenge_modal.timer_message",{timeLeft:D(e)}),onEnd:J})})}),t(_,{blockSize:"large-200"})]})]})})}export{A as SUPPORTED_PAYMENT_METHOD_BRAND_ICONS,q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.