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BqB,GAC1BrB,EAA0BsB,IAE3B2B,MAAO,CAAEhC,SAAUA,GAAY,SAE9Bc,GAAWJ,IAA6BD,EACxC,2BAAKa,UAAU,uDACbzB,GAGFA,K,+MCpDL,MAnDkB,EAAGA,SAAAA,EAAUuC,QAAAA,EAAU,QAAStC,MACjD,MAAM,yBAAEY,GAA6BZ,GAC9BuC,EAASC,IAAcC,EAAAA,EAAAA,WAAS,IAyBjC,IAAEC,EAAF,OAAOC,IAAWC,EAAAA,EAAAA,IAAU,IAC5BC,GAAaC,EAAAA,EAAAA,QAAO,MAM1B,OAJAC,EAAAA,EAAAA,YAAU,QAEP,CAACJ,IAGH,2BAAKD,IAAKG,GACT,2BAAKH,IAAKA,EAAKlB,UAAU,wBACxB,oBAAC,EAAD,KACKxB,EADL,CAECgB,WAASuB,IAAWI,GACpB5B,QAjBY,KAEfyB,GAAW,IAgBR1B,OAzBW,KACd,MAAMkC,EAAOH,EAAWI,QACxB,IAAKD,EAAM,OACCA,EAAKE,cAAc,OAC3BC,UAAUC,IAAI,cAsBfvC,WArCe,KAClB,GAAID,EAA0B,CAC7B,MAAMoC,EAAOH,EAAWI,QACxB,IAAKD,EAAM,OACX,MAAMK,EAAUL,EAAKE,cAAc,mBAC7BI,EAAMN,EAAKE,cAAc,OAC/BG,EAAQnB,MAAMqB,QAAU,IACxBD,EAAIH,UAAUK,OAAO,iBAgClBzD","sources":["webpack://wfp-usa/./wp-content/themes/tombras/tailwind/helpers.js","webpack://wfp-usa/./wp-content/themes/tombras/tailwind/jsx-options.js","webpack://wfp-usa/./wp-content/themes/tombras/blocks/components/hero/utils.js","webpack://wfp-usa/./wp-content/themes/tombras/blocks/components/hero/components/HeroV3.jsx","webpack://wfp-usa/./wp-content/themes/tombras/blocks/components/hero/components/Save/Frontend.jsx"],"sourcesContent":["import tailwindConfig from \"./config.json\";\n\nexport let getSpaceLabelFromKey = (key) => {\n\tswitch (key) {\n\t\tcase \"px\":\n\t\t\treturn \"1px\";\n\t\tcase \"-px\":\n\t\t\treturn \"-1px\";\n\t\tcase \"1\":\n\t\tcase \"-1\":\n\t\t\treturn `${key} unit`;\n\t\tdefault:\n\t\t\treturn `${key} units`;\n\t}\n};\n\n/**\n *\n * @param {partial class, such as 'p', 't', 'mb'} prefix\n * @param {The key used to set value, such as '1', 'px', '-px', '64'} key\n */\nexport let mergeSpaceKeyWithClassPrefix = (prefix, key) => {\n\tif (key == \"\") return \"\";\n\tif (key.startsWith(\"-\")) return `-${prefix}-${key.replace(\"-\", \"\")}`;\n\treturn `${prefix}-${key}`;\n};\n\n/**\n *\n * @param {string} size - Will return a human readable version of\n * Tailwind sizes\n *\n * @return {string} - defaults to <size> with first letter capitalized; otherwise,\n * return matching string or special capitalized version\n */\nexport const sizingToHumanReadableWords = (size) => {\n\tswitch (size) {\n\t\tcase \"xs\":\n\t\t\treturn \"Extra Small\";\n\t\tcase \"sm\":\n\t\t\treturn \"Small\";\n\t\tcase \"md\":\n\t\t\treturn \"Medium\";\n\t\tcase \"lg\":\n\t\t\treturn \"Large\";\n\t\tcase \"5xl\":\n\t\tcase \"4xl\":\n\t\tcase \"3xl\":\n\t\tcase \"2xl\":\n\t\tcase \"xl\":\n\t\t\treturn size.toUpperCase();\n\t\tdefault:\n\t\t\treturn `${size.charAt(0).toUpperCase()}${size.slice(1)}`;\n\t}\n};\n\nexport const removeAllBut = (arr) => (key) => arr.includes(key);\n\nexport const flattenNestedCSSClasses = (obj) => {\n\treturn Object.keys(obj).reduce((acc, curr) => {\n\t\tconst isObject = typeof obj[curr] === \"object\";\n\t\tlet items = [];\n\t\tif (isObject) {\n\t\t\titems = Object.keys(obj[curr]).map((key) => `${curr}-${key}`);\n\t\t}\n\t\treturn isObject ? [...acc, ...items] : [...acc, `${curr}`];\n\t}, []);\n};\n\nexport const flattenNestedCSSToObjects = (obj, prefix = \"\") => {\n\treturn Object.keys(obj).reduce((acc, curr) => {\n\t\tconst isObject = typeof obj[curr] === \"object\";\n\t\tlet items = [];\n\t\tif (isObject) {\n\t\t\titems = Object.keys(obj[curr]).map((key) => {\n\t\t\t\treturn {\n\t\t\t\t\tname: `${prefix}${prefix ? \"-\" : \"\"}${curr}-${key}`,\n\t\t\t\t\tcolor: obj[curr][key],\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\treturn isObject\n\t\t\t? [...acc, ...items]\n\t\t\t: [...acc, { name: `${curr}`, color: obj[curr] }];\n\t}, []);\n};\n\nexport let config = tailwindConfig;\nexport let spacing = tailwindConfig.spacing;\n// produces the values for both neg and positive spacing\nexport let space = {\n\t...spacing,\n\t...Object.keys(spacing).reduce(\n\t\t(negSpace, key) => ({ ...negSpace, [`-${key}`]: `-${spacing[key]}` }),\n\t\t{}\n\t),\n};\nexport let screens = [\"default\", ...Object.keys(tailwindConfig.screens)];\nexport let borderRadius = tailwindConfig.borderRadius;\nexport let shadows = tailwindConfig.boxShadow;\nexport let borderWidth = tailwindConfig.borderWidth;\nexport let borderColor = tailwindConfig.borderColor;\nexport let backgroundColor = tailwindConfig.backgroundColor;\nexport let colors = tailwindConfig.colorOptions.reduce(\n\t(options, curr) => ({ ...options, [curr.slug]: curr.color }),\n\t{}\n);\nexport let cmsColors = tailwindConfig.colorOptions;\n","/**\n * All of these functions can be immediately used inside of a JSX component\n * as the options array\n */\nimport tailwindCMSOptions from \"./config.json\";\nimport {\n\tcolors,\n\tborderWidth,\n\tborderColor,\n\tborderRadius,\n\tbackgroundColor,\n\tshadows,\n\tremoveAllBut,\n\tflattenNestedCSSToObjects,\n\tsizingToHumanReadableWords,\n\tmergeSpaceKeyWithClassPrefix,\n} from \"./helpers.js\";\n\nconst { __ } = wp.i18n;\n\n/* Hashes */\nexport const colorsObjectToHash = (tailwindDef) => {\n\treturn Object.keys(tailwindDef).reduce((acc, curr) => {\n\t\tif (typeof tailwindDef[curr] === \"object\") {\n\t\t\tObject.keys(tailwindDef[curr]).forEach((key) => {\n\t\t\t\tacc[`${curr}-${key}`] = tailwindDef[curr][key];\n\t\t\t});\n\t\t} else {\n\t\t\tacc[`${curr}`] = tailwindDef[curr];\n\t\t}\n\t\treturn acc;\n\t}, {});\n};\n\nexport const hexToClassHash = (tailwindDef) => {\n\treturn Object.keys(tailwindDef).reduce((acc, curr) => {\n\t\tif (typeof tailwindDef[curr] === \"object\") {\n\t\t\tObject.keys(tailwindDef[curr]).forEach((key) => {\n\t\t\t\tacc[tailwindDef[curr][key]] = `${curr}-${key}`;\n\t\t\t});\n\t\t} else {\n\t\t\tacc[tailwindDef[curr]] = `${curr}`;\n\t\t}\n\t\treturn acc;\n\t}, {});\n};\n\nexport const colorsHash = colorsObjectToHash(colors);\nexport const hexHash = hexToClassHash(colors);\n\n/**\n * Capitalizes the first letter of a string, used\n * mainly when dealing with colors where they are\n * in the form of 'color-500' instead of 'Color-500'\n * @param {string} word\n */\nconst capitalizeFirstLetter = (word) =>\n\t`${word.charAt(0).toUpperCase()}${word.slice(1)}`;\n\nexport const jsxBorderWidth = tailwindCMSOptions.borderWidth.map((key) => ({\n\tlabel: __(`${sizingToHumanReadableWords(key)}`, \"tombras\"),\n\tvalue: mergeSpaceKeyWithClassPrefix(\"border\", key),\n}));\n\nexport const jsxBorderRadius = tailwindCMSOptions.borderRadius.map((key) => ({\n\tlabel: __(`${sizingToHumanReadableWords(key)}`, \"tombras\"),\n\tvalue: mergeSpaceKeyWithClassPrefix(\"rounded\", key),\n}));\n\nexport const jsxBoxShadow = tailwindCMSOptions.boxShadow.map((key) => ({\n\tlabel: __(`${sizingToHumanReadableWords(key)}`, \"tombras\"),\n\tvalue: mergeSpaceKeyWithClassPrefix(\"shadow\", key),\n}));\n\nexport const jsxContentAlignment = [\n\t{ label: __(\"Left\", \"tombras\"), value: \"mr-auto\" },\n\t{ label: __(\"Center\", \"tombras\"), value: \"mx-auto\" },\n\t{ label: __(\"Right\", \"tombras\"), value: \"ml-auto\" },\n];\n\nexport const jsxBorderColorObjectOptions =\n\ttailwindCMSOptions.colorOptions.filter((color) => {\n\t\treturn tailwindCMSOptions.borderColor.includes(color.slug);\n\t});\n\n/* Background Color Related */\nexport const jsxBackgroundColorObjectOptions =\n\ttailwindCMSOptions.colorOptions.filter((color) => {\n\t\treturn tailwindCMSOptions.backgroundColor.includes(color.slug);\n\t});\n\n/* Text Color Related */\nexport const jsxTextColorObjectOptions = tailwindCMSOptions.colorOptions.filter(\n\t(color) => {\n\t\treturn tailwindCMSOptions.textColor.includes(color.slug);\n\t},\n);\n\nexport const jsxDividerColorObjectOptions =\n\ttailwindCMSOptions.colorOptions.filter((color) => {\n\t\treturn tailwindCMSOptions.dividerColor.includes(color.slug);\n\t});\n\nexport const jsxSortColors = (colors) =>\n\tcolors.sort((a, b) => a.color < b.color);\n/**\n * Reduces an obj hash of screen sizes and classes into a string of responsive classes\n * ex:\n * {\n *  \"default\": [\"mt-6\"],\n * \t\"sm\": [\"mt-5\", \"mb-5\"],\n *  \"xl\": [\"mt-10\"]\n *  \"2xl\": \"non-array\"\n * } => \"mt-6 sm:mt-5 sm:mb-5 xl:mt-10 2xl:non-array\"\n */\n\nexport const reduceResponsiveClassHash = (hash, prefix = \"\") => {\n\tif (!hash) {\n\t\tlet hasPrefix = prefix ? \" (prefix\" + prefix + \")\" : \"\";\n\t\tconsole.warn(\n\t\t\t`Provided hash${hasPrefix} is empty and cannot be used for reducing down to classes.`,\n\t\t);\n\t\treturn \"\";\n\t}\n\treturn Object.keys(hash)\n\t\t.reduce((classes, key) => {\n\t\t\tlet hashKey = Array.isArray(hash[key]) ? hash[key] : [hash[key]];\n\t\t\tif (key == \"default\")\n\t\t\t\treturn classes.concat(\n\t\t\t\t\thashKey.filter((c) => !!c && c != \"0\").map((c) => `${prefix}${c}`),\n\t\t\t\t);\n\t\t\treturn classes.concat(\n\t\t\t\thashKey\n\t\t\t\t\t.filter((c) => !!c && c != \"0\")\n\t\t\t\t\t.map((c) => `${key}:${prefix}${c}`),\n\t\t\t);\n\t\t}, [])\n\t\t.join(\" \");\n};\n","export function getAlignmentClass({ alwaysOverlayText, verticalAlignment }) {\n\tif (alwaysOverlayText) return \"\";\n\n\tswitch (verticalAlignment) {\n\t\tcase \"top\":\n\t\t\treturn \"justify-start\";\n\t\tcase \"center\":\n\t\t\treturn \"justify-center\";\n\t\tcase \"bottom\":\n\t\t\treturn \"justify-end\";\n\t\tdefault:\n\t\t\treturn \"\";\n\t}\n}\n","import { reduceResponsiveClassHash } from \"../../../../tailwind/jsx-options\";\nimport classnames from \"classnames\";\nimport ReactPlayer from \"react-player\";\nimport { decipherSource } from \"../../../utils/helper.jsx\";\nimport { getAlignmentClass } from \"../utils\";\n\nexport default ({ children, ...props }) => {\n\tconsole.log(props);\n\tconst {\n\t\tnoAutoplay = false,\n\t\tmaxWidth = \"100%\",\n\t\tfocalPoint,\n\t\timageOverlay,\n\t\tbackgroundImageData = {},\n\t\tmarginClasses,\n\t\tpaddingClasses,\n\t\talwaysOverlayText = false,\n\t\tinnerContentAlignment,\n\t\tverticalAlignment,\n\t\tvideoUrl,\n\t\thasVideo,\n\t\tvideoLoop,\n\t\tvideoHideContentUntilEnd,\n\t\t// stuff specifically for video\n\t\tonVideoEnd = () => console.log(\"Video has ended\"),\n\t\tonPlay = () => console.log(\"Video began playing\"),\n\t\tonReady = () => console.log(\"Video is ready\"),\n\t\tplaying = false,\n\t} = props;\n\tconsole.log(\"bg image\", backgroundImageData.url);\n\n\tconst innerContentClasses = [].join(\" \");\n\n\tconst imageStyles = {\n\t\tobjectPosition: `${focalPoint.x * 100}% ${focalPoint.y * 100}%`,\n\t};\n\n\tconst source = decipherSource(videoUrl).url;\n\n\tconsole.log(\"the source\", source);\n\t// todo: work on getting video in\n\treturn (\n\t\t<div\n\t\t\tclassName={classnames(\n\t\t\t\t\"hero\",\n\t\t\t\t\"relative\",\n\t\t\t\talwaysOverlayText\n\t\t\t\t\t? \"hero--keep-overlaid md:flex md:flex-col\"\n\t\t\t\t\t: \"md:flex md:flex-col\",\n\t\t\t\t!alwaysOverlayText ? innerContentAlignment : innerContentAlignment,\n\t\t\t\tgetAlignmentClass(props),\n\t\t\t)}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classnames(\n\t\t\t\t\t\"hero--image\",\n\t\t\t\t\talwaysOverlayText ? \"\" : \"hero--image-not-full\",\n\t\t\t\t\t// hasVideo ? \"aspect-w-16 aspect-h-9\" : \"\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<span data-image-id={backgroundImageData.id}></span>\n\t\t\t\t{/* only put this in if we're going to have video */}\n\t\t\t\t{hasVideo ? (\n\t\t\t\t\t<ReactPlayer\n\t\t\t\t\t\tclassName=\"absolute h-full w-full inset-0 object-cover overflow-hidden\"\n\t\t\t\t\t\turl={source}\n\t\t\t\t\t\twidth=\"100%\"\n\t\t\t\t\t\theight=\"100%\"\n\t\t\t\t\t\tcontrols={false}\n\t\t\t\t\t\tplaying={playing}\n\t\t\t\t\t\tmuted={true}\n\t\t\t\t\t\tloop={videoLoop}\n\t\t\t\t\t\tonReady={onReady}\n\t\t\t\t\t\tonEnded={onVideoEnd}\n\t\t\t\t\t\tonPlay={onPlay}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<img\n\t\t\t\t\tclassName=\"absolute h-full w-full inset-0 object-cover duration-75 transition-opacity\"\n\t\t\t\t\tstyle={imageStyles}\n\t\t\t\t\tsrc={backgroundImageData.url}\n\t\t\t\t\talt=\"\"\n\t\t\t\t/>\n\n\t\t\t\t{imageOverlay > 0 && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{ background: `rgba(0, 0, 0, ${imageOverlay / 100})`}\n\t\t\t\t\t}\n\t\t\t\t\t\tclassName=\"absolute inset-0\"\n\t\t\t\t\t></div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName={classnames(\n\t\t\t\t\t\"hero--content\",\n\t\t\t\t\t// \"mx-auto\",\n\t\t\t\t\t\"relative\",\n\t\t\t\t\treduceResponsiveClassHash(marginClasses),\n\t\t\t\t\treduceResponsiveClassHash(paddingClasses),\n\t\t\t\t)}\n\t\t\t\tstyle={{ maxWidth: maxWidth || \"100%\" }}\n\t\t\t>\n\t\t\t\t{playing && videoHideContentUntilEnd && !videoLoop ? (\n\t\t\t\t\t<div className=\"hidden-content opacity-0 duration-75 transition-all\">\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\tchildren\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n","import { useEffect, useRef, useState } from \"react\";\nimport { useInView } from \"react-intersection-observer\";\nimport Hero from \"../HeroV3.jsx\";\n\nconst VideoHero = ({ children, onClick = null, ...props }) => {\n\tconst { videoHideContentUntilEnd } = props;\n\tconst [isReady, setIsReady] = useState(false);\n\n\tconsole.log(\"da props\", props);\n\tconst onVideoEnd = () => {\n\t\tif (videoHideContentUntilEnd) {\n\t\t\tconst hero = contentRef.current;\n\t\t\tif (!hero) return;\n\t\t\tconst content = hero.querySelector(\".hidden-content\");\n\t\t\tconst img = hero.querySelector(\"img\");\n\t\t\tcontent.style.opacity = \"1\";\n\t\t\timg.classList.remove(\"opacity-0\");\n\t\t}\n\t};\n\n\tconst onPlay = () => {\n\t\tconst hero = contentRef.current;\n\t\tif (!hero) return;\n\t\tconst img = hero.querySelector(\"img\");\n\t\timg.classList.add(\"opacity-0\");\n\t};\n\n\tconst onReady = () => {\n\t\tconsole.log(\"video is ready\");\n\t\tsetIsReady(true);\n\t};\n\tconst { ref, inView } = useInView(0.2);\n\tconst contentRef = useRef(null);\n\n\tuseEffect(() => {\n\t\tconsole.log(\"video is in view?\", inView, ref?.current);\n\t}, [inView]);\n\n\treturn (\n\t\t<div ref={contentRef}>\n\t\t\t<div ref={ref} className=\"gutenberg-video-hero\">\n\t\t\t\t<Hero\n\t\t\t\t\t{...props}\n\t\t\t\t\tplaying={isReady && inView ? true : false}\n\t\t\t\t\tonReady={onReady}\n\t\t\t\t\tonPlay={onPlay}\n\t\t\t\t\tonVideoEnd={onVideoEnd}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Hero>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default VideoHero;\n"],"names":["mergeSpaceKeyWithClassPrefix","prefix","key","startsWith","replace","sizingToHumanReadableWords","size","toUpperCase","charAt","slice","spacing","tailwindConfig","colors","Object","keys","reduce","negSpace","options","curr","slug","color","__","wp","i18n","tailwindDef","acc","forEach","hexToClassHash","tailwindCMSOptions","label","value","reduceResponsiveClassHash","hash","classes","hashKey","Array","isArray","concat","filter","c","map","join","getAlignmentClass","alwaysOverlayText","verticalAlignment","children","props","noAutoplay","maxWidth","focalPoint","imageOverlay","backgroundImageData","marginClasses","paddingClasses","innerContentAlignment","videoUrl","hasVideo","videoLoop","videoHideContentUntilEnd","onVideoEnd","onPlay","onReady","playing","imageStyles","objectPosition","x","y","source","decipherSource","url","className","classnames","data-image-id","id","width","height","controls","muted","loop","onEnded","style","src","alt","background","onClick","isReady","setIsReady","useState","ref","inView","useInView","contentRef","useRef","useEffect","hero","current","querySelector","classList","add","content","img","opacity","remove"],"sourceRoot":""}