1import{f1 as l}from"./addresses-is-address-empty.-MuOhIyI.js";var a=(t=>(t.InterestEligibility="interest_bearing_checkout_eligibility",t.SplitPayEligibility="split_pay_checkout_eligibility",t.UserEligibility="user_eligibility",t.CheckoutEligibility="checkout_eligibility",t.InstallmentsRetryError="installments_retryable_error",t.InstallmentsPermanentRejection="installments_permanent_rejection",t.InstallmentsPlanSelected="plan_selected",t.CreateAgreement="create_agreement",t.OptionImpression="installments_option_impression",t))(a||{}),u=(t=>(t.PointOfSale="point_of_sale",t.SpiBanner="spi_banner",t.ReturningSpiBuyer="returning_spi_buyer",t.SelectedSpi="selected_spi",t))(u||{});function h({consentManager:t,shop:e},{shopAccountUuid:o,userPrivacySettings:r}){r&&e.hasFlagEnabled(l)&&t.setPrefetchedConsent(r,o)}class m{constructor(e){this.customEventNamespace="CheckoutSheetProtocolConsumer",this.#o=c.fromEnvironment(),this.#t=new WeakMap,this.#e=e}#e;#o;#t;postMessageToConsumer(e){const o=window.webkit?.messageHandlers?.CheckoutSheetProtocolConsumer,r=window.CheckoutSheetProtocolConsumer,n=[o,r,this.#o];for(const i of n)if(i&&typeof i?.postMessage=="function")try{const s={name:e.handlerId,body:JSON.stringify(e.body)};return this.#e.log("checkout_sheet_protocol_client_message_posted","Posting message to checkout sheet protocol consumer.",{handlerId:e.handlerId}),i.postMessage(JSON.stringify(s)),this.#e.counter({name:"checkout_sheet_protocol_event_emitted",value:1,exportImmediately:!0,attributes:{event:String(e.handlerId),status:"success"}}),!0}catch(s){return this.#e.log("checkout_sheet_protocol_client_message_posting_failed","Error posting message to checkout sheet protocol consumer",{handlerId:e.handlerId,error:s instanceof Error?s.message:String(s)}),this.#e.counter({name:"checkout_sheet_protocol_event_emitted",value:1,exportImmediately:!0,attributes:{event:String(e.handlerId),status:"failed"}}),console.info("Error received when posting message to checkout sheet protocol consumer",e,s),!1}return this.#e.log("checkout_sheet_protocol_client_no_consumer_found","No checkout sheet protocol consumer found",{handlerId:e.handlerId}),this.#e.counter({name:"checkout_sheet_protocol_event_emitted",value:1,exportImmediately:!0,attributes:{event:String(e.handlerId),status:"no_consumer"}}),!1}addEventListener(e,o){const r=new AbortController,n=this.#t.get(o)??new Map;n.set(e,r),this.#t.set(o,n),this.#o?.addEventListener("message",i=>{i.data.name===e&&o(i)},{signal:r.signal}),window.addEventListener(`${this.customEventNamespace}.${e}`,o,{signal:r.signal})}removeEventListener(e,o){this.#t.get(o)?.get(e)?.abort()}postMessage(e,o){const r=new CustomEvent(`${this.customEventNamespace}.${e}`,o);window.dispatchEvent(r)}}class c{static fromEnvironment(){if(window.opener)return new c(window.opener);if(window.parent!==window)return new c(window.parent)}#e;constructor(e){this.#e=e}addEventListener(e,o,r){window.addEventListener("message",n=>{n.source===this.#e&&d(n.data)&&o(n)},r)}postMessage(e){this.#e.postMessage({_ecp:"2025-10",data:e},"*")}}function d(t){return t!=null&&typeof t=="object"&&"_ecp"in t&&typeof t._ecp=="string"}export{m as C,u as P,a as S,h as r};
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.