'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),Link=require("next/link"),core=require("@gem-sdk/core"),helpers=require("../../../link/common/helpers.js"),Text=require("../../../text/components/Text.js"),system=require("@gem-sdk/system"),helpers$1=require("./common/helpers.js");const ProductTitle=e=>{let{setting:t,builderProps:r}=e,{isPreviewSharePageMode:s}=core.useRenderMode(),i=core.useProduct(),l=s?`/products/${i?.handle}`:i?.handle?helpers.urlJoin("/products",i.handle):"#",o=i?.baseID?.replace("gid://shopify/Product/",""),u=core.useEditorMode(),d=()=>jsxRuntime.jsx(Text.default,{...helpers$1.getTextProps(e,i?.title)}),n={href:l,title:i?.title},c=t?.linkProduct,p=system.createClass({"gp-product-title-link-wrapper":!0}),m=system.createAttr({id:`shopify-text-element-${r?.uid}`,...o&&{"data-product-id":o}});return jsxRuntime.jsx("div",{..."edit"===u&&m,children:system.Unless(!!i,"",system.If(c,jsxRuntime.jsx(Link,{...n,className:p,children:d()}),d()))})};exports.default=ProductTitle;
