'use client';
import{jsx as e}from"react/jsx-runtime";import t from"../../text/components/Text.js";import{useMemo as r}from"react";import{useArticleStore as i,useTimezone as l}from"@gem-sdk/core";let ArticleDate=({setting:o,builderProps:a,styles:n})=>{let{dateFormat:s}=o??{},d=i(e=>e.article),{timezone:c}=l(),m=(e,t)=>{let r=t?.split(" ")?.[1]??"";return r?new Date(new Date(e).toLocaleString("en-US",{timeZone:r})):e},p=r(()=>{let e=m(new Date(d.publishedAt),c??""),{locales:t,options:r}=JSON.parse(s??'{"locales":"en-US","options":{"month":"short","day":"2-digit","year":"numeric"}}');return e.toLocaleDateString(t,r)},[d.publishedAt,c,s]);return e("div",{id:`shopify-text-element-${a?.uid}`,"data-article-id":d?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:e(t,{builderProps:a,styles:n,setting:{...o,text:p,excludeFlex:!0},disableEdit:!0})})};export{ArticleDate as default};
