'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("@gem-sdk/core"),r=require("@gem-sdk/system"),i=require("../helpers/product-price-breakdown/getClasses.js"),a=require("../helpers/product-price-breakdown/getStyles.js"),l=require("../hooks/useGetItemGapPriceBreakdown.js"),n=require("../hooks/useSetCollapsePrice.js"),o=require("./price-breakdown/MoneyLine.js"),d=require("../../text/components/Text.js"),u=require("../hooks/useGetMoneyLines.js");exports.default=({setting:c={},styles:p={},style:C,builderAttrs:h,builderProps:g,children:x})=>{let{labelStyle:y,moneyStyle:m,spacing:j,width:b,align:q,isShowPrice:w,direction:k}=p,v=t.useProduct(),I=v?.baseID?.replace("gid://shopify/Product/",""),{isCollapsePrice:L,onClickLabelPriceBreakdown:S}=n.useSetCollapsePrice(w),{itemGap:f}=l.useGetItemGapPriceBreakdown(j),{getMoneyLines:P}=u.useGetMoneyLines(p,c),M=r.createStyle({...a.getStyle(C)}),N=r.createAttr({...h}),B=r.createClass(i.getIconCollapseClassesRotate(L)),G=r.createClass(i.getContainerPriceBreakdownClasses(q,g?.uid)),T=r.createClass(i.getWrapperLabelClasses(k)),W=r.createClass(i.getLabelClasses()),D=r.createClass(i.getDividerClasses()),R=r.createClass(i.getWrapperMoneyLinesClasses()),F=r.createClass(i.getWrapperBreakdownClasses()),H=r.createStyle({...a.getWrapperMoneyLinesStyles(b,f)}),$=({uniqueId:e})=>"recurringTotalLabel"===e?{...m,fontWeight:"normal"}:m;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:T,onClick:S,role:"button",tabIndex:0,"aria-hidden":"true",children:[e.jsx(d.default,{className:W,styles:{direction:k},setting:{text:L?c.contentHide||"Hide price breakdown":c.contentShow||"Show price breakdown",options:{isCannotEditing:!0}}}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:B,children:e.jsx("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"})})]}),e.jsx("div",{className:D}),L?e.jsx("div",{className:F,children:e.jsxs("div",{...N,className:G,style:M,id:`shopify-text-element-${g?.uid}`,"data-product-id":I,children:[e.jsx("div",{className:R,style:H,children:P().map(t=>e.jsxs(s.Fragment,{children:["totalLabel"===t.uniqueId&&P().length>1&&e.jsx("hr",{}),e.jsx("div",{children:e.jsx(o.default,{uniqueId:t.uniqueId,direction:k,builderPropsUID:g?.uid,title:"totalLabel"===t.uniqueId?`<b>${t.title}</b>`:t.title,money:t.money,tooltipData:t.tooltip,labelTextStyles:{typo:{...y},direction:k},moneyTextStyles:{typo:$({uniqueId:t.uniqueId})},subTitle:t.subTitle})},t.uniqueId)]},t.uniqueId))}),x]})}):null]})};
