import{u as e,b as d}from"./vendor.CynPCimz.js";import{b as c,u as h,T as s,f as p,a3 as y,as as g,at as l,au as o,av as f,aw as m,ax as b,P as _,ay as C,az as k,aA as u,aB as x,aC as P}from"./app.BXvw8ij6.js";function I({quantity:n,previousQuantity:t}){const{i18n:r}=c(),{lineItems:{optionsColor:a="subdued",optionsEmphasis:i}}=h();return e(p,{alignItems:"end",children:[e(s,{...{size:"small",color:a,type:i==="bold"?"strong":void 0},color:"subdued",type:"redundant",children:r.translate("stock.item_label",{count:t})}),e(s,{children:r.translate("stock.item_label",{count:n})})]})}function S({merchandiseIssueType:n}){const{i18n:t}=c();return e(g,{gridAutoFlow:"column",gridAutoColumns:"minmax(auto, max-content)",gridTemplateColumns:"minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-400",alignItems:"center",alignContent:"center",children:[e(y,{size:"small",type:"disabled",tone:"critical"}),e(s,{type:"strong",size:"small",tone:"critical",letterCase:"uppercase",children:(()=>{switch(n){case l.Unfulfillable:case l.Unavailable:return t.translate("contextual_availability.unavailable_label");case l.Unpurchasable:case l.UnpurchasableB2B:return t.translate("stock.unpurchasable_product.status_column_header");case l.Unshippable:return t.translate("stock.unpurchasable_product_generic.status_column_header");default:return t.translate("stock.sold_out_label")}})()})]})}function L({price:n,previousPrice:t}){const{i18n:r}=c();return e(p,{alignItems:"end",children:[t&&e(d,{children:[e(s,{accessibilityVisibility:"exclusive",children:r.translate("order_summary.original_price")}),e(s,{size:"small",color:"subdued",type:"redundant",translate:!1,children:r.formatCurrency(t.amount,{currency:t.currencyCode})})]}),n&&e(d,{children:[e(s,{accessibilityVisibility:"exclusive",children:r.translate("stock.price_update.updated_price")}),e(s,{translate:!1,children:r.formatCurrency(n.amount,{currency:n.currencyCode})})]})]})}function T(n){const{line:t,problem:r}=n,{image:a,title:i}=n.line;return e(b,{...n,children:[e(o,{children:e(_,{src:a?.one,srcSet:a?`${a.one} 1x, ${a.two} 2x, ${a.four} 4x`:void 0,alt:i})}),e(o,{primary:!0,children:e(C,{id:null,deferredAmount:t.deferredAmount,options:t.options,properties:t.properties,quantity:t.quantity,recurringTotal:t.recurringTotal,sellingPlan:t.sellingPlan,subtitle:t.subtitle,title:i,totalPrice:t.totalPrice})}),e(o,{noWrap:!0,children:e(A,{problem:r})})]})}function z(n){return n.type===l.PriceChange}function v(n){return n.type===l.QuantityChange}function A(n){const{problem:t}=n;return z(t)?e(L,{price:t.negotiatedPrice,previousPrice:t.proposedPrice}):v(t)?e(I,{quantity:t.negotiatedQuantity??0,previousQuantity:t.proposedQuantity??0}):e(S,{merchandiseIssueType:t.type})}function R(n){return e(b,{...n,children:[e(o,{children:e(f,{inlineSize:64,blockSize:64})}),e(o,{primary:!0,children:e(m,{inlineSize:"base"})}),e(o,{inlineAlignment:"center",children:e(m,{inlineSize:"small"})})]})}function $(n){const{stockProblemsLineItems:{spacing:t}}=h(),{i18n:r}=c();return e(P,{spacing:t,children:[e(k,{hidden:!0,blockPadding:"base",children:[e(u,{hidden:!0,children:r.translate("order_summary.product_image_label")}),e(u,{hidden:!0,children:r.translate("order_summary.description_label")}),e(u,{hidden:!0,children:r.translate("order_summary.quantity_label")})]}),e(x,{children:n.lineItems.map(({line:a,problem:i})=>n.loading?e(R,{},a.stableId):e(T,{problem:i,line:a},`${i.type}-${a.stableId}`))})]})}export{$ as S};
