PageSourceSearch

https://www.thegreatbritishbookshop.co.uk/cdn/shopifycloud/checkout-web/assets/c1/7fd9930c.By5ensm3.js

js thegreatbritishbookshop.co.uk collected 2026-10-01 10:27:39 UTC 6,672 bytes, 1 lines download raw bytes

1import{k as e,A as n,h as a,u as t,F as o,T as l,q as i,S as s}from"./2c1ab0fe.D_oO1jU7.js";import{C as r,P as c,J as d,B as m,y as p,c as h,l as u,I as g,b as _,bv as f,by as y}from"./164ad2e3.DgUUtBtV.js";import{Q as b,C as w}from"./3e6029dd.Bhk_IN06.js";import"./app.bDJ3v-8C.js";import{bC as x,O as k,G as M,bD as S}from"./4c290a1e.D9lE9kmU.js";import"./65f3d4da.8ZfwXSRH.js";import"./60a453ce.BIyixFcg.js";import"./0a7dffce.BMM606kb.js";import"./bb728e1c.BObJOhlA.js";var v="var(--_1cm3fw00)";const C=d("Countdown");function z({duration:l=0,defaultValue:i=l,label:s,onEnd:d}){const m=r(void 0,C),[p]=e((()=>Date.now()+i)),[h,u]=e((()=>Math.max(i,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 f=l>0?Math.min(Math.max((l-h)/l*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]:`${f}%`}),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 E=new Set(["alipay","bancontact","blik","eps","ideal","klarna","mobilepay","multibanco","paypal","przelewy24","satispay","sofort","swish","twint","usdc","wechatpay"]);function R(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 C=((e,n)=>null!=n?Math.max(n-Date.now(),0):e&&y(e)&&e.timeout?.millisecondsRemaining||0)(r,v),[q,j]=e(!1),[O,N]=e(),[$]=e(C),{i18n:L,client:Q,embed:B}=k(),V=function(e){const{paymentMethod:n}=e,{userEvents:a,shop:{id:t},source:o}=k(),l=e=>a.monorailEvent({schemaId:"checkout_buyer_action_required_events/1.0",payload:{eventTriggerReason:e,paymentMethodDisplayName:n.name,checkoutSessionIdentifier:o.checkoutSessionIdentifier||"",shopId:parseInt(M(t),10)}});return{onModalRendered:()=>l("modal_rendered"),onModalTimeout:()=>l("buyer_action_timeout"),onModalExit:()=>l("buyer_closes_modal"),onCopiedToClipboard:()=>l("buyer_copies_to_clipboard"),onChallengeRendered:e=>{switch(e){case"QR_CODE":l("qr_code_rendered");break;case"EXTERNAL":l("external_action_rendered")}}}}({paymentMethod:d});l((()=>{q&&x&&setTimeout((()=>{x()}),1e3)}),[q,x]);const W=i((()=>r?(V.onModalTimeout(),j(!1),null):null),[r,V]);let F,G;a((()=>{n&&o&&$&&(N(JSON.parse(o)),j(!0))}),[n,o,$]);let J,X=!1;switch(n){case"QR_CODE":if(F=L.translate("payment_challenge_modal.qr_code.instructions",{paymentMethod:d.name}),O){const e=JSON.parse(O.data);G=e?.mobile_app_universal_url,J=e?.instruction,X=T.includes(e?.instruction),"wechat_pay"===e?.instruction?F=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&&(F=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":F=L.translate("payment_challenge_modal.external.instructions",{paymentMethod:d.name});break;default:F=L.translate("payment_challenge_modal.instructions",{paymentMethod:d.name})}a((()=>{q&&O&&V.onModalRendered()}),[q,O,V]),a((()=>{O&&V.onChallengeRendered(n)}),[V,O,n]);const H=L.translate("payment_challenge_modal.copy_text",{paymentMethod:d.name}),P=L.translate("payment_challenge_modal.open_app_text",{paymentMethod:d.name}),Y=G?P:H,K=L.translate("payment_challenge_modal.header",{paymentMethod:d.name}),U=L.translate("payment_challenge_modal.close"),Z=(e=>{const n=S(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=R(n);if(E.has(e))return`https://cdn.shopify.com/static/retail/lpm-icons/png/square-icons/${e}.png`}}([J,...d.paymentBrands??[]]):void 0;return r&&t(f,{open:q,blocking:!0,accessibilityLabel:K,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:K}),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:F})}),"QR_CODE"===n&&O&&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(b,{content:O?.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:G?void 0:"--copy",inlineSize:"fill",inlineAlignment:"center",onClick:()=>{G&&(window.open(G,"_blank"),V.onChallengeRendered("QR_CODE"))},children:Y})}),!G&&t(w,{text:O?.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(z,{duration:$,defaultValue:C,label:e=>L.translate("payment_challenge_modal.timer_message",{timeLeft:D(e)}),onEnd:W})})}),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.