{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/aFxgcRN1U8OOQcaOyEIy/yNL6u8VOrkI9QnIVhHlm/Remote_image.js"],
  "sourcesContent": ["// Welcome to Code in Framer\n// Get Started: https://www.framer.com/docs/guides/\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport { useState } from \"react\"; /**\n                                  * These annotations control how your component sizes\n                                  * Learn more: https://www.framer.com/docs/guides/auto-sizing\n                                  *\n                                  * @framerSupportedLayoutWidth auto\n                                  * @framerSupportedLayoutHeight auto\n                                  */\nexport default function Remote_image(props) {\n  // This is a React component containing an Example component\n  // - Replace <Example /> with your own code\n  // - Find inspiration: https://www.framer.com/developers/\n  const imgSource = prepare(props.image, props.slug, props.routeSlugs, props.folder, props.useThumbnail);\n  const [imageError, setImageError] = useState(false);\n  const handleImageError = () => {\n    setImageError(true);\n  };\n  const [loading, setLoading] = useState(true);\n  const onLoaded = () => {\n    setLoading(false);\n  };\n  const spinnerStyle = {\n    border: \"3px solid #f3f3f300\",\n    borderTop: \"3px solid #BBBBBB\",\n    borderRadius: \"50%\",\n    width: \"40px\",\n    height: \"40px\",\n    animation: loading ? \"spin 1s linear infinite\" : \"none\",\n    marginTop: \"-40px\",\n    position: \"absolute\",\n    top: \"50%\",\n    left: \"50%\"\n  };\n  const spinnerAnimation = `\n    @keyframes spin {\n      0% {\n        transform: rotate(0deg);\n      }\n      100% {\n        transform: rotate(360deg);\n      }\n    }\n  `;\n  return /*#__PURE__*/_jsxs(\"div\", {\n    style: {\n      width: props.width == \"\" ? \"auto\" : props.width,\n      height: props.height == \"\" ? \"auto\" : props.height,\n      objectFit: \"contain\",\n      display: \"flex\",\n      flexWrap: \"wrap\",\n      justifyContent: \"center\",\n      alignItems: \"center\",\n      overflow: \"hidden\"\n    },\n    children: [/*#__PURE__*/_jsxs(\"div\", {\n      children: [/*#__PURE__*/_jsx(\"style\", {\n        children: spinnerAnimation\n      }), /*#__PURE__*/_jsx(\"div\", {\n        style: {\n          display: loading ? \"block\" : \"none\"\n        },\n        children: /*#__PURE__*/_jsx(\"div\", {\n          style: spinnerStyle\n        })\n      })]\n    }), /*#__PURE__*/_jsx(\"img\", {\n      src: imgSource,\n      onError: handleImageError,\n      onLoad: onLoaded,\n      style: {\n        width: props.width == \"\" ? \"auto\" : props.width,\n        height: \"100%\",\n        borderRadius: props.roundCorners ? \"25px\" : \"0px\",\n        objectFit: \"contain\",\n        opacity: loading ? 0 : imageError ? 0 : 1\n      }\n    })]\n  });\n}\n;\nfunction prepare(link, _slug, routeSlugs, folder, useThumbnail) {\n  var slug = _slug;\n  if (slug == \"\") {\n    slug = routeSlugs.slice(1, -1).split(\",\")[0].trim();\n  }\n  const urlParts = link.split(\"/\");\n  const filenameWithExtension = urlParts[urlParts.length - 1];\n  const filenameParts = filenameWithExtension.split(\".\");\n  const extension = filenameParts.pop();\n  let filename = filenameParts.join(\".\");\n  const hasRegularSuffix = filename.endsWith(\"_regular\");\n  if (hasRegularSuffix) {\n    filename = filename.slice(0, -8);\n  }\n  const postfix = useThumbnail ? \"_thumbnail\" : \"_regular\";\n  filename += postfix;\n  const folderPath = folder == \"\" ? \"\" : folder + \"/\";\n  return `https://ingry.s3.eu-west-1.amazonaws.com/${folderPath}${slug}/${filename}.jpg`;\n}\naddPropertyControls(Remote_image, {\n  image: {\n    type: ControlType.String\n  },\n  height: {\n    type: ControlType.String\n  },\n  width: {\n    type: ControlType.String\n  },\n  slug: {\n    type: ControlType.String\n  },\n  routeSlugs: {\n    type: ControlType.String\n  },\n  folder: {\n    type: ControlType.String\n  },\n  useThumbnail: {\n    type: ControlType.Boolean\n  },\n  roundCorners: {\n    type: ControlType.Boolean\n  }\n}); // Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle = {\n  height: \"100%\",\n  display: \"flex\",\n  flexWrap: \"wrap\",\n  justifyContent: \"center\",\n  alignItems: \"center\",\n  overflow: \"hidden\"\n};\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"default\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"Remote_image\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerSupportedLayoutWidth\": \"auto\",\n        \"framerContractVersion\": \"1\",\n        \"framerSupportedLayoutHeight\": \"auto\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./Remote_image.map"],
  "mappings": "yIAWe,SAARA,EAA8BC,EAAO,CAI1C,IAAMC,EAAYC,EAAQF,EAAM,MAAOA,EAAM,KAAMA,EAAM,WAAYA,EAAM,OAAQA,EAAM,YAAY,EAC/F,CAACG,EAAYC,CAAa,EAAIC,EAAS,EAAK,EAC5CC,EAAmB,IAAM,CAC7BF,EAAc,EAAI,CACpB,EACM,CAACG,EAASC,CAAU,EAAIH,EAAS,EAAI,EACrCI,EAAW,IAAM,CACrBD,EAAW,EAAK,CAClB,EACME,EAAe,CACnB,OAAQ,sBACR,UAAW,oBACX,aAAc,MACd,MAAO,OACP,OAAQ,OACR,UAAWH,EAAU,0BAA4B,OACjD,UAAW,QACX,SAAU,WACV,IAAK,MACL,KAAM,KACR,EACMI,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUzB,OAAoBC,EAAM,MAAO,CAC/B,MAAO,CACL,MAAOZ,EAAM,OAAS,GAAK,OAASA,EAAM,MAC1C,OAAQA,EAAM,QAAU,GAAK,OAASA,EAAM,OAC5C,UAAW,UACX,QAAS,OACT,SAAU,OACV,eAAgB,SAChB,WAAY,SACZ,SAAU,QACZ,EACA,SAAU,CAAcY,EAAM,MAAO,CACnC,SAAU,CAAcC,EAAK,QAAS,CACpC,SAAUF,CACZ,CAAC,EAAgBE,EAAK,MAAO,CAC3B,MAAO,CACL,QAASN,EAAU,QAAU,MAC/B,EACA,SAAuBM,EAAK,MAAO,CACjC,MAAOH,CACT,CAAC,CACH,CAAC,CAAC,CACJ,CAAC,EAAgBG,EAAK,MAAO,CAC3B,IAAKZ,EACL,QAASK,EACT,OAAQG,EACR,MAAO,CACL,MAAOT,EAAM,OAAS,GAAK,OAASA,EAAM,MAC1C,OAAQ,OACR,aAAcA,EAAM,aAAe,OAAS,MAC5C,UAAW,UACX,QAASO,GAAcJ,EAAJ,EAAqB,CAC1C,CACF,CAAC,CAAC,CACJ,CAAC,CACH,CAEA,SAASD,EAAQY,EAAMC,EAAOC,EAAYC,EAAQC,EAAc,CAC9D,IAAIC,EAAOJ,EACPI,GAAQ,KACVA,EAAOH,EAAW,MAAM,EAAG,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,GAEpD,IAAMI,EAAWN,EAAK,MAAM,GAAG,EAEzBO,EADwBD,EAASA,EAAS,OAAS,CAAC,EACd,MAAM,GAAG,EAC/CE,EAAYD,EAAc,IAAI,EAChCE,EAAWF,EAAc,KAAK,GAAG,EAErC,OADyBE,EAAS,SAAS,UAAU,IAEnDA,EAAWA,EAAS,MAAM,EAAG,EAAE,GAGjCA,GADgBL,EAAe,aAAe,WAGvC,4CADYD,GAAU,GAAK,GAAKA,EAAS,MACgBE,KAAQI,OAC1E,CACAC,EAAoBzB,EAAc,CAChC,MAAO,CACL,KAAM0B,EAAY,MACpB,EACA,OAAQ,CACN,KAAMA,EAAY,MACpB,EACA,MAAO,CACL,KAAMA,EAAY,MACpB,EACA,KAAM,CACJ,KAAMA,EAAY,MACpB,EACA,WAAY,CACV,KAAMA,EAAY,MACpB,EACA,OAAQ,CACN,KAAMA,EAAY,MACpB,EACA,aAAc,CACZ,KAAMA,EAAY,OACpB,EACA,aAAc,CACZ,KAAMA,EAAY,OACpB,CACF,CAAC",
  "names": ["Remote_image", "props", "imgSource", "prepare", "imageError", "setImageError", "ye", "handleImageError", "loading", "setLoading", "onLoaded", "spinnerStyle", "spinnerAnimation", "u", "p", "link", "_slug", "routeSlugs", "folder", "useThumbnail", "slug", "urlParts", "filenameParts", "extension", "filename", "addPropertyControls", "ControlType"]
}
