{"version":3,"file":"useXmasDeliverySetVariant.tyU-R0ju.mjs","names":["useState","inStock"],"sources":["https:/framerusercontent.com/modules/M9cXh4I9KJVUlake4ujw/eoAsV7mKjGjf6VhuggzX/useXmasDeliverySetVariant.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{store_Country}from\"https://framerusercontent.com/modules/uEbYfRswpEkLoguEXuyc/aJGVne8id8ZJMOpoLekR/store_Country.js\";import{store_ProductPropsStore}from\"https://framerusercontent.com/modules/XlGHH84z4WYiDTmjfihj/ubudeOZTU3Q0olVhPzVw/store_ProductPropsStore.js\";import{territoryCountriesEu}from\"https://framerusercontent.com/modules/MXAlwEF2Ne69R0dSh1Po/PBkk6PatjLnl9iNIEarO/country_lists_territories.js\";function setXmasDeliveryGuaranteeVariant(Component,isProductPage=false){return props=>{const[country,_c]=store_Country();const[store,_s]=store_ProductPropsStore();const countryCode=(country?.countryCode||\"\").toUpperCase();const[inStock,setInStock]=useState();const[showVariant,setShowVariant]=useState();// Update component when store changes\nuseEffect(()=>{// Get Variant:\nlet variant=\"None\";try{let inStock=true;const nowTs=new Date().getTime();if(store.productFormat!==\"Jewelry\"){inStock=true;}else{let bezel20mmOutOfStock=false;let bezel20mmOutOfStockMessage=\"\";const isBezel=store.jewelryBezelMount!==\"No Mount\";const isKeyring=store.jewelryPiece===\"Keyring\";const isBracelet=store.jewelryPiece===\"Bracelet\";// Onyx 20\nconst isOnyxBracelet=!isBezel&&isBracelet&&store.jewelryMaterial==\"Black Onyx\";// Onyx 25 One Hole Unmounted\nconst isOnyx25mmUnmounted=!isBezel&&!isBracelet&&store.jewelryMaterial==\"Black Onyx\"&&store.jewelrySize===\"25mm\";if((isOnyxBracelet||isOnyx25mmUnmounted)&&nowTs<Date.parse(\"2026-01-05T00:00:00Z\")){inStock=false;}else{inStock=true;}}if(inStock){const now=new Date().getTime();const showJewelry=isProductPage&&store.productFormat===\"Jewelry\";if(countryCode===\"US\"){// Jewelry: December 18th: now < \"2025-12-19T00:00:00Z\"\n// Print Free: December 13th: now < \"2025-12-14T05:00:00Z\"\n// Print Express: December 17th: now < \"2025-12-18T05:00:00Z\"\nif(showJewelry&&now<Date.parse(\"2025-12-19T00:00:00Z\")){variant=\"US Jewelry Exp Closed\";}else if(now<Date.parse(\"2025-12-14T05:00:00Z\")){variant=\"US Print Free Closed\";}else if(now<Date.parse(\"2025-12-18T05:00:00Z\")){variant=\"US Print Exp Closed\";}else if(!showJewelry&&now<Date.parse(\"2025-12-20T00:00:00Z\")){variant=\"US Print Overnight Closed\";}}else if(countryCode===\"GB\"){// Jewelry: December 18th: now < \"2025-12-19T00:00:00Z\"\n// Print Free: December 15th: now < \"2025-12-16T00:00:00Z\"\n// Print Express: December 17th: now < \"2025-12-18T00:00:00Z\"\nif(showJewelry&&now<Date.parse(\"2025-12-19T00:00:00Z\")){variant=\"UK Jewelry Exp Closed\";}else if(now<Date.parse(\"2025-12-16T00:00:00Z\")){variant=\"UK Print Free Closed\";}else if(now<Date.parse(\"2025-12-18T00:00:00Z\")){variant=\"UK Print Exp Closed\";}}else if(countryCode===\"CA\"){// Jewelry: December 18th: now < \"2025-12-19T00:00:00Z\"\n// Print Free: December 10th: now < \"2025-12-11T00:00:00Z\" // Could be UK or CA lab, so UK midnight\n// Print Express: December 12th: now < \"2025-12-13T00:00:00Z\" // Could be UK or CA lab, so UK midnight\nif(showJewelry&&now<Date.parse(\"2025-12-19T00:00:00Z\")){variant=\"CA Jewelry Exp Closed\";}else if(now<Date.parse(\"2025-12-11T00:00:00Z\")){variant=\"CA Print Free Closed\";}else if(now<Date.parse(\"2025-12-13T00:00:00Z\")){variant=\"CA Print Exp Closed\";}}else if(countryCode===\"AU\"){// Jewelry: December 15th: now < \"2025-12-16T00:00:00Z\"\n// Print Free: December 10th: now < \"2025-12-09T13:00:00Z\"\n// Print Express: December 11th: now < \"2025-12-10T13:00:00Z\"\nif(showJewelry&&now<Date.parse(\"2025-12-16T00:00:00Z\")){variant=\"AU Jewelry Exp Closed\";}else if(now<Date.parse(\"2025-12-09T13:00:00Z\")){variant=\"AU Print Free Closed\";}else if(now<Date.parse(\"2025-12-10T13:00:00Z\")){variant=\"AU Print Exp Closed\";}}else if(territoryCountriesEu.includes(countryCode)){// Jewelry: December 20th: now < \"2025-12-21T00:00:00Z\"\n// Print Free: December 5th: now < \"2025-12-04T23:00:00Z\"\n// Print Express: December 14th: now < \"2025-12-13T23:00:00Z\"\nif(showJewelry&&now<Date.parse(\"2025-12-21T00:00:00Z\")){variant=\"EU Jewelry Exp Closed\";}else if(now<Date.parse(\"2025-12-04T23:00:00Z\")){variant=\"EU Print Free Closed\";}else if(now<Date.parse(\"2025-12-13T23:00:00Z\")){variant=\"EU Print Exp Closed\";}}}}catch(e){}setShowVariant(variant);},[countryCode,store.pageLoaded,store.productFormat,store.jewelrySize,store.jewelryMaterial,store.jewelryBezelMount,store.jewelryPiece]);return showVariant===\"None\"?null:/*#__PURE__*/_jsx(Component,{...props,variant:showVariant});};}export function setVariantForProductPageXmasDeliveryGuarantee(Component,isProductPage=false){return setXmasDeliveryGuaranteeVariant(Component,true);}export function setVariantForHomepageXmasDeliveryGuarantee(Component,isProductPage=false){return props=>{const[country,_c]=store_Country();const[store,_s]=store_ProductPropsStore();// Get Variant:\nlet variant=\"None\";try{const now=new Date().getTime();const countryCode=(country?.countryCode||\"\").toUpperCase();if(countryCode===\"US\"){// Jewelry: December 18th: now < \"2025-12-19T00:00:00Z\"\n// Print Free: December 13th: now < \"2025-12-14T05:00:00Z\"\n// Print Express: December 17th: now < \"2025-12-18T05:00:00Z\"\nif(now<Date.parse(\"2025-12-13T08:00:00Z\")){variant=\"US Print Free Shipping\";}else if(now<Date.parse(\"2025-12-17T08:00:00Z\")){variant=\"US Last Print Orders\";}else if(now<Date.parse(\"2025-12-20T00:00:00Z\")){// Last order is 5AM, minus 5 hours to submit\nvariant=\"US Last Orders\";}}else if(countryCode===\"GB\"){// Jewelry: December 18th: now < \"2025-12-19T00:00:00Z\"\n// Print Free: December 15th: now < \"2025-12-16T00:00:00Z\"\n// Print Express: December 17th: now < \"2025-12-18T00:00:00Z\"\nif(now<Date.parse(\"2025-12-15T00:00:00Z\")){variant=\"UK Print Free Shipping\";}else if(now<Date.parse(\"2025-12-17T00:00:00Z\")){variant=\"UK Last Print Orders\";}else if(now<Date.parse(\"2025-12-18T00:00:00Z\")){variant=\"UK Last Orders\";}}else if(countryCode===\"CA\"){// Jewelry: December 18th: now < \"2025-12-19T00:00:00Z\"\n// Print Free: December 10th: now < \"2025-12-11T00:00:00Z\" // Could be UK or CA lab, so UK midnight\n// Print Express: December 12th: now < \"2025-12-13T00:00:00Z\" // Could be UK or CA lab, so UK midnight\nif(now<Date.parse(\"2025-12-12T08:00:00Z\")){variant=\"CA Last Print Orders\";}else if(now<Date.parse(\"2025-12-18T08:00:00Z\")){variant=\"CA Last Orders\";}}else if(countryCode===\"AU\"){// Jewelry: December 15th: now < \"2025-12-16T00:00:00Z\"\n// Print Free: December 10th: now < \"2025-12-09T13:00:00Z\"\n// Print Express: December 11th: now < \"2025-12-10T13:00:00Z\"\nif(now<Date.parse(\"2025-12-12T00:00:00Z\")){variant=\"AU Last Print Orders\";}else if(now<Date.parse(\"2025-12-15T00:00:00Z\")){variant=\"AU Last Orders\";}}else if(territoryCountriesEu.includes(countryCode)){// Jewelry: December 20th: now < \"2025-12-21T00:00:00Z\"\n// Print Free: December 5th: now < \"2025-12-04T23:00:00Z\"\n// Print Express: December 14th: now < \"2025-12-13T23:00:00Z\"\nif(now<Date.parse(\"2025-12-12T00:00:00Z\")){variant=\"EU Last Print Orders\";}else if(now<Date.parse(\"2025-12-12T23:00:00Z\")){variant=\"EU Last Orders\";}}}catch(e){}return variant===\"None\"?null:/*#__PURE__*/_jsx(Component,{...props,variant:variant});};}\nexport const __FramerMetadata__ = {\"exports\":{\"setVariantForHomepageXmasDeliveryGuarantee\":{\"type\":\"reactHoc\",\"name\":\"setVariantForHomepageXmasDeliveryGuarantee\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setVariantForProductPageXmasDeliveryGuarantee\":{\"type\":\"reactHoc\",\"name\":\"setVariantForProductPageXmasDeliveryGuarantee\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./useXmasDeliverySetVariant.map"],"mappings":"gPAA4e,SAAS,EAAgC,EAAU,EAAc,GAAM,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAQ,GAAI,GAAe,CAAM,CAAC,EAAM,GAAI,GAAyB,CAAO,GAAa,GAAS,aAAa,IAAI,aAAa,CAAM,CAAC,EAAQ,GAAYA,GAAU,CAAM,CAAC,EAAY,GAAgBA,GAAU,CAmBrX,OAlBta,MAAc,CACd,IAAI,EAAQ,OAAO,GAAG,CAAC,IAAIC,EAAQ,GAAW,EAAM,IAAI,MAAM,CAAC,SAAS,CAAC,GAAG,EAAM,gBAAgB,UAAW,EAAQ,OAAU,CAAiE,IAAM,EAAQ,EAAM,oBAAoB,WAA2B,EAAM,aAAyB,IAAM,EAAW,EAAM,eAAe,WAClU,EAAe,CAAC,GAAS,GAAY,EAAM,iBAAiB,aAC5D,EAAoB,CAAC,GAAS,CAAC,GAAY,EAAM,iBAAiB,cAAc,EAAM,cAAc,OAAO,AAAwG,EAAxG,GAAI,GAAgB,IAAsB,EAAM,KAAK,MAAM,uBAAuB,EAAqC,GAAGA,EAAQ,CAAC,IAAM,EAAI,IAAI,MAAM,CAAC,SAAS,CAAO,EAAY,GAAe,EAAM,gBAAgB,UAAa,IAAc,KAGlW,GAAa,EAAI,KAAK,MAAM,uBAAuB,CAAE,EAAQ,wBAAiC,EAAI,KAAK,MAAM,uBAAuB,CAAE,EAAQ,uBAAgC,EAAI,KAAK,MAAM,uBAAuB,CAAE,EAAQ,sBAA+B,CAAC,GAAa,EAAI,KAAK,MAAM,uBAAuB,GAAE,EAAQ,6BAAsC,IAAc,KAG/W,GAAa,EAAI,KAA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