@gem-sdk/components 3.0.9 → 3.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../grid/components/ChildrenDroppable.js"),Loading=require("../../common/components/Loading.js"),React=require("react"),ArticleNotFound=require("./ArticleNotFound.js");const ArticleList=e=>{let t=core.useEditorMode(),{styles:i,setting:r,className:l,children:o,builderProps:a,advanced:n,builderAttrs:s}=e??{},{articleSetting:d,numberOfArticle:c}=r??{},{articleIds:u,articlePickType:g}=d??{},{border:m,rounded:p,hasBoxShadow:h,boxShadow:y}=n??{},b=core.composeAdvanceStyle({border:m,rounded:p,hasBoxShadow:h,boxShadow:y,"spacing-setting":n?.["spacing-setting"]}),x={first:u?.length||50,where:{baseIDIn:[...d?.articleIds??[]]},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},j={first:1,where:{baseID:d?.blogId},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"},articlesOrderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},[v,f]=React.useState(!0),A=core.useBlogsQuery("latest"===g?j:null,{revalidateOnMount:!0}),R=core.useArticlesQuery("manually"===g?x:null,{revalidateOnMount:!0}),S=A.data?.blogs?.edges?.[0]?.node,D="manually"===g?R.isLoading:A.isLoading,w="manually"===g?R.isValidating:A.isValidating,T="manually"===g?R.error:A.error,k=A?.data?.blogs?.edges?.[0]?.node,B="latest"===g?core.flattenConnection(k?.articles):core.flattenConnection(R?.data?.articles),L=(e,t)=>({...e??{},blog:{title:t?.title??"",handle:t?.handle??""}}),P="latest"===g?B?.filter((e,t)=>t<+(c||4)).map(e=>L(e,k)):"manually"===g&&d?.articleIds?.length?u?.map(e=>{let t=B?.find(t=>t?.baseID===e);return L(t,t?.blogs?.edges?.[0]?.node)}).filter(Boolean):B.filter((e,t)=>t<(d?.numOfSelectedArticles||4)).map(e=>L(e,e?.blogs?.edges?.[0]?.node));return P?.length||D||"edit"!=t?jsxRuntime.jsxs("div",{...s,className:a?.builderData?.uid,children:[w||D?jsxRuntime.jsx(Loading.default,{}):T?jsxRuntime.jsxs("div",{children:["Error: ",T?.message]}):P?.length?jsxRuntime.jsx(core.ArticleListProvider,{styles:{horizontalGutter:i?.horizontalGutter,verticalGutter:i?.verticalGutter,spacing:i?.spacing,width:i?.width,height:i?.height},settings:{slidesToShow:r?.slideToShow??{desktop:4,tablet:3,mobile:1}},articles:P,children:jsxRuntime.jsx("div",{"data-id":a?.uid,className:"gp-relative",children:jsxRuntime.jsx("div",{style:{...b,...core.makeStyleWithDefault("w",core.makeWidth(i?.width),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...core.makeStyleResponsive("rg",i?.horizontalGutter),...core.makeStyleResponsive("cg",i?.verticalGutter),...core.getStyleBackgroundByDevice(r?.background),...core.getGradientBgrStyleByDevice(r?.background),...core.makeStyleResponsive("gtc",{desktop:`repeat(${core.getResponsiveValueByScreen(r?.slideToShow,"desktop")}, minmax(0, 1fr))`,tablet:r?.slideToShow?.tablet&&`repeat(${core.getResponsiveValueByScreen(r?.slideToShow,"tablet")}, minmax(0, 1fr))`,mobile:r?.slideToShow?.mobile&&`repeat(${core.getResponsiveValueByScreen(r?.slideToShow,"mobile")}, minmax(0, 1fr))`})},className:core.cls(l,"gp-m-auto gp-grid gp-w-full"),children:P.map(e=>jsxRuntime.jsx(core.ArticleProvider,{article:e,readOnly:!0,children:jsxRuntime.jsx("div",{"data-component-type":"component","data-component-tag":"Article","data-component-label":"Article","data-component-no-setting":!0,"data-article-id":e?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:core.isEmptyChildren(o)?jsxRuntime.jsx(ChildrenDroppable.default,{}):o})},e?.id))})})}):jsxRuntime.jsx("div",{children:"Articles not found"}),core.filterToolbarPreview(o,!0)]}):v?jsxRuntime.jsx(ArticleNotFound.default,{blogHandle:S?.handle,onClose:()=>f(!1),articlePickType:g??"manually",children:o}):null};exports.default=ArticleList;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),ChildrenDroppable=require("../../grid/components/ChildrenDroppable.js"),Loading=require("../../common/components/Loading.js"),React=require("react"),ArticleNotFound=require("./ArticleNotFound.js");const ArticleList=e=>{let t=core.useEditorMode(),{styles:i,setting:r,className:l,children:o,builderProps:a,advanced:n,builderAttrs:s}=e??{},{articleSetting:d,numberOfArticle:c}=r??{},{articleIds:u,articlePickType:m}=d??{},{border:g,rounded:p,hasBoxShadow:h,boxShadow:b}=n??{},x=core.composeAdvanceStyle({border:g,rounded:p,hasBoxShadow:h,boxShadow:b,"spacing-setting":n?.["spacing-setting"]}),y={first:u?.length||50,where:{baseIDIn:[...d?.articleIds??[]]},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},j={first:1,where:{baseID:d?.blogId},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"},articlesOrderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},[v,f]=React.useState(!0),R=core.useBlogsQuery("latest"===m?j:null,{revalidateOnMount:!0}),A=core.useArticlesQuery("manually"===m?y:null,{revalidateOnMount:!0}),S=R.data?.blogs?.edges?.[0]?.node,D="manually"===m?A.isLoading:R.isLoading,w="manually"===m?A.isValidating:R.isValidating,T="manually"===m?A.error:R.error,k=R?.data?.blogs?.edges?.[0]?.node,B="latest"===m?core.flattenConnection(k?.articles):core.flattenConnection(A?.data?.articles),P=(e,t)=>({...e??{},blog:{title:t?.title??"",handle:t?.handle??""}}),L="latest"===m?B?.filter((e,t)=>t<+(c||4)).map(e=>P(e,k)):"manually"===m&&d?.articleIds?.length?u?.map(e=>{let t=B?.find(t=>t?.baseID===e);return P(t,t?.blogs?.edges?.[0]?.node)}).filter(Boolean):B.filter((e,t)=>t<(d?.numOfSelectedArticles||4)).map(e=>P(e,e?.blogs?.edges?.[0]?.node));return L?.length||D||"edit"!=t?jsxRuntime.jsxs("div",{...s,className:a?.builderData?.uid,children:[w||D?jsxRuntime.jsx(Loading.default,{}):T?jsxRuntime.jsxs("div",{children:["Error: ",T?.message]}):L?.length?jsxRuntime.jsx(core.ArticleListProvider,{styles:{horizontalGutter:i?.horizontalGutter,verticalGutter:i?.verticalGutter,spacing:i?.spacing,width:i?.width,height:i?.height},settings:{slidesToShow:r?.slideToShow??{desktop:4,tablet:3,mobile:1}},articles:L,children:jsxRuntime.jsx("div",{"data-id":a?.uid,className:"gp-relative",children:jsxRuntime.jsx("div",{style:{...x,...core.makeStyleWithDefault("w",core.makeWidth(i?.width),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...core.makeStyleResponsive("rg",i?.horizontalGutter),...core.makeStyleResponsive("cg",i?.verticalGutter),...core.getStyleBackgroundByDevice(r?.background),...core.getGradientBgrStyleByDevice(r?.background),...core.makeStyleResponsive("gtc",{desktop:`repeat(${core.getResponsiveValueByScreen(r?.slideToShow,"desktop")}, minmax(0, 1fr))`,tablet:r?.slideToShow?.tablet&&`repeat(${core.getResponsiveValueByScreen(r?.slideToShow,"tablet")}, minmax(0, 1fr))`,mobile:r?.slideToShow?.mobile&&`repeat(${core.getResponsiveValueByScreen(r?.slideToShow,"mobile")}, minmax(0, 1fr))`})},className:core.cls(l,"gp-m-auto gp-grid gp-w-full"),children:L.map(e=>jsxRuntime.jsx(core.ArticleProvider,{article:e,readOnly:!0,children:jsxRuntime.jsx("div",{"data-component-type":"component","data-component-tag":"Article","data-component-label":"Article","data-component-no-setting":!0,"data-article-id":e?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:core.isEmptyChildren(o)?jsxRuntime.jsx(ChildrenDroppable.default,{}):o})},e?.id))})})}):jsxRuntime.jsx("div",{children:"Articles not found"}),core.filterToolbarPreview(o,!0)]}):v?jsxRuntime.jsxs("div",{...s,className:a?.builderData?.uid,children:[jsxRuntime.jsx(ArticleNotFound.default,{blogHandle:S?.handle,onClose:()=>f(!1),articlePickType:m??"manually",children:o}),core.filterToolbarPreview(o,!0)]}):null};exports.default=ArticleList;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}const getClasses=({setting:e,builderProps:s,advancedCssClass:t})=>{let o="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return t&&(o+=` ${t}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(o),...helpers.getClassAlignBanner(helpers.getResponsiveSetting(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer gp-h-full")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...helpers.getClassContentPosition(helpers.getContentPosition(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),getOverlayClasses=e=>{let{overlayColor:s}=e??{},t="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1 gp-transition-all gp-duration-300 ",{disableHoverOpacity:o,disableOpacity:l}=helpers.opacityEnabledData(e);return o||(t+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),core.getGlobalColorStateClass("bg",s,l,o)&&(t+=` ${core.getGlobalColorStateClass("bg",s,l,o)}`),composeClasses(t)},getRowClasses=(e,s)=>{let{sizeSetting:t,background:o}=e??{},{verticalAlign:l}=s??{},a=helpers.getClassForContentByFitContent(t,o),r=helpers.getClassForStretchContent(l),g=helpers.getClassSpaceBetween(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),p=helpers.getClassSpaceBetweenLeftRight(s?.layout||{}),n=`gp-hero-banner-row ${a} ${r}`;return{...composeClasses(n),...g,...p}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let t="hero-banner-bg gp-hero-banner-image-background hero-banner-bg-parallax";return s&&(t+=" gp_lazybg"),e&&(t+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(t)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,s=!1)=>{let t="gp-relative",o=core.getValueByDevice(e,"tablet"),l=core.getValueByDevice(e,"mobile");return s&&(t+=" gp-hidden"),o&&(t+=" tablet:gp-h-full tablet:gp-object-cover"),l&&(t+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(t)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};exports.getAdaptiveClasses=getAdaptiveClasses,exports.getAdaptivePictureClasses=getAdaptivePictureClasses,exports.getBackgroundClasses=getBackgroundClasses,exports.getClasses=getClasses,exports.getContainBackgroundClasses=getContainBackgroundClasses,exports.getContainerClasses=getContainerClasses,exports.getHtml5VideoClasses=getHtml5VideoClasses,exports.getIframeYoutubeClasses=getIframeYoutubeClasses,exports.getLazyBackgroundClasses=getLazyBackgroundClasses,exports.getLinkClasses=getLinkClasses,exports.getOverlayClasses=getOverlayClasses,exports.getRowClasses=getRowClasses,exports.getWrapperYoutubeClasses=getWrapperYoutubeClasses;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}const getClasses=({setting:e,builderProps:s,advancedCssClass:t})=>{let o="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return t&&(o+=` ${t}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(o),...helpers.getClassAlignBanner(helpers.getResponsiveSetting(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer gp-h-full")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...helpers.getClassContentPosition(helpers.getContentPosition(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),enableTransitionHover=e=>{let{overlayColor:s}=e??{},t=s?.hover||s?.normal;return t&&"transparent"!==t&&"0%"!=helpers.getOpacityHover(e)},getOverlayClasses=e=>{let{overlayColor:s,hoverEffect:t}=e??{},{disableOpacity:o}=helpers.opacityEnabledData(e),a="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1";return enableTransitionHover(e)&&(a+=" gp-transition-all gp-duration-300"),t&&(a+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),core.getGlobalColorStateClass("bg",s,o,!t)&&(a+=` ${core.getGlobalColorStateClass("bg",s,o,!t)}`),composeClasses(a)},getRowClasses=(e,s)=>{let{sizeSetting:t,background:o}=e??{},{verticalAlign:a}=s??{},l=helpers.getClassForContentByFitContent(t,o),r=helpers.getClassForStretchContent(a),g=helpers.getClassSpaceBetween(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),p=helpers.getClassSpaceBetweenLeftRight(s?.layout||{}),n=`gp-hero-banner-row ${l} ${r}`;return{...composeClasses(n),...g,...p}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let t="hero-banner-bg gp-hero-banner-image-background hero-banner-bg-parallax";return s&&(t+=" gp_lazybg"),e&&(t+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(t)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,s=!1)=>{let t="gp-relative",o=core.getValueByDevice(e,"tablet"),a=core.getValueByDevice(e,"mobile");return s&&(t+=" gp-hidden"),o&&(t+=" tablet:gp-h-full tablet:gp-object-cover"),a&&(t+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(t)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};exports.enableTransitionHover=enableTransitionHover,exports.getAdaptiveClasses=getAdaptiveClasses,exports.getAdaptivePictureClasses=getAdaptivePictureClasses,exports.getBackgroundClasses=getBackgroundClasses,exports.getClasses=getClasses,exports.getContainBackgroundClasses=getContainBackgroundClasses,exports.getContainerClasses=getContainerClasses,exports.getHtml5VideoClasses=getHtml5VideoClasses,exports.getIframeYoutubeClasses=getIframeYoutubeClasses,exports.getLazyBackgroundClasses=getLazyBackgroundClasses,exports.getLinkClasses=getLinkClasses,exports.getOverlayClasses=getOverlayClasses,exports.getRowClasses=getRowClasses,exports.getWrapperYoutubeClasses=getWrapperYoutubeClasses;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),helpers=require("../../image/common/helpers.js"),constant=require("../../constant.js");const getContentPosition=(e,t,o)=>{let l={};return core.DEVICES.map(i=>{let n=core.getResponsiveValueByScreen(e,i),a=core.getResponsiveValueByScreen(t,i),s=core.getResponsiveValueByScreen(o,i);l={...l,[i]:1>=(n?.cols?.length||1)?a:s}}),l},getAspectRatioSettings=(e,t)=>{let o={desktop:e?.desktop?.width,tablet:e?.tablet?.width,mobile:e?.mobile?.width},l={desktop:e?.desktop?.height,tablet:e?.tablet?.height,mobile:e?.mobile?.height},i={desktop:t?.desktop==="custom"?`${core.getResponsiveValueByScreen(o,"desktop")}/${core.getResponsiveValueByScreen(l,"desktop")}`:t?.desktop==="cover"?"unset":t?.desktop,tablet:t?.tablet==="custom"?`${core.getResponsiveValueByScreen(o,"tablet")}/${core.getResponsiveValueByScreen(l,"tablet")}`:t?.tablet==="cover"?"unset":t?.tablet,mobile:t?.mobile==="custom"?`${core.getResponsiveValueByScreen(o,"mobile")}/${core.getResponsiveValueByScreen(l,"mobile")}`:t?.mobile==="cover"?"unset":t?.mobile};return i},getEnableBgImageByDevice=(e,t)=>{if(!core.getResponsiveValueByScreen(getBgImage(t),e))return!1;if(!t?.[e]){if("mobile"===e)return t?.tablet?.type==="image"||t?.desktop?.type==="image"&&!t?.tablet;if("tablet"===e)return t?.desktop?.type==="image"}return t?.[e]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:helpers.createBlurDataURL(t?.desktop?.width??0,t?.desktop?.height??0),tablet:helpers.createBlurDataURL(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:helpers.createBlurDataURL(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(e,t,o,l)=>{if(!e)return"";let i=getBgImage(e),n=core.getResponsiveValueByScreen(e,t),a=o?`url(${imagePlaceholder(e)[t]})`:`url(${helpers.getImageSrc(core.getResponsiveValueByScreen(i,t),t,l)})`,s=n?.color?`, ${n.color}`:"";return n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type==="image"?`${a}${s}`:n?.color?.includes(core.GRADIENT_BGR_KEY)&&n?.type!=="image"?`${n.color}`:n?.type==="image"?a:"url()"},getBackgroundImageHeroBanner=(e,t=!1,o=!1)=>{if(!e)return;let l={};return core.DEVICES.forEach(i=>{l={...l,[i]:getBgImageByScreen(e,i,t,o)}}),core.makeStyleResponsive("bgi",l)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},getStyleAspectRatioHeroBannerCustom=(e,t,o)=>{let l=core.getAspectRatioGlobalSize(t),i=["desktop","mobile","tablet"];return i.forEach(i=>{let n=core.getResponsiveValueByScreen(t,i),a=!!getDataVideoHeroBannerResponsive(i,e),s=n?.shape,r=n?.height,g="original"===s&&"fit-content"!==r,p=g&&a;p&&(l={...l,[i]:"16/9"}),o&&o[i]&&getDataVideoHeroBannerResponsive(i,e)?.data?.videoType==="html5"&&(l={...l,[i]:o[i]})}),core.makeStyleResponsive("aspect",l)},mapContentPositionToHorizontal=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},getDisplayStyleByFitContent=(e,t)=>{let o={desktop:"none",tablet:"none",mobile:"none"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=core.getResponsiveValueByScreen(e,l),n=!!getDataVideoHeroBannerResponsive(l,t),a=i?.shape,s=i?.height,r="original"===a&&"fit-content"!==s&&!n;o={...o,[l]:r?"block":"none"}}),core.makeStyleResponsive("d",o)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:l}=e,i=-l;if(o<i)return 0;if(o>t)return 100;let n=(o-i)/(t-i)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:t?"150%":i?"100vh":"100%"}}),core.makeStyleResponsive("h",o)},getWidthHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:i?"100vw":"100%"}}),core.makeStyleResponsive("w",o)},getTopHeroBanner=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),core.makeStyleResponsive("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),l=getWidthHeroBanner(e,t),i=getTopHeroBanner(e);return{...o,...l,...i}},calcRounderClipPath=(e,t=0,o=0)=>{let l=t,i=t;if(t>o?l=o:i=o,e>=999){let t=e-l;return t>0?t:0}let n=e-i;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,l,i,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:s,bbrr:r,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,n),c=calcRounderClipPath(parseInt(s??"0"),o,l),b=calcRounderClipPath(parseInt(r??"0"),l,i),d=calcRounderClipPath(parseInt(g??"0"),i,n);return`inset(0 0 0 round ${p}px ${c}px ${b}px ${d}px)`},getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),getClassSpaceBetween=(e,t,o)=>{let l=getResponsiveSetting(e),i=getResponsiveSetting(t),n=getResponsiveSetting(o),a=1>=(l?.desktop?.cols?.length||1)?i.desktop:n.desktop,s=1>=(l?.tablet?.cols?.length||1)?i.tablet:n.tablet,r=1>=(l?.mobile?.cols?.length||1)?i.mobile:n.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":l.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.tablet?.cols?.length===1&&"space-between"===s,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":l.tablet?.cols?.length===1&&"top"===s,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":l.tablet?.cols?.length===1&&"center"===s,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":l.tablet?.cols?.length===1&&"bottom"===s,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.mobile?.cols?.length===1&&"space-between"===r,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":l.mobile?.cols?.length===1&&"top"===r,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":l.mobile?.cols?.length===1&&"center"===r,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":l.mobile?.cols?.length===1&&"bottom"===r}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",l=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",i=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":l,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":i,"mobile:!gp-h-auto":!i}},getClassForStretchContent=e=>{let t={desktop:"none",tablet:"none",mobile:"none"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=core.getResponsiveValueByScreen(e,o);t={...t,[o]:l}}),core.cls("space-between"===t.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===t.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${e?.tablet}`,"space-between"===t.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${e?.mobile}`)},getClassForContentByFitContent=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=core.getResponsiveValueByScreen(e,l),n=!!getDataVideoHeroBannerResponsive(l,t),a=i?.shape,s=i?.height,r="original"===a&&"fit-content"!==s;o={...o,[l]:r&&!n}}),core.cls(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",l=e.tablet||o,i=e.mobile||l;return{[`gp-justify-${t[o||"center"]}`]:!!o,[`tablet:gp-justify-${t[l||"center"]}`]:!!l,[`mobile:gp-justify-${t[i||"center"]}`]:!!i}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},showVideoType=e=>core.DEVICES.some(t=>{let o=core.getValueByDevice(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}const fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:constant.HREF_TO_SALES_PAGE,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o,hoverEffect:l}=e??{},i=!t?.normal||o?.normal=="0%"||!o?.normal,n=!l;return{disableOpacity:i,disableHoverOpacity:n}};exports.debounce=debounce,exports.fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",exports.formatHoverScale=formatHoverScale,exports.getAspectRatioSettings=getAspectRatioSettings,exports.getAttachmentDevice=getAttachmentDevice,exports.getBackgroundImageHeroBanner=getBackgroundImageHeroBanner,exports.getBannerLink=getBannerLink,exports.getBgImage=getBgImage,exports.getClassAlignBanner=getClassAlignBanner,exports.getClassContentPosition=getClassContentPosition,exports.getClassForContentByFitContent=getClassForContentByFitContent,exports.getClassForStretchContent=getClassForStretchContent,exports.getClassSpaceBetween=getClassSpaceBetween,exports.getClassSpaceBetweenLeftRight=getClassSpaceBetweenLeftRight,exports.getClipPath=getClipPath,exports.getContentPosition=getContentPosition,exports.getDataVideoHeroBannerResponsive=getDataVideoHeroBannerResponsive,exports.getDisplayStyleByFitContent=getDisplayStyleByFitContent,exports.getEnableBgImageByDevice=getEnableBgImageByDevice,exports.getPercentageVisible=getPercentageVisible,exports.getResponsiveSetting=getResponsiveSetting,exports.getStyleAspectRatioHeroBannerCustom=getStyleAspectRatioHeroBannerCustom,exports.getStyleHeroBannerBg=getStyleHeroBannerBg,exports.getVisibilityStyle=getVisibilityStyle,exports.getWidth=getWidth,exports.horizontalAlign=horizontalAlign,exports.imagePlaceholder=imagePlaceholder,exports.isScaleImage=isScaleImage,exports.mapContentPositionToHorizontal=mapContentPositionToHorizontal,exports.opacityEnabledData=opacityEnabledData,exports.scrollToContentBanner=scrollToContentBanner,exports.showVideoType=showVideoType;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("../../image/common/helpers.js"),constant=require("../../constant.js");const getContentPosition=(e,t,o)=>{let l={};return core.DEVICES.map(n=>{let i=core.getResponsiveValueByScreen(e,n),a=core.getResponsiveValueByScreen(t,n),r=core.getResponsiveValueByScreen(o,n);l={...l,[n]:1>=(i?.cols?.length||1)?a:r}}),l},getAspectRatioSettings=(e,t)=>{let o={desktop:e?.desktop?.width,tablet:e?.tablet?.width,mobile:e?.mobile?.width},l={desktop:e?.desktop?.height,tablet:e?.tablet?.height,mobile:e?.mobile?.height},n={desktop:t?.desktop==="custom"?`${core.getResponsiveValueByScreen(o,"desktop")}/${core.getResponsiveValueByScreen(l,"desktop")}`:t?.desktop==="cover"?"unset":t?.desktop,tablet:t?.tablet==="custom"?`${core.getResponsiveValueByScreen(o,"tablet")}/${core.getResponsiveValueByScreen(l,"tablet")}`:t?.tablet==="cover"?"unset":t?.tablet,mobile:t?.mobile==="custom"?`${core.getResponsiveValueByScreen(o,"mobile")}/${core.getResponsiveValueByScreen(l,"mobile")}`:t?.mobile==="cover"?"unset":t?.mobile};return n},getEnableBgImageByDevice=(e,t)=>{if(!core.getResponsiveValueByScreen(getBgImage(t),e))return!1;if(!t?.[e]){if("mobile"===e)return t?.tablet?.type==="image"||t?.desktop?.type==="image"&&!t?.tablet;if("tablet"===e)return t?.desktop?.type==="image"}return t?.[e]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:helpers.createBlurDataURL(t?.desktop?.width??0,t?.desktop?.height??0),tablet:helpers.createBlurDataURL(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:helpers.createBlurDataURL(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(e,t,o,l)=>{if(!e)return"";let n=getBgImage(e),i=core.getResponsiveValueByScreen(e,t),a=o?`url(${imagePlaceholder(e)[t]})`:`url(${helpers.getImageSrc(core.getResponsiveValueByScreen(n,t),t,l)})`,r=i?.color?`, ${i.color}`:"";return i?.color?.includes(core.GRADIENT_BGR_KEY)&&i?.type==="image"?`${a}${r}`:i?.color?.includes(core.GRADIENT_BGR_KEY)&&i?.type!=="image"?`${i.color}`:i?.type==="image"?a:"url()"},getBackgroundImageHeroBanner=(e,t=!1,o=!1)=>{if(!e)return;let l={};return core.DEVICES.forEach(n=>{l={...l,[n]:getBgImageByScreen(e,n,t,o)}}),core.makeStyleResponsive("bgi",l)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},getStyleAspectRatioHeroBannerCustom=(e,t,o)=>{let l=core.getAspectRatioGlobalSize(t),n=["desktop","mobile","tablet"];return n.forEach(n=>{let i=core.getResponsiveValueByScreen(t,n),a=!!getDataVideoHeroBannerResponsive(n,e),r=i?.shape,s=i?.height,g="original"===r&&"fit-content"!==s,p=g&&a;p&&(l={...l,[n]:"16/9"}),o&&o[n]&&getDataVideoHeroBannerResponsive(n,e)?.data?.videoType==="html5"&&(l={...l,[n]:o[n]})}),core.makeStyleResponsive("aspect",l)},mapContentPositionToHorizontal=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},getDisplayStyleByFitContent=(e,t)=>{let o={desktop:"none",tablet:"none",mobile:"none"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let n=core.getResponsiveValueByScreen(e,l),i=!!getDataVideoHeroBannerResponsive(l,t),a=n?.shape,r=n?.height,s="original"===a&&"fit-content"!==r&&!i;o={...o,[l]:s?"block":"none"}}),core.makeStyleResponsive("d",o)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:l}=e,n=-l;if(o<n)return 0;if(o>t)return 100;let i=(o-n)/(t-n)*100;return Math.min(Math.max(i,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let n=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:t?"150%":n?"100vh":"100%"}}),core.makeStyleResponsive("h",o)},getWidthHeroBanner=(e,t)=>{let o={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let n=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:n?"100vw":"100%"}}),core.makeStyleResponsive("w",o)},getTopHeroBanner=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),core.makeStyleResponsive("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),l=getWidthHeroBanner(e,t),n=getTopHeroBanner(e);return{...o,...l,...n}},calcRounderClipPath=(e,t=0,o=0)=>{let l=t,n=t;if(t>o?l=o:n=o,e>=999){let t=e-l;return t>0?t:0}let i=e-n;return i>0?i:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,l,n,i]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,i),c=calcRounderClipPath(parseInt(r??"0"),o,l),b=calcRounderClipPath(parseInt(s??"0"),l,n),d=calcRounderClipPath(parseInt(g??"0"),n,i);return`inset(0 0 0 round ${p}px ${c}px ${b}px ${d}px)`},getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),getClassSpaceBetween=(e,t,o)=>{let l=getResponsiveSetting(e),n=getResponsiveSetting(t),i=getResponsiveSetting(o),a=1>=(l?.desktop?.cols?.length||1)?n.desktop:i.desktop,r=1>=(l?.tablet?.cols?.length||1)?n.tablet:i.tablet,s=1>=(l?.mobile?.cols?.length||1)?n.mobile:i.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":l.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.tablet?.cols?.length===1&&"space-between"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":l.tablet?.cols?.length===1&&"top"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":l.tablet?.cols?.length===1&&"center"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":l.tablet?.cols?.length===1&&"bottom"===r,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.mobile?.cols?.length===1&&"space-between"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":l.mobile?.cols?.length===1&&"top"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":l.mobile?.cols?.length===1&&"center"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":l.mobile?.cols?.length===1&&"bottom"===s}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",l=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",n=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":l,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":n,"mobile:!gp-h-auto":!n}},getClassForStretchContent=e=>{let t={desktop:"none",tablet:"none",mobile:"none"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=core.getResponsiveValueByScreen(e,o);t={...t,[o]:l}}),core.cls("space-between"===t.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===t.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${e?.tablet}`,"space-between"===t.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${e?.mobile}`)},getClassForContentByFitContent=(e,t)=>{let o={desktop:!1,tablet:!1,mobile:!1},l=["desktop","mobile","tablet"];return l.forEach(l=>{let n=core.getResponsiveValueByScreen(e,l),i=!!getDataVideoHeroBannerResponsive(l,t),a=n?.shape,r=n?.height,s="original"===a&&"fit-content"!==r;o={...o,[l]:s&&!i}}),core.cls(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",l=e.tablet||o,n=e.mobile||l;return{[`gp-justify-${t[o||"center"]}`]:!!o,[`tablet:gp-justify-${t[l||"center"]}`]:!!l,[`mobile:gp-justify-${t[n||"center"]}`]:!!n}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},showVideoType=e=>core.DEVICES.some(t=>{let o=core.getValueByDevice(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}const fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:constant.HREF_TO_SALES_PAGE,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},l=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:l}},getOpacityHover=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,l="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||l};exports.debounce=debounce,exports.fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",exports.formatHoverScale=formatHoverScale,exports.getAspectRatioSettings=getAspectRatioSettings,exports.getAttachmentDevice=getAttachmentDevice,exports.getBackgroundImageHeroBanner=getBackgroundImageHeroBanner,exports.getBannerLink=getBannerLink,exports.getBgImage=getBgImage,exports.getClassAlignBanner=getClassAlignBanner,exports.getClassContentPosition=getClassContentPosition,exports.getClassForContentByFitContent=getClassForContentByFitContent,exports.getClassForStretchContent=getClassForStretchContent,exports.getClassSpaceBetween=getClassSpaceBetween,exports.getClassSpaceBetweenLeftRight=getClassSpaceBetweenLeftRight,exports.getClipPath=getClipPath,exports.getContentPosition=getContentPosition,exports.getDataVideoHeroBannerResponsive=getDataVideoHeroBannerResponsive,exports.getDisplayStyleByFitContent=getDisplayStyleByFitContent,exports.getEnableBgImageByDevice=getEnableBgImageByDevice,exports.getOpacityHover=getOpacityHover,exports.getPercentageVisible=getPercentageVisible,exports.getResponsiveSetting=getResponsiveSetting,exports.getStyleAspectRatioHeroBannerCustom=getStyleAspectRatioHeroBannerCustom,exports.getStyleHeroBannerBg=getStyleHeroBannerBg,exports.getVisibilityStyle=getVisibilityStyle,exports.getWidth=getWidth,exports.horizontalAlign=horizontalAlign,exports.imagePlaceholder=imagePlaceholder,exports.isScaleImage=isScaleImage,exports.mapContentPositionToHorizontal=mapContentPositionToHorizontal,exports.opacityEnabledData=opacityEnabledData,exports.scrollToContentBanner=scrollToContentBanner,exports.showVideoType=showVideoType;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t,r)=>{let{sizeSetting:l,background:o}=e??{},{ratioOptions:a,aspectRatio:i}=t??{},s={...r,...helpers.getVisibilityStyle(r),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(l,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...helpers.getStyleAspectRatioHeroBannerCustom(o,l,helpers.getAspectRatioSettings(a,i)),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(l))};return filterTruthyStyles(s)},getContainerStyle=(e,t)=>{let{sizeSetting:r,background:l,borderBg:o,cornerBg:a,shadowBg:i,hasActiveShadow:s}=e??{},{ratioOptions:y,aspectRatio:g}=t??{},S={...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(r)),...helpers.getStyleAspectRatioHeroBannerCustom(l,r,helpers.getAspectRatioSettings(y,g)),...core.makeStyle({bs:o?.border??o?.border,bw:o?.width??o?.width,bc:core.getSingleColorVariable(o?.color)}),...core.getRadiusStyleActiveState({...a,active:{...a||{},radiusType:"custom"}}),...l?{...core.getStyleBgColor(l)}:{},...core.getStyleShadow({value:i,styleAppliedFor:"box-shadow",isEnableShadow:s})};return filterTruthyStyles(S)},getOverlayStyle=e=>{let{overlayColor:t,overlayOpacity:r}=e??{},l=core.makeStyleState("op",{...r,hover:r?.hover||r?.normal}),{disableOpacity:o,disableHoverOpacity:a}=helpers.opacityEnabledData(e),i=core.getGlobalColorStateStyle("bgc",{...t,hover:t?.hover||t?.normal});o&&(delete i?.["--bgc"],delete l?.["--op"]),a&&(delete i?.["--hvr-bgc"],delete l?.["--hvr-op"]);let s={...i,...l,"--top":"0","--left":"0"};return filterTruthyStyles(s)},getRowStyle=e=>{let{contentPadding:t}=e??{},r={...core.getResponsiveStylePadding(t)};return filterTruthyStyles(r)},getAdaptiveStyle=e=>{let{sizeSetting:t,background:r}=e??{},l={...helpers.getDisplayStyleByFitContent(t,r),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(t)),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(t,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(l)},getBackgroundStyle=(e,t,r)=>{let{hoverEffectScale:l,background:o,hoverEffectDuration:a}=e??{},i={...helpers.getStyleHeroBannerBg(helpers.getResponsiveSetting(o||{}),t),...core.getStyleBackgroundByDevice(o,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":`${parseInt(`${a}`)??0}s`,"--scale":helpers.formatHoverScale(l),...core.makeStyleResponsive("pos",helpers.getAttachmentDevice(o)),transform:r,transition:"transform 300ms cubic-bezier(0,0,0,1)"};return filterTruthyStyles(i)},getContainBackgroundStyle=e=>{let{borderBg:t,cornerBg:r}=e??{},l={"clip-path":helpers.getClipPath(t?.width,r)};return filterTruthyStyles(l)},getHtml5VideoStyle=e=>{let t={...core.makeStyleResponsive("aspect",e)};return filterTruthyStyles(t)},getYoutubeIframeStyle=e=>{let t={...core.makeStyleResponsive("aspect",e),"pointer-event":"none"};return filterTruthyStyles(t)};exports.getAdaptiveStyle=getAdaptiveStyle,exports.getBackgroundStyle=getBackgroundStyle,exports.getContainBackgroundStyle=getContainBackgroundStyle,exports.getContainerStyle=getContainerStyle,exports.getHtml5VideoStyle=getHtml5VideoStyle,exports.getOverlayStyle=getOverlayStyle,exports.getRowStyle=getRowStyle,exports.getStyle=getStyle,exports.getYoutubeIframeStyle=getYoutubeIframeStyle;
1
+ "use strict";var core=require("@gem-sdk/core"),helpers=require("./helpers.js");function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}const getStyle=(e,t,r)=>{let{sizeSetting:l,background:o}=e??{},{ratioOptions:a,aspectRatio:i}=t??{},s={...r,...helpers.getVisibilityStyle(r),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(l,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...helpers.getStyleAspectRatioHeroBannerCustom(o,l,helpers.getAspectRatioSettings(a,i)),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(l))};return filterTruthyStyles(s)},getContainerStyle=(e,t)=>{let{sizeSetting:r,background:l,borderBg:o,cornerBg:a,shadowBg:i,hasActiveShadow:s}=e??{},{ratioOptions:y,aspectRatio:g}=t??{},n={...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(r)),...helpers.getStyleAspectRatioHeroBannerCustom(l,r,helpers.getAspectRatioSettings(y,g)),...core.makeStyle({bs:o?.border??o?.border,bw:o?.width??o?.width,bc:core.getSingleColorVariable(o?.color)}),...core.getRadiusStyleActiveState({...a,active:{...a||{},radiusType:"custom"}}),...l?{...core.getStyleBgColor(l)}:{},...core.getStyleShadow({value:i,styleAppliedFor:"box-shadow",isEnableShadow:s})};return filterTruthyStyles(n)},getOverlayStyle=e=>{let{overlayColor:t,overlayOpacity:r,hoverEffect:l}=e??{},{disableOpacity:o}=helpers.opacityEnabledData(e),a="number"!=typeof r?.normal||isNaN(r?.normal)?"string"==typeof r?.normal?`${parseInt(r?.normal)}%`:"0%":`${r?.normal}%`,i=core.makeStyleState("op",{normal:a,hover:helpers.getOpacityHover(e)}),s=core.getGlobalColorStateStyle("bgc",{...t,hover:t?.hover||t?.normal});o&&(delete s?.["--bgc"],delete i?.["--op"]),l||(delete s?.["--hvr-bgc"],delete i?.["--hvr-op"]);let y={...s,...i,"--top":"0","--left":"0"};return filterTruthyStyles(y)},getRowStyle=e=>{let{contentPadding:t}=e??{},r={...core.getResponsiveStylePadding(t)};return filterTruthyStyles(r)},getAdaptiveStyle=e=>{let{sizeSetting:t,background:r}=e??{},l={...helpers.getDisplayStyleByFitContent(t,r),...core.makeStyleResponsive("h",core.getHeightByShapeGlobalSize(t)),...core.makeStyleWithDefault("w",core.getWidthByShapeGlobalSize(t,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(l)},getBackgroundStyle=(e,t,r)=>{let{hoverEffectScale:l,background:o,hoverEffectDuration:a}=e??{},i={...helpers.getStyleHeroBannerBg(helpers.getResponsiveSetting(o||{}),t),...core.getStyleBackgroundByDevice(o,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":`${parseInt(`${a}`)??0}s`,"--scale":helpers.formatHoverScale(l),...core.makeStyleResponsive("pos",helpers.getAttachmentDevice(o)),transform:r,transition:"transform 300ms cubic-bezier(0,0,0,1)"};return filterTruthyStyles(i)},getContainBackgroundStyle=e=>{let{borderBg:t,cornerBg:r}=e??{},l={"clip-path":helpers.getClipPath(t?.width,r)};return filterTruthyStyles(l)},getHtml5VideoStyle=e=>{let t={...core.makeStyleResponsive("aspect",e)};return filterTruthyStyles(t)},getYoutubeIframeStyle=e=>{let t={...core.makeStyleResponsive("aspect",e),"pointer-event":"none"};return filterTruthyStyles(t)};exports.getAdaptiveStyle=getAdaptiveStyle,exports.getBackgroundStyle=getBackgroundStyle,exports.getContainBackgroundStyle=getContainBackgroundStyle,exports.getContainerStyle=getContainerStyle,exports.getHtml5VideoStyle=getHtml5VideoStyle,exports.getOverlayStyle=getOverlayStyle,exports.getRowStyle=getRowStyle,exports.getStyle=getStyle,exports.getYoutubeIframeStyle=getYoutubeIframeStyle;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useEditorMode as i,composeAdvanceStyle as l,useBlogsQuery as a,useArticlesQuery as r,flattenConnection as o,ArticleListProvider as d,makeStyleWithDefault as n,makeWidth as s,makeStyleResponsive as c,getStyleBackgroundByDevice as m,getGradientBgrStyleByDevice as g,getResponsiveValueByScreen as p,cls as h,ArticleProvider as u,isEmptyChildren as b,filterToolbarPreview as f}from"@gem-sdk/core";import w from"../../grid/components/ChildrenDroppable.js";import A from"../../common/components/Loading.js";import{useState as T}from"react";import y from"./ArticleNotFound.js";let ArticleList=D=>{let v=i(),{styles:S,setting:O,className:k,children:I,builderProps:L,advanced:E,builderAttrs:P}=D??{},{articleSetting:G,numberOfArticle:_}=O??{},{articleIds:x,articlePickType:C}=G??{},{border:M,rounded:j,hasBoxShadow:B,boxShadow:F}=E??{},N=l({border:M,rounded:j,hasBoxShadow:B,boxShadow:F,"spacing-setting":E?.["spacing-setting"]}),z={first:x?.length||50,where:{baseIDIn:[...G?.articleIds??[]]},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},R={first:1,where:{baseID:G?.blogId},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"},articlesOrderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},[U,$]=T(!0),V=a("latest"===C?R:null,{revalidateOnMount:!0}),H=r("manually"===C?z:null,{revalidateOnMount:!0}),q=V.data?.blogs?.edges?.[0]?.node,J="manually"===C?H.isLoading:V.isLoading,K="manually"===C?H.isValidating:V.isValidating,Q="manually"===C?H.error:V.error,W=V?.data?.blogs?.edges?.[0]?.node,X="latest"===C?o(W?.articles):o(H?.data?.articles),Y=(e,t)=>({...e??{},blog:{title:t?.title??"",handle:t?.handle??""}}),Z="latest"===C?X?.filter((e,t)=>t<+(_||4)).map(e=>Y(e,W)):"manually"===C&&G?.articleIds?.length?x?.map(e=>{let t=X?.find(t=>t?.baseID===e);return Y(t,t?.blogs?.edges?.[0]?.node)}).filter(Boolean):X.filter((e,t)=>t<(G?.numOfSelectedArticles||4)).map(e=>Y(e,e?.blogs?.edges?.[0]?.node));return Z?.length||J||"edit"!=v?t("div",{...P,className:L?.builderData?.uid,children:[K||J?e(A,{}):Q?t("div",{children:["Error: ",Q?.message]}):Z?.length?e(d,{styles:{horizontalGutter:S?.horizontalGutter,verticalGutter:S?.verticalGutter,spacing:S?.spacing,width:S?.width,height:S?.height},settings:{slidesToShow:O?.slideToShow??{desktop:4,tablet:3,mobile:1}},articles:Z,children:e("div",{"data-id":L?.uid,className:"gp-relative",children:e("div",{style:{...N,...n("w",s(S?.width),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...c("rg",S?.horizontalGutter),...c("cg",S?.verticalGutter),...m(O?.background),...g(O?.background),...c("gtc",{desktop:`repeat(${p(O?.slideToShow,"desktop")}, minmax(0, 1fr))`,tablet:O?.slideToShow?.tablet&&`repeat(${p(O?.slideToShow,"tablet")}, minmax(0, 1fr))`,mobile:O?.slideToShow?.mobile&&`repeat(${p(O?.slideToShow,"mobile")}, minmax(0, 1fr))`})},className:h(k,"gp-m-auto gp-grid gp-w-full"),children:Z.map(t=>e(u,{article:t,readOnly:!0,children:e("div",{"data-component-type":"component","data-component-tag":"Article","data-component-label":"Article","data-component-no-setting":!0,"data-article-id":t?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:b(I)?e(w,{}):I})},t?.id))})})}):e("div",{children:"Articles not found"}),f(I,!0)]}):U?e(y,{blogHandle:q?.handle,onClose:()=>$(!1),articlePickType:C??"manually",children:I}):null};export{ArticleList as default};
2
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useEditorMode as i,composeAdvanceStyle as l,useBlogsQuery as a,useArticlesQuery as r,flattenConnection as o,filterToolbarPreview as d,ArticleListProvider as n,makeStyleWithDefault as s,makeWidth as c,makeStyleResponsive as m,getStyleBackgroundByDevice as g,getGradientBgrStyleByDevice as p,getResponsiveValueByScreen as h,cls as u,ArticleProvider as b,isEmptyChildren as f}from"@gem-sdk/core";import w from"../../grid/components/ChildrenDroppable.js";import A from"../../common/components/Loading.js";import{useState as T}from"react";import D from"./ArticleNotFound.js";let ArticleList=y=>{let v=i(),{styles:S,setting:O,className:k,children:I,builderProps:L,advanced:E,builderAttrs:P}=y??{},{articleSetting:G,numberOfArticle:_}=O??{},{articleIds:x,articlePickType:C}=G??{},{border:M,rounded:N,hasBoxShadow:j,boxShadow:B}=E??{},F=l({border:M,rounded:N,hasBoxShadow:j,boxShadow:B,"spacing-setting":E?.["spacing-setting"]}),z={first:x?.length||50,where:{baseIDIn:[...G?.articleIds??[]]},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},R={first:1,where:{baseID:G?.blogId},orderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"},articlesOrderBy:{direction:"DESC",field:"PLATFORM_UPDATED_AT"}},[U,$]=T(!0),V=a("latest"===C?R:null,{revalidateOnMount:!0}),H=r("manually"===C?z:null,{revalidateOnMount:!0}),q=V.data?.blogs?.edges?.[0]?.node,J="manually"===C?H.isLoading:V.isLoading,K="manually"===C?H.isValidating:V.isValidating,Q="manually"===C?H.error:V.error,W=V?.data?.blogs?.edges?.[0]?.node,X="latest"===C?o(W?.articles):o(H?.data?.articles),Y=(e,t)=>({...e??{},blog:{title:t?.title??"",handle:t?.handle??""}}),Z="latest"===C?X?.filter((e,t)=>t<+(_||4)).map(e=>Y(e,W)):"manually"===C&&G?.articleIds?.length?x?.map(e=>{let t=X?.find(t=>t?.baseID===e);return Y(t,t?.blogs?.edges?.[0]?.node)}).filter(Boolean):X.filter((e,t)=>t<(G?.numOfSelectedArticles||4)).map(e=>Y(e,e?.blogs?.edges?.[0]?.node));return Z?.length||J||"edit"!=v?e("div",{...P,className:L?.builderData?.uid,children:[K||J?t(A,{}):Q?e("div",{children:["Error: ",Q?.message]}):Z?.length?t(n,{styles:{horizontalGutter:S?.horizontalGutter,verticalGutter:S?.verticalGutter,spacing:S?.spacing,width:S?.width,height:S?.height},settings:{slidesToShow:O?.slideToShow??{desktop:4,tablet:3,mobile:1}},articles:Z,children:t("div",{"data-id":L?.uid,className:"gp-relative",children:t("div",{style:{...F,...s("w",c(S?.width),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...m("rg",S?.horizontalGutter),...m("cg",S?.verticalGutter),...g(O?.background),...p(O?.background),...m("gtc",{desktop:`repeat(${h(O?.slideToShow,"desktop")}, minmax(0, 1fr))`,tablet:O?.slideToShow?.tablet&&`repeat(${h(O?.slideToShow,"tablet")}, minmax(0, 1fr))`,mobile:O?.slideToShow?.mobile&&`repeat(${h(O?.slideToShow,"mobile")}, minmax(0, 1fr))`})},className:u(k,"gp-m-auto gp-grid gp-w-full"),children:Z.map(e=>t(b,{article:e,readOnly:!0,children:t("div",{"data-component-type":"component","data-component-tag":"Article","data-component-label":"Article","data-component-no-setting":!0,"data-article-id":e?.baseID?.replace("gid://shopify/OnlineStoreArticle/",""),children:f(I)?t(w,{}):I})},e?.id))})})}):t("div",{children:"Articles not found"}),d(I,!0)]}):U?e("div",{...P,className:L?.builderData?.uid,children:[t(D,{blogHandle:q?.handle,onClose:()=>$(!1),articlePickType:C??"manually",children:I}),d(I,!0)]}):null};export{ArticleList as default};
@@ -1 +1 @@
1
- import{getGlobalColorStateClass as e,getValueByDevice as s}from"@gem-sdk/core";import{getClassAlignBanner as o,getResponsiveSetting as l,getClassContentPosition as a,getContentPosition as t,getClassForContentByFitContent as g,getClassForStretchContent as p,opacityEnabledData as r,getClassSpaceBetween as n,getClassSpaceBetweenLeftRight as i}from"./helpers.js";function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}let getClasses=({setting:e,builderProps:s,advancedCssClass:a})=>{let t="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return a&&(t+=` ${a}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(t),...o(l(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer gp-h-full")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...a(t(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),getOverlayClasses=s=>{let{overlayColor:o}=s??{},l="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1 gp-transition-all gp-duration-300 ",{disableHoverOpacity:a,disableOpacity:t}=r(s);return a||(l+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),e("bg",o,t,a)&&(l+=` ${e("bg",o,t,a)}`),composeClasses(l)},getRowClasses=(e,s)=>{let{sizeSetting:o,background:l}=e??{},{verticalAlign:a}=s??{},t=g(o,l),r=p(a),u=n(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),c=i(s?.layout||{}),C=`gp-hero-banner-row ${t} ${r}`;return{...composeClasses(C),...u,...c}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let o="hero-banner-bg gp-hero-banner-image-background hero-banner-bg-parallax";return s&&(o+=" gp_lazybg"),e&&(o+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(o)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,o=!1)=>{let l="gp-relative",a=s(e,"tablet"),t=s(e,"mobile");return o&&(l+=" gp-hidden"),a&&(l+=" tablet:gp-h-full tablet:gp-object-cover"),t&&(l+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(l)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};export{getAdaptiveClasses,getAdaptivePictureClasses,getBackgroundClasses,getClasses,getContainBackgroundClasses,getContainerClasses,getHtml5VideoClasses,getIframeYoutubeClasses,getLazyBackgroundClasses,getLinkClasses,getOverlayClasses,getRowClasses,getWrapperYoutubeClasses};
1
+ import{getGlobalColorStateClass as e,getValueByDevice as s}from"@gem-sdk/core";import{getClassAlignBanner as o,getResponsiveSetting as l,getClassContentPosition as a,getContentPosition as t,getClassForContentByFitContent as r,getClassForStretchContent as g,opacityEnabledData as p,getClassSpaceBetween as n,getClassSpaceBetweenLeftRight as i,getOpacityHover as u}from"./helpers.js";function composeClasses(e){return e.split(" ").reduce((e,s)=>(e[s]=!0,e),{})}let getClasses=({setting:e,builderProps:s,advancedCssClass:a})=>{let t="gp-group/hero gp-flex gp-w-full gp-flex-col gp-self-center gp-transition-colors gp-duration-200 gp-ease-in-out";return a&&(t+=` ${a}`),{...s?.uid&&{[s.uid]:!0},...composeClasses(t),...o(l(e?.alignBanner||{}))}},getLinkClasses=()=>({...composeClasses("gp-cursor-pointer gp-h-full")}),getContainerClasses=(e,s)=>({...composeClasses("gp-relative gp-flex gp-w-full gp-flex-col gp-items-center gp-overflow-hidden hero-banner-container"),...a(t(e?.layout,s?.contentPosition1Col,s?.contentPosition2Col)||{})}),enableTransitionHover=e=>{let{overlayColor:s}=e??{},o=s?.hover||s?.normal;return o&&"transparent"!==o&&"0%"!=u(e)},getOverlayClasses=s=>{let{overlayColor:o,hoverEffect:l}=s??{},{disableOpacity:a}=p(s),t="gp-absolute gp-inset-0 gp-left-[var(--left)] gp-top-[var(--top)] gp-z-1";return enableTransitionHover(s)&&(t+=" gp-transition-all gp-duration-300"),l&&(t+=" group-hover/hero:gp-bg-[color:var(--hvr-bgc,_var(--bgc))] group-hover/hero:gp-opacity-[var(--hvr-op,_var(--op))]"),e("bg",o,a,!l)&&(t+=` ${e("bg",o,a,!l)}`),composeClasses(t)},getRowClasses=(e,s)=>{let{sizeSetting:o,background:l}=e??{},{verticalAlign:a}=s??{},t=r(o,l),p=g(a),u=n(s?.layout||{},e?.contentPosition1Col||{},e?.contentPosition2Col||{}),c=i(s?.layout||{}),C=`gp-hero-banner-row ${t} ${p}`;return{...composeClasses(C),...u,...c}},getAdaptiveClasses=()=>composeClasses("adaptive-hero-banner"),getAdaptivePictureClasses=()=>composeClasses("gp-w-full"),getBackgroundClasses=(e,s)=>{let o="hero-banner-bg gp-hero-banner-image-background hero-banner-bg-parallax";return s&&(o+=" gp_lazybg"),e&&(o+=" gp-duration-[var(--duration)] group-hover/hero:gp-scale-[var(--scale)] gp-transition-transform"),composeClasses(o)},getContainBackgroundClasses=()=>composeClasses("gp-hero-banner-bg gp-absolute gp-overflow-hidden gp-w-full gp-h-full top-0 left-0"),getHtml5VideoClasses=(e,o=!1)=>{let l="gp-relative",a=s(e,"tablet"),t=s(e,"mobile");return o&&(l+=" gp-hidden"),a&&(l+=" tablet:gp-h-full tablet:gp-object-cover"),t&&(l+=" mobile:gp-h-full mobile:gp-object-cover"),composeClasses(l)},getWrapperYoutubeClasses=()=>composeClasses("gp-pb-[56.25%] gp-h-full gp-w-full !gp-max-w-none gp-pointer-events-none"),getIframeYoutubeClasses=()=>composeClasses("!gp-w-[500%] !gp-ml-[-200%] !gp-h-full !gp-max-w-none gp-scale-[104%]"),getLazyBackgroundClasses=e=>{let s="gp-absolute gp-top-0 gp-invisible gp-w-full gp_lazyload gp-h-full gp_lazyforbg";return"tablet"===e&&(s+=" gp_lazybg_tl"),"mobile"===e&&(s+=" gp_lazybg_mb"),composeClasses(s)};export{enableTransitionHover,getAdaptiveClasses,getAdaptivePictureClasses,getBackgroundClasses,getClasses,getContainBackgroundClasses,getContainerClasses,getHtml5VideoClasses,getIframeYoutubeClasses,getLazyBackgroundClasses,getLinkClasses,getOverlayClasses,getRowClasses,getWrapperYoutubeClasses};
@@ -1 +1 @@
1
- import{getResponsiveValueByScreen as e,getAspectRatioGlobalSize as t,makeStyleResponsive as l,DEVICES as o,getValueByDevice as i,GRADIENT_BGR_KEY as n,cls as a}from"@gem-sdk/core";import{getImageSrc as r,createBlurDataURL as s}from"../../image/common/helpers.js";import{HREF_TO_SALES_PAGE as g}from"../../constant.js";let getContentPosition=(t,l,i)=>{let n={};return o.map(o=>{let a=e(t,o),r=e(l,o),s=e(i,o);n={...n,[o]:1>=(a?.cols?.length||1)?r:s}}),n},getAspectRatioSettings=(t,l)=>{let o={desktop:t?.desktop?.width,tablet:t?.tablet?.width,mobile:t?.mobile?.width},i={desktop:t?.desktop?.height,tablet:t?.tablet?.height,mobile:t?.mobile?.height},n={desktop:l?.desktop==="custom"?`${e(o,"desktop")}/${e(i,"desktop")}`:l?.desktop==="cover"?"unset":l?.desktop,tablet:l?.tablet==="custom"?`${e(o,"tablet")}/${e(i,"tablet")}`:l?.tablet==="cover"?"unset":l?.tablet,mobile:l?.mobile==="custom"?`${e(o,"mobile")}/${e(i,"mobile")}`:l?.mobile==="cover"?"unset":l?.mobile};return n},getEnableBgImageByDevice=(t,l)=>{if(!e(getBgImage(l),t))return!1;if(!l?.[t]){if("mobile"===t)return l?.tablet?.type==="image"||l?.desktop?.type==="image"&&!l?.tablet;if("tablet"===t)return l?.desktop?.type==="image"}return l?.[t]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:s(t?.desktop?.width??0,t?.desktop?.height??0),tablet:s(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:s(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(t,l,o,i)=>{if(!t)return"";let a=getBgImage(t),s=e(t,l),g=o?`url(${imagePlaceholder(t)[l]})`:`url(${r(e(a,l),l,i)})`,p=s?.color?`, ${s.color}`:"";return s?.color?.includes(n)&&s?.type==="image"?`${g}${p}`:s?.color?.includes(n)&&s?.type!=="image"?`${s.color}`:s?.type==="image"?g:"url()"},getBackgroundImageHeroBanner=(e,t=!1,i=!1)=>{if(!e)return;let n={};return o.forEach(l=>{n={...n,[l]:getBgImageByScreen(e,l,t,i)}}),l("bgi",n)},getAttachmentDevice=e=>{let t={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let o=e?.[l]?.attachment;t={...t,[l]:"fixed"===o?"fixed":"absolute"}}),t},horizontalAlign=(e,t,l)=>mapContentPositionToHorizontal(getContentPosition(e,t,l)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,l)=>({...t,[l]:e?.[l]!=="none"?"flex":e?.[l]}),{}):{},getStyleAspectRatioHeroBannerCustom=(o,i,n)=>{let a=t(i),r=["desktop","mobile","tablet"];return r.forEach(t=>{let l=e(i,t),r=!!getDataVideoHeroBannerResponsive(t,o),s=l?.shape,g=l?.height,p="original"===s&&"fit-content"!==g,b=p&&r;b&&(a={...a,[t]:"16/9"}),n&&n[t]&&getDataVideoHeroBannerResponsive(t,o)?.data?.videoType==="html5"&&(a={...a,[t]:n[t]})}),l("aspect",a)},mapContentPositionToHorizontal=e=>{let t={};for(let l in e)"top"===e[l]?t[l]="start":"bottom"===e[l]?t[l]="end":t[l]="center";return t},getDisplayStyleByFitContent=(t,o)=>{let i={desktop:"none",tablet:"none",mobile:"none"},n=["desktop","mobile","tablet"];return n.forEach(l=>{let n=e(t,l),a=!!getDataVideoHeroBannerResponsive(l,o),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s&&!a;i={...i,[l]:g?"block":"none"}}),l("d",i)},getWidth=e=>{let t={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let o=e?.[l];o&&(t={...t,[l]:"default"===o?"var(--g-ct-w, 1200px)":o})}),t},getPercentageVisible=(e,t)=>{let{top:l,height:o}=e,i=-o;if(l<i)return 0;if(l>t)return 100;let n=(l-i)/(t-i)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:t?"150%":i?"100vh":"100%"}}),l("h",o)},getWidthHeroBanner=(e,t)=>{let o={},i=["desktop","mobile","tablet"];return i.forEach(l=>{let i=isScaleImage({enableParallax:t,attachment:e[l]?.attachment});o={...o,[l]:i?"100vw":"100%"}}),l("w",o)},getTopHeroBanner=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(l=>{t={...t,[l]:e[l]?.attachment==="fixed"?"0px":""}}),l("top",t)},getStyleHeroBannerBg=(e,t)=>{let l=getHeightHeroBanner(e,t),o=getWidthHeroBanner(e,t),i=getTopHeroBanner(e);return{...l,...o,...i}},calcRounderClipPath=(e,t=0,l=0)=>{let o=t,i=t;if(t>l?o=l:i=l,e>=999){let t=e-o;return t>0?t:0}let n=e-i;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[l,o,i,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),l,n),b=calcRounderClipPath(parseInt(r??"0"),l,o),c=calcRounderClipPath(parseInt(s??"0"),o,i),d=calcRounderClipPath(parseInt(g??"0"),i,n);return`inset(0 0 0 round ${p}px ${b}px ${c}px ${d}px)`},getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),getClassSpaceBetween=(e,t,l)=>{let o=getResponsiveSetting(e),i=getResponsiveSetting(t),n=getResponsiveSetting(l),a=1>=(o?.desktop?.cols?.length||1)?i.desktop:n.desktop,r=1>=(o?.tablet?.cols?.length||1)?i.tablet:n.tablet,s=1>=(o?.mobile?.cols?.length||1)?i.mobile:n.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":o.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":o.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":o.tablet?.cols?.length===1&&"space-between"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":o.tablet?.cols?.length===1&&"top"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":o.tablet?.cols?.length===1&&"center"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":o.tablet?.cols?.length===1&&"bottom"===r,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":o.mobile?.cols?.length===1&&"space-between"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":o.mobile?.cols?.length===1&&"top"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":o.mobile?.cols?.length===1&&"center"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":o.mobile?.cols?.length===1&&"bottom"===s}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),l=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",o=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",i=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":l,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":o,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":i,"mobile:!gp-h-auto":!i}},getClassForStretchContent=t=>{let l={desktop:"none",tablet:"none",mobile:"none"},o=["desktop","mobile","tablet"];return o.forEach(o=>{let i=e(t,o);l={...l,[o]:i}}),a("space-between"===l.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===l.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${t?.tablet}`,"space-between"===l.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${t?.mobile}`)},getClassForContentByFitContent=(t,l)=>{let o={desktop:!1,tablet:!1,mobile:!1},i=["desktop","mobile","tablet"];return i.forEach(i=>{let n=e(t,i),a=!!getDataVideoHeroBannerResponsive(i,l),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s;o={...o,[i]:g&&!a}}),a(o.desktop?"!gp-absolute":"",o.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",o.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},l=e.desktop||"center",o=e.tablet||l,i=e.mobile||o;return{[`gp-justify-${t[l||"center"]}`]:!!l,[`tablet:gp-justify-${t[o||"center"]}`]:!!o,[`mobile:gp-justify-${t[i||"center"]}`]:!!i}},getResponsiveSetting=e=>{let t=e.desktop,l=e.tablet?e.tablet:t,o=e.mobile?e.mobile:l;return{desktop:t,tablet:l,mobile:o}},showVideoType=e=>o.some(t=>{let l=i(e,t);return l?.type!=="color"&&l?.type!=="image"&&!!l&&(l?.videoType==="html5"&&l?.videoHtml5||l?.videoType==="youtube"&&l?.video)});function debounce(e,t){let l;return function(...o){clearTimeout(l),l=setTimeout(()=>e.apply(this,o),t)}}let fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:g,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:l,hoverEffect:o}=e??{},i=!t?.normal||l?.normal=="0%"||!l?.normal,n=!o;return{disableOpacity:i,disableHoverOpacity:n}};export{debounce,fallbackImg,formatHoverScale,getAspectRatioSettings,getAttachmentDevice,getBackgroundImageHeroBanner,getBannerLink,getBgImage,getClassAlignBanner,getClassContentPosition,getClassForContentByFitContent,getClassForStretchContent,getClassSpaceBetween,getClassSpaceBetweenLeftRight,getClipPath,getContentPosition,getDataVideoHeroBannerResponsive,getDisplayStyleByFitContent,getEnableBgImageByDevice,getPercentageVisible,getResponsiveSetting,getStyleAspectRatioHeroBannerCustom,getStyleHeroBannerBg,getVisibilityStyle,getWidth,horizontalAlign,imagePlaceholder,isScaleImage,mapContentPositionToHorizontal,opacityEnabledData,scrollToContentBanner,showVideoType};
1
+ import{getResponsiveValueByScreen as e,getAspectRatioGlobalSize as t,makeStyleResponsive as o,DEVICES as l,getValueByDevice as i,GRADIENT_BGR_KEY as n,cls as a}from"@gem-sdk/core";import{getImageSrc as r,createBlurDataURL as s}from"../../image/common/helpers.js";import{HREF_TO_SALES_PAGE as g}from"../../constant.js";let getContentPosition=(t,o,i)=>{let n={};return l.map(l=>{let a=e(t,l),r=e(o,l),s=e(i,l);n={...n,[l]:1>=(a?.cols?.length||1)?r:s}}),n},getAspectRatioSettings=(t,o)=>{let l={desktop:t?.desktop?.width,tablet:t?.tablet?.width,mobile:t?.mobile?.width},i={desktop:t?.desktop?.height,tablet:t?.tablet?.height,mobile:t?.mobile?.height},n={desktop:o?.desktop==="custom"?`${e(l,"desktop")}/${e(i,"desktop")}`:o?.desktop==="cover"?"unset":o?.desktop,tablet:o?.tablet==="custom"?`${e(l,"tablet")}/${e(i,"tablet")}`:o?.tablet==="cover"?"unset":o?.tablet,mobile:o?.mobile==="custom"?`${e(l,"mobile")}/${e(i,"mobile")}`:o?.mobile==="cover"?"unset":o?.mobile};return n},getEnableBgImageByDevice=(t,o)=>{if(!e(getBgImage(o),t))return!1;if(!o?.[t]){if("mobile"===t)return o?.tablet?.type==="image"||o?.desktop?.type==="image"&&!o?.tablet;if("tablet"===t)return o?.desktop?.type==="image"}return o?.[t]?.type==="image"},getBgImage=e=>{if(!e)return{};let t={desktop:e?.desktop?.image,tablet:e?.tablet?.image,mobile:e?.mobile?.image};return t},imagePlaceholder=e=>{let t=getBgImage(e);return{desktop:s(t?.desktop?.width??0,t?.desktop?.height??0),tablet:s(t?.tablet?.width??t?.desktop?.width??0,t?.tablet?.height??t?.desktop?.width??0),mobile:s(t?.mobile?.width??t?.tablet?.width??t?.desktop?.width??0,t?.mobile?.height??t?.tablet?.height??t?.desktop?.width??0)}},getBgImageByScreen=(t,o,l,i)=>{if(!t)return"";let a=getBgImage(t),s=e(t,o),g=l?`url(${imagePlaceholder(t)[o]})`:`url(${r(e(a,o),o,i)})`,p=s?.color?`, ${s.color}`:"";return s?.color?.includes(n)&&s?.type==="image"?`${g}${p}`:s?.color?.includes(n)&&s?.type!=="image"?`${s.color}`:s?.type==="image"?g:"url()"},getBackgroundImageHeroBanner=(e,t=!1,i=!1)=>{if(!e)return;let n={};return l.forEach(o=>{n={...n,[o]:getBgImageByScreen(e,o,t,i)}}),o("bgi",n)},getAttachmentDevice=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o]?.attachment;t={...t,[o]:"fixed"===l?"fixed":"absolute"}}),t},horizontalAlign=(e,t,o)=>mapContentPositionToHorizontal(getContentPosition(e,t,o)),scrollToContentBanner=e=>e?.target?.closest("div.gp-hero-banner-row")?.scrollTo(0,0),getDataVideoHeroBannerResponsive=(e,t)=>{switch(e){case"desktop":if(t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if(t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.tablet&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if(t?.mobile?.type==="video")return{device:"mobile",data:t.mobile};if(!t?.mobile&&t?.tablet?.type==="video")return{device:"tablet",data:t.tablet};if(!t?.mobile&&!t?.tablet?.type&&t?.desktop?.type==="video")return{device:"desktop",data:t.desktop}}},getVisibilityStyle=e=>e?Object.keys(e).filter(e=>["--d","--d-tablet","--d-mobile"].includes(e)).reduce((t,o)=>({...t,[o]:e?.[o]!=="none"?"flex":e?.[o]}),{}):{},getStyleAspectRatioHeroBannerCustom=(l,i,n)=>{let a=t(i),r=["desktop","mobile","tablet"];return r.forEach(t=>{let o=e(i,t),r=!!getDataVideoHeroBannerResponsive(t,l),s=o?.shape,g=o?.height,p="original"===s&&"fit-content"!==g,b=p&&r;b&&(a={...a,[t]:"16/9"}),n&&n[t]&&getDataVideoHeroBannerResponsive(t,l)?.data?.videoType==="html5"&&(a={...a,[t]:n[t]})}),o("aspect",a)},mapContentPositionToHorizontal=e=>{let t={};for(let o in e)"top"===e[o]?t[o]="start":"bottom"===e[o]?t[o]="end":t[o]="center";return t},getDisplayStyleByFitContent=(t,l)=>{let i={desktop:"none",tablet:"none",mobile:"none"},n=["desktop","mobile","tablet"];return n.forEach(o=>{let n=e(t,o),a=!!getDataVideoHeroBannerResponsive(o,l),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s&&!a;i={...i,[o]:g?"block":"none"}}),o("d",i)},getWidth=e=>{let t={},o=["desktop","mobile","tablet"];return o.forEach(o=>{let l=e?.[o];l&&(t={...t,[o]:"default"===l?"var(--g-ct-w, 1200px)":l})}),t},getPercentageVisible=(e,t)=>{let{top:o,height:l}=e,i=-l;if(o<i)return 0;if(o>t)return 100;let n=(o-i)/(t-i)*100;return Math.min(Math.max(n,0),100)},isScaleImage=({enableParallax:e=!1,attachment:t="scroll"})=>!!e||"fixed"===t,getHeightHeroBanner=(e,t)=>{let l={},i=["desktop","mobile","tablet"];return i.forEach(o=>{let i=isScaleImage({enableParallax:t,attachment:e[o]?.attachment});l={...l,[o]:t?"150%":i?"100vh":"100%"}}),o("h",l)},getWidthHeroBanner=(e,t)=>{let l={},i=["desktop","mobile","tablet"];return i.forEach(o=>{let i=isScaleImage({enableParallax:t,attachment:e[o]?.attachment});l={...l,[o]:i?"100vw":"100%"}}),o("w",l)},getTopHeroBanner=e=>{let t={},l=["desktop","mobile","tablet"];return l.forEach(o=>{t={...t,[o]:e[o]?.attachment==="fixed"?"0px":""}}),o("top",t)},getStyleHeroBannerBg=(e,t)=>{let o=getHeightHeroBanner(e,t),l=getWidthHeroBanner(e,t),i=getTopHeroBanner(e);return{...o,...l,...i}},calcRounderClipPath=(e,t=0,o=0)=>{let l=t,i=t;if(t>o?l=o:i=o,e>=999){let t=e-l;return t>0?t:0}let n=e-i;return n>0?n:0},getClipPath=(e,t)=>{if(!t||!e)return"inset(0 0 0)";let[o,l,i,n]=e.split(" ").map(e=>parseInt(e??"0")),{btlr:a,btrr:r,bbrr:s,bblr:g}=t,p=calcRounderClipPath(parseInt(a??"0"),o,n),b=calcRounderClipPath(parseInt(r??"0"),o,l),c=calcRounderClipPath(parseInt(s??"0"),l,i),d=calcRounderClipPath(parseInt(g??"0"),i,n);return`inset(0 0 0 round ${p}px ${b}px ${c}px ${d}px)`},getClassAlignBanner=e=>({"!gp-self-start":"left"===e.desktop,"!gp-self-center":"center"===e.desktop,"!gp-self-end":"right"===e.desktop,"tablet:!gp-self-start":"left"===e.tablet,"tablet:!gp-self-center":"center"===e.tablet,"tablet:!gp-self-end":"right"===e.tablet,"mobile:!gp-self-start":"left"===e.mobile,"mobile:!gp-self-center":"center"===e.mobile,"mobile:!gp-self-end":"right"===e.mobile}),getClassSpaceBetween=(e,t,o)=>{let l=getResponsiveSetting(e),i=getResponsiveSetting(t),n=getResponsiveSetting(o),a=1>=(l?.desktop?.cols?.length||1)?i.desktop:n.desktop,r=1>=(l?.tablet?.cols?.length||1)?i.tablet:n.tablet,s=1>=(l?.mobile?.cols?.length||1)?i.mobile:n.mobile;return{"!gp-h-full !gp-content-stretch [&>*]:!gp-justify-between [&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.desktop?.cols?.length===1&&"space-between"===a,"!gp-content-stretch [&>*]:!gp-justify-start":l.desktop?.cols?.length===1&&"top"===a,"tablet:!gp-h-full tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-between tablet:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.tablet?.cols?.length===1&&"space-between"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-start":l.tablet?.cols?.length===1&&"top"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-center":l.tablet?.cols?.length===1&&"center"===r,"tablet:!gp-content-stretch tablet:[&>*]:!gp-justify-end":l.tablet?.cols?.length===1&&"bottom"===r,"mobile:!gp-h-full mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-between mobile:[&>*:nth-child(2)]:gp-absolute [&>*:nth-child(2)]:gp-hidden":l.mobile?.cols?.length===1&&"space-between"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-start":l.mobile?.cols?.length===1&&"top"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-center":l.mobile?.cols?.length===1&&"center"===s,"mobile:!gp-content-stretch mobile:[&>*]:!gp-justify-end":l.mobile?.cols?.length===1&&"bottom"===s}},getClassSpaceBetweenLeftRight=e=>{let t=getResponsiveSetting(e),o=t?.desktop?.type=="left-distributed"||t?.desktop?.type=="right-distributed",l=t?.tablet?.type=="left-distributed"||t?.tablet?.type=="right-distributed",i=t?.mobile?.type=="left-distributed"||t?.mobile?.type=="right-distributed";return{"gp-h-full tablet:gp-h-auto mobile:gp-h-auto [&>*]:!gp-justify-between":o,"tablet:!gp-h-full tablet:[&>*]:!gp-justify-between mobile:gp-h-auto":l,"mobile:!gp-h-full mobile:[&>*]:!gp-justify-between":i,"mobile:!gp-h-auto":!i}},getClassForStretchContent=t=>{let o={desktop:"none",tablet:"none",mobile:"none"},l=["desktop","mobile","tablet"];return l.forEach(l=>{let i=e(t,l);o={...o,[l]:i}}),a("space-between"===o.desktop?"[&>*>*]:!gp-justify-between":"","space-between"===o.tablet?"tablet:[&>*>*]:!gp-justify-between ":`tablet:[&>*>*]:!gp-justify-${t?.tablet}`,"space-between"===o.mobile?"mobile:[&>*>*]:!gp-justify-between ":`mobile:[&>*>*]:!gp-justify-${t?.mobile}`)},getClassForContentByFitContent=(t,o)=>{let l={desktop:!1,tablet:!1,mobile:!1},i=["desktop","mobile","tablet"];return i.forEach(i=>{let n=e(t,i),a=!!getDataVideoHeroBannerResponsive(i,o),r=n?.shape,s=n?.height,g="original"===r&&"fit-content"!==s;l={...l,[i]:g&&!a}}),a(l.desktop?"!gp-absolute":"",l.tablet?"tablet:!gp-absolute":"tablet:!gp-relative",l.mobile?"mobile:!gp-absolute":"mobile:!gp-relative")},getClassContentPosition=e=>{let t={center:"center",top:"start",bottom:"end","space-between":"between"},o=e.desktop||"center",l=e.tablet||o,i=e.mobile||l;return{[`gp-justify-${t[o||"center"]}`]:!!o,[`tablet:gp-justify-${t[l||"center"]}`]:!!l,[`mobile:gp-justify-${t[i||"center"]}`]:!!i}},getResponsiveSetting=e=>{let t=e.desktop,o=e.tablet?e.tablet:t,l=e.mobile?e.mobile:o;return{desktop:t,tablet:o,mobile:l}},showVideoType=e=>l.some(t=>{let o=i(e,t);return o?.type!=="color"&&o?.type!=="image"&&!!o&&(o?.videoType==="html5"&&o?.videoHtml5||o?.videoType==="youtube"&&o?.video)});function debounce(e,t){let o;return function(...l){clearTimeout(o),o=setTimeout(()=>e.apply(this,l),t)}}let fallbackImg="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZGVmcz4KICAgICAgPGxpbmVhckdyYWRpZW50IGlkPSJnLTE5MjAtOTAwIj4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjIwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjUwJSIgLz4KICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSJyZ2JhKDUxLCA1MSwgNTEsIDApIiBvZmZzZXQ9IjcwJSIgLz4KICAgICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDwvZGVmcz4KICAgIDxyZWN0IHdpZHRoPSIxOTIwIiBoZWlnaHQ9IjkwMCIgZmlsbD0icmdiYSg1MSwgNTEsIDUxLCAwKSIgLz4KICAgIDxyZWN0IGlkPSJyIiB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI5MDAiIGZpbGw9InVybCgjZy0xOTIwLTkwMCkiIC8+CiAgICA8YW5pbWF0ZSB4bGluazpocmVmPSIjciIgYXR0cmlidXRlTmFtZT0ieCIgZnJvbT0iLTE5MjAiIHRvPSIxOTIwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgIC8+CiAgPC9zdmc+",getBannerLink=e=>{let t=e?.link;return t?.type==="go-to-sales-page"?{type:"go-to-sales-page",link:g,target:"_self"}:t},formatHoverScale=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",opacityEnabledData=e=>{let{overlayColor:t,overlayOpacity:o}=e??{},l=!t?.normal||o?.normal=="0%"||!o?.normal;return{disableOpacity:l}},getOpacityHover=e=>{let{overlayOpacity:t}=e??{},o="number"!=typeof t?.hover||isNaN(t?.hover)?"string"==typeof t?.hover?`${parseInt(t?.hover)}%`:"":`${t?.hover}%`,l="number"!=typeof t?.normal||isNaN(t?.normal)?"string"==typeof t?.normal?`${parseInt(t?.normal)}%`:"0%":`${t?.normal}%`;return o||l};export{debounce,fallbackImg,formatHoverScale,getAspectRatioSettings,getAttachmentDevice,getBackgroundImageHeroBanner,getBannerLink,getBgImage,getClassAlignBanner,getClassContentPosition,getClassForContentByFitContent,getClassForStretchContent,getClassSpaceBetween,getClassSpaceBetweenLeftRight,getClipPath,getContentPosition,getDataVideoHeroBannerResponsive,getDisplayStyleByFitContent,getEnableBgImageByDevice,getOpacityHover,getPercentageVisible,getResponsiveSetting,getStyleAspectRatioHeroBannerCustom,getStyleHeroBannerBg,getVisibilityStyle,getWidth,horizontalAlign,imagePlaceholder,isScaleImage,mapContentPositionToHorizontal,opacityEnabledData,scrollToContentBanner,showVideoType};
@@ -1 +1 @@
1
- import{makeStyleWithDefault as e,getWidthByShapeGlobalSize as t,makeStyleResponsive as r,getHeightByShapeGlobalSize as l,makeStyle as o,getSingleColorVariable as i,getRadiusStyleActiveState as n,getStyleBgColor as y,getStyleShadow as g,makeStyleState as a,getGlobalColorStateStyle as u,getResponsiveStylePadding as s,getStyleBackgroundByDevice as c}from"@gem-sdk/core";import{getVisibilityStyle as S,getStyleAspectRatioHeroBannerCustom as h,getAspectRatioSettings as d,getDisplayStyleByFitContent as p,getStyleHeroBannerBg as b,formatHoverScale as f,getAttachmentDevice as m,getClipPath as w,opacityEnabledData as v,getResponsiveSetting as T}from"./helpers.js";function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let getStyle=(o,i,n)=>{let{sizeSetting:y,background:g}=o??{},{ratioOptions:a,aspectRatio:u}=i??{},s={...n,...S(n),...e("w",t(y,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...h(g,y,d(a,u)),...r("h",l(y))};return filterTruthyStyles(s)},getContainerStyle=(e,t)=>{let{sizeSetting:a,background:u,borderBg:s,cornerBg:c,shadowBg:S,hasActiveShadow:p}=e??{},{ratioOptions:b,aspectRatio:f}=t??{},m={...r("h",l(a)),...h(u,a,d(b,f)),...o({bs:s?.border??s?.border,bw:s?.width??s?.width,bc:i(s?.color)}),...n({...c,active:{...c||{},radiusType:"custom"}}),...u?{...y(u)}:{},...g({value:S,styleAppliedFor:"box-shadow",isEnableShadow:p})};return filterTruthyStyles(m)},getOverlayStyle=e=>{let{overlayColor:t,overlayOpacity:r}=e??{},l=a("op",{...r,hover:r?.hover||r?.normal}),{disableOpacity:o,disableHoverOpacity:i}=v(e),n=u("bgc",{...t,hover:t?.hover||t?.normal});o&&(delete n?.["--bgc"],delete l?.["--op"]),i&&(delete n?.["--hvr-bgc"],delete l?.["--hvr-op"]);let y={...n,...l,"--top":"0","--left":"0"};return filterTruthyStyles(y)},getRowStyle=e=>{let{contentPadding:t}=e??{},r={...s(t)};return filterTruthyStyles(r)},getAdaptiveStyle=o=>{let{sizeSetting:i,background:n}=o??{},y={...p(i,n),...r("h",l(i)),...e("w",t(i,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(y)},getBackgroundStyle=(e,t,l)=>{let{hoverEffectScale:o,background:i,hoverEffectDuration:n}=e??{},y={...b(T(i||{}),t),...c(i,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":`${parseInt(`${n}`)??0}s`,"--scale":f(o),...r("pos",m(i)),transform:l,transition:"transform 300ms cubic-bezier(0,0,0,1)"};return filterTruthyStyles(y)},getContainBackgroundStyle=e=>{let{borderBg:t,cornerBg:r}=e??{},l={"clip-path":w(t?.width,r)};return filterTruthyStyles(l)},getHtml5VideoStyle=e=>{let t={...r("aspect",e)};return filterTruthyStyles(t)},getYoutubeIframeStyle=e=>{let t={...r("aspect",e),"pointer-event":"none"};return filterTruthyStyles(t)};export{getAdaptiveStyle,getBackgroundStyle,getContainBackgroundStyle,getContainerStyle,getHtml5VideoStyle,getOverlayStyle,getRowStyle,getStyle,getYoutubeIframeStyle};
1
+ import{makeStyleWithDefault as e,getWidthByShapeGlobalSize as t,makeStyleResponsive as r,getHeightByShapeGlobalSize as l,makeStyle as o,getSingleColorVariable as n,getRadiusStyleActiveState as i,getStyleBgColor as y,getStyleShadow as a,makeStyleState as g,getGlobalColorStateStyle as u,getResponsiveStylePadding as s,getStyleBackgroundByDevice as c}from"@gem-sdk/core";import{getVisibilityStyle as S,getStyleAspectRatioHeroBannerCustom as d,getAspectRatioSettings as h,getOpacityHover as p,getDisplayStyleByFitContent as m,getStyleHeroBannerBg as b,formatHoverScale as f,getAttachmentDevice as w,getClipPath as v,opacityEnabledData as T,getResponsiveSetting as k}from"./helpers.js";function filterTruthyStyles(e){return Object.fromEntries(Object.entries(e||{}).filter(([,e])=>!!e))}let getStyle=(o,n,i)=>{let{sizeSetting:y,background:a}=o??{},{ratioOptions:g,aspectRatio:u}=n??{},s={...i,...S(i),...e("w",t(y,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),...d(a,y,h(g,u)),...r("h",l(y))};return filterTruthyStyles(s)},getContainerStyle=(e,t)=>{let{sizeSetting:g,background:u,borderBg:s,cornerBg:c,shadowBg:S,hasActiveShadow:p}=e??{},{ratioOptions:m,aspectRatio:b}=t??{},f={...r("h",l(g)),...d(u,g,h(m,b)),...o({bs:s?.border??s?.border,bw:s?.width??s?.width,bc:n(s?.color)}),...i({...c,active:{...c||{},radiusType:"custom"}}),...u?{...y(u)}:{},...a({value:S,styleAppliedFor:"box-shadow",isEnableShadow:p})};return filterTruthyStyles(f)},getOverlayStyle=e=>{let{overlayColor:t,overlayOpacity:r,hoverEffect:l}=e??{},{disableOpacity:o}=T(e),n="number"!=typeof r?.normal||isNaN(r?.normal)?"string"==typeof r?.normal?`${parseInt(r?.normal)}%`:"0%":`${r?.normal}%`,i=g("op",{normal:n,hover:p(e)}),y=u("bgc",{...t,hover:t?.hover||t?.normal});o&&(delete y?.["--bgc"],delete i?.["--op"]),l||(delete y?.["--hvr-bgc"],delete i?.["--hvr-op"]);let a={...y,...i,"--top":"0","--left":"0"};return filterTruthyStyles(a)},getRowStyle=e=>{let{contentPadding:t}=e??{},r={...s(t)};return filterTruthyStyles(r)},getAdaptiveStyle=o=>{let{sizeSetting:n,background:i}=o??{},y={...m(n,i),...r("h",l(n)),...e("w",t(n,!0),{desktop:"--g-ct-w",tablet:"--g-ct-w",mobile:"--g-ct-w"}),"--op":0,"--z":-1};return filterTruthyStyles(y)},getBackgroundStyle=(e,t,l)=>{let{hoverEffectScale:o,background:n,hoverEffectDuration:i}=e??{},y={...b(k(n||{}),t),...c(n,{ignoreBgAttachment:!0,ignoreBackgroundImage:!0}),"--duration":`${parseInt(`${i}`)??0}s`,"--scale":f(o),...r("pos",w(n)),transform:l,transition:"transform 300ms cubic-bezier(0,0,0,1)"};return filterTruthyStyles(y)},getContainBackgroundStyle=e=>{let{borderBg:t,cornerBg:r}=e??{},l={"clip-path":v(t?.width,r)};return filterTruthyStyles(l)},getHtml5VideoStyle=e=>{let t={...r("aspect",e)};return filterTruthyStyles(t)},getYoutubeIframeStyle=e=>{let t={...r("aspect",e),"pointer-event":"none"};return filterTruthyStyles(t)};export{getAdaptiveStyle,getBackgroundStyle,getContainBackgroundStyle,getContainerStyle,getHtml5VideoStyle,getOverlayStyle,getRowStyle,getStyle,getYoutubeIframeStyle};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",