'use client';
import{jsx as t}from"react/jsx-runtime";import e from"next/link";import{useRenderMode as r,useProduct as o,useEditorMode as i}from"@gem-sdk/core";import{urlJoin as m}from"../../../link/common/helpers.js";import d from"../../../text/components/Text.js";import{createClass as l,createAttr as p,Unless as s,If as n}from"@gem-sdk/system";import{getTextProps as c}from"./common/helpers.js";let a=a=>{let{setting:f,builderProps:u}=a,{isPreviewSharePageMode:h}=r(),k=o(),x=h?`/products/${k?.handle}`:k?.handle?m("/products",k.handle):"#",g=k?.baseID?.replace("gid://shopify/Product/",""),j=i(),y=()=>t(d,{...c(a,k?.title)}),P={href:x,title:k?.title},T=f?.linkProduct,$=l({"gp-product-title-link-wrapper":!0}),b=p({id:`shopify-text-element-${u?.uid}`,...g&&{"data-product-id":g}});return t("div",{..."edit"===j&&b,children:s(!!k,"",n(T,t(e,{...P,className:$,children:y()}),y()))})};export{a as default};
