{"ast":null,"code":"'use client';\n\nvar __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport React, { useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport makeCancellable from 'make-cancellable-promise';\nimport makeEventProps from 'make-event-props';\nimport clsx from 'clsx';\nimport invariant from 'tiny-invariant';\nimport warning from 'warning';\nimport OutlineContext from './OutlineContext.js';\nimport OutlineItem from './OutlineItem.js';\nimport { cancelRunningTask } from './shared/utils.js';\nimport useDocumentContext from './shared/hooks/useDocumentContext.js';\nimport useResolver from './shared/hooks/useResolver.js';\nimport { eventProps, isClassName, isPdf, isRef } from './shared/propTypes.js';\n/**\n * Displays an outline (table of contents).\n *\n * Should be placed inside `<Document />`. Alternatively, it can have `pdf` prop passed, which can be obtained from `<Document />`'s `onLoadSuccess` callback function.\n */\nconst Outline = function Outline(props) {\n  const documentContext = useDocumentContext();\n  const mergedProps = Object.assign(Object.assign({}, documentContext), props);\n  const {\n      className,\n      inputRef,\n      onItemClick,\n      onLoadError: onLoadErrorProps,\n      onLoadSuccess: onLoadSuccessProps,\n      pdf\n    } = mergedProps,\n    otherProps = __rest(mergedProps, [\"className\", \"inputRef\", \"onItemClick\", \"onLoadError\", \"onLoadSuccess\", \"pdf\"]);\n  invariant(pdf, 'Attempted to load an outline, but no document was specified. Wrap <Outline /> in a <Document /> or pass explicit `pdf` prop.');\n  const [outlineState, outlineDispatch] = useResolver();\n  const {\n    value: outline,\n    error: outlineError\n  } = outlineState;\n  /**\n   * Called when an outline is read successfully\n   */\n  function onLoadSuccess() {\n    if (typeof outline === 'undefined' || outline === false) {\n      return;\n    }\n    if (onLoadSuccessProps) {\n      onLoadSuccessProps(outline);\n    }\n  }\n  /**\n   * Called when an outline failed to read successfully\n   */\n  function onLoadError() {\n    if (!outlineError) {\n      // Impossible, but TypeScript doesn't know that\n      return;\n    }\n    warning(false, outlineError.toString());\n    if (onLoadErrorProps) {\n      onLoadErrorProps(outlineError);\n    }\n  }\n  function resetOutline() {\n    outlineDispatch({\n      type: 'RESET'\n    });\n  }\n  useEffect(resetOutline, [outlineDispatch, pdf]);\n  function loadOutline() {\n    if (!pdf) {\n      // Impossible, but TypeScript doesn't know that\n      return;\n    }\n    const cancellable = makeCancellable(pdf.getOutline());\n    const runningTask = cancellable;\n    cancellable.promise.then(nextOutline => {\n      outlineDispatch({\n        type: 'RESOLVE',\n        value: nextOutline\n      });\n    }).catch(error => {\n      outlineDispatch({\n        type: 'REJECT',\n        error\n      });\n    });\n    return () => cancelRunningTask(runningTask);\n  }\n  useEffect(loadOutline, [outlineDispatch, pdf]);\n  useEffect(() => {\n    if (outline === undefined) {\n      return;\n    }\n    if (outline === false) {\n      onLoadError();\n      return;\n    }\n    onLoadSuccess();\n  },\n  // Ommitted callbacks so they are not called every time they change\n  // eslint-disable-next-line react-hooks/exhaustive-deps\n  [outline]);\n  const childContext = useMemo(() => ({\n    onItemClick\n  }), [onItemClick]);\n  const eventProps = useMemo(() => makeEventProps(otherProps, () => outline), [otherProps, outline]);\n  if (!outline) {\n    return null;\n  }\n  function renderOutline() {\n    if (!outline) {\n      return null;\n    }\n    return React.createElement(\"ul\", null, outline.map((item, itemIndex) => React.createElement(OutlineItem, {\n      key: typeof item.dest === 'string' ? item.dest : itemIndex,\n      item: item,\n      pdf: pdf\n    })));\n  }\n  return React.createElement(\"div\", Object.assign({\n    className: clsx('react-pdf__Outline', className),\n    ref: inputRef\n  }, eventProps), React.createElement(OutlineContext.Provider, {\n    value: childContext\n  }, renderOutline()));\n};\nOutline.propTypes = Object.assign(Object.assign({}, eventProps), {\n  className: isClassName,\n  inputRef: isRef,\n  onItemClick: PropTypes.func,\n  onLoadError: PropTypes.func,\n  onLoadSuccess: PropTypes.func,\n  pdf: isPdf\n});\nexport default Outline;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","useEffect","useMemo","PropTypes","makeCancellable","makeEventProps","clsx","invariant","warning","OutlineContext","OutlineItem","cancelRunningTask","useDocumentContext","useResolver","eventProps","isClassName","isPdf","isRef","Outline","props","documentContext","mergedProps","assign","className","inputRef","onItemClick","onLoadError","onLoadErrorProps","onLoadSuccess","onLoadSuccessProps","pdf","otherProps","outlineState","outlineDispatch","value","outline","error","outlineError","toString","resetOutline","type","loadOutline","cancellable","getOutline","runningTask","promise","then","nextOutline","catch","undefined","childContext","renderOutline","createElement","map","item","itemIndex","key","dest","ref","Provider","propTypes","func"],"sources":["/Users/chrishaack/UC_Trains_Voice/react-demo/node_modules/react-pdf/dist/esm/Outline.js"],"sourcesContent":["'use client';\nvar __rest = (this && this.__rest) || function (s, e) {\n    var t = {};\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n        t[p] = s[p];\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n                t[p[i]] = s[p[i]];\n        }\n    return t;\n};\nimport React, { useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport makeCancellable from 'make-cancellable-promise';\nimport makeEventProps from 'make-event-props';\nimport clsx from 'clsx';\nimport invariant from 'tiny-invariant';\nimport warning from 'warning';\nimport OutlineContext from './OutlineContext.js';\nimport OutlineItem from './OutlineItem.js';\nimport { cancelRunningTask } from './shared/utils.js';\nimport useDocumentContext from './shared/hooks/useDocumentContext.js';\nimport useResolver from './shared/hooks/useResolver.js';\nimport { eventProps, isClassName, isPdf, isRef } from './shared/propTypes.js';\n/**\n * Displays an outline (table of contents).\n *\n * Should be placed inside `<Document />`. Alternatively, it can have `pdf` prop passed, which can be obtained from `<Document />`'s `onLoadSuccess` callback function.\n */\nconst Outline = function Outline(props) {\n    const documentContext = useDocumentContext();\n    const mergedProps = Object.assign(Object.assign({}, documentContext), props);\n    const { className, inputRef, onItemClick, onLoadError: onLoadErrorProps, onLoadSuccess: onLoadSuccessProps, pdf } = mergedProps, otherProps = __rest(mergedProps, [\"className\", \"inputRef\", \"onItemClick\", \"onLoadError\", \"onLoadSuccess\", \"pdf\"]);\n    invariant(pdf, 'Attempted to load an outline, but no document was specified. Wrap <Outline /> in a <Document /> or pass explicit `pdf` prop.');\n    const [outlineState, outlineDispatch] = useResolver();\n    const { value: outline, error: outlineError } = outlineState;\n    /**\n     * Called when an outline is read successfully\n     */\n    function onLoadSuccess() {\n        if (typeof outline === 'undefined' || outline === false) {\n            return;\n        }\n        if (onLoadSuccessProps) {\n            onLoadSuccessProps(outline);\n        }\n    }\n    /**\n     * Called when an outline failed to read successfully\n     */\n    function onLoadError() {\n        if (!outlineError) {\n            // Impossible, but TypeScript doesn't know that\n            return;\n        }\n        warning(false, outlineError.toString());\n        if (onLoadErrorProps) {\n            onLoadErrorProps(outlineError);\n        }\n    }\n    function resetOutline() {\n        outlineDispatch({ type: 'RESET' });\n    }\n    useEffect(resetOutline, [outlineDispatch, pdf]);\n    function loadOutline() {\n        if (!pdf) {\n            // Impossible, but TypeScript doesn't know that\n            return;\n        }\n        const cancellable = makeCancellable(pdf.getOutline());\n        const runningTask = cancellable;\n        cancellable.promise\n            .then((nextOutline) => {\n            outlineDispatch({ type: 'RESOLVE', value: nextOutline });\n        })\n            .catch((error) => {\n            outlineDispatch({ type: 'REJECT', error });\n        });\n        return () => cancelRunningTask(runningTask);\n    }\n    useEffect(loadOutline, [outlineDispatch, pdf]);\n    useEffect(() => {\n        if (outline === undefined) {\n            return;\n        }\n        if (outline === false) {\n            onLoadError();\n            return;\n        }\n        onLoadSuccess();\n    }, \n    // Ommitted callbacks so they are not called every time they change\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    [outline]);\n    const childContext = useMemo(() => ({\n        onItemClick,\n    }), [onItemClick]);\n    const eventProps = useMemo(() => makeEventProps(otherProps, () => outline), [otherProps, outline]);\n    if (!outline) {\n        return null;\n    }\n    function renderOutline() {\n        if (!outline) {\n            return null;\n        }\n        return (React.createElement(\"ul\", null, outline.map((item, itemIndex) => (React.createElement(OutlineItem, { key: typeof item.dest === 'string' ? item.dest : itemIndex, item: item, pdf: pdf })))));\n    }\n    return (React.createElement(\"div\", Object.assign({ className: clsx('react-pdf__Outline', className), ref: inputRef }, eventProps),\n        React.createElement(OutlineContext.Provider, { value: childContext }, renderOutline())));\n};\nOutline.propTypes = Object.assign(Object.assign({}, eventProps), { className: isClassName, inputRef: isRef, onItemClick: PropTypes.func, onLoadError: PropTypes.func, onLoadSuccess: PropTypes.func, pdf: isPdf });\nexport default Outline;\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,MAAM,GAAI,IAAI,IAAI,IAAI,CAACA,MAAM,IAAK,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAC/ED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EACf,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAC/D,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEP,CAAC,GAAGC,MAAM,CAACK,qBAAqB,CAACT,CAAC,CAAC,EAAEU,CAAC,GAAGP,CAAC,CAACQ,MAAM,E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