(() => {
var exports = {};
exports.id = 331;
exports.ids = [331];
exports.modules = {

/***/ 35:
/***/ ((module) => {

// Exports
module.exports = {
	"pdfWrap": "style_pdfWrap__Sy11_",
	"title": "style_title__MM8Bl",
	"pdfview": "style_pdfview__Qj385",
	"container": "style_container__xvHbZ",
	"baseline": "style_baseline__xvLKo",
	"tool": "style_tool__yWiqi",
	"pageNum": "style_pageNum__RrhYH",
	"num": "style_num__Nddt3",
	"changeTab": "style_changeTab__ycA3b",
	"download": "style_download__2UcJ2",
	"icon": "style_icon__pdYvj",
	"right": "style_right__koq3A",
	"fullscreen": "style_fullscreen__6L9lD"
};


/***/ }),

/***/ 9688:
/***/ ((module) => {

// Exports
module.exports = {
	"manual": "Manual_manual__Xiyme"
};


/***/ }),

/***/ 4039:
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "Z": () => (/* binding */ components_PDFView)
});

// EXTERNAL MODULE: external "react/jsx-runtime"
var jsx_runtime_ = __webpack_require__(997);
// EXTERNAL MODULE: ./src/components/PDFView/style.module.css
var style_module = __webpack_require__(35);
var style_module_default = /*#__PURE__*/__webpack_require__.n(style_module);
;// CONCATENATED MODULE: external "react-pdf"
const external_react_pdf_namespaceObject = require("react-pdf");
// EXTERNAL MODULE: external "react"
var external_react_ = __webpack_require__(6689);
// EXTERNAL MODULE: ./node_modules/react-pdf/dist/esm/Page/AnnotationLayer.css
var AnnotationLayer = __webpack_require__(9436);
// EXTERNAL MODULE: ./node_modules/react-pdf/dist/esm/Page/TextLayer.css
var TextLayer = __webpack_require__(2036);
// EXTERNAL MODULE: ./node_modules/next/image.js
var next_image = __webpack_require__(5675);
var image_default = /*#__PURE__*/__webpack_require__.n(next_image);
;// CONCATENATED MODULE: ./src/components/PDFView/index.tsx







// const file =
//     'https://ai-image.weshop.com/WeShop%20AI%E5%95%86%E6%8B%8D%2001%E8%AF%BE-%E6%A6%82%E8%BF%B0%20pdf.pdf'
const file = "/WeShop AI商拍 01课-概述.pdf";
const PDFView = ()=>{
    const [numPages, setNumPages] = (0,external_react_.useState)(0);
    const [pageNumber, setPageNumer] = (0,external_react_.useState)(1);
    const [options, setOption] = (0,external_react_.useState)({});
    const [fullscreen, setFullscreen] = (0,external_react_.useState)(false);
    const [height, setHeight] = (0,external_react_.useState)(608);
    const [width, setWidth] = (0,external_react_.useState)(1080);
    const scale = 1080 / 608;
    const canvasRef = (0,external_react_.useRef)();
    const [baseLine, setBaseLine] = (0,external_react_.useState)(false);
    (0,external_react_.useEffect)(()=>{
        external_react_pdf_namespaceObject.pdfjs.GlobalWorkerOptions.workerSrc = /* asset import */ new __webpack_require__.U(__webpack_require__(6238)).toString();
        setOption({
            cMapUrl: "cmaps/",
            standardFontDataUrl: "standard_fonts/",
            cMapPacked: true
        });
    }, []);
    (0,external_react_.useEffect)(()=>{
        if (!numPages) return;
        const handleKeyDown = (event)=>{
            if (event.keyCode === 37) {
                left();
            } else if (event.keyCode === 39) {
                right();
            } else if (event.keyCode === 27) {
                setFullscreen(false);
                setHeight(608);
                setWidth(1080);
            }
        };
        document.addEventListener("keydown", handleKeyDown);
        return ()=>{
            document.removeEventListener("keydown", handleKeyDown);
        };
    }, [
        pageNumber,
        numPages
    ]);
    function onDocumentLoadSuccess({ numPages  }) {
        setNumPages(numPages);
    }
    function left() {
        if (pageNumber > 1) {
            const number = pageNumber - 1;
            setPageNumer(number);
        }
    }
    function right() {
        if (pageNumber < numPages) {
            const number = pageNumber + 1;
            setPageNumer(number);
        }
    }
    function showFullscreen() {
        setFullscreen(!fullscreen);
        const windowScale = window.innerWidth / window.innerHeight;
        if (windowScale > scale) {
            setHeight(window.innerHeight - 48);
            const width = (window.innerHeight - 48) * scale;
            setWidth(width);
            setBaseLine(true);
        } else {
            setWidth(window.innerWidth);
            const height = window.innerWidth / scale;
            setHeight(height);
            setBaseLine(false);
        }
    }
    return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
        className: `${(style_module_default()).pdfWrap}`,
        children: [
            /*#__PURE__*/ jsx_runtime_.jsx("p", {
                className: `ag36 ${(style_module_default()).title}`,
                children: "WeShopAl商拍课程手册"
            }),
            /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                className: `${(style_module_default()).content} ${fullscreen ? (style_module_default()).fullscreen : ""}`,
                children: [
                    /*#__PURE__*/ jsx_runtime_.jsx("div", {
                        className: (style_module_default()).pdfview,
                        children: /*#__PURE__*/ jsx_runtime_.jsx("div", {
                            className: `${(style_module_default()).container} ${baseLine ? (style_module_default()).baseline : ""} `,
                            children: /*#__PURE__*/ jsx_runtime_.jsx(external_react_pdf_namespaceObject.Document, {
                                file: file,
                                onLoadSuccess: onDocumentLoadSuccess,
                                options: options,
                                loading: "加载中...",
                                children: /*#__PURE__*/ jsx_runtime_.jsx(external_react_pdf_namespaceObject.Page, {
                                    width: width,
                                    height: height,
                                    loading: "",
                                    pageNumber: pageNumber,
                                    canvasRef: canvasRef
                                })
                            })
                        })
                    }),
                    numPages ? /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                        className: `ag16 ${(style_module_default()).tool}`,
                        children: [
                            /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                                className: (style_module_default()).pageNum,
                                children: [
                                    /*#__PURE__*/ jsx_runtime_.jsx("div", {
                                        className: (style_module_default()).changeTab,
                                        onClick: left,
                                        children: /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                                            src: "/arrow.svg",
                                            alt: "change page",
                                            width: 24,
                                            height: 24
                                        })
                                    }),
                                    /*#__PURE__*/ jsx_runtime_.jsx("div", {
                                        className: (style_module_default()).num,
                                        children: pageNumber
                                    }),
                                    /*#__PURE__*/ jsx_runtime_.jsx("div", {
                                        className: `${(style_module_default()).changeTab} ${(style_module_default()).right}`,
                                        onClick: right,
                                        children: /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                                            src: "/arrow.svg",
                                            alt: "change page",
                                            width: 24,
                                            height: 24
                                        })
                                    })
                                ]
                            }),
                            !fullscreen ? /*#__PURE__*/ (0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, {
                                children: [
                                    /*#__PURE__*/ (0,jsx_runtime_.jsxs)("a", {
                                        className: (style_module_default()).download,
                                        href: file,
                                        download: true,
                                        children: [
                                            /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                                                src: "/pdf-download.svg",
                                                alt: "pdf download",
                                                width: 24,
                                                height: 24,
                                                className: (style_module_default()).icon
                                            }),
                                            "下载PDF"
                                        ]
                                    }),
                                    /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
                                        className: (style_module_default()).download,
                                        onClick: ()=>{
                                            showFullscreen();
                                        },
                                        children: [
                                            /*#__PURE__*/ jsx_runtime_.jsx((image_default()), {
                                                src: "/maximize.svg",
                                                alt: "maximize",
                                                width: 24,
                                                height: 24,
                                                className: (style_module_default()).icon
                                            }),
                                            "全屏"
                                        ]
                                    })
                                ]
                            }) : null
                        ]
                    }) : null
                ]
            })
        ]
    });
};
/* harmony default export */ const components_PDFView = (PDFView);


