import{bC as I,aW as M,bD as N,bE as R,aj as _,r as T,aO as E,a as e,e as k,bd as L,ab as x,B as S,a_ as p,d as m,P as v,a6 as h,I as D,ae as w,a1 as H,bF as O,bG as B,bH as F,bI as z,ax as C,bJ as q,az as P,aa as V,bK as W,bL as J,aR as K,bM as $,bN as j,bO as G,b0 as U,n as Y,bP as Q,a2 as X}from"./app.owqgWGYv.js";function ae(){const{value:n}=I();return!!n}function ne({children:n}){const i=M(),d=N(),c=R(),s=_(),r=_(),l=T();E(o=>{s.current=void 0,r.current=void 0,"violations"in o&&(s.current=o.violations.map(b=>b.code)),"reasons"in o&&(r.current=o.reasons)});function t(o){o.detail>2&&(i.counter({name:"pay_now_rage_click",value:1}),i.log("rage_click_capture_pay_now_rage_click_detected","pay_now_rage_click",{customerProfile:c?.__typename,numberOfErrors:d?.numberOfErrors()??"unknown",lastInterceptionReasons:r.current,lastViolations:s.current,blocked:l}))}return e("div",{onClickCapture:t,children:n})}function Z({shopId:n,shopName:i,shopLogo:d,amount:c,showDivider:s}){const r=k(),l=L(),[t,o]=x(!1);return e(V,{"aria-expanded":t,"aria-controls":`separate-payments-collapsible-${n}`,onClick:()=>o(!t),children:e(S,{children:[e(p,{columns:["auto","fill"],spacing:"base",children:[e(m,{children:e(v,{size:"small",src:d,alt:i})}),e(m,{blockAlignment:"center",children:[e(p,{columns:["fill","auto"],spacing:"base",children:[e(h,{type:"strong",children:i}),e(p,{columns:"auto",spacing:"small200",blockAlignment:"center",children:[!t&&e(h,{type:"strong",children:l(c.amount,{currency:c.currencyCode,form:"short"})}),e(D,{type:t?"chevron-up":"chevron-down",size:"small-200"})]})]}),e(w,{open:t,id:`separate-payments-collapsible-${n}`,children:[e(H,{spacing:"tight"}),e(O,{title:r("order_summary.cost_table_title"),children:[e(B,{shopId:n}),e(F,{children:[e(z,{children:e(C,{level:1,children:r("order_summary.total_label")})}),e(q,{children:e(C,{level:1,children:l(c.amount,{currency:c.currencyCode,form:"short"})})})]})]})]})]})]}),s&&e(P,{direction:"inline",borderWidth:"base"})]})})}function oe(){const n=k(),i=L(),{value:d,loading:c}=W(),s=J(),{name:r,id:l,brandSettings:t,remoteShopsConfigMap:o}=K(),b=$(j),g=G(()=>{const a=[];for(const[u,y]of s){if(!y)continue;if(u===l){a.push({shopName:r,shopLogo:t?.squareLogo?.url,shopId:l,amount:y});continue}const f=o?.get(u);f&&a.push({shopName:f.name,shopId:u,shopLogo:f.brandSettings?.squareLogo?.url,amount:y})}return a},[s,l,r,t?.squareLogo?.url,o]);if(c||!d||d&&s.size<2)return null;const A=e(Q,{textDecoration:"none",overlay:e(U,{heading:n("payment.payments"),children:e(S,{spacing:"base",children:g.map((a,u)=>b?e(Z,{shopId:a.shopId,shopName:a.shopName,shopLogo:a.shopLogo,amount:a.amount,showDivider:u!==g.length-1},a.shopId):e(Y,{children:[e(p,{columns:["auto","fill","auto"],spacing:"base",children:[e(m,{children:e(v,{size:"small",src:a.shopLogo,alt:a.shopName})}),e(m,{blockAlignment:"center",children:e(h,{children:a.shopName})}),e(m,{blockAlignment:"center",children:e(h,{type:"strong",children:i(a.amount.amount,{currency:a.amount.currencyCode,form:"short"})})})]}),u!==g.length-1&&e(P,{direction:"inline",borderWidth:"base"})]},a.shopName||u))})}),children:n("payment.separate_payments_text")});return e(X,{color:"subdued",children:n("payment.separate_payments_label",{separate_payments_link:A})})}export{ne as R,oe as S,ae as u};