{"version":3,"file":"Frameship.Co4oeE91.mjs","names":["useState","FrameshipUpgradeBanner"],"sources":["https:/framerusercontent.com/modules/1kPVCHEEg0BrtObiM14s/tMfCOzlhvRKnksP8sgzC/Frameship.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{createPortal}from\"react-dom\";import{useEffect,useState}from\"react\";import{hasFrameshipAccess,parseFrameshipData,useCartStore,useCartValidationOnReturn}from\"https://framerusercontent.com/modules/ibjYTPLnMMPhPLNCj4uG/FkITfeSZPOAgcIAyLyDi/Cart.js\";import{UPGRADE_LINK}from\"https://framerusercontent.com/modules/gd3dcT3w5rYoRy7ZcKte/sH6FZizM8jJ11j2dQOhQ/Shared.js\";import FrameshipUpgradeBanner from\"https://framerusercontent.com/modules/b6p2QQlcwhhLAA5Operm/erpgLSZm2BuxCMM1NCPK/LOQtD1uPa.js\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */export default function Frameship(props){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[portalContainer,setPortalContainer]=useState(null);const initializeCart=useCartStore(state=>state.initializeCart);useCartValidationOnReturn();useEffect(()=>{initializeCart?.();},[]);const attributes={};let stagingDomain=\"\";let productionDomain=\"\";if(props.frameshipData){attributes[\"data-frameship-id\"]=props.frameshipData;const frameshipData=parseFrameshipData(props.frameshipData);stagingDomain=frameshipData.stagingDomain;productionDomain=frameshipData.productionDomain;}else{attributes[\"data-frameship-component\"]=true;if(props.shopUrl){attributes[\"data-shop-url\"]=props.shopUrl;}if(props.shopifyAccessToken){attributes[\"data-shopify-access-token\"]=props.shopifyAccessToken;}if(props.productionDomain){attributes[\"data-production-domain\"]=props.productionDomain;}if(props.stagingDomain){attributes[\"data-staging-domain\"]=props.stagingDomain;}stagingDomain=props.stagingDomain;productionDomain=props.productionDomain;}const hasAccess=hasFrameshipAccess(stagingDomain,productionDomain);useEffect(()=>{if(!isCanvas){const container=document.createElement(\"div\");document.body.appendChild(container);setPortalContainer(container);return()=>{document.body.removeChild(container);};}},[]);return /*#__PURE__*/_jsx(\"div\",{...attributes,children:!isCanvas&&portalContainer&&!hasAccess&&/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",left:20,bottom:20},children:/*#__PURE__*/_jsx(FrameshipUpgradeBanner,{link:UPGRADE_LINK})}),portalContainer)});}Frameship.displayName=\"Frameship (Shopify)\";addPropertyControls(Frameship,{frameshipData:{type:ControlType.String,defaultValue:\"\",preventLocalization:true,hidden:()=>true},shopUrl:{type:ControlType.String,defaultValue:\"\",title:\"Shop URL\",preventLocalization:true,hidden:()=>true},shopifyAccessToken:{type:ControlType.String,defaultValue:\"\",preventLocalization:true,hidden:()=>true},productionDomain:{type:ControlType.String,defaultValue:\"\",preventLocalization:true,hidden:()=>true},stagingDomain:{type:ControlType.String,defaultValue:\"\",preventLocalization:true,hidden:()=>true},note:{type:ControlType.Enum,options:[\"IMPORTANT\"],displaySegmentedControl:true,description:\"*Do not delete this component.*\\n\\nThis component is managed by the [Frameship plugin](https://framer.link/L3dGFQc)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Frameship\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Frameship.map"],"mappings":"wUAIG,SAAwB,EAAU,EAAM,CAAC,IAAM,EAAS,EAAa,SAAS,GAAG,EAAa,OAAY,CAAC,EAAgB,GAAoBA,EAAS,KAAK,CAAO,EAAe,EAAa,GAAO,EAAM,eAAe,CAAC,GAA2B,CAAC,MAAc,CAAC,KAAkB,EAAG,EAAE,CAAC,CAAC,IAAM,EAAW,EAAE,CAAK,EAAc,GAAO,EAAiB,GAAG,G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