'use client';
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{Fragment as i}from"react";import{useProduct as r}from"@gem-sdk/core";import{createStyle as s,createAttr as l,createClass as n}from"@gem-sdk/system";import{getIconCollapseClassesRotate as d,getContainerPriceBreakdownClasses as a,getWrapperLabelClasses as c,getLabelClasses as m,getDividerClasses as u,getWrapperMoneyLinesClasses as p,getWrapperBreakdownClasses as h}from"../helpers/product-price-breakdown/getClasses.js";import{getStyle as f,getWrapperMoneyLinesStyles as b}from"../helpers/product-price-breakdown/getStyles.js";import{useGetItemGapPriceBreakdown as w}from"../hooks/useGetItemGapPriceBreakdown.js";import{useSetCollapsePrice as y}from"../hooks/useSetCollapsePrice.js";import g from"./price-breakdown/MoneyLine.js";import k from"../../text/components/Text.js";import{useGetMoneyLines as I}from"../hooks/useGetMoneyLines.js";let PostPurchaseProductPriceBreakdown=({setting:P={},styles:v={},style:x,builderAttrs:C,builderProps:L,children:j})=>{let{labelStyle:q,moneyStyle:N,spacing:S,width:T,align:B,isShowPrice:D,direction:G}=v,M=r(),H=M?.baseID?.replace("gid://shopify/Product/",""),{isCollapsePrice:R,onClickLabelPriceBreakdown:$}=y(D),{itemGap:E}=w(S),{getMoneyLines:F}=I(v,P),U=s({...f(x)}),W=l({...C}),Z=n(d(R)),z=n(a(B,L?.uid)),A=n(c(G)),J=n(m()),K=n(u()),O=n(p()),Q=n(h()),V=s({...b(T,E)}),X=({uniqueId:e})=>"recurringTotalLabel"===e?{...N,fontWeight:"normal"}:N;return e(t,{children:[e("div",{className:A,onClick:$,role:"button",tabIndex:0,"aria-hidden":"true",children:[o(k,{className:J,styles:{direction:G},setting:{text:R?P.contentHide||"Hide price breakdown":P.contentShow||"Show price breakdown",options:{isCannotEditing:!0}}}),o("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:Z,children:o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0187 10.3598C10.7759 10.5853 10.3963 10.5712 10.1708 10.3284L8.01045 8.00191L5.85012 10.3284C5.62464 10.5712 5.245 10.5853 5.00218 10.3598C4.75935 10.1343 4.74529 9.75469 4.97077 9.51187L7.57077 6.71187C7.6843 6.58961 7.84361 6.52014 8.01045 6.52014C8.17729 6.52014 8.3366 6.58961 8.45012 6.71187L11.0501 9.51187C11.2756 9.75469 11.2615 10.1343 11.0187 10.3598Z",fill:"#1879B9"})})]}),o("div",{className:K}),R?o("div",{className:Q,children:e("div",{...W,className:z,style:U,id:`shopify-text-element-${L?.uid}`,"data-product-id":H,children:[o("div",{className:O,style:V,children:F().map(t=>e(i,{children:["totalLabel"===t.uniqueId&&F().length>1&&o("hr",{}),o("div",{children:o(g,{uniqueId:t.uniqueId,direction:G,builderPropsUID:L?.uid,title:"totalLabel"===t.uniqueId?`<b>${t.title}</b>`:t.title,money:t.money,tooltipData:t.tooltip,labelTextStyles:{typo:{...q},direction:G},moneyTextStyles:{typo:X({uniqueId:t.uniqueId})},subTitle:t.subTitle})},t.uniqueId)]},t.uniqueId))}),j]})}):null]})};export{PostPurchaseProductPriceBreakdown as default};
