@gem-sdk/components 8.0.0-dev.111 → 8.0.0-dev.114

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.
Files changed (42) hide show
  1. package/dist/cjs/post-purchase/product/components/ProductPriceBreakdown.js +1 -1
  2. package/dist/cjs/post-purchase/product/components/price-breakdown/MoneyLine.js +1 -1
  3. package/dist/cjs/post-purchase/product/components/product-subscription/common/attrs.js +1 -0
  4. package/dist/cjs/post-purchase/product/components/product-subscription/common/extractSellingPlanSettings.js +1 -1
  5. package/dist/cjs/post-purchase/product/components/product-subscription/common/styles.js +1 -1
  6. package/dist/cjs/post-purchase/product/components/product-subscription/components/OneTimePurchaseTooltip.js +1 -0
  7. package/dist/cjs/post-purchase/product/components/product-subscription/components/ProductSubscription.js +1 -1
  8. package/dist/cjs/post-purchase/product/components/product-subscription/components/SellingPlanLabel.js +1 -1
  9. package/dist/cjs/post-purchase/product/components/product-subscription/components/SubscriptionRadio.js +1 -1
  10. package/dist/cjs/post-purchase/product/components/product-subscription/hooks/useDetectBothSubscriptionTypes.js +1 -0
  11. package/dist/cjs/post-purchase/product/components/product-subscription/hooks/useSellingSubscription.js +1 -1
  12. package/dist/cjs/post-purchase/product/components/product-subscription/hooks/useSubscriptionVisibility.js +1 -0
  13. package/dist/cjs/post-purchase/product/constants/index.js +1 -1
  14. package/dist/cjs/post-purchase/product/hooks/useGetMoneyLines.js +1 -1
  15. package/dist/cjs/post-purchase/product/hooks/useSubscriptionConsentCheck.js +1 -1
  16. package/dist/cjs/post-purchase/product/index.js +1 -1
  17. package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/settings.js +1 -1
  18. package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/ui-v2.js +1 -1
  19. package/dist/cjs/post-purchase/product/settings/product-subscription/configs/settings.js +1 -1
  20. package/dist/cjs/post-purchase/product/settings/product-subscription/configs/ui-v2.js +1 -1
  21. package/dist/esm/post-purchase/product/components/ProductPriceBreakdown.js +1 -1
  22. package/dist/esm/post-purchase/product/components/price-breakdown/MoneyLine.js +1 -1
  23. package/dist/esm/post-purchase/product/components/product-subscription/common/attrs.js +1 -0
  24. package/dist/esm/post-purchase/product/components/product-subscription/common/extractSellingPlanSettings.js +1 -1
  25. package/dist/esm/post-purchase/product/components/product-subscription/common/styles.js +1 -1
  26. package/dist/esm/post-purchase/product/components/product-subscription/components/OneTimePurchaseTooltip.js +1 -0
  27. package/dist/esm/post-purchase/product/components/product-subscription/components/ProductSubscription.js +1 -1
  28. package/dist/esm/post-purchase/product/components/product-subscription/components/SellingPlanLabel.js +1 -1
  29. package/dist/esm/post-purchase/product/components/product-subscription/components/SubscriptionRadio.js +1 -1
  30. package/dist/esm/post-purchase/product/components/product-subscription/hooks/useDetectBothSubscriptionTypes.js +1 -0
  31. package/dist/esm/post-purchase/product/components/product-subscription/hooks/useSellingSubscription.js +1 -1
  32. package/dist/esm/post-purchase/product/components/product-subscription/hooks/useSubscriptionVisibility.js +1 -0
  33. package/dist/esm/post-purchase/product/constants/index.js +1 -1
  34. package/dist/esm/post-purchase/product/hooks/useGetMoneyLines.js +1 -1
  35. package/dist/esm/post-purchase/product/hooks/useSubscriptionConsentCheck.js +1 -1
  36. package/dist/esm/post-purchase/product/index.js +1 -1
  37. package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/settings.js +1 -1
  38. package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/ui-v2.js +1 -1
  39. package/dist/esm/post-purchase/product/settings/product-subscription/configs/settings.js +1 -1
  40. package/dist/esm/post-purchase/product/settings/product-subscription/configs/ui-v2.js +1 -1
  41. package/dist/types/index.d.ts +9 -3
  42. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),getClasses=require("../helpers/product-price-breakdown/getClasses.js"),getStyles=require("../helpers/product-price-breakdown/getStyles.js"),useGetItemGapPriceBreakdown=require("../hooks/useGetItemGapPriceBreakdown.js"),useSetCollapsePrice=require("../hooks/useSetCollapsePrice.js"),MoneyLine=require("./price-breakdown/MoneyLine.js"),Text=require("../../text/components/Text.js"),useGetMoneyLines=require("../hooks/useGetMoneyLines.js");const PostPurchaseProductPriceBreakdown=({setting:e={},styles:s={},style:t,builderAttrs:r,builderProps:i,children:a})=>{let{labelStyle:l,moneyStyle:n,spacing:o,width:u,align:d,isShowPrice:c,direction:m}=s,p=core.useProduct(),x=p?.baseID?.replace("gid://shopify/Product/",""),{isCollapsePrice:y,onClickLabelPriceBreakdown:j}=useSetCollapsePrice.useSetCollapsePrice(c),{itemGap:C}=useGetItemGapPriceBreakdown.useGetItemGapPriceBreakdown(o),{getMoneyLines:g}=useGetMoneyLines.useGetMoneyLines(s,e),h=system.createStyle({...getStyles.getStyle(t)}),w=system.createAttr({...r}),P=system.createClass(getClasses.getIconCollapseClassesRotate(y)),R=system.createClass(getClasses.getContainerPriceBreakdownClasses(d,i?.uid)),k=system.createClass(getClasses.getWrapperLabelClasses(m)),b=system.createClass(getClasses.getLabelClasses()),q=system.createClass(getClasses.getDividerClasses()),L=system.createClass(getClasses.getWrapperMoneyLinesClasses()),S=system.createClass(getClasses.getWrapperBreakdownClasses()),v=system.createStyle({...getStyles.getWrapperMoneyLinesStyles(u,C)});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:k,onClick:j,role:"button",tabIndex:0,"aria-hidden":"true",children:[jsxRuntime.jsx(Text.default,{className:b,styles:{direction:m},setting:{text:y?e.contentHide||"Hide price breakdown":e.contentShow||"Show price breakdown",options:{isCannotEditing:!0}}}),jsxRuntime.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:P,children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0187 10.3598C10.7759 10.5853 10.3963 10.5712 10.1708 10.3284L8.01045 8.00191L5.85012 10.3284C5.62464 10.5712 5.245 10.5853 5.00218 10.3598C4.75935 10.1343 4.74529 9.75469 4.97077 9.51187L7.57077 6.71187C7.6843 6.58961 7.84361 6.52014 8.01045 6.52014C8.17729 6.52014 8.3366 6.58961 8.45012 6.71187L11.0501 9.51187C11.2756 9.75469 11.2615 10.1343 11.0187 10.3598Z",fill:"#1879B9"})})]}),jsxRuntime.jsx("div",{className:q}),y?jsxRuntime.jsx("div",{className:S,children:jsxRuntime.jsxs("div",{...w,className:R,style:h,id:`shopify-text-element-${i?.uid}`,"data-product-id":x,children:[jsxRuntime.jsx("div",{className:L,style:v,children:g().map(e=>jsxRuntime.jsxs(React.Fragment,{children:["totalLabel"===e.uniqueId&&g().length>1&&jsxRuntime.jsx("hr",{}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(MoneyLine.default,{uniqueId:e.uniqueId,direction:m,builderPropsUID:i?.uid,title:"totalLabel"===e.uniqueId?`<b>${e.title}</b>`:e.title,money:e.money,tooltipData:e.tooltip,labelTextStyles:{typo:{...l},direction:m},moneyTextStyles:{typo:n}})},e.uniqueId)]},e.uniqueId))}),a]})}):null]})};exports.default=PostPurchaseProductPriceBreakdown;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),getClasses=require("../helpers/product-price-breakdown/getClasses.js"),getStyles=require("../helpers/product-price-breakdown/getStyles.js"),useGetItemGapPriceBreakdown=require("../hooks/useGetItemGapPriceBreakdown.js"),useSetCollapsePrice=require("../hooks/useSetCollapsePrice.js"),MoneyLine=require("./price-breakdown/MoneyLine.js"),Text=require("../../text/components/Text.js"),useGetMoneyLines=require("../hooks/useGetMoneyLines.js");const PostPurchaseProductPriceBreakdown=({setting:e={},styles:s={},style:t,builderAttrs:r,builderProps:i,children:a})=>{let{labelStyle:l,moneyStyle:n,spacing:o,width:u,align:d,isShowPrice:c,direction:m}=s,p=core.useProduct(),x=p?.baseID?.replace("gid://shopify/Product/",""),{isCollapsePrice:y,onClickLabelPriceBreakdown:j}=useSetCollapsePrice.useSetCollapsePrice(c),{itemGap:C}=useGetItemGapPriceBreakdown.useGetItemGapPriceBreakdown(o),{getMoneyLines:g}=useGetMoneyLines.useGetMoneyLines(s,e),h=system.createStyle({...getStyles.getStyle(t)}),w=system.createAttr({...r}),P=system.createClass(getClasses.getIconCollapseClassesRotate(y)),R=system.createClass(getClasses.getContainerPriceBreakdownClasses(d,i?.uid)),b=system.createClass(getClasses.getWrapperLabelClasses(m)),k=system.createClass(getClasses.getLabelClasses()),q=system.createClass(getClasses.getDividerClasses()),L=system.createClass(getClasses.getWrapperMoneyLinesClasses()),S=system.createClass(getClasses.getWrapperBreakdownClasses()),v=system.createStyle({...getStyles.getWrapperMoneyLinesStyles(u,C)});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:b,onClick:j,role:"button",tabIndex:0,"aria-hidden":"true",children:[jsxRuntime.jsx(Text.default,{className:k,styles:{direction:m},setting:{text:y?e.contentHide||"Hide price breakdown":e.contentShow||"Show price breakdown",options:{isCannotEditing:!0}}}),jsxRuntime.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:P,children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0187 10.3598C10.7759 10.5853 10.3963 10.5712 10.1708 10.3284L8.01045 8.00191L5.85012 10.3284C5.62464 10.5712 5.245 10.5853 5.00218 10.3598C4.75935 10.1343 4.74529 9.75469 4.97077 9.51187L7.57077 6.71187C7.6843 6.58961 7.84361 6.52014 8.01045 6.52014C8.17729 6.52014 8.3366 6.58961 8.45012 6.71187L11.0501 9.51187C11.2756 9.75469 11.2615 10.1343 11.0187 10.3598Z",fill:"#1879B9"})})]}),jsxRuntime.jsx("div",{className:q}),y?jsxRuntime.jsx("div",{className:S,children:jsxRuntime.jsxs("div",{...w,className:R,style:h,id:`shopify-text-element-${i?.uid}`,"data-product-id":x,children:[jsxRuntime.jsx("div",{className:L,style:v,children:g().map(e=>jsxRuntime.jsxs(React.Fragment,{children:["totalLabel"===e.uniqueId&&g().length>1&&jsxRuntime.jsx("hr",{}),jsxRuntime.jsx("div",{children:jsxRuntime.jsx(MoneyLine.default,{uniqueId:e.uniqueId,direction:m,builderPropsUID:i?.uid,title:"totalLabel"===e.uniqueId?`<b>${e.title}</b>`:e.title,money:e.money,tooltipData:e.tooltip,labelTextStyles:{typo:{...l},direction:m},moneyTextStyles:{typo:n},subTitle:e.subTitle})},e.uniqueId)]},e.uniqueId))}),a]})}):null]})};exports.default=PostPurchaseProductPriceBreakdown;
@@ -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"),Tooltip=require("../../../../common/components/Tooltip.js"),Text=require("../../../text/components/Text.js"),system=require("@gem-sdk/system"),getClasses=require("../../helpers/product-price-breakdown/getClasses.js"),getStyles=require("../../helpers/product-price-breakdown/getStyles.js");const MoneyLine=({uniqueId:e,title:s,money:t,labelTextStyles:r,moneyTextStyles:o,builderPropsUID:l,tooltipData:i,direction:a})=>{let n=core.useProduct(),u=n?.baseID?.replace("gid://shopify/Product/",""),c=system.createClass(getClasses.getMoneyRowClasses(a)),d=system.createClass(getClasses.getTextLabelMoneyClasses(a)),x=system.createClass(getClasses.getTextValueMoneyClasses(a)),m=getStyles.getLabelTextStyles(a,r);return jsxRuntime.jsxs("div",{className:c,children:[jsxRuntime.jsx(Text.default,{className:d,setting:{text:s,options:{uniqueId:`${e}-${l}-${u}`,productID:u,useState:!0}},styles:m}),i?jsxRuntime.jsx(Tooltip.default,{tooltip:i.content||"",width:i.width||""}):jsxRuntime.jsx(Text.default,{className:x,setting:{text:t,options:{isCannotEditing:!0}},styles:o})]})};exports.default=MoneyLine;
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Tooltip=require("../../../../common/components/Tooltip.js"),Text=require("../../../text/components/Text.js"),system=require("@gem-sdk/system"),getClasses=require("../../helpers/product-price-breakdown/getClasses.js"),getStyles=require("../../helpers/product-price-breakdown/getStyles.js");const MoneyLine=({uniqueId:e,title:s,money:t,labelTextStyles:r,moneyTextStyles:i,builderPropsUID:o,tooltipData:l,direction:n,subTitle:a})=>{let u=core.useProduct(),c=u?.baseID?.replace("gid://shopify/Product/",""),x=system.createClass(getClasses.getMoneyRowClasses(n)),d=system.createClass(getClasses.getTextLabelMoneyClasses(n)),m=system.createClass(getClasses.getTextValueMoneyClasses(n)),p=getStyles.getLabelTextStyles(n,r);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:x,children:[jsxRuntime.jsx(Text.default,{className:d,setting:{text:s,options:{uniqueId:`${e}-${o}-${c}`,productID:c,useState:!0}},styles:p}),l?jsxRuntime.jsx(Tooltip.default,{tooltip:l.content||"",width:l.width||""}):jsxRuntime.jsx(Text.default,{className:m,setting:{text:t,options:{isCannotEditing:!0}},styles:i})]}),a&&jsxRuntime.jsx("div",{className:"gp-text-xs gp-font-normal gp-leading-5 gp-text-[#737373]",children:a})]})};exports.default=MoneyLine;
@@ -0,0 +1 @@
1
+ "use strict";var index=require("../../../constants/index.js");const getSellingPlanLabelAttrs=({styles:e,sellingType:l})=>{let i=l===index.SubscriptionEnum.ONE_TIME;return{typo:i?e?.sellingTitleOneTimeTypo??{}:e?.sellingTitleTypo??{},textAlign:i?e?.sellingTitleOneTimeAlign??"left":e?.sellingTitleAlign??"left",direction:i?e?.sellingTitleOneTimeDirection??"ltr":e?.sellingTitleDirection??"ltr"}};exports.getSellingPlanLabelAttrs=getSellingPlanLabelAttrs;
@@ -1 +1 @@
1
- "use strict";const extractVariantId=t=>t?t.includes("/ProductVariant/")?t.split("/ProductVariant/")[1]||"":t:"",extractSellingPlanSettings=({sellingPlansSetting:t,currentVariant:e,isFromEvent:i=!1})=>{if(!t)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};if(i&&e?.id){let i;let r=Object.keys(t)[0];if(i="data"===r&&t[r]?Object.keys(t[r])[0]:r){let o=t["data"===r?"data":i],u="data"===r?o[i]:o;if(u){let t=extractVariantId(e.id?.toString()||""),i=extractVariantId(e.baseID||""),r=Object.keys(u).find(r=>r===e.id?.toString()||r===e.baseID||r===t||r===i||e.id?.toString()===r||e.baseID===r||e.id?.toString().includes(r)||e.baseID?.includes(r)||r.includes(t)||r.includes(i));if(r&&u[r]){let t=u[r];return{sourceApp:t?.sourceApp,group:t?.group,defaultOptions:t?.defaultOption}}let o=Object.keys(u)[0];if(o&&u[o]){let t=u[o];return{sourceApp:t?.sourceApp,group:t?.group,defaultOptions:t?.defaultOption}}}}}let r=Object.keys(t)[0];if(!r)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let o=t[r];if(!o)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let u=Object.keys(o)[0];if(!u)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let p=o[u];return{sourceApp:p?.sourceApp||p?.appSource,group:p?.group,defaultOptions:p?.defaultOption}};exports.extractSellingPlanSettings=extractSellingPlanSettings;
1
+ "use strict";const extractVariantId=t=>t?t.includes("/ProductVariant/")?t.split("/ProductVariant/")[1]||"":t:"",extractProductId=t=>t?t.includes("/Product/")?t.split("/Product/")[1]||"":t:"",extractSellingPlanSettings=({sellingPlansSetting:t,currentVariant:e,product:i,isFromEvent:r=!1})=>{if(!t)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};if(r&&e?.id){let r,o;if(i&&"baseID"in i&&i.baseID?(r=extractProductId(i.baseID),o=Object.keys(t)[0]):r="data"===(o=Object.keys(t)[0])&&t[o]?Object.keys(t[o])[0]:o,r){let i="data"===o?t.data:t[r],u="data"===o?i[r]:i;if(u){let t=extractVariantId(e.id?.toString()||""),i=extractVariantId(e.baseID||""),r=Object.keys(u).find(r=>r===e.id?.toString()||r===e.baseID||r===t||r===i||e.id?.toString()===r||e.baseID===r||e.id?.toString().includes(r)||e.baseID?.includes(r)||r.includes(t)||r.includes(i));if(r&&u[r]){let t=u[r];return{sourceApp:t?.sourceApp,group:t?.group,defaultOptions:t?.defaultOption}}let o=Object.keys(u)[0];if(o&&u[o]){let t=u[o];return{sourceApp:t?.sourceApp,group:t?.group,defaultOptions:t?.defaultOption}}}}}let o=Object.keys(t)[0];if(!o)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let u=t[o];if(!u)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let d=Object.keys(u)[0];if(!d)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let a=u[d];return{sourceApp:a?.sourceApp||a?.appSource,group:a?.group,defaultOptions:a?.defaultOption}};exports.extractSellingPlanSettings=extractSellingPlanSettings;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),helper=require("../../../../common/helper.js");const getSubscriptionStyles=(e,r)=>{let{sellingType:t}=r??{},{width:s,backgroundColor:i,sellingPlanItemGap:o}=e??{},p=helper.postPurchaseSpacing[o??"tight"]||"9px",c=core.makeStyle({rg:"subscription"===t?p:"9px"}),l=core.makeStyleResponsive("w",core.makeWidth(s)),S=core.makeStyleResponsive("bgc",i);return core.filterTruthyStyles({...l,...S,...c})},getSubscriptionWrapperStyles=e=>core.filterTruthyStyles({...core.makeStyle({ai:e??"left"})});exports.getSubscriptionStyles=getSubscriptionStyles,exports.getSubscriptionWrapperStyles=getSubscriptionWrapperStyles;
1
+ "use strict";var SubscriptionBgColorEnum,core=require("@gem-sdk/core"),helper=require("../../../../common/helper.js");!function(e){e.info="#f0f8ff",e.success="#E8F8EB",e.warning="#FFF8E0",e.critical="#FFEBEB",e.none="#FAFAFA"}(SubscriptionBgColorEnum||(SubscriptionBgColorEnum={}));const getSubscriptionStyles=(e,r)=>{let{sellingType:t}=r??{},{width:o,backgroundColor:i,sellingPlanItemGap:s}=e??{},n=helper.postPurchaseSpacing[s??"tight"]||"9px",c=core.makeStyle({rg:"subscription"===t?n:"9px"}),p=core.makeStyleResponsive("w",core.makeWidth(o)),u=i?{backgroundColor:SubscriptionBgColorEnum[i]??SubscriptionBgColorEnum.none}:{};return core.filterTruthyStyles({...p,...u,...c})},getSubscriptionWrapperStyles=e=>core.filterTruthyStyles({...core.makeStyle({ai:e??"left"})});exports.getSubscriptionStyles=getSubscriptionStyles,exports.getSubscriptionWrapperStyles=getSubscriptionWrapperStyles;
@@ -0,0 +1 @@
1
+ "use strict";var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),TooltipHover=require("../../../../../common/components/TooltipHover.js");const OneTimePurchaseTooltip=React.forwardRef(({setting:e},r)=>{let{t}=core.useI18nStore();return jsxRuntime.jsx("div",{ref:r,"data-selling-type":e?.sellingType,id:"product-subscription",children:jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:"Not be displayed when published",width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:jsxRuntime.jsx("div",{className:"gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:jsxRuntime.jsx("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:t("This product is only available as a one-time purchase")})})})})});OneTimePurchaseTooltip.displayName="OneTimePurchaseTooltip",exports.OneTimePurchaseTooltip=OneTimePurchaseTooltip;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),SubscriptionDetail=require("./SubscriptionDetail.js"),SellingPlanDropdown=require("./SellingPlanDropdown.js"),SellingPlanRadio=require("./SellingPlanRadio.js"),SellingPlanLabel=require("./SellingPlanLabel.js"),TooltipHover=require("../../../../../common/components/TooltipHover.js"),core=require("@gem-sdk/core"),React=require("react"),index=require("../../../constants/index.js"),useSellingSubscription=require("../hooks/useSellingSubscription.js");const ProductSubscription=({styles:e,setting:s})=>{let{sellingPlans:l,defaultValue:t}=useSellingSubscription.useSellingSubscription(s),i=core.useProductStore(e=>e.setSubscriptionSellingType),n=system.createStyle(styles.getSubscriptionStyles(e,s)),r=system.createStyle(styles.getSubscriptionWrapperStyles(e?.align)),a=system.createClass(classes.getWrapperClasses()),o=system.createClass(classes.getContainerClasses()),{t:u}=core.useI18nStore();return(React.useEffect(()=>{i(s?.sellingType??index.PostPurchaseSubscriptionSellingType.SUBSCRIPTION)},[i,s?.sellingType]),s?.sellingType!=="one-time"&&l&&0!==l.length)?jsxRuntime.jsx("div",{"data-selling-type":s?.sellingType,id:"product-subscription",className:a,style:r,children:jsxRuntime.jsxs("div",{className:o,style:n,children:[jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:s,styles:e}),s?.sellingStyle==="radio"?jsxRuntime.jsx(SellingPlanRadio.SellingPlanRadio,{setting:s,defaultValue:t||""}):jsxRuntime.jsx(SellingPlanDropdown.SellingPlanDropdown,{setting:s,defaultValue:t||""}),jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:s,styles:e})]})}):jsxRuntime.jsx(TooltipHover.default,{enable:!0,text:"Not be displayed when published",width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:jsxRuntime.jsx("div",{className:"gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:jsxRuntime.jsx("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:u("This product is only available as a one-time purchase")})})})};exports.default=ProductSubscription;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),React=require("react"),index=require("../../../constants/index.js"),classes=require("../common/classes.js"),styles=require("../common/styles.js"),useDetectBothSubscriptionTypes=require("../hooks/useDetectBothSubscriptionTypes.js"),useSellingSubscription=require("../hooks/useSellingSubscription.js"),useSubscriptionVisibility=require("../hooks/useSubscriptionVisibility.js"),OneTimePurchaseTooltip=require("./OneTimePurchaseTooltip.js"),SellingPlanDropdown=require("./SellingPlanDropdown.js"),SellingPlanLabel=require("./SellingPlanLabel.js"),SellingPlanRadio=require("./SellingPlanRadio.js"),SubscriptionDetail=require("./SubscriptionDetail.js"),SubscriptionRadio=require("./SubscriptionRadio.js");const ProductSubscription=({styles:e,setting:i})=>{let s=core.useProduct(),t=useSellingSubscription.useSellingSubscription(i),n=t.sellingPlans,l=t.defaultValue,r=React.useRef(null),u=React.useId(),a=useDetectBothSubscriptionTypes.useDetectBothSubscriptionTypes(r),{selectedType:o,shouldShowRadio:c,isOneTimeHidden:S,hasNoSellingPlanOptions:p,setSubscriptionSellingType:d}=useSubscriptionVisibility.useSubscriptionVisibility({setting:i,hasBothTypes:a,sellingPlans:n}),b=system.createStyle(styles.getSubscriptionStyles(e,i)),m=system.createStyle(styles.getSubscriptionWrapperStyles(e?.align)),j=system.createClass(classes.getWrapperClasses()),x=system.createClass(classes.getContainerClasses()),{isEditMode:g}=core.useRenderMode(),y=`product-subscription-${s?.baseID}`,R=s?.baseID,P=`subscription-type-selection-${u}`,h=i?.sellingType===index.SubscriptionEnum.ONE_TIME,T=i?.sellingType===index.SubscriptionEnum.SUBSCRIPTION;if(S||p)return g?jsxRuntime.jsx(OneTimePurchaseTooltip.OneTimePurchaseTooltip,{ref:r,setting:i}):null;let q=e=>jsxRuntime.jsx("div",{ref:r,"data-selling-type":i?.sellingType,id:y,className:j,style:m,children:e}),D=()=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:i?.sellingStyle==="radio"?jsxRuntime.jsx(SellingPlanRadio.SellingPlanRadio,{setting:i,defaultValue:l||""}):jsxRuntime.jsx(SellingPlanDropdown.SellingPlanDropdown,{setting:i,defaultValue:l||""})});return q(h&&c?jsxRuntime.jsx("div",{className:x,style:b,children:jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${R}-one-time-radio`,name:P,value:index.SubscriptionEnum.ONE_TIME,checked:o===index.SubscriptionEnum.ONE_TIME,onChange:e=>{e.target.checked&&d(index.SubscriptionEnum.ONE_TIME)},children:jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:i,styles:e})})}):T&&c?jsxRuntime.jsxs("div",{className:x,style:b,children:[jsxRuntime.jsx(SubscriptionRadio.SubscriptionRadio,{id:`${R}-subscription-radio`,name:P,value:index.SubscriptionEnum.SUBSCRIPTION,checked:o===index.SubscriptionEnum.SUBSCRIPTION,onChange:e=>{e.target.checked&&d(index.SubscriptionEnum.SUBSCRIPTION)},children:jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:i,styles:e})}),jsxRuntime.jsx("div",{className:"gp-pl-7",children:D()}),jsxRuntime.jsx("div",{className:"gp-pl-7",children:jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:i,styles:e})})]}):jsxRuntime.jsxs("div",{className:x,style:b,children:[jsxRuntime.jsx(SellingPlanLabel.SellingPlanLabel,{setting:i,styles:e}),D(),jsxRuntime.jsx(SubscriptionDetail.SubscriptionDetail,{setting:i,styles:e})]}))};exports.default=ProductSubscription;
@@ -1 +1 @@
1
- "use strict";var jsxRuntime=require("react/jsx-runtime"),Text=require("../../../../text/components/Text.js");const SellingPlanLabel=({setting:e,styles:t})=>{let{sellingTitle:l}=e??{};return jsxRuntime.jsx(Text.default,{className:"gp-flex-1",textClassWrapper:"gp-leading-[24px]",styles:{typo:t?.sellingTitleTypo??{},textAlign:t?.sellingTitleAlign??"left",direction:t?.sellingTitleDirection??"ltr"},setting:{text:l}})};exports.SellingPlanLabel=SellingPlanLabel;
1
+ "use strict";var jsxRuntime=require("react/jsx-runtime"),Text=require("../../../../text/components/Text.js"),attrs=require("../common/attrs.js"),index=require("../../../constants/index.js");const SellingPlanLabel=({setting:e,styles:t})=>{let{sellingTitle:s,sellingTitleOneTime:n,sellingType:l}=e??{},r=l===index.SubscriptionEnum.ONE_TIME,a=r?n:s,{typo:i,textAlign:x,direction:u}=attrs.getSellingPlanLabelAttrs({styles:t,sellingType:l});return jsxRuntime.jsx(Text.default,{className:"gp-flex-1",textClassWrapper:"gp-leading-[24px]",styles:{typo:i,textAlign:x,direction:u},setting:{text:a}})};exports.SellingPlanLabel=SellingPlanLabel;
@@ -1 +1 @@
1
- "use strict";var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),classes=require("../common/classes.js");const SubscriptionRadio=({checked:s=!1,value:e,name:a,onChange:i,disabled:t=!1,className:r="",children:c})=>{let n=system.createClass(classes.getSubscriptionRadioLabelClasses(t)),l=system.createClass(classes.getSubscriptionRadioInputClasses());return jsxRuntime.jsxs("label",{className:`${n} ${r}`.trim(),children:[jsxRuntime.jsx("input",{type:"radio",name:a,value:e,checked:s,onChange:i,disabled:t,className:l}),c]})};exports.SubscriptionRadio=SubscriptionRadio;
1
+ "use strict";var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),classes=require("../common/classes.js");const SubscriptionRadio=({checked:s=!1,id:e,value:i,name:a,onChange:t,disabled:r=!1,className:c="",children:n})=>{let l=system.createClass(classes.getSubscriptionRadioLabelClasses(r)),u=system.createClass(classes.getSubscriptionRadioInputClasses());return jsxRuntime.jsxs("label",{className:`${l} ${c}`.trim(),children:[jsxRuntime.jsx("input",{id:e,type:"radio",name:a,value:i,checked:s,onChange:t,disabled:r,className:u}),n]})};exports.SubscriptionRadio=SubscriptionRadio;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),index=require("../../../constants/index.js");const DEBOUNCE_DELAY=100,findSubscriptionContainer=e=>{let t=e.closest("[data-product-id]");return t instanceof HTMLElement?t:null},getSubscriptionElements=e=>Array.from(e.querySelectorAll("[data-selling-type]")).filter(e=>e instanceof HTMLElement),useDetectBothSubscriptionTypes=e=>{let[t,r]=React.useState(!1),n=React.useRef(null),u=React.useRef(null),i=React.useRef(null),c=React.useCallback(()=>{let t=e?.current;if(!t){r(!1);return}let n=findSubscriptionContainer(t);if(!n){r(!1);return}let u=getSubscriptionElements(n);if(u.length<2){r(!1);return}let i=u.some(e=>e.dataset.sellingType===index.SubscriptionEnum.ONE_TIME),c=u.some(e=>e.dataset.sellingType===index.SubscriptionEnum.SUBSCRIPTION),l=i&&c;r(l)},[e]),l=React.useCallback(()=>{u.current&&(clearTimeout(u.current),u.current=null),i.current&&(clearTimeout(i.current),i.current=null),n.current&&(n.current.disconnect(),n.current=null)},[]);return React.useEffect(()=>{if(!e?.current){r(!1);return}l();let t=requestAnimationFrame(()=>{c(),i.current=globalThis.setTimeout(()=>{c(),i.current=null},200)}),s=()=>{u.current&&clearTimeout(u.current),u.current=globalThis.setTimeout(c,100)};n.current=new MutationObserver(s);let a=findSubscriptionContainer(e.current);return a&&n.current.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-selling-type"]}),()=>{cancelAnimationFrame(t),l()}},[e,c,l]),t};exports.useDetectBothSubscriptionTypes=useDetectBothSubscriptionTypes;
@@ -1 +1 @@
1
- "use strict";var React=require("react"),core=require("@gem-sdk/core"),extractSellingPlanSettings=require("../common/extractSellingPlanSettings.js");const useSellingSubscription=e=>{let l=core.useProduct(),t=core.useVariants(),{selectedOptions:n}=core.useSelectedOption(),s=core.usePageStore(e=>e.sellingPlanMeta),i=core.useEditorMode(),u=React.useRef(!1);React.useEffect(()=>{if(!u.current&&i===core.RenderModeEnv.EDIT&&!s){let e=new CustomEvent("element-subscription-mount");globalThis.dispatchEvent(e),u.current=!0}},[i,s]);let r=s??e?.sellingPlans,a=React.useMemo(()=>{if(!r)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let e=null;return s&&n&&(e=t.find(e=>!!e?.selectedOptions&&e.selectedOptions.every(e=>n[e.name??""]===e.value))??null),extractSellingPlanSettings.extractSellingPlanSettings({sellingPlansSetting:r,currentVariant:e,isFromEvent:!!s})},[r,s,t,n]),o=React.useMemo(()=>{if(!n||!t||0===t.length)return null;let e=t.find(e=>!!e?.selectedOptions&&e.selectedOptions.every(e=>n[e.name??""]===e.value))??null;return e},[n,t]),{sellingPlans:c,defaultValue:d}=React.useMemo(()=>{let e;let t=o?.sellingPlanGroups??l?.sellingPlanGroups??[];if(!t||0===t.length||!a.sourceApp||!a.group)return{sellingPlans:[],defaultValue:void 0};let n=t.find(e=>null!=e&&e.appID===a.sourceApp&&e.id===a.group),s=n?.sellingPlans?.filter(e=>null!=e).map(e=>({label:e.name,value:e.baseID}))??[];if(a.defaultOptions){let l=n?.sellingPlans?.find(e=>null!=e&&e.baseID===a.defaultOptions),t=n?.sellingPlans?.find(e=>null!=e&&e.id===a.defaultOptions);e=l?.baseID??t?.baseID??s[0]?.value}else e=s[0]?.value;return{sellingPlans:s,defaultValue:e}},[l,o,a]);return{sellingPlans:c,defaultValue:d}};exports.useSellingSubscription=useSellingSubscription;
1
+ "use strict";var React=require("react"),core=require("@gem-sdk/core"),extractSellingPlanSettings=require("../common/extractSellingPlanSettings.js");const useSellingSubscription=e=>{let l=core.useProduct(),n=core.useVariants(),{selectedOptions:t}=core.useSelectedOption(),s=core.usePageStore(e=>e.sellingPlanMeta),u=core.useEditorMode(),i=React.useRef(!1);React.useEffect(()=>{if(!i.current&&u===core.RenderModeEnv.EDIT&&!s){let e=new CustomEvent("element-subscription-mount");globalThis.dispatchEvent(e),i.current=!0}},[u,s]);let r=s??e?.sellingPlans,a=React.useMemo(()=>{if(!r)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let e=null;return s&&t&&(e=n.find(e=>!!e?.selectedOptions&&e.selectedOptions.every(e=>t[e.name??""]===e.value))??null),extractSellingPlanSettings.extractSellingPlanSettings({sellingPlansSetting:r,currentVariant:e,product:l,isFromEvent:!!s})},[r,s,n,t,l]),o=React.useMemo(()=>{if(!t||!n||0===n.length)return null;let e=n.find(e=>!!e?.selectedOptions&&e.selectedOptions.every(e=>t[e.name??""]===e.value))??null;return e},[t,n]),{sellingPlans:c,defaultValue:p}=React.useMemo(()=>{let e,n;let t=o?.sellingPlanGroups??l?.sellingPlanGroups??[];if(!t||0===t.length)return{sellingPlans:[],defaultValue:void 0};"__unknown__"===a.sourceApp?a.group&&(e=t.find(e=>null!=e&&e.id===a.group)):a.sourceApp&&a.group&&(e=t.find(e=>null!=e&&e.appID===a.sourceApp&&e.id===a.group)),e??(e=t[0]);let s=e?.sellingPlans?.filter(e=>null!=e).map(e=>({label:e.name,value:e.baseID}))??[];if(a.defaultOptions){let l=e?.sellingPlans?.find(e=>null!=e&&e.baseID===a.defaultOptions),t=e?.sellingPlans?.find(e=>null!=e&&e.id===a.defaultOptions);n=l?.baseID??t?.baseID??s[0]?.value}else n=s[0]?.value;return{sellingPlans:s,defaultValue:n}},[l,o,a]);return{sellingPlans:c,defaultValue:p}};exports.useSellingSubscription=useSellingSubscription;
@@ -0,0 +1 @@
1
+ "use strict";var React=require("react"),core=require("@gem-sdk/core"),index=require("../../../constants/index.js"),useSellingPlanOptions=require("./useSellingPlanOptions.js");const useSubscriptionVisibility=({setting:e,hasBothTypes:i,sellingPlans:n})=>{let s=core.useProductStore(e=>e.setSubscriptionSellingType),t=core.useProductStore(e=>e.subscriptionSellingType),u=useSellingPlanOptions.useSellingPlanOptions(e),r=core.useProduct(),l=r?.requiresSellingPlan,o=t===index.SubscriptionEnum.ONE_TIME?index.SubscriptionEnum.ONE_TIME:index.SubscriptionEnum.SUBSCRIPTION;React.useEffect(()=>{if(!i){s(e?.sellingType??index.SubscriptionEnum.SUBSCRIPTION);return}t||s(index.SubscriptionEnum.SUBSCRIPTION)},[s,e?.sellingType,i,t]);let c=i&&!l,S=!u||0===u.length,p=e?.sellingType===index.SubscriptionEnum.ONE_TIME&&(l||!n||0===n.length)||e?.sellingType===index.SubscriptionEnum.ONE_TIME&&!i;return{selectedType:o,shouldShowRadio:c,isOneTimeHidden:p,hasNoSellingPlanOptions:S,setSubscriptionSellingType:s}};exports.useSubscriptionVisibility=useSubscriptionVisibility;
@@ -1 +1 @@
1
- "use strict";const NEXT_AND_PREV_URLS={},BUTTON_URL_MAP_POST_PURCHASE={next:{vertical:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-6c7f10a8-a205-43bd-b39c-aab044bb3771.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a3c3d74c-2cde-49e5-9854-8079f5239013.svg"},horizontal:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a3d1f159-001d-4301-bead-214606caf995.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a5ac0286-5941-4bd7-a21d-72a6c017aeea.svg"}},prev:{vertical:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-010c3c2a-fcc3-4b09-84a2-734d924ad49b.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-4e4e886a-5aa1-4bb3-ab48-aa7752fd5eba.svg"},horizontal:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-33e3810b-a94c-40a1-a48b-4eba39013f15.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a2eb5093-0203-4973-8ade-183d5bdefdce.svg"}}};exports.PostPurchaseSubscriptionSellingType=void 0,function(s){s.ONE_TIME="one-time",s.SUBSCRIPTION="subscription"}(exports.PostPurchaseSubscriptionSellingType||(exports.PostPurchaseSubscriptionSellingType={})),exports.BUTTON_URL_MAP_POST_PURCHASE=BUTTON_URL_MAP_POST_PURCHASE;
1
+ "use strict";const NEXT_AND_PREV_URLS={},BUTTON_URL_MAP_POST_PURCHASE={next:{vertical:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-6c7f10a8-a205-43bd-b39c-aab044bb3771.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a3c3d74c-2cde-49e5-9854-8079f5239013.svg"},horizontal:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a3d1f159-001d-4301-bead-214606caf995.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a5ac0286-5941-4bd7-a21d-72a6c017aeea.svg"}},prev:{vertical:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-010c3c2a-fcc3-4b09-84a2-734d924ad49b.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-4e4e886a-5aa1-4bb3-ab48-aa7752fd5eba.svg"},horizontal:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-33e3810b-a94c-40a1-a48b-4eba39013f15.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a2eb5093-0203-4973-8ade-183d5bdefdce.svg"}}};exports.SubscriptionEnum=void 0,function(s){s.ONE_TIME="one-time",s.SUBSCRIPTION="subscription"}(exports.SubscriptionEnum||(exports.SubscriptionEnum={})),exports.BUTTON_URL_MAP_POST_PURCHASE=BUTTON_URL_MAP_POST_PURCHASE;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),useDynamicProduct=require("./useDynamicProduct.js");const useGetMoneyLines=(e,t)=>{let{isDynamicProduct:o,dynamicPrice:u,dynamicDiscount:i,isEnableDynamicDiscount:a}=useDynamicProduct.useDynamicProduct(),s=core.useProductOfferDiscount(),n=core.useCurrentVariant(),{quantity:l}=core.useQuantity(),r=s*(l||1),c=core.useFormatMoney(r,!1),b=core.convertDecimalToNumber(n?.price)??0,p=b*(l||1),d=core.useFormatMoney(p,!1),L=core.shopifyPriceRounding(r,2),h=core.useFormatMoney(p-parseFloat(L),!1),m=()=>{let n=[];return!1!==e.isShowSubTotalLabel&&n.push({title:t.subTotalLabel,money:o?u:d,uniqueId:"subTotalLabel"}),!1!==e.isShowDiscountLabel&&n.push({title:t.discountLabel,money:o&&i&&a?`${i.value}%`:s>0?c:"No discount",uniqueId:"discountLabel"}),!1!==e.isShowShippingLabel&&n.push({title:t.shippingLabel,uniqueId:"shippingLabel",tooltip:{content:"Shipping fee will be calculated on real offer page",width:"23em"}}),!1!==e.isShowTaxesLabel&&n.push({title:t.taxesLabel,uniqueId:"taxesLabel",tooltip:{content:"Taxes will be calculated on real offer page",width:"20em"}}),!1!==e.isShowTotalLabel&&n.push({title:t.totalLabel,money:o?u:h,uniqueId:"totalLabel"}),n};return{getMoneyLines:m}};exports.useGetMoneyLines=useGetMoneyLines;
1
+ "use strict";var core=require("@gem-sdk/core"),useDynamicProduct=require("./useDynamicProduct.js");const useGetMoneyLines=(e,t)=>{let{isDynamicProduct:o,dynamicPrice:u,dynamicDiscount:i,isEnableDynamicDiscount:s}=useDynamicProduct.useDynamicProduct(),a=core.useProductOfferDiscount(),n=core.useCurrentVariant(),{quantity:r}=core.useQuantity(),{t:l}=core.useI18nStore(),c=a*(r||1),b=core.useFormatMoney(c,!1),p=core.convertDecimalToNumber(n?.price)??0,d=p*(r||1),h=core.useFormatMoney(d,!1),L=core.shopifyPriceRounding(c,2),y=core.useFormatMoney(d-parseFloat(L),!1),m=()=>{let n=[];return!1!==e.isShowSubTotalLabel&&n.push({title:t.subTotalLabel,money:o?u:h,uniqueId:"subTotalLabel"}),!1!==e.isShowDiscountLabel&&n.push({title:t.discountLabel,money:o&&i&&s?`${i.value}%`:a>0?b:"No discount",uniqueId:"discountLabel"}),!1!==e.isShowShippingLabel&&n.push({title:t.shippingLabel,uniqueId:"shippingLabel",tooltip:{content:"Shipping fee will be calculated on real offer page",width:"23em"}}),!1!==e.isShowTaxesLabel&&n.push({title:t.taxesLabel,uniqueId:"taxesLabel",tooltip:{content:"Taxes will be calculated on real offer page",width:"20em"}}),!1!==e.isShowTotalLabel&&n.push({title:t.totalLabel,money:o?u:y,uniqueId:"totalLabel"}),t?.isShowRecurringTotalLabel!==!1&&n.push({title:l("Recurring subtotal"),money:"$20.00 every week",uniqueId:"recurringTotalLabel",subTitle:l("Doesn't include shipping, tax or duties")}),n};return{getMoneyLines:m}};exports.useGetMoneyLines=useGetMoneyLines;
@@ -1 +1 @@
1
- "use strict";var core=require("@gem-sdk/core"),React=require("react"),index=require("../constants/index.js"),product=require("../../../product/helpers/product.js");const useSubscriptionConsentCheck=()=>{let e=core.useProductStore(e=>e.isAgreeBuyWithSubscription),r=core.useProductStore(e=>e.selectedOptions),t=core.useProductStore(e=>e.subscriptionSellingType),s=core.useProduct(),n=core.useVariants(),u=React.useMemo(()=>{let u=t===index.PostPurchaseSubscriptionSellingType.ONE_TIME;if(e||u)return!1;let o=!!s?.sellingPlanGroups?.length||!!s?.variants?.edges.find(e=>!!e.node?.sellingPlanGroups?.length);if(!o||!r)return!1;let i=product.checkDefaultVariant(s);if(!i){let e=n.find(e=>e?.selectedOptions.every(e=>r[e.name??""]===e.value)),t=!!e?.sellingPlanGroups?.length;return t}return!0},[r,t,e,s,n]);return{isDisableAccept:u}};exports.useSubscriptionConsentCheck=useSubscriptionConsentCheck;
1
+ "use strict";var core=require("@gem-sdk/core"),React=require("react"),index=require("../constants/index.js"),product=require("../../../product/helpers/product.js");const useSubscriptionConsentCheck=()=>{let e=core.useProductStore(e=>e.isAgreeBuyWithSubscription),r=core.useProductStore(e=>e.selectedOptions),t=core.useProductStore(e=>e.subscriptionSellingType),n=core.useProduct(),s=core.useVariants(),u=React.useMemo(()=>{let u=t===index.SubscriptionEnum.ONE_TIME;if(e||u)return!1;let o=!!n?.sellingPlanGroups?.length||!!n?.variants?.edges.find(e=>!!e.node?.sellingPlanGroups?.length);if(!o||!r)return!1;let i=product.checkDefaultVariant(n);if(!i){let e=s.find(e=>e?.selectedOptions.every(e=>r[e.name??""]===e.value)),t=!!e?.sellingPlanGroups?.length;return t}return!0},[r,t,e,n,s]);return{isDisableAccept:u}};exports.useSubscriptionConsentCheck=useSubscriptionConsentCheck;
@@ -1 +1 @@
1
- "use strict";require("react/jsx-runtime"),require("@gem-sdk/core"),require("@gem-sdk/system"),require("react"),require("./components/product-variant/components/variants/VariantItem.js"),require("next/link"),require("./constants/index.js"),require("next/head"),require("next/image"),require("react-youtube"),require("../image/components/Img.js");var ProductTitle$1=require("./settings/product-title/ProductTitle.js"),ProductDescription$1=require("./settings/product-description/ProductDescription.js"),ProductPrice$1=require("./settings/product-price/ProductPrice.js"),ProductVariant$1=require("./settings/product-variants/ProductVariant.js"),index$1=require("./settings/accept-button/index.js"),index$2=require("./settings/product-quantity/index.js"),index$4=require("./settings/product-offer/index.js"),index$3=require("./settings/product-price-breakdown/index.js"),ProductDiscountTag$1=require("./settings/product-discount-tag/ProductDiscountTag.js"),index$5=require("./settings/product-subscription/index.js"),ProductImages=require("./settings/product-image/ProductImages.js");const postPurchaseProductSetting={PostPurchaseProductTitle:ProductTitle$1.default,PostPurchaseProductDescription:ProductDescription$1.default,PostPurchaseProductPrice:ProductPrice$1.default,PostPurchaseProductVariants:ProductVariant$1.default,PostPurchaseAcceptButton:index$1.default,PostPurchaseProductQuantity:index$2.default,PostPurchaseProductPriceBreakdown:index$3.default,PostPurchaseProductOffer:index$4.default,PostPurchaseProductDiscountTag:ProductDiscountTag$1.default,PostPurchaseProductImages:ProductImages.default,PostPurchaseProductSubscription:index$5.default};exports.postPurchaseProductSetting=postPurchaseProductSetting;
1
+ "use strict";require("react/jsx-runtime"),require("@gem-sdk/core"),require("@gem-sdk/system"),require("react"),require("./components/product-variant/components/variants/VariantItem.js"),require("next/link"),require("./constants/index.js"),require("next/head"),require("next/image"),require("react-youtube"),require("./components/product-subscription/common/styles.js"),require("./components/product-subscription/components/OneTimePurchaseTooltip.js"),require("../image/components/Img.js");var ProductTitle$1=require("./settings/product-title/ProductTitle.js"),ProductDescription$1=require("./settings/product-description/ProductDescription.js"),ProductPrice$1=require("./settings/product-price/ProductPrice.js"),ProductVariant$1=require("./settings/product-variants/ProductVariant.js"),index$1=require("./settings/accept-button/index.js"),index$2=require("./settings/product-quantity/index.js"),index$4=require("./settings/product-offer/index.js"),index$3=require("./settings/product-price-breakdown/index.js"),ProductDiscountTag$1=require("./settings/product-discount-tag/ProductDiscountTag.js"),index$5=require("./settings/product-subscription/index.js"),ProductImages=require("./settings/product-image/ProductImages.js");const postPurchaseProductSetting={PostPurchaseProductTitle:ProductTitle$1.default,PostPurchaseProductDescription:ProductDescription$1.default,PostPurchaseProductPrice:ProductPrice$1.default,PostPurchaseProductVariants:ProductVariant$1.default,PostPurchaseAcceptButton:index$1.default,PostPurchaseProductQuantity:index$2.default,PostPurchaseProductPriceBreakdown:index$3.default,PostPurchaseProductOffer:index$4.default,PostPurchaseProductDiscountTag:ProductDiscountTag$1.default,PostPurchaseProductImages:ProductImages.default,PostPurchaseProductSubscription:index$5.default};exports.postPurchaseProductSetting=postPurchaseProductSetting;
@@ -1 +1 @@
1
- "use strict";var constants=require("../../../../common/constants.js");const ProductPriceBreakdownSettings=[{id:"setting",controls:[{id:"discountAndShippingFee",type:"discount-and-shipping-fee-product-offer",multiple:!1},{id:"subTotalLabel",type:"input",default:"Sub total",emptyOnClear:!0},{id:"discountLabel",type:"input",default:"Discount",emptyOnClear:!0},{id:"shippingLabel",type:"input",default:"Shipping",emptyOnClear:!0},{id:"taxesLabel",type:"input",default:"Taxes",emptyOnClear:!0},{id:"totalLabel",type:"input",default:"Total",emptyOnClear:!0},{id:"contentShow",type:"input",default:"Show price breakdown",fallbackValue:"Show price breakdown",clearButton:!1},{id:"contentHide",type:"input",default:"Hide price breakdown",fallbackValue:"Hide price breakdown",clearButton:!1}]},{id:"style",controls:[{id:"labelStyle",label:"Label",type:"typography-post-purchase",default:{fontSize:"medium",textColor:"default",fontWeight:"bold",textTransform:"none"}},{id:"moneyStyle",label:"Money value",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"bold",textTransform:"none"}},{id:"isShowPrice",label:"Expand price breakdown",type:"toggle",default:!0},{id:"isShowSubTotalLabel",label:"Sub total",type:"toggle",default:!0},{id:"direction",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"isShowDiscountLabel",label:"Discount",type:"toggle",default:!0},{id:"isShowShippingLabel",label:"Shipping",type:"toggle",default:!0},{id:"isShowTaxesLabel",label:"Taxes",type:"toggle",default:!0},{id:"isShowTotalLabel",label:"Total",type:"toggle",default:!0},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"left"},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"}},displayOptions:[{label:"Full",value:"100%",showValue:!0}]},{type:"select",label:"Spacing",id:"spacing",options:constants.postPurchaseSpacing,default:"none"}]}];exports.ProductPriceBreakdownSettings=ProductPriceBreakdownSettings;
1
+ "use strict";var constants=require("../../../../common/constants.js");const ProductPriceBreakdownSettings=[{id:"setting",controls:[{id:"discountAndShippingFee",type:"discount-and-shipping-fee-product-offer",multiple:!1},{id:"subTotalLabel",type:"input",default:"Sub total",emptyOnClear:!0},{id:"discountLabel",type:"input",default:"Discount",emptyOnClear:!0},{id:"shippingLabel",type:"input",default:"Shipping",emptyOnClear:!0},{id:"taxesLabel",type:"input",default:"Taxes",emptyOnClear:!0},{id:"totalLabel",type:"input",default:"Total",emptyOnClear:!0},{id:"contentShow",type:"input",default:"Show price breakdown",fallbackValue:"Show price breakdown",clearButton:!1},{id:"contentHide",type:"input",default:"Hide price breakdown",fallbackValue:"Hide price breakdown",clearButton:!1},{id:"isShowRecurringTotalLabel",label:"Recurring price",type:"toggle",default:!0}]},{id:"style",controls:[{id:"labelStyle",label:"Label",type:"typography-post-purchase",default:{fontSize:"medium",textColor:"default",fontWeight:"bold",textTransform:"none"}},{id:"moneyStyle",label:"Money value",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"bold",textTransform:"none"}},{id:"isShowPrice",label:"Expand price breakdown",type:"toggle",default:!0},{id:"isShowSubTotalLabel",label:"Sub total",type:"toggle",default:!0},{id:"direction",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"isShowDiscountLabel",label:"Discount",type:"toggle",default:!0},{id:"isShowShippingLabel",label:"Shipping",type:"toggle",default:!0},{id:"isShowTaxesLabel",label:"Taxes",type:"toggle",default:!0},{id:"isShowTotalLabel",label:"Total",type:"toggle",default:!0},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"left"},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"}},displayOptions:[{label:"Full",value:"100%",showValue:!0}]},{type:"select",label:"Spacing",id:"spacing",options:constants.postPurchaseSpacing,default:"none"}]}];exports.ProductPriceBreakdownSettings=ProductPriceBreakdownSettings;
@@ -1 +1 @@
1
- "use strict";const SettingUIV2=[{controls:[{type:"control",setting:{id:"discountAndShippingFee"},layout:"vertical"}]},{label:{en:"Content"},controls:[{label:{en:"Show"},popoverLabel:{en:"Show button"},type:"combo",iconName:"polaris-text-block",compoDefaultValue:"Show",getValueFromSettingID:"contentShow",disableClearMessage:"This content is needed for customers <br> to show the price breakdown",layout:"horizontal",controls:[{setting:{id:"contentShow"},label:{en:"Content"},layout:"vertical",isHideClear:!0}]},{label:{en:"Hide"},popoverLabel:{en:"Hide button"},type:"combo",iconName:"polaris-text-block",getValueFromSettingID:"contentHide",disableClearMessage:"This content is needed for customers <br> to hide the price breakdown",layout:"horizontal",controls:[{setting:{id:"contentHide"},label:{en:"Content"},layout:"vertical"}]}]},{label:{en:"Label"},controls:[{setting:{id:"labelStyle"},layout:"vertical"}]},{label:{en:"Money value"},controls:[{setting:{id:"moneyStyle"},layout:"vertical"}]},{label:{en:"Item spacing"},controls:[{label:{en:"Item gap"},setting:{id:"spacing"},layout:"horizontal"}]},{label:{en:"Size"},controls:[{label:{en:"Width"},setting:{id:"width"},layout:"horizontal"}]},{label:{en:"Price breakdown option"},controls:[{label:{en:"Direction"},setting:{id:"direction"},layout:"horizontal"},{label:{en:"Auto-expand"},setting:{id:"isShowPrice"},layout:"horizontal"}],moreSettings:{type:"collapse",controls:[{label:{en:"Sub total"},setting:{id:"isShowSubTotalLabel"},layout:"horizontal"},{label:{en:"Discount"},setting:{id:"isShowDiscountLabel"},layout:"horizontal"},{label:{en:"Shipping"},setting:{id:"isShowShippingLabel"},layout:"horizontal"},{label:{en:"Taxes"},setting:{id:"isShowTaxesLabel"},layout:"horizontal"},{label:{en:"Total"},setting:{id:"isShowTotalLabel"},layout:"horizontal"}]}},{controls:[{type:"control",label:{en:"Align"},setting:{id:"align"},conditionEnable:'!(parseInt(width) >= 100 && width?.includes("%"))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"},layout:"horizontal"}]}];exports.SettingUIV2=SettingUIV2;
1
+ "use strict";const SettingUIV2=[{controls:[{type:"control",setting:{id:"discountAndShippingFee"},layout:"vertical"}]},{label:{en:"Content"},controls:[{label:{en:"Show"},popoverLabel:{en:"Show button"},type:"combo",iconName:"polaris-text-block",compoDefaultValue:"Show",getValueFromSettingID:"contentShow",disableClearMessage:"This content is needed for customers <br> to show the price breakdown",layout:"horizontal",controls:[{setting:{id:"contentShow"},label:{en:"Content"},layout:"vertical",isHideClear:!0}]},{label:{en:"Hide"},popoverLabel:{en:"Hide button"},type:"combo",iconName:"polaris-text-block",getValueFromSettingID:"contentHide",disableClearMessage:"This content is needed for customers <br> to hide the price breakdown",layout:"horizontal",controls:[{setting:{id:"contentHide"},label:{en:"Content"},layout:"vertical"}]}]},{label:{en:"Label"},controls:[{setting:{id:"labelStyle"},layout:"vertical"}]},{label:{en:"Money value"},controls:[{setting:{id:"moneyStyle"},layout:"vertical"}]},{label:{en:"Item spacing"},controls:[{label:{en:"Item gap"},setting:{id:"spacing"},layout:"horizontal"}]},{label:{en:"Size"},controls:[{label:{en:"Width"},setting:{id:"width"},layout:"horizontal"}]},{label:{en:"Price breakdown option"},controls:[{label:{en:"Direction"},setting:{id:"direction"},layout:"horizontal"},{label:{en:"Auto-expand"},setting:{id:"isShowPrice"},layout:"horizontal"}],moreSettings:{type:"collapse",controls:[{label:{en:"Sub total"},setting:{id:"isShowSubTotalLabel"},layout:"horizontal"},{label:{en:"Discount"},setting:{id:"isShowDiscountLabel"},layout:"horizontal"},{label:{en:"Shipping"},setting:{id:"isShowShippingLabel"},layout:"horizontal"},{label:{en:"Taxes"},setting:{id:"isShowTaxesLabel"},layout:"horizontal"},{label:{en:"Total"},setting:{id:"isShowTotalLabel"},layout:"horizontal"},{label:{en:"Recurring price"},setting:{id:"isShowRecurringTotalLabel"},layout:"horizontal"}]}},{controls:[{type:"control",label:{en:"Align"},setting:{id:"align"},conditionEnable:'!(parseInt(width) >= 100 && width?.includes("%"))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"},layout:"horizontal"}]}];exports.SettingUIV2=SettingUIV2;
@@ -1 +1 @@
1
- "use strict";var constants=require("../../../../common/constants.js");const ProductSubscriptionSettings=[{id:"setting",controls:[{id:"sellingType",label:"Type",type:"pick-subscription",options:[{value:"one-time",label:"One-time"},{value:"subscription",label:"Subscription"}],default:"subscription"},{id:"sellingPlans",label:"Selling plans",type:"selling-plan"},{id:"sellingTitle",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Subscribe and save up to {total_max_discount}",suggestContents:[{message:"{total_max_discount}",eg:"E.g: 50% (offer’s + plan’s max discount)"},{message:"{offer_selling_plan_discount}",eg:"E.g: 20%"}]},{id:"sellingLabel",label:"Text",type:"input",default:"Purchase options",placeholder:"E.g. Purchase options",clearButton:!1},{id:"sellingStyle",label:"Style",type:"option:illustration",default:"dropdown",options:[{label:"Dropdown",value:"dropdown",svgName:"gp-selling-plan-dropdown"},{label:"Radio",value:"radio",svgName:"gp-selling-plan-radio"}]},{id:"subscriptionLabel",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",suggestContents:[{message:"{selling_plan_delivery_frequency}",eg:"E.g: every week"},{message:"{selling_plan_discount}",eg:"E.g: 10%"},{message:"{selling_plan_billing_cycle}",eg:"E.g: every 1 month"}]},{id:"enableSubscriptionDetail",label:"Enable subscription detail",type:"toggle",default:!1}]},{id:"style",controls:[{id:"sellingTitleDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"subscriptionDetailDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"sellingPlanItemGap",type:"select",label:"Item gap",options:constants.postPurchaseSpacing,default:"tight"},{id:"sellingTitleTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"sellingTitleAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"subscriptionDetailTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"subscriptionDetailAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"},tablet:{default:"100%"},mobile:{default:"100%"}},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}]},{id:"backgroundColor",type:"color-picker-v2",devices:{desktop:{default:void 0}},compoDefaultValue:{desktop:{default:"#DDDDDD"}},enableGradient:!0},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"left"}]}];exports.ProductSubscriptionSettings=ProductSubscriptionSettings;
1
+ "use strict";var constants=require("../../../../common/constants.js");const ProductSubscriptionSettings=[{id:"setting",controls:[{id:"sellingType",label:"Type",type:"pick-subscription",options:[{value:"one-time",label:"One-time"},{value:"subscription",label:"Subscription"}],default:"subscription"},{id:"sellingPlans",label:"Selling plans",type:"selling-plan"},{id:"sellingTitle",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Subscribe and save up to {total_max_discount}",suggestContents:[{message:"{total_max_discount}",eg:"E.g: 50% (offer’s + plan’s max discount)"},{message:"{offer_selling_plan_discount}",eg:"E.g: 20%"}]},{id:"sellingLabel",label:"Text",type:"input",default:"Purchase options",placeholder:"E.g. Purchase options",clearButton:!1},{id:"sellingTitleOneTime",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"One-time purchase",suggestContents:[]},{id:"sellingStyle",label:"Style",type:"option:illustration",default:"dropdown",options:[{label:"Dropdown",value:"dropdown",svgName:"gp-selling-plan-dropdown"},{label:"Radio",value:"radio",svgName:"gp-selling-plan-radio"}]},{id:"subscriptionLabel",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",suggestContents:[{message:"{selling_plan_delivery_frequency}",eg:"E.g: every week"},{message:"{selling_plan_discount}",eg:"E.g: 10%"},{message:"{selling_plan_billing_cycle}",eg:"E.g: every 1 month"}]},{id:"enableSubscriptionDetail",label:"Enable subscription detail",type:"toggle",default:!1}]},{id:"style",controls:[{id:"sellingTitleDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"sellingTitleOneTimeDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"subscriptionDetailDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"sellingPlanItemGap",type:"select",label:"Item gap",options:constants.postPurchaseSpacing,default:"tight"},{id:"sellingTitleTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"sellingTitleAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"sellingTitleOneTimeTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"sellingTitleOneTimeAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"subscriptionDetailTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"subscriptionDetailAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"},tablet:{default:"100%"},mobile:{default:"100%"}},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}]},{id:"backgroundColor",type:"select",label:"Background Color",options:[{label:"Transparent",value:"none",icon:"gp-bg-transparent"},{label:"Red",value:"critical",icon:"gp-bg-color-red"},{label:"Blue",value:"info",icon:"gp-bg-color-blue"},{label:"Green",value:"success",icon:"gp-bg-color-green"},{label:"Yellow",value:"warning",icon:"gp-bg-color-yellow"}],default:"none"},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"left"}]}];exports.ProductSubscriptionSettings=ProductSubscriptionSettings;
@@ -1 +1 @@
1
- "use strict";const SettingUIV2=[{label:{en:"Selling options"},controls:[{type:"control",label:{en:"Type"},setting:{id:"sellingType"}},{type:"combo",label:{en:"Title"},iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_max_discount}",popoverLabel:{en:"Selling option title"},isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:{en:"Direction"},setting:{id:"sellingTitleDirection"}},{type:"control",label:{en:""},setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:{en:"Align"}}]}]},{label:{en:"Selling plans"},controls:[{type:"control",label:{en:"Selling plans"},setting:{id:"sellingPlans"}},{type:"control",label:{en:"Label"},setting:{id:"sellingLabel"},layout:"horizontal"},{type:"control",label:{en:"Style"},setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:{en:"Item gap"},setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}]},{controls:[{type:"control",label:{en:"Subscription detail"},setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:{en:"Label"},iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:{en:"Subscription detail"},isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:{en:"Content"},setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:{en:"Direction"},setting:{id:"subscriptionDetailDirection"},conditionDisplay:"enableSubscriptionDetail === true",controlChangeTrigger:{settings:[{action:{controlId:"subscriptionDetailAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'rtl' && subscriptionDetailAlign === 'left'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]},{action:{controlId:"subscriptionDetailAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'ltr' && subscriptionDetailAlign === 'right'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:{en:"Align"},conditionDisplay:"enableSubscriptionDetail === true"}]},{label:{en:"Size"},controls:[{type:"control",label:{en:"Width"},setting:{id:"width"},layout:"horizontal"}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{controls:[{label:{en:"Align"},conditionEnable:"activeScreenId === 'desktop' ? !(parseInt(width) >= 100 && width?.includes(\"%\")) : (!(parseInt(width) >= 100 && width?.includes(\"%\")) && width !== 'default')",setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];exports.SettingUIV2=SettingUIV2;
1
+ "use strict";const SettingUIV2=[{label:{en:"Selling options"},controls:[{type:"control",label:{en:"Type"},setting:{id:"sellingType"}},{type:"combo",label:{en:"Title"},iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_max_discount}",popoverLabel:{en:"Selling option title"},isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:{en:"Direction"},setting:{id:"sellingTitleDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'rtl' && sellingTitleAlign === 'left'",source:["subscriptionDetailDirection","sellingTitleAlign"]},{action:{controlId:"sellingTitleAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'ltr' && sellingTitleAlign === 'right'",source:["sellingTitleDirection","sellingTitleAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:{en:"Align"}}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:{en:"Title"},iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"Purchase options",popoverLabel:{en:"Selling option title"},isHideClear:!0,conditionDisplay:'sellingType === "one-time"',controls:[{label:{en:"Content"},setting:{id:"sellingTitleOneTime"},layout:"vertical"},{type:"control",label:{en:"Direction"},setting:{id:"sellingTitleOneTimeDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleOneTimeAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleOneTimeDirection === 'rtl' && sellingTitleOneTimeAlign === 'left'",source:["sellingTitleOneTimeDirection","sellingTitleOneTimeAlign"]},{action:{controlId:"sellingTitleOneTimeAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleOneTimeDirection === 'ltr' && sellingTitleOneTimeAlign === 'right'",source:["sellingTitleOneTimeDirection","sellingTitleOneTimeAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"sellingTitleOneTimeTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleOneTimeAlign"},label:{en:"Align"}}]}]},{label:{en:"Selling plans"},controls:[{type:"control",label:{en:"Selling plans"},setting:{id:"sellingPlans"}},{type:"control",label:{en:"Label"},setting:{id:"sellingLabel"},layout:"horizontal",conditionDisplay:'sellingType === "subscription"'},{type:"control",label:{en:"Style"},setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:{en:"Item gap"},setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}],conditionDisplay:'sellingType === "subscription"'},{controls:[{type:"control",label:{en:"Subscription detail"},setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:{en:"Label"},iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:{en:"Subscription detail"},isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:{en:"Content"},setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:{en:"Direction"},setting:{id:"subscriptionDetailDirection"},conditionDisplay:"enableSubscriptionDetail === true",controlChangeTrigger:{settings:[{action:{controlId:"subscriptionDetailAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'rtl' && subscriptionDetailAlign === 'left'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]},{action:{controlId:"subscriptionDetailAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'ltr' && subscriptionDetailAlign === 'right'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:{en:"Align"},conditionDisplay:"enableSubscriptionDetail === true"}],conditionDisplay:'sellingType === "subscription"'},{label:{en:"Size"},controls:[{type:"control",label:{en:"Width"},setting:{id:"width"},layout:"horizontal"}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{controls:[{label:{en:"Align"},conditionEnable:"activeScreenId === 'desktop' ? !(parseInt(width) >= 100 && width?.includes(\"%\")) : (!(parseInt(width) >= 100 && width?.includes(\"%\")) && width !== 'default')",setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];exports.SettingUIV2=SettingUIV2;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{Fragment as i}from"react";import{useProduct as r}from"@gem-sdk/core";import{createStyle as s,createAttr as d,createClass as l}from"@gem-sdk/system";import{getIconCollapseClassesRotate as n,getContainerPriceBreakdownClasses as a,getWrapperLabelClasses as c,getLabelClasses as m,getDividerClasses as p,getWrapperMoneyLinesClasses as u,getWrapperBreakdownClasses as h}from"../helpers/product-price-breakdown/getClasses.js";import{getStyle as f,getWrapperMoneyLinesStyles as w}from"../helpers/product-price-breakdown/getStyles.js";import{useGetItemGapPriceBreakdown as y}from"../hooks/useGetItemGapPriceBreakdown.js";import{useSetCollapsePrice as b}from"../hooks/useSetCollapsePrice.js";import k from"./price-breakdown/MoneyLine.js";import g from"../../text/components/Text.js";import{useGetMoneyLines as P}from"../hooks/useGetMoneyLines.js";let PostPurchaseProductPriceBreakdown=({setting:v={},styles:x={},style:C,builderAttrs:I,builderProps:j,children:L})=>{let{labelStyle:N,moneyStyle:q,spacing:S,width:B,align:D,isShowPrice:G,direction:M}=x,T=r(),H=T?.baseID?.replace("gid://shopify/Product/",""),{isCollapsePrice:R,onClickLabelPriceBreakdown:$}=b(G),{itemGap:E}=y(S),{getMoneyLines:F}=P(x,v),U=s({...f(C)}),Z=d({...I}),z=l(n(R)),A=l(a(D,j?.uid)),J=l(c(M)),K=l(m()),O=l(p()),Q=l(u()),V=l(h()),W=s({...w(B,E)});return e(t,{children:[e("div",{className:J,onClick:$,role:"button",tabIndex:0,"aria-hidden":"true",children:[o(g,{className:K,styles:{direction:M},setting:{text:R?v.contentHide||"Hide price breakdown":v.contentShow||"Show price breakdown",options:{isCannotEditing:!0}}}),o("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:z,children:o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0187 10.3598C10.7759 10.5853 10.3963 10.5712 10.1708 10.3284L8.01045 8.00191L5.85012 10.3284C5.62464 10.5712 5.245 10.5853 5.00218 10.3598C4.75935 10.1343 4.74529 9.75469 4.97077 9.51187L7.57077 6.71187C7.6843 6.58961 7.84361 6.52014 8.01045 6.52014C8.17729 6.52014 8.3366 6.58961 8.45012 6.71187L11.0501 9.51187C11.2756 9.75469 11.2615 10.1343 11.0187 10.3598Z",fill:"#1879B9"})})]}),o("div",{className:O}),R?o("div",{className:V,children:e("div",{...Z,className:A,style:U,id:`shopify-text-element-${j?.uid}`,"data-product-id":H,children:[o("div",{className:Q,style:W,children:F().map(t=>e(i,{children:["totalLabel"===t.uniqueId&&F().length>1&&o("hr",{}),o("div",{children:o(k,{uniqueId:t.uniqueId,direction:M,builderPropsUID:j?.uid,title:"totalLabel"===t.uniqueId?`<b>${t.title}</b>`:t.title,money:t.money,tooltipData:t.tooltip,labelTextStyles:{typo:{...N},direction:M},moneyTextStyles:{typo:q}})},t.uniqueId)]},t.uniqueId))}),L]})}):null]})};export{PostPurchaseProductPriceBreakdown as default};
2
+ import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{Fragment as i}from"react";import{useProduct as r}from"@gem-sdk/core";import{createStyle as s,createAttr as l,createClass as d}from"@gem-sdk/system";import{getIconCollapseClassesRotate as n,getContainerPriceBreakdownClasses as a,getWrapperLabelClasses as c,getLabelClasses as m,getDividerClasses as p,getWrapperMoneyLinesClasses as u,getWrapperBreakdownClasses as h}from"../helpers/product-price-breakdown/getClasses.js";import{getStyle as f,getWrapperMoneyLinesStyles as b}from"../helpers/product-price-breakdown/getStyles.js";import{useGetItemGapPriceBreakdown as w}from"../hooks/useGetItemGapPriceBreakdown.js";import{useSetCollapsePrice as y}from"../hooks/useSetCollapsePrice.js";import k from"./price-breakdown/MoneyLine.js";import g from"../../text/components/Text.js";import{useGetMoneyLines as P}from"../hooks/useGetMoneyLines.js";let PostPurchaseProductPriceBreakdown=({setting:v={},styles:x={},style:C,builderAttrs:I,builderProps:j,children:L})=>{let{labelStyle:N,moneyStyle:q,spacing:S,width:B,align:T,isShowPrice:D,direction:G}=x,M=r(),H=M?.baseID?.replace("gid://shopify/Product/",""),{isCollapsePrice:R,onClickLabelPriceBreakdown:$}=y(D),{itemGap:E}=w(S),{getMoneyLines:F}=P(x,v),U=s({...f(C)}),Z=l({...I}),z=d(n(R)),A=d(a(T,j?.uid)),J=d(c(G)),K=d(m()),O=d(p()),Q=d(u()),V=d(h()),W=s({...b(B,E)});return e(t,{children:[e("div",{className:J,onClick:$,role:"button",tabIndex:0,"aria-hidden":"true",children:[o(g,{className:K,styles:{direction:G},setting:{text:R?v.contentHide||"Hide price breakdown":v.contentShow||"Show price breakdown",options:{isCannotEditing:!0}}}),o("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:z,children:o("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.0187 10.3598C10.7759 10.5853 10.3963 10.5712 10.1708 10.3284L8.01045 8.00191L5.85012 10.3284C5.62464 10.5712 5.245 10.5853 5.00218 10.3598C4.75935 10.1343 4.74529 9.75469 4.97077 9.51187L7.57077 6.71187C7.6843 6.58961 7.84361 6.52014 8.01045 6.52014C8.17729 6.52014 8.3366 6.58961 8.45012 6.71187L11.0501 9.51187C11.2756 9.75469 11.2615 10.1343 11.0187 10.3598Z",fill:"#1879B9"})})]}),o("div",{className:O}),R?o("div",{className:V,children:e("div",{...Z,className:A,style:U,id:`shopify-text-element-${j?.uid}`,"data-product-id":H,children:[o("div",{className:Q,style:W,children:F().map(t=>e(i,{children:["totalLabel"===t.uniqueId&&F().length>1&&o("hr",{}),o("div",{children:o(k,{uniqueId:t.uniqueId,direction:G,builderPropsUID:j?.uid,title:"totalLabel"===t.uniqueId?`<b>${t.title}</b>`:t.title,money:t.money,tooltipData:t.tooltip,labelTextStyles:{typo:{...N},direction:G},moneyTextStyles:{typo:q},subTitle:t.subTitle})},t.uniqueId)]},t.uniqueId))}),L]})}):null]})};export{PostPurchaseProductPriceBreakdown as default};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useProduct as o}from"@gem-sdk/core";import s from"../../../../common/components/Tooltip.js";import r from"../../../text/components/Text.js";import{createClass as i}from"@gem-sdk/system";import{getMoneyRowClasses as m,getTextLabelMoneyClasses as n,getTextValueMoneyClasses as p}from"../../helpers/product-price-breakdown/getClasses.js";import{getLabelTextStyles as c}from"../../helpers/product-price-breakdown/getStyles.js";let MoneyLine=({uniqueId:a,title:d,money:l,labelTextStyles:u,moneyTextStyles:f,builderPropsUID:g,tooltipData:y,direction:h})=>{let x=o(),j=x?.baseID?.replace("gid://shopify/Product/",""),k=i(m(h)),w=i(n(h)),b=i(p(h)),I=c(h,u);return t("div",{className:k,children:[e(r,{className:w,setting:{text:d,options:{uniqueId:`${a}-${g}-${j}`,productID:j,useState:!0}},styles:I}),y?e(s,{tooltip:y.content||"",width:y.width||""}):e(r,{className:b,setting:{text:l,options:{isCannotEditing:!0}},styles:f})]})};export{MoneyLine as default};
2
+ import{jsxs as t,jsx as e}from"react/jsx-runtime";import{useProduct as o}from"@gem-sdk/core";import s from"../../../../common/components/Tooltip.js";import r from"../../../text/components/Text.js";import{createClass as i}from"@gem-sdk/system";import{getMoneyRowClasses as n,getTextLabelMoneyClasses as m,getTextValueMoneyClasses as p}from"../../helpers/product-price-breakdown/getClasses.js";import{getLabelTextStyles as d}from"../../helpers/product-price-breakdown/getStyles.js";let MoneyLine=({uniqueId:l,title:a,money:c,labelTextStyles:g,moneyTextStyles:f,builderPropsUID:u,tooltipData:x,direction:h,subTitle:y})=>{let j=o(),k=j?.baseID?.replace("gid://shopify/Product/",""),w=i(n(h)),N=i(m(h)),b=i(p(h)),v=d(h,g);return t("div",{children:[t("div",{className:w,children:[e(r,{className:N,setting:{text:a,options:{uniqueId:`${l}-${u}-${k}`,productID:k,useState:!0}},styles:v}),x?e(s,{tooltip:x.content||"",width:x.width||""}):e(r,{className:b,setting:{text:c,options:{isCannotEditing:!0}},styles:f})]}),y&&e("div",{className:"gp-text-xs gp-font-normal gp-leading-5 gp-text-[#737373]",children:y})]})};export{MoneyLine as default};
@@ -0,0 +1 @@
1
+ import{SubscriptionEnum as e}from"../../../constants/index.js";let getSellingPlanLabelAttrs=({styles:l,sellingType:t})=>{let i=t===e.ONE_TIME;return{typo:i?l?.sellingTitleOneTimeTypo??{}:l?.sellingTitleTypo??{},textAlign:i?l?.sellingTitleOneTimeAlign??"left":l?.sellingTitleAlign??"left",direction:i?l?.sellingTitleOneTimeDirection??"ltr":l?.sellingTitleDirection??"ltr"}};export{getSellingPlanLabelAttrs};
@@ -1 +1 @@
1
- let extractVariantId=t=>t?t.includes("/ProductVariant/")?t.split("/ProductVariant/")[1]||"":t:"",extractSellingPlanSettings=({sellingPlansSetting:t,currentVariant:e,isFromEvent:i=!1})=>{if(!t)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};if(i&&e?.id){let i;let r=Object.keys(t)[0];if(i="data"===r&&t[r]?Object.keys(t[r])[0]:r){let o=t["data"===r?"data":i],u="data"===r?o[i]:o;if(u){let t=extractVariantId(e.id?.toString()||""),i=extractVariantId(e.baseID||""),r=Object.keys(u).find(r=>r===e.id?.toString()||r===e.baseID||r===t||r===i||e.id?.toString()===r||e.baseID===r||e.id?.toString().includes(r)||e.baseID?.includes(r)||r.includes(t)||r.includes(i));if(r&&u[r]){let t=u[r];return{sourceApp:t?.sourceApp,group:t?.group,defaultOptions:t?.defaultOption}}let o=Object.keys(u)[0];if(o&&u[o]){let t=u[o];return{sourceApp:t?.sourceApp,group:t?.group,defaultOptions:t?.defaultOption}}}}}let r=Object.keys(t)[0];if(!r)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let o=t[r];if(!o)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let u=Object.keys(o)[0];if(!u)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let p=o[u];return{sourceApp:p?.sourceApp||p?.appSource,group:p?.group,defaultOptions:p?.defaultOption}};export{extractSellingPlanSettings};
1
+ let extractVariantId=t=>t?t.includes("/ProductVariant/")?t.split("/ProductVariant/")[1]||"":t:"",extractProductId=t=>t?t.includes("/Product/")?t.split("/Product/")[1]||"":t:"",extractSellingPlanSettings=({sellingPlansSetting:t,currentVariant:e,product:i,isFromEvent:r=!1})=>{if(!t)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};if(r&&e?.id){let r,o;if(i&&"baseID"in i&&i.baseID?(r=extractProductId(i.baseID),o=Object.keys(t)[0]):r="data"===(o=Object.keys(t)[0])&&t[o]?Object.keys(t[o])[0]:o,r){let i="data"===o?t.data:t[r],u="data"===o?i[r]:i;if(u){let t=extractVariantId(e.id?.toString()||""),i=extractVariantId(e.baseID||""),r=Object.keys(u).find(r=>r===e.id?.toString()||r===e.baseID||r===t||r===i||e.id?.toString()===r||e.baseID===r||e.id?.toString().includes(r)||e.baseID?.includes(r)||r.includes(t)||r.includes(i));if(r&&u[r]){let t=u[r];return{sourceApp:t?.sourceApp,group:t?.group,defaultOptions:t?.defaultOption}}let o=Object.keys(u)[0];if(o&&u[o]){let t=u[o];return{sourceApp:t?.sourceApp,group:t?.group,defaultOptions:t?.defaultOption}}}}}let o=Object.keys(t)[0];if(!o)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let u=t[o];if(!u)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let d=Object.keys(u)[0];if(!d)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let a=u[d];return{sourceApp:a?.sourceApp||a?.appSource,group:a?.group,defaultOptions:a?.defaultOption}};export{extractSellingPlanSettings};
@@ -1 +1 @@
1
- import{makeStyle as t,makeStyleResponsive as e,makeWidth as r,filterTruthyStyles as p}from"@gem-sdk/core";import{postPurchaseSpacing as i}from"../../../../common/helper.js";let getSubscriptionStyles=(o,s)=>{let{sellingType:c}=s??{},{width:g,backgroundColor:l,sellingPlanItemGap:S}=o??{},m=i[S??"tight"]||"9px",n=t({rg:"subscription"===c?m:"9px"}),b=e("w",r(g)),u=e("bgc",l);return p({...b,...u,...n})},getSubscriptionWrapperStyles=e=>p({...t({ai:e??"left"})});export{getSubscriptionStyles,getSubscriptionWrapperStyles};
1
+ var SubscriptionBgColorEnum;import{makeStyle as o,makeStyleResponsive as r,makeWidth as i,filterTruthyStyles as t}from"@gem-sdk/core";import{postPurchaseSpacing as n}from"../../../../common/helper.js";!function(o){o.info="#f0f8ff",o.success="#E8F8EB",o.warning="#FFF8E0",o.critical="#FFEBEB",o.none="#FAFAFA"}(SubscriptionBgColorEnum||(SubscriptionBgColorEnum={}));let getSubscriptionStyles=(e,p)=>{let{sellingType:s}=p??{},{width:u,backgroundColor:c,sellingPlanItemGap:l}=e??{},g=n[l??"tight"]||"9px",S=o({rg:"subscription"===s?g:"9px"}),m=r("w",i(u)),b=c?{backgroundColor:SubscriptionBgColorEnum[c]??SubscriptionBgColorEnum.none}:{};return t({...m,...b,...S})},getSubscriptionWrapperStyles=r=>t({...o({ai:r??"left"})});export{getSubscriptionStyles,getSubscriptionWrapperStyles};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{useI18nStore as t}from"@gem-sdk/core";import o from"../../../../../common/components/TooltipHover.js";let OneTimePurchaseTooltip=r(({setting:r},i)=>{let{t:p}=t();return e("div",{ref:i,"data-selling-type":r?.sellingType,id:"product-subscription",children:e(o,{enable:!0,text:"Not be displayed when published",width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:e("div",{className:"gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:e("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:p("This product is only available as a one-time purchase")})})})})});OneTimePurchaseTooltip.displayName="OneTimePurchaseTooltip";export{OneTimePurchaseTooltip};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{createStyle as s,createClass as o}from"@gem-sdk/system";import{getSubscriptionStyles as i,getSubscriptionWrapperStyles as l}from"../common/styles.js";import{getWrapperClasses as r,getContainerClasses as n}from"../common/classes.js";import{SubscriptionDetail as p}from"./SubscriptionDetail.js";import{SellingPlanDropdown as a}from"./SellingPlanDropdown.js";import{SellingPlanRadio as m}from"./SellingPlanRadio.js";import{SellingPlanLabel as d}from"./SellingPlanLabel.js";import g from"../../../../../common/components/TooltipHover.js";import{useProductStore as c,useI18nStore as u}from"@gem-sdk/core";import{useEffect as f}from"react";import{PostPurchaseSubscriptionSellingType as y}from"../../../constants/index.js";import{useSellingSubscription as b}from"../hooks/useSellingSubscription.js";let ProductSubscription=({styles:h,setting:S})=>{let{sellingPlans:j,defaultValue:x}=b(S),T=c(e=>e.setSubscriptionSellingType),N=s(i(h,S)),P=s(l(h?.align)),k=o(r()),v=o(n()),{t:w}=u();return(f(()=>{T(S?.sellingType??y.SUBSCRIPTION)},[T,S?.sellingType]),S?.sellingType!=="one-time"&&j&&0!==j.length)?e("div",{"data-selling-type":S?.sellingType,id:"product-subscription",className:k,style:P,children:t("div",{className:v,style:N,children:[e(d,{setting:S,styles:h}),S?.sellingStyle==="radio"?e(m,{setting:S,defaultValue:x||""}):e(a,{setting:S,defaultValue:x||""}),e(p,{setting:S,styles:h})]})}):e(g,{enable:!0,text:"Not be displayed when published",width:"205px",position:"bottom",className:"gp-arrow-left-offset-10",children:e("div",{className:"gp-px-1.5 gp-py-1 gp-flex gp-border gp-border-light-200 gp-items-center gp-justify-center gp-rounded-lg",style:{borderStyle:"dashed",strokeDasharray:"2,2"},children:e("span",{className:"gp-text-dark-400 gp-text-[12px] gp-leading-5",children:w("This product is only available as a one-time purchase")})})})};export{ProductSubscription as default};
1
+ import{jsx as e,jsxs as s,Fragment as i}from"react/jsx-runtime";import{useProduct as t,useRenderMode as l}from"@gem-sdk/core";import{createStyle as o,createClass as r}from"@gem-sdk/system";import{useRef as n,useId as m}from"react";import{SubscriptionEnum as a}from"../../../constants/index.js";import{getWrapperClasses as c,getContainerClasses as p}from"../common/classes.js";import{getSubscriptionStyles as d,getSubscriptionWrapperStyles as u}from"../common/styles.js";import{useDetectBothSubscriptionTypes as g}from"../hooks/useDetectBothSubscriptionTypes.js";import{useSellingSubscription as f}from"../hooks/useSellingSubscription.js";import{useSubscriptionVisibility as h}from"../hooks/useSubscriptionVisibility.js";import{OneTimePurchaseTooltip as S}from"./OneTimePurchaseTooltip.js";import{SellingPlanDropdown as y}from"./SellingPlanDropdown.js";import{SellingPlanLabel as b}from"./SellingPlanLabel.js";import{SellingPlanRadio as I}from"./SellingPlanRadio.js";import{SubscriptionDetail as N}from"./SubscriptionDetail.js";import{SubscriptionRadio as T}from"./SubscriptionRadio.js";let ProductSubscription=({styles:j,setting:P})=>{let k=t(),O=f(P),v=O.sellingPlans,E=O.defaultValue,C=n(null),R=m(),B=g(C),{selectedType:D,shouldShowRadio:M,isOneTimeHidden:U,hasNoSellingPlanOptions:V,setSubscriptionSellingType:$}=h({setting:P,hasBothTypes:B,sellingPlans:v}),_=o(d(j,P)),x=o(u(j?.align)),w=r(c()),L=r(p()),{isEditMode:q}=l(),z=`product-subscription-${k?.baseID}`,A=k?.baseID,F=`subscription-type-selection-${R}`,G=P?.sellingType===a.ONE_TIME,H=P?.sellingType===a.SUBSCRIPTION;if(U||V)return q?e(S,{ref:C,setting:P}):null;let J=s=>e("div",{ref:C,"data-selling-type":P?.sellingType,id:z,className:w,style:x,children:s}),K=()=>e(i,{children:P?.sellingStyle==="radio"?e(I,{setting:P,defaultValue:E||""}):e(y,{setting:P,defaultValue:E||""})});return J(G&&M?e("div",{className:L,style:_,children:e(T,{id:`${A}-one-time-radio`,name:F,value:a.ONE_TIME,checked:D===a.ONE_TIME,onChange:e=>{e.target.checked&&$(a.ONE_TIME)},children:e(b,{setting:P,styles:j})})}):H&&M?s("div",{className:L,style:_,children:[e(T,{id:`${A}-subscription-radio`,name:F,value:a.SUBSCRIPTION,checked:D===a.SUBSCRIPTION,onChange:e=>{e.target.checked&&$(a.SUBSCRIPTION)},children:e(b,{setting:P,styles:j})}),e("div",{className:"gp-pl-7",children:K()}),e("div",{className:"gp-pl-7",children:e(N,{setting:P,styles:j})})]}):s("div",{className:L,style:_,children:[e(b,{setting:P,styles:j}),K(),e(N,{setting:P,styles:j})]}))};export{ProductSubscription as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import t from"../../../../text/components/Text.js";let SellingPlanLabel=({setting:l,styles:i})=>{let{sellingTitle:n}=l??{};return e(t,{className:"gp-flex-1",textClassWrapper:"gp-leading-[24px]",styles:{typo:i?.sellingTitleTypo??{},textAlign:i?.sellingTitleAlign??"left",direction:i?.sellingTitleDirection??"ltr"},setting:{text:n}})};export{SellingPlanLabel};
1
+ import{jsx as e}from"react/jsx-runtime";import t from"../../../../text/components/Text.js";import{getSellingPlanLabelAttrs as l}from"../common/attrs.js";import{SubscriptionEnum as r}from"../../../constants/index.js";let SellingPlanLabel=({setting:s,styles:n})=>{let{sellingTitle:o,sellingTitleOneTime:m,sellingType:a}=s??{},p=a===r.ONE_TIME,i=p?m:o,{typo:x,textAlign:g,direction:c}=l({styles:n,sellingType:a});return e(t,{className:"gp-flex-1",textClassWrapper:"gp-leading-[24px]",styles:{typo:x,textAlign:g,direction:c},setting:{text:i}})};export{SellingPlanLabel};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{createClass as i}from"@gem-sdk/system";import{getSubscriptionRadioLabelClasses as m,getSubscriptionRadioInputClasses as o}from"../common/classes.js";let SubscriptionRadio=({checked:s=!1,value:t,name:a,onChange:c,disabled:l=!1,className:n="",children:d})=>{let p=i(m(l)),u=i(o());return e("label",{className:`${p} ${n}`.trim(),children:[r("input",{type:"radio",name:a,value:t,checked:s,onChange:c,disabled:l,className:u}),d]})};export{SubscriptionRadio};
1
+ import{jsxs as e,jsx as i}from"react/jsx-runtime";import{createClass as r}from"@gem-sdk/system";import{getSubscriptionRadioLabelClasses as m,getSubscriptionRadioInputClasses as o}from"../common/classes.js";let SubscriptionRadio=({checked:s=!1,id:t,value:a,name:c,onChange:l,disabled:n=!1,className:d="",children:p})=>{let u=r(m(n)),b=r(o());return e("label",{className:`${u} ${d}`.trim(),children:[i("input",{id:t,type:"radio",name:c,value:a,checked:s,onChange:l,disabled:n,className:b}),p]})};export{SubscriptionRadio};
@@ -0,0 +1 @@
1
+ import{useState as e,useRef as t,useCallback as r,useEffect as n}from"react";import{SubscriptionEnum as u}from"../../../constants/index.js";let DEBOUNCE_DELAY=100,findSubscriptionContainer=e=>{let t=e.closest("[data-product-id]");return t instanceof HTMLElement?t:null},getSubscriptionElements=e=>Array.from(e.querySelectorAll("[data-selling-type]")).filter(e=>e instanceof HTMLElement),useDetectBothSubscriptionTypes=i=>{let[l,c]=e(!1),s=t(null),o=t(null),a=t(null),m=r(()=>{let e=i?.current;if(!e){c(!1);return}let t=findSubscriptionContainer(e);if(!t){c(!1);return}let r=getSubscriptionElements(t);if(r.length<2){c(!1);return}let n=r.some(e=>e.dataset.sellingType===u.ONE_TIME),l=r.some(e=>e.dataset.sellingType===u.SUBSCRIPTION),s=n&&l;c(s)},[i]),p=r(()=>{o.current&&(clearTimeout(o.current),o.current=null),a.current&&(clearTimeout(a.current),a.current=null),s.current&&(s.current.disconnect(),s.current=null)},[]);return n(()=>{if(!i?.current){c(!1);return}p();let e=requestAnimationFrame(()=>{m(),a.current=globalThis.setTimeout(()=>{m(),a.current=null},200)}),t=()=>{o.current&&clearTimeout(o.current),o.current=globalThis.setTimeout(m,100)};s.current=new MutationObserver(t);let r=findSubscriptionContainer(i.current);return r&&s.current.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-selling-type"]}),()=>{cancelAnimationFrame(e),p()}},[i,m,p]),l};export{useDetectBothSubscriptionTypes};
@@ -1 +1 @@
1
- import{useRef as e,useEffect as l,useMemo as n}from"react";import{useProduct as t,useVariants as i,useSelectedOption as s,usePageStore as u,useEditorMode as r,RenderModeEnv as a}from"@gem-sdk/core";import{extractSellingPlanSettings as o}from"../common/extractSellingPlanSettings.js";let useSellingSubscription=p=>{let d=t(),f=i(),{selectedOptions:g}=s(),c=u(e=>e.sellingPlanMeta),m=r(),v=e(!1);l(()=>{if(!v.current&&m===a.EDIT&&!c){let e=new CustomEvent("element-subscription-mount");globalThis.dispatchEvent(e),v.current=!0}},[m,c]);let P=c??p?.sellingPlans,b=n(()=>{if(!P)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let e=null;return c&&g&&(e=f.find(e=>!!e?.selectedOptions&&e.selectedOptions.every(e=>g[e.name??""]===e.value))??null),o({sellingPlansSetting:P,currentVariant:e,isFromEvent:!!c})},[P,c,f,g]),O=n(()=>{if(!g||!f||0===f.length)return null;let e=f.find(e=>!!e?.selectedOptions&&e.selectedOptions.every(e=>g[e.name??""]===e.value))??null;return e},[g,f]),{sellingPlans:D,defaultValue:I}=n(()=>{let e;let l=O?.sellingPlanGroups??d?.sellingPlanGroups??[];if(!l||0===l.length||!b.sourceApp||!b.group)return{sellingPlans:[],defaultValue:void 0};let n=l.find(e=>null!=e&&e.appID===b.sourceApp&&e.id===b.group),t=n?.sellingPlans?.filter(e=>null!=e).map(e=>({label:e.name,value:e.baseID}))??[];if(b.defaultOptions){let l=n?.sellingPlans?.find(e=>null!=e&&e.baseID===b.defaultOptions),i=n?.sellingPlans?.find(e=>null!=e&&e.id===b.defaultOptions);e=l?.baseID??i?.baseID??t[0]?.value}else e=t[0]?.value;return{sellingPlans:t,defaultValue:e}},[d,O,b]);return{sellingPlans:D,defaultValue:I}};export{useSellingSubscription};
1
+ import{useRef as e,useEffect as l,useMemo as n}from"react";import{useProduct as t,useVariants as i,useSelectedOption as s,usePageStore as u,useEditorMode as r,RenderModeEnv as o}from"@gem-sdk/core";import{extractSellingPlanSettings as a}from"../common/extractSellingPlanSettings.js";let useSellingSubscription=p=>{let d=t(),g=i(),{selectedOptions:f}=s(),c=u(e=>e.sellingPlanMeta),m=r(),v=e(!1);l(()=>{if(!v.current&&m===o.EDIT&&!c){let e=new CustomEvent("element-subscription-mount");globalThis.dispatchEvent(e),v.current=!0}},[m,c]);let P=c??p?.sellingPlans,b=n(()=>{if(!P)return{sourceApp:void 0,group:void 0,defaultOptions:void 0};let e=null;return c&&f&&(e=g.find(e=>!!e?.selectedOptions&&e.selectedOptions.every(e=>f[e.name??""]===e.value))??null),a({sellingPlansSetting:P,currentVariant:e,product:d,isFromEvent:!!c})},[P,c,g,f,d]),O=n(()=>{if(!f||!g||0===g.length)return null;let e=g.find(e=>!!e?.selectedOptions&&e.selectedOptions.every(e=>f[e.name??""]===e.value))??null;return e},[f,g]),{sellingPlans:D,defaultValue:I}=n(()=>{let e,l;let n=O?.sellingPlanGroups??d?.sellingPlanGroups??[];if(!n||0===n.length)return{sellingPlans:[],defaultValue:void 0};"__unknown__"===b.sourceApp?b.group&&(e=n.find(e=>null!=e&&e.id===b.group)):b.sourceApp&&b.group&&(e=n.find(e=>null!=e&&e.appID===b.sourceApp&&e.id===b.group)),e??(e=n[0]);let t=e?.sellingPlans?.filter(e=>null!=e).map(e=>({label:e.name,value:e.baseID}))??[];if(b.defaultOptions){let n=e?.sellingPlans?.find(e=>null!=e&&e.baseID===b.defaultOptions),i=e?.sellingPlans?.find(e=>null!=e&&e.id===b.defaultOptions);l=n?.baseID??i?.baseID??t[0]?.value}else l=t[0]?.value;return{sellingPlans:t,defaultValue:l}},[d,O,b]);return{sellingPlans:D,defaultValue:I}};export{useSellingSubscription};
@@ -0,0 +1 @@
1
+ import{useEffect as e}from"react";import{useProductStore as i,useProduct as l}from"@gem-sdk/core";import{SubscriptionEnum as t}from"../../../constants/index.js";import{useSellingPlanOptions as n}from"./useSellingPlanOptions.js";let useSubscriptionVisibility=({setting:s,hasBothTypes:r,sellingPlans:o})=>{let p=i(e=>e.setSubscriptionSellingType),S=i(e=>e.subscriptionSellingType),T=n(s),g=l(),u=g?.requiresSellingPlan,I=S===t.ONE_TIME?t.ONE_TIME:t.SUBSCRIPTION;e(()=>{if(!r){p(s?.sellingType??t.SUBSCRIPTION);return}S||p(t.SUBSCRIPTION)},[p,s?.sellingType,r,S]);let m=r&&!u,y=!T||0===T.length,E=s?.sellingType===t.ONE_TIME&&(u||!o||0===o.length)||s?.sellingType===t.ONE_TIME&&!r;return{selectedType:I,shouldShowRadio:m,isOneTimeHidden:E,hasNoSellingPlanOptions:y,setSubscriptionSellingType:p}};export{useSubscriptionVisibility};
@@ -1 +1 @@
1
- var PostPurchaseSubscriptionSellingType;let NEXT_AND_PREV_URLS={},BUTTON_URL_MAP_POST_PURCHASE={next:{vertical:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-6c7f10a8-a205-43bd-b39c-aab044bb3771.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a3c3d74c-2cde-49e5-9854-8079f5239013.svg"},horizontal:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a3d1f159-001d-4301-bead-214606caf995.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a5ac0286-5941-4bd7-a21d-72a6c017aeea.svg"}},prev:{vertical:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-010c3c2a-fcc3-4b09-84a2-734d924ad49b.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-4e4e886a-5aa1-4bb3-ab48-aa7752fd5eba.svg"},horizontal:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-33e3810b-a94c-40a1-a48b-4eba39013f15.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a2eb5093-0203-4973-8ade-183d5bdefdce.svg"}}};!function(s){s.ONE_TIME="one-time",s.SUBSCRIPTION="subscription"}(PostPurchaseSubscriptionSellingType||(PostPurchaseSubscriptionSellingType={}));export{BUTTON_URL_MAP_POST_PURCHASE,PostPurchaseSubscriptionSellingType};
1
+ var SubscriptionEnum;let NEXT_AND_PREV_URLS={},BUTTON_URL_MAP_POST_PURCHASE={next:{vertical:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-6c7f10a8-a205-43bd-b39c-aab044bb3771.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a3c3d74c-2cde-49e5-9854-8079f5239013.svg"},horizontal:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a3d1f159-001d-4301-bead-214606caf995.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a5ac0286-5941-4bd7-a21d-72a6c017aeea.svg"}},prev:{vertical:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-010c3c2a-fcc3-4b09-84a2-734d924ad49b.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-4e4e886a-5aa1-4bb3-ab48-aa7752fd5eba.svg"},horizontal:{disabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-33e3810b-a94c-40a1-a48b-4eba39013f15.svg",enabled:"https://cdn.shopify.com/s/files/1/0789/8018/6418/files/472169286689883168-a2eb5093-0203-4973-8ade-183d5bdefdce.svg"}}};!function(s){s.ONE_TIME="one-time",s.SUBSCRIPTION="subscription"}(SubscriptionEnum||(SubscriptionEnum={}));export{BUTTON_URL_MAP_POST_PURCHASE,SubscriptionEnum};
@@ -1 +1 @@
1
- import{useProductOfferDiscount as e,useCurrentVariant as t,useQuantity as l,useFormatMoney as i,convertDecimalToNumber as o,shopifyPriceRounding as a}from"@gem-sdk/core";import{useDynamicProduct as u}from"./useDynamicProduct.js";let useGetMoneyLines=(s,n)=>{let{isDynamicProduct:p,dynamicPrice:b,dynamicDiscount:r,isEnableDynamicDiscount:L}=u(),h=e(),c=t(),{quantity:d}=l(),m=h*(d||1),w=i(m,!1),S=o(c?.price)??0,f=S*(d||1),g=i(f,!1),y=a(m,2),T=i(f-parseFloat(y),!1),q=()=>{let e=[];return!1!==s.isShowSubTotalLabel&&e.push({title:n.subTotalLabel,money:p?b:g,uniqueId:"subTotalLabel"}),!1!==s.isShowDiscountLabel&&e.push({title:n.discountLabel,money:p&&r&&L?`${r.value}%`:h>0?w:"No discount",uniqueId:"discountLabel"}),!1!==s.isShowShippingLabel&&e.push({title:n.shippingLabel,uniqueId:"shippingLabel",tooltip:{content:"Shipping fee will be calculated on real offer page",width:"23em"}}),!1!==s.isShowTaxesLabel&&e.push({title:n.taxesLabel,uniqueId:"taxesLabel",tooltip:{content:"Taxes will be calculated on real offer page",width:"20em"}}),!1!==s.isShowTotalLabel&&e.push({title:n.totalLabel,money:p?b:T,uniqueId:"totalLabel"}),e};return{getMoneyLines:q}};export{useGetMoneyLines};
1
+ import{useProductOfferDiscount as e,useCurrentVariant as t,useQuantity as l,useI18nStore as i,useFormatMoney as o,convertDecimalToNumber as a,shopifyPriceRounding as u}from"@gem-sdk/core";import{useDynamicProduct as n}from"./useDynamicProduct.js";let useGetMoneyLines=(s,r)=>{let{isDynamicProduct:p,dynamicPrice:b,dynamicDiscount:h,isEnableDynamicDiscount:L}=n(),c=e(),d=t(),{quantity:m}=l(),{t:g}=i(),w=c*(m||1),S=o(w,!1),T=a(d?.price)??0,y=T*(m||1),f=o(y,!1),q=u(w,2),x=o(y-parseFloat(q),!1),I=()=>{let e=[];return!1!==s.isShowSubTotalLabel&&e.push({title:r.subTotalLabel,money:p?b:f,uniqueId:"subTotalLabel"}),!1!==s.isShowDiscountLabel&&e.push({title:r.discountLabel,money:p&&h&&L?`${h.value}%`:c>0?S:"No discount",uniqueId:"discountLabel"}),!1!==s.isShowShippingLabel&&e.push({title:r.shippingLabel,uniqueId:"shippingLabel",tooltip:{content:"Shipping fee will be calculated on real offer page",width:"23em"}}),!1!==s.isShowTaxesLabel&&e.push({title:r.taxesLabel,uniqueId:"taxesLabel",tooltip:{content:"Taxes will be calculated on real offer page",width:"20em"}}),!1!==s.isShowTotalLabel&&e.push({title:r.totalLabel,money:p?b:x,uniqueId:"totalLabel"}),r?.isShowRecurringTotalLabel!==!1&&e.push({title:g("Recurring subtotal"),money:"$20.00 every week",uniqueId:"recurringTotalLabel",subTitle:g("Doesn't include shipping, tax or duties")}),e};return{getMoneyLines:I}};export{useGetMoneyLines};
@@ -1 +1 @@
1
- import{useProductStore as e,useProduct as t,useVariants as r}from"@gem-sdk/core";import{useMemo as n}from"react";import{PostPurchaseSubscriptionSellingType as s}from"../constants/index.js";import{checkDefaultVariant as i}from"../../../product/helpers/product.js";let useSubscriptionConsentCheck=()=>{let o=e(e=>e.isAgreeBuyWithSubscription),l=e(e=>e.selectedOptions),p=e(e=>e.subscriptionSellingType),u=t(),c=r(),d=n(()=>{let e=p===s.ONE_TIME;if(o||e)return!1;let t=!!u?.sellingPlanGroups?.length||!!u?.variants?.edges.find(e=>!!e.node?.sellingPlanGroups?.length);if(!t||!l)return!1;let r=i(u);if(!r){let e=c.find(e=>e?.selectedOptions.every(e=>l[e.name??""]===e.value)),t=!!e?.sellingPlanGroups?.length;return t}return!0},[l,p,o,u,c]);return{isDisableAccept:d}};export{useSubscriptionConsentCheck};
1
+ import{useProductStore as e,useProduct as t,useVariants as r}from"@gem-sdk/core";import{useMemo as n}from"react";import{SubscriptionEnum as s}from"../constants/index.js";import{checkDefaultVariant as i}from"../../../product/helpers/product.js";let useSubscriptionConsentCheck=()=>{let o=e(e=>e.isAgreeBuyWithSubscription),l=e(e=>e.selectedOptions),p=e(e=>e.subscriptionSellingType),u=t(),c=r(),d=n(()=>{let e=p===s.ONE_TIME;if(o||e)return!1;let t=!!u?.sellingPlanGroups?.length||!!u?.variants?.edges.find(e=>!!e.node?.sellingPlanGroups?.length);if(!t||!l)return!1;let r=i(u);if(!r){let e=c.find(e=>e?.selectedOptions.every(e=>l[e.name??""]===e.value)),t=!!e?.sellingPlanGroups?.length;return t}return!0},[l,p,o,u,c]);return{isDisableAccept:d}};export{useSubscriptionConsentCheck};
@@ -1 +1 @@
1
- import"react/jsx-runtime";import"@gem-sdk/core";import"@gem-sdk/system";import"react";import"./components/product-variant/components/variants/VariantItem.js";import"next/link";import"./constants/index.js";import"next/head";import"next/image";import"react-youtube";import"../image/components/Img.js";import t from"./settings/product-title/ProductTitle.js";import r from"./settings/product-description/ProductDescription.js";import o from"./settings/product-price/ProductPrice.js";import s from"./settings/product-variants/ProductVariant.js";import i from"./settings/accept-button/index.js";import e from"./settings/product-quantity/index.js";import c from"./settings/product-offer/index.js";import u from"./settings/product-price-breakdown/index.js";import n from"./settings/product-discount-tag/ProductDiscountTag.js";import p from"./settings/product-subscription/index.js";import m from"./settings/product-image/ProductImages.js";let postPurchaseProductSetting={PostPurchaseProductTitle:t,PostPurchaseProductDescription:r,PostPurchaseProductPrice:o,PostPurchaseProductVariants:s,PostPurchaseAcceptButton:i,PostPurchaseProductQuantity:e,PostPurchaseProductPriceBreakdown:u,PostPurchaseProductOffer:c,PostPurchaseProductDiscountTag:n,PostPurchaseProductImages:m,PostPurchaseProductSubscription:p};export{postPurchaseProductSetting};
1
+ import"react/jsx-runtime";import"@gem-sdk/core";import"@gem-sdk/system";import"react";import"./components/product-variant/components/variants/VariantItem.js";import"next/link";import"./constants/index.js";import"next/head";import"next/image";import"react-youtube";import"./components/product-subscription/common/styles.js";import"./components/product-subscription/components/OneTimePurchaseTooltip.js";import"../image/components/Img.js";import t from"./settings/product-title/ProductTitle.js";import o from"./settings/product-description/ProductDescription.js";import r from"./settings/product-price/ProductPrice.js";import s from"./settings/product-variants/ProductVariant.js";import i from"./settings/accept-button/index.js";import e from"./settings/product-quantity/index.js";import c from"./settings/product-offer/index.js";import n from"./settings/product-price-breakdown/index.js";import u from"./settings/product-discount-tag/ProductDiscountTag.js";import p from"./settings/product-subscription/index.js";import m from"./settings/product-image/ProductImages.js";let postPurchaseProductSetting={PostPurchaseProductTitle:t,PostPurchaseProductDescription:o,PostPurchaseProductPrice:r,PostPurchaseProductVariants:s,PostPurchaseAcceptButton:i,PostPurchaseProductQuantity:e,PostPurchaseProductPriceBreakdown:n,PostPurchaseProductOffer:c,PostPurchaseProductDiscountTag:u,PostPurchaseProductImages:m,PostPurchaseProductSubscription:p};export{postPurchaseProductSetting};
@@ -1 +1 @@
1
- import{postPurchaseSpacing as e}from"../../../../common/constants.js";let ProductPriceBreakdownSettings=[{id:"setting",controls:[{id:"discountAndShippingFee",type:"discount-and-shipping-fee-product-offer",multiple:!1},{id:"subTotalLabel",type:"input",default:"Sub total",emptyOnClear:!0},{id:"discountLabel",type:"input",default:"Discount",emptyOnClear:!0},{id:"shippingLabel",type:"input",default:"Shipping",emptyOnClear:!0},{id:"taxesLabel",type:"input",default:"Taxes",emptyOnClear:!0},{id:"totalLabel",type:"input",default:"Total",emptyOnClear:!0},{id:"contentShow",type:"input",default:"Show price breakdown",fallbackValue:"Show price breakdown",clearButton:!1},{id:"contentHide",type:"input",default:"Hide price breakdown",fallbackValue:"Hide price breakdown",clearButton:!1}]},{id:"style",controls:[{id:"labelStyle",label:"Label",type:"typography-post-purchase",default:{fontSize:"medium",textColor:"default",fontWeight:"bold",textTransform:"none"}},{id:"moneyStyle",label:"Money value",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"bold",textTransform:"none"}},{id:"isShowPrice",label:"Expand price breakdown",type:"toggle",default:!0},{id:"isShowSubTotalLabel",label:"Sub total",type:"toggle",default:!0},{id:"direction",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"isShowDiscountLabel",label:"Discount",type:"toggle",default:!0},{id:"isShowShippingLabel",label:"Shipping",type:"toggle",default:!0},{id:"isShowTaxesLabel",label:"Taxes",type:"toggle",default:!0},{id:"isShowTotalLabel",label:"Total",type:"toggle",default:!0},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"left"},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"}},displayOptions:[{label:"Full",value:"100%",showValue:!0}]},{type:"select",label:"Spacing",id:"spacing",options:e,default:"none"}]}];export{ProductPriceBreakdownSettings};
1
+ import{postPurchaseSpacing as e}from"../../../../common/constants.js";let ProductPriceBreakdownSettings=[{id:"setting",controls:[{id:"discountAndShippingFee",type:"discount-and-shipping-fee-product-offer",multiple:!1},{id:"subTotalLabel",type:"input",default:"Sub total",emptyOnClear:!0},{id:"discountLabel",type:"input",default:"Discount",emptyOnClear:!0},{id:"shippingLabel",type:"input",default:"Shipping",emptyOnClear:!0},{id:"taxesLabel",type:"input",default:"Taxes",emptyOnClear:!0},{id:"totalLabel",type:"input",default:"Total",emptyOnClear:!0},{id:"contentShow",type:"input",default:"Show price breakdown",fallbackValue:"Show price breakdown",clearButton:!1},{id:"contentHide",type:"input",default:"Hide price breakdown",fallbackValue:"Hide price breakdown",clearButton:!1},{id:"isShowRecurringTotalLabel",label:"Recurring price",type:"toggle",default:!0}]},{id:"style",controls:[{id:"labelStyle",label:"Label",type:"typography-post-purchase",default:{fontSize:"medium",textColor:"default",fontWeight:"bold",textTransform:"none"}},{id:"moneyStyle",label:"Money value",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"bold",textTransform:"none"}},{id:"isShowPrice",label:"Expand price breakdown",type:"toggle",default:!0},{id:"isShowSubTotalLabel",label:"Sub total",type:"toggle",default:!0},{id:"direction",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"isShowDiscountLabel",label:"Discount",type:"toggle",default:!0},{id:"isShowShippingLabel",label:"Shipping",type:"toggle",default:!0},{id:"isShowTaxesLabel",label:"Taxes",type:"toggle",default:!0},{id:"isShowTotalLabel",label:"Total",type:"toggle",default:!0},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"left"},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"}},displayOptions:[{label:"Full",value:"100%",showValue:!0}]},{type:"select",label:"Spacing",id:"spacing",options:e,default:"none"}]}];export{ProductPriceBreakdownSettings};
@@ -1 +1 @@
1
- let SettingUIV2=[{controls:[{type:"control",setting:{id:"discountAndShippingFee"},layout:"vertical"}]},{label:{en:"Content"},controls:[{label:{en:"Show"},popoverLabel:{en:"Show button"},type:"combo",iconName:"polaris-text-block",compoDefaultValue:"Show",getValueFromSettingID:"contentShow",disableClearMessage:"This content is needed for customers <br> to show the price breakdown",layout:"horizontal",controls:[{setting:{id:"contentShow"},label:{en:"Content"},layout:"vertical",isHideClear:!0}]},{label:{en:"Hide"},popoverLabel:{en:"Hide button"},type:"combo",iconName:"polaris-text-block",getValueFromSettingID:"contentHide",disableClearMessage:"This content is needed for customers <br> to hide the price breakdown",layout:"horizontal",controls:[{setting:{id:"contentHide"},label:{en:"Content"},layout:"vertical"}]}]},{label:{en:"Label"},controls:[{setting:{id:"labelStyle"},layout:"vertical"}]},{label:{en:"Money value"},controls:[{setting:{id:"moneyStyle"},layout:"vertical"}]},{label:{en:"Item spacing"},controls:[{label:{en:"Item gap"},setting:{id:"spacing"},layout:"horizontal"}]},{label:{en:"Size"},controls:[{label:{en:"Width"},setting:{id:"width"},layout:"horizontal"}]},{label:{en:"Price breakdown option"},controls:[{label:{en:"Direction"},setting:{id:"direction"},layout:"horizontal"},{label:{en:"Auto-expand"},setting:{id:"isShowPrice"},layout:"horizontal"}],moreSettings:{type:"collapse",controls:[{label:{en:"Sub total"},setting:{id:"isShowSubTotalLabel"},layout:"horizontal"},{label:{en:"Discount"},setting:{id:"isShowDiscountLabel"},layout:"horizontal"},{label:{en:"Shipping"},setting:{id:"isShowShippingLabel"},layout:"horizontal"},{label:{en:"Taxes"},setting:{id:"isShowTaxesLabel"},layout:"horizontal"},{label:{en:"Total"},setting:{id:"isShowTotalLabel"},layout:"horizontal"}]}},{controls:[{type:"control",label:{en:"Align"},setting:{id:"align"},conditionEnable:'!(parseInt(width) >= 100 && width?.includes("%"))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"},layout:"horizontal"}]}];export{SettingUIV2};
1
+ let SettingUIV2=[{controls:[{type:"control",setting:{id:"discountAndShippingFee"},layout:"vertical"}]},{label:{en:"Content"},controls:[{label:{en:"Show"},popoverLabel:{en:"Show button"},type:"combo",iconName:"polaris-text-block",compoDefaultValue:"Show",getValueFromSettingID:"contentShow",disableClearMessage:"This content is needed for customers <br> to show the price breakdown",layout:"horizontal",controls:[{setting:{id:"contentShow"},label:{en:"Content"},layout:"vertical",isHideClear:!0}]},{label:{en:"Hide"},popoverLabel:{en:"Hide button"},type:"combo",iconName:"polaris-text-block",getValueFromSettingID:"contentHide",disableClearMessage:"This content is needed for customers <br> to hide the price breakdown",layout:"horizontal",controls:[{setting:{id:"contentHide"},label:{en:"Content"},layout:"vertical"}]}]},{label:{en:"Label"},controls:[{setting:{id:"labelStyle"},layout:"vertical"}]},{label:{en:"Money value"},controls:[{setting:{id:"moneyStyle"},layout:"vertical"}]},{label:{en:"Item spacing"},controls:[{label:{en:"Item gap"},setting:{id:"spacing"},layout:"horizontal"}]},{label:{en:"Size"},controls:[{label:{en:"Width"},setting:{id:"width"},layout:"horizontal"}]},{label:{en:"Price breakdown option"},controls:[{label:{en:"Direction"},setting:{id:"direction"},layout:"horizontal"},{label:{en:"Auto-expand"},setting:{id:"isShowPrice"},layout:"horizontal"}],moreSettings:{type:"collapse",controls:[{label:{en:"Sub total"},setting:{id:"isShowSubTotalLabel"},layout:"horizontal"},{label:{en:"Discount"},setting:{id:"isShowDiscountLabel"},layout:"horizontal"},{label:{en:"Shipping"},setting:{id:"isShowShippingLabel"},layout:"horizontal"},{label:{en:"Taxes"},setting:{id:"isShowTaxesLabel"},layout:"horizontal"},{label:{en:"Total"},setting:{id:"isShowTotalLabel"},layout:"horizontal"},{label:{en:"Recurring price"},setting:{id:"isShowRecurringTotalLabel"},layout:"horizontal"}]}},{controls:[{type:"control",label:{en:"Align"},setting:{id:"align"},conditionEnable:'!(parseInt(width) >= 100 && width?.includes("%"))',options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"},layout:"horizontal"}]}];export{SettingUIV2};
@@ -1 +1 @@
1
- import{postPurchaseSpacing as e}from"../../../../common/constants.js";let ProductSubscriptionSettings=[{id:"setting",controls:[{id:"sellingType",label:"Type",type:"pick-subscription",options:[{value:"one-time",label:"One-time"},{value:"subscription",label:"Subscription"}],default:"subscription"},{id:"sellingPlans",label:"Selling plans",type:"selling-plan"},{id:"sellingTitle",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Subscribe and save up to {total_max_discount}",suggestContents:[{message:"{total_max_discount}",eg:"E.g: 50% (offer’s + plan’s max discount)"},{message:"{offer_selling_plan_discount}",eg:"E.g: 20%"}]},{id:"sellingLabel",label:"Text",type:"input",default:"Purchase options",placeholder:"E.g. Purchase options",clearButton:!1},{id:"sellingStyle",label:"Style",type:"option:illustration",default:"dropdown",options:[{label:"Dropdown",value:"dropdown",svgName:"gp-selling-plan-dropdown"},{label:"Radio",value:"radio",svgName:"gp-selling-plan-radio"}]},{id:"subscriptionLabel",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",suggestContents:[{message:"{selling_plan_delivery_frequency}",eg:"E.g: every week"},{message:"{selling_plan_discount}",eg:"E.g: 10%"},{message:"{selling_plan_billing_cycle}",eg:"E.g: every 1 month"}]},{id:"enableSubscriptionDetail",label:"Enable subscription detail",type:"toggle",default:!1}]},{id:"style",controls:[{id:"sellingTitleDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"subscriptionDetailDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"sellingPlanItemGap",type:"select",label:"Item gap",options:e,default:"tight"},{id:"sellingTitleTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"sellingTitleAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"subscriptionDetailTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"subscriptionDetailAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"},tablet:{default:"100%"},mobile:{default:"100%"}},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}]},{id:"backgroundColor",type:"color-picker-v2",devices:{desktop:{default:void 0}},compoDefaultValue:{desktop:{default:"#DDDDDD"}},enableGradient:!0},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"left"}]}];export{ProductSubscriptionSettings};
1
+ import{postPurchaseSpacing as e}from"../../../../common/constants.js";let ProductSubscriptionSettings=[{id:"setting",controls:[{id:"sellingType",label:"Type",type:"pick-subscription",options:[{value:"one-time",label:"One-time"},{value:"subscription",label:"Subscription"}],default:"subscription"},{id:"sellingPlans",label:"Selling plans",type:"selling-plan"},{id:"sellingTitle",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Subscribe and save up to {total_max_discount}",suggestContents:[{message:"{total_max_discount}",eg:"E.g: 50% (offer’s + plan’s max discount)"},{message:"{offer_selling_plan_discount}",eg:"E.g: 20%"}]},{id:"sellingLabel",label:"Text",type:"input",default:"Purchase options",placeholder:"E.g. Purchase options",clearButton:!1},{id:"sellingTitleOneTime",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"One-time purchase",suggestContents:[]},{id:"sellingStyle",label:"Style",type:"option:illustration",default:"dropdown",options:[{label:"Dropdown",value:"dropdown",svgName:"gp-selling-plan-dropdown"},{label:"Radio",value:"radio",svgName:"gp-selling-plan-radio"}]},{id:"subscriptionLabel",label:"Text",type:"textarea",defaultRows:4,showPlusBtn:!0,autoHeight:!0,minHeight:72,default:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",suggestContents:[{message:"{selling_plan_delivery_frequency}",eg:"E.g: every week"},{message:"{selling_plan_discount}",eg:"E.g: 10%"},{message:"{selling_plan_billing_cycle}",eg:"E.g: every 1 month"}]},{id:"enableSubscriptionDetail",label:"Enable subscription detail",type:"toggle",default:!1}]},{id:"style",controls:[{id:"sellingTitleDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"sellingTitleOneTimeDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"subscriptionDetailDirection",label:"Direction",type:"option:value",options:[{label:"LTR",value:"ltr"},{label:"RTL",value:"rtl"}],default:"ltr"},{id:"sellingPlanItemGap",type:"select",label:"Item gap",options:e,default:"tight"},{id:"sellingTitleTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"sellingTitleAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"sellingTitleOneTimeTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"sellingTitleOneTimeAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"subscriptionDetailTypo",label:"Label",type:"typography-post-purchase",default:{fontSize:"default",textColor:"default",fontWeight:"normal",textTransform:"none"}},{id:"subscriptionDetailAlign",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"text",tooltip:"Align left",iconName:"polaris-text-align-left"},{label:"Center",value:"center",type:"text",tooltip:"Align center",iconName:"polaris-text-align-center"},{label:"Right",value:"right",type:"text",tooltip:"Align right",iconName:"polaris-text-align-right"}],default:"left"},{id:"width",type:"dropdown:input",label:"Width",inputType:"number",units:["px","%"],hideUnit:!1,devices:{desktop:{default:"100%"},tablet:{default:"100%"},mobile:{default:"100%"}},displayOptions:[{label:"Fit content",value:"Auto",showValue:!0},{label:"Full",value:"100%",showValue:!0}]},{id:"backgroundColor",type:"select",label:"Background Color",options:[{label:"Transparent",value:"none",icon:"gp-bg-transparent"},{label:"Red",value:"critical",icon:"gp-bg-color-red"},{label:"Blue",value:"info",icon:"gp-bg-color-blue"},{label:"Green",value:"success",icon:"gp-bg-color-green"},{label:"Yellow",value:"warning",icon:"gp-bg-color-yellow"}],default:"none"},{id:"align",label:"Alignment",type:"option:value",options:[{label:"Left",value:"left",type:"align",tooltip:"Align left",iconName:"gp-align-left"},{label:"Center",value:"center",type:"align",tooltip:"Align center",iconName:"gp-align-center"},{label:"Right",value:"right",type:"align",tooltip:"Align right",iconName:"gp-align-right"}],default:"left"}]}];export{ProductSubscriptionSettings};
@@ -1 +1 @@
1
- let SettingUIV2=[{label:{en:"Selling options"},controls:[{type:"control",label:{en:"Type"},setting:{id:"sellingType"}},{type:"combo",label:{en:"Title"},iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_max_discount}",popoverLabel:{en:"Selling option title"},isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:{en:"Direction"},setting:{id:"sellingTitleDirection"}},{type:"control",label:{en:""},setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:{en:"Align"}}]}]},{label:{en:"Selling plans"},controls:[{type:"control",label:{en:"Selling plans"},setting:{id:"sellingPlans"}},{type:"control",label:{en:"Label"},setting:{id:"sellingLabel"},layout:"horizontal"},{type:"control",label:{en:"Style"},setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:{en:"Item gap"},setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}]},{controls:[{type:"control",label:{en:"Subscription detail"},setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:{en:"Label"},iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:{en:"Subscription detail"},isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:{en:"Content"},setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:{en:"Direction"},setting:{id:"subscriptionDetailDirection"},conditionDisplay:"enableSubscriptionDetail === true",controlChangeTrigger:{settings:[{action:{controlId:"subscriptionDetailAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'rtl' && subscriptionDetailAlign === 'left'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]},{action:{controlId:"subscriptionDetailAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'ltr' && subscriptionDetailAlign === 'right'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:{en:"Align"},conditionDisplay:"enableSubscriptionDetail === true"}]},{label:{en:"Size"},controls:[{type:"control",label:{en:"Width"},setting:{id:"width"},layout:"horizontal"}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{controls:[{label:{en:"Align"},conditionEnable:"activeScreenId === 'desktop' ? !(parseInt(width) >= 100 && width?.includes(\"%\")) : (!(parseInt(width) >= 100 && width?.includes(\"%\")) && width !== 'default')",setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];export{SettingUIV2};
1
+ let SettingUIV2=[{label:{en:"Selling options"},controls:[{type:"control",label:{en:"Type"},setting:{id:"sellingType"}},{type:"combo",label:{en:"Title"},iconName:"polaris-text-block",getValueFromSettingID:"sellingTitle",compoDefaultValue:"Subscribe and save up to {total_max_discount}",popoverLabel:{en:"Selling option title"},isHideClear:!0,controls:[{label:{en:"Content"},setting:{id:"sellingTitle"},layout:"vertical"},{type:"control",label:{en:"Direction"},setting:{id:"sellingTitleDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'rtl' && sellingTitleAlign === 'left'",source:["subscriptionDetailDirection","sellingTitleAlign"]},{action:{controlId:"sellingTitleAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleDirection === 'ltr' && sellingTitleAlign === 'right'",source:["sellingTitleDirection","sellingTitleAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"sellingTitleTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleAlign"},label:{en:"Align"}}],conditionDisplay:'sellingType === "subscription"'},{type:"combo",label:{en:"Title"},iconName:"polaris-text-block",getValueFromSettingID:"sellingTitleOneTime",compoDefaultValue:"Purchase options",popoverLabel:{en:"Selling option title"},isHideClear:!0,conditionDisplay:'sellingType === "one-time"',controls:[{label:{en:"Content"},setting:{id:"sellingTitleOneTime"},layout:"vertical"},{type:"control",label:{en:"Direction"},setting:{id:"sellingTitleOneTimeDirection"},controlChangeTrigger:{settings:[{action:{controlId:"sellingTitleOneTimeAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"sellingTitleOneTimeDirection === 'rtl' && sellingTitleOneTimeAlign === 'left'",source:["sellingTitleOneTimeDirection","sellingTitleOneTimeAlign"]},{action:{controlId:"sellingTitleOneTimeAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"sellingTitleOneTimeDirection === 'ltr' && sellingTitleOneTimeAlign === 'right'",source:["sellingTitleOneTimeDirection","sellingTitleOneTimeAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"sellingTitleOneTimeTypo"},layout:"vertical"},{type:"control",setting:{id:"sellingTitleOneTimeAlign"},label:{en:"Align"}}]}]},{label:{en:"Selling plans"},controls:[{type:"control",label:{en:"Selling plans"},setting:{id:"sellingPlans"}},{type:"control",label:{en:"Label"},setting:{id:"sellingLabel"},layout:"horizontal",conditionDisplay:'sellingType === "subscription"'},{type:"control",label:{en:"Style"},setting:{id:"sellingStyle"},layout:"horizontal"},{type:"control",label:{en:"Item gap"},setting:{id:"sellingPlanItemGap"},layout:"horizontal",conditionDisplay:"sellingStyle === 'radio'"}],conditionDisplay:'sellingType === "subscription"'},{controls:[{type:"control",label:{en:"Subscription detail"},setting:{id:"enableSubscriptionDetail"},options:{labelVariant:"primary",toggleStyle:"switch",fullWidth:!0}},{type:"combo",label:{en:"Label"},iconName:"polaris-text-block",getValueFromSettingID:"subscriptionLabel",compoDefaultValue:"Delivery every {selling_plan_delivery_frequency}, save {selling_plan_discount}",popoverLabel:{en:"Subscription detail"},isHideClear:!0,conditionDisplay:"enableSubscriptionDetail === true",controls:[{label:{en:"Content"},setting:{id:"subscriptionLabel"},layout:"vertical"}]},{type:"control",label:{en:"Direction"},setting:{id:"subscriptionDetailDirection"},conditionDisplay:"enableSubscriptionDetail === true",controlChangeTrigger:{settings:[{action:{controlId:"subscriptionDetailAlign",newValue:"right",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'rtl' && subscriptionDetailAlign === 'left'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]},{action:{controlId:"subscriptionDetailAlign",newValue:"left",groupType:"style",controlType:"style"},condition:"subscriptionDetailDirection === 'ltr' && subscriptionDetailAlign === 'right'",source:["subscriptionDetailDirection","subscriptionDetailAlign"]}],options:{noRecordHistory:!0}}},{type:"control",label:{en:""},setting:{id:"subscriptionDetailTypo"},layout:"vertical",conditionDisplay:"enableSubscriptionDetail === true"},{type:"control",setting:{id:"subscriptionDetailAlign"},label:{en:"Align"},conditionDisplay:"enableSubscriptionDetail === true"}],conditionDisplay:'sellingType === "subscription"'},{label:{en:"Size"},controls:[{type:"control",label:{en:"Width"},setting:{id:"width"},layout:"horizontal"}]},{label:{en:"Background"},controls:[{label:{en:"Color"},setting:{id:"backgroundColor"}}]},{controls:[{label:{en:"Align"},conditionEnable:"activeScreenId === 'desktop' ? !(parseInt(width) >= 100 && width?.includes(\"%\")) : (!(parseInt(width) >= 100 && width?.includes(\"%\")) && width !== 'default')",setting:{id:"align"},options:{labelVariant:"primary",fullWidth:!0,disableMessage:"Horizontal alignment is disabled when the width is set to 100% or greater"}}]}];export{SettingUIV2};
@@ -2587,9 +2587,9 @@ declare const postPurchaseButtonSetting: {
2587
2587
  PostPurchaseButton: _gem_sdk_core.ComponentSetting<PostPurchaseButtonProps>;
2588
2588
  };
2589
2589
 
2590
- type TStatus = 'info' | 'success' | 'warning' | 'critical' | 'none';
2590
+ type TStatus$1 = 'info' | 'success' | 'warning' | 'critical' | 'none';
2591
2591
  type BackgroundColor = {
2592
- backgroundColor: TStatus | '';
2592
+ backgroundColor: TStatus$1 | '';
2593
2593
  };
2594
2594
  type CalloutBoxProps = RowProps & {
2595
2595
  styles: BackgroundColor;
@@ -2904,6 +2904,7 @@ type PostPurchaseProductPriceBreakdownSettingProps = {
2904
2904
  discountAndShippingFee?: boolean;
2905
2905
  contentShow?: string;
2906
2906
  contentHide?: string;
2907
+ isShowRecurringTotalLabel?: boolean;
2907
2908
  };
2908
2909
  type PostPurchaseProductPriceBreakdownStyleProps = {
2909
2910
  labelStyle?: PostPurchaseTypo;
@@ -3069,9 +3070,11 @@ type PostPurchaseProductImagesProps = BasePropsWrap<ProductImagesSettingProps, P
3069
3070
 
3070
3071
  declare const postPurchaseSpacing: Record<string, string>;
3071
3072
 
3073
+ type TStatus = 'info' | 'success' | 'warning' | 'critical' | 'none';
3072
3074
  type ProductSubscriptionSettingProps = {
3073
3075
  sellingType?: 'one-time' | 'subscription';
3074
3076
  sellingLabel?: string;
3077
+ sellingTitleOneTime?: string;
3075
3078
  sellingStyle?: 'dropdown' | 'radio' | 'image';
3076
3079
  sellingTitle?: string;
3077
3080
  subscriptionLabel?: string;
@@ -3090,12 +3093,15 @@ type ProductSubscriptionStyleProps = {
3090
3093
  sellingTitleDirection?: 'ltr' | 'rtl';
3091
3094
  sellingTitleTypo?: PostPurchaseTypo;
3092
3095
  sellingTitleAlign?: AlignItemProp;
3096
+ sellingTitleOneTimeDirection?: 'ltr' | 'rtl';
3097
+ sellingTitleOneTimeTypo?: PostPurchaseTypo;
3098
+ sellingTitleOneTimeAlign?: AlignItemProp;
3093
3099
  subscriptionDetailDirection?: 'ltr' | 'rtl';
3094
3100
  subscriptionDetailTypo?: PostPurchaseTypo;
3095
3101
  subscriptionDetailAlign?: AlignItemProp;
3096
3102
  sellingPlanItemGap?: keyof typeof postPurchaseSpacing;
3097
3103
  width?: ObjectDevices<string>;
3098
- backgroundColor?: ObjectDevices<string | undefined>;
3104
+ backgroundColor?: TStatus | '';
3099
3105
  align?: AlignItemProp;
3100
3106
  sellingPlanId?: string;
3101
3107
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "8.0.0-dev.111",
3
+ "version": "8.0.0-dev.114",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -27,7 +27,7 @@
27
27
  "i18n:generate": "node ./scripts/update-locales-to-setting.js"
28
28
  },
29
29
  "devDependencies": {
30
- "@gem-sdk/core": "8.0.0-dev.111",
30
+ "@gem-sdk/core": "8.0.0-dev.112",
31
31
  "@gem-sdk/styles": "8.0.0-dev.111",
32
32
  "@gem-sdk/system": "8.0.0-dev.111",
33
33
  "@types/react-transition-group": "4.4.12",