text: import e,{Fragment as t,forwardRef as a,useRef as i,useState as r,useEffect as n}from"react";import{stripIndent as o}from"common-tags";import s from"camelcase";import l,{string as d,bool as c,exact as u,arrayOf as h,oneOfType as g}from"prop-types";function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e}).apply(this,arguments)}function m(e,t){if(null==e)return{};var a,i,r={},n=Object.keys(e);for(i=0;i<n.length;i++)t.indexOf(a=n[i])>=0||(r[a]=e[a]);return r}let f,w=e=>e;const y=[.25,.5,1,2],b=[750,1080,1366,1920],v=[320,654,768,1024,1366,1600,1920,2048,2560,3440,3840,4096],E=e=>console.warn(e),M=(e,t)=>e-t,S=e=>e.map(e=>`${e.src} ${e.width}w`).join(",\n");function k(e){const t=e.lastIndexOf(".");if(-1!==t){const a=e.substr(t+1);if("jpeg"===a)return"jpg";if(3===a.length||4===a.length)return a}}function j(e){let{layout:t="constrained",width:a,height:i,sourceMetadata:r,breakpoints:n,aspectRatio:o,formats:l=["auto","webp"]}=e;return l=l.map(e=>e.toLowerCase()),t=s(t),a&&i?p({},e,{formats:l,layout:t}):(r.width&&r.height&&!o&&(o=r.width/r.height),"fullWidth"===t?(a=a||r.width||n[n.length-1],i=i||Math.round(a/(o||1.3333333333333333))):(a||(a=i&&o?i*o:r.width?r.width:i?Math.round(i/1.3333333333333333):800),o&&!i?i=Math.round(a/o):o||(o=a/i)),p({},e,{width:a,height:i,aspectRatio:o,layout:t,formats:l}))}function $(e,t=20){var a;e=j(e);const{generateImageSource:i,filename:r,aspectRatio:n}=e;return null==(a=i(r,t,Math.round(t/n),e.sourceMetadata.format||"jpg",e.fit,e.options))?void 0:a.src}function _(e){e=j(e);let{pluginName:t,sourceMetadata:a,generateImageSource:i,layout:r,fit:n,options:s,width:l,height:d,filename:c,reporter:u={warn:E},backgroundColor:h,placeholderURL:g}=e;if(t||u.warn('[gatsby-plugin-image] "generateImageData" was not passed a plugin name'),"function"!=typeof i)throw new Error("generateImageSource must be a function");var m;a&&(a.width||a.height)?a.format||(a.format=k(c)):a={width:l,height:d,format:(null==(m=a)?void 0:m.format)||k(c)||"auto"};const v=new Set(e.formats);(0===v.size||v.has("auto")||v.has(""))&&(v.delete("auto"),v.delete(""),v.add(a.format)),v.has("jpg")&&v.has("png")&&(u.warn(`[${t}] Specifying both 'jpg' and 'png' formats is not supported. Using 'auto' instead`),v.delete("jpg"===a.format?"png":"jpg"));const M=function(e){const{width:t,height:a,filename:i,layout:r="constrained",sourceMetadata:n,reporter:s={warn:E},breakpoints:l=b}=e,d=Object.entries({width:t,height:a}).filter(([e,t])=>"number"==typeof t&&t<1);if(d.length)throw new Error(`Specified dimensions for images must be positive numbers (> 0). Problem dimensions you have are ${d.map(e=>e.join(": ")).join(", ")}`);return"fixed"===r?function({filename:e,sourceMetadata:t,width:a,height:i,fit:r="cover",outputPixelDensities:n=y,reporter:s={warn:E}}){let l=t.width/t.height;const d=I(n);if(a&&i){const e=N(t,{width:a,height:i,fit:r});a=e.width,i=e.height,l=e.aspectRatio}a?i||(i=Math.round(a/l)):a=i?Math.round(i*l):800;const c=a;if(t.width<a||t.height<i){const r=t.width<a?"width":"height";s.warn(o(f||(f=w`
      The requested ${0} "${0}px" for the image ${0} was larger than the actual image ${0} of ${0}px. If possible, replace the current image with a larger one.`),r,"width"===r?a:i,e,r,t[r])),"width"===r?(a=t.width,i=Math.round(a/l)):a=(i=t.height)*l}return{sizes:d.filter(e=>e>=1).map(e=>Math.round(e*a)).filter(e=>e<=t.width),aspectRatio:l,presentationWidth:c,presentationHeight:Math.round(c/l),unscaledWidth:a}}(e):"constrained"===r?x(e):"fullWidth"===r?x(p({breakpoints:l},e)):(s.warn(`No valid layout was provided for the image at ${i}. Valid image layouts are fixed, fullWidth, and constrained. Found ${r}`),{sizes:[n.width],presentationWidth:n.width,presentationHeight:n.height,aspectRatio:n.width/n.height,unscaledWidth:n.width})}(p({},e,{sourceMetadata:a})),$={sources:[]};let _=e.sizes;_||(_=((e,t)=>{switch(t){case"constrained":return`(min-width: ${e}px) ${e}px, 100vw`;case"fixed":return`${e}px`;case"fullWidth":return"100vw";default:return}})(M.presentationWidth,r)),v.forEach(e=>{const a=M.sizes.map(a=>{const r=i(c,a,Math.round(a/M.aspectRatio),e,n,s);if(null!=r&&r.width&&r.height&&r.src&&r.format)return r;u.warn(`[${t}] The resolver for image ${c} returned an invalid value.`)}).filter(Boolean);if("jpg"===e||"png"===e||"auto"===e){const e=a.find(e=>e.width===M.unscaledWidth)||a[0];e&&($.fallback={src:e.src,srcSet:S(a),sizes:_})}else{var r;null==(r=$.sources)||r.push({srcSet:S(a),sizes:_,type:`image/${e}`})}});const O={images:$,layout:r,backgroundColor:h};switch(g&&(O.placeholder={fallback:g}),r){case"fixed":O.width=M.presentationWidth,O.height=M.presentationHeight;break;case"fullWidth":O.width=1,O.height=1/M.aspectRatio;break;case"constrained":O.width=e.width||M.presentationWidth||1,O.height=(O.width||1)/M.aspectRatio}return O}const I=e=>Array.from(new Set([1,...e])).sort(M);function x({sourceMetadata:e,width:t,height:a,fit:i="cover",outputPixelDensities:r=y,breakpoints:n,layout:o}){let s,l=e.width/e.height;const d=I(r);if(t&&a){const r=N(e,{width:t,height:a,fit:i});t=r.width,a=r.height,l=r.aspectRatio}t=t&&Math.min(t,e.width),a=a&&Math.min(a,e.height),t||a||(a=(t=Math.min(800,e.width))/l),t||(t=a*l);const c=t;return(e.width<t||e.height<a)&&(t=e.width,a=e.height),t=Math.round(t),(null==n?void 0:n.length)>0?(s=n.filter(t=>t<=e.width),s.length<n.length&&!s.includes(e.width)&&s.push(e.width)):(s=d.map(e=>Math.round(e*t)),s=s.filter(t=>t<=e.width)),"constrained"!==o||s.includes(t)||s.push(t),s=s.sort(M),{sizes:s,aspectRatio:l,presentationWidth:c,presentationHeight:Math.round(c/l),unscaledWidth:t}}function N(e,t){const a=e.width/e.height;let i=t.width,r=t.height;switch(t.fit){case"fill":i=t.width?t.width:e.width,r=t.height?t.height:e.height;break;case"inside":{const e=t.width?t.width:Number.MAX_SAFE_INTEGER,n=t.height?t.height:Number.MAX_SAFE_INTEGER;i=Math.min(e,Math.round(n*a)),r=Math.min(n,Math.round(e/a));break}case"outside":{const e=t.width?t.width:0,n=t.height?t.height:0;i=Math.max(e,Math.round(n*a)),r=Math.max(n,Math.round(e/a));break}default:t.width&&!t.height&&(i=t.width,r=Math.round(t.width/a)),t.height&&!t.width&&(i=Math.round(t.height*a),r=t.height)}return{width:i,height:r,aspectRatio:i/r}}const O=new Set,R=()=>"undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;function W(e){e&&O.add(e)}function L(e){return O.has(e)}const T=e=>{var t;return(e=>{var t,a;return Boolean(null==e||null==(t=e.images)||null==(a=t.fallback)?void 0:a.src)})(e)?e:(e=>Boolean(null==e?void 0:e.gatsbyImageData))(e)?e.gatsbyImageData:null==e||null==(t=e.childImageSharp)?void 0:t.gatsbyImageData},z=e=>{var t,a,i;return null==(t=T(e))||null==(a=t.images)||null==(i=a.fallback)?void 0:i.src},A=e=>{var t,a,i;return null==(t=T(e))||null==(a=t.images)||null==(i=a.fallback)?void 0:i.srcSet};function G(e){var t;let{baseUrl:a,urlBuilder:i,sourceWidth:r,sourceHeight:n,pluginName:o="getImageData",formats:s=["auto"],breakpoints:l,options:d}=e,c=m(e,["baseUrl","urlBuilder","sourceWidth","sourceHeight","pluginName","formats","breakpoints","options"]);return null!=(t=l)&&t.length||"fullWidth"!==c.layout&&"FULL_WIDTH"!==c.layout||(l=v),_(p({},c,{pluginName:o,generateImageSource:(e,t,a,r)=>({width:t,height:a,format:r,src:i({baseUrl:e,width:t,height:a,options:d,format:r})}),filename:a,formats:s,breakpoints:l,sourceMetadata:{width:r,height:n,format:"auto"}}))}function q(e,t,a,i,r,n,o,s={}){var l,d;return null!=o&&o.current&&!("objectFit"in document.documentElement.style)&&(o.current.dataset.objectFit=null!=(l=s.objectFit)?l:"cover",o.current.dataset.objectPosition=`${null!=(d=s.objectPosition)?d:"50% 50%"}`,async function(e){"objectFitPolyfill"in window||await import("objectFitPolyfill"),window.objectFitPolyfill(e.current)}(o)),global.GATSBY___IMAGE||(s=p({height:"100%",left:0,position:"absolute",top:0,transform:"translateZ(0)",transition:"opacity 250ms linear",width:"100%",willChange:"opacity"},s)),p({},a,{loading:i,shouldLoad:e,"data-main-image":"",style:p({},s,{opacity:t?1:0}),onLoad:function(e){if(t)return;W(n);const a=e.currentTarget,i=new Image;i.src=a.currentSrc,i.decode?i.decode().catch(()=>{}).then(()=>{r(!0)}):r(!0)},ref:o})}function C(e,t,a,i,r,n){const o={};n&&(o.backgroundColor=n,"fixed"===a?(o.width=i,o.height=r,o.backgroundColor=n,o.position="relative"):("constrained"===a||"fullWidth"===a)&&(o.position="absolute",o.top=0,o.left=0,o.bottom=0,o.right=0));const s=p({},e,{"aria-hidden":!0,"data-placeholder-image":"",style:p({opacity:t?0:1,transition:"opacity 500ms linear"},o)});return global.GATSBY___IMAGE||(s.style={height:"100%",left:0,position:"absolute",top:0,width:"100%"}),s}function D(e,t){const{images:a,placeholder:i}=e,r=p({},m(e,["images","placeholder"]),{images:p({},a,{sources:[]}),placeholder:i&&p({},i,{sources:[]})});var n;return t.forEach(({media:t,image:a})=>{t?(a.layout!==e.layout&&"development"===process.env.NODE_ENV&&console.warn(`[gatsby-plugin-image] Mismatched image layout: expected "${e.layout}" but received "${a.layout}". All art-directed images use the same layout as the default image`),r.images.sources.push(...a.images.sources.map(e=>p({},e,{media:t})),{media:t,srcSet:a.images.fallback.srcSet}),r.placeholder&&r.placeholder.sources.push({media:t,srcSet:a.placeholder.fallback})):"development"===process.env.NODE_ENV&&console.warn("[gatsby-plugin-image] All art-directed images passed to must have a value set for `media`. Skipping.")}),r.images.sources.push(...a.sources),null!=i&&i.sources&&(null==(n=r.placeholder)||n.sources.push(...i.sources)),r}const P=function({layout:a,width:i,height:r,children:n}){let o=null;return"fullWidth"===a&&(o=e.createElement("div",{"aria-hidden":!0,style:{paddingTop:r/i*100+"%"}})),"constrained"===a&&(o=e.createElement("div",{style:{maxWidth:i,display:"block"}},e.createElement("img",{alt:"",role:"presentation","aria-hidden":"true",src:`data:image/svg+xml;charset=utf-8,%3Csvg height='${r}' width='${i}' xmlns='http://www.w3.org/2000/svg' version='1.1'%3E%3C/svg%3E`,style:{maxWidth:"100%",display:"block",position:"static"}}))),e.createElement(t,null,o,n,!1)},H=function(t){let{src:a,srcSet:i,loading:r,alt:n="",shouldLoad:o,innerRef:s}=t,l=m(t,["src","srcSet","loading","alt","shouldLoad","innerRef"]);return e.createElement("img",Object.assign({},l,{decoding:"async",loading:r,src:o?a:void 0,"data-src":o?void 0:a,srcSet:o?i:void 0,"data-srcset":o?void 0:i,alt:n,ref:s}))},B=a(function(t,a){let{fallback:i,sources:r=[],shouldLoad:n=!0}=t,o=m(t,["fallback","sources","shouldLoad"]);const s=o.sizes||(null==i?void 0:i.sizes),l=e.createElement(H,Object.assign({},o,i,{sizes:s,shouldLoad:n,innerRef:a}));return r.length?e.createElement("picture",null,r.map(({media:t,srcSet:a,type:i})=>e.createElement("source",{key:`${t}-${i}-${a}`,type:i,media:t,srcSet:a,sizes:s})),l):l});var F;H.propTypes={src:d.isRequired,alt:d.isRequired,sizes:d,srcSet:d,shouldLoad:c},B.displayName="Picture",B.propTypes={alt:d.isRequired,shouldLoad:c,fallback:u({src:d.isRequired,srcSet:d,sizes:d}),sources:h(g([u({media:d.isRequired,type:d,sizes:d,srcSet:d.isRequired}),u({media:d,type:d.isRequired,sizes:d,srcSet:d.isRequired})]))};const V=function(t){let{fallback:a}=t,i=m(t,["fallback"]);return a?e.createElement(B,Object.assign({},i,{fallback:{src:a},"aria-hidden":!0,alt:""})):e.createElement("div",Object.assign({},i))};V.displayName="Placeholder",V.propTypes={fallback:d,sources:null==(F=B.propTypes)?void 0:F.sources,alt:function(e,t,a){return e[t]?new Error(`Invalid prop \`${t}\` supplied to \`${a}\`. Validation failed.`):null}};const Y=a(function(t,a){return e.createElement(e.Fragment,null,e.createElement(B,Object.assign({ref:a},t)),e.createElement("noscript",null,e.createElement(B,Object.assign({},t,{shouldLoad:!0}))))});Y.displayName="MainImage",Y.propTypes=B.propTypes;const U=(e,t,a,...i)=>e.alt||""===e.alt?l.string(e,t,a,...i):new Error(`The "alt" prop is required in ${a}. If the image is purely presentational then pass an empty string: e.g. alt="". Learn more: https://a11y-style-guide.com/style-guide/section-media.html`);let J=!1;const X=function(t){let{as:a="div",style:o,className:s,class:l,onStartLoad:d,image:c,onLoad:u,backgroundColor:h,loading:g="lazy"}=t,f=m(t,["as","style","className","class","onStartLoad","image","onLoad","backgroundColor","loading"]);if(!c)return"development"===process.env.NODE_ENV&&console.warn("[gatsby-plugin-image] Missing image prop"),null;l&&(s=l);const{width:w,height:y,layout:b,images:v}=c,E=i(),M=i(!1),S=i(null),k=i(null),j=i(),[$,_]=r(R()),[I,x]=r(!1);global.GATSBY___IMAGE||J||(J=!0,console.warn('[gatsby-plugin-image] You\'re missing out on some cool performance features. Please add "gatsby-plugin-image" to your gatsby-config.js'));const N=function(e,t,a){const i={};let r="gatsby-image-wrapper";return global.GATSBY___IMAGE||(i.position="relative",i.overflow="hidden"),"fixed"===a?(i.width=e,i.height=t):"constrained"===a&&(global.GATSBY___IMAGE||(i.display="inline-block"),r="gatsby-image-wrapper gatsby-image-wrapper-constrained"),{className:r,"data-gatsby-image-wrapper":"",style:i}}(w,y,b),{style:O,className:L}=N,T=m(N,["style","className"]);n(()=>{if(E.current){const e=E.current.querySelector("[data-gatsby-image-ssr]");if(R()&&e&&global.GATSBY___IMAGE)return null==d||d({wasCached:!1}),void(e.complete?(null==u||u(),W(JSON.stringify(v))):e.addEventListener("load",function t(){e.removeEventListener("load",t),null==u||u(),W(JSON.stringify(v))}));import("./intersection-observer-1b2d7fcb.js").then(({createIntersectionObserver:e})=>{const t=e(()=>{E.current&&(null==d||d({wasCached:!1}),_(!0))});E.current&&(S.current=t(E))})}return()=>{S.current&&(S.current(E),M.current&&k.current&&k.current())}},[]),n(()=>{if(E.current){const e=E.current.querySelector("[data-gatsby-image-ssr]");if(R()&&e&&!M.current)return void(M.current=!0);import("./lazy-hydrate-40bf4dfe.js").then(({lazyHydrate:e})=>{k.current=e(p({image:c,isLoading:$,isLoaded:I,toggleIsLoaded:()=>{null==u||u(),x(!0)},ref:j,loading:g},f),E,M)})}},[w,y,b,v,$,I,x,j,f]);const z=function(e,t,a){let i=null;return"fullWidth"===e&&(i=`<div aria-hidden="true" style="padding-top: ${a/t*100}%;"></div>`),"constrained"===e&&(i=`<div style="max-width: ${t}px; display: block;"><img alt="" role="presentation" aria-hidden="true" src="data:image/svg+xml;charset=utf-8,%3Csvg height='${a}' width='${t}' xmlns='http://www.w3.org/2000/svg' version='1.1'%3E%3C/svg%3E" style="max-width: 100%; display: block; position: static;"></div>`),i}(b,w,y);return e.createElement(a,Object.assign({},T,{style:p({},O,o,{backgroundColor:h}),className:`${L}${s?` ${s}`:""}`,ref:E,dangerouslySetInnerHTML:{__html:z},suppressHydrationWarning:!0}))},Z=function(t){return e.createElement(X,Object.assign({},t))};Z.propTypes={image:l.object.isRequired,alt:U},Z.displayName="GatsbyImage";const K=(e,t,...a)=>"fullWidth"!==e.layout||"width"!==t&&"height"!==t||!e[t]?l.number(e,t,...a):new Error(`"${t}" ${e[t]} may not be passed when layout is fullWidth.`),Q=new Set(["fixed","fullWidth","constrained"]),ee={src:l.string.isRequired,alt:U,width:K,height:K,sizes:l.string,layout:e=>{if(void 0!==e.layout&&!Q.has(e.layout))return new Error(`Invalid value ${e.layout}" provided for prop "layout". Defaulting to "constrained". Valid values are "fixed", "fullWidth" or "constrained".`)}},te=function(t){return function(a){let{src:i,__imageData:r,__error:n}=a,o=m(a,["src","__imageData","__error","width","height","aspectRatio","tracedSVGOptions","placeholder","formats","quality","transformOptions","jpgOptions","pngOptions","webpOptions","avifOptions","blurredOptions"]);return n&&console.warn(n),r?e.createElement(t,Object.assign({image:r},o)):(console.warn("Image not loaded",i),n||"development"!==process.env.NODE_ENV||console.warn('Please ensure that "gatsby-plugin-image" is included in the plugins array in gatsby-config.js, and that your version of gatsby is at least 2.24.78'),null)}}(Z);function ae({children:e}){return n(()=>{import("./lazy-hydrate-40bf4dfe.js")},[]),e}te.displayName="StaticImage",te.propTypes=ee;export{Z as G,P as L,Y as M,V as P,te as S,m as _,L as a,p as b,q as c,ae as d,T as e,z as f,C as g,R as h,A as i,G as j,_ as k,$ as l,D as w};
  //# sourceMappingURL=index.browser-f71c3fab.js.map
  