You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Anime-Girls-Holding-Program.../docs/898-a35ed9c500d9bee9e356.js...

1 line
4.9 KiB

{"version":3,"file":"898-a35ed9c500d9bee9e356.js","mappings":"6ZAgBgBA,EAAAA,EAedC,EACAC,EACAC,GAAAA,IAfEC,EAAAA,EAAAA,MACAC,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,eACAC,EAAAA,EAAAA,IACAC,EAAAA,EAAAA,aAAAA,EAAAA,EACAC,SAAAA,OAAAA,IAAAA,EAAW,GAAAC,EACXC,EAAAA,EAAAA,eACAC,EAAAA,EAAAA,gBAAAA,EAAAA,EACAC,UAAAA,OAAAA,IAAAA,EAAAA,QAAAA,EACGC,GAAAA,EAAAA,EAAAA,GAAAA,EAAAA,GAOHC,EAMEb,EANFa,MACAC,EAKEd,EALFc,OACAC,EAIEf,EAJFe,OACAC,EAGEhB,EAHFgB,OACAC,EAEEjB,EAFFiB,YACiBC,EACflB,EADFU,gBAGIS,EAAWC,KAAKC,UAAUL,GAEhCT,GAAAA,EAAAA,EAAAA,GAAAA,CACEI,UAAAA,EACAF,eAAAA,EACAC,gBAAAA,GACGH,GAGL,IAAMe,EACJC,EAAAA,cAACC,EAAAA,EAAAA,CAAcT,OAAQA,EAAQF,MAAOA,EAAOC,OAAQA,GACnDS,EAAAA,cAACE,EAAAA,GAAAA,EAAAA,EAAAA,GAAAA,IACKC,EAAAA,EAAAA,GACFT,EACAd,EACAY,EACAF,EACAC,EACAI,EACAP,EACAF,KAIJc,EAAAA,cAACI,EAAAA,GAAAA,EAAAA,EAAAA,GAAAA,GACMf,EAAAA,CACLC,MAAOA,EACPC,OAAQA,EACRc,UAAWtB,IACPuB,EAAAA,EAAAA,GACF3B,EACAC,EACAa,EACAf,EACAG,EACAe,EACAd,EACAE,MA2BR,OArBIV,EAAKiC,UAGHC,EAAAA,YACGjC,EAASgC,UAEZhC,EAASgC,QAAUC,EAAAA,WAAoBlC,EAAKiC,UAI9ChC,EAASgC,QAAQE,OAAOV,MAGtBxB,EAASgC,SAAW/B,EAAa+B,QAC7BC,EAAAA,OACAA,EAAAA,SACGT,EAAWzB,EAAKiC,SACzBhC,EAASgC,SAAAA,IAAU,WAKjBjC,EAAKiC,UAEHC,EAAAA,WAEFjC,EAASgC,QAAQE,OAAO,MAExBD,EAAAA,OAAgB,KAAiClC,EAAKiC","sources":["webpack://anime-girls-holding-programming-books/../src/components/lazy-hydrate.tsx"],"sourcesContent":["import React, { MutableRefObject } from \"react\"\nimport ReactDOM from \"react-dom\"\nimport { GatsbyImageProps } from \"./gatsby-image.browser\"\nimport { LayoutWrapper } from \"./layout-wrapper\"\nimport { Placeholder } from \"./placeholder\"\nimport { MainImageProps, MainImage } from \"./main-image\"\nimport { getMainProps, getPlaceholderProps } from \"./hooks\"\nimport { ReactElement } from \"react\"\n\ntype LazyHydrateProps = Omit<GatsbyImageProps, \"as\" | \"style\" | \"className\"> & {\n isLoading: boolean\n isLoaded: boolean // alwaystype SetStateAction<S> = S | ((prevState: S) => S);\n toggleIsLoaded: (toggle: boolean) => void\n ref: MutableRefObject<HTMLImageElement | undefined>\n}\n\nexport function lazyHydrate(\n {\n image,\n loading,\n isLoading,\n isLoaded,\n toggleIsLoaded,\n ref,\n imgClassName,\n imgStyle = {},\n objectPosition,\n backgroundColor,\n objectFit = `cover`,\n ...props\n }: LazyHydrateProps,\n root: MutableRefObject<HTMLElement | undefined>,\n hydrated: MutableRefObject<boolean>,\n forceHydrate: MutableRefObject<boolean>\n): (() => void) | null {\n const {\n width,\n height,\n layout,\n images,\n placeholder,\n backgroundColor: wrapperBackgroundColor,\n } = image\n\n const cacheKey = JSON.stringify(images)\n\n imgStyle = {\n objectFit,\n objectPosition,\n backgroundColor,\n ...imgStyle,\n }\n\n const component = (\n <LayoutWrapper layout={layout} width={width} height={height}>\n <Placeholder\n {...getPlaceholderProps(\n placeholder,\n isLoaded,\n layout,\n width,\n height,\n wrapperBackgroundColor,\n objectFit,\n objectPosition\n )}\n />\n\n <MainImage\n {...(props as Omit<MainImageProps, \"images\" | \"fallback\">)}\n width={width}\n height={height}\n className={imgClassName}\n {...getMainProps(\n isLoading,\n isLoaded,\n images,\n loading,\n toggleIsLoaded,\n cacheKey,\n ref,\n imgStyle\n )}\n />\n </LayoutWrapper>\n )\n\n if (root.current) {\n // Force render to mitigate \"Expected server HTML to contain a matching\" in develop\n // @ts-ignore react 18 typings\n if (ReactDOM.createRoot) {\n if (!hydrated.current) {\n // @ts-ignore react 18 typings\n hydrated.current = ReactDOM.createRoot(root.current)\n }\n\n // @ts-ignore react 18 typings\n hydrated.current.render(component)\n } else {\n const doRender =\n hydrated.current || forceHydrate.current\n ? ReactDOM.render\n : ReactDOM.hydrate\n doRender(component, root.current)\n hydrated.current = true\n }\n }\n\n return (): void => {\n if (root.current) {\n // @ts-ignore react 18 typings\n if (ReactDOM.createRoot) {\n // @ts-ignore react 18 typings\n hydrated.current.render(null)\n } else {\n ReactDOM.render(null as unknown as ReactElement, root.current)\n }\n }\n }\n}\n"],"names":["lazyHydrate","root","hydrated","forceHydrate","image","loading","isLoading","isLoaded","toggleIsLoaded","ref","imgClassName","imgStyle","v","objectPosition","backgroundColor","objectFit","props","width","height","layout","images","placeholder","wrapperBackgroundColor","cacheKey","JSON","stringify","component","React","LayoutWrapper","Placeholder","getPlaceholderProps","MainImage","className","getMainProps","current","ReactDOM","render"],"sourceRoot":""}