{"version":3,"names":["scLineItemsCss","ScLineItemsStyle0","ScLineItems","isEditable","item","_a","price","ad_hoc","bump_amount","locked","this","editable","render","formBusy","_c","_b","checkoutState","checkout","line_items","data","length","h","style","width","height","slot","display","class","part","tabindex","_e","_d","map","max","getMaxStockQuantity","product","variant","key","id","image","name","priceName","variantLabel","variant_options","filter","Boolean","join","purchasableStatusDisplay","purchasable_status_display","removable","quantity","fees","setupFeeTrialEnabled","_f","setup_fee_trial_enabled","amount","ad_hoc_amount","subtotal_amount","scratchAmount","scratch_amount","scratchDisplayAmount","scratch_display_amount","currency","_g","displayAmount","ad_hoc_display_amount","subtotal_display_amount","trialDurationDays","_h","trial_duration_days","interval","intervalString","showOnce","hasSubscription","onScUpdateQuantity","e","updateCheckoutLineItem","detail","onScRemove","removeCheckoutLineItem","exportparts"],"sources":["src/components/controllers/checkout-form/line-items/sc-line-items.css?tag=sc-line-items&encapsulation=shadow","src/components/controllers/checkout-form/line-items/sc-line-items.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n:slotted(* ~ *) {\n margin-top: 20px;\n}\n\n.line-items {\n display: grid;\n gap: var(--sc-form-row-spacing);\n}\n\n.line-item {\n display: grid;\n gap: var(--sc-spacing-small);\n}\n\n.fee__description {\n opacity: 0.75;\n}\n","import { Component, h, Prop } from '@stencil/core';\nimport { __ } from '@wordpress/i18n';\n\nimport { state as checkoutState } from '@store/checkout';\nimport { hasSubscription } from '../../../../functions/line-items';\nimport { intervalString } from '../../../../functions/price';\nimport { LineItem, Product, Variant } from '../../../../types';\nimport { removeCheckoutLineItem, updateCheckoutLineItem } from '@store/checkout/mutations';\nimport { formBusy } from '@store/form/getters';\nimport { getMaxStockQuantity } from '../../../../functions/quantity';\n\n/**\n * @part base - The component base\n * @part line-item - The line item\n * @part product-line-item - The product line item\n * @part line-item__image - The line item image\n * @part line-item__text - The line item text\n * @part line-item__title - The line item title\n * @part line-item__suffix - The line item suffix\n * @part line-item__price - The line item price\n * @part line-item__price-amount - The line item price amount\n * @part line-item__price-description - The line item price description\n * @part line-item__price-scratch - The line item price scratch\n * @part line-item__static-quantity - The line item static quantity\n * @part line-item__remove-icon - The line item remove icon\n * @part line-item__quantity - The line item quantity\n * @part line-item__quantity-minus - The line item quantity minus\n * @part line-item__quantity-minus-icon - The line item quantity minus icon\n * @part line-item__quantity-plus - The line item quantity plus\n * @part line-item__quantity-plus-icon - The line item quantity plus icon\n * @part line-item__quantity-input - The line item quantity input\n * @part line-item__price-description - The line item price description\n */\n\n@Component({\n tag: 'sc-line-items',\n styleUrl: 'sc-line-items.css',\n shadow: true,\n})\nexport class ScLineItems {\n /**\n * Is the line item editable?\n */\n @Prop() editable: boolean;\n\n /**\n * Is the line item removable?\n */\n @Prop() removable: boolean;\n\n /**\n * Is the line item editable?\n */\n isEditable(item: LineItem) {\n // ad_hoc prices and bumps cannot have quantity.\n if (item?.price?.ad_hoc || item?.bump_amount || item?.locked) {\n return false;\n }\n return this.editable;\n }\n\n render() {\n if (!!formBusy() && !checkoutState?.checkout?.line_items?.data?.length) {\n return (\n