{"code":"// Generated with util/create-component.js\r\nimport React from \"react\";\r\nimport Label from \"../Label\";\r\nimport NsImage from \"../shared/ns-image\";\r\nimport Timer from \"../Timer\";\r\nimport Heading from \"../UI/Heading\";\r\nimport Text from \"../UI/Text\";\r\nvar NosearchDeal = function (props) {\r\n    var data = props.data, viewType = props.viewType, fluid = props.fluid, _a = props.type, type = _a === void 0 ? \"nosearchDeal\" : _a, _b = props.isLogin, isLogin = _b === void 0 ? false : _b, _c = props.isIOSApp, isIOSApp = _c === void 0 ? false : _c;\r\n    var state = \"NOSEARCH_DEAL\";\r\n    var itemState = function () {\r\n        if (type === \"reviewTem\")\r\n            state = \"REVIEWTEM\";\r\n        if (type === \"nosearchDeal\")\r\n            state = \"NOSEARCH_DEAL\";\r\n        if (!isLogin && data.goodsAccess === \"member\")\r\n            state = \"MEMBERSHIP\";\r\n        if (data.soldOutFl === \"y\")\r\n            state = \"SOLDOUT\";\r\n        if (!isLogin && data.goodsAccess === \"member\" && data.soldOutFl === \"y\")\r\n            state = \"MEMBERSHIP-SOLDOUT\";\r\n        return state;\r\n    };\r\n    var imageSize = fluid\r\n        ? \"w-full max-w-[33.5rem] \".concat(viewType === \"home\" ? \"pc:max-w-[48rem]\" : \"pc:max-w-[38rem]\")\r\n        : \"w-[33.5rem] \".concat(viewType === \"home\" ? \"pc:w-[48rem]\" : \"pc:w-[38rem]\");\r\n    return (React.createElement(\"article\", { \"data-testid\": \"NosearchDeal\", className: \"nrc--NosearchDeal overflow-hidden pc:p-[2rem] pc:bg-blue-1 \".concat(type ===\r\n            \"nosearchDeal\" && \"bg-blue-1\", \" \").concat(fluid\r\n            ? \"w-full max-w-[33.5rem] \".concat(viewType === \"home\" ? \"pc:max-w-[52rem]\" : \"pc:max-w-[80rem]\")\r\n            : \"w-[33.5rem] \".concat(viewType === \"home\" ? \"pc:w-[52rem]\" : \"pc:w-[80rem]\"), \" \").concat(viewType === \"pick\" && \"pc:flex\") },\r\n        React.createElement(\"div\", { className: \"relative h-auto \".concat(imageSize, \" \").concat(viewType !== \"home\" &&\r\n                \"pc:mr-[2rem] pc:flex-shrink-0\"), style: { aspectRatio: \"16/9\" } },\r\n            React.createElement(ProductImage, { imageSize: imageSize, video: data.video, videoThumbnail: data.videoThumbnail, comingSoonImg: data.comingSoonImg, isComingSoon: data.isComingSoon, ImageWrapper: data.ImageWrapper, startAt: data.periodDiscountStart, isIOSApp: isIOSApp, videoKey: data.goodsNo }),\r\n            type === \"nosearchDeal\" && !data.isComingSoon && (React.createElement(Timer, { id: data.goodsNo, type: \"nsDeal\", periodDiscountStart: data.periodDiscountStart, periodDiscountEnd: data.periodDiscountEnd, benefitUseType: data.benefitUseType, timerText: \"\\uB0A8\\uC558\\uC5B4\\uC694!\" }))),\r\n        React.createElement(\"div\", { className: \"\".concat(viewType === \"pick\" &&\r\n                \"pc:flex pc:flex-col pc:justify-between\") },\r\n            React.createElement(\"div\", { className: \"\".concat(viewType === \"home\" && \"my-[1.2rem]\") },\r\n                React.createElement(\"h5\", { className: \"text-heading-5 pc:text-heading-4 font-bold text-gray-10 break-all line-clamp-2 mb-[0.4rem]\", dangerouslySetInnerHTML: {\r\n                        __html: data.title,\r\n                    }, \"aria-label\": \"\\uB178\\uC368\\uCE58 \\uACF5\\uB3D9\\uAD6C\\uB9E4 \\uC0C1\\uD488 \\uC81C\\uBAA9\" }),\r\n                (type === \"nosearchDeal\" || viewType === \"pick\") && (React.createElement(\"div\", { className: \"\".concat(viewType === \"pick\" && \"hidden pc:block\") },\r\n                    React.createElement(Text, { type: \"B6\", className: \"break-all text-gray-10 line-clamp-3 pc:line-clamp-2\", children: data.description, \"aria-label\": \"\\uB178\\uC368\\uCE58 \\uACF5\\uB3D9\\uAD6C\\uB9E4 \\uC0C1\\uD488 \\uC124\\uBA85\" })))),\r\n            React.createElement(\"div\", { className: \"pt-[1.2rem] border-t-[1px] border-gray-3\" },\r\n                React.createElement(Heading, { level: 4, className: \"text-gray-10 mb-[0.4rem] pc:text-heading-3 \".concat((itemState() ===\r\n                        \"SOLDOUT\" ||\r\n                        itemState() === \"MEMBERSHIP-SOLDOUT\") &&\r\n                        \"text-gray-6\"), children: data.dealGoodsNm, \"aria-label\": \"\\uC0C1\\uD488\\uBA85\" }),\r\n                React.createElement(\"div\", { className: \"flex items-center justify-between pc:justify-start\" },\r\n                    itemState() === \"REVIEWTEM\" && (React.createElement(\"div\", { className: \"flex space-x-2\" },\r\n                        data.hasSpecialPrice && (React.createElement(Label, { className: \"bg-orange pc:mr-[1rem]\" }, \"\\uD2B9\\uAC00\")),\r\n                        data.hasCouponDiscount && (React.createElement(Label, { className: \"bg-white border-[1px] border-blue-7 text-blue-7 pc:mr-[1rem]\" }, \"\\uCFE0\\uD3F0 \\uC801\\uC6A9\\uAC00\")))),\r\n                    itemState() === \"NOSEARCH_DEAL\" && (React.createElement(Label, { className: \"bg-red-4 hidden pc:block pc:mr-[1rem]\" }, \"\\uCD5C\\uC800\\uAC00 \\uC774\\uD558 \\uD2B9\\uAC00\")),\r\n                    (itemState() === \"SOLDOUT\" ||\r\n                        itemState() === \"MEMBERSHIP-SOLDOUT\") && (React.createElement(Label, { className: \"bg-gray-6 hidden pc:block pc:mr-[1rem]\" }, \"\\uD488\\uC808\")),\r\n                    itemState() === \"MEMBERSHIP\" && (React.createElement(Label, { className: \"bg-secret hidden pc:block pc:mr-[1rem]\" }, \"\\uD68C\\uC6D0\\uC804\\uC6A9 \\uC2DC\\uD06C\\uB9BF \\uD2B9\\uAC00 \\u2728\")),\r\n                    itemState() === \"MEMBERSHIP\" ||\r\n                        itemState() === \"MEMBERSHIP-SOLDOUT\" ? (React.createElement(Heading, { level: 5, className: \"\".concat(itemState() === \"MEMBERSHIP\" ? \"text-secret\" : \"text-gray-6\"), \"aria-label\": \"\\uD68C\\uC6D0\\uC804\\uC6A9 \\uC0C1\\uD488\\uC73C\\uB85C \\uAC00\\uACA9 \\uBBF8\\uACF5\\uAC1C\" }, \"\\uC2DC\\uD06C\\uB9BF \\uD2B9\\uAC00 \\uD655\\uC778\\uD558\\uAE30\")) : (React.createElement(\"div\", { className: \"flex items-center\" },\r\n                        React.createElement(\"h2\", { className: \"text-heading-2 font-extrabold mr-[0.8rem] \".concat(data.isComingSoon\r\n                                ? \"text-[transparent]\"\r\n                                : itemState() === \"SOLDOUT\" ||\r\n                                    itemState() === \"MEMBERSHIP-SOLDOUT\"\r\n                                    ? \"text-gray-6\"\r\n                                    : \"text-gray-10\"), style: {\r\n                                textShadow: \"\".concat(data.isComingSoon ? \"0 0 20px rgba(0,0,0,0.4)\" : \"\"),\r\n                            }, \"aria-label\": \"\\uD310\\uB9E4\\uAC00\" },\r\n                            numberWithCommas(data.discountedPrice),\r\n                            \"\\uC6D0\"),\r\n                        !data.isComingSoon && (React.createElement(Text, { type: \"B9\", className: \"line-through text-gray-6\", \"aria-label\": \"\\uC815\\uC0C1\\uAC00\" },\r\n                            numberWithCommas(data.originPrice),\r\n                            \"\\uC6D0\")))),\r\n                    itemState() === \"NOSEARCH_DEAL\" && (React.createElement(Label, { className: \"bg-red-4 pc:hidden\" }, \"\\uCD5C\\uC800\\uAC00 \\uC774\\uD558 \\uD2B9\\uAC00\")),\r\n                    (itemState() === \"SOLDOUT\" ||\r\n                        itemState() === \"MEMBERSHIP-SOLDOUT\") && (React.createElement(Label, { className: \"bg-gray-6 pc:hidden\" }, \"\\uD488\\uC808\")),\r\n                    itemState() === \"MEMBERSHIP\" && (React.createElement(Label, { className: \"bg-secret pc:hidden\" }, \"\\uD68C\\uC6D0\\uC804\\uC6A9 \\uC2DC\\uD06C\\uB9BF \\uD2B9\\uAC00 \\u2728\")))))));\r\n};\r\nexport default NosearchDeal;\r\nvar numberWithCommas = function (num) {\r\n    if (!num)\r\n        return \"\";\r\n    return num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\n};\r\nvar ProductImage = function (props) {\r\n    var imageSize = props.imageSize, video = props.video, videoThumbnail = props.videoThumbnail, comingSoonImg = props.comingSoonImg, isComingSoon = props.isComingSoon, ImageWrapper = props.ImageWrapper, startAt = props.startAt, isIOSApp = props.isIOSApp, videoKey = props.videoKey;\r\n    var COMING_SOON_IMG = (React.createElement(\"div\", { className: \"\".concat(imageSize, \" relative\") },\r\n        React.createElement(\"div\", { className: \"\".concat(imageSize, \" relative\") },\r\n            React.createElement(NsImage, { ImageWrapper: ImageWrapper, imageUrl: comingSoonImg, className: \"\".concat(imageSize, \" object-cover\"), style: {\r\n                    aspectRatio: \"16/9\",\r\n                } })),\r\n        React.createElement(\"div\", { className: \"\".concat(imageSize, \" bg-black opacity-40 absolute top-0 left-0\"), style: {\r\n                aspectRatio: \"16/9\",\r\n            } }),\r\n        React.createElement(\"div\", { className: \"absolute text-center -translate-x-1/2 -translate-y-1/2 top-1/2 left-1/2\" },\r\n            React.createElement(Heading, { level: 3, className: \"text-white\" }, \"coming soon\"),\r\n            React.createElement(Text, { type: \"B4\", className: \"text-white\" },\r\n                startAt && startAt.substring(0, 10).replace(/-/g, \".\"),\r\n                \" 14:00 OPEN\"))));\r\n    var VIDEO = (React.createElement(\"video\", { width: \"100%\", height: \"auto\", controls: isIOSApp ? true : false, autoPlay: isIOSApp ? false : true, poster: isIOSApp ? videoThumbnail : undefined, muted: true, controlsList: \"nofullscreen nodownload noremoteplayback\", loop: true, playsInline: true, style: {\r\n            objectFit: \"fill\",\r\n            aspectRatio: \"16/9\",\r\n        }, key: videoKey },\r\n        React.createElement(\"source\", { \"data-testid\": \"NsDealItem_video\", src: video, width: \"100%\", height: \"100%\" })));\r\n    return isComingSoon ? (COMING_SOON_IMG) : (React.createElement(\"div\", { onClick: function (e) {\r\n            if (isIOSApp)\r\n                e.preventDefault();\r\n        } }, VIDEO));\r\n};\r\n","references":["/Users/dongyoonkim/Dev/nosearch-react-component/node_modules/@types/react/index.d.ts","/Users/dongyoonkim/Dev/nosearch-react-component/src/components/Label/index.ts","/Users/dongyoonkim/Dev/nosearch-react-component/src/components/shared/ns-image.tsx","/Users/dongyoonkim/Dev/nosearch-react-component/src/components/Timer/index.ts","/Users/dongyoonkim/Dev/nosearch-react-component/src/components/UI/Heading/index.ts","/Users/dongyoonkim/Dev/nosearch-react-component/src/components/UI/Text/index.ts","/Users/dongyoonkim/Dev/nosearch-react-component/src/components/NosearchDeal/NosearchDeal.types.ts"],"dts":{"name":"/Users/dongyoonkim/Dev/nosearch-react-component/lib/components/NosearchDeal/NosearchDeal.d.ts","writeByteOrderMark":false,"text":"import React from \"react\";\r\nimport { NosearchDealProps } from \"./NosearchDeal.types\";\r\ndeclare const NosearchDeal: React.FC<NosearchDealProps>;\r\nexport default NosearchDeal;\r\n"}}
