1import L from"./Du7c5kok.js";import{p as g,h as S,R as k,L as q,s as B,H as M,v as _,c as $,o as j,T as C,r as i,j as f,U as N,a as R,d as V,i as d,b as E,O as T}from"./xdku3boD.js";import{u as U}from"./DwEc6qYq.js";import{u as D}from"./DXJjcJtE.js";const J={__name:"ScriptPayPalMessages",props:{rootAttrs:{type:Object,required:!1},trigger:{type:[String,Array,Boolean],required:!1,default:"visible"},clientId:{type:String,required:!1,default:"test"},messagesOptions:{type:Object,required:!1,default:()=>({})},merchantId:{type:String,required:!1},partnerAttributionId:{type:String,required:!1},paypalScriptOptions:{type:Object,required:!1,default:()=>({})}},emits:["apply","clickMessages","render"],setup(y,{emit:b}){const n=g(null),h=g(null),s=y,l=g(!1),{onLoaded:I,status:a}=U({clientId:s.clientId,merchantId:s.merchantId,partnerAttributionId:s.partnerAttributionId,...s.paypalScriptOptions}),c=b,m=S(()=>k({onApply:r=>{var t,o;return c("apply",r),(o=(t=s.messagesOptions)==null?void 0:t.onApply)==null?void 0:o.call(t,r)},onClick:r=>{var t,o;return c("clickMessages",r),(o=(t=s.messagesOptions)==null?void 0:t.onClick)==null?void 0:o.call(t,r)},onRender:r=>{var t,o;return c("render",r),(o=(t=s.messagesOptions)==null?void 0:t.onRender)==null?void 0:o.call(t,r)}},s.messagesOptions)),u=q();B(()=>{I(async({paypal:e})=>{var r,t;n.value&&(u.value=(r=e==null?void 0:e.Messages)==null?void 0:r.call(e,m.value),await((t=u.value)==null?void 0:t.render(n.value)),l.value=!0,M(()=>m.value,async o=>{var p,P;n.value&&(u.value=(p=e==null?void 0:e.Messages)==null?void 0:p.call(e,o),await((P=u.value)==null?void 0:P.render(n.value)))}))})});function O(){var e;n.value&&((e=n.value)==null||e.replaceChildren())}_(()=>{O()});const w=L,v=D({trigger:s.trigger,el:h}),A=S(()=>k(s.rootAttrs,{"aria-busy":a.value==="loading","aria-label":a.value==="awaitingLoad"?"PayPal Script Placeholder":a.value==="loading"?"PayPal Buttons Loading":"PayPal Buttons","aria-live":"polite",role:"application",...v instanceof Promise?v.ssrAttrs||{}:{}}));return(e,r)=>(j(),$("div",T(A.value,{id:"test"}),[C(R("div",{ref_key:"el",ref:n},null,512),[[N,l.value]]),l.value?f("",!0):i(e.$slots,"placeholder",{key:0},()=>[r[0]||(r[0]=V(" placeholder "))]),d(a)!=="awaitingLoad"&&!l.value?i(e.$slots,"loading",{key:1},()=>[E(d(w),{color:"black"})]):f("",!0),d(a)==="awaitingLoad"?i(e.$slots,"awaitingLoad",{key:2}):d(a)==="error"?i(e.$slots,"error",{key:3}):f("",!0),i(e.$slots,"default")],16))}};export{J 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.