{"version":3,"sources":["webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/extends.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/inheritsLoose.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/interopRequireWildcard.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack://knight-hacks-club-site/./node_modules/@babel/runtime/helpers/typeof.js","webpack://knight-hacks-club-site/./node_modules/@mikaelkristiansson/domready/ready.js","webpack://knight-hacks-club-site/./node_modules/@gatsbyjs/reach-router/lib/history.js","webpack://knight-hacks-club-site/./node_modules/@gatsbyjs/reach-router/lib/utils.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/TemplateTag/TemplateTag.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/inlineArrayTransformer/inlineArrayTransformer.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/stripIndentTransformer/stripIndentTransformer.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/trimResultTransformer/trimResultTransformer.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/splitStringTransformer/splitStringTransformer.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/commaLists/commaLists.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/commaListsAnd/commaListsAnd.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/commaListsOr/commaListsOr.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/removeNonPrintingValuesTransformer/removeNonPrintingValuesTransformer.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/replaceSubstitutionTransformer/replaceSubstitutionTransformer.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/html/html.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/replaceResultTransformer/replaceResultTransformer.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/safeHtml/safeHtml.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/oneLine/oneLine.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/oneLineTrim/oneLineTrim.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/oneLineCommaLists/oneLineCommaLists.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/oneLineCommaListsOr/oneLineCommaListsOr.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/oneLineCommaListsAnd/oneLineCommaListsAnd.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/inlineLists/inlineLists.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/oneLineInlineLists/oneLineInlineLists.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/stripIndent/stripIndent.js","webpack://knight-hacks-club-site/./node_modules/common-tags/es/stripIndents/stripIndents.js","webpack://knight-hacks-club-site/./node_modules/gatsby/dist/internal-plugins/bundle-optimisations/polyfills/object-assign.js","webpack://knight-hacks-club-site/./node_modules/gatsby-link/index.js","webpack://knight-hacks-club-site/./node_modules/gatsby-link/parse-path.js","webpack://knight-hacks-club-site/./node_modules/gatsby-react-router-scroll/index.js","webpack://knight-hacks-club-site/./node_modules/gatsby-react-router-scroll/scroll-handler.js","webpack://knight-hacks-club-site/./node_modules/gatsby-react-router-scroll/session-storage.js","webpack://knight-hacks-club-site/./node_modules/gatsby-react-router-scroll/use-scroll-restoration.js","webpack://knight-hacks-club-site/./.cache/_this_is_virtual_fs_path_/$virtual/async-requires.js","webpack://knight-hacks-club-site/./.cache/api-runner-browser-plugins.js","webpack://knight-hacks-club-site/./.cache/api-runner-browser.js","webpack://knight-hacks-club-site/./node_modules/mitt/dist/mitt.es.js","webpack://knight-hacks-club-site/./.cache/emitter.js","webpack://knight-hacks-club-site/./.cache/normalize-page-path.js","webpack://knight-hacks-club-site/./.cache/find-path.js","webpack://knight-hacks-club-site/./.cache/gatsby-browser-entry.js","webpack://knight-hacks-club-site/./.cache/prefetch.js","webpack://knight-hacks-club-site/./.cache/loader.js","webpack://knight-hacks-club-site/./.cache/page-renderer.js","webpack://knight-hacks-club-site/./.cache/route-announcer-props.js","webpack://knight-hacks-club-site/./.cache/navigation.js","webpack://knight-hacks-club-site/./node_modules/shallow-compare/es/index.js","webpack://knight-hacks-club-site/./.cache/ensure-resources.js","webpack://knight-hacks-club-site/./.cache/production-app.js","webpack://knight-hacks-club-site/./.cache/public-page-renderer-prod.js","webpack://knight-hacks-club-site/./.cache/public-page-renderer.js","webpack://knight-hacks-club-site/./.cache/react-lifecycles-compat.js","webpack://knight-hacks-club-site/./.cache/register-service-worker.js","webpack://knight-hacks-club-site/./.cache/strip-prefix.js","webpack://knight-hacks-club-site/../src/image-utils.ts","webpack://knight-hacks-club-site/../src/components/hooks.ts","webpack://knight-hacks-club-site/../src/components/layout-wrapper.tsx","webpack://knight-hacks-club-site/../src/components/picture.tsx","webpack://knight-hacks-club-site/../src/components/placeholder.tsx","webpack://knight-hacks-club-site/../src/components/main-image.tsx","webpack://knight-hacks-club-site/../src/components/gatsby-image.server.tsx","webpack://knight-hacks-club-site/../src/components/gatsby-image.browser.tsx","webpack://knight-hacks-club-site/../src/components/static-image.server.tsx","webpack://knight-hacks-club-site/../src/components/static-image.tsx","webpack://knight-hacks-club-site/../src/components/later-hydrator.tsx","webpack://knight-hacks-club-site/./node_modules/gatsby-plugin-image/gatsby-browser.js","webpack://knight-hacks-club-site/./node_modules/gatsby-plugin-image/node_modules/camelcase/index.js","webpack://knight-hacks-club-site/./node_modules/@gatsbyjs/reach-router/es/lib/utils.js","webpack://knight-hacks-club-site/./node_modules/@gatsbyjs/reach-router/es/lib/history.js","webpack://knight-hacks-club-site/./node_modules/@gatsbyjs/reach-router/es/index.js","webpack://knight-hacks-club-site/./node_modules/invariant/browser.js"],"names":["module","exports","self","ReferenceError","__esModule","_arrayLikeToArray","arr","len","length","i","arr2","Array","_setPrototypeOf","o","p","Object","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","prototype","create","constructor","_iterableToArray","iter","Symbol","iterator","from","_toConsumableArray","isArray","arrayLikeToArray","iterableToArray","unsupportedIterableToArray","TypeError","_unsupportedIterableToArray","minLen","n","toString","call","slice","name","test","_extends","assign","target","arguments","source","key","hasOwnProperty","apply","this","obj","_typeof","_getRequireWildcardCache","WeakMap","cache","has","get","newObj","hasPropertyDescriptor","defineProperty","getOwnPropertyDescriptor","desc","set","excluded","sourceKeys","keys","indexOf","ie10","navigator","appVersion","listener","fns","doc","document","hack","documentElement","doScroll","domContentLoaded","loaded","readyState","addEventListener","removeEventListener","shift","fn","setTimeout","push","definition","getLocation","_source$location","location","search","hash","href","origin","protocol","host","hostname","port","pathname","canUseDOM","URL","encodeURI","decodeURI","state","history","createHistory","options","listeners","transitioning","resolveTransition","_onTransitionComplete","listen","popstateListener","action","filter","navigate","to","_ref","undefined","_ref$replace","replace","go","Date","now","replaceState","pushState","e","transition","Promise","res","forEach","createMemorySource","initialPath","searchIndex","initialLocation","substr","index","stack","states","_","uri","_uri$split","split","_uri$split$","_uri$split2","_uri$split2$","newIndex","window","createElement","globalHistory","shallowCompare","validateRedirect","insertParams","resolve","match","pick","startsWith","_invariant","_invariant2","default","string","routes","default_","uriPathname","uriSegments","segmentize","isRootUri","ranked","rankRoutes","l","missed","route","params","routeSegments","path","max","Math","routeSegment","uriSegment","isSplat","map","decodeURIComponent","join","dynamicMatch","paramRe","exec","reservedNames","value","isDynamic","segment","rankRoute","score","reduce","isRootSegment","SEGMENT_POINTS","sort","a","b","addQuery","_len","query","_key","q","base","_to$split","toPathname","toQuery","basePathname","toSegments","baseSegments","concat","allSegments","segments","pop","_path$split","pathBase","_path$split$","constructedPath","_params$location","_params$location$sear","searchSplit","obj1","obj2","obj1Keys","every","strings","raw","_createClass","defineProperties","props","descriptor","enumerable","configurable","writable","Constructor","protoProps","staticProps","_templateObject","freeze","_classCallCheck","instance","TemplateTag","_this","transformers","tag","_len2","expressions","_key2","interimTag","bind","transformEndResult","transformString","processSubstitutions","transformer","previousTag","template","_len3","substitutions","_key3","resultSoFar","remainingPart","substitution","transformSubstitution","str","transform","onString","onSubstitution","endResult","onEndResult","defaults","separator","conjunction","serial","opts","arrayLength","indent","separatorIndex","lastIndexOf","type","min","el","regexp","RegExp","Error","side","trim","toLowerCase","splitBy","includes","isValidValue","x","Number","isNaN","replaceWhat","replaceWith","_interopRequireDefault","_objectWithoutPropertiesLoose2","_assertThisInitialized2","_inheritsLoose2","_extends2","_propTypes","_react","_reachRouter","_utils","_parsePath","parsePath","isAbsolutePath","withPrefix","prefix","_prefix","getGlobalBasePrefix","isLocalLink","getGlobalPathPrefix","endsWith","rewriteLinkPath","relativeTo","current","absolutify","NavLinkPropTypes","activeClassName","activeStyle","object","partiallyActive","bool","GatsbyLinkLocationWrapper","Location","_ref2","GatsbyLink","_location","_React$Component","defaultGetProps","_ref3","isPartiallyCurrent","isCurrent","className","Boolean","style","IOSupported","IntersectionObserver","handleRef","_proto","_prefetch","currentPath","rewrittenPath","newPathName","___loader","enqueue","componentDidUpdate","prevProps","prevState","componentDidMount","componentWillUnmount","io","_this$io","unobserve","disconnect","ref","cb","_this2","innerRef","entries","entry","isIntersecting","intersectionRatio","observe","render","_this3","_this$props","_this$props$getProps","getProps","_onClick","onClick","_onMouseEnter","onMouseEnter","rest","prefixedTo","Link","hovering","button","defaultPrevented","metaKey","altKey","ctrlKey","shiftKey","preventDefault","shouldReplace","___navigate","Component","propTypes","func","isRequired","_default","forwardRef","hashIndex","_scrollHandler","ScrollHandler","useScrollRestoration","_interopRequireWildcard","ScrollContext","React","_sessionStorage","createContext","SessionStorage","displayName","args","_stateStorage","_isTicking","_latestKnownScrollY","scrollListener","scrollY","requestAnimationFrame","_saveScroll","windowScroll","position","shouldUpdateScroll","scrollTo","scrollToHash","node","getElementById","substring","scrollIntoView","prevRouterProps","routerProps","save","scrollPosition","_this$props$location","read","_this$props$location2","Provider","children","element","GATSBY_ROUTER_SCROLL_STATE","stateKey","getStateKey","sessionStorage","getItem","JSON","parse","storedValue","stringify","setItem","stateKeyBase","identifier","useLocation","useContext","useRef","useLayoutEffect","onScroll","scrollTop","components","plugin","require","plugins","getResourceURLsForPathname","loadPage","loadPageSync","api","defaultReturn","argTransform","results","result","previous","next","then","all","on","handler","off","splice","emit","evt","mitt","charAt","pathCache","Map","matchPaths","trimPathname","rawPathname","stripPrefix","__BASE_PATH__","setMatchPaths","findMatchPath","trimmedPathname","cleanPath","pickPaths","matchPath","originalPath","normalizePagePath","grabMatchParams","findPath","foundPath","StaticQueryContext","loader","supportedPrefetchStrategy","feature","fakeLink","relList","supports","err","support","url","reject","link","setAttribute","onload","onerror","getElementsByTagName","getElementsByName","parentNode","appendChild","req","XMLHttpRequest","open","status","send","preFetched","catch","PageResourceStatus","Success","preferDefault","m","createPageDataUrl","s","stripSurroundingSlashes","doFetch","method","onreadystatechange","toPageResources","pageData","component","page","componentChunkName","webpackCompilationHash","staticQueryHashes","json","BaseLoader","loadComponent","inFlightNetworkRequests","pageDb","inFlightDb","staticQueryDb","pageDataDb","prefetchTriggered","Set","prefetchCompleted","memoizedGet","inFlightPromise","response","delete","setApiRunner","apiRunner","prefetchDisabled","some","fetchPageDataJson","loadObj","pagePath","retries","responseText","jsonPayload","payload","notFound","loadPageDataJson","rawPath","error","loadAppData","allData","finalResult","componentChunkPromise","pageResources","createdAt","staticQueryBatchPromise","staticQueryHash","staticQueryResults","staticQueryResultsMap","emitter","withErrorDetails","shouldPrefetch","connection","effectiveType","saveData","doesConnectionSupportPrefetch","prefetch","add","realPath","doPrefetch","pageDataUrl","prefetchHelper","crossOrigin","as","createComponentUrls","isPageNotFound","appData","___chunkMapping","chunk","__PATH_PREFIX__","ProdLoader","asyncRequires","chunkName","componentUrls","data","setLoader","_loader","publicLoader","getStaticQueryResults","PageRenderer","pageContext","__params","pageElement","RouteAnnouncerProps","id","top","width","height","padding","overflow","clip","whiteSpace","border","redirectMap","redirectIgnoreCaseMap","maybeRedirect","redirect","___replace","toPath","redirects","ignoreCase","fromPath","onPreRouteUpdate","prevLocation","onRouteUpdate","___swUpdated","timeoutId","clearTimeout","___webpackCompilationHash","serviceWorker","controller","postMessage","gatsbyApi","reachNavigate","getSavedScrollPosition","RouteAnnouncer","announcementRef","nextProps","pageName","title","pageHeadings","querySelectorAll","textContent","newAnnouncement","innerText","compareLocationProps","nextLocation","RouteUpdates","shouldComponentUpdate","shallowDiffers","_i","getDerivedStateFromProps","loadResources","setState","nextState","___emitter","___push","apiRunnerAsync","RouteHandler","BaseContext","baseuri","basepath","DataContext","GatsbyRoot","LocationHandler","Consumer","Router","browserLoc","message","console","SiteRoot","App","renderer","ReactDOM","domReady","InternalPageRenderer","register","reg","installingWorker","installing","log","___failedResources","reload","imageCache","hasNativeLazyLoadSupport","HTMLImageElement","storeImageloaded","cacheKey","hasImageLoaded","getImage","images","fallback","src","gatsbyImageData","childImageSharp","format","getMainProps","isLoading","isLoaded","loading","toggleLoaded","dataset","objectFit","objectPosition","objectFitPolyfill","import","shouldLoad","data-main-image","opacity","onLoad","currentTarget","img","Image","currentSrc","decode","getPlaceholderProps","placeholder","layout","backgroundColor","wrapperStyle","left","bottom","right","aria-hidden","data-placeholder-image","LayoutWrapper","sizer","paddingTop","maxWidth","display","alt","role","Fragment","srcSet","decoding","Picture","sources","sizes","fallbackImage","media","PropTypes","Placeholder","propName","componentName","MainImage","altValidator","GatsbyImageHydrator","Type","preactClass","onStartLoad","image","customOnLoad","warn","root","hydrated","unobserveRef","lazyHydrator","useState","toggleIsLoading","toggleIsLoaded","data-gatsby-image-wrapper","wStyle","wClass","wrapperProps","useEffect","hasSSRHtml","querySelector","wasCached","complete","intersectionObserver","createIntersectionObserver","lazyHydrate","dangerouslySetInnerHTML","__html","suppressHydrationWarning","GatsbyImage","checkDimensionProps","validLayouts","StaticImage","GatsbyImageBrowser","imageData","__imageData","__error","LaterHydrator","wrapRootElement","camelCase","input","pascalCase","toUpperCase","isLastCharLower","isLastCharUpper","isLastLastCharUpper","character","preserveCamelCase","p1","_objectWithoutProperties","_possibleConstructorReturn","_inherits","createNamedContext","defaultValue","Ctx","LocationContext","context","LocationProvider","_temp","getContext","refs","unlisten","_props$history","componentDidCatch","info","isRedirect","_navigate","unmounted","defaultProps","ServerLocation","baseContext","locationContext","RouterImpl","_React$PureComponent","_props","_navigate2","primary","_props$component","domProps","array","child","createRoute","clone","FocusWrapper","FocusHandler","FocusContext","requestFocus","FocusHandlerImpl","initialRender","focusHandlerCount","_React$Component2","_temp2","_this4","shouldFocus","focus","myURIChanged","navigatedUpToMe","contains","activeElement","_this5","_props2","_props2$component","Comp","outline","tabIndex","k","C","_ref4","_ref5","_ref6","_props$getProps","anchorProps","encodedHref","event","shouldNavigate","_location$state","restState","RedirectRequest","redirectTo","RedirectImpl","_React$Component3","_props3","_props3$replace","noThrow","resolvedTo","_props4","Redirect","_ref7","Match","_ref8","_ref9","_ref10","resolvedPath","useNavigate","useParams","useMatch","stripSlashes","elementPath","condition","c","d","f","argIndex","framesToPop"],"mappings":";oHAQAA,EAAOC,QARP,SAAgCC,GAC9B,QAAa,IAATA,EACF,MAAM,IAAIC,eAAe,6DAG3B,OAAOD,GAITF,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AAOmP,EACP/Q,QAAS+Q,EAAQzM,MAAMtE,QACvBe,KAAMgQ,EAAQzM,MAAMwM,SAAW0c,GAAazsB,GAAQ,KAAOA,KAK7DmrB,GAAiB,SAAwBD,GAC3C,OAAQA,EAAMre,kBAAqC,IAAjBqe,EAAMte,UAAkBse,EAAMpe,SAAWoe,EAAMne,QAAUme,EAAMle,SAAWke,EAAMje,Y,8BC/oBpHjY,EAAOC,QA5BS,SAAS03B,EAAW7L,EAAQxf,EAAGC,EAAGqrB,EAAGC,EAAG7vB,EAAG8vB,GAOzD,IAAKH,EAAW,CACd,IAAItU,EACJ,QAAe7b,IAAXskB,EACFzI,EAAQ,IAAIxR,MACV,qIAGG,CACL,IAAIyH,EAAO,CAAChN,EAAGC,EAAGqrB,EAAGC,EAAG7vB,EAAG8vB,GACvBC,EAAW,GACf1U,EAAQ,IAAIxR,MACVia,EAAOpkB,QAAQ,OAAO,WAAa,OAAO4R,EAAKye,UAE3Ct1B,KAAO,sBAIf,MADA4gB,EAAM2U,YAAc,EACd3U,M","file":"app-31a54dd9fbf76459e9ee.js","sourcesContent":["function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inheritsLoose;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nmodule.exports = _interopRequireDefault;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","var _typeof = require(\"@babel/runtime/helpers/typeof\")[\"default\"];\n\nfunction _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n}\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n \"default\": obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj[\"default\"] = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n}\n\nmodule.exports = _interopRequireWildcard;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","/*!\n * domready (c) Dustin Diaz 2014 - License MIT\n * ie10 fix - Mikael Kristiansson 2019\n */\n!(function(name, definition) {\n if (typeof module != \"undefined\") module.exports = definition();\n else if (typeof define == \"function\" && typeof define.amd == \"object\")\n define(definition);\n else this[name] = definition();\n})(\"domready\", function() {\n var ie10 = false;\n if (navigator.appVersion.indexOf(\"MSIE 10\") !== -1) {\n ie10 = true;\n }\n\n var fns = [],\n listener,\n doc = typeof document === \"object\" && document,\n hack = ie10\n ? doc.documentElement.doScroll(\"left\")\n : doc.documentElement.doScroll,\n domContentLoaded = \"DOMContentLoaded\",\n loaded =\n doc && (hack ? /^loaded|^c/ : /^loaded|^i|^c/).test(doc.readyState);\n\n if (!loaded && doc)\n doc.addEventListener(\n domContentLoaded,\n (listener = function() {\n doc.removeEventListener(domContentLoaded, listener);\n loaded = 1;\n while ((listener = fns.shift())) listener();\n })\n );\n\n return function(fn) {\n loaded ? setTimeout(fn, 0) : fns.push(fn);\n };\n});\n","\"use strict\";\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar getLocation = function getLocation(source) {\n var _source$location = source.location,\n search = _source$location.search,\n hash = _source$location.hash,\n href = _source$location.href,\n origin = _source$location.origin,\n protocol = _source$location.protocol,\n host = _source$location.host,\n hostname = _source$location.hostname,\n port = _source$location.port;\n var pathname = source.location.pathname;\n\n if (!pathname && href && canUseDOM) {\n var url = new URL(href);\n pathname = url.pathname;\n }\n\n return {\n pathname: encodeURI(decodeURI(pathname)),\n search: search,\n hash: hash,\n href: href,\n origin: origin,\n protocol: protocol,\n host: host,\n hostname: hostname,\n port: port,\n state: source.history.state,\n key: source.history.state && source.history.state.key || \"initial\"\n };\n};\n\nvar createHistory = function createHistory(source, options) {\n var listeners = [];\n var location = getLocation(source);\n var transitioning = false;\n\n var resolveTransition = function resolveTransition() {};\n\n return {\n get location() {\n return location;\n },\n\n get transitioning() {\n return transitioning;\n },\n\n _onTransitionComplete: function _onTransitionComplete() {\n transitioning = false;\n resolveTransition();\n },\n listen: function listen(listener) {\n listeners.push(listener);\n\n var popstateListener = function popstateListener() {\n location = getLocation(source);\n listener({\n location: location,\n action: \"POP\"\n });\n };\n\n source.addEventListener(\"popstate\", popstateListener);\n return function () {\n source.removeEventListener(\"popstate\", popstateListener);\n listeners = listeners.filter(function (fn) {\n return fn !== listener;\n });\n };\n },\n navigate: function navigate(to) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n state = _ref.state,\n _ref$replace = _ref.replace,\n replace = _ref$replace === undefined ? false : _ref$replace;\n\n if (typeof to === \"number\") {\n source.history.go(to);\n } else {\n state = _extends({}, state, {\n key: Date.now() + \"\"\n }); // try...catch iOS Safari limits to 100 pushState calls\n\n try {\n if (transitioning || replace) {\n source.history.replaceState(state, null, to);\n } else {\n source.history.pushState(state, null, to);\n }\n } catch (e) {\n source.location[replace ? \"replace\" : \"assign\"](to);\n }\n }\n\n location = getLocation(source);\n transitioning = true;\n var transition = new Promise(function (res) {\n return resolveTransition = res;\n });\n listeners.forEach(function (listener) {\n return listener({\n location: location,\n action: \"PUSH\"\n });\n });\n return transition;\n }\n };\n}; ////////////////////////////////////////////////////////////////////////////////\n// Stores history entries in memory for testing or other platforms like Native\n\n\nvar createMemorySource = function createMemorySource() {\n var initialPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"/\";\n var searchIndex = initialPath.indexOf(\"?\");\n var initialLocation = {\n pathname: searchIndex > -1 ? initialPath.substr(0, searchIndex) : initialPath,\n search: searchIndex > -1 ? initialPath.substr(searchIndex) : \"\"\n };\n var index = 0;\n var stack = [initialLocation];\n var states = [null];\n return {\n get location() {\n return stack[index];\n },\n\n addEventListener: function addEventListener(name, fn) {},\n removeEventListener: function removeEventListener(name, fn) {},\n history: {\n get entries() {\n return stack;\n },\n\n get index() {\n return index;\n },\n\n get state() {\n return states[index];\n },\n\n pushState: function pushState(state, _, uri) {\n var _uri$split = uri.split(\"?\"),\n pathname = _uri$split[0],\n _uri$split$ = _uri$split[1],\n search = _uri$split$ === undefined ? \"\" : _uri$split$;\n\n index++;\n stack.push({\n pathname: pathname,\n search: search.length ? \"?\" + search : search\n });\n states.push(state);\n },\n replaceState: function replaceState(state, _, uri) {\n var _uri$split2 = uri.split(\"?\"),\n pathname = _uri$split2[0],\n _uri$split2$ = _uri$split2[1],\n search = _uri$split2$ === undefined ? \"\" : _uri$split2$;\n\n stack[index] = {\n pathname: pathname,\n search: search\n };\n states[index] = state;\n },\n go: function go(to) {\n var newIndex = index + to;\n\n if (newIndex < 0 || newIndex > states.length - 1) {\n return;\n }\n\n index = newIndex;\n }\n }\n };\n}; ////////////////////////////////////////////////////////////////////////////////\n// global history - uses window.history as the source if available, otherwise a\n// memory history\n\n\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\n\nvar getSource = function getSource() {\n return canUseDOM ? window : createMemorySource();\n};\n\nvar globalHistory = createHistory(getSource());\nvar navigate = globalHistory.navigate; ////////////////////////////////////////////////////////////////////////////////\n\nexports.globalHistory = globalHistory;\nexports.navigate = navigate;\nexports.createHistory = createHistory;\nexports.createMemorySource = createMemorySource;","\"use strict\";\n\nexports.__esModule = true;\nexports.shallowCompare = exports.validateRedirect = exports.insertParams = exports.resolve = exports.match = exports.pick = exports.startsWith = undefined;\n\nvar _invariant = require(\"invariant\");\n\nvar _invariant2 = _interopRequireDefault(_invariant);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n} ////////////////////////////////////////////////////////////////////////////////\n// startsWith(string, search) - Check if `string` starts with `search`\n\n\nvar startsWith = function startsWith(string, search) {\n return string.substr(0, search.length) === search;\n}; ////////////////////////////////////////////////////////////////////////////////\n// pick(routes, uri)\n//\n// Ranks and picks the best route to match. Each segment gets the highest\n// amount of points, then the type of segment gets an additional amount of\n// points where\n//\n// static > dynamic > splat > root\n//\n// This way we don't have to worry about the order of our routes, let the\n// computers do it.\n//\n// A route looks like this\n//\n// { path, default, value }\n//\n// And a returned match looks like:\n//\n// { route, params, uri }\n//\n// I know, I should use TypeScript not comments for these types.\n\n\nvar pick = function pick(routes, uri) {\n var match = void 0;\n var default_ = void 0;\n\n var _uri$split = uri.split(\"?\"),\n uriPathname = _uri$split[0];\n\n var uriSegments = segmentize(uriPathname);\n var isRootUri = uriSegments[0] === \"\";\n var ranked = rankRoutes(routes);\n\n for (var i = 0, l = ranked.length; i < l; i++) {\n var missed = false;\n var route = ranked[i].route;\n\n if (route.default) {\n default_ = {\n route: route,\n params: {},\n uri: uri\n };\n continue;\n }\n\n var routeSegments = segmentize(route.path);\n var params = {};\n var max = Math.max(uriSegments.length, routeSegments.length);\n var index = 0;\n\n for (; index < max; index++) {\n var routeSegment = routeSegments[index];\n var uriSegment = uriSegments[index];\n\n if (isSplat(routeSegment)) {\n // Hit a splat, just grab the rest, and return a match\n // uri: /files/documents/work\n // route: /files/*\n var param = routeSegment.slice(1) || \"*\";\n params[param] = uriSegments.slice(index).map(decodeURIComponent).join(\"/\");\n break;\n }\n\n if (uriSegment === undefined) {\n // URI is shorter than the route, no match\n // uri: /users\n // route: /users/:userId\n missed = true;\n break;\n }\n\n var dynamicMatch = paramRe.exec(routeSegment);\n\n if (dynamicMatch && !isRootUri) {\n var matchIsNotReserved = reservedNames.indexOf(dynamicMatch[1]) === -1;\n !matchIsNotReserved ? process.env.NODE_ENV !== \"production\" ? (0, _invariant2.default)(false, \" dynamic segment \\\"\" + dynamicMatch[1] + \"\\\" is a reserved name. Please use a different name in path \\\"\" + route.path + \"\\\".\") : (0, _invariant2.default)(false) : void 0;\n var value = decodeURIComponent(uriSegment);\n params[dynamicMatch[1]] = value;\n } else if (routeSegment !== uriSegment) {\n // Current segments don't match, not dynamic, not splat, so no match\n // uri: /users/123/settings\n // route: /users/:id/profile\n missed = true;\n break;\n }\n }\n\n if (!missed) {\n match = {\n route: route,\n params: params,\n uri: \"/\" + uriSegments.slice(0, index).join(\"/\")\n };\n break;\n }\n }\n\n return match || default_ || null;\n}; ////////////////////////////////////////////////////////////////////////////////\n// match(path, uri) - Matches just one path to a uri, also lol\n\n\nvar match = function match(path, uri) {\n return pick([{\n path: path\n }], uri);\n}; ////////////////////////////////////////////////////////////////////////////////\n// resolve(to, basepath)\n//\n// Resolves URIs as though every path is a directory, no files. Relative URIs\n// in the browser can feel awkward because not only can you be \"in a directory\"\n// you can be \"at a file\", too. For example\n//\n// browserSpecResolve('foo', '/bar/') => /bar/foo\n// browserSpecResolve('foo', '/bar') => /foo\n//\n// But on the command line of a file system, it's not as complicated, you can't\n// `cd` from a file, only directories. This way, links have to know less about\n// their current path. To go deeper you can do this:\n//\n// \n// // instead of\n// \n//\n// Just like `cd`, if you want to go deeper from the command line, you do this:\n//\n// cd deeper\n// # not\n// cd $(pwd)/deeper\n//\n// By treating every path as a directory, linking to relative paths should\n// require less contextual information and (fingers crossed) be more intuitive.\n\n\nvar resolve = function resolve(to, base) {\n // /foo/bar, /baz/qux => /foo/bar\n if (startsWith(to, \"/\")) {\n return to;\n }\n\n var _to$split = to.split(\"?\"),\n toPathname = _to$split[0],\n toQuery = _to$split[1];\n\n var _base$split = base.split(\"?\"),\n basePathname = _base$split[0];\n\n var toSegments = segmentize(toPathname);\n var baseSegments = segmentize(basePathname); // ?a=b, /users?b=c => /users?a=b\n\n if (toSegments[0] === \"\") {\n return addQuery(basePathname, toQuery);\n } // profile, /users/789 => /users/789/profile\n\n\n if (!startsWith(toSegments[0], \".\")) {\n var pathname = baseSegments.concat(toSegments).join(\"/\");\n return addQuery((basePathname === \"/\" ? \"\" : \"/\") + pathname, toQuery);\n } // ./ /users/123 => /users/123\n // ../ /users/123 => /users\n // ../.. /users/123 => /\n // ../../one /a/b/c/d => /a/b/one\n // .././one /a/b/c/d => /a/b/c/one\n\n\n var allSegments = baseSegments.concat(toSegments);\n var segments = [];\n\n for (var i = 0, l = allSegments.length; i < l; i++) {\n var segment = allSegments[i];\n if (segment === \"..\") segments.pop();else if (segment !== \".\") segments.push(segment);\n }\n\n return addQuery(\"/\" + segments.join(\"/\"), toQuery);\n}; ////////////////////////////////////////////////////////////////////////////////\n// insertParams(path, params)\n\n\nvar insertParams = function insertParams(path, params) {\n var _path$split = path.split(\"?\"),\n pathBase = _path$split[0],\n _path$split$ = _path$split[1],\n query = _path$split$ === undefined ? \"\" : _path$split$;\n\n var segments = segmentize(pathBase);\n var constructedPath = \"/\" + segments.map(function (segment) {\n var match = paramRe.exec(segment);\n return match ? params[match[1]] : segment;\n }).join(\"/\");\n var _params$location = params.location;\n _params$location = _params$location === undefined ? {} : _params$location;\n var _params$location$sear = _params$location.search,\n search = _params$location$sear === undefined ? \"\" : _params$location$sear;\n var searchSplit = search.split(\"?\")[1] || \"\";\n constructedPath = addQuery(constructedPath, query, searchSplit);\n return constructedPath;\n};\n\nvar validateRedirect = function validateRedirect(from, to) {\n var filter = function filter(segment) {\n return isDynamic(segment);\n };\n\n var fromString = segmentize(from).filter(filter).sort().join(\"/\");\n var toString = segmentize(to).filter(filter).sort().join(\"/\");\n return fromString === toString;\n}; ////////////////////////////////////////////////////////////////////////////////\n// Junk\n\n\nvar paramRe = /^:(.+)/;\nvar SEGMENT_POINTS = 4;\nvar STATIC_POINTS = 3;\nvar DYNAMIC_POINTS = 2;\nvar SPLAT_PENALTY = 1;\nvar ROOT_POINTS = 1;\n\nvar isRootSegment = function isRootSegment(segment) {\n return segment === \"\";\n};\n\nvar isDynamic = function isDynamic(segment) {\n return paramRe.test(segment);\n};\n\nvar isSplat = function isSplat(segment) {\n return segment && segment[0] === \"*\";\n};\n\nvar rankRoute = function rankRoute(route, index) {\n var score = route.default ? 0 : segmentize(route.path).reduce(function (score, segment) {\n score += SEGMENT_POINTS;\n if (isRootSegment(segment)) score += ROOT_POINTS;else if (isDynamic(segment)) score += DYNAMIC_POINTS;else if (isSplat(segment)) score -= SEGMENT_POINTS + SPLAT_PENALTY;else score += STATIC_POINTS;\n return score;\n }, 0);\n return {\n route: route,\n score: score,\n index: index\n };\n};\n\nvar rankRoutes = function rankRoutes(routes) {\n return routes.map(rankRoute).sort(function (a, b) {\n return a.score < b.score ? 1 : a.score > b.score ? -1 : a.index - b.index;\n });\n};\n\nvar segmentize = function segmentize(uri) {\n return uri // strip starting/ending slashes\n .replace(/(^\\/+|\\/+$)/g, \"\").split(\"/\");\n};\n\nvar addQuery = function addQuery(pathname) {\n for (var _len = arguments.length, query = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n query[_key - 1] = arguments[_key];\n }\n\n query = query.filter(function (q) {\n return q && q.length > 0;\n });\n return pathname + (query && query.length > 0 ? \"?\" + query.join(\"&\") : \"\");\n};\n\nvar reservedNames = [\"uri\", \"path\"];\n/**\n * Shallow compares two objects.\n * @param {Object} obj1 The first object to compare.\n * @param {Object} obj2 The second object to compare.\n */\n\nvar shallowCompare = function shallowCompare(obj1, obj2) {\n var obj1Keys = Object.keys(obj1);\n return obj1Keys.length === Object.keys(obj2).length && obj1Keys.every(function (key) {\n return obj2.hasOwnProperty(key) && obj1[key] === obj2[key];\n });\n}; ////////////////////////////////////////////////////////////////////////////////\n\n\nexports.startsWith = startsWith;\nexports.pick = pick;\nexports.match = match;\nexports.resolve = resolve;\nexports.insertParams = insertParams;\nexports.validateRedirect = validateRedirect;\nexports.shallowCompare = shallowCompare;","var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _templateObject = _taggedTemplateLiteral(['', ''], ['', '']);\n\nfunction _taggedTemplateLiteral(strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n/**\n * @class TemplateTag\n * @classdesc Consumes a pipeline of composable transformer plugins and produces a template tag.\n */\n\n\nvar TemplateTag = function () {\n /**\n * constructs a template tag\n * @constructs TemplateTag\n * @param {...Object} [...transformers] - an array or arguments list of transformers\n * @return {Function} - a template tag\n */\n function TemplateTag() {\n var _this = this;\n\n for (var _len = arguments.length, transformers = Array(_len), _key = 0; _key < _len; _key++) {\n transformers[_key] = arguments[_key];\n }\n\n _classCallCheck(this, TemplateTag);\n\n this.tag = function (strings) {\n for (var _len2 = arguments.length, expressions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n expressions[_key2 - 1] = arguments[_key2];\n }\n\n if (typeof strings === 'function') {\n // if the first argument passed is a function, assume it is a template tag and return\n // an intermediary tag that processes the template using the aforementioned tag, passing the\n // result to our tag\n return _this.interimTag.bind(_this, strings);\n }\n\n if (typeof strings === 'string') {\n // if the first argument passed is a string, just transform it\n return _this.transformEndResult(strings);\n } // else, return a transformed end result of processing the template with our tag\n\n\n strings = strings.map(_this.transformString.bind(_this));\n return _this.transformEndResult(strings.reduce(_this.processSubstitutions.bind(_this, expressions)));\n }; // if first argument is an array, extrude it as a list of transformers\n\n\n if (transformers.length > 0 && Array.isArray(transformers[0])) {\n transformers = transformers[0];\n } // if any transformers are functions, this means they are not initiated - automatically initiate them\n\n\n this.transformers = transformers.map(function (transformer) {\n return typeof transformer === 'function' ? transformer() : transformer;\n }); // return an ES2015 template tag\n\n return this.tag;\n }\n /**\n * Applies all transformers to a template literal tagged with this method.\n * If a function is passed as the first argument, assumes the function is a template tag\n * and applies it to the template, returning a template tag.\n * @param {(Function|String|Array)} strings - Either a template tag or an array containing template strings separated by identifier\n * @param {...*} ...expressions - Optional list of substitution values.\n * @return {(String|Function)} - Either an intermediary tag function or the results of processing the template.\n */\n\n\n _createClass(TemplateTag, [{\n key: 'interimTag',\n\n /**\n * An intermediary template tag that receives a template tag and passes the result of calling the template with the received\n * template tag to our own template tag.\n * @param {Function} nextTag - the received template tag\n * @param {Array} template - the template to process\n * @param {...*} ...substitutions - `substitutions` is an array of all substitutions in the template\n * @return {*} - the final processed value\n */\n value: function interimTag(previousTag, template) {\n for (var _len3 = arguments.length, substitutions = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n substitutions[_key3 - 2] = arguments[_key3];\n }\n\n return this.tag(_templateObject, previousTag.apply(undefined, [template].concat(substitutions)));\n }\n /**\n * Performs bulk processing on the tagged template, transforming each substitution and then\n * concatenating the resulting values into a string.\n * @param {Array<*>} substitutions - an array of all remaining substitutions present in this template\n * @param {String} resultSoFar - this iteration's result string so far\n * @param {String} remainingPart - the template chunk after the current substitution\n * @return {String} - the result of joining this iteration's processed substitution with the result\n */\n\n }, {\n key: 'processSubstitutions',\n value: function processSubstitutions(substitutions, resultSoFar, remainingPart) {\n var substitution = this.transformSubstitution(substitutions.shift(), resultSoFar);\n return ''.concat(resultSoFar, substitution, remainingPart);\n }\n /**\n * Iterate through each transformer, applying the transformer's `onString` method to the template\n * strings before all substitutions are processed.\n * @param {String} str - The input string\n * @return {String} - The final results of processing each transformer\n */\n\n }, {\n key: 'transformString',\n value: function transformString(str) {\n var cb = function cb(res, transform) {\n return transform.onString ? transform.onString(res) : res;\n };\n\n return this.transformers.reduce(cb, str);\n }\n /**\n * When a substitution is encountered, iterates through each transformer and applies the transformer's\n * `onSubstitution` method to the substitution.\n * @param {*} substitution - The current substitution\n * @param {String} resultSoFar - The result up to and excluding this substitution.\n * @return {*} - The final result of applying all substitution transformations.\n */\n\n }, {\n key: 'transformSubstitution',\n value: function transformSubstitution(substitution, resultSoFar) {\n var cb = function cb(res, transform) {\n return transform.onSubstitution ? transform.onSubstitution(res, resultSoFar) : res;\n };\n\n return this.transformers.reduce(cb, substitution);\n }\n /**\n * Iterates through each transformer, applying the transformer's `onEndResult` method to the\n * template literal after all substitutions have finished processing.\n * @param {String} endResult - The processed template, just before it is returned from the tag\n * @return {String} - The final results of processing each transformer\n */\n\n }, {\n key: 'transformEndResult',\n value: function transformEndResult(endResult) {\n var cb = function cb(res, transform) {\n return transform.onEndResult ? transform.onEndResult(res) : res;\n };\n\n return this.transformers.reduce(cb, endResult);\n }\n }]);\n\n return TemplateTag;\n}();\n\nexport default TemplateTag;","var defaults = {\n separator: '',\n conjunction: '',\n serial: false\n};\n/**\n * Converts an array substitution to a string containing a list\n * @param {String} [opts.separator = ''] - the character that separates each item\n * @param {String} [opts.conjunction = ''] - replace the last separator with this\n * @param {Boolean} [opts.serial = false] - include the separator before the conjunction? (Oxford comma use-case)\n *\n * @return {Object} - a TemplateTag transformer\n */\n\nvar inlineArrayTransformer = function inlineArrayTransformer() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaults;\n return {\n onSubstitution: function onSubstitution(substitution, resultSoFar) {\n // only operate on arrays\n if (Array.isArray(substitution)) {\n var arrayLength = substitution.length;\n var separator = opts.separator;\n var conjunction = opts.conjunction;\n var serial = opts.serial; // join each item in the array into a string where each item is separated by separator\n // be sure to maintain indentation\n\n var indent = resultSoFar.match(/(\\n?[^\\S\\n]+)$/);\n\n if (indent) {\n substitution = substitution.join(separator + indent[1]);\n } else {\n substitution = substitution.join(separator + ' ');\n } // if conjunction is set, replace the last separator with conjunction, but only if there is more than one substitution\n\n\n if (conjunction && arrayLength > 1) {\n var separatorIndex = substitution.lastIndexOf(separator);\n substitution = substitution.slice(0, separatorIndex) + (serial ? separator : '') + ' ' + conjunction + substitution.slice(separatorIndex + 1);\n }\n }\n\n return substitution;\n }\n };\n};\n\nexport default inlineArrayTransformer;","function _toConsumableArray(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return Array.from(arr);\n }\n}\n/**\n * strips indentation from a template literal\n * @param {String} type = 'initial' - whether to remove all indentation or just leading indentation. can be 'all' or 'initial'\n * @return {Object} - a TemplateTag transformer\n */\n\n\nvar stripIndentTransformer = function stripIndentTransformer() {\n var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'initial';\n return {\n onEndResult: function onEndResult(endResult) {\n if (type === 'initial') {\n // remove the shortest leading indentation from each line\n var match = endResult.match(/^[^\\S\\n]*(?=\\S)/gm);\n var indent = match && Math.min.apply(Math, _toConsumableArray(match.map(function (el) {\n return el.length;\n })));\n\n if (indent) {\n var regexp = new RegExp('^.{' + indent + '}', 'gm');\n return endResult.replace(regexp, '');\n }\n\n return endResult;\n }\n\n if (type === 'all') {\n // remove all indentation from each line\n return endResult.replace(/^[^\\S\\n]+/gm, '');\n }\n\n throw new Error('Unknown type: ' + type);\n }\n };\n};\n\nexport default stripIndentTransformer;","/**\n * TemplateTag transformer that trims whitespace on the end result of a tagged template\n * @param {String} side = '' - The side of the string to trim. Can be 'start' or 'end' (alternatively 'left' or 'right')\n * @return {Object} - a TemplateTag transformer\n */\nvar trimResultTransformer = function trimResultTransformer() {\n var side = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n return {\n onEndResult: function onEndResult(endResult) {\n if (side === '') {\n return endResult.trim();\n }\n\n side = side.toLowerCase();\n\n if (side === 'start' || side === 'left') {\n return endResult.replace(/^\\s*/, '');\n }\n\n if (side === 'end' || side === 'right') {\n return endResult.replace(/\\s*$/, '');\n }\n\n throw new Error('Side not supported: ' + side);\n }\n };\n};\n\nexport default trimResultTransformer;","var splitStringTransformer = function splitStringTransformer(splitBy) {\n return {\n onSubstitution: function onSubstitution(substitution, resultSoFar) {\n if (splitBy != null && typeof splitBy === 'string') {\n if (typeof substitution === 'string' && substitution.includes(splitBy)) {\n substitution = substitution.split(splitBy);\n }\n } else {\n throw new Error('You need to specify a string character to split by.');\n }\n\n return substitution;\n }\n };\n};\n\nexport default splitStringTransformer;","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nvar commaLists = new TemplateTag(inlineArrayTransformer({\n separator: ','\n}), stripIndentTransformer, trimResultTransformer);\nexport default commaLists;","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nvar commaListsAnd = new TemplateTag(inlineArrayTransformer({\n separator: ',',\n conjunction: 'and'\n}), stripIndentTransformer, trimResultTransformer);\nexport default commaListsAnd;","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nvar commaListsOr = new TemplateTag(inlineArrayTransformer({\n separator: ',',\n conjunction: 'or'\n}), stripIndentTransformer, trimResultTransformer);\nexport default commaListsOr;","var isValidValue = function isValidValue(x) {\n return x != null && !Number.isNaN(x) && typeof x !== 'boolean';\n};\n\nvar removeNonPrintingValuesTransformer = function removeNonPrintingValuesTransformer() {\n return {\n onSubstitution: function onSubstitution(substitution) {\n if (Array.isArray(substitution)) {\n return substitution.filter(isValidValue);\n }\n\n if (isValidValue(substitution)) {\n return substitution;\n }\n\n return '';\n }\n };\n};\n\nexport default removeNonPrintingValuesTransformer;","var replaceSubstitutionTransformer = function replaceSubstitutionTransformer(replaceWhat, replaceWith) {\n return {\n onSubstitution: function onSubstitution(substitution, resultSoFar) {\n if (replaceWhat == null || replaceWith == null) {\n throw new Error('replaceSubstitutionTransformer requires at least 2 arguments.');\n } // Do not touch if null or undefined\n\n\n if (substitution == null) {\n return substitution;\n } else {\n return substitution.toString().replace(replaceWhat, replaceWith);\n }\n }\n };\n};\n\nexport default replaceSubstitutionTransformer;","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport splitStringTransformer from '../splitStringTransformer';\nimport removeNonPrintingValuesTransformer from '../removeNonPrintingValuesTransformer';\nvar html = new TemplateTag(splitStringTransformer('\\n'), removeNonPrintingValuesTransformer, inlineArrayTransformer, stripIndentTransformer, trimResultTransformer);\nexport default html;","/**\n * Replaces tabs, newlines and spaces with the chosen value when they occur in sequences\n * @param {(String|RegExp)} replaceWhat - the value or pattern that should be replaced\n * @param {*} replaceWith - the replacement value\n * @return {Object} - a TemplateTag transformer\n */\nvar replaceResultTransformer = function replaceResultTransformer(replaceWhat, replaceWith) {\n return {\n onEndResult: function onEndResult(endResult) {\n if (replaceWhat == null || replaceWith == null) {\n throw new Error('replaceResultTransformer requires at least 2 arguments.');\n }\n\n return endResult.replace(replaceWhat, replaceWith);\n }\n };\n};\n\nexport default replaceResultTransformer;","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport splitStringTransformer from '../splitStringTransformer';\nimport replaceSubstitutionTransformer from '../replaceSubstitutionTransformer';\nvar safeHtml = new TemplateTag(splitStringTransformer('\\n'), inlineArrayTransformer, stripIndentTransformer, trimResultTransformer, replaceSubstitutionTransformer(/&/g, '&'), replaceSubstitutionTransformer(//g, '>'), replaceSubstitutionTransformer(/\"/g, '"'), replaceSubstitutionTransformer(/'/g, '''), replaceSubstitutionTransformer(/`/g, '`'));\nexport default safeHtml;","import TemplateTag from '../TemplateTag';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\nvar oneLine = new TemplateTag(replaceResultTransformer(/(?:\\n(?:\\s*))+/g, ' '), trimResultTransformer);\nexport default oneLine;","import TemplateTag from '../TemplateTag';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\nvar oneLineTrim = new TemplateTag(replaceResultTransformer(/(?:\\n\\s*)/g, ''), trimResultTransformer);\nexport default oneLineTrim;","import TemplateTag from '../TemplateTag';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\nvar oneLineCommaLists = new TemplateTag(inlineArrayTransformer({\n separator: ','\n}), replaceResultTransformer(/(?:\\s+)/g, ' '), trimResultTransformer);\nexport default oneLineCommaLists;","import TemplateTag from '../TemplateTag';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\nvar oneLineCommaListsOr = new TemplateTag(inlineArrayTransformer({\n separator: ',',\n conjunction: 'or'\n}), replaceResultTransformer(/(?:\\s+)/g, ' '), trimResultTransformer);\nexport default oneLineCommaListsOr;","import TemplateTag from '../TemplateTag';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\nvar oneLineCommaListsAnd = new TemplateTag(inlineArrayTransformer({\n separator: ',',\n conjunction: 'and'\n}), replaceResultTransformer(/(?:\\s+)/g, ' '), trimResultTransformer);\nexport default oneLineCommaListsAnd;","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nvar inlineLists = new TemplateTag(inlineArrayTransformer, stripIndentTransformer, trimResultTransformer);\nexport default inlineLists;","import TemplateTag from '../TemplateTag';\nimport inlineArrayTransformer from '../inlineArrayTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nimport replaceResultTransformer from '../replaceResultTransformer';\nvar oneLineInlineLists = new TemplateTag(inlineArrayTransformer, replaceResultTransformer(/(?:\\s+)/g, ' '), trimResultTransformer);\nexport default oneLineInlineLists;","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nvar stripIndent = new TemplateTag(stripIndentTransformer, trimResultTransformer);\nexport default stripIndent;","import TemplateTag from '../TemplateTag';\nimport stripIndentTransformer from '../stripIndentTransformer';\nimport trimResultTransformer from '../trimResultTransformer';\nvar stripIndents = new TemplateTag(stripIndentTransformer('all'), trimResultTransformer);\nexport default stripIndents;","\"use strict\";\n\nmodule.exports = Object.assign;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.withPrefix = withPrefix;\nexports.withAssetPrefix = withAssetPrefix;\nexports.navigate = exports.default = void 0;\n\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\n\nvar _assertThisInitialized2 = _interopRequireDefault(require(\"@babel/runtime/helpers/assertThisInitialized\"));\n\nvar _inheritsLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/inheritsLoose\"));\n\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reachRouter = require(\"@gatsbyjs/reach-router\");\n\nvar _utils = require(\"@gatsbyjs/reach-router/lib/utils\");\n\nvar _parsePath = require(\"./parse-path\");\n\nexports.parsePath = _parsePath.parsePath;\n\nvar isAbsolutePath = function isAbsolutePath(path) {\n return path === null || path === void 0 ? void 0 : path.startsWith(\"/\");\n};\n\nfunction withPrefix(path, prefix) {\n var _ref, _prefix;\n\n if (prefix === void 0) {\n prefix = getGlobalBasePrefix();\n }\n\n if (!isLocalLink(path)) {\n return path;\n }\n\n if (path.startsWith(\"./\") || path.startsWith(\"../\")) {\n return path;\n }\n\n var base = (_ref = (_prefix = prefix) !== null && _prefix !== void 0 ? _prefix : getGlobalPathPrefix()) !== null && _ref !== void 0 ? _ref : \"/\";\n return \"\" + (base !== null && base !== void 0 && base.endsWith(\"/\") ? base.slice(0, -1) : base) + (path.startsWith(\"/\") ? path : \"/\" + path);\n} // These global values are wrapped in typeof clauses to ensure the values exist.\n// This is especially problematic in unit testing of this component.\n\n\nvar getGlobalPathPrefix = function getGlobalPathPrefix() {\n return process.env.NODE_ENV !== \"production\" ? typeof __PATH_PREFIX__ !== \"undefined\" ? __PATH_PREFIX__ : undefined : __PATH_PREFIX__;\n};\n\nvar getGlobalBasePrefix = function getGlobalBasePrefix() {\n return process.env.NODE_ENV !== \"production\" ? typeof __BASE_PATH__ !== \"undefined\" ? __BASE_PATH__ : undefined : __BASE_PATH__;\n};\n\nvar isLocalLink = function isLocalLink(path) {\n return path && !path.startsWith(\"http://\") && !path.startsWith(\"https://\") && !path.startsWith(\"//\");\n};\n\nfunction withAssetPrefix(path) {\n return withPrefix(path, getGlobalPathPrefix());\n}\n\nfunction absolutify(path, current) {\n // If it's already absolute, return as-is\n if (isAbsolutePath(path)) {\n return path;\n }\n\n return (0, _utils.resolve)(path, current);\n}\n\nvar rewriteLinkPath = function rewriteLinkPath(path, relativeTo) {\n if (typeof path === \"number\") {\n return path;\n }\n\n if (!isLocalLink(path)) {\n return path;\n }\n\n return isAbsolutePath(path) ? withPrefix(path) : absolutify(path, relativeTo);\n};\n\nvar NavLinkPropTypes = {\n activeClassName: _propTypes.default.string,\n activeStyle: _propTypes.default.object,\n partiallyActive: _propTypes.default.bool\n}; // Set up IntersectionObserver\n\nvar createIntersectionObserver = function createIntersectionObserver(el, cb) {\n var io = new window.IntersectionObserver(function (entries) {\n entries.forEach(function (entry) {\n if (el === entry.target) {\n // Check if element is within viewport, remove listener, destroy observer, and run link callback.\n // MSEdge doesn't currently support isIntersecting, so also test for an intersectionRatio > 0\n if (entry.isIntersecting || entry.intersectionRatio > 0) {\n io.unobserve(el);\n io.disconnect();\n cb();\n }\n }\n });\n }); // Add element to the observer\n\n io.observe(el);\n return {\n instance: io,\n el: el\n };\n};\n\nfunction GatsbyLinkLocationWrapper(props) {\n return /*#__PURE__*/_react.default.createElement(_reachRouter.Location, null, function (_ref2) {\n var location = _ref2.location;\n return /*#__PURE__*/_react.default.createElement(GatsbyLink, (0, _extends2.default)({}, props, {\n _location: location\n }));\n });\n}\n\nvar GatsbyLink = /*#__PURE__*/function (_React$Component) {\n (0, _inheritsLoose2.default)(GatsbyLink, _React$Component);\n\n function GatsbyLink(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this; // Default to no support for IntersectionObserver\n\n _this.defaultGetProps = function (_ref3) {\n var isPartiallyCurrent = _ref3.isPartiallyCurrent,\n isCurrent = _ref3.isCurrent;\n\n if (_this.props.partiallyActive ? isPartiallyCurrent : isCurrent) {\n return {\n className: [_this.props.className, _this.props.activeClassName].filter(Boolean).join(\" \"),\n style: (0, _extends2.default)({}, _this.props.style, _this.props.activeStyle)\n };\n }\n\n return null;\n };\n\n var IOSupported = false;\n\n if (typeof window !== \"undefined\" && window.IntersectionObserver) {\n IOSupported = true;\n }\n\n _this.state = {\n IOSupported: IOSupported\n };\n _this.handleRef = _this.handleRef.bind((0, _assertThisInitialized2.default)(_this));\n return _this;\n }\n\n var _proto = GatsbyLink.prototype;\n\n _proto._prefetch = function _prefetch() {\n var currentPath = window.location.pathname; // reach router should have the correct state\n\n if (this.props._location && this.props._location.pathname) {\n currentPath = this.props._location.pathname;\n }\n\n var rewrittenPath = rewriteLinkPath(this.props.to, currentPath);\n var newPathName = (0, _parsePath.parsePath)(rewrittenPath).pathname; // Prefech is used to speed up next navigations. When you use it on the current navigation,\n // there could be a race-condition where Chrome uses the stale data instead of waiting for the network to complete\n\n if (currentPath !== newPathName) {\n ___loader.enqueue(newPathName);\n }\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n // Preserve non IO functionality if no support\n if (this.props.to !== prevProps.to && !this.state.IOSupported) {\n this._prefetch();\n }\n };\n\n _proto.componentDidMount = function componentDidMount() {\n // Preserve non IO functionality if no support\n if (!this.state.IOSupported) {\n this._prefetch();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (!this.io) {\n return;\n }\n\n var _this$io = this.io,\n instance = _this$io.instance,\n el = _this$io.el;\n instance.unobserve(el);\n instance.disconnect();\n };\n\n _proto.handleRef = function handleRef(ref) {\n var _this2 = this;\n\n if (this.props.innerRef && this.props.innerRef.hasOwnProperty(\"current\")) {\n this.props.innerRef.current = ref;\n } else if (this.props.innerRef) {\n this.props.innerRef(ref);\n }\n\n if (this.state.IOSupported && ref) {\n // If IO supported and element reference found, setup Observer functionality\n this.io = createIntersectionObserver(ref, function () {\n _this2._prefetch();\n });\n }\n };\n\n _proto.render = function render() {\n var _this3 = this;\n\n var _this$props = this.props,\n to = _this$props.to,\n _this$props$getProps = _this$props.getProps,\n getProps = _this$props$getProps === void 0 ? this.defaultGetProps : _this$props$getProps,\n _onClick = _this$props.onClick,\n _onMouseEnter = _this$props.onMouseEnter,\n $activeClassName = _this$props.activeClassName,\n $activeStyle = _this$props.activeStyle,\n $innerRef = _this$props.innerRef,\n partiallyActive = _this$props.partiallyActive,\n state = _this$props.state,\n replace = _this$props.replace,\n _location = _this$props._location,\n rest = (0, _objectWithoutPropertiesLoose2.default)(_this$props, [\"to\", \"getProps\", \"onClick\", \"onMouseEnter\", \"activeClassName\", \"activeStyle\", \"innerRef\", \"partiallyActive\", \"state\", \"replace\", \"_location\"]);\n\n if (process.env.NODE_ENV !== \"production\" && !isLocalLink(to)) {\n console.warn(\"External link \" + to + \" was detected in a Link component. Use the Link component only for internal links. See: https://gatsby.dev/internal-links\");\n }\n\n var prefixedTo = rewriteLinkPath(to, _location.pathname);\n\n if (!isLocalLink(prefixedTo)) {\n return /*#__PURE__*/_react.default.createElement(\"a\", (0, _extends2.default)({\n href: prefixedTo\n }, rest));\n }\n\n return /*#__PURE__*/_react.default.createElement(_reachRouter.Link, (0, _extends2.default)({\n to: prefixedTo,\n state: state,\n getProps: getProps,\n innerRef: this.handleRef,\n onMouseEnter: function onMouseEnter(e) {\n if (_onMouseEnter) {\n _onMouseEnter(e);\n }\n\n ___loader.hovering((0, _parsePath.parsePath)(prefixedTo).pathname);\n },\n onClick: function onClick(e) {\n if (_onClick) {\n _onClick(e);\n }\n\n if (e.button === 0 && // ignore right clicks\n !_this3.props.target && // let browser handle \"target=_blank\"\n !e.defaultPrevented && // onClick prevented default\n !e.metaKey && // ignore clicks with modifier keys...\n !e.altKey && !e.ctrlKey && !e.shiftKey) {\n e.preventDefault();\n var shouldReplace = replace;\n\n var isCurrent = encodeURI(prefixedTo) === _location.pathname;\n\n if (typeof replace !== \"boolean\" && isCurrent) {\n shouldReplace = true;\n } // Make sure the necessary scripts and data are\n // loaded before continuing.\n\n\n window.___navigate(prefixedTo, {\n state: state,\n replace: shouldReplace\n });\n }\n\n return true;\n }\n }, rest));\n };\n\n return GatsbyLink;\n}(_react.default.Component);\n\nGatsbyLink.propTypes = (0, _extends2.default)({}, NavLinkPropTypes, {\n onClick: _propTypes.default.func,\n to: _propTypes.default.string.isRequired,\n replace: _propTypes.default.bool,\n state: _propTypes.default.object\n});\n\nvar _default = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {\n return /*#__PURE__*/_react.default.createElement(GatsbyLinkLocationWrapper, (0, _extends2.default)({\n innerRef: ref\n }, props));\n});\n\nexports.default = _default;\n\nvar navigate = function navigate(to, options) {\n window.___navigate(rewriteLinkPath(to, window.location.pathname), options);\n};\n\nexports.navigate = navigate;","\"use strict\";\n\nexports.__esModule = true;\nexports.parsePath = parsePath;\n\nfunction parsePath(path) {\n var pathname = path || \"/\";\n var search = \"\";\n var hash = \"\";\n var hashIndex = pathname.indexOf(\"#\");\n\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf(\"?\");\n\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === \"?\" ? \"\" : search,\n hash: hash === \"#\" ? \"\" : hash\n };\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.useScrollRestoration = exports.ScrollContext = void 0;\n\nvar _scrollHandler = require(\"./scroll-handler\");\n\nexports.ScrollContext = _scrollHandler.ScrollHandler;\n\nvar _useScrollRestoration = require(\"./use-scroll-restoration\");\n\nexports.useScrollRestoration = _useScrollRestoration.useScrollRestoration;","\"use strict\";\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.ScrollHandler = exports.ScrollContext = void 0;\n\nvar _assertThisInitialized2 = _interopRequireDefault(require(\"@babel/runtime/helpers/assertThisInitialized\"));\n\nvar _inheritsLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/inheritsLoose\"));\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _sessionStorage = require(\"./session-storage\");\n\nvar ScrollContext = /*#__PURE__*/React.createContext(new _sessionStorage.SessionStorage());\nexports.ScrollContext = ScrollContext;\nScrollContext.displayName = \"GatsbyScrollContext\";\n\nvar ScrollHandler = /*#__PURE__*/function (_React$Component) {\n (0, _inheritsLoose2.default)(ScrollHandler, _React$Component);\n\n function ScrollHandler() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this._stateStorage = new _sessionStorage.SessionStorage();\n _this._isTicking = false;\n _this._latestKnownScrollY = 0;\n\n _this.scrollListener = function () {\n _this._latestKnownScrollY = window.scrollY;\n\n if (!_this._isTicking) {\n _this._isTicking = true;\n requestAnimationFrame(_this._saveScroll.bind((0, _assertThisInitialized2.default)(_this)));\n }\n };\n\n _this.windowScroll = function (position, prevProps) {\n if (_this.shouldUpdateScroll(prevProps, _this.props)) {\n window.scrollTo(0, position);\n }\n };\n\n _this.scrollToHash = function (hash, prevProps) {\n var node = document.getElementById(hash.substring(1));\n\n if (node && _this.shouldUpdateScroll(prevProps, _this.props)) {\n node.scrollIntoView();\n }\n };\n\n _this.shouldUpdateScroll = function (prevRouterProps, routerProps) {\n var shouldUpdateScroll = _this.props.shouldUpdateScroll;\n\n if (!shouldUpdateScroll) {\n return true;\n } // Hack to allow accessing this._stateStorage.\n\n\n return shouldUpdateScroll.call((0, _assertThisInitialized2.default)(_this), prevRouterProps, routerProps);\n };\n\n return _this;\n }\n\n var _proto = ScrollHandler.prototype;\n\n _proto._saveScroll = function _saveScroll() {\n var key = this.props.location.key || null;\n\n if (key) {\n this._stateStorage.save(this.props.location, key, this._latestKnownScrollY);\n }\n\n this._isTicking = false;\n };\n\n _proto.componentDidMount = function componentDidMount() {\n window.addEventListener(\"scroll\", this.scrollListener);\n var scrollPosition;\n var _this$props$location = this.props.location,\n key = _this$props$location.key,\n hash = _this$props$location.hash;\n\n if (key) {\n scrollPosition = this._stateStorage.read(this.props.location, key);\n }\n\n if (scrollPosition) {\n this.windowScroll(scrollPosition, undefined);\n } else if (hash) {\n this.scrollToHash(decodeURI(hash), undefined);\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n window.removeEventListener(\"scroll\", this.scrollListener);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _this$props$location2 = this.props.location,\n hash = _this$props$location2.hash,\n key = _this$props$location2.key;\n var scrollPosition;\n\n if (key) {\n scrollPosition = this._stateStorage.read(this.props.location, key);\n }\n /** There are two pieces of state: the browser url and\n * history state which keeps track of scroll position\n * Native behaviour prescribes that we ought to restore scroll position\n * when a user navigates back in their browser (this is the `POP` action)\n * Currently, reach router has a bug that prevents this at https://github.com/reach/router/issues/228\n * So we _always_ stick to the url as a source of truth — if the url\n * contains a hash, we scroll to it\n */\n\n\n if (hash) {\n this.scrollToHash(decodeURI(hash), prevProps);\n } else {\n this.windowScroll(scrollPosition, prevProps);\n }\n };\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(ScrollContext.Provider, {\n value: this._stateStorage\n }, this.props.children);\n };\n\n return ScrollHandler;\n}(React.Component);\n\nexports.ScrollHandler = ScrollHandler;\nScrollHandler.propTypes = {\n shouldUpdateScroll: _propTypes.default.func,\n children: _propTypes.default.element.isRequired,\n location: _propTypes.default.object.isRequired\n};","\"use strict\";\n\nexports.__esModule = true;\nexports.SessionStorage = void 0;\nvar STATE_KEY_PREFIX = \"@@scroll|\";\nvar GATSBY_ROUTER_SCROLL_STATE = \"___GATSBY_REACT_ROUTER_SCROLL\";\n\nvar SessionStorage = /*#__PURE__*/function () {\n function SessionStorage() {}\n\n var _proto = SessionStorage.prototype;\n\n _proto.read = function read(location, key) {\n var stateKey = this.getStateKey(location, key);\n\n try {\n var value = window.sessionStorage.getItem(stateKey);\n return value ? JSON.parse(value) : 0;\n } catch (e) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"[gatsby-react-router-scroll] Unable to access sessionStorage; sessionStorage is not available.\");\n }\n\n if (window && window[GATSBY_ROUTER_SCROLL_STATE] && window[GATSBY_ROUTER_SCROLL_STATE][stateKey]) {\n return window[GATSBY_ROUTER_SCROLL_STATE][stateKey];\n }\n\n return 0;\n }\n };\n\n _proto.save = function save(location, key, value) {\n var stateKey = this.getStateKey(location, key);\n var storedValue = JSON.stringify(value);\n\n try {\n window.sessionStorage.setItem(stateKey, storedValue);\n } catch (e) {\n if (window && window[GATSBY_ROUTER_SCROLL_STATE]) {\n window[GATSBY_ROUTER_SCROLL_STATE][stateKey] = JSON.parse(storedValue);\n } else {\n window[GATSBY_ROUTER_SCROLL_STATE] = {};\n window[GATSBY_ROUTER_SCROLL_STATE][stateKey] = JSON.parse(storedValue);\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"[gatsby-react-router-scroll] Unable to save state in sessionStorage; sessionStorage is not available.\");\n }\n }\n };\n\n _proto.getStateKey = function getStateKey(location, key) {\n var stateKeyBase = \"\" + STATE_KEY_PREFIX + location.pathname;\n return key === null || typeof key === \"undefined\" ? stateKeyBase : stateKeyBase + \"|\" + key;\n };\n\n return SessionStorage;\n}();\n\nexports.SessionStorage = SessionStorage;","\"use strict\";\n\nexports.__esModule = true;\nexports.useScrollRestoration = useScrollRestoration;\n\nvar _scrollHandler = require(\"./scroll-handler\");\n\nvar _react = require(\"react\");\n\nvar _reachRouter = require(\"@gatsbyjs/reach-router\");\n\nfunction useScrollRestoration(identifier) {\n var location = (0, _reachRouter.useLocation)();\n var state = (0, _react.useContext)(_scrollHandler.ScrollContext);\n var ref = (0, _react.useRef)();\n (0, _react.useLayoutEffect)(function () {\n if (ref.current) {\n var position = state.read(location, identifier);\n ref.current.scrollTo(0, position || 0);\n }\n }, []);\n return {\n ref: ref,\n onScroll: function onScroll() {\n if (ref.current) {\n state.save(location, identifier, ref.current.scrollTop);\n }\n }\n };\n}","// prefer default export if available\nconst preferDefault = m => (m && m.default) || m\n\nexports.components = {\n \"component---src-pages-404-js\": () => import(\"./../../../src/pages/404.js\" /* webpackChunkName: \"component---src-pages-404-js\" */),\n \"component---src-pages-index-js\": () => import(\"./../../../src/pages/index.js\" /* webpackChunkName: \"component---src-pages-index-js\" */),\n \"component---src-templates-redirect-js\": () => import(\"./../../../src/templates/redirect.js\" /* webpackChunkName: \"component---src-templates-redirect-js\" */)\n}\n\n","module.exports = [{\n plugin: require('../node_modules/gatsby-plugin-image/gatsby-browser.js'),\n options: {\"plugins\":[]},\n },{\n plugin: require('../gatsby-browser.js'),\n options: {\"plugins\":[]},\n }]\n","const plugins = require(`./api-runner-browser-plugins`)\nconst {\n getResourceURLsForPathname,\n loadPage,\n loadPageSync,\n} = require(`./loader`).publicLoader\n\nexports.apiRunner = (api, args = {}, defaultReturn, argTransform) => {\n // Hooks for gatsby-cypress's API handler\n if (process.env.CYPRESS_SUPPORT) {\n if (window.___apiHandler) {\n window.___apiHandler(api)\n } else if (window.___resolvedAPIs) {\n window.___resolvedAPIs.push(api)\n } else {\n window.___resolvedAPIs = [api]\n }\n }\n\n let results = plugins.map(plugin => {\n if (!plugin.plugin[api]) {\n return undefined\n }\n\n args.getResourceURLsForPathname = getResourceURLsForPathname\n args.loadPage = loadPage\n args.loadPageSync = loadPageSync\n\n const result = plugin.plugin[api](args, plugin.options)\n if (result && argTransform) {\n args = argTransform({ args, result, plugin })\n }\n return result\n })\n\n // Filter out undefined results.\n results = results.filter(result => typeof result !== `undefined`)\n\n if (results.length > 0) {\n return results\n } else if (defaultReturn) {\n return [defaultReturn]\n } else {\n return []\n }\n}\n\nexports.apiRunnerAsync = (api, args, defaultReturn) =>\n plugins.reduce(\n (previous, next) =>\n next.plugin[api]\n ? previous.then(() => next.plugin[api](args, next.options))\n : previous,\n Promise.resolve()\n )\n","// \n// An event handler can take an optional event argument\n// and should not return a value\n \n \n\n// An array of all currently registered event handlers for a type\n \n \n// A map of event types and their corresponding event handlers.\n \n \n \n \n\n/** Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nfunction mitt(all ) {\n\tall = all || Object.create(null);\n\n\treturn {\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t *\n\t\t * @param {String} type\tType of event to listen for, or `\"*\"` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton: function on(type , handler ) {\n\t\t\t(all[type] || (all[type] = [])).push(handler);\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t *\n\t\t * @param {String} type\tType of event to unregister `handler` from, or `\"*\"`\n\t\t * @param {Function} handler Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff: function off(type , handler ) {\n\t\t\tif (all[type]) {\n\t\t\t\tall[type].splice(all[type].indexOf(handler) >>> 0, 1);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `\"*\"` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * @param {String} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit: function emit(type , evt ) {\n\t\t\t(all[type] || []).slice().map(function (handler) { handler(evt); });\n\t\t\t(all['*'] || []).slice().map(function (handler) { handler(type, evt); });\n\t\t}\n\t};\n}\n\nexport default mitt;\n//# sourceMappingURL=mitt.es.js.map\n","import mitt from \"mitt\"\n\nconst emitter = mitt()\nexport default emitter\n","export default path => {\n if (path === undefined) {\n return path\n }\n if (path === `/`) {\n return `/`\n }\n if (path.charAt(path.length - 1) === `/`) {\n return path.slice(0, -1)\n }\n return path\n}\n","import { pick } from \"@gatsbyjs/reach-router/lib/utils\"\nimport stripPrefix from \"./strip-prefix\"\nimport normalizePagePath from \"./normalize-page-path\"\n\nconst pathCache = new Map()\nlet matchPaths = []\n\nconst trimPathname = rawPathname => {\n const pathname = decodeURIComponent(rawPathname)\n // Remove the pathPrefix from the pathname.\n const trimmedPathname = stripPrefix(pathname, __BASE_PATH__)\n // Remove any hashfragment\n .split(`#`)[0]\n // Remove search query\n .split(`?`)[0]\n\n return trimmedPathname\n}\n\nfunction absolutify(path) {\n // If it's already absolute, return as-is\n if (\n path.startsWith(`/`) ||\n path.startsWith(`https://`) ||\n path.startsWith(`http://`)\n ) {\n return path\n }\n // Calculate path relative to current location, adding a trailing slash to\n // match behavior of @reach/router\n return new URL(\n path,\n window.location.href + (window.location.href.endsWith(`/`) ? `` : `/`)\n ).pathname\n}\n\n/**\n * Set list of matchPaths\n *\n * @param {Array<{path: string, matchPath: string}>} value collection of matchPaths\n */\nexport const setMatchPaths = value => {\n matchPaths = value\n}\n\n/**\n * Return a matchpath url\n * if `match-paths.json` contains `{ \"/foo*\": \"/page1\", ...}`, then\n * `/foo?bar=far` => `/page1`\n *\n * @param {string} rawPathname A raw pathname\n * @return {string|null}\n */\nexport const findMatchPath = rawPathname => {\n const trimmedPathname = cleanPath(rawPathname)\n\n const pickPaths = matchPaths.map(({ path, matchPath }) => {\n return {\n path: matchPath,\n originalPath: path,\n }\n })\n\n const path = pick(pickPaths, trimmedPathname)\n\n if (path) {\n return normalizePagePath(path.route.originalPath)\n }\n\n return null\n}\n\n/**\n * Return a matchpath params from reach/router rules\n * if `match-paths.json` contains `{ \":bar/*foo\" }`, and the path is /baz/zaz/zoo\n * then it returns\n * { bar: baz, foo: zaz/zoo }\n *\n * @param {string} rawPathname A raw pathname\n * @return {object}\n */\nexport const grabMatchParams = rawPathname => {\n const trimmedPathname = cleanPath(rawPathname)\n\n const pickPaths = matchPaths.map(({ path, matchPath }) => {\n return {\n path: matchPath,\n originalPath: path,\n }\n })\n\n const path = pick(pickPaths, trimmedPathname)\n\n if (path) {\n return path.params\n }\n\n return {}\n}\n\n// Given a raw URL path, returns the cleaned version of it (trim off\n// `#` and query params), or if it matches an entry in\n// `match-paths.json`, its matched path is returned\n//\n// E.g. `/foo?bar=far` => `/foo`\n//\n// Or if `match-paths.json` contains `{ \"/foo*\": \"/page1\", ...}`, then\n// `/foo?bar=far` => `/page1`\nexport const findPath = rawPathname => {\n const trimmedPathname = trimPathname(absolutify(rawPathname))\n if (pathCache.has(trimmedPathname)) {\n return pathCache.get(trimmedPathname)\n }\n\n let foundPath = findMatchPath(trimmedPathname)\n\n if (!foundPath) {\n foundPath = cleanPath(rawPathname)\n }\n\n pathCache.set(trimmedPathname, foundPath)\n\n return foundPath\n}\n\n/**\n * Clean a url and converts /index.html => /\n * E.g. `/foo?bar=far` => `/foo`\n *\n * @param {string} rawPathname A raw pathname\n * @return {string}\n */\nexport const cleanPath = rawPathname => {\n const trimmedPathname = trimPathname(absolutify(rawPathname))\n\n let foundPath = trimmedPathname\n if (foundPath === `/index.html`) {\n foundPath = `/`\n }\n\n foundPath = normalizePagePath(foundPath)\n\n return foundPath\n}\n","import React from \"react\"\nimport PropTypes from \"prop-types\"\nimport Link, {\n withPrefix,\n withAssetPrefix,\n navigate,\n push,\n replace,\n navigateTo,\n parsePath,\n} from \"gatsby-link\"\nimport { useScrollRestoration } from \"gatsby-react-router-scroll\"\nimport PageRenderer from \"./public-page-renderer\"\nimport loader from \"./loader\"\n\nconst prefetchPathname = loader.enqueue\n\nconst StaticQueryContext = React.createContext({})\n\nfunction StaticQueryDataRenderer({ staticQueryData, data, query, render }) {\n const finalData = data\n ? data.data\n : staticQueryData[query] && staticQueryData[query].data\n\n return (\n \n {finalData && render(finalData)}\n {!finalData &&
Loading (StaticQuery)
}\n
\n )\n}\n\nconst StaticQuery = props => {\n const { data, query, render, children } = props\n\n return (\n \n {staticQueryData => (\n \n )}\n \n )\n}\n\nconst useStaticQuery = query => {\n if (\n typeof React.useContext !== `function` &&\n process.env.NODE_ENV === `development`\n ) {\n throw new Error(\n `You're likely using a version of React that doesn't support Hooks\\n` +\n `Please update React and ReactDOM to 16.8.0 or later to use the useStaticQuery hook.`\n )\n }\n const context = React.useContext(StaticQueryContext)\n\n // query is a stringified number like `3303882` when wrapped with graphql, If a user forgets\n // to wrap the query in a grqphql, then casting it to a Number results in `NaN` allowing us to\n // catch the misuse of the API and give proper direction\n if (isNaN(Number(query))) {\n throw new Error(`useStaticQuery was called with a string but expects to be called using \\`graphql\\`. Try this:\n\nimport { useStaticQuery, graphql } from 'gatsby';\n\nuseStaticQuery(graphql\\`${query}\\`);\n`)\n }\n\n if (context[query]?.data) {\n return context[query].data\n } else {\n throw new Error(\n `The result of this StaticQuery could not be fetched.\\n\\n` +\n `This is likely a bug in Gatsby and if refreshing the page does not fix it, ` +\n `please open an issue in https://github.com/gatsbyjs/gatsby/issues`\n )\n }\n}\n\nStaticQuery.propTypes = {\n data: PropTypes.object,\n query: PropTypes.string.isRequired,\n render: PropTypes.func,\n children: PropTypes.func,\n}\n\nfunction graphql() {\n throw new Error(\n `It appears like Gatsby is misconfigured. Gatsby related \\`graphql\\` calls ` +\n `are supposed to only be evaluated at compile time, and then compiled away. ` +\n `Unfortunately, something went wrong and the query was left in the compiled code.\\n\\n` +\n `Unless your site has a complex or custom babel/Gatsby configuration this is likely a bug in Gatsby.`\n )\n}\n\nexport {\n Link,\n withAssetPrefix,\n withPrefix,\n graphql,\n parsePath,\n navigate,\n useScrollRestoration,\n StaticQueryContext,\n StaticQuery,\n PageRenderer,\n useStaticQuery,\n prefetchPathname,\n}\n","const support = function (feature) {\n if (typeof document === `undefined`) {\n return false\n }\n const fakeLink = document.createElement(`link`)\n try {\n if (fakeLink.relList && typeof fakeLink.relList.supports === `function`) {\n return fakeLink.relList.supports(feature)\n }\n } catch (err) {\n return false\n }\n return false\n}\n\nconst linkPrefetchStrategy = function (url, options) {\n return new Promise((resolve, reject) => {\n if (typeof document === `undefined`) {\n reject()\n return\n }\n\n const link = document.createElement(`link`)\n link.setAttribute(`rel`, `prefetch`)\n link.setAttribute(`href`, url)\n\n Object.keys(options).forEach(key => {\n link.setAttribute(key, options[key])\n })\n\n link.onload = resolve\n link.onerror = reject\n\n const parentElement =\n document.getElementsByTagName(`head`)[0] ||\n document.getElementsByName(`script`)[0].parentNode\n parentElement.appendChild(link)\n })\n}\n\nconst xhrPrefetchStrategy = function (url) {\n return new Promise((resolve, reject) => {\n const req = new XMLHttpRequest()\n req.open(`GET`, url, true)\n\n req.onload = () => {\n if (req.status === 200) {\n resolve()\n } else {\n reject()\n }\n }\n\n req.send(null)\n })\n}\n\nconst supportedPrefetchStrategy = support(`prefetch`)\n ? linkPrefetchStrategy\n : xhrPrefetchStrategy\n\nconst preFetched = {}\n\nconst prefetch = function (url, options) {\n return new Promise(resolve => {\n if (preFetched[url]) {\n resolve()\n return\n }\n\n supportedPrefetchStrategy(url, options)\n .then(() => {\n resolve()\n preFetched[url] = true\n })\n .catch(() => {}) // 404s are logged to the console anyway\n })\n}\n\nexport default prefetch\n","import prefetchHelper from \"./prefetch\"\nimport emitter from \"./emitter\"\nimport { setMatchPaths, findPath, findMatchPath } from \"./find-path\"\n\n/**\n * Available resource loading statuses\n */\nexport const PageResourceStatus = {\n /**\n * At least one of critical resources failed to load\n */\n Error: `error`,\n /**\n * Resources loaded successfully\n */\n Success: `success`,\n}\n\nconst preferDefault = m => (m && m.default) || m\n\nconst stripSurroundingSlashes = s => {\n s = s[0] === `/` ? s.slice(1) : s\n s = s.endsWith(`/`) ? s.slice(0, -1) : s\n return s\n}\n\nconst createPageDataUrl = path => {\n const fixedPath = path === `/` ? `index` : stripSurroundingSlashes(path)\n return `${__PATH_PREFIX__}/page-data/${fixedPath}/page-data.json`\n}\n\nfunction doFetch(url, method = `GET`) {\n return new Promise((resolve, reject) => {\n const req = new XMLHttpRequest()\n req.open(method, url, true)\n req.onreadystatechange = () => {\n if (req.readyState == 4) {\n resolve(req)\n }\n }\n req.send(null)\n })\n}\n\nconst doesConnectionSupportPrefetch = () => {\n if (\n `connection` in navigator &&\n typeof navigator.connection !== `undefined`\n ) {\n if ((navigator.connection.effectiveType || ``).includes(`2g`)) {\n return false\n }\n if (navigator.connection.saveData) {\n return false\n }\n }\n return true\n}\n\nconst toPageResources = (pageData, component = null) => {\n const page = {\n componentChunkName: pageData.componentChunkName,\n path: pageData.path,\n webpackCompilationHash: pageData.webpackCompilationHash,\n matchPath: pageData.matchPath,\n staticQueryHashes: pageData.staticQueryHashes,\n }\n\n return {\n component,\n json: pageData.result,\n page,\n }\n}\n\nexport class BaseLoader {\n constructor(loadComponent, matchPaths) {\n // Map of pagePath -> Page. Where Page is an object with: {\n // status: PageResourceStatus.Success || PageResourceStatus.Error,\n // payload: PageResources, // undefined if PageResourceStatus.Error\n // }\n // PageResources is {\n // component,\n // json: pageData.result,\n // page: {\n // componentChunkName,\n // path,\n // webpackCompilationHash,\n // staticQueryHashes\n // },\n // staticQueryResults\n // }\n this.pageDb = new Map()\n this.inFlightDb = new Map()\n this.staticQueryDb = {}\n this.pageDataDb = new Map()\n this.prefetchTriggered = new Set()\n this.prefetchCompleted = new Set()\n this.loadComponent = loadComponent\n setMatchPaths(matchPaths)\n }\n\n inFlightNetworkRequests = new Map()\n\n memoizedGet(url) {\n let inFlightPromise = this.inFlightNetworkRequests.get(url)\n\n if (!inFlightPromise) {\n inFlightPromise = doFetch(url, `GET`)\n this.inFlightNetworkRequests.set(url, inFlightPromise)\n }\n\n // Prefer duplication with then + catch over .finally to prevent problems in ie11 + firefox\n return inFlightPromise\n .then(response => {\n this.inFlightNetworkRequests.delete(url)\n return response\n })\n .catch(err => {\n this.inFlightNetworkRequests.delete(url)\n throw err\n })\n }\n\n setApiRunner(apiRunner) {\n this.apiRunner = apiRunner\n this.prefetchDisabled = apiRunner(`disableCorePrefetching`).some(a => a)\n }\n\n fetchPageDataJson(loadObj) {\n const { pagePath, retries = 0 } = loadObj\n const url = createPageDataUrl(pagePath)\n return this.memoizedGet(url).then(req => {\n const { status, responseText } = req\n\n // Handle 200\n if (status === 200) {\n try {\n const jsonPayload = JSON.parse(responseText)\n if (jsonPayload.path === undefined) {\n throw new Error(`not a valid pageData response`)\n }\n\n return Object.assign(loadObj, {\n status: PageResourceStatus.Success,\n payload: jsonPayload,\n })\n } catch (err) {\n // continue regardless of error\n }\n }\n\n // Handle 404\n if (status === 404 || status === 200) {\n // If the request was for a 404 page and it doesn't exist, we're done\n if (pagePath === `/404.html`) {\n return Object.assign(loadObj, {\n status: PageResourceStatus.Error,\n })\n }\n\n // Need some code here to cache the 404 request. In case\n // multiple loadPageDataJsons result in 404s\n return this.fetchPageDataJson(\n Object.assign(loadObj, { pagePath: `/404.html`, notFound: true })\n )\n }\n\n // handle 500 response (Unrecoverable)\n if (status === 500) {\n return Object.assign(loadObj, {\n status: PageResourceStatus.Error,\n })\n }\n\n // Handle everything else, including status === 0, and 503s. Should retry\n if (retries < 3) {\n return this.fetchPageDataJson(\n Object.assign(loadObj, { retries: retries + 1 })\n )\n }\n\n // Retried 3 times already, result is an error.\n return Object.assign(loadObj, {\n status: PageResourceStatus.Error,\n })\n })\n }\n\n loadPageDataJson(rawPath) {\n const pagePath = findPath(rawPath)\n if (this.pageDataDb.has(pagePath)) {\n const pageData = this.pageDataDb.get(pagePath)\n if (process.env.BUILD_STAGE !== `develop` || !pageData.stale) {\n return Promise.resolve(pageData)\n }\n }\n\n return this.fetchPageDataJson({ pagePath }).then(pageData => {\n this.pageDataDb.set(pagePath, pageData)\n\n return pageData\n })\n }\n\n findMatchPath(rawPath) {\n return findMatchPath(rawPath)\n }\n\n // TODO check all uses of this and whether they use undefined for page resources not exist\n loadPage(rawPath) {\n const pagePath = findPath(rawPath)\n if (this.pageDb.has(pagePath)) {\n const page = this.pageDb.get(pagePath)\n if (process.env.BUILD_STAGE !== `develop` || !page.payload.stale) {\n if (page.error) {\n return {\n error: page.error,\n status: page.status,\n }\n }\n\n return Promise.resolve(page.payload)\n }\n }\n\n if (this.inFlightDb.has(pagePath)) {\n return this.inFlightDb.get(pagePath)\n }\n\n const inFlightPromise = Promise.all([\n this.loadAppData(),\n this.loadPageDataJson(pagePath),\n ]).then(allData => {\n const result = allData[1]\n if (result.status === PageResourceStatus.Error) {\n return {\n status: PageResourceStatus.Error,\n }\n }\n\n let pageData = result.payload\n const { componentChunkName, staticQueryHashes = [] } = pageData\n\n const finalResult = {}\n\n const componentChunkPromise = this.loadComponent(componentChunkName).then(\n component => {\n finalResult.createdAt = new Date()\n let pageResources\n if (!component || component instanceof Error) {\n finalResult.status = PageResourceStatus.Error\n finalResult.error = component\n } else {\n finalResult.status = PageResourceStatus.Success\n if (result.notFound === true) {\n finalResult.notFound = true\n }\n pageData = Object.assign(pageData, {\n webpackCompilationHash: allData[0]\n ? allData[0].webpackCompilationHash\n : ``,\n })\n pageResources = toPageResources(pageData, component)\n }\n // undefined if final result is an error\n return pageResources\n }\n )\n\n const staticQueryBatchPromise = Promise.all(\n staticQueryHashes.map(staticQueryHash => {\n // Check for cache in case this static query result has already been loaded\n if (this.staticQueryDb[staticQueryHash]) {\n const jsonPayload = this.staticQueryDb[staticQueryHash]\n return { staticQueryHash, jsonPayload }\n }\n\n return this.memoizedGet(\n `${__PATH_PREFIX__}/page-data/sq/d/${staticQueryHash}.json`\n )\n .then(req => {\n const jsonPayload = JSON.parse(req.responseText)\n return { staticQueryHash, jsonPayload }\n })\n .catch(() => {\n throw new Error(\n `We couldn't load \"${__PATH_PREFIX__}/page-data/sq/d/${staticQueryHash}.json\"`\n )\n })\n })\n ).then(staticQueryResults => {\n const staticQueryResultsMap = {}\n\n staticQueryResults.forEach(({ staticQueryHash, jsonPayload }) => {\n staticQueryResultsMap[staticQueryHash] = jsonPayload\n this.staticQueryDb[staticQueryHash] = jsonPayload\n })\n\n return staticQueryResultsMap\n })\n\n return (\n Promise.all([componentChunkPromise, staticQueryBatchPromise])\n .then(([pageResources, staticQueryResults]) => {\n let payload\n if (pageResources) {\n payload = { ...pageResources, staticQueryResults }\n finalResult.payload = payload\n emitter.emit(`onPostLoadPageResources`, {\n page: payload,\n pageResources: payload,\n })\n }\n\n this.pageDb.set(pagePath, finalResult)\n\n if (finalResult.error) {\n return {\n error: finalResult.error,\n status: finalResult.status,\n }\n }\n\n return payload\n })\n // when static-query fail to load we throw a better error\n .catch(err => {\n return {\n error: err,\n status: PageResourceStatus.Error,\n }\n })\n )\n })\n\n inFlightPromise\n .then(() => {\n this.inFlightDb.delete(pagePath)\n })\n .catch(error => {\n this.inFlightDb.delete(pagePath)\n throw error\n })\n\n this.inFlightDb.set(pagePath, inFlightPromise)\n\n return inFlightPromise\n }\n\n // returns undefined if the page does not exists in cache\n loadPageSync(rawPath, options = {}) {\n const pagePath = findPath(rawPath)\n if (this.pageDb.has(pagePath)) {\n const pageData = this.pageDb.get(pagePath)\n\n if (pageData.payload) {\n return pageData.payload\n }\n\n if (options?.withErrorDetails) {\n return {\n error: pageData.error,\n status: pageData.status,\n }\n }\n }\n return undefined\n }\n\n shouldPrefetch(pagePath) {\n // Skip prefetching if we know user is on slow or constrained connection\n if (!doesConnectionSupportPrefetch()) {\n return false\n }\n\n // Check if the page exists.\n if (this.pageDb.has(pagePath)) {\n return false\n }\n\n return true\n }\n\n prefetch(pagePath) {\n if (!this.shouldPrefetch(pagePath)) {\n return false\n }\n\n // Tell plugins with custom prefetching logic that they should start\n // prefetching this path.\n if (!this.prefetchTriggered.has(pagePath)) {\n this.apiRunner(`onPrefetchPathname`, { pathname: pagePath })\n this.prefetchTriggered.add(pagePath)\n }\n\n // If a plugin has disabled core prefetching, stop now.\n if (this.prefetchDisabled) {\n return false\n }\n\n const realPath = findPath(pagePath)\n // Todo make doPrefetch logic cacheable\n // eslint-disable-next-line consistent-return\n this.doPrefetch(realPath).then(() => {\n if (!this.prefetchCompleted.has(pagePath)) {\n this.apiRunner(`onPostPrefetchPathname`, { pathname: pagePath })\n this.prefetchCompleted.add(pagePath)\n }\n })\n\n return true\n }\n\n doPrefetch(pagePath) {\n const pageDataUrl = createPageDataUrl(pagePath)\n return prefetchHelper(pageDataUrl, {\n crossOrigin: `anonymous`,\n as: `fetch`,\n }).then(() =>\n // This was just prefetched, so will return a response from\n // the cache instead of making another request to the server\n this.loadPageDataJson(pagePath)\n )\n }\n\n hovering(rawPath) {\n this.loadPage(rawPath)\n }\n\n getResourceURLsForPathname(rawPath) {\n const pagePath = findPath(rawPath)\n const page = this.pageDataDb.get(pagePath)\n if (page) {\n const pageResources = toPageResources(page.payload)\n\n return [\n ...createComponentUrls(pageResources.page.componentChunkName),\n createPageDataUrl(pagePath),\n ]\n } else {\n return null\n }\n }\n\n isPageNotFound(rawPath) {\n const pagePath = findPath(rawPath)\n const page = this.pageDb.get(pagePath)\n return !page || page.notFound\n }\n\n loadAppData(retries = 0) {\n return this.memoizedGet(`${__PATH_PREFIX__}/page-data/app-data.json`).then(\n req => {\n const { status, responseText } = req\n\n let appData\n\n if (status !== 200 && retries < 3) {\n // Retry 3 times incase of non-200 responses\n return this.loadAppData(retries + 1)\n }\n\n // Handle 200\n if (status === 200) {\n try {\n const jsonPayload = JSON.parse(responseText)\n if (jsonPayload.webpackCompilationHash === undefined) {\n throw new Error(`not a valid app-data response`)\n }\n\n appData = jsonPayload\n } catch (err) {\n // continue regardless of error\n }\n }\n\n return appData\n }\n )\n }\n}\n\nconst createComponentUrls = componentChunkName =>\n (window.___chunkMapping[componentChunkName] || []).map(\n chunk => __PATH_PREFIX__ + chunk\n )\n\nexport class ProdLoader extends BaseLoader {\n constructor(asyncRequires, matchPaths) {\n const loadComponent = chunkName => {\n if (!asyncRequires.components[chunkName]) {\n throw new Error(\n `We couldn't find the correct component chunk with the name ${chunkName}`\n )\n }\n\n return (\n asyncRequires.components[chunkName]()\n .then(preferDefault)\n // loader will handle the case when component is error\n .catch(err => err)\n )\n }\n\n super(loadComponent, matchPaths)\n }\n\n doPrefetch(pagePath) {\n return super.doPrefetch(pagePath).then(result => {\n if (result.status !== PageResourceStatus.Success) {\n return Promise.resolve()\n }\n const pageData = result.payload\n const chunkName = pageData.componentChunkName\n const componentUrls = createComponentUrls(chunkName)\n return Promise.all(componentUrls.map(prefetchHelper)).then(() => pageData)\n })\n }\n\n loadPageDataJson(rawPath) {\n return super.loadPageDataJson(rawPath).then(data => {\n if (data.notFound) {\n // check if html file exist using HEAD request:\n // if it does we should navigate to it instead of showing 404\n return doFetch(rawPath, `HEAD`).then(req => {\n if (req.status === 200) {\n // page (.html file) actually exist (or we asked for 404 )\n // returning page resources status as errored to trigger\n // regular browser navigation to given page\n return {\n status: PageResourceStatus.Error,\n }\n }\n\n // if HEAD request wasn't 200, return notFound result\n // and show 404 page\n return data\n })\n }\n return data\n })\n }\n}\n\nlet instance\n\nexport const setLoader = _loader => {\n instance = _loader\n}\n\nexport const publicLoader = {\n enqueue: rawPath => instance.prefetch(rawPath),\n\n // Real methods\n getResourceURLsForPathname: rawPath =>\n instance.getResourceURLsForPathname(rawPath),\n loadPage: rawPath => instance.loadPage(rawPath),\n // TODO add deprecation to v4 so people use withErrorDetails and then we can remove in v5 and change default behaviour\n loadPageSync: (rawPath, options = {}) =>\n instance.loadPageSync(rawPath, options),\n prefetch: rawPath => instance.prefetch(rawPath),\n isPageNotFound: rawPath => instance.isPageNotFound(rawPath),\n hovering: rawPath => instance.hovering(rawPath),\n loadAppData: () => instance.loadAppData(),\n}\n\nexport default publicLoader\n\nexport function getStaticQueryResults() {\n if (instance) {\n return instance.staticQueryDb\n } else {\n return {}\n }\n}\n","import React, { createElement } from \"react\"\nimport PropTypes from \"prop-types\"\nimport { apiRunner } from \"./api-runner-browser\"\nimport { grabMatchParams } from \"./find-path\"\n\n// Renders page\nclass PageRenderer extends React.Component {\n render() {\n const props = {\n ...this.props,\n params: {\n ...grabMatchParams(this.props.location.pathname),\n ...this.props.pageResources.json.pageContext.__params,\n },\n }\n\n const pageElement = createElement(this.props.pageResources.component, {\n ...props,\n key: this.props.path || this.props.pageResources.page.path,\n })\n\n const wrappedPage = apiRunner(\n `wrapPageElement`,\n { element: pageElement, props },\n pageElement,\n ({ result }) => {\n return { element: result, props }\n }\n ).pop()\n\n return wrappedPage\n }\n}\n\nPageRenderer.propTypes = {\n location: PropTypes.object.isRequired,\n pageResources: PropTypes.object.isRequired,\n data: PropTypes.object,\n pageContext: PropTypes.object.isRequired,\n}\n\nexport default PageRenderer\n","// This is extracted to separate module because it's shared\n// between browser and SSR code\nexport const RouteAnnouncerProps = {\n id: `gatsby-announcer`,\n style: {\n position: `absolute`,\n top: 0,\n width: 1,\n height: 1,\n padding: 0,\n overflow: `hidden`,\n clip: `rect(0, 0, 0, 0)`,\n whiteSpace: `nowrap`,\n border: 0,\n },\n \"aria-live\": `assertive`,\n \"aria-atomic\": `true`,\n}\n","import React from \"react\"\nimport PropTypes from \"prop-types\"\nimport loader, { PageResourceStatus } from \"./loader\"\nimport redirects from \"./redirects.json\"\nimport { apiRunner } from \"./api-runner-browser\"\nimport emitter from \"./emitter\"\nimport { RouteAnnouncerProps } from \"./route-announcer-props\"\nimport { navigate as reachNavigate } from \"@gatsbyjs/reach-router\"\nimport { globalHistory } from \"@gatsbyjs/reach-router/lib/history\"\nimport { parsePath } from \"gatsby-link\"\n\n// Convert to a map for faster lookup in maybeRedirect()\n\nconst redirectMap = new Map()\nconst redirectIgnoreCaseMap = new Map()\n\nredirects.forEach(redirect => {\n if (redirect.ignoreCase) {\n redirectIgnoreCaseMap.set(redirect.fromPath, redirect)\n } else {\n redirectMap.set(redirect.fromPath, redirect)\n }\n})\n\nfunction maybeRedirect(pathname) {\n let redirect = redirectMap.get(pathname)\n if (!redirect) {\n redirect = redirectIgnoreCaseMap.get(pathname.toLowerCase())\n }\n\n if (redirect != null) {\n if (process.env.NODE_ENV !== `production`) {\n if (!loader.isPageNotFound(pathname)) {\n console.error(\n `The route \"${pathname}\" matches both a page and a redirect; this is probably not intentional.`\n )\n }\n }\n\n window.___replace(redirect.toPath)\n return true\n } else {\n return false\n }\n}\n\nconst onPreRouteUpdate = (location, prevLocation) => {\n if (!maybeRedirect(location.pathname)) {\n apiRunner(`onPreRouteUpdate`, { location, prevLocation })\n }\n}\n\nconst onRouteUpdate = (location, prevLocation) => {\n if (!maybeRedirect(location.pathname)) {\n apiRunner(`onRouteUpdate`, { location, prevLocation })\n if (\n process.env.GATSBY_EXPERIMENTAL_QUERY_ON_DEMAND &&\n process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR === `true`\n ) {\n emitter.emit(`onRouteUpdate`, { location, prevLocation })\n }\n }\n}\n\nconst navigate = (to, options = {}) => {\n // Support forward/backward navigation with numbers\n // navigate(-2) (jumps back 2 history steps)\n // navigate(2) (jumps forward 2 history steps)\n if (typeof to === `number`) {\n globalHistory.navigate(to)\n return\n }\n\n let { pathname } = parsePath(to)\n let redirect = redirectMap.get(pathname)\n if (!redirect) {\n redirect = redirectIgnoreCaseMap.get(pathname.toLowerCase())\n }\n\n // If we're redirecting, just replace the passed in pathname\n // to the one we want to redirect to.\n if (redirect) {\n to = redirect.toPath\n pathname = parsePath(to).pathname\n }\n\n // If we had a service worker update, no matter the path, reload window and\n // reset the pathname whitelist\n if (window.___swUpdated) {\n window.location = pathname\n return\n }\n\n // Start a timer to wait for a second before transitioning and showing a\n // loader in case resources aren't around yet.\n const timeoutId = setTimeout(() => {\n emitter.emit(`onDelayedLoadPageResources`, { pathname })\n apiRunner(`onRouteUpdateDelayed`, {\n location: window.location,\n })\n }, 1000)\n\n loader.loadPage(pathname).then(pageResources => {\n // If no page resources, then refresh the page\n // Do this, rather than simply `window.location.reload()`, so that\n // pressing the back/forward buttons work - otherwise when pressing\n // back, the browser will just change the URL and expect JS to handle\n // the change, which won't always work since it might not be a Gatsby\n // page.\n if (!pageResources || pageResources.status === PageResourceStatus.Error) {\n window.history.replaceState({}, ``, location.href)\n window.location = pathname\n clearTimeout(timeoutId)\n return\n }\n\n // If the loaded page has a different compilation hash to the\n // window, then a rebuild has occurred on the server. Reload.\n if (process.env.NODE_ENV === `production` && pageResources) {\n if (\n pageResources.page.webpackCompilationHash !==\n window.___webpackCompilationHash\n ) {\n // Purge plugin-offline cache\n if (\n `serviceWorker` in navigator &&\n navigator.serviceWorker.controller !== null &&\n navigator.serviceWorker.controller.state === `activated`\n ) {\n navigator.serviceWorker.controller.postMessage({\n gatsbyApi: `clearPathResources`,\n })\n }\n\n window.location = pathname\n }\n }\n reachNavigate(to, options)\n clearTimeout(timeoutId)\n })\n}\n\nfunction shouldUpdateScroll(prevRouterProps, { location }) {\n const { pathname, hash } = location\n const results = apiRunner(`shouldUpdateScroll`, {\n prevRouterProps,\n // `pathname` for backwards compatibility\n pathname,\n routerProps: { location },\n getSavedScrollPosition: args => [\n 0,\n // FIXME this is actually a big code smell, we should fix this\n // eslint-disable-next-line @babel/no-invalid-this\n this._stateStorage.read(args, args.key),\n ],\n })\n if (results.length > 0) {\n // Use the latest registered shouldUpdateScroll result, this allows users to override plugin's configuration\n // @see https://github.com/gatsbyjs/gatsby/issues/12038\n return results[results.length - 1]\n }\n\n if (prevRouterProps) {\n const {\n location: { pathname: oldPathname },\n } = prevRouterProps\n if (oldPathname === pathname) {\n // Scroll to element if it exists, if it doesn't, or no hash is provided,\n // scroll to top.\n return hash ? decodeURI(hash.slice(1)) : [0, 0]\n }\n }\n return true\n}\n\nfunction init() {\n // The \"scroll-behavior\" package expects the \"action\" to be on the location\n // object so let's copy it over.\n globalHistory.listen(args => {\n args.location.action = args.action\n })\n\n window.___push = to => navigate(to, { replace: false })\n window.___replace = to => navigate(to, { replace: true })\n window.___navigate = (to, options) => navigate(to, options)\n\n // Check for initial page-load redirect\n maybeRedirect(window.location.pathname)\n}\n\nclass RouteAnnouncer extends React.Component {\n constructor(props) {\n super(props)\n this.announcementRef = React.createRef()\n }\n\n componentDidUpdate(prevProps, nextProps) {\n requestAnimationFrame(() => {\n let pageName = `new page at ${this.props.location.pathname}`\n if (document.title) {\n pageName = document.title\n }\n const pageHeadings = document.querySelectorAll(`#gatsby-focus-wrapper h1`)\n if (pageHeadings && pageHeadings.length) {\n pageName = pageHeadings[0].textContent\n }\n const newAnnouncement = `Navigated to ${pageName}`\n if (this.announcementRef.current) {\n const oldAnnouncement = this.announcementRef.current.innerText\n if (oldAnnouncement !== newAnnouncement) {\n this.announcementRef.current.innerText = newAnnouncement\n }\n }\n })\n }\n\n render() {\n return
\n }\n}\n\nconst compareLocationProps = (prevLocation, nextLocation) => {\n if (prevLocation.href !== nextLocation.href) {\n return true\n }\n\n if (prevLocation?.state?.key !== nextLocation?.state?.key) {\n return true\n }\n\n return false\n}\n\n// Fire on(Pre)RouteUpdate APIs\nclass RouteUpdates extends React.Component {\n constructor(props) {\n super(props)\n onPreRouteUpdate(props.location, null)\n }\n\n componentDidMount() {\n onRouteUpdate(this.props.location, null)\n }\n\n shouldComponentUpdate(prevProps) {\n if (compareLocationProps(prevProps.location, this.props.location)) {\n onPreRouteUpdate(this.props.location, prevProps.location)\n return true\n }\n return false\n }\n\n componentDidUpdate(prevProps) {\n if (compareLocationProps(prevProps.location, this.props.location)) {\n onRouteUpdate(this.props.location, prevProps.location)\n }\n }\n\n render() {\n return (\n \n {this.props.children}\n \n \n )\n }\n}\n\nRouteUpdates.propTypes = {\n location: PropTypes.object.isRequired,\n}\n\nexport { init, shouldUpdateScroll, RouteUpdates }\n","// Pulled from react-compat\n// https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349\nfunction shallowDiffers(a, b) {\n for (var i in a) {\n if (!(i in b)) return true;\n }for (var _i in b) {\n if (a[_i] !== b[_i]) return true;\n }return false;\n}\n\nexport default (function (instance, nextProps, nextState) {\n return shallowDiffers(instance.props, nextProps) || shallowDiffers(instance.state, nextState);\n});","import React from \"react\"\nimport loader, { PageResourceStatus } from \"./loader\"\nimport shallowCompare from \"shallow-compare\"\n\nclass EnsureResources extends React.Component {\n constructor(props) {\n super()\n const { location, pageResources } = props\n this.state = {\n location: { ...location },\n pageResources:\n pageResources ||\n loader.loadPageSync(location.pathname, { withErrorDetails: true }),\n }\n }\n\n static getDerivedStateFromProps({ location }, prevState) {\n if (prevState.location.href !== location.href) {\n const pageResources = loader.loadPageSync(location.pathname, {\n withErrorDetails: true,\n })\n\n return {\n pageResources,\n location: { ...location },\n }\n }\n\n return {\n location: { ...location },\n }\n }\n\n loadResources(rawPath) {\n loader.loadPage(rawPath).then(pageResources => {\n if (pageResources && pageResources.status !== PageResourceStatus.Error) {\n this.setState({\n location: { ...window.location },\n pageResources,\n })\n } else {\n window.history.replaceState({}, ``, location.href)\n window.location = rawPath\n }\n })\n }\n\n shouldComponentUpdate(nextProps, nextState) {\n // Always return false if we're missing resources.\n if (!nextState.pageResources) {\n this.loadResources(nextProps.location.pathname)\n return false\n }\n\n if (\n process.env.BUILD_STAGE === `develop` &&\n nextState.pageResources.stale\n ) {\n this.loadResources(nextProps.location.pathname)\n return false\n }\n\n // Check if the component or json have changed.\n if (this.state.pageResources !== nextState.pageResources) {\n return true\n }\n if (\n this.state.pageResources.component !== nextState.pageResources.component\n ) {\n return true\n }\n\n if (this.state.pageResources.json !== nextState.pageResources.json) {\n return true\n }\n // Check if location has changed on a page using internal routing\n // via matchPath configuration.\n if (\n this.state.location.key !== nextState.location.key &&\n nextState.pageResources.page &&\n (nextState.pageResources.page.matchPath ||\n nextState.pageResources.page.path)\n ) {\n return true\n }\n return shallowCompare(this, nextProps, nextState)\n }\n\n render() {\n if (\n process.env.NODE_ENV !== `production` &&\n (!this.state.pageResources ||\n this.state.pageResources.status === PageResourceStatus.Error)\n ) {\n const message = `EnsureResources was not able to find resources for path: \"${this.props.location.pathname}\"\nThis typically means that an issue occurred building components for that path.\nRun \\`gatsby clean\\` to remove any cached elements.`\n if (this.state.pageResources?.error) {\n console.error(message)\n throw this.state.pageResources.error\n }\n\n throw new Error(message)\n }\n\n return this.props.children(this.state)\n }\n}\n\nexport default EnsureResources\n","import { apiRunner, apiRunnerAsync } from \"./api-runner-browser\"\nimport React from \"react\"\nimport ReactDOM from \"react-dom\"\nimport { Router, navigate, Location, BaseContext } from \"@gatsbyjs/reach-router\"\nimport { ScrollContext } from \"gatsby-react-router-scroll\"\nimport domReady from \"@mikaelkristiansson/domready\"\nimport { StaticQueryContext } from \"gatsby\"\nimport {\n shouldUpdateScroll,\n init as navigationInit,\n RouteUpdates,\n} from \"./navigation\"\nimport emitter from \"./emitter\"\nimport PageRenderer from \"./page-renderer\"\nimport asyncRequires from \"$virtual/async-requires\"\nimport {\n setLoader,\n ProdLoader,\n publicLoader,\n PageResourceStatus,\n getStaticQueryResults,\n} from \"./loader\"\nimport EnsureResources from \"./ensure-resources\"\nimport stripPrefix from \"./strip-prefix\"\n\n// Generated during bootstrap\nimport matchPaths from \"$virtual/match-paths.json\"\n\nconst loader = new ProdLoader(asyncRequires, matchPaths)\nsetLoader(loader)\nloader.setApiRunner(apiRunner)\n\nwindow.asyncRequires = asyncRequires\nwindow.___emitter = emitter\nwindow.___loader = publicLoader\n\nnavigationInit()\n\napiRunnerAsync(`onClientEntry`).then(() => {\n // Let plugins register a service worker. The plugin just needs\n // to return true.\n if (apiRunner(`registerServiceWorker`).length > 0) {\n require(`./register-service-worker`)\n }\n\n // In gatsby v2 if Router is used in page using matchPaths\n // paths need to contain full path.\n // For example:\n // - page have `/app/*` matchPath\n // - inside template user needs to use `/app/xyz` as path\n // Resetting `basepath`/`baseuri` keeps current behaviour\n // to not introduce breaking change.\n // Remove this in v3\n const RouteHandler = props => (\n \n \n \n )\n\n const DataContext = React.createContext({})\n\n class GatsbyRoot extends React.Component {\n render() {\n const { children } = this.props\n return (\n \n {({ location }) => (\n \n {({ pageResources, location }) => {\n const staticQueryResults = getStaticQueryResults()\n return (\n \n \n {children}\n \n \n )\n }}\n \n )}\n \n )\n }\n }\n\n class LocationHandler extends React.Component {\n render() {\n return (\n \n {({ pageResources, location }) => (\n \n \n \n \n
\n \n \n )}\n \n )\n }\n }\n\n const { pagePath, location: browserLoc } = window\n\n // Explicitly call navigate if the canonical path (window.pagePath)\n // is different to the browser path (window.location.pathname). But\n // only if NONE of the following conditions hold:\n //\n // - The url matches a client side route (page.matchPath)\n // - it's a 404 page\n // - it's the offline plugin shell (/offline-plugin-app-shell-fallback/)\n if (\n pagePath &&\n __BASE_PATH__ + pagePath !== browserLoc.pathname &&\n !(\n loader.findMatchPath(stripPrefix(browserLoc.pathname, __BASE_PATH__)) ||\n pagePath === `/404.html` ||\n pagePath.match(/^\\/404\\/?$/) ||\n pagePath.match(/^\\/offline-plugin-app-shell-fallback\\/?$/)\n )\n ) {\n navigate(__BASE_PATH__ + pagePath + browserLoc.search + browserLoc.hash, {\n replace: true,\n })\n }\n\n publicLoader.loadPage(browserLoc.pathname).then(page => {\n if (!page || page.status === PageResourceStatus.Error) {\n const message = `page resources for ${browserLoc.pathname} not found. Not rendering React`\n\n // if the chunk throws an error we want to capture the real error\n // This should help with https://github.com/gatsbyjs/gatsby/issues/19618\n if (page && page.error) {\n console.error(message)\n throw page.error\n }\n\n throw new Error(message)\n }\n\n window.___webpackCompilationHash = page.page.webpackCompilationHash\n\n const SiteRoot = apiRunner(\n `wrapRootElement`,\n { element: },\n ,\n ({ result }) => {\n return { element: result }\n }\n ).pop()\n\n const App = () => {SiteRoot}\n\n const renderer = apiRunner(\n `replaceHydrateFunction`,\n undefined,\n ReactDOM.hydrate\n )[0]\n\n domReady(() => {\n renderer(\n ,\n typeof window !== `undefined`\n ? document.getElementById(`___gatsby`)\n : void 0,\n () => {\n apiRunner(`onInitialClientRender`)\n }\n )\n })\n })\n})\n","import React from \"react\"\nimport PropTypes from \"prop-types\"\n\nimport loader from \"./loader\"\nimport InternalPageRenderer from \"./page-renderer\"\n\nconst ProdPageRenderer = ({ location }) => {\n const pageResources = loader.loadPageSync(location.pathname)\n if (!pageResources) {\n return null\n }\n return React.createElement(InternalPageRenderer, {\n location,\n pageResources,\n ...pageResources.json,\n })\n}\n\nProdPageRenderer.propTypes = {\n location: PropTypes.shape({\n pathname: PropTypes.string.isRequired,\n }).isRequired,\n}\n\nexport default ProdPageRenderer\n","const preferDefault = m => (m && m.default) || m\n\nif (process.env.BUILD_STAGE === `develop`) {\n module.exports = preferDefault(require(`./public-page-renderer-dev`))\n} else if (process.env.BUILD_STAGE === `build-javascript`) {\n module.exports = preferDefault(require(`./public-page-renderer-prod`))\n} else {\n module.exports = () => null\n}\n","exports.polyfill = Component => Component\n","import { apiRunner } from \"./api-runner-browser\"\n\nif (\n window.location.protocol !== `https:` &&\n window.location.hostname !== `localhost`\n) {\n console.error(\n `Service workers can only be used over HTTPS, or on localhost for development`\n )\n} else if (`serviceWorker` in navigator) {\n navigator.serviceWorker\n .register(`${__BASE_PATH__}/sw.js`)\n .then(function (reg) {\n reg.addEventListener(`updatefound`, () => {\n apiRunner(`onServiceWorkerUpdateFound`, { serviceWorker: reg })\n // The updatefound event implies that reg.installing is set; see\n // https://w3c.github.io/ServiceWorker/#service-worker-registration-updatefound-event\n const installingWorker = reg.installing\n console.log(`installingWorker`, installingWorker)\n installingWorker.addEventListener(`statechange`, () => {\n switch (installingWorker.state) {\n case `installed`:\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and the fresh content will\n // have been added to the cache.\n\n // We set a flag so Gatsby Link knows to refresh the page on next navigation attempt\n window.___swUpdated = true\n // We call the onServiceWorkerUpdateReady API so users can show update prompts.\n apiRunner(`onServiceWorkerUpdateReady`, { serviceWorker: reg })\n\n // If resources failed for the current page, reload.\n if (window.___failedResources) {\n console.log(`resources failed, SW updated - reloading`)\n window.location.reload()\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a \"Content is cached for offline use.\" message.\n console.log(`Content is now available offline!`)\n\n // Post to service worker that install is complete.\n // Delay to allow time for the event listener to be added --\n // otherwise fetch is called too soon and resources aren't cached.\n apiRunner(`onServiceWorkerInstalled`, { serviceWorker: reg })\n }\n break\n\n case `redundant`:\n console.error(`The installing service worker became redundant.`)\n apiRunner(`onServiceWorkerRedundant`, { serviceWorker: reg })\n break\n\n case `activated`:\n apiRunner(`onServiceWorkerActive`, { serviceWorker: reg })\n break\n }\n })\n })\n })\n .catch(function (e) {\n console.error(`Error during service worker registration:`, e)\n })\n}\n","/**\n * Remove a prefix from a string. Return the input string if the given prefix\n * isn't found.\n */\n\nexport default function stripPrefix(str, prefix = ``) {\n if (!prefix) {\n return str\n }\n\n if (str === prefix) {\n return `/`\n }\n\n if (str.startsWith(`${prefix}/`)) {\n return str.slice(prefix.length)\n }\n\n return str\n}\n","/* eslint-disable no-unused-expressions */\nimport { stripIndent } from \"common-tags\"\nimport camelCase from \"camelcase\"\nimport { IGatsbyImageData } from \".\"\n\nconst DEFAULT_PIXEL_DENSITIES = [0.25, 0.5, 1, 2]\nexport const DEFAULT_BREAKPOINTS = [750, 1080, 1366, 1920]\nexport const EVERY_BREAKPOINT = [\n 320,\n 654,\n 768,\n 1024,\n 1366,\n 1600,\n 1920,\n 2048,\n 2560,\n 3440,\n 3840,\n 4096,\n]\nconst DEFAULT_FLUID_WIDTH = 800\nconst DEFAULT_FIXED_WIDTH = 800\nconst DEFAULT_ASPECT_RATIO = 4 / 3\n\nexport type Fit = \"cover\" | \"fill\" | \"inside\" | \"outside\" | \"contain\"\n\nexport type Layout = \"fixed\" | \"fullWidth\" | \"constrained\"\nexport type ImageFormat = \"jpg\" | \"png\" | \"webp\" | \"avif\" | \"auto\" | \"\"\n\n/**\n * The minimal required reporter, as we don't want to import it from gatsby-cli\n */\nexport interface IReporter {\n warn(message: string): void\n}\n\nexport interface ISharpGatsbyImageArgs {\n layout?: Layout\n formats?: Array\n placeholder?: \"tracedSVG\" | \"dominantColor\" | \"blurred\" | \"none\"\n tracedSVGOptions?: Record\n width?: number\n height?: number\n aspectRatio?: number\n sizes?: string\n quality?: number\n transformOptions?: {\n fit?: Fit\n cropFocus?: number | string\n }\n jpgOptions?: Record\n pngOptions?: Record\n webpOptions?: Record\n avifOptions?: Record\n blurredOptions?: { width?: number; toFormat?: ImageFormat }\n breakpoints?: Array\n backgroundColor?: string\n}\n\nexport interface IImageSizeArgs {\n width?: number\n height?: number\n layout?: Layout\n filename: string\n outputPixelDensities?: Array\n breakpoints?: Array\n fit?: Fit\n reporter?: IReporter\n sourceMetadata: { width: number; height: number }\n}\n\nexport interface IImageSizes {\n sizes: Array\n presentationWidth: number\n presentationHeight: number\n aspectRatio: number\n unscaledWidth: number\n}\n\nexport interface IImage {\n src: string\n width: number\n height: number\n format: ImageFormat\n}\n\nexport interface IGatsbyImageHelperArgs {\n pluginName: string\n generateImageSource: (\n filename: string,\n width: number,\n height: number,\n format: ImageFormat,\n fit?: Fit,\n options?: Record\n ) => IImage\n layout?: Layout\n formats?: Array\n filename: string\n placeholderURL?: string\n width?: number\n height?: number\n sizes?: string\n reporter?: IReporter\n sourceMetadata?: { width: number; height: number; format: ImageFormat }\n fit?: Fit\n options?: Record\n breakpoints?: Array\n backgroundColor?: string\n aspectRatio?: number\n}\n\nconst warn = (message: string): void => console.warn(message)\n\nconst sortNumeric = (a: number, b: number): number => a - b\n\nexport const getSizes = (width: number, layout: Layout): string | undefined => {\n switch (layout) {\n // If screen is wider than the max size, image width is the max size,\n // otherwise it's the width of the screen\n case `constrained`:\n return `(min-width: ${width}px) ${width}px, 100vw`\n\n // Image is always the same width, whatever the size of the screen\n case `fixed`:\n return `${width}px`\n\n // Image is always the width of the screen\n case `fullWidth`:\n return `100vw`\n\n default:\n return undefined\n }\n}\n\nexport const getSrcSet = (images: Array): string =>\n images.map(image => `${image.src} ${image.width}w`).join(`,\\n`)\n\nexport function formatFromFilename(filename: string): ImageFormat | undefined {\n const dot = filename.lastIndexOf(`.`)\n if (dot !== -1) {\n const ext = filename.substr(dot + 1)\n if (ext === `jpeg`) {\n return `jpg`\n }\n if (ext.length === 3 || ext.length === 4) {\n return ext as ImageFormat\n }\n }\n return undefined\n}\n\nexport function setDefaultDimensions(\n args: IGatsbyImageHelperArgs\n): IGatsbyImageHelperArgs {\n let {\n layout = `constrained`,\n width,\n height,\n sourceMetadata,\n breakpoints,\n aspectRatio,\n formats = [`auto`, `webp`],\n } = args\n formats = formats.map(format => format.toLowerCase() as ImageFormat)\n layout = camelCase(layout) as Layout\n\n if (width && height) {\n return { ...args, formats, layout }\n }\n if (sourceMetadata.width && sourceMetadata.height && !aspectRatio) {\n aspectRatio = sourceMetadata.width / sourceMetadata.height\n }\n\n if (layout === `fullWidth`) {\n width = width || sourceMetadata.width || breakpoints[breakpoints.length - 1]\n height = height || Math.round(width / (aspectRatio || DEFAULT_ASPECT_RATIO))\n } else {\n if (!width) {\n if (height && aspectRatio) {\n width = height * aspectRatio\n } else if (sourceMetadata.width) {\n width = sourceMetadata.width\n } else if (height) {\n width = Math.round(height / DEFAULT_ASPECT_RATIO)\n } else {\n width = DEFAULT_FIXED_WIDTH\n }\n }\n\n if (aspectRatio && !height) {\n height = Math.round(width / aspectRatio)\n } else if (!aspectRatio) {\n aspectRatio = width / height\n }\n }\n return { ...args, width, height, aspectRatio, layout, formats }\n}\n\n/**\n * Use this for getting an image for the blurred placeholder. This ensures the\n * aspect ratio and crop match the main image\n */\nexport function getLowResolutionImageURL(\n args: IGatsbyImageHelperArgs,\n width = 20\n): string {\n args = setDefaultDimensions(args)\n const { generateImageSource, filename, aspectRatio } = args\n return generateImageSource(\n filename,\n width,\n Math.round(width / aspectRatio),\n args.sourceMetadata.format || `jpg`,\n args.fit,\n args.options\n )?.src\n}\n\nexport function generateImageData(\n args: IGatsbyImageHelperArgs\n): IGatsbyImageData {\n args = setDefaultDimensions(args)\n\n let {\n pluginName,\n sourceMetadata,\n generateImageSource,\n layout,\n fit,\n options,\n width,\n height,\n filename,\n reporter = { warn },\n backgroundColor,\n placeholderURL,\n } = args\n\n if (!pluginName) {\n reporter.warn(\n `[gatsby-plugin-image] \"generateImageData\" was not passed a plugin name`\n )\n }\n\n if (typeof generateImageSource !== `function`) {\n throw new Error(`generateImageSource must be a function`)\n }\n\n if (!sourceMetadata || (!sourceMetadata.width && !sourceMetadata.height)) {\n // No metadata means we let the CDN handle max size etc, aspect ratio etc\n sourceMetadata = {\n width,\n height,\n format: sourceMetadata?.format || formatFromFilename(filename) || `auto`,\n }\n } else if (!sourceMetadata.format) {\n sourceMetadata.format = formatFromFilename(filename)\n }\n\n const formats = new Set(args.formats)\n\n if (formats.size === 0 || formats.has(`auto`) || formats.has(``)) {\n formats.delete(`auto`)\n formats.delete(``)\n formats.add(sourceMetadata.format)\n }\n\n if (formats.has(`jpg`) && formats.has(`png`)) {\n reporter.warn(\n `[${pluginName}] Specifying both 'jpg' and 'png' formats is not supported. Using 'auto' instead`\n )\n if (sourceMetadata.format === `jpg`) {\n formats.delete(`png`)\n } else {\n formats.delete(`jpg`)\n }\n }\n\n const imageSizes = calculateImageSizes({ ...args, sourceMetadata })\n\n const result: IGatsbyImageData[\"images\"] = {\n sources: [],\n }\n\n let sizes = args.sizes\n if (!sizes) {\n sizes = getSizes(imageSizes.presentationWidth, layout)\n }\n\n formats.forEach(format => {\n const images = imageSizes.sizes\n .map(size => {\n const imageSrc = generateImageSource(\n filename,\n size,\n Math.round(size / imageSizes.aspectRatio),\n format,\n fit,\n options\n )\n if (\n !imageSrc?.width ||\n !imageSrc.height ||\n !imageSrc.src ||\n !imageSrc.format\n ) {\n reporter.warn(\n `[${pluginName}] The resolver for image ${filename} returned an invalid value.`\n )\n return undefined\n }\n return imageSrc\n })\n .filter(Boolean)\n\n if (format === `jpg` || format === `png` || format === `auto`) {\n const unscaled =\n images.find(img => img.width === imageSizes.unscaledWidth) || images[0]\n\n if (unscaled) {\n result.fallback = {\n src: unscaled.src,\n srcSet: getSrcSet(images),\n sizes,\n }\n }\n } else {\n result.sources?.push({\n srcSet: getSrcSet(images),\n sizes,\n type: `image/${format}`,\n })\n }\n })\n\n const imageProps: Partial = {\n images: result,\n layout,\n backgroundColor,\n }\n\n if (placeholderURL) {\n imageProps.placeholder = { fallback: placeholderURL }\n }\n\n switch (layout) {\n case `fixed`:\n imageProps.width = imageSizes.presentationWidth\n imageProps.height = imageSizes.presentationHeight\n break\n\n case `fullWidth`:\n imageProps.width = 1\n imageProps.height = 1 / imageSizes.aspectRatio\n break\n\n case `constrained`:\n imageProps.width = args.width || imageSizes.presentationWidth || 1\n imageProps.height = (imageProps.width || 1) / imageSizes.aspectRatio\n }\n\n return imageProps as IGatsbyImageData\n}\n\nconst dedupeAndSortDensities = (values: Array): Array =>\n Array.from(new Set([1, ...values])).sort(sortNumeric)\n\nexport function calculateImageSizes(args: IImageSizeArgs): IImageSizes {\n const {\n width,\n height,\n filename,\n layout = `constrained`,\n sourceMetadata: imgDimensions,\n reporter = { warn },\n breakpoints = DEFAULT_BREAKPOINTS,\n } = args\n\n // check that all dimensions provided are positive\n const userDimensions = { width, height }\n const erroneousUserDimensions = Object.entries(userDimensions).filter(\n ([_, size]) => typeof size === `number` && size < 1\n )\n if (erroneousUserDimensions.length) {\n throw new Error(\n `Specified dimensions for images must be positive numbers (> 0). Problem dimensions you have are ${erroneousUserDimensions\n .map(dim => dim.join(`: `))\n .join(`, `)}`\n )\n }\n\n if (layout === `fixed`) {\n return fixedImageSizes(args)\n } else if (layout === `constrained`) {\n return responsiveImageSizes(args)\n } else if (layout === `fullWidth`) {\n return responsiveImageSizes({ breakpoints, ...args })\n } else {\n reporter.warn(\n `No valid layout was provided for the image at ${filename}. Valid image layouts are fixed, fullWidth, and constrained. Found ${layout}`\n )\n return {\n sizes: [imgDimensions.width],\n presentationWidth: imgDimensions.width,\n presentationHeight: imgDimensions.height,\n aspectRatio: imgDimensions.width / imgDimensions.height,\n unscaledWidth: imgDimensions.width,\n }\n }\n}\nexport function fixedImageSizes({\n filename,\n sourceMetadata: imgDimensions,\n width,\n height,\n fit = `cover`,\n outputPixelDensities = DEFAULT_PIXEL_DENSITIES,\n reporter = { warn },\n}: IImageSizeArgs): IImageSizes {\n let aspectRatio = imgDimensions.width / imgDimensions.height\n // Sort, dedupe and ensure there's a 1\n const densities = dedupeAndSortDensities(outputPixelDensities)\n\n // If both are provided then we need to check the fit\n if (width && height) {\n const calculated = getDimensionsAndAspectRatio(imgDimensions, {\n width,\n height,\n fit,\n })\n width = calculated.width\n height = calculated.height\n aspectRatio = calculated.aspectRatio\n }\n\n if (!width) {\n if (!height) {\n width = DEFAULT_FIXED_WIDTH\n } else {\n width = Math.round(height * aspectRatio)\n }\n } else if (!height) {\n height = Math.round(width / aspectRatio)\n }\n\n const originalWidth = width // will use this for presentationWidth, don't want to lose it\n const isTopSizeOverriden =\n imgDimensions.width < width || imgDimensions.height < (height as number)\n\n // If the image is smaller than requested, warn the user that it's being processed as such\n // print out this message with the necessary information before we overwrite it for sizing\n if (isTopSizeOverriden) {\n const fixedDimension = imgDimensions.width < width ? `width` : `height`\n reporter.warn(stripIndent`\n The requested ${fixedDimension} \"${\n fixedDimension === `width` ? width : height\n }px\" for the image ${filename} was larger than the actual image ${fixedDimension} of ${\n imgDimensions[fixedDimension]\n }px. If possible, replace the current image with a larger one.`)\n\n if (fixedDimension === `width`) {\n width = imgDimensions.width\n height = Math.round(width / aspectRatio)\n } else {\n height = imgDimensions.height\n width = height * aspectRatio\n }\n }\n\n const sizes = densities\n .filter(size => size >= 1) // remove smaller densities because fixed images don't need them\n .map(density => Math.round(density * (width as number)))\n .filter(size => size <= imgDimensions.width)\n\n return {\n sizes,\n aspectRatio,\n presentationWidth: originalWidth,\n presentationHeight: Math.round(originalWidth / aspectRatio),\n unscaledWidth: width,\n }\n}\n\nexport function responsiveImageSizes({\n sourceMetadata: imgDimensions,\n width,\n height,\n fit = `cover`,\n outputPixelDensities = DEFAULT_PIXEL_DENSITIES,\n breakpoints,\n layout,\n}: IImageSizeArgs): IImageSizes {\n let sizes\n let aspectRatio = imgDimensions.width / imgDimensions.height\n // Sort, dedupe and ensure there's a 1\n const densities = dedupeAndSortDensities(outputPixelDensities)\n\n // If both are provided then we need to check the fit\n if (width && height) {\n const calculated = getDimensionsAndAspectRatio(imgDimensions, {\n width,\n height,\n fit,\n })\n width = calculated.width\n height = calculated.height\n aspectRatio = calculated.aspectRatio\n }\n\n // Case 1: width of height were passed in, make sure it isn't larger than the actual image\n width = width && Math.min(width, imgDimensions.width)\n height = height && Math.min(height, imgDimensions.height)\n\n // Case 2: neither width or height were passed in, use default size\n if (!width && !height) {\n width = Math.min(DEFAULT_FLUID_WIDTH, imgDimensions.width)\n height = width / aspectRatio\n }\n\n // if it still hasn't been found, calculate width from the derived height.\n // TS isn't smart enough to realise the type for height has been narrowed here\n if (!width) {\n width = (height as number) * aspectRatio\n }\n\n const originalWidth = width\n const isTopSizeOverriden =\n imgDimensions.width < width || imgDimensions.height < (height as number)\n if (isTopSizeOverriden) {\n width = imgDimensions.width\n height = imgDimensions.height\n }\n\n width = Math.round(width)\n\n if (breakpoints?.length > 0) {\n sizes = breakpoints.filter(size => size <= imgDimensions.width)\n\n // If a larger breakpoint has been filtered-out, add the actual image width instead\n if (\n sizes.length < breakpoints.length &&\n !sizes.includes(imgDimensions.width)\n ) {\n sizes.push(imgDimensions.width)\n }\n } else {\n sizes = densities.map(density => Math.round(density * (width as number)))\n sizes = sizes.filter(size => size <= imgDimensions.width)\n }\n\n // ensure that the size passed in is included in the final output\n if (layout === `constrained` && !sizes.includes(width)) {\n sizes.push(width)\n }\n sizes = sizes.sort(sortNumeric)\n return {\n sizes,\n aspectRatio,\n presentationWidth: originalWidth,\n presentationHeight: Math.round(originalWidth / aspectRatio),\n unscaledWidth: width,\n }\n}\n\nexport function getDimensionsAndAspectRatio(\n dimensions,\n options\n): { width: number; height: number; aspectRatio: number } {\n // Calculate the eventual width/height of the image.\n const imageAspectRatio = dimensions.width / dimensions.height\n\n let width = options.width\n let height = options.height\n\n switch (options.fit) {\n case `fill`: {\n width = options.width ? options.width : dimensions.width\n height = options.height ? options.height : dimensions.height\n break\n }\n case `inside`: {\n const widthOption = options.width\n ? options.width\n : Number.MAX_SAFE_INTEGER\n const heightOption = options.height\n ? options.height\n : Number.MAX_SAFE_INTEGER\n\n width = Math.min(widthOption, Math.round(heightOption * imageAspectRatio))\n height = Math.min(\n heightOption,\n Math.round(widthOption / imageAspectRatio)\n )\n break\n }\n case `outside`: {\n const widthOption = options.width ? options.width : 0\n const heightOption = options.height ? options.height : 0\n\n width = Math.max(widthOption, Math.round(heightOption * imageAspectRatio))\n height = Math.max(\n heightOption,\n Math.round(widthOption / imageAspectRatio)\n )\n break\n }\n\n default: {\n if (options.width && !options.height) {\n width = options.width\n height = Math.round(options.width / imageAspectRatio)\n }\n\n if (options.height && !options.width) {\n width = Math.round(options.height * imageAspectRatio)\n height = options.height\n }\n }\n }\n\n return {\n width,\n height,\n aspectRatio: width / height,\n }\n}\n","/* eslint-disable no-unused-expressions */\nimport {\n useState,\n CSSProperties,\n useEffect,\n HTMLAttributes,\n ImgHTMLAttributes,\n ReactEventHandler,\n SetStateAction,\n Dispatch,\n RefObject,\n} from \"react\"\nimport { Node } from \"gatsby\"\nimport { PlaceholderProps } from \"./placeholder\"\nimport { MainImageProps } from \"./main-image\"\nimport type { IGatsbyImageData } from \"./gatsby-image.browser\"\nimport {\n IGatsbyImageHelperArgs,\n generateImageData,\n Layout,\n EVERY_BREAKPOINT,\n IImage,\n ImageFormat,\n} from \"../image-utils\"\nconst imageCache = new Set()\n\n// Native lazy-loading support: https://addyosmani.com/blog/lazy-loading/\nexport const hasNativeLazyLoadSupport = (): boolean =>\n typeof HTMLImageElement !== `undefined` &&\n `loading` in HTMLImageElement.prototype\n\nexport function storeImageloaded(cacheKey?: string): void {\n if (cacheKey) {\n imageCache.add(cacheKey)\n }\n}\n\nexport function hasImageLoaded(cacheKey: string): boolean {\n return imageCache.has(cacheKey)\n}\nexport type IGatsbyImageDataParent = T & {\n gatsbyImageData: IGatsbyImageData\n}\nexport type FileNode = Node & {\n childImageSharp?: IGatsbyImageDataParent\n}\n\nconst isGatsbyImageData = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: IGatsbyImageData | any\n): node is IGatsbyImageData =>\n // 🦆 check for a deep prop to be sure this is a valid gatsbyImageData object\n Boolean(node?.images?.fallback?.src)\n\nconst isGatsbyImageDataParent = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: IGatsbyImageDataParent | any\n): node is IGatsbyImageDataParent => Boolean(node?.gatsbyImageData)\n\ntype ImageDataLike = FileNode | IGatsbyImageDataParent | IGatsbyImageData\nexport const getImage = (node: ImageDataLike): IGatsbyImageData | undefined => {\n if (isGatsbyImageData(node)) {\n return node\n }\n if (isGatsbyImageDataParent(node)) {\n return node.gatsbyImageData\n }\n return node?.childImageSharp?.gatsbyImageData\n}\n\nexport const getSrc = (node: ImageDataLike): string | undefined =>\n getImage(node)?.images?.fallback?.src\n\nexport const getSrcSet = (node: ImageDataLike): string | undefined =>\n getImage(node)?.images?.fallback?.srcSet\n\nexport function getWrapperProps(\n width: number,\n height: number,\n layout: Layout\n): Pick, \"className\" | \"style\"> & {\n \"data-gatsby-image-wrapper\": string\n} {\n const wrapperStyle: CSSProperties = {}\n\n let className = `gatsby-image-wrapper`\n\n // If the plugin isn't installed we need to apply the styles inline\n if (!global.GATSBY___IMAGE) {\n wrapperStyle.position = `relative`\n wrapperStyle.overflow = `hidden`\n }\n\n if (layout === `fixed`) {\n wrapperStyle.width = width\n wrapperStyle.height = height\n } else if (layout === `constrained`) {\n if (!global.GATSBY___IMAGE) {\n wrapperStyle.display = `inline-block`\n }\n className = `gatsby-image-wrapper gatsby-image-wrapper-constrained`\n }\n\n return {\n className,\n \"data-gatsby-image-wrapper\": ``,\n style: wrapperStyle,\n }\n}\n\nexport async function applyPolyfill(\n ref: RefObject\n): Promise {\n if (!(`objectFitPolyfill` in window)) {\n await import(\n /* webpackChunkName: \"gatsby-plugin-image-objectfit-polyfill\" */ `objectFitPolyfill`\n )\n }\n ;(window as any).objectFitPolyfill(ref.current)\n}\n\nexport interface IUrlBuilderArgs {\n width: number\n height: number\n baseUrl: string\n format: ImageFormat\n options: OptionsType\n}\nexport interface IGetImageDataArgs> {\n baseUrl: string\n /**\n * For constrained and fixed images, the size of the image element\n */\n width?: number\n height?: number\n /**\n * If available, pass the source image width and height\n */\n sourceWidth?: number\n sourceHeight?: number\n /**\n * If only one dimension is passed, then this will be used to calculate the other.\n */\n aspectRatio?: number\n layout?: Layout\n /**\n * Returns a URL based on the passed arguments. Should be a pure function\n */\n urlBuilder: (args: IUrlBuilderArgs) => string\n\n /**\n * Should be a data URI\n */\n placeholderURL?: string\n backgroundColor?: string\n /**\n * Used in error messages etc\n */\n pluginName?: string\n\n /**\n * If you do not support auto-format, pass an array of image types here\n */\n formats?: Array\n\n breakpoints?: Array\n\n /**\n * Passed to the urlBuilder function\n */\n options?: OptionsType\n}\n\n/**\n * Use this hook to generate gatsby-plugin-image data in the browser.\n */\nexport function getImageData({\n baseUrl,\n urlBuilder,\n sourceWidth,\n sourceHeight,\n pluginName = `getImageData`,\n formats = [`auto`],\n breakpoints,\n options,\n ...props\n}: IGetImageDataArgs): IGatsbyImageData {\n if (\n !breakpoints?.length &&\n (props.layout === `fullWidth` || (props.layout as string) === `FULL_WIDTH`)\n ) {\n breakpoints = EVERY_BREAKPOINT\n }\n const generateImageSource = (\n baseUrl: string,\n width: number,\n height?: number,\n format?: ImageFormat\n ): IImage => {\n return {\n width,\n height,\n format,\n src: urlBuilder({ baseUrl, width, height, options, format }),\n }\n }\n\n const sourceMetadata: IGatsbyImageHelperArgs[\"sourceMetadata\"] = {\n width: sourceWidth,\n height: sourceHeight,\n format: `auto`,\n }\n\n const args: IGatsbyImageHelperArgs = {\n ...props,\n pluginName,\n generateImageSource,\n filename: baseUrl,\n formats,\n breakpoints,\n sourceMetadata,\n }\n return generateImageData(args)\n}\n\nexport function getMainProps(\n isLoading: boolean,\n isLoaded: boolean,\n images: IGatsbyImageData[\"images\"],\n loading?: \"eager\" | \"lazy\",\n toggleLoaded?: (loaded: boolean) => void,\n cacheKey?: string,\n ref?: RefObject,\n style: CSSProperties = {}\n): Partial {\n const onLoad: ReactEventHandler = function (e) {\n if (isLoaded) {\n return\n }\n\n storeImageloaded(cacheKey)\n\n const target = e.currentTarget\n const img = new Image()\n img.src = target.currentSrc\n\n if (img.decode) {\n // Decode the image through javascript to support our transition\n img\n .decode()\n .catch(() => {\n // ignore error, we just go forward\n })\n .then(() => {\n toggleLoaded(true)\n })\n } else {\n toggleLoaded(true)\n }\n }\n\n // Polyfill \"object-fit\" if unsupported (mostly IE)\n if (ref?.current && !(`objectFit` in document.documentElement.style)) {\n ref.current.dataset.objectFit = style.objectFit ?? `cover`\n ref.current.dataset.objectPosition = `${style.objectPosition ?? `50% 50%`}`\n applyPolyfill(ref)\n }\n\n // fallback when it's not configured in gatsby-config.\n if (!global.GATSBY___IMAGE) {\n style = {\n height: `100%`,\n left: 0,\n position: `absolute`,\n top: 0,\n transform: `translateZ(0)`,\n transition: `opacity 250ms linear`,\n width: `100%`,\n willChange: `opacity`,\n ...style,\n }\n }\n\n const result = {\n ...images,\n loading,\n shouldLoad: isLoading,\n \"data-main-image\": ``,\n style: {\n ...style,\n opacity: isLoaded ? 1 : 0,\n },\n onLoad,\n ref,\n }\n\n return result\n}\n\nexport type PlaceholderImageAttrs = ImgHTMLAttributes &\n Pick & {\n \"data-placeholder-image\"?: string\n }\n\nexport function getPlaceholderProps(\n placeholder: PlaceholderImageAttrs | undefined,\n isLoaded: boolean,\n layout: Layout,\n width?: number,\n height?: number,\n backgroundColor?: string\n): PlaceholderImageAttrs {\n const wrapperStyle: CSSProperties = {}\n\n if (backgroundColor) {\n wrapperStyle.backgroundColor = backgroundColor\n\n if (layout === `fixed`) {\n wrapperStyle.width = width\n wrapperStyle.height = height\n wrapperStyle.backgroundColor = backgroundColor\n wrapperStyle.position = `relative`\n } else if (layout === `constrained`) {\n wrapperStyle.position = `absolute`\n wrapperStyle.top = 0\n wrapperStyle.left = 0\n wrapperStyle.bottom = 0\n wrapperStyle.right = 0\n } else if (layout === `fullWidth`) {\n wrapperStyle.position = `absolute`\n wrapperStyle.top = 0\n wrapperStyle.left = 0\n wrapperStyle.bottom = 0\n wrapperStyle.right = 0\n }\n }\n\n const result: PlaceholderImageAttrs = {\n ...placeholder,\n \"aria-hidden\": true,\n \"data-placeholder-image\": ``,\n style: {\n opacity: isLoaded ? 0 : 1,\n transition: `opacity 500ms linear`,\n ...wrapperStyle,\n },\n }\n\n // fallback when it's not configured in gatsby-config.\n if (!global.GATSBY___IMAGE) {\n result.style = {\n height: `100%`,\n left: 0,\n position: `absolute`,\n top: 0,\n width: `100%`,\n }\n }\n\n return result\n}\n\nexport function useImageLoaded(\n cacheKey: string,\n loading: \"lazy\" | \"eager\",\n ref: any\n): {\n isLoaded: boolean\n isLoading: boolean\n toggleLoaded: Dispatch>\n} {\n const [isLoaded, toggleLoaded] = useState(false)\n const [isLoading, toggleIsLoading] = useState(loading === `eager`)\n\n const rAF =\n typeof window !== `undefined` && `requestAnimationFrame` in window\n ? requestAnimationFrame\n : function (cb: TimerHandler): number {\n return setTimeout(cb, 16)\n }\n const cRAF =\n typeof window !== `undefined` && `cancelAnimationFrame` in window\n ? cancelAnimationFrame\n : clearTimeout\n\n useEffect(() => {\n let interval: number\n // @see https://stackoverflow.com/questions/44074747/componentdidmount-called-before-ref-callback/50019873#50019873\n function toggleIfRefExists(): void {\n if (ref.current) {\n if (loading === `eager` && ref.current.complete) {\n storeImageloaded(cacheKey)\n toggleLoaded(true)\n } else {\n toggleIsLoading(true)\n }\n } else {\n interval = rAF(toggleIfRefExists)\n }\n }\n toggleIfRefExists()\n\n return (): void => {\n cRAF(interval)\n }\n }, [])\n\n return {\n isLoading,\n isLoaded,\n toggleLoaded,\n }\n}\n\nexport interface IArtDirectedImage {\n media: string\n image: IGatsbyImageData\n}\n\n/**\n * Generate a Gatsby image data object with multiple, art-directed images that display at different\n * resolutions.\n *\n * @param defaultImage The image displayed when no media query matches.\n * It is also used for all other settings applied to the image, such as width, height and layout.\n * You should pass a className to the component with media queries to adjust the size of the container,\n * as this cannot be adjusted automatically.\n * @param artDirected Array of objects which each contains a `media` string which is a media query\n * such as `(min-width: 320px)`, and the image object to use when that query matches.\n */\nexport function withArtDirection(\n defaultImage: IGatsbyImageData,\n artDirected: Array\n): IGatsbyImageData {\n const { images, placeholder, ...props } = defaultImage\n const output: IGatsbyImageData = {\n ...props,\n images: {\n ...images,\n sources: [],\n },\n placeholder: placeholder && {\n ...placeholder,\n sources: [],\n },\n }\n\n artDirected.forEach(({ media, image }) => {\n if (!media) {\n if (process.env.NODE_ENV === `development`) {\n console.warn(\n \"[gatsby-plugin-image] All art-directed images passed to must have a value set for `media`. Skipping.\"\n )\n }\n return\n }\n\n if (\n image.layout !== defaultImage.layout &&\n process.env.NODE_ENV === `development`\n ) {\n console.warn(\n `[gatsby-plugin-image] Mismatched image layout: expected \"${defaultImage.layout}\" but received \"${image.layout}\". All art-directed images use the same layout as the default image`\n )\n }\n\n output.images.sources.push(\n ...image.images.sources.map(source => {\n return { ...source, media }\n }),\n {\n media,\n srcSet: image.images.fallback.srcSet,\n }\n )\n\n if (!output.placeholder) {\n return\n }\n\n output.placeholder.sources.push({\n media,\n srcSet: image.placeholder.fallback,\n })\n })\n output.images.sources.push(...images.sources)\n if (placeholder?.sources) {\n output.placeholder?.sources.push(...placeholder.sources)\n }\n return output\n}\n","// eslint-disable-next-line @typescript-eslint/triple-slash-reference\n/// \n\nimport React, { Fragment, FunctionComponent, ReactElement } from \"react\"\nimport terserMacro from \"../../macros/terser.macro\"\nimport { Layout } from \"../image-utils\"\n\nexport interface ILayoutWrapperProps {\n layout: Layout\n width: number\n height: number\n}\n\nconst NativeScriptLoading: FunctionComponent = () => (\n \n)\n\nexport function getSizer(\n layout: Layout,\n width: number,\n height: number\n): string {\n let sizer: string | null = null\n if (layout === `fullWidth`) {\n sizer = `
`\n }\n if (layout === `constrained`) {\n sizer = `
\"\"
`\n }\n return sizer\n}\n\nexport const LayoutWrapper: FunctionComponent = function LayoutWrapper({\n layout,\n width,\n height,\n children,\n}) {\n let sizer: ReactElement | null = null\n if (layout === `fullWidth`) {\n sizer = (\n
\n )\n }\n if (layout === `constrained`) {\n sizer = (\n
\n \n
\n )\n }\n return (\n \n {sizer}\n {children}\n\n {\n // eslint-disable-next-line no-undef\n SERVER && \n }\n \n )\n}\n","/* eslint-disable filenames/match-regex */\nimport React, {\n FunctionComponent,\n ImgHTMLAttributes,\n forwardRef,\n LegacyRef,\n} from \"react\"\nimport * as PropTypes from \"prop-types\"\n\nexport interface IResponsiveImageProps {\n sizes?: string\n srcSet: string\n}\n\nexport type SourceProps = IResponsiveImageProps &\n (\n | {\n media: string\n type?: string\n }\n | {\n media?: string\n type: string\n }\n )\n\ntype FallbackProps = { src: string } & Partial\n\ntype ImageProps = ImgHTMLAttributes & {\n src: string\n alt: string\n shouldLoad: boolean\n innerRef: LegacyRef\n}\n\nexport type PictureProps = ImgHTMLAttributes & {\n fallback?: FallbackProps\n sources?: Array\n alt: string\n shouldLoad?: boolean\n}\n\nconst Image: FunctionComponent = function Image({\n src,\n srcSet,\n loading,\n alt = ``,\n shouldLoad,\n innerRef,\n ...props\n}) {\n return (\n \n )\n}\n\nexport const Picture = forwardRef(\n function Picture(\n { fallback, sources = [], shouldLoad = true, ...props },\n ref\n ) {\n const sizes = props.sizes || fallback?.sizes\n const fallbackImage = (\n \n )\n\n if (!sources.length) {\n return fallbackImage\n }\n\n return (\n \n {sources.map(({ media, srcSet, type }) => (\n \n ))}\n {fallbackImage}\n \n )\n }\n)\n\nImage.propTypes = {\n src: PropTypes.string.isRequired,\n alt: PropTypes.string.isRequired,\n sizes: PropTypes.string,\n srcSet: PropTypes.string,\n shouldLoad: PropTypes.bool,\n}\n\nPicture.displayName = `Picture`\nPicture.propTypes = {\n alt: PropTypes.string.isRequired,\n shouldLoad: PropTypes.bool,\n fallback: PropTypes.exact({\n src: PropTypes.string.isRequired,\n srcSet: PropTypes.string,\n sizes: PropTypes.string,\n }),\n sources: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.exact({\n media: PropTypes.string.isRequired,\n type: PropTypes.string,\n sizes: PropTypes.string,\n srcSet: PropTypes.string.isRequired,\n }),\n PropTypes.exact({\n media: PropTypes.string,\n type: PropTypes.string.isRequired,\n sizes: PropTypes.string,\n srcSet: PropTypes.string.isRequired,\n }),\n ])\n ),\n}\n","import React, { FunctionComponent, ImgHTMLAttributes } from \"react\"\nimport * as PropTypes from \"prop-types\"\nimport { Picture, SourceProps } from \"./picture\"\n\nexport type PlaceholderProps = ImgHTMLAttributes & {\n fallback?: string\n sources?: Array\n}\n\nexport const Placeholder: FunctionComponent = function Placeholder({\n fallback,\n ...props\n}) {\n if (fallback) {\n return (\n \n )\n } else {\n return
\n }\n}\n\nPlaceholder.displayName = `Placeholder`\nPlaceholder.propTypes = {\n fallback: PropTypes.string,\n sources: Picture.propTypes?.sources,\n alt: function (props, propName, componentName): Error | null {\n if (!props[propName]) {\n return null\n }\n return new Error(\n `Invalid prop \\`${propName}\\` supplied to \\`${componentName}\\`. Validation failed.`\n )\n },\n}\n","import React, { forwardRef } from \"react\"\nimport { Picture, PictureProps } from \"./picture\"\n\nexport type MainImageProps = PictureProps\n\nexport const MainImage = forwardRef(\n function MainImage(props, ref) {\n return (\n <>\n \n \n \n )\n }\n)\n\nMainImage.displayName = `MainImage`\nMainImage.propTypes = Picture.propTypes\n","import React, {\n ElementType,\n FunctionComponent,\n CSSProperties,\n WeakValidationMap,\n} from \"react\"\nimport { GatsbyImageProps, IGatsbyImageData } from \"./gatsby-image.browser\"\nimport { getWrapperProps, getMainProps, getPlaceholderProps } from \"./hooks\"\nimport { Placeholder } from \"./placeholder\"\nimport { MainImage, MainImageProps } from \"./main-image\"\nimport { LayoutWrapper } from \"./layout-wrapper\"\nimport PropTypes from \"prop-types\"\n\nconst removeNewLines = (str: string): string => str.replace(/\\n/g, ``)\n\nexport const GatsbyImageHydrator: FunctionComponent<{\n as?: ElementType\n style?: CSSProperties\n className?: string\n}> = function GatsbyImageHydrator({ as: Type = `div`, children, ...props }) {\n return {children}\n}\n\nexport const GatsbyImage: FunctionComponent = function GatsbyImage({\n as,\n className,\n class: preactClass,\n style,\n image,\n loading = `lazy`,\n imgClassName,\n imgStyle,\n backgroundColor,\n objectFit,\n objectPosition,\n ...props\n}) {\n if (!image) {\n console.warn(`[gatsby-plugin-image] Missing image prop`)\n return null\n }\n if (preactClass) {\n className = preactClass\n }\n imgStyle = {\n objectFit,\n objectPosition,\n backgroundColor,\n ...imgStyle,\n }\n\n const {\n width,\n height,\n layout,\n images,\n placeholder,\n backgroundColor: placeholderBackgroundColor,\n } = image\n\n const { style: wStyle, className: wClass, ...wrapperProps } = getWrapperProps(\n width,\n height,\n layout\n )\n\n const cleanedImages: IGatsbyImageData[\"images\"] = {\n fallback: undefined,\n sources: [],\n }\n if (images.fallback) {\n cleanedImages.fallback = {\n ...images.fallback,\n srcSet: images.fallback.srcSet\n ? removeNewLines(images.fallback.srcSet)\n : undefined,\n }\n }\n\n if (images.sources) {\n cleanedImages.sources = images.sources.map(source => {\n return {\n ...source,\n srcSet: removeNewLines(source.srcSet),\n }\n })\n }\n\n return (\n \n \n \n\n )}\n // When eager is set we want to start the isLoading state on true (we want to load the img without react)\n {...getMainProps(\n loading === `eager`,\n false,\n cleanedImages,\n loading,\n undefined,\n undefined,\n undefined,\n imgStyle\n )}\n />\n \n \n )\n}\n\nexport const altValidator: PropTypes.Validator = (\n props: GatsbyImageProps,\n propName,\n componentName,\n ...rest\n): Error | undefined => {\n if (!props.alt && props.alt !== ``) {\n return new Error(\n `The \"alt\" prop is required in ${componentName}. 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`\n )\n }\n return PropTypes.string(props, propName, componentName, ...rest)\n}\nexport const propTypes = {\n image: PropTypes.object.isRequired,\n alt: altValidator,\n} as WeakValidationMap\n","/* eslint-disable no-unused-expressions */\nimport React, {\n ElementType,\n useEffect,\n useRef,\n FunctionComponent,\n ImgHTMLAttributes,\n useState,\n RefObject,\n CSSProperties,\n} from \"react\"\nimport {\n getWrapperProps,\n hasNativeLazyLoadSupport,\n storeImageloaded,\n} from \"./hooks\"\nimport { PlaceholderProps } from \"./placeholder\"\nimport { MainImageProps } from \"./main-image\"\nimport { Layout } from \"../image-utils\"\nimport { getSizer } from \"./layout-wrapper\"\nimport { propTypes } from \"./gatsby-image.server\"\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface GatsbyImageProps\n extends Omit<\n ImgHTMLAttributes,\n \"placeholder\" | \"onLoad\" | \"src\" | \"srcSet\" | \"width\" | \"height\"\n > {\n alt: string\n as?: ElementType\n className?: string\n class?: string\n imgClassName?: string\n image: IGatsbyImageData\n imgStyle?: CSSProperties\n backgroundColor?: string\n objectFit?: CSSProperties[\"objectFit\"]\n objectPosition?: CSSProperties[\"objectPosition\"]\n onLoad?: () => void\n onError?: () => void\n onStartLoad?: (props: { wasCached?: boolean }) => void\n}\n\nexport interface IGatsbyImageData {\n layout: Layout\n width: number\n height: number\n backgroundColor?: string\n images: Pick\n placeholder?: Pick\n}\n\nlet hasShownWarning = false\n\nexport const GatsbyImageHydrator: FunctionComponent = function GatsbyImageHydrator({\n as: Type = `div`,\n style,\n className,\n class: preactClass,\n onStartLoad,\n image,\n onLoad: customOnLoad,\n backgroundColor,\n loading = `lazy`,\n ...props\n}) {\n if (!image) {\n if (process.env.NODE_ENV === `development`) {\n console.warn(`[gatsby-plugin-image] Missing image prop`)\n }\n return null\n }\n if (preactClass) {\n className = preactClass\n }\n const { width, height, layout, images } = image\n\n const root = useRef()\n const hydrated = useRef(false)\n const unobserveRef = useRef<\n ((element: RefObject) => void) | null\n >(null)\n const lazyHydrator = useRef<(() => void) | null>(null)\n const ref = useRef()\n const [isLoading, toggleIsLoading] = useState(hasNativeLazyLoadSupport())\n const [isLoaded, toggleIsLoaded] = useState(false)\n\n if (!global.GATSBY___IMAGE && !hasShownWarning) {\n hasShownWarning = true\n console.warn(\n `[gatsby-plugin-image] You're missing out on some cool performance features. Please add \"gatsby-plugin-image\" to your gatsby-config.js`\n )\n }\n\n const { style: wStyle, className: wClass, ...wrapperProps } = getWrapperProps(\n width,\n height,\n layout\n )\n\n useEffect((): (() => void) | undefined => {\n if (root.current) {\n const hasSSRHtml = root.current.querySelector(\n `[data-gatsby-image-ssr]`\n ) as HTMLImageElement\n\n // when SSR and native lazyload is supported we'll do nothing ;)\n if (hasNativeLazyLoadSupport() && hasSSRHtml && global.GATSBY___IMAGE) {\n onStartLoad?.({ wasCached: false })\n\n if (hasSSRHtml.complete) {\n customOnLoad?.()\n storeImageloaded(JSON.stringify(images))\n } else {\n hasSSRHtml.addEventListener(`load`, function onLoad() {\n hasSSRHtml.removeEventListener(`load`, onLoad)\n\n customOnLoad?.()\n storeImageloaded(JSON.stringify(images))\n })\n }\n return undefined\n }\n\n // Fallback to custom lazy loading (intersection observer)\n import(`./intersection-observer`).then(\n ({ createIntersectionObserver }) => {\n const intersectionObserver = createIntersectionObserver(() => {\n if (root.current) {\n onStartLoad?.({ wasCached: false })\n toggleIsLoading(true)\n }\n })\n\n if (root.current) {\n unobserveRef.current = intersectionObserver(root)\n }\n }\n )\n }\n\n return (): void => {\n if (unobserveRef.current) {\n unobserveRef.current(root)\n\n // on unmount, make sure we cleanup\n if (hydrated.current && lazyHydrator.current) {\n lazyHydrator.current()\n }\n }\n }\n }, [])\n\n useEffect(() => {\n if (root.current) {\n const hasSSRHtml = root.current.querySelector(`[data-gatsby-image-ssr]`)\n // On first server hydration do nothing\n if (hasNativeLazyLoadSupport() && hasSSRHtml && !hydrated.current) {\n hydrated.current = true\n return\n }\n\n import(`./lazy-hydrate`).then(({ lazyHydrate }) => {\n lazyHydrator.current = lazyHydrate(\n {\n image,\n isLoading,\n isLoaded,\n toggleIsLoaded: () => {\n customOnLoad?.()\n toggleIsLoaded(true)\n },\n ref,\n loading,\n ...props,\n },\n root,\n hydrated\n )\n })\n }\n }, [\n width,\n height,\n layout,\n images,\n isLoading,\n isLoaded,\n toggleIsLoaded,\n ref,\n props,\n ])\n\n const sizer = getSizer(layout, width, height)\n\n return (\n \n )\n}\n\nexport const GatsbyImage: FunctionComponent = function GatsbyImage(\n props\n) {\n return \n}\n\nGatsbyImage.propTypes = propTypes\n\nGatsbyImage.displayName = `GatsbyImage`\n","import React, { FunctionComponent, ReactElement } from \"react\"\nimport {\n altValidator,\n GatsbyImage as GatsbyImageServer,\n} from \"./gatsby-image.server\"\nimport { GatsbyImageProps, IGatsbyImageData } from \"./gatsby-image.browser\"\nimport PropTypes from \"prop-types\"\nimport { ISharpGatsbyImageArgs } from \"../image-utils\"\n\nexport interface IStaticImageProps\n extends Omit,\n Omit {\n src: string\n}\n\n// These values are added by Babel. Do not add them manually\ninterface IPrivateProps {\n __imageData?: IGatsbyImageData\n __error?: string\n}\n\nexport function _getStaticImage(\n GatsbyImage: FunctionComponent\n): React.FC {\n return function StaticImage({\n src,\n __imageData: imageData,\n __error,\n // We extract these because they're not meant to be passed-down to GatsbyImage\n /* eslint-disable @typescript-eslint/no-unused-vars */\n width,\n height,\n aspectRatio,\n tracedSVGOptions,\n placeholder,\n formats,\n quality,\n transformOptions,\n jpgOptions,\n pngOptions,\n webpOptions,\n avifOptions,\n blurredOptions,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...props\n }): ReactElement {\n if (__error) {\n console.warn(__error)\n }\n\n if (imageData) {\n return \n }\n console.warn(`Image not loaded`, src)\n if (!__error && process.env.NODE_ENV === `development`) {\n console.warn(\n `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`\n )\n }\n return null\n }\n}\n\nconst StaticImage: React.FC<\n IStaticImageProps & IPrivateProps\n> = _getStaticImage(GatsbyImageServer)\n\nconst checkDimensionProps: PropTypes.Validator = (\n props: IStaticImageProps & IPrivateProps,\n propName: keyof IStaticImageProps & IPrivateProps,\n ...rest\n) => {\n if (\n props.layout === `fullWidth` &&\n (propName === `width` || propName === `height`) &&\n props[propName]\n ) {\n return new Error(\n `\"${propName}\" ${props[propName]} may not be passed when layout is fullWidth.`\n )\n }\n return PropTypes.number(props, propName, ...rest)\n}\n\nconst validLayouts = new Set([`fixed`, `fullWidth`, `constrained`])\n\nexport const propTypes = {\n src: PropTypes.string.isRequired,\n alt: altValidator,\n width: checkDimensionProps,\n height: checkDimensionProps,\n sizes: PropTypes.string,\n layout: (props: IStaticImageProps & IPrivateProps): Error | undefined => {\n if (props.layout === undefined) {\n return undefined\n }\n if (validLayouts.has(props.layout)) {\n return undefined\n }\n\n return new Error(\n `Invalid value ${props.layout}\" provided for prop \"layout\". Defaulting to \"constrained\". Valid values are \"fixed\", \"fullWidth\" or \"constrained\".`\n )\n },\n}\n\nStaticImage.displayName = `StaticImage`\nStaticImage.propTypes = propTypes\n\nexport { StaticImage }\n","import {\n GatsbyImage as GatsbyImageBrowser,\n IGatsbyImageData,\n} from \"./gatsby-image.browser\"\nimport React from \"react\"\nimport {\n _getStaticImage,\n propTypes,\n IStaticImageProps,\n} from \"./static-image.server\"\n// These values are added by Babel. Do not add them manually\ninterface IPrivateProps {\n __imageData?: IGatsbyImageData\n __error?: string\n}\n\nconst StaticImage: React.FC<\n IStaticImageProps & IPrivateProps\n> = _getStaticImage(GatsbyImageBrowser)\n\nStaticImage.displayName = `StaticImage`\nStaticImage.propTypes = propTypes\n\nexport { StaticImage }\n","import * as React from \"react\"\nexport function LaterHydrator({\n children,\n}: React.PropsWithChildren>): React.ReactNode {\n React.useEffect(() => {\n // eslint-disable-next-line no-unused-expressions\n import(`./lazy-hydrate`)\n }, [])\n\n return children\n}\n","import React from \"react\"\nimport { LaterHydrator } from \".\"\n\nexport function wrapRootElement({ element }) {\n return {element}\n}","'use strict';\n\nconst preserveCamelCase = string => {\n\tlet isLastCharLower = false;\n\tlet isLastCharUpper = false;\n\tlet isLastLastCharUpper = false;\n\n\tfor (let i = 0; i < string.length; i++) {\n\t\tconst character = string[i];\n\n\t\tif (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) {\n\t\t\tstring = string.slice(0, i) + '-' + string.slice(i);\n\t\t\tisLastCharLower = false;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = true;\n\t\t\ti++;\n\t\t} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) {\n\t\t\tstring = string.slice(0, i - 1) + '-' + string.slice(i - 1);\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = false;\n\t\t\tisLastCharLower = true;\n\t\t} else {\n\t\t\tisLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character;\n\t\t}\n\t}\n\n\treturn string;\n};\n\nconst camelCase = (input, options) => {\n\tif (!(typeof input === 'string' || Array.isArray(input))) {\n\t\tthrow new TypeError('Expected the input to be `string | string[]`');\n\t}\n\n\toptions = Object.assign({\n\t\tpascalCase: false\n\t}, options);\n\n\tconst postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x;\n\n\tif (Array.isArray(input)) {\n\t\tinput = input.map(x => x.trim())\n\t\t\t.filter(x => x.length)\n\t\t\t.join('-');\n\t} else {\n\t\tinput = input.trim();\n\t}\n\n\tif (input.length === 0) {\n\t\treturn '';\n\t}\n\n\tif (input.length === 1) {\n\t\treturn options.pascalCase ? input.toUpperCase() : input.toLowerCase();\n\t}\n\n\tconst hasUpperCase = input !== input.toLowerCase();\n\n\tif (hasUpperCase) {\n\t\tinput = preserveCamelCase(input);\n\t}\n\n\tinput = input\n\t\t.replace(/^[_.\\- ]+/, '')\n\t\t.toLowerCase()\n\t\t.replace(/[_.\\- ]+(\\w|$)/g, (_, p1) => p1.toUpperCase())\n\t\t.replace(/\\d+(\\w|$)/g, m => m.toUpperCase());\n\n\treturn postProcess(input);\n};\n\nmodule.exports = camelCase;\n// TODO: Remove this for the next major release\nmodule.exports.default = camelCase;\n","import invariant from \"invariant\"; ////////////////////////////////////////////////////////////////////////////////\n// startsWith(string, search) - Check if `string` starts with `search`\n\nvar startsWith = function startsWith(string, search) {\n return string.substr(0, search.length) === search;\n}; ////////////////////////////////////////////////////////////////////////////////\n// pick(routes, uri)\n//\n// Ranks and picks the best route to match. Each segment gets the highest\n// amount of points, then the type of segment gets an additional amount of\n// points where\n//\n// static > dynamic > splat > root\n//\n// This way we don't have to worry about the order of our routes, let the\n// computers do it.\n//\n// A route looks like this\n//\n// { path, default, value }\n//\n// And a returned match looks like:\n//\n// { route, params, uri }\n//\n// I know, I should use TypeScript not comments for these types.\n\n\nvar pick = function pick(routes, uri) {\n var match = void 0;\n var default_ = void 0;\n\n var _uri$split = uri.split(\"?\"),\n uriPathname = _uri$split[0];\n\n var uriSegments = segmentize(uriPathname);\n var isRootUri = uriSegments[0] === \"\";\n var ranked = rankRoutes(routes);\n\n for (var i = 0, l = ranked.length; i < l; i++) {\n var missed = false;\n var route = ranked[i].route;\n\n if (route.default) {\n default_ = {\n route: route,\n params: {},\n uri: uri\n };\n continue;\n }\n\n var routeSegments = segmentize(route.path);\n var params = {};\n var max = Math.max(uriSegments.length, routeSegments.length);\n var index = 0;\n\n for (; index < max; index++) {\n var routeSegment = routeSegments[index];\n var uriSegment = uriSegments[index];\n\n if (isSplat(routeSegment)) {\n // Hit a splat, just grab the rest, and return a match\n // uri: /files/documents/work\n // route: /files/*\n var param = routeSegment.slice(1) || \"*\";\n params[param] = uriSegments.slice(index).map(decodeURIComponent).join(\"/\");\n break;\n }\n\n if (uriSegment === undefined) {\n // URI is shorter than the route, no match\n // uri: /users\n // route: /users/:userId\n missed = true;\n break;\n }\n\n var dynamicMatch = paramRe.exec(routeSegment);\n\n if (dynamicMatch && !isRootUri) {\n var matchIsNotReserved = reservedNames.indexOf(dynamicMatch[1]) === -1;\n !matchIsNotReserved ? process.env.NODE_ENV !== \"production\" ? invariant(false, \" dynamic segment \\\"\" + dynamicMatch[1] + \"\\\" is a reserved name. Please use a different name in path \\\"\" + route.path + \"\\\".\") : invariant(false) : void 0;\n var value = decodeURIComponent(uriSegment);\n params[dynamicMatch[1]] = value;\n } else if (routeSegment !== uriSegment) {\n // Current segments don't match, not dynamic, not splat, so no match\n // uri: /users/123/settings\n // route: /users/:id/profile\n missed = true;\n break;\n }\n }\n\n if (!missed) {\n match = {\n route: route,\n params: params,\n uri: \"/\" + uriSegments.slice(0, index).join(\"/\")\n };\n break;\n }\n }\n\n return match || default_ || null;\n}; ////////////////////////////////////////////////////////////////////////////////\n// match(path, uri) - Matches just one path to a uri, also lol\n\n\nvar match = function match(path, uri) {\n return pick([{\n path: path\n }], uri);\n}; ////////////////////////////////////////////////////////////////////////////////\n// resolve(to, basepath)\n//\n// Resolves URIs as though every path is a directory, no files. Relative URIs\n// in the browser can feel awkward because not only can you be \"in a directory\"\n// you can be \"at a file\", too. For example\n//\n// browserSpecResolve('foo', '/bar/') => /bar/foo\n// browserSpecResolve('foo', '/bar') => /foo\n//\n// But on the command line of a file system, it's not as complicated, you can't\n// `cd` from a file, only directories. This way, links have to know less about\n// their current path. To go deeper you can do this:\n//\n// \n// // instead of\n// \n//\n// Just like `cd`, if you want to go deeper from the command line, you do this:\n//\n// cd deeper\n// # not\n// cd $(pwd)/deeper\n//\n// By treating every path as a directory, linking to relative paths should\n// require less contextual information and (fingers crossed) be more intuitive.\n\n\nvar resolve = function resolve(to, base) {\n // /foo/bar, /baz/qux => /foo/bar\n if (startsWith(to, \"/\")) {\n return to;\n }\n\n var _to$split = to.split(\"?\"),\n toPathname = _to$split[0],\n toQuery = _to$split[1];\n\n var _base$split = base.split(\"?\"),\n basePathname = _base$split[0];\n\n var toSegments = segmentize(toPathname);\n var baseSegments = segmentize(basePathname); // ?a=b, /users?b=c => /users?a=b\n\n if (toSegments[0] === \"\") {\n return addQuery(basePathname, toQuery);\n } // profile, /users/789 => /users/789/profile\n\n\n if (!startsWith(toSegments[0], \".\")) {\n var pathname = baseSegments.concat(toSegments).join(\"/\");\n return addQuery((basePathname === \"/\" ? \"\" : \"/\") + pathname, toQuery);\n } // ./ /users/123 => /users/123\n // ../ /users/123 => /users\n // ../.. /users/123 => /\n // ../../one /a/b/c/d => /a/b/one\n // .././one /a/b/c/d => /a/b/c/one\n\n\n var allSegments = baseSegments.concat(toSegments);\n var segments = [];\n\n for (var i = 0, l = allSegments.length; i < l; i++) {\n var segment = allSegments[i];\n if (segment === \"..\") segments.pop();else if (segment !== \".\") segments.push(segment);\n }\n\n return addQuery(\"/\" + segments.join(\"/\"), toQuery);\n}; ////////////////////////////////////////////////////////////////////////////////\n// insertParams(path, params)\n\n\nvar insertParams = function insertParams(path, params) {\n var _path$split = path.split(\"?\"),\n pathBase = _path$split[0],\n _path$split$ = _path$split[1],\n query = _path$split$ === undefined ? \"\" : _path$split$;\n\n var segments = segmentize(pathBase);\n var constructedPath = \"/\" + segments.map(function (segment) {\n var match = paramRe.exec(segment);\n return match ? params[match[1]] : segment;\n }).join(\"/\");\n var _params$location = params.location;\n _params$location = _params$location === undefined ? {} : _params$location;\n var _params$location$sear = _params$location.search,\n search = _params$location$sear === undefined ? \"\" : _params$location$sear;\n var searchSplit = search.split(\"?\")[1] || \"\";\n constructedPath = addQuery(constructedPath, query, searchSplit);\n return constructedPath;\n};\n\nvar validateRedirect = function validateRedirect(from, to) {\n var filter = function filter(segment) {\n return isDynamic(segment);\n };\n\n var fromString = segmentize(from).filter(filter).sort().join(\"/\");\n var toString = segmentize(to).filter(filter).sort().join(\"/\");\n return fromString === toString;\n}; ////////////////////////////////////////////////////////////////////////////////\n// Junk\n\n\nvar paramRe = /^:(.+)/;\nvar SEGMENT_POINTS = 4;\nvar STATIC_POINTS = 3;\nvar DYNAMIC_POINTS = 2;\nvar SPLAT_PENALTY = 1;\nvar ROOT_POINTS = 1;\n\nvar isRootSegment = function isRootSegment(segment) {\n return segment === \"\";\n};\n\nvar isDynamic = function isDynamic(segment) {\n return paramRe.test(segment);\n};\n\nvar isSplat = function isSplat(segment) {\n return segment && segment[0] === \"*\";\n};\n\nvar rankRoute = function rankRoute(route, index) {\n var score = route.default ? 0 : segmentize(route.path).reduce(function (score, segment) {\n score += SEGMENT_POINTS;\n if (isRootSegment(segment)) score += ROOT_POINTS;else if (isDynamic(segment)) score += DYNAMIC_POINTS;else if (isSplat(segment)) score -= SEGMENT_POINTS + SPLAT_PENALTY;else score += STATIC_POINTS;\n return score;\n }, 0);\n return {\n route: route,\n score: score,\n index: index\n };\n};\n\nvar rankRoutes = function rankRoutes(routes) {\n return routes.map(rankRoute).sort(function (a, b) {\n return a.score < b.score ? 1 : a.score > b.score ? -1 : a.index - b.index;\n });\n};\n\nvar segmentize = function segmentize(uri) {\n return uri // strip starting/ending slashes\n .replace(/(^\\/+|\\/+$)/g, \"\").split(\"/\");\n};\n\nvar addQuery = function addQuery(pathname) {\n for (var _len = arguments.length, query = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n query[_key - 1] = arguments[_key];\n }\n\n query = query.filter(function (q) {\n return q && q.length > 0;\n });\n return pathname + (query && query.length > 0 ? \"?\" + query.join(\"&\") : \"\");\n};\n\nvar reservedNames = [\"uri\", \"path\"];\n/**\n * Shallow compares two objects.\n * @param {Object} obj1 The first object to compare.\n * @param {Object} obj2 The second object to compare.\n */\n\nvar shallowCompare = function shallowCompare(obj1, obj2) {\n var obj1Keys = Object.keys(obj1);\n return obj1Keys.length === Object.keys(obj2).length && obj1Keys.every(function (key) {\n return obj2.hasOwnProperty(key) && obj1[key] === obj2[key];\n });\n}; ////////////////////////////////////////////////////////////////////////////////\n\n\nexport { startsWith, pick, match, resolve, insertParams, validateRedirect, shallowCompare };","var _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar getLocation = function getLocation(source) {\n var _source$location = source.location,\n search = _source$location.search,\n hash = _source$location.hash,\n href = _source$location.href,\n origin = _source$location.origin,\n protocol = _source$location.protocol,\n host = _source$location.host,\n hostname = _source$location.hostname,\n port = _source$location.port;\n var pathname = source.location.pathname;\n\n if (!pathname && href && canUseDOM) {\n var url = new URL(href);\n pathname = url.pathname;\n }\n\n return {\n pathname: encodeURI(decodeURI(pathname)),\n search: search,\n hash: hash,\n href: href,\n origin: origin,\n protocol: protocol,\n host: host,\n hostname: hostname,\n port: port,\n state: source.history.state,\n key: source.history.state && source.history.state.key || \"initial\"\n };\n};\n\nvar createHistory = function createHistory(source, options) {\n var listeners = [];\n var location = getLocation(source);\n var transitioning = false;\n\n var resolveTransition = function resolveTransition() {};\n\n return {\n get location() {\n return location;\n },\n\n get transitioning() {\n return transitioning;\n },\n\n _onTransitionComplete: function _onTransitionComplete() {\n transitioning = false;\n resolveTransition();\n },\n listen: function listen(listener) {\n listeners.push(listener);\n\n var popstateListener = function popstateListener() {\n location = getLocation(source);\n listener({\n location: location,\n action: \"POP\"\n });\n };\n\n source.addEventListener(\"popstate\", popstateListener);\n return function () {\n source.removeEventListener(\"popstate\", popstateListener);\n listeners = listeners.filter(function (fn) {\n return fn !== listener;\n });\n };\n },\n navigate: function navigate(to) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n state = _ref.state,\n _ref$replace = _ref.replace,\n replace = _ref$replace === undefined ? false : _ref$replace;\n\n if (typeof to === \"number\") {\n source.history.go(to);\n } else {\n state = _extends({}, state, {\n key: Date.now() + \"\"\n }); // try...catch iOS Safari limits to 100 pushState calls\n\n try {\n if (transitioning || replace) {\n source.history.replaceState(state, null, to);\n } else {\n source.history.pushState(state, null, to);\n }\n } catch (e) {\n source.location[replace ? \"replace\" : \"assign\"](to);\n }\n }\n\n location = getLocation(source);\n transitioning = true;\n var transition = new Promise(function (res) {\n return resolveTransition = res;\n });\n listeners.forEach(function (listener) {\n return listener({\n location: location,\n action: \"PUSH\"\n });\n });\n return transition;\n }\n };\n}; ////////////////////////////////////////////////////////////////////////////////\n// Stores history entries in memory for testing or other platforms like Native\n\n\nvar createMemorySource = function createMemorySource() {\n var initialPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"/\";\n var searchIndex = initialPath.indexOf(\"?\");\n var initialLocation = {\n pathname: searchIndex > -1 ? initialPath.substr(0, searchIndex) : initialPath,\n search: searchIndex > -1 ? initialPath.substr(searchIndex) : \"\"\n };\n var index = 0;\n var stack = [initialLocation];\n var states = [null];\n return {\n get location() {\n return stack[index];\n },\n\n addEventListener: function addEventListener(name, fn) {},\n removeEventListener: function removeEventListener(name, fn) {},\n history: {\n get entries() {\n return stack;\n },\n\n get index() {\n return index;\n },\n\n get state() {\n return states[index];\n },\n\n pushState: function pushState(state, _, uri) {\n var _uri$split = uri.split(\"?\"),\n pathname = _uri$split[0],\n _uri$split$ = _uri$split[1],\n search = _uri$split$ === undefined ? \"\" : _uri$split$;\n\n index++;\n stack.push({\n pathname: pathname,\n search: search.length ? \"?\" + search : search\n });\n states.push(state);\n },\n replaceState: function replaceState(state, _, uri) {\n var _uri$split2 = uri.split(\"?\"),\n pathname = _uri$split2[0],\n _uri$split2$ = _uri$split2[1],\n search = _uri$split2$ === undefined ? \"\" : _uri$split2$;\n\n stack[index] = {\n pathname: pathname,\n search: search\n };\n states[index] = state;\n },\n go: function go(to) {\n var newIndex = index + to;\n\n if (newIndex < 0 || newIndex > states.length - 1) {\n return;\n }\n\n index = newIndex;\n }\n }\n };\n}; ////////////////////////////////////////////////////////////////////////////////\n// global history - uses window.history as the source if available, otherwise a\n// memory history\n\n\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\n\nvar getSource = function getSource() {\n return canUseDOM ? window : createMemorySource();\n};\n\nvar globalHistory = createHistory(getSource());\nvar navigate = globalHistory.navigate; ////////////////////////////////////////////////////////////////////////////////\n\nexport { globalHistory, navigate, createHistory, createMemorySource };","var _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n/* eslint-disable jsx-a11y/anchor-has-content */\n\n\nimport React, { useContext, createContext } from \"react\";\nimport invariant from \"invariant\";\nimport { polyfill } from \"react-lifecycles-compat\";\nimport { startsWith, pick, resolve, match, insertParams, validateRedirect, shallowCompare } from \"./lib/utils\";\nimport { globalHistory, navigate, createHistory, createMemorySource } from \"./lib/history\"; ////////////////////////////////////////////////////////////////////////////////\n\nvar createNamedContext = function createNamedContext(name, defaultValue) {\n var Ctx = createContext(defaultValue);\n Ctx.displayName = name;\n return Ctx;\n}; ////////////////////////////////////////////////////////////////////////////////\n// Location Context/Provider\n\n\nvar LocationContext = createNamedContext(\"Location\"); // sets up a listener if there isn't one already so apps don't need to be\n// wrapped in some top level provider\n\nvar Location = function Location(_ref) {\n var children = _ref.children;\n return React.createElement(LocationContext.Consumer, null, function (context) {\n return context ? children(context) : React.createElement(LocationProvider, null, children);\n });\n};\n\nvar LocationProvider = function (_React$Component) {\n _inherits(LocationProvider, _React$Component);\n\n function LocationProvider() {\n var _temp, _this, _ret;\n\n _classCallCheck(this, LocationProvider);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {\n context: _this.getContext(),\n refs: {\n unlisten: null\n }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n LocationProvider.prototype.getContext = function getContext() {\n var _props$history = this.props.history,\n navigate = _props$history.navigate,\n location = _props$history.location;\n return {\n navigate: navigate,\n location: location\n };\n };\n\n LocationProvider.prototype.componentDidCatch = function componentDidCatch(error, info) {\n if (isRedirect(error)) {\n var _navigate = this.props.history.navigate;\n\n _navigate(error.uri, {\n replace: true\n });\n } else {\n throw error;\n }\n };\n\n LocationProvider.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (prevState.context.location !== this.state.context.location) {\n this.props.history._onTransitionComplete();\n }\n };\n\n LocationProvider.prototype.componentDidMount = function componentDidMount() {\n var _this2 = this;\n\n var refs = this.state.refs,\n history = this.props.history;\n\n history._onTransitionComplete();\n\n refs.unlisten = history.listen(function () {\n Promise.resolve().then(function () {\n // TODO: replace rAF with react deferred update API when it's ready https://github.com/facebook/react/issues/13306\n requestAnimationFrame(function () {\n if (!_this2.unmounted) {\n _this2.setState(function () {\n return {\n context: _this2.getContext()\n };\n });\n }\n });\n });\n });\n };\n\n LocationProvider.prototype.componentWillUnmount = function componentWillUnmount() {\n var refs = this.state.refs;\n this.unmounted = true;\n refs.unlisten();\n };\n\n LocationProvider.prototype.render = function render() {\n var context = this.state.context,\n children = this.props.children;\n return React.createElement(LocationContext.Provider, {\n value: context\n }, typeof children === \"function\" ? children(context) : children || null);\n };\n\n return LocationProvider;\n}(React.Component); ////////////////////////////////////////////////////////////////////////////////\n\n\nLocationProvider.defaultProps = {\n history: globalHistory\n};\nprocess.env.NODE_ENV !== \"production\" ? void 0 : void 0;\n\nvar ServerLocation = function ServerLocation(_ref2) {\n var url = _ref2.url,\n children = _ref2.children;\n var searchIndex = url.indexOf(\"?\");\n var searchExists = searchIndex > -1;\n var pathname = void 0;\n var search = \"\";\n var hash = \"\";\n\n if (searchExists) {\n pathname = url.substring(0, searchIndex);\n search = url.substring(searchIndex);\n } else {\n pathname = url;\n }\n\n return React.createElement(LocationContext.Provider, {\n value: {\n location: {\n pathname: pathname,\n search: search,\n hash: hash\n },\n navigate: function navigate() {\n throw new Error(\"You can't call navigate on the server.\");\n }\n }\n }, children);\n}; ////////////////////////////////////////////////////////////////////////////////\n// Sets baseuri and basepath for nested routers and links\n\n\nvar BaseContext = createNamedContext(\"Base\", {\n baseuri: \"/\",\n basepath: \"/\",\n navigate: globalHistory.navigate\n}); ////////////////////////////////////////////////////////////////////////////////\n// The main event, welcome to the show everybody.\n\nvar Router = function Router(props) {\n return React.createElement(BaseContext.Consumer, null, function (baseContext) {\n return React.createElement(Location, null, function (locationContext) {\n return React.createElement(RouterImpl, _extends({}, baseContext, locationContext, props));\n });\n });\n};\n\nvar RouterImpl = function (_React$PureComponent) {\n _inherits(RouterImpl, _React$PureComponent);\n\n function RouterImpl() {\n _classCallCheck(this, RouterImpl);\n\n return _possibleConstructorReturn(this, _React$PureComponent.apply(this, arguments));\n }\n\n RouterImpl.prototype.render = function render() {\n var _props = this.props,\n location = _props.location,\n _navigate2 = _props.navigate,\n basepath = _props.basepath,\n primary = _props.primary,\n children = _props.children,\n baseuri = _props.baseuri,\n _props$component = _props.component,\n component = _props$component === undefined ? \"div\" : _props$component,\n domProps = _objectWithoutProperties(_props, [\"location\", \"navigate\", \"basepath\", \"primary\", \"children\", \"baseuri\", \"component\"]);\n\n var routes = React.Children.toArray(children).reduce(function (array, child) {\n var routes = createRoute(basepath)(child);\n return array.concat(routes);\n }, []);\n var pathname = location.pathname;\n var match = pick(routes, pathname);\n\n if (match) {\n var params = match.params,\n uri = match.uri,\n route = match.route,\n element = match.route.value; // remove the /* from the end for child routes relative paths\n\n basepath = route.default ? basepath : route.path.replace(/\\*$/, \"\");\n\n var props = _extends({}, params, {\n uri: uri,\n location: location,\n navigate: function navigate(to, options) {\n return _navigate2(resolve(to, uri), options);\n }\n });\n\n var clone = React.cloneElement(element, props, element.props.children ? React.createElement(Router, {\n location: location,\n primary: primary\n }, element.props.children) : undefined); // using 'div' for < 16.3 support\n\n var FocusWrapper = primary ? FocusHandler : component; // don't pass any props to 'div'\n\n var wrapperProps = primary ? _extends({\n uri: uri,\n location: location,\n component: component\n }, domProps) : domProps;\n return React.createElement(BaseContext.Provider, {\n value: {\n baseuri: uri,\n basepath: basepath,\n navigate: props.navigate\n }\n }, React.createElement(FocusWrapper, wrapperProps, clone));\n } else {\n // Not sure if we want this, would require index routes at every level\n // warning(\n // false,\n // `\\n\\nNothing matched:\\n\\t${\n // location.pathname\n // }\\n\\nPaths checked: \\n\\t${routes\n // .map(route => route.path)\n // .join(\n // \"\\n\\t\"\n // )}\\n\\nTo get rid of this warning, add a default NotFound component as child of Router:\n // \\n\\tlet NotFound = () =>
Not Found!
\n // \\n\\t\\n\\t \\n\\t {/* ... */}\\n\\t`\n // );\n return null;\n }\n };\n\n return RouterImpl;\n}(React.PureComponent);\n\nRouterImpl.defaultProps = {\n primary: true\n};\nvar FocusContext = createNamedContext(\"Focus\");\n\nvar FocusHandler = function FocusHandler(_ref3) {\n var uri = _ref3.uri,\n location = _ref3.location,\n component = _ref3.component,\n domProps = _objectWithoutProperties(_ref3, [\"uri\", \"location\", \"component\"]);\n\n return React.createElement(FocusContext.Consumer, null, function (requestFocus) {\n return React.createElement(FocusHandlerImpl, _extends({}, domProps, {\n component: component,\n requestFocus: requestFocus,\n uri: uri,\n location: location\n }));\n });\n}; // don't focus on initial render\n\n\nvar initialRender = true;\nvar focusHandlerCount = 0;\n\nvar FocusHandlerImpl = function (_React$Component2) {\n _inherits(FocusHandlerImpl, _React$Component2);\n\n function FocusHandlerImpl() {\n var _temp2, _this4, _ret2;\n\n _classCallCheck(this, FocusHandlerImpl);\n\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _ret2 = (_temp2 = (_this4 = _possibleConstructorReturn(this, _React$Component2.call.apply(_React$Component2, [this].concat(args))), _this4), _this4.state = {}, _this4.requestFocus = function (node) {\n if (!_this4.state.shouldFocus && node) {\n node.focus();\n }\n }, _temp2), _possibleConstructorReturn(_this4, _ret2);\n }\n\n FocusHandlerImpl.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {\n var initial = prevState.uri == null;\n\n if (initial) {\n return _extends({\n shouldFocus: true\n }, nextProps);\n } else {\n var myURIChanged = nextProps.uri !== prevState.uri;\n var navigatedUpToMe = prevState.location.pathname !== nextProps.location.pathname && nextProps.location.pathname === nextProps.uri;\n return _extends({\n shouldFocus: myURIChanged || navigatedUpToMe\n }, nextProps);\n }\n };\n\n FocusHandlerImpl.prototype.componentDidMount = function componentDidMount() {\n focusHandlerCount++;\n this.focus();\n };\n\n FocusHandlerImpl.prototype.componentWillUnmount = function componentWillUnmount() {\n focusHandlerCount--;\n\n if (focusHandlerCount === 0) {\n initialRender = true;\n }\n };\n\n FocusHandlerImpl.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (prevProps.location !== this.props.location && this.state.shouldFocus) {\n this.focus();\n }\n };\n\n FocusHandlerImpl.prototype.focus = function focus() {\n if (process.env.NODE_ENV === \"test\") {\n // getting cannot read property focus of null in the tests\n // and that bit of global `initialRender` state causes problems\n // should probably figure it out!\n return;\n }\n\n var requestFocus = this.props.requestFocus;\n\n if (requestFocus) {\n requestFocus(this.node);\n } else {\n if (initialRender) {\n initialRender = false;\n } else if (this.node) {\n // React polyfills [autofocus] and it fires earlier than cDM,\n // so we were stealing focus away, this line prevents that.\n if (!this.node.contains(document.activeElement)) {\n this.node.focus();\n }\n }\n }\n };\n\n FocusHandlerImpl.prototype.render = function render() {\n var _this5 = this;\n\n var _props2 = this.props,\n children = _props2.children,\n style = _props2.style,\n requestFocus = _props2.requestFocus,\n _props2$component = _props2.component,\n Comp = _props2$component === undefined ? \"div\" : _props2$component,\n uri = _props2.uri,\n location = _props2.location,\n domProps = _objectWithoutProperties(_props2, [\"children\", \"style\", \"requestFocus\", \"component\", \"uri\", \"location\"]);\n\n return React.createElement(Comp, _extends({\n style: _extends({\n outline: \"none\"\n }, style),\n tabIndex: \"-1\",\n ref: function ref(n) {\n return _this5.node = n;\n }\n }, domProps), React.createElement(FocusContext.Provider, {\n value: this.requestFocus\n }, this.props.children));\n };\n\n return FocusHandlerImpl;\n}(React.Component);\n\npolyfill(FocusHandlerImpl);\n\nvar k = function k() {}; ////////////////////////////////////////////////////////////////////////////////\n\n\nvar forwardRef = React.forwardRef;\n\nif (typeof forwardRef === \"undefined\") {\n forwardRef = function forwardRef(C) {\n return C;\n };\n}\n\nvar Link = forwardRef(function (_ref4, ref) {\n var innerRef = _ref4.innerRef,\n props = _objectWithoutProperties(_ref4, [\"innerRef\"]);\n\n return React.createElement(BaseContext.Consumer, null, function (_ref5) {\n var basepath = _ref5.basepath,\n baseuri = _ref5.baseuri;\n return React.createElement(Location, null, function (_ref6) {\n var location = _ref6.location,\n navigate = _ref6.navigate;\n\n var to = props.to,\n state = props.state,\n replace = props.replace,\n _props$getProps = props.getProps,\n getProps = _props$getProps === undefined ? k : _props$getProps,\n anchorProps = _objectWithoutProperties(props, [\"to\", \"state\", \"replace\", \"getProps\"]);\n\n var href = resolve(to, baseuri);\n var encodedHref = encodeURI(href);\n var isCurrent = location.pathname === encodedHref;\n var isPartiallyCurrent = startsWith(location.pathname, encodedHref);\n return React.createElement(\"a\", _extends({\n ref: ref || innerRef,\n \"aria-current\": isCurrent ? \"page\" : undefined\n }, anchorProps, getProps({\n isCurrent: isCurrent,\n isPartiallyCurrent: isPartiallyCurrent,\n href: href,\n location: location\n }), {\n href: href,\n onClick: function onClick(event) {\n if (anchorProps.onClick) anchorProps.onClick(event);\n\n if (shouldNavigate(event)) {\n event.preventDefault();\n var shouldReplace = replace;\n\n if (typeof replace !== \"boolean\" && isCurrent) {\n var _location$state = _extends({}, location.state),\n key = _location$state.key,\n restState = _objectWithoutProperties(_location$state, [\"key\"]);\n\n shouldReplace = shallowCompare(_extends({}, state), restState);\n }\n\n navigate(href, {\n state: state,\n replace: shouldReplace\n });\n }\n }\n }));\n });\n });\n});\nLink.displayName = \"Link\";\nprocess.env.NODE_ENV !== \"production\" ? void 0 : void 0; ////////////////////////////////////////////////////////////////////////////////\n\nfunction RedirectRequest(uri) {\n this.uri = uri;\n}\n\nvar isRedirect = function isRedirect(o) {\n return o instanceof RedirectRequest;\n};\n\nvar redirectTo = function redirectTo(to) {\n throw new RedirectRequest(to);\n};\n\nvar RedirectImpl = function (_React$Component3) {\n _inherits(RedirectImpl, _React$Component3);\n\n function RedirectImpl() {\n _classCallCheck(this, RedirectImpl);\n\n return _possibleConstructorReturn(this, _React$Component3.apply(this, arguments));\n } // Support React < 16 with this hook\n\n\n RedirectImpl.prototype.componentDidMount = function componentDidMount() {\n var _props3 = this.props,\n navigate = _props3.navigate,\n to = _props3.to,\n from = _props3.from,\n _props3$replace = _props3.replace,\n replace = _props3$replace === undefined ? true : _props3$replace,\n state = _props3.state,\n noThrow = _props3.noThrow,\n baseuri = _props3.baseuri,\n props = _objectWithoutProperties(_props3, [\"navigate\", \"to\", \"from\", \"replace\", \"state\", \"noThrow\", \"baseuri\"]);\n\n Promise.resolve().then(function () {\n var resolvedTo = resolve(to, baseuri);\n navigate(insertParams(resolvedTo, props), {\n replace: replace,\n state: state\n });\n });\n };\n\n RedirectImpl.prototype.render = function render() {\n var _props4 = this.props,\n navigate = _props4.navigate,\n to = _props4.to,\n from = _props4.from,\n replace = _props4.replace,\n state = _props4.state,\n noThrow = _props4.noThrow,\n baseuri = _props4.baseuri,\n props = _objectWithoutProperties(_props4, [\"navigate\", \"to\", \"from\", \"replace\", \"state\", \"noThrow\", \"baseuri\"]);\n\n var resolvedTo = resolve(to, baseuri);\n if (!noThrow) redirectTo(insertParams(resolvedTo, props));\n return null;\n };\n\n return RedirectImpl;\n}(React.Component);\n\nvar Redirect = function Redirect(props) {\n return React.createElement(BaseContext.Consumer, null, function (_ref7) {\n var baseuri = _ref7.baseuri;\n return React.createElement(Location, null, function (locationContext) {\n return React.createElement(RedirectImpl, _extends({}, locationContext, {\n baseuri: baseuri\n }, props));\n });\n });\n};\n\nprocess.env.NODE_ENV !== \"production\" ? void 0 : void 0; ////////////////////////////////////////////////////////////////////////////////\n\nvar Match = function Match(_ref8) {\n var path = _ref8.path,\n children = _ref8.children;\n return React.createElement(BaseContext.Consumer, null, function (_ref9) {\n var baseuri = _ref9.baseuri;\n return React.createElement(Location, null, function (_ref10) {\n var navigate = _ref10.navigate,\n location = _ref10.location;\n var resolvedPath = resolve(path, baseuri);\n var result = match(resolvedPath, location.pathname);\n return children({\n navigate: navigate,\n location: location,\n match: result ? _extends({}, result.params, {\n uri: result.uri,\n path: path\n }) : null\n });\n });\n });\n}; ////////////////////////////////////////////////////////////////////////////////\n// Hooks\n\n\nvar useLocation = function useLocation() {\n var context = useContext(LocationContext);\n\n if (!context) {\n throw new Error(\"useLocation hook was used but a LocationContext.Provider was not found in the parent tree. Make sure this is used in a component that is a child of Router\");\n }\n\n return context.location;\n};\n\nvar useNavigate = function useNavigate() {\n var context = useContext(BaseContext);\n\n if (!context) {\n throw new Error(\"useNavigate hook was used but a BaseContext.Provider was not found in the parent tree. Make sure this is used in a component that is a child of Router\");\n }\n\n return context.navigate;\n};\n\nvar useParams = function useParams() {\n var context = useContext(BaseContext);\n\n if (!context) {\n throw new Error(\"useParams hook was used but a LocationContext.Provider was not found in the parent tree. Make sure this is used in a component that is a child of Router\");\n }\n\n var location = useLocation();\n var results = match(context.basepath, location.pathname);\n return results ? results.params : null;\n};\n\nvar useMatch = function useMatch(path) {\n if (!path) {\n throw new Error(\"useMatch(path: string) requires an argument of a string to match against\");\n }\n\n var context = useContext(BaseContext);\n\n if (!context) {\n throw new Error(\"useMatch hook was used but a LocationContext.Provider was not found in the parent tree. Make sure this is used in a component that is a child of Router\");\n }\n\n var location = useLocation();\n var resolvedPath = resolve(path, context.baseuri);\n var result = match(resolvedPath, location.pathname);\n return result ? _extends({}, result.params, {\n uri: result.uri,\n path: path\n }) : null;\n}; ////////////////////////////////////////////////////////////////////////////////\n// Junk\n\n\nvar stripSlashes = function stripSlashes(str) {\n return str.replace(/(^\\/+|\\/+$)/g, \"\");\n};\n\nvar createRoute = function createRoute(basepath) {\n return function (element) {\n if (!element) {\n return null;\n }\n\n if (element.type === React.Fragment && element.props.children) {\n return React.Children.map(element.props.children, createRoute(basepath));\n }\n\n !(element.props.path || element.props.default || element.type === Redirect) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \": Children of must have a `path` or `default` prop, or be a ``. None found on element type `\" + element.type + \"`\") : invariant(false) : void 0;\n !!(element.type === Redirect && (!element.props.from || !element.props.to)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \" requires both \\\"from\\\" and \\\"to\\\" props when inside a .\") : invariant(false) : void 0;\n !!(element.type === Redirect && !validateRedirect(element.props.from, element.props.to)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \" has mismatched dynamic segments, ensure both paths have the exact same dynamic segments.\") : invariant(false) : void 0;\n\n if (element.props.default) {\n return {\n value: element,\n default: true\n };\n }\n\n var elementPath = element.type === Redirect ? element.props.from : element.props.path;\n var path = elementPath === \"/\" ? basepath : stripSlashes(basepath) + \"/\" + stripSlashes(elementPath);\n return {\n value: element,\n default: element.props.default,\n path: element.props.children ? stripSlashes(path) + \"/*\" : path\n };\n };\n};\n\nvar shouldNavigate = function shouldNavigate(event) {\n return !event.defaultPrevented && event.button === 0 && !(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}; ////////////////////////////////////////////////////////////////////////\n\n\nexport { Link, Location, LocationProvider, Match, Redirect, Router, ServerLocation, createHistory, createMemorySource, isRedirect, navigate, redirectTo, globalHistory, match as matchPath, useLocation, useNavigate, useParams, useMatch , BaseContext };","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n"],"sourceRoot":""}