/***/ }),

/***/ 9139:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   "getStaticProps": () => (/* binding */ getStaticProps)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_Layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2758);
/* harmony import */ var _styles_Manual_module_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9688);
/* harmony import */ var _styles_Manual_module_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_styles_Manual_module_css__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _components_PDFView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4039);
/* harmony import */ var next_i18next_serverSideTranslations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5460);
/* harmony import */ var next_i18next_serverSideTranslations__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_i18next_serverSideTranslations__WEBPACK_IMPORTED_MODULE_3__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_Layout__WEBPACK_IMPORTED_MODULE_1__]);
_components_Layout__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];





const Manual = ()=>{
    return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_Layout__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, {
        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
            className: (_styles_Manual_module_css__WEBPACK_IMPORTED_MODULE_4___default().manual),
            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_PDFView__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {})
        })
    });
};
const getStaticProps = async ({ locale  })=>({
        props: {
            ...await (0,next_i18next_serverSideTranslations__WEBPACK_IMPORTED_MODULE_3__.serverSideTranslations)(locale ?? "zh-CN", [
                "common"
            ])
        }
    });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Manual);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ }),

/***/ 9436:
/***/ (() => {



/***/ }),

/***/ 2036:
/***/ (() => {



/***/ }),

/***/ 5725:
/***/ ((module) => {

"use strict";
module.exports = require("antd");

/***/ }),

/***/ 1377:
/***/ ((module) => {

"use strict";
module.exports = require("next-i18next");

/***/ }),

/***/ 5460:
/***/ ((module) => {

"use strict";
module.exports = require("next-i18next/serverSideTranslations");

/***/ }),

/***/ 3918:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/amp-context.js");

/***/ }),

/***/ 5732:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/amp-mode.js");

/***/ }),

/***/ 2796:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/head-manager-context.js");

/***/ }),

/***/ 4486:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/image-blur-svg.js");

/***/ }),

/***/ 744:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/image-config-context.js");

/***/ }),

/***/ 5843:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/image-config.js");

/***/ }),

/***/ 9552:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/image-loader");

/***/ }),

/***/ 2470:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/side-effect.js");

/***/ }),

/***/ 618:
/***/ ((module) => {

"use strict";
module.exports = require("next/dist/shared/lib/utils/warn-once.js");

/***/ }),

/***/ 968:
/***/ ((module) => {

"use strict";
module.exports = require("next/head");

/***/ }),

/***/ 1853:
/***/ ((module) => {

"use strict";
module.exports = require("next/router");

/***/ }),

/***/ 6238:
/***/ ((module) => {

"use strict";
module.exports = require("pdfjs-dist/build/pdf.worker.min.js");

/***/ }),

/***/ 6689:
/***/ ((module) => {

"use strict";
module.exports = require("react");

/***/ }),

/***/ 997:
/***/ ((module) => {

"use strict";
module.exports = require("react/jsx-runtime");

/***/ }),

/***/ 9621:
/***/ ((module) => {

"use strict";
module.exports = require("ua-parser-js");

/***/ }),

/***/ 9648:
/***/ ((module) => {

"use strict";
module.exports = import("axios");;

/***/ })

};
;

// load runtime
var __webpack_require__ = require("../webpack-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [636,675,751,758], () => (__webpack_exec__(9139)));
module.exports = __webpack_exports__;

})();