'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),r=require("react"),s=require("../../../grid/components/row/Row.js"),i=require("../../../grid/components/col/Col.js");require("../../../modal/components/confirm.js");var l=require("../../../modal/components/Modal.js"),o=require("../product-button/ProductButton.js"),u=require("../ProductImages.js"),a=require("../product-price/ProductPrice.js"),d=require("../product-quantity/ProductQuantity.js"),c=require("../product-title/ProductTitle.js"),n=require("../product-variants/ProductVariants.js");const p=()=>{let r=t.useProduct(),{data:l,isValidating:p,error:g}=t.useProductQuery(r?.id);return p?e.jsx("div",{children:e.jsxs("svg",{className:"gp-mx-auto gp-my-20 gp-h-8 gp-w-8 gp-animate-spin gp-text-base",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"gp-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"gp-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):g?e.jsx("p",{className:"gp-py-20 gp-text-center gp-font-semibold",children:"Something went wrong"}):e.jsx(t.ProductProvider,{product:l,children:e.jsxs(s.default,{setting:{layout:{desktop:{cols:[6,6],display:"fill"},mobile:{cols:[12]}}},children:[e.jsx(i.default,{children:e.jsx(u.default,{})}),e.jsxs(i.default,{children:[e.jsx(c.default,{setting:{htmlTag:"p"},styles:{typography:{type:"heading-3"}}}),e.jsxs(s.default,{setting:{layout:{desktop:{cols:[6,6],display:"fit"}}},children:[e.jsx(i.default,{children:e.jsx(a.default,{setting:{priceType:"regular"},styles:{typography:{type:"subheading-2"}}})}),e.jsx(i.default,{children:e.jsx(a.default,{setting:{priceType:"compare"},styles:{typography:{type:"paragraph-2"}}})})]}),e.jsx(n.default,{}),e.jsx(d.default,{}),e.jsx(o.default,{})]})]})})},g=({label:s})=>{let[i,o]=r.useState(!1),u=t.usePluginEnable();return u?.includes("quick-view")?e.jsxs("div",{children:[e.jsx("div",{"aria-hidden":!0,role:"button","aria-label":"Quick view",onClick:()=>o(e=>!e),children:s}),e.jsx(l.default,{setting:{open:i},closeOnClickOutside:!0,onClose:()=>o(e=>!e),children:e.jsx(p,{})})]}):null};g.defaultProps={label:"Quick View"},exports.default=g;
