{"ast":null,"code":"\"use strict\";\n\nvar _slicedToArray = require(\"@babel/runtime/helpers/slicedToArray\");\n\nvar _s = $RefreshSig$();\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nexports.__esModule = true;\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _utils = require(\"../next-server/lib/utils\");\n\nvar _router = require(\"./router\");\n\nvar _router2 = require(\"../next-server/lib/router/router\");\n/**\n* Detects whether a given url is from the same origin as the current page (browser only).\n*/\n\n\nfunction isLocal(url) {\n  var locationOrigin = (0, _utils.getLocationOrigin)();\n  var resolved = new URL(url, locationOrigin);\n  return resolved.origin === locationOrigin;\n}\n\nvar cachedObserver;\nvar listeners = new Map();\nvar IntersectionObserver = true ? window.IntersectionObserver : null;\nvar prefetched = {};\n\nfunction getObserver() {\n  // Return shared instance of IntersectionObserver if already created\n  if (cachedObserver) {\n    return cachedObserver;\n  } // Only create shared IntersectionObserver if supported in browser\n\n\n  if (!IntersectionObserver) {\n    return undefined;\n  }\n\n  return cachedObserver = new IntersectionObserver(function (entries) {\n    entries.forEach(function (entry) {\n      if (!listeners.has(entry.target)) {\n        return;\n      }\n\n      var cb = listeners.get(entry.target);\n\n      if (entry.isIntersecting || entry.intersectionRatio > 0) {\n        cachedObserver.unobserve(entry.target);\n        listeners[\"delete\"](entry.target);\n        cb();\n      }\n    });\n  }, {\n    rootMargin: '200px'\n  });\n}\n\nvar listenToIntersections = function listenToIntersections(el, cb) {\n  var observer = getObserver();\n\n  if (!observer) {\n    return function () {};\n  }\n\n  observer.observe(el);\n  listeners.set(el, cb);\n  return function () {\n    try {\n      observer.unobserve(el);\n    } catch (err) {\n      console.error(err);\n    }\n\n    listeners[\"delete\"](el);\n  };\n};\n\nfunction prefetch(router, href, as, options) {\n  if (false) return; // Prefetch the JSON page if asked (only in the client)\n  // We need to handle a prefetch error here since we may be\n  // loading with priority which can reject but we don't\n  // want to force navigation since this is only a prefetch\n\n  router.prefetch(href, as, options)[\"catch\"](function (err) {\n    if (true) {\n      // rethrow to show invalid URL errors\n      throw err;\n    }\n  }); // Join on an invalid URI character\n\n  prefetched[href + '%' + as] = true;\n}\n\nfunction linkClicked(e, router, href, as, replace, shallow, scroll) {\n  var _e$currentTarget = e.currentTarget,\n      nodeName = _e$currentTarget.nodeName,\n      target = _e$currentTarget.target;\n\n  if (nodeName === 'A' && (target && target !== '_self' || e.metaKey || e.ctrlKey || e.shiftKey || e.nativeEvent && e.nativeEvent.which === 2)) {\n    // ignore click for new tab / new window behavior\n    return;\n  }\n\n  if (!isLocal(href)) {\n    // ignore click if it's outside our scope (e.g. https://google.com)\n    return;\n  }\n\n  e.preventDefault(); //  avoid scroll for urls with anchor refs\n\n  if (scroll == null) {\n    scroll = as.indexOf('#') < 0;\n  } // replace state instead of push if prop is present\n\n\n  router[replace ? 'replace' : 'push'](href, as, {\n    shallow: shallow\n  }).then(function (success) {\n    if (!success) return;\n\n    if (scroll) {\n      window.scrollTo(0, 0);\n      document.body.focus();\n    }\n  });\n}\n\nfunction Link(props) {\n  _s();\n\n  if (true) {\n    // This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    var hasWarned = _react[\"default\"].useRef(false);\n\n    if (props.prefetch && !hasWarned.current) {\n      hasWarned.current = true;\n      console.warn('Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/vercel/next.js/prefetch-true-deprecated');\n    }\n  }\n\n  var p = props.prefetch !== false;\n\n  var _react$default$useSta = _react[\"default\"].useState(),\n      _react$default$useSta2 = _slicedToArray(_react$default$useSta, 2),\n      childElm = _react$default$useSta2[0],\n      setChildElm = _react$default$useSta2[1];\n\n  var router = (0, _router.useRouter)();\n\n  var _react$default$useMem = _react[\"default\"].useMemo(function () {\n    var resolvedHref = (0, _router2.resolveHref)(router.pathname, props.href);\n    return {\n      href: resolvedHref,\n      as: props.as ? (0, _router2.resolveHref)(router.pathname, props.as) : resolvedHref\n    };\n  }, [router.pathname, props.href, props.as]),\n      href = _react$default$useMem.href,\n      as = _react$default$useMem.as;\n\n  _react[\"default\"].useEffect(function () {\n    if (p && IntersectionObserver && childElm && childElm.tagName) {\n      // Join on an invalid URI character\n      var isPrefetched = prefetched[href + '%' + as];\n\n      if (!isPrefetched) {\n        return listenToIntersections(childElm, function () {\n          prefetch(router, href, as);\n        });\n      }\n    }\n  }, [p, childElm, href, as, router]);\n\n  var children = props.children,\n      replace = props.replace,\n      shallow = props.shallow,\n      scroll = props.scroll; // Deprecated. Warning shown by propType check. If the children provided is a string (<Link>example</Link>) we wrap it in an <a> tag\n\n  if (typeof children === 'string') {\n    children = /*#__PURE__*/_react[\"default\"].createElement(\"a\", null, children);\n  } // This will return the first child, if multiple are provided it will throw an error\n\n\n  var child = _react.Children.only(children);\n\n  var childProps = {\n    ref: function ref(el) {\n      if (el) setChildElm(el);\n\n      if (child && typeof child === 'object' && child.ref) {\n        if (typeof child.ref === 'function') child.ref(el);else if (typeof child.ref === 'object') {\n          child.ref.current = el;\n        }\n      }\n    },\n    onClick: function onClick(e) {\n      if (child.props && typeof child.props.onClick === 'function') {\n        child.props.onClick(e);\n      }\n\n      if (!e.defaultPrevented) {\n        linkClicked(e, router, href, as, replace, shallow, scroll);\n      }\n    }\n  };\n\n  if (p) {\n    childProps.onMouseEnter = function (e) {\n      if (child.props && typeof child.props.onMouseEnter === 'function') {\n        child.props.onMouseEnter(e);\n      }\n\n      prefetch(router, href, as, {\n        priority: true\n      });\n    };\n  } // If child is an <a> tag and doesn't have a href attribute, or if the 'passHref' property is\n  // defined, we specify the current 'href', so that repetition is not needed by the user\n\n\n  if (props.passHref || child.type === 'a' && !('href' in child.props)) {\n    childProps.href = (0, _router2.addBasePath)(as);\n  } // Add the ending slash to the paths. So, we can serve the\n  // \"<page>/index.html\" directly.\n\n\n  if (process.env.__NEXT_EXPORT_TRAILING_SLASH) {\n    var rewriteUrlForNextExport = require('../next-server/lib/router/rewrite-url-for-export').rewriteUrlForNextExport;\n\n    if (childProps.href && typeof __NEXT_DATA__ !== 'undefined' && __NEXT_DATA__.nextExport) {\n      childProps.href = rewriteUrlForNextExport(childProps.href);\n    }\n  }\n\n  return _react[\"default\"].cloneElement(child, childProps);\n}\n\n_s(Link, \"Yt4+dEXpDdcToH476p06kPk14D0=\");\n\n_c = Link;\n\nif (true) {\n  var warn = (0, _utils.execOnce)(console.error); // This module gets removed by webpack.IgnorePlugin\n\n  var PropTypes = require('prop-types');\n\n  var exact = require('prop-types-exact'); // @ts-ignore the property is supported, when declaring it on the class it outputs an extra bit of code which is not needed.\n\n\n  Link.propTypes = exact({\n    href: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,\n    as: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n    prefetch: PropTypes.bool,\n    replace: PropTypes.bool,\n    shallow: PropTypes.bool,\n    passHref: PropTypes.bool,\n    scroll: PropTypes.bool,\n    children: PropTypes.oneOfType([PropTypes.element, function (props, propName) {\n      var value = props[propName];\n\n      if (typeof value === 'string') {\n        warn(\"Warning: You're using a string directly inside <Link>. This usage has been deprecated. Please add an <a> tag as child of <Link>\");\n      }\n\n      return null;\n    }]).isRequired\n  });\n}\n\nvar _default = Link;\nexports[\"default\"] = _default;\n\nvar _c;\n\n$RefreshReg$(_c, \"Link\");","map":{"version":3,"sources":["../../client/link.tsx"],"names":["locationOrigin","resolved","listeners","IntersectionObserver","window","prefetched","cachedObserver","entries","entry","cb","rootMargin","listenToIntersections","observer","getObserver","console","router","err","href","e","nodeName","target","isLocal","scroll","as","replace","shallow","success","document","hasWarned","React","props","p","resolvedHref","childElm","isPrefetched","prefetch","children","child","Children","childProps","ref","el","setChildElm","onClick","linkClicked","priority","process","rewriteUrlForNextExport","require","__NEXT_DATA__","warn","PropTypes","exact","Link","passHref","value"],"mappings":";;;;;;;;;;;AAEA,IAAA,MAAA,GAAA,uBAAA,CAAA,OAAA,CAAA,OAAA,C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A4C;AAC1C,MAAMqB,IAAI,GAAG,CAAA,GAAA,MAAA,CAAA,QAAA,EAASpC,OAAO,CAA7B,KAAa,CAAb,CAD0C,CAG1C;;AACA,MAAMqC,SAAS,GAAGH,OAAO,CAAzB,YAAyB,CAAzB;;AACA,MAAMI,KAAK,GAAGJ,OAAO,CAArB,kBAAqB,CAArB,CAL0C,CAM1C;;;AACAK,EAAAA,IAAI,CAAJA,SAAAA,GAAiBD,KAAK,CAAC;AACrBnC,IAAAA,IAAI,EAAEkC,SAAS,CAATA,SAAAA,CAAoB,CAACA,SAAS,CAAV,MAAA,EAAmBA,SAAS,CAAhDA,MAAoB,CAApBA,EADe,UAAA;AAErB5B,IAAAA,EAAE,EAAE4B,SAAS,CAATA,SAAAA,CAAoB,CAACA,SAAS,CAAV,MAAA,EAAmBA,SAAS,CAF/B,MAEG,CAApBA,CAFiB;AAGrBhB,IAAAA,QAAQ,EAAEgB,SAAS,CAHE,IAAA;AAIrB3B,IAAAA,OAAO,EAAE2B,SAAS,CAJG,IAAA;AAKrB1B,IAAAA,OAAO,EAAE0B,SAAS,CALG,IAAA;AAMrBG,IAAAA,QAAQ,EAAEH,SAAS,CANE,IAAA;AAOrB7B,IAAAA,MAAM,EAAE6B,SAAS,CAPI,IAAA;AAQrBf,IAAAA,QAAQ,EAAEe,SAAS,CAATA,SAAAA,CAAoB,CAC5BA,SAAS,CADmB,OAAA,EAE5B,UAAA,KAAA,EAAA,QAAA,EAAkC;AAChC,UAAMI,KAAK,GAAGzB,KAAK,CAAnB,QAAmB,CAAnB;;AAEA,UAAI,OAAA,KAAA,KAAJ,QAAA,EAA+B;AAC7BoB,QAAAA,IAAAA,mIAAAA;AAKF;;AAAA,aAAA,IAAA;AAXMC,KAAoB,CAApBA,EARZE;AAAuB,GAAD,CAAtBA;;;eAyBaA,I","sourcesContent":["declare const __NEXT_DATA__: any\n\nimport React, { Children } from 'react'\nimport { UrlObject } from 'url'\nimport { PrefetchOptions, NextRouter } from '../next-server/lib/router/router'\nimport { execOnce, getLocationOrigin } from '../next-server/lib/utils'\nimport { useRouter } from './router'\nimport { addBasePath, resolveHref } from '../next-server/lib/router/router'\n\n/**\n * Detects whether a given url is from the same origin as the current page (browser only).\n */\nfunction isLocal(url: string): boolean {\n  const locationOrigin = getLocationOrigin()\n  const resolved = new URL(url, locationOrigin)\n  return resolved.origin === locationOrigin\n}\n\ntype Url = string | UrlObject\n\nexport type LinkProps = {\n  href: Url\n  as?: Url\n  replace?: boolean\n  scroll?: boolean\n  shallow?: boolean\n  passHref?: boolean\n  prefetch?: boolean\n}\n\nlet cachedObserver: IntersectionObserver\nconst listeners = new Map<Element, () => void>()\nconst IntersectionObserver =\n  typeof window !== 'undefined' ? window.IntersectionObserver : null\nconst prefetched: { [cacheKey: string]: boolean } = {}\n\nfunction getObserver(): IntersectionObserver | undefined {\n  // Return shared instance of IntersectionObserver if already created\n  if (cachedObserver) {\n    return cachedObserver\n  }\n\n  // Only create shared IntersectionObserver if supported in browser\n  if (!IntersectionObserver) {\n    return undefined\n  }\n\n  return (cachedObserver = new IntersectionObserver(\n    (entries) => {\n      entries.forEach((entry) => {\n        if (!listeners.has(entry.target)) {\n          return\n        }\n\n        const cb = listeners.get(entry.target)!\n        if (entry.isIntersecting || entry.intersectionRatio > 0) {\n          cachedObserver.unobserve(entry.target)\n          listeners.delete(entry.target)\n          cb()\n        }\n      })\n    },\n    { rootMargin: '200px' }\n  ))\n}\n\nconst listenToIntersections = (el: Element, cb: () => void) => {\n  const observer = getObserver()\n  if (!observer) {\n    return () => {}\n  }\n\n  observer.observe(el)\n  listeners.set(el, cb)\n  return () => {\n    try {\n      observer.unobserve(el)\n    } catch (err) {\n      console.error(err)\n    }\n    listeners.delete(el)\n  }\n}\n\nfunction prefetch(\n  router: NextRouter,\n  href: string,\n  as: string,\n  options?: PrefetchOptions\n): void {\n  if (typeof window === 'undefined') return\n  // Prefetch the JSON page if asked (only in the client)\n  // We need to handle a prefetch error here since we may be\n  // loading with priority which can reject but we don't\n  // want to force navigation since this is only a prefetch\n  router.prefetch(href, as, options).catch((err) => {\n    if (process.env.NODE_ENV !== 'production') {\n      // rethrow to show invalid URL errors\n      throw err\n    }\n  })\n  // Join on an invalid URI character\n  prefetched[href + '%' + as] = true\n}\n\nfunction linkClicked(\n  e: React.MouseEvent,\n  router: NextRouter,\n  href: string,\n  as: string,\n  replace?: boolean,\n  shallow?: boolean,\n  scroll?: boolean\n): void {\n  const { nodeName, target } = e.currentTarget as HTMLAnchorElement\n  if (\n    nodeName === 'A' &&\n    ((target && target !== '_self') ||\n      e.metaKey ||\n      e.ctrlKey ||\n      e.shiftKey ||\n      (e.nativeEvent && e.nativeEvent.which === 2))\n  ) {\n    // ignore click for new tab / new window behavior\n    return\n  }\n\n  if (!isLocal(href)) {\n    // ignore click if it's outside our scope (e.g. https://google.com)\n    return\n  }\n\n  e.preventDefault()\n\n  //  avoid scroll for urls with anchor refs\n  if (scroll == null) {\n    scroll = as.indexOf('#') < 0\n  }\n\n  // replace state instead of push if prop is present\n  router[replace ? 'replace' : 'push'](href, as, { shallow }).then(\n    (success: boolean) => {\n      if (!success) return\n      if (scroll) {\n        window.scrollTo(0, 0)\n        document.body.focus()\n      }\n    }\n  )\n}\n\nfunction Link(props: React.PropsWithChildren<LinkProps>) {\n  if (process.env.NODE_ENV !== 'production') {\n    // This hook is in a conditional but that is ok because `process.env.NODE_ENV` never changes\n    // eslint-disable-next-line react-hooks/rules-of-hooks\n    const hasWarned = React.useRef(false)\n    if (props.prefetch && !hasWarned.current) {\n      hasWarned.current = true\n      console.warn(\n        'Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://err.sh/vercel/next.js/prefetch-true-deprecated'\n      )\n    }\n  }\n  const p = props.prefetch !== false\n\n  const [childElm, setChildElm] = React.useState<Element>()\n\n  const router = useRouter()\n\n  const { href, as } = React.useMemo(() => {\n    const resolvedHref = resolveHref(router.pathname, props.href)\n    return {\n      href: resolvedHref,\n      as: props.as ? resolveHref(router.pathname, props.as) : resolvedHref,\n    }\n  }, [router.pathname, props.href, props.as])\n\n  React.useEffect(() => {\n    if (p && IntersectionObserver && childElm && childElm.tagName) {\n      // Join on an invalid URI character\n      const isPrefetched = prefetched[href + '%' + as]\n      if (!isPrefetched) {\n        return listenToIntersections(childElm, () => {\n          prefetch(router, href, as)\n        })\n      }\n    }\n  }, [p, childElm, href, as, router])\n\n  let { children, replace, shallow, scroll } = props\n  // Deprecated. Warning shown by propType check. If the children provided is a string (<Link>example</Link>) we wrap it in an <a> tag\n  if (typeof children === 'string') {\n    children = <a>{children}</a>\n  }\n\n  // This will return the first child, if multiple are provided it will throw an error\n  const child: any = Children.only(children)\n  const childProps: {\n    onMouseEnter?: React.MouseEventHandler\n    onClick: React.MouseEventHandler\n    href?: string\n    ref?: any\n  } = {\n    ref: (el: any) => {\n      if (el) setChildElm(el)\n\n      if (child && typeof child === 'object' && child.ref) {\n        if (typeof child.ref === 'function') child.ref(el)\n        else if (typeof child.ref === 'object') {\n          child.ref.current = el\n        }\n      }\n    },\n    onClick: (e: React.MouseEvent) => {\n      if (child.props && typeof child.props.onClick === 'function') {\n        child.props.onClick(e)\n      }\n      if (!e.defaultPrevented) {\n        linkClicked(e, router, href, as, replace, shallow, scroll)\n      }\n    },\n  }\n\n  if (p) {\n    childProps.onMouseEnter = (e: React.MouseEvent) => {\n      if (child.props && typeof child.props.onMouseEnter === 'function') {\n        child.props.onMouseEnter(e)\n      }\n      prefetch(router, href, as, { priority: true })\n    }\n  }\n\n  // If child is an <a> tag and doesn't have a href attribute, or if the 'passHref' property is\n  // defined, we specify the current 'href', so that repetition is not needed by the user\n  if (props.passHref || (child.type === 'a' && !('href' in child.props))) {\n    childProps.href = addBasePath(as)\n  }\n\n  // Add the ending slash to the paths. So, we can serve the\n  // \"<page>/index.html\" directly.\n  if (process.env.__NEXT_EXPORT_TRAILING_SLASH) {\n    const rewriteUrlForNextExport = require('../next-server/lib/router/rewrite-url-for-export')\n      .rewriteUrlForNextExport\n    if (\n      childProps.href &&\n      typeof __NEXT_DATA__ !== 'undefined' &&\n      __NEXT_DATA__.nextExport\n    ) {\n      childProps.href = rewriteUrlForNextExport(childProps.href)\n    }\n  }\n\n  return React.cloneElement(child, childProps)\n}\n\nif (process.env.NODE_ENV === 'development') {\n  const warn = execOnce(console.error)\n\n  // This module gets removed by webpack.IgnorePlugin\n  const PropTypes = require('prop-types')\n  const exact = require('prop-types-exact')\n  // @ts-ignore the property is supported, when declaring it on the class it outputs an extra bit of code which is not needed.\n  Link.propTypes = exact({\n    href: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,\n    as: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n    prefetch: PropTypes.bool,\n    replace: PropTypes.bool,\n    shallow: PropTypes.bool,\n    passHref: PropTypes.bool,\n    scroll: PropTypes.bool,\n    children: PropTypes.oneOfType([\n      PropTypes.element,\n      (props: any, propName: string) => {\n        const value = props[propName]\n\n        if (typeof value === 'string') {\n          warn(\n            `Warning: You're using a string directly inside <Link>. This usage has been deprecated. Please add an <a> tag as child of <Link>`\n          )\n        }\n\n        return null\n      },\n    ]).isRequired,\n  })\n}\n\nexport default Link\n"]},"metadata":{},"sourceType":"script"}