PageSourceSearch

https://www.quiksilver.com.au/cdn/shopifycloud/checkout-web/assets/c1/utils-useViolationsHandler.Cu7hKIy9.js

js quiksilver.com.au collected 2026-09-24 23:07:02 UTC 2,439 bytes, 1 lines download raw bytes

1import{T as d,u as S,X as f,x as i,h as T,f as _,q as u}from"./esnext-vendor.BBoIVOQW.js";import{Q as p,at as h,as as c,au as v,av as w,aw as O,T as P,W as L,ax as g,ay as M}from"./addresses-is-address-empty.ZJ1ThpFy.js";const k=p("CheckoutSheetProtocolSchemaContext");function V(e,o){e.postMessageToConsumer(o)}var x=(e=>(e.Continue="continue",e.Cancel="cancel",e))(x||{});class A{constructor(){this.listeners=new Set}listen(o){return this.listeners.add(o),()=>{this.listeners.delete(o)}}emit(o="continue"){this.listeners.forEach(t=>t(o))}}const y=f(void 0);function b(){const e=i(y);if(e==null)throw new h("Missing CheckoutProtocolEventContext");return e}function K(e){const o=b();T(()=>o.listen(e),[e,o])}function Y({children:e}){const o=d(()=>new A,[]);return S(y.Provider,{value:o,children:e})}const H=p("MobileCheckoutSdkSchemaContext");function I(){const e=i(k),o=i(H);if(!e&&!o)throw new h("No Checkout Sheet Protocol or Mobile Checkout SDK Schema context found");return e||o}const N=[{brand:"APPLE_PAY",flowType:"applePay"},{brand:"GOOGLE_PAY",flowType:"googlePay"},{brand:"PAYPAL_EXPRESS",flowType:"payPal"},{brand:"SHOPIFY_INSTALLMENTS",flowType:"shopifyInstallments"},{brand:c.AmazonPay,flowType:"amazonPay"},{brand:c.BuyWithPrime,flowType:"buyWithPrime"}];[...v,...w,...O];function D(e){return Object.values(c).includes(e)}function j(){const{checkout:{identity:e},router:o,shopPay:t}=P(),r=L().paymentLines;return _(()=>{const n=e.current.value==="shopPay",s=o.currentUrlMatches("/shoppay_login"),l=r.value,m=t.session.paymentMethodOption.value?.name.toUpperCase()==="SHOPIFY_INSTALLMENTS",E=N.map(({brand:a,flowType:C})=>({condition:D(a)?!!g(l,a):!!M(l,a),flowType:C}));return[{condition:s,flowType:"shopPayLogin"},{condition:m,flowType:"shopifyInstallments"},{condition:n,flowType:"shopPay"},...E].find(({condition:a})=>a)?.flowType??"regular"})}const B=()=>{const{schema:{postMessageHandler:e}}=I(),{observability:o}=P(),t=u((n,s)=>{o.log("checkout_sheet_protocol_violation_event_emitted","Emitting event: `violation`."),e({type:"violation",flowType:s,violationErrors:n})},[e,o]),r=u((n,s)=>{o.log("checkout_sheet_protocol_journey_progression_error_event_emitted","Emitting event: `journeyProgressionError`."),e({type:"journeyProgressionError",flowType:s,reasons:n})},[e,o]);return{handleViolationEvent:t,handleJourneyProgressionErrorEvent:r}};export{k as C,x as E,H as M,Y as P,I as a,j as b,B as c,K as d,V as p,b as u};

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.