diff --git a/storybook/116.88bec430.iframe.bundle.js b/storybook/116.88bec430.iframe.bundle.js deleted file mode 100644 index 776f98d26..000000000 --- a/storybook/116.88bec430.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[116],{"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _utils_error__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/utils/error.ts");const __WEBPACK_DEFAULT_EXPORT__={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.e({...apiError,status:response.status})}return response}catch(error){if(error instanceof _utils_error__WEBPACK_IMPORTED_MODULE_0__.e)throw error;throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.D}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/apis/room.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gn:()=>exitRoom,ew:()=>applyRoomSetting,qE:()=>getRoomInfo,rm:()=>getCategoryList,zj:()=>startGame});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const getRoomInfo=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.getRoomInfo(roomId)});return await res.json()},startGame=async roomId=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.startGame(roomId)})},getCategoryList=async()=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.categoryList});return await res.json()},applyRoomSetting=async(roomId,roomSetting)=>{const{totalRound,timeLimit,category}=roomSetting;await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.applyRoomSetting(roomId),headers:{"Content-Type":"application/json"},body:{totalRound,timeLimit,category}})},exitRoom=async(roomId,memberId)=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.delete({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.deleteRoom(roomId,memberId)})}},"./src/components/ReadyMembersContainer/ReadyMembersContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>ReadyMembersContainer_ReadyMembersContainer});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var react=__webpack_require__("./node_modules/react/index.js"),es=__webpack_require__("./node_modules/recoil/es/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const readyMembersContainerLayout={name:"ch4q08",styles:"display:flex;flex-direction:column;gap:2rem;width:100%"},membersContainer=(0,emotion_react_browser_esm.AH)("position:relative;height:25rem;padding:2rem 3rem 0;border-radius:2rem;background-color:",Theme.S.color.peanut300,";font-weight:600;font-size:1rem;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}",""),totalNumber={name:"1h2hkhu",styles:"padding-left:2rem;font-weight:900;font-size:1.6rem"},memberList={name:"10zw2ye",styles:"display:flex;flex-direction:column;gap:2rem"},inviteButton=(0,emotion_react_browser_esm.AH)("display:flex;align-items:center;gap:2rem;width:100%;border-radius:",(0,getBorderRadius.A)("medium"),";background-color:",Theme.S.color.peanut400,";font-size:1rem;",""),memberItem={name:"15umcqw",styles:"display:flex;align-items:center;gap:2rem"},profileBox={name:"1bezcfz",styles:"display:flex;justify-content:center;align-items:center;width:3.6rem;height:3.6rem;border-radius:50%;background-color:white"},profileImage={name:"xjt14x",styles:"width:60%"},memberStatus={name:"mk4uq1",styles:"display:flex;flex:1;justify-content:space-between;align-items:center"};var InviteModal=__webpack_require__("./src/components/common/InviteModal/InviteModal.tsx");const crownIcon_namespaceObject=__webpack_require__.p+"static/media/crownIcon.7f63c2cb.png",plusIcon_namespaceObject=__webpack_require__.p+"static/media/plusIcon.e7c40c3c.png";var sillyDdangkong=__webpack_require__("./src/assets/images/sillyDdangkong.png"),useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),atom=__webpack_require__("./src/recoil/atom.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const ReadyMembersContainer=()=>{const{members,master}=(0,useGetRoomInfo.$)(),{isOpen,show,close}=(0,useModal.A)(),[memberInfo,setMemberInfo]=(0,es.L4)(atom.u);return(0,react.useEffect)((()=>{memberInfo.isMaster||master.memberId!==memberInfo.memberId||setMemberInfo({...memberInfo,isMaster:!0})}),[master.memberId]),(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:readyMembersContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("p",{css:totalNumber,children:["총 인원 ",members.length,"명"]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("section",{css:membersContainer,children:(0,emotion_react_jsx_runtime_browser_esm.FD)("ul",{css:memberList,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("button",{css:inviteButton,onClick:show,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:profileBox,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:plusIcon_namespaceObject,alt:"추가 아이콘"})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{children:"초대하기"})]})}),members.map((member=>(0,emotion_react_jsx_runtime_browser_esm.FD)("li",{css:memberItem,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:profileBox,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:sillyDdangkong,alt:"사용자 프로필",css:profileImage})}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:memberStatus,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{children:member.nickname}),member.isMaster&&(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:crownIcon_namespaceObject,alt:"왕관 아이콘"})]})]},member.memberId)))]})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(InviteModal.A,{isOpen,onClose:close})]})},ReadyMembersContainer_ReadyMembersContainer=ReadyMembersContainer;ReadyMembersContainer.__docgenInfo={description:"",methods:[],displayName:"ReadyMembersContainer"}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/hooks/useGetRoomInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>useGetRoomInfo});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-router/dist/index.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_config__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/constants/config.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const useGetRoomInfo=()=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.g)(),{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.roomMembers,Number(roomId)],queryFn:()=>(0,_apis_room__WEBPACK_IMPORTED_MODULE_0__.qE)(Number(roomId)),refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=_constants_config__WEBPACK_IMPORTED_MODULE_4__.A3)&&_constants_config__WEBPACK_IMPORTED_MODULE_4__.S2,refetchIntervalInBackground:!0,gcTime:0});return{members:data?.members,roomSetting:data?.roomSetting,master:data?.master,isGameStart:data?.isGameStart}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");const __WEBPACK_DEFAULT_EXPORT__=()=>{const[isOpen,setIsOpen]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return{isOpen,show:()=>{setIsOpen(!0)},close:()=>{setIsOpen(!1)}}}},"./src/utils/error.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>CustomError,D:()=>NetworkError});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 5초, 10초, 15초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}},"./src/assets/images/sillyDdangkong.png":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/sillyDdangkong.301fa659.png"}}]); \ No newline at end of file diff --git a/storybook/305.23ee0d20.iframe.bundle.js b/storybook/305.23ee0d20.iframe.bundle.js new file mode 100644 index 000000000..eca50d206 --- /dev/null +++ b/storybook/305.23ee0d20.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[305],{"./src/components/common/AlertModal/AlertModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>AlertModal_AlertModal});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var react=__webpack_require__("./node_modules/react/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const alertModalTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.headline3,";",""),messageContainer={name:"1azakc",styles:"text-align:center"},alertText={name:"255c6r",styles:"word-break:keep-all"};var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const AlertModal=({isOpen,onClose,onConfirm,message,title})=>(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:alertModalTitle,children:title||"알림"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{css:messageContainer,children:message.split("\n").map((text=>(0,emotion_react_jsx_runtime_browser_esm.FD)(react.Fragment,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:alertText,children:text}),(0,emotion_react_jsx_runtime_browser_esm.Y)("br",{})]},text)))}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{onClick:()=>{onConfirm&&onConfirm(),onClose()},buttonWidth:"60%",children:"확인"})})]}),AlertModal_AlertModal=AlertModal;AlertModal.__docgenInfo={description:"",methods:[],displayName:"AlertModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},message:{required:!0,tsType:{name:"string"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onConfirm:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},title:{required:!1,tsType:{name:"string"},description:""}}}},"./src/components/common/Button/Button.styled.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>bottomButtonLayout,l:()=>buttonLayout});var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const utils_getFontSize=fontSize=>{switch(fontSize){case"small":return Theme.S.typography.caption.fontSize;case"medium":default:return Theme.S.typography.headline2.fontSize;case"large":return Theme.S.typography.headline1.fontSize}};var _ref={name:"10t0zvp",styles:"width:32rem;padding:2rem 0"},_ref2={name:"10t0zvp",styles:"width:32rem;padding:2rem 0"},_ref3={name:"1d06pcm",styles:"width:12rem;padding:1.6rem 0"},_ref4={name:"g089ls",styles:"width:6.8rem;padding:0.8rem 0"};const utils_getSizeStyles=size=>{switch(size){case"small":return _ref4;case"medium":return _ref3;case"large":return _ref2;default:return _ref}};var Button_styled_ref={name:"1wsejju",styles:"position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%"};const buttonLayout=({disabled,size,radius,fontSize,bottom})=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;",utils_getSizeStyles(size),";border:none;border-radius:",(0,getBorderRadius.A)(radius),";background-color:",disabled?Theme.S.color.peanut300:Theme.S.color.peanut400,";font-weight:bold;font-size:",utils_getFontSize(fontSize),";cursor:",disabled?"not-allowed":"pointer",";",bottom&&Button_styled_ref,";",""),bottomButtonLayout={name:"o8a8jf",styles:"position:fixed;bottom:0;width:100%"}},"./src/components/common/Button/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _Button_styled__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/common/Button/Button.styled.ts"),_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Button=({text,onClick,disabled,size,radius,fontSize,bottom,...props})=>(0,_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Y)("button",{onClick,disabled,css:(0,_Button_styled__WEBPACK_IMPORTED_MODULE_1__.l)({disabled,size,radius,fontSize,bottom}),...props,children:text}),__WEBPACK_DEFAULT_EXPORT__=Button;Button.__docgenInfo={description:"",methods:[],displayName:"Button",props:{text:{required:!0,tsType:{name:"string"},description:""},onClick:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:""},style:{required:!1,tsType:{name:"ReactCSSProperties",raw:"React.CSSProperties"},description:""},size:{required:!1,tsType:{name:"union",raw:"'small' | 'medium' | 'large'",elements:[{name:"literal",value:"'small'"},{name:"literal",value:"'medium'"},{name:"literal",value:"'large'"}]},description:""},radius:{required:!1,tsType:{name:"union",raw:"'small' | 'medium' | 'large'",elements:[{name:"literal",value:"'small'"},{name:"literal",value:"'medium'"},{name:"literal",value:"'large'"}]},description:""},fontSize:{required:!1,tsType:{name:"union",raw:"'small' | 'medium' | 'large'",elements:[{name:"literal",value:"'small'"},{name:"literal",value:"'medium'"},{name:"literal",value:"'large'"}]},description:""},bottom:{required:!1,tsType:{name:"boolean"},description:""}},composes:["ButtonHTMLAttributes"]}},"./src/components/common/ErrorBoundary/AsyncErrorBoundary.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>ErrorBoundary_AsyncErrorBoundary});var errorboundary=__webpack_require__("./node_modules/@sentry/react/build/esm/errorboundary.js"),currentScopes=__webpack_require__("./node_modules/@sentry/core/build/esm/currentScopes.js"),esm_exports=__webpack_require__("./node_modules/@sentry/core/build/esm/exports.js"),QueryErrorResetBoundary=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js"),react=__webpack_require__("./node_modules/react/index.js"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const DeferredComponent=({children})=>{const[isDeferred,setIsDeferred]=(0,react.useState)(!1);return(0,react.useEffect)((()=>{const timeoutId=setTimeout((()=>{setIsDeferred(!0)}),300);return()=>clearTimeout(timeoutId)}),[]),isDeferred?(0,emotion_react_jsx_runtime_browser_esm.Y)(emotion_react_jsx_runtime_browser_esm.FK,{children}):null},DeferredComponent_DeferredComponent=DeferredComponent;DeferredComponent.__docgenInfo={description:"",methods:[],displayName:"DeferredComponent"};var dist=__webpack_require__("./node_modules/react-router/dist/index.js"),Button=__webpack_require__("./src/components/common/Button/Button.tsx");const errorFallbackLayout={name:"l8or78",styles:"display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2rem;height:80vh;padding:2.4rem"},errorImage={name:"137ewef",styles:"width:16rem;height:16rem"},errorText={name:"15tabo2",styles:"font-size:1.6rem;line-height:2rem;text-align:center;word-break:keep-all"},fallbackButtonContainer={name:"10zw2ye",styles:"display:flex;flex-direction:column;gap:2rem"},errorDdangkong_namespaceObject=__webpack_require__.p+"static/media/errorDdangkong.d4e3eff5.png";var utils_error=__webpack_require__("./src/utils/error.ts");const AsyncErrorFallback=({error,resetError})=>{const navigate=(0,dist.Zp)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:errorFallbackLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:errorDdangkong_namespaceObject,alt:"에러나서 슬픈 땅콩",css:errorImage}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:errorText,children:error instanceof utils_error.e&&error.message}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:fallbackButtonContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Button.A,{onClick:resetError,text:"다시 시도",size:"medium",radius:"medium"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Button.A,{onClick:()=>{navigate("/")},text:"홈으로",size:"medium",radius:"medium"})]})]})},AsyncErrorFallback_AsyncErrorFallback=AsyncErrorFallback;AsyncErrorFallback.__docgenInfo={description:"",methods:[],displayName:"AsyncErrorFallback"};const AsyncErrorBoundary=({pendingFallback,children})=>{const{reset}=(0,QueryErrorResetBoundary.h)();return(0,emotion_react_jsx_runtime_browser_esm.Y)(errorboundary.tH,{onReset:reset,fallback:({error,resetError})=>(0,emotion_react_jsx_runtime_browser_esm.Y)(AsyncErrorFallback_AsyncErrorFallback,{error,resetError}),onError:error=>{if(!(error instanceof utils_error.e))throw error;(0,currentScopes.v4)((scope=>{scope.setLevel("warning"),scope.setTag("api","internalServerError"),(0,esm_exports.Cp)(new Error(error.message))}))},children:(0,emotion_react_jsx_runtime_browser_esm.Y)(react.Suspense,{fallback:(0,emotion_react_jsx_runtime_browser_esm.Y)(DeferredComponent_DeferredComponent,{children:pendingFallback}),children})})},ErrorBoundary_AsyncErrorBoundary=AsyncErrorBoundary;AsyncErrorBoundary.__docgenInfo={description:"",methods:[],displayName:"AsyncErrorBoundary",props:{pendingFallback:{required:!0,tsType:{name:"ReactReactNode",raw:"React.ReactNode"},description:""}}}},"./src/components/layout/Content/Content.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>Content_Content});const contentLayout={name:"v9f8bz",styles:"display:flex;flex-direction:column;align-items:center;gap:1.6rem;height:85vh;padding:0 2.4rem"};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Content=({children})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("section",{css:contentLayout,children}),Content_Content=Content;Content.__docgenInfo={description:"",methods:[],displayName:"Content"}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");const __WEBPACK_DEFAULT_EXPORT__=()=>{const[isOpen,setIsOpen]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return{isOpen,show:()=>{setIsOpen(!0)},close:()=>{setIsOpen(!1)}}}},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}}}]); \ No newline at end of file diff --git a/storybook/424.b2c3d1c3.iframe.bundle.js b/storybook/424.b2c3d1c3.iframe.bundle.js new file mode 100644 index 000000000..8cd822382 --- /dev/null +++ b/storybook/424.b2c3d1c3.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[424],{"./src/components/ReadyMembersContainer/ReadyMembersContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>ReadyMembersContainer_ReadyMembersContainer});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var react=__webpack_require__("./node_modules/react/index.js"),es=__webpack_require__("./node_modules/recoil/es/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const readyMembersContainerLayout={name:"ch4q08",styles:"display:flex;flex-direction:column;gap:2rem;width:100%"},membersContainer=(0,emotion_react_browser_esm.AH)("position:relative;height:25rem;padding:2rem 3rem 0;border-radius:2rem;background-color:",Theme.S.color.peanut300,";font-weight:600;font-size:1rem;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none;&::-webkit-scrollbar{display:none;}",""),totalNumber={name:"eu54mg",styles:"display:flex;justify-content:space-between;align-items:center;padding-left:2rem;font-weight:900;font-size:2rem"},memberList={name:"10zw2ye",styles:"display:flex;flex-direction:column;gap:2rem"},inviteButton=(0,emotion_react_browser_esm.AH)("width:12rem;height:4rem;border-radius:",(0,getBorderRadius.A)("medium"),";background-color:",Theme.S.color.peanut400,";",""),memberItem={name:"15umcqw",styles:"display:flex;align-items:center;gap:2rem"},profileBox={name:"1bezcfz",styles:"display:flex;justify-content:center;align-items:center;width:3.6rem;height:3.6rem;border-radius:50%;background-color:white"},profileImage={name:"xjt14x",styles:"width:60%"},memberStatus={name:"mk4uq1",styles:"display:flex;flex:1;justify-content:space-between;align-items:center"};var InviteModal=__webpack_require__("./src/components/common/InviteModal/InviteModal.tsx");const crownIcon_namespaceObject=__webpack_require__.p+"static/media/crownIcon.7f63c2cb.png",sillyDdangkong_namespaceObject=__webpack_require__.p+"static/media/sillyDdangkong.301fa659.png";var useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),atom=__webpack_require__("./src/recoil/atom.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const ReadyMembersContainer=()=>{const{members,master}=(0,useGetRoomInfo.$)(),{isOpen,show,close}=(0,useModal.A)(),[memberInfo,setMemberInfo]=(0,es.L4)(atom.u);return(0,react.useEffect)((()=>{memberInfo.isMaster||master.memberId!==memberInfo.memberId||setMemberInfo({...memberInfo,isMaster:!0})}),[master.memberId]),(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:readyMembersContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:totalNumber,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{children:["총 인원 ",members.length,"명"]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:inviteButton,onClick:show,children:"초대하기"})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("section",{css:membersContainer,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:memberList,children:members.map((member=>(0,emotion_react_jsx_runtime_browser_esm.FD)("li",{css:memberItem,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:profileBox,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:sillyDdangkong_namespaceObject,alt:"사용자 프로필",css:profileImage})}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:memberStatus,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{children:member.nickname}),member.isMaster&&(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:crownIcon_namespaceObject,alt:"왕관 아이콘"})]})]},member.memberId)))})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(InviteModal.A,{isOpen,onClose:close})]})},ReadyMembersContainer_ReadyMembersContainer=ReadyMembersContainer;ReadyMembersContainer.__docgenInfo={description:"",methods:[],displayName:"ReadyMembersContainer"}}}]); \ No newline at end of file diff --git a/storybook/507.1b2139ef.iframe.bundle.js b/storybook/507.1b2139ef.iframe.bundle.js deleted file mode 100644 index 585a66944..000000000 --- a/storybook/507.1b2139ef.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[507],{"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _utils_error__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/utils/error.ts");const __WEBPACK_DEFAULT_EXPORT__={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.e({...apiError,status:response.status})}return response}catch(error){if(error instanceof _utils_error__WEBPACK_IMPORTED_MODULE_0__.e)throw error;throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.D}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/apis/room.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gn:()=>exitRoom,ew:()=>applyRoomSetting,qE:()=>getRoomInfo,rm:()=>getCategoryList,zj:()=>startGame});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const getRoomInfo=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.getRoomInfo(roomId)});return await res.json()},startGame=async roomId=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.startGame(roomId)})},getCategoryList=async()=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.categoryList});return await res.json()},applyRoomSetting=async(roomId,roomSetting)=>{const{totalRound,timeLimit,category}=roomSetting;await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.applyRoomSetting(roomId),headers:{"Content-Type":"application/json"},body:{totalRound,timeLimit,category}})},exitRoom=async(roomId,memberId)=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.delete({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.deleteRoom(roomId,memberId)})}},"./src/components/common/RoomSettingModal/RoomSettingModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>RoomSettingModal_RoomSettingModal});var react=__webpack_require__("./node_modules/react/index.js");const emptyLayout={name:"nbsemk",styles:"height:3.6rem"};var Dropdown=__webpack_require__("./src/components/common/Dropdown/Dropdown.tsx"),useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),dist=__webpack_require__("./node_modules/react-router/dist/index.js"),room=__webpack_require__("./src/apis/room.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useCategoryListQuery=()=>{const{roomId}=(0,dist.g)(),categoryListQuery=(0,useQuery.I)({queryKey:[queryKeys.e.categoryList,Number(roomId)],queryFn:async()=>await(0,room.rm)()});return{...categoryListQuery,categoryList:categoryListQuery.data?.categories}};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const CategoryDropdown=({category,handleClickOption})=>{const{categoryList,isLoading}=hooks_useCategoryListQuery();return isLoading?(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:emptyLayout}):categoryList&&category?(0,emotion_react_jsx_runtime_browser_esm.Y)(Dropdown.A,{text:category,optionList:categoryList,handleClick:handleClickOption}):(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{children:"카테고리가 없습니다."})},CategoryDropdown_CategoryDropdown=CategoryDropdown;CategoryDropdown.__docgenInfo={description:"",methods:[],displayName:"CategoryDropdown",props:{category:{required:!1,tsType:{name:"string"},description:""},handleClickOption:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.MouseEvent) => void",signature:{arguments:[{type:{name:"ReactMouseEvent",raw:"React.MouseEvent",elements:[{name:"HTMLButtonElement"}]},name:"e"}],return:{name:"void"}}},description:""}}};var QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),useMutation=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js");const hooks_useApplyRoomSetting=roomId=>{const queryClient=(0,QueryClientProvider.jE)();return(0,useMutation.n)({mutationFn:async roomSetting=>await(0,room.ew)(roomId,roomSetting),onSuccess:()=>{queryClient.invalidateQueries({queryKey:[queryKeys.e.roomMembers,Number(roomId)]})}})},hooks_useCategoryDropdown=selectedCategory=>{const[category,setCategory]=(0,react.useState)(selectedCategory);return(0,react.useEffect)((()=>{setCategory(selectedCategory)}),[selectedCategory]),{category,handleClickOption:e=>{const target=e.target,clickedCategoryValue=target.value,clickedCategoryLabel=target.textContent;clickedCategoryValue&&setCategory({value:clickedCategoryValue,label:clickedCategoryLabel})}}},useTimerPerRound=selectedTimeLimit=>{const[timeLimitPerRound,setTimeLimitPerRound]=(0,react.useState)(selectedTimeLimit);return(0,react.useEffect)((()=>{setTimeLimitPerRound(selectedTimeLimit)}),[selectedTimeLimit]),{timeLimitPerRound,handleClickTimeLimit:e=>{const target=e.target;setTimeLimitPerRound(Number(target.value))}}},hooks_useTotalRound=selectedTotalRound=>{const[totalRound,setTotalRound]=(0,react.useState)(selectedTotalRound);return(0,react.useEffect)((()=>{setTotalRound(selectedTotalRound)}),[selectedTotalRound]),{totalRound,handleClickRound:e=>{const target=e.target;setTotalRound(Number(target.textContent))}}};var useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts");const hooks_useRoomSetting=({onClose})=>{const{roomId}=(0,dist.g)(),{mutate:applyRoomSetting}=hooks_useApplyRoomSetting(Number(roomId)),{roomSetting:selectedRoomSetting}=(0,useGetRoomInfo.$)(),{category,handleClickOption}=hooks_useCategoryDropdown(selectedRoomSetting?.category),{totalRound,handleClickRound}=hooks_useTotalRound(selectedRoomSetting?.totalRound),{timeLimitPerRound,handleClickTimeLimit}=useTimerPerRound(selectedRoomSetting?.timeLimit);return{roomSetting:{category,totalRound,timeLimitPerRound},handleClickOption,handleClickRound,handleClickTimeLimit,handleClickApply:()=>{category&&totalRound&&timeLimitPerRound&&(applyRoomSetting({category:category.value,totalRound,timeLimit:timeLimitPerRound}),onClose())}}};var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const roomSettingTitleContainer={name:"4zk4ri",styles:"display:flex;flex-direction:column;gap:1rem"},roomSettingTitleWrapper={name:"zl1inp",styles:"display:flex;justify-content:center"},roomSettingTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.body2,";font-weight:700;",""),roomSettingButtonContainer={name:"e4w4z7",styles:"display:flex;justify-content:center;gap:1.6rem"},RoomSettingContainer=({children,title})=>(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingTitleContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:roomSettingTitleWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingTitle,children:title})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:roomSettingButtonContainer,children})]}),RoomSettingContainer_RoomSettingContainer=RoomSettingContainer;RoomSettingContainer.__docgenInfo={description:"",methods:[],displayName:"RoomSettingContainer",props:{title:{required:!0,tsType:{name:"union",raw:"'카테고리' | '총 라운드' | '라운드 당 타이머'",elements:[{name:"literal",value:"'카테고리'"},{name:"literal",value:"'총 라운드'"},{name:"literal",value:"'라운드 당 타이머'"}]},description:""}}};const roomSettingModalLayout=(0,emotion_react_browser_esm.AH)("background-color:",Theme.S.color.peanut300,";",""),roomSettingModalTitle={name:"1kymkw5",styles:"font-size:1.6rem"},roomSettingContainer=(0,emotion_react_browser_esm.AH)("display:flex;flex-direction:column;justify-content:space-around;gap:2.4rem;padding:1.6rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:white;",""),roomSettingButton=isSelected=>(0,emotion_react_browser_esm.AH)("width:4rem;height:4rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:",isSelected?Theme.S.color.peanut500:Theme.S.color.peanut300,";transition:background-color 0.3s;","");var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx"),config=__webpack_require__("./src/constants/config.ts");const TOTAL_ROUND_LIST=[5,7,10],TIMER_PER_ROUND_LIST=[5e3,1e4,15e3],RoomSettingModal=({isOpen,onClose})=>{const{roomSetting,handleClickOption,handleClickRound,handleClickTimeLimit,handleClickApply}=hooks_useRoomSetting({onClose}),{category,totalRound,timeLimitPerRound}=roomSetting;return(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,css:roomSettingModalLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:roomSettingModalTitle,children:"방 설정"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"카테고리",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(CategoryDropdown_CategoryDropdown,{category:category?.label,handleClickOption})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"총 라운드",children:TOTAL_ROUND_LIST.map((round=>(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:roomSettingButton(totalRound===round),onClick:handleClickRound,children:round})},round)))}),(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"라운드 당 타이머",children:TIMER_PER_ROUND_LIST.map((timeLimit=>(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("button",{css:roomSettingButton(timeLimitPerRound===timeLimit),onClick:handleClickTimeLimit,value:timeLimit,children:[timeLimit/config.S2,"초"]})},timeLimit)))})]})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{onClick:handleClickApply,children:"적용"})})]})},RoomSettingModal_RoomSettingModal=RoomSettingModal;RoomSettingModal.__docgenInfo={description:"",methods:[],displayName:"RoomSettingModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/hooks/useGetRoomInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>useGetRoomInfo});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-router/dist/index.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_config__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/constants/config.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const useGetRoomInfo=()=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.g)(),{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.roomMembers,Number(roomId)],queryFn:()=>(0,_apis_room__WEBPACK_IMPORTED_MODULE_0__.qE)(Number(roomId)),refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=_constants_config__WEBPACK_IMPORTED_MODULE_4__.A3)&&_constants_config__WEBPACK_IMPORTED_MODULE_4__.S2,refetchIntervalInBackground:!0,gcTime:0});return{members:data?.members,roomSetting:data?.roomSetting,master:data?.master,isGameStart:data?.isGameStart}}},"./src/utils/error.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>CustomError,D:()=>NetworkError});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 5초, 10초, 15초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}}}]); \ No newline at end of file diff --git a/storybook/507.eec8179a.iframe.bundle.js b/storybook/507.eec8179a.iframe.bundle.js new file mode 100644 index 000000000..3b5dc3e98 --- /dev/null +++ b/storybook/507.eec8179a.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[507],{"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _utils_error__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/utils/error.ts");const __WEBPACK_DEFAULT_EXPORT__={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.e({...apiError,status:response.status})}return response}catch(error){if(error instanceof _utils_error__WEBPACK_IMPORTED_MODULE_0__.e)throw error;throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.D}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/apis/room.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gn:()=>exitRoom,ew:()=>applyRoomSetting,qE:()=>getRoomInfo,rm:()=>getCategoryList,zj:()=>startGame});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const getRoomInfo=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.getRoomInfo(roomId)});return await res.json()},startGame=async roomId=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.startGame(roomId)})},getCategoryList=async()=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.categoryList});return await res.json()},applyRoomSetting=async(roomId,roomSetting)=>{const{totalRound,timeLimit,category}=roomSetting;await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.applyRoomSetting(roomId),headers:{"Content-Type":"application/json"},body:{totalRound,timeLimit,category}})},exitRoom=async(roomId,memberId)=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.delete({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.deleteRoom(roomId,memberId)})}},"./src/components/common/RoomSettingModal/RoomSettingModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>RoomSettingModal_RoomSettingModal});var react=__webpack_require__("./node_modules/react/index.js");const emptyLayout={name:"nbsemk",styles:"height:3.6rem"};var Dropdown=__webpack_require__("./src/components/common/Dropdown/Dropdown.tsx"),useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),dist=__webpack_require__("./node_modules/react-router/dist/index.js"),room=__webpack_require__("./src/apis/room.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useCategoryListQuery=()=>{const{roomId}=(0,dist.g)(),categoryListQuery=(0,useQuery.I)({queryKey:[queryKeys.e.categoryList,Number(roomId)],queryFn:async()=>await(0,room.rm)()});return{...categoryListQuery,categoryList:categoryListQuery.data?.categories}};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const CategoryDropdown=({category,handleClickOption})=>{const{categoryList,isLoading}=hooks_useCategoryListQuery();return isLoading?(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:emptyLayout}):categoryList&&category?(0,emotion_react_jsx_runtime_browser_esm.Y)(Dropdown.A,{text:category,optionList:categoryList,handleClick:handleClickOption}):(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{children:"카테고리가 없습니다."})},CategoryDropdown_CategoryDropdown=CategoryDropdown;CategoryDropdown.__docgenInfo={description:"",methods:[],displayName:"CategoryDropdown",props:{category:{required:!1,tsType:{name:"string"},description:""},handleClickOption:{required:!0,tsType:{name:"signature",type:"function",raw:"(e: React.MouseEvent) => void",signature:{arguments:[{type:{name:"ReactMouseEvent",raw:"React.MouseEvent",elements:[{name:"HTMLButtonElement"}]},name:"e"}],return:{name:"void"}}},description:""}}};var QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),useMutation=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useMutation.js");const hooks_useApplyRoomSetting=roomId=>{const queryClient=(0,QueryClientProvider.jE)();return(0,useMutation.n)({mutationFn:async roomSetting=>await(0,room.ew)(roomId,roomSetting),onSuccess:()=>{queryClient.invalidateQueries({queryKey:[queryKeys.e.roomMembers,Number(roomId)]})}})},hooks_useCategoryDropdown=selectedCategory=>{const[category,setCategory]=(0,react.useState)(selectedCategory);return(0,react.useEffect)((()=>{setCategory(selectedCategory)}),[selectedCategory]),{category,handleClickOption:e=>{const target=e.target,clickedCategoryValue=target.value,clickedCategoryLabel=target.textContent;clickedCategoryValue&&setCategory({value:clickedCategoryValue,label:clickedCategoryLabel})}}},useTimerPerRound=selectedTimeLimit=>{const[timeLimitPerRound,setTimeLimitPerRound]=(0,react.useState)(selectedTimeLimit);return(0,react.useEffect)((()=>{setTimeLimitPerRound(selectedTimeLimit)}),[selectedTimeLimit]),{timeLimitPerRound,handleClickTimeLimit:e=>{const target=e.target;setTimeLimitPerRound(Number(target.value))}}},hooks_useTotalRound=selectedTotalRound=>{const[totalRound,setTotalRound]=(0,react.useState)(selectedTotalRound);return(0,react.useEffect)((()=>{setTotalRound(selectedTotalRound)}),[selectedTotalRound]),{totalRound,handleClickRound:e=>{const target=e.target;setTotalRound(Number(target.textContent))}}};var useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts");const hooks_useRoomSetting=({onClose})=>{const{roomId}=(0,dist.g)(),{mutate:applyRoomSetting}=hooks_useApplyRoomSetting(Number(roomId)),{roomSetting:selectedRoomSetting}=(0,useGetRoomInfo.$)(),{category,handleClickOption}=hooks_useCategoryDropdown(selectedRoomSetting?.category),{totalRound,handleClickRound}=hooks_useTotalRound(selectedRoomSetting?.totalRound),{timeLimitPerRound,handleClickTimeLimit}=useTimerPerRound(selectedRoomSetting?.timeLimit);return{roomSetting:{category,totalRound,timeLimitPerRound},handleClickOption,handleClickRound,handleClickTimeLimit,handleClickApply:()=>{category&&totalRound&&timeLimitPerRound&&(applyRoomSetting({category:category.value,totalRound,timeLimit:timeLimitPerRound}),onClose())}}};var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const roomSettingTitleContainer={name:"4zk4ri",styles:"display:flex;flex-direction:column;gap:1rem"},roomSettingTitleWrapper={name:"zl1inp",styles:"display:flex;justify-content:center"},roomSettingTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.body2,";font-weight:700;",""),roomSettingButtonContainer={name:"e4w4z7",styles:"display:flex;justify-content:center;gap:1.6rem"},RoomSettingContainer=({children,title})=>(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingTitleContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:roomSettingTitleWrapper,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingTitle,children:title})}),(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:roomSettingButtonContainer,children})]}),RoomSettingContainer_RoomSettingContainer=RoomSettingContainer;RoomSettingContainer.__docgenInfo={description:"",methods:[],displayName:"RoomSettingContainer",props:{title:{required:!0,tsType:{name:"union",raw:"'카테고리' | '총 라운드' | '라운드 당 타이머'",elements:[{name:"literal",value:"'카테고리'"},{name:"literal",value:"'총 라운드'"},{name:"literal",value:"'라운드 당 타이머'"}]},description:""}}};const roomSettingModalLayout=(0,emotion_react_browser_esm.AH)("background-color:",Theme.S.color.peanut300,";",""),roomSettingModalTitle={name:"1kymkw5",styles:"font-size:1.6rem"},roomSettingContainer=(0,emotion_react_browser_esm.AH)("display:flex;flex-direction:column;justify-content:space-around;gap:2.4rem;padding:1.6rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:white;",""),roomSettingButton=isSelected=>(0,emotion_react_browser_esm.AH)("width:4rem;height:4rem;border-radius:",Theme.S.borderRadius.radius10,";background-color:",isSelected?Theme.S.color.peanut500:Theme.S.color.peanut300,";transition:background-color 0.3s;","");var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx"),config=__webpack_require__("./src/constants/config.ts");const TOTAL_ROUND_LIST=[5,7,10],TIMER_PER_ROUND_LIST=[5e3,1e4,15e3],RoomSettingModal=({isOpen,onClose})=>{const{roomSetting,handleClickOption,handleClickRound,handleClickTimeLimit,handleClickApply}=hooks_useRoomSetting({onClose}),{category,totalRound,timeLimitPerRound}=roomSetting;return(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,css:roomSettingModalLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:roomSettingModalTitle,children:"방 설정"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"카테고리",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(CategoryDropdown_CategoryDropdown,{category:category?.label,handleClickOption})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"총 라운드",children:TOTAL_ROUND_LIST.map((round=>(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:roomSettingButton(totalRound===round),onClick:handleClickRound,children:round})},round)))}),(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingContainer_RoomSettingContainer,{title:"라운드 당 타이머",children:TIMER_PER_ROUND_LIST.map((timeLimit=>(0,emotion_react_jsx_runtime_browser_esm.Y)("li",{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("button",{css:roomSettingButton(timeLimitPerRound===timeLimit),onClick:handleClickTimeLimit,value:timeLimit,children:[timeLimit/config.S2,"초"]})},timeLimit)))})]})}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{onClick:handleClickApply,children:"적용"})})]})},RoomSettingModal_RoomSettingModal=RoomSettingModal;RoomSettingModal.__docgenInfo={description:"",methods:[],displayName:"RoomSettingModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""}}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/hooks/useGetRoomInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>useGetRoomInfo});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-router/dist/index.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_config__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/constants/config.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const useGetRoomInfo=()=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.g)(),{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.roomMembers,Number(roomId)],queryFn:()=>(0,_apis_room__WEBPACK_IMPORTED_MODULE_0__.qE)(Number(roomId)),refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=_constants_config__WEBPACK_IMPORTED_MODULE_4__.A3)&&_constants_config__WEBPACK_IMPORTED_MODULE_4__.S2,refetchIntervalInBackground:!0,gcTime:0});return{members:data?.members,roomSetting:data?.roomSetting,master:data?.master,isGameStart:data?.isGameStart}}},"./src/utils/error.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>CustomError,D:()=>NetworkError});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 5초, 10초, 15초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}}}]); \ No newline at end of file diff --git a/storybook/760.e36a786a.iframe.bundle.js b/storybook/756.ae321d0c.iframe.bundle.js similarity index 83% rename from storybook/760.e36a786a.iframe.bundle.js rename to storybook/756.ae321d0c.iframe.bundle.js index 0a81a8c4e..01908bb31 100644 --- a/storybook/760.e36a786a.iframe.bundle.js +++ b/storybook/756.ae321d0c.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[760],{"./node_modules/@sentry/core/build/esm/currentScopes.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{KU:()=>getClient,o5:()=>getCurrentScope,rm:()=>getIsolationScope,v4:()=>currentScopes_withScope});var worldwide=__webpack_require__("./node_modules/@sentry/utils/build/esm/worldwide.js"),version=__webpack_require__("./node_modules/@sentry/utils/build/esm/version.js");function carrier_getMainCarrier(){return carrier_getSentryCarrier(worldwide.O),worldwide.O}function carrier_getSentryCarrier(carrier){const __SENTRY__=carrier.__SENTRY__=carrier.__SENTRY__||{};return __SENTRY__.version=__SENTRY__.version||version.M,__SENTRY__[version.M]=__SENTRY__[version.M]||{}}var is=__webpack_require__("./node_modules/@sentry/utils/build/esm/is.js"),esm_scope=__webpack_require__("./node_modules/@sentry/core/build/esm/scope.js");class AsyncContextStack{constructor(scope,isolationScope){let assignedScope,assignedIsolationScope;assignedScope=scope||new esm_scope.H,assignedIsolationScope=isolationScope||new esm_scope.H,this._stack=[{scope:assignedScope}],this._isolationScope=assignedIsolationScope}withScope(callback){const scope=this._pushScope();let maybePromiseResult;try{maybePromiseResult=callback(scope)}catch(e){throw this._popScope(),e}return(0,is.Qg)(maybePromiseResult)?maybePromiseResult.then((res=>(this._popScope(),res)),(e=>{throw this._popScope(),e})):(this._popScope(),maybePromiseResult)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const scope=this.getScope().clone();return this._stack.push({client:this.getClient(),scope}),scope}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function getAsyncContextStack(){const sentry=carrier_getSentryCarrier(carrier_getMainCarrier());return sentry.stack=sentry.stack||new AsyncContextStack(function getDefaultCurrentScope(){return(0,worldwide.B)("defaultCurrentScope",(()=>new esm_scope.H))}(),function getDefaultIsolationScope(){return(0,worldwide.B)("defaultIsolationScope",(()=>new esm_scope.H))}())}function withScope(callback){return getAsyncContextStack().withScope(callback)}function withSetScope(scope,callback){const stack=getAsyncContextStack();return stack.withScope((()=>(stack.getStackTop().scope=scope,callback(scope))))}function withIsolationScope(callback){return getAsyncContextStack().withScope((()=>callback(getAsyncContextStack().getIsolationScope())))}function asyncContext_getAsyncContextStrategy(carrier){const sentry=carrier_getSentryCarrier(carrier);return sentry.acs?sentry.acs:function getStackAsyncContextStrategy(){return{withIsolationScope,withScope,withSetScope,withSetIsolationScope:(_isolationScope,callback)=>withIsolationScope(callback),getCurrentScope:()=>getAsyncContextStack().getScope(),getIsolationScope:()=>getAsyncContextStack().getIsolationScope()}}()}function getCurrentScope(){return asyncContext_getAsyncContextStrategy(carrier_getMainCarrier()).getCurrentScope()}function getIsolationScope(){return asyncContext_getAsyncContextStrategy(carrier_getMainCarrier()).getIsolationScope()}function currentScopes_withScope(...rest){const acs=asyncContext_getAsyncContextStrategy(carrier_getMainCarrier());if(2===rest.length){const[scope,callback]=rest;return scope?acs.withSetScope(scope,callback):acs.withScope(callback)}return acs.withScope(rest[0])}function getClient(){return getCurrentScope().getClient()}},"./node_modules/@sentry/core/build/esm/exports.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Cp:()=>captureException,Q:()=>lastEventId});var currentScopes=__webpack_require__("./node_modules/@sentry/core/build/esm/currentScopes.js"),scope=__webpack_require__("./node_modules/@sentry/core/build/esm/scope.js");new WeakMap;function parseEventHintOrCaptureContext(hint){if(hint)return function hintIsScopeOrFunction(hint){return hint instanceof scope.H||"function"==typeof hint}(hint)||function hintIsScopeContext(hint){return Object.keys(hint).some((key=>captureContextKeys.includes(key)))}(hint)?{captureContext:hint}:hint}const captureContextKeys=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function captureException(exception,hint){return(0,currentScopes.o5)().captureException(exception,parseEventHintOrCaptureContext(hint))}function lastEventId(){return(0,currentScopes.rm)().lastEventId()}},"./node_modules/@sentry/core/build/esm/scope.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{H:()=>Scope});var worldwide=__webpack_require__("./node_modules/@sentry/utils/build/esm/worldwide.js");function misc_uuid4(){const gbl=worldwide.O,crypto=gbl.crypto||gbl.msCrypto;let getRandomByte=()=>16*Math.random();try{if(crypto&&crypto.randomUUID)return crypto.randomUUID().replace(/-/g,"");crypto&&crypto.getRandomValues&&(getRandomByte=()=>{const typedArray=new Uint8Array(1);return crypto.getRandomValues(typedArray),typedArray[0]})}catch(_){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(c=>(c^(15&getRandomByte())>>c/4).toString(16)))}function generatePropagationContext(){return{traceId:misc_uuid4(),spanId:misc_uuid4().substring(16)}}var is=__webpack_require__("./node_modules/@sentry/utils/build/esm/is.js");const ONE_SECOND_IN_MS=1e3;function dateTimestampInSeconds(){return Date.now()/ONE_SECOND_IN_MS}const time_timestampInSeconds=function createUnixTimestampInSecondsFunc(){const{performance}=worldwide.O;if(!performance||!performance.now)return dateTimestampInSeconds;const approxStartingTimeOrigin=Date.now()-performance.now(),timeOrigin=null==performance.timeOrigin?approxStartingTimeOrigin:performance.timeOrigin;return()=>(timeOrigin+performance.now())/ONE_SECOND_IN_MS}();let _browserPerformanceTimeOriginMode;(()=>{const{performance}=worldwide.O;if(!performance||!performance.now)return void(_browserPerformanceTimeOriginMode="none");const performanceNow=performance.now(),dateNow=Date.now(),timeOriginDelta=performance.timeOrigin?Math.abs(performance.timeOrigin+performanceNow-dateNow):36e5,timeOriginIsReliable=timeOriginDelta<36e5,navigationStart=performance.timing&&performance.timing.navigationStart,navigationStartDelta="number"==typeof navigationStart?Math.abs(navigationStart+performanceNow-dateNow):36e5;timeOriginIsReliable||navigationStartDelta<36e5?timeOriginDelta<=navigationStartDelta?(_browserPerformanceTimeOriginMode="timeOrigin",performance.timeOrigin):_browserPerformanceTimeOriginMode="navigationStart":_browserPerformanceTimeOriginMode="dateNow"})();var logger=__webpack_require__("./node_modules/@sentry/utils/build/esm/logger.js");function updateSession(session,context={}){if(context.user&&(!session.ipAddress&&context.user.ip_address&&(session.ipAddress=context.user.ip_address),session.did||context.did||(session.did=context.user.id||context.user.email||context.user.username)),session.timestamp=context.timestamp||time_timestampInSeconds(),context.abnormal_mechanism&&(session.abnormal_mechanism=context.abnormal_mechanism),context.ignoreDuration&&(session.ignoreDuration=context.ignoreDuration),context.sid&&(session.sid=32===context.sid.length?context.sid:misc_uuid4()),void 0!==context.init&&(session.init=context.init),!session.did&&context.did&&(session.did=`${context.did}`),"number"==typeof context.started&&(session.started=context.started),session.ignoreDuration)session.duration=void 0;else if("number"==typeof context.duration)session.duration=context.duration;else{const duration=session.timestamp-session.started;session.duration=duration>=0?duration:0}context.release&&(session.release=context.release),context.environment&&(session.environment=context.environment),!session.ipAddress&&context.ipAddress&&(session.ipAddress=context.ipAddress),!session.userAgent&&context.userAgent&&(session.userAgent=context.userAgent),"number"==typeof context.errors&&(session.errors=context.errors),context.status&&(session.status=context.status)}var debug_build=__webpack_require__("./node_modules/@sentry/utils/build/esm/debug-build.js");function object_addNonEnumerableProperty(obj,name,value){try{Object.defineProperty(obj,name,{value,writable:!0,configurable:!0})}catch(o_O){debug_build.T&&logger.vF.log(`Failed to add non-enumerable property "${name}" to object`,obj)}}function _setSpanForScope(scope,span){span?object_addNonEnumerableProperty(scope,"_sentrySpan",span):delete scope._sentrySpan}function _getSpanForScope(scope){return scope._sentrySpan}class ScopeClass{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=generatePropagationContext()}clone(){const newScope=new ScopeClass;return newScope._breadcrumbs=[...this._breadcrumbs],newScope._tags={...this._tags},newScope._extra={...this._extra},newScope._contexts={...this._contexts},newScope._user=this._user,newScope._level=this._level,newScope._session=this._session,newScope._transactionName=this._transactionName,newScope._fingerprint=this._fingerprint,newScope._eventProcessors=[...this._eventProcessors],newScope._requestSession=this._requestSession,newScope._attachments=[...this._attachments],newScope._sdkProcessingMetadata={...this._sdkProcessingMetadata},newScope._propagationContext={...this._propagationContext},newScope._client=this._client,newScope._lastEventId=this._lastEventId,_setSpanForScope(newScope,_getSpanForScope(this)),newScope}setClient(client){this._client=client}setLastEventId(lastEventId){this._lastEventId=lastEventId}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(callback){this._scopeListeners.push(callback)}addEventProcessor(callback){return this._eventProcessors.push(callback),this}setUser(user){return this._user=user||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&updateSession(this._session,{user}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(requestSession){return this._requestSession=requestSession,this}setTags(tags){return this._tags={...this._tags,...tags},this._notifyScopeListeners(),this}setTag(key,value){return this._tags={...this._tags,[key]:value},this._notifyScopeListeners(),this}setExtras(extras){return this._extra={...this._extra,...extras},this._notifyScopeListeners(),this}setExtra(key,extra){return this._extra={...this._extra,[key]:extra},this._notifyScopeListeners(),this}setFingerprint(fingerprint){return this._fingerprint=fingerprint,this._notifyScopeListeners(),this}setLevel(level){return this._level=level,this._notifyScopeListeners(),this}setTransactionName(name){return this._transactionName=name,this._notifyScopeListeners(),this}setContext(key,context){return null===context?delete this._contexts[key]:this._contexts[key]=context,this._notifyScopeListeners(),this}setSession(session){return session?this._session=session:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(captureContext){if(!captureContext)return this;const scopeToMerge="function"==typeof captureContext?captureContext(this):captureContext,[scopeInstance,requestSession]=scopeToMerge instanceof Scope?[scopeToMerge.getScopeData(),scopeToMerge.getRequestSession()]:(0,is.Qd)(scopeToMerge)?[captureContext,captureContext.requestSession]:[],{tags,extra,user,contexts,level,fingerprint=[],propagationContext}=scopeInstance||{};return this._tags={...this._tags,...tags},this._extra={...this._extra,...extra},this._contexts={...this._contexts,...contexts},user&&Object.keys(user).length&&(this._user=user),level&&(this._level=level),fingerprint.length&&(this._fingerprint=fingerprint),propagationContext&&(this._propagationContext=propagationContext),requestSession&&(this._requestSession=requestSession),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,_setSpanForScope(this,void 0),this._attachments=[],this._propagationContext=generatePropagationContext(),this._notifyScopeListeners(),this}addBreadcrumb(breadcrumb,maxBreadcrumbs){const maxCrumbs="number"==typeof maxBreadcrumbs?maxBreadcrumbs:100;if(maxCrumbs<=0)return this;const mergedBreadcrumb={timestamp:dateTimestampInSeconds(),...breadcrumb},breadcrumbs=this._breadcrumbs;return breadcrumbs.push(mergedBreadcrumb),this._breadcrumbs=breadcrumbs.length>maxCrumbs?breadcrumbs.slice(-maxCrumbs):breadcrumbs,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(attachment){return this._attachments.push(attachment),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_getSpanForScope(this)}}setSDKProcessingMetadata(newData){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...newData},this}setPropagationContext(context){return this._propagationContext=context,this}getPropagationContext(){return this._propagationContext}captureException(exception,hint){const eventId=hint&&hint.event_id?hint.event_id:misc_uuid4();if(!this._client)return logger.vF.warn("No client configured on scope - will not capture exception!"),eventId;const syntheticException=new Error("Sentry syntheticException");return this._client.captureException(exception,{originalException:exception,syntheticException,...hint,event_id:eventId},this),eventId}captureMessage(message,level,hint){const eventId=hint&&hint.event_id?hint.event_id:misc_uuid4();if(!this._client)return logger.vF.warn("No client configured on scope - will not capture message!"),eventId;const syntheticException=new Error(message);return this._client.captureMessage(message,level,{originalException:message,syntheticException,...hint,event_id:eventId},this),eventId}captureEvent(event,hint){const eventId=hint&&hint.event_id?hint.event_id:misc_uuid4();return this._client?(this._client.captureEvent(event,{...hint,event_id:eventId},this),eventId):(logger.vF.warn("No client configured on scope - will not capture event!"),eventId)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((callback=>{callback(this)})),this._notifyingListeners=!1)}}const Scope=ScopeClass},"./node_modules/@sentry/react/build/esm/errorboundary.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{tH:()=>ErrorBoundary});var currentScopes=__webpack_require__("./node_modules/@sentry/core/build/esm/currentScopes.js"),esm_exports=__webpack_require__("./node_modules/@sentry/core/build/esm/exports.js"),debug_build=__webpack_require__("./node_modules/@sentry/utils/build/esm/debug-build.js"),esm_logger=__webpack_require__("./node_modules/@sentry/utils/build/esm/logger.js");const DSN_REGEX=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function dsnFromComponents(components){return{protocol:components.protocol,publicKey:components.publicKey||"",pass:components.pass||"",host:components.host,port:components.port||"",path:components.path||"",projectId:components.projectId}}function makeDsn(from){const components="string"==typeof from?function dsnFromString(str){const match=DSN_REGEX.exec(str);if(!match)return void(0,esm_logger.pq)((()=>{console.error(`Invalid Sentry Dsn: ${str}`)}));const[protocol,publicKey,pass="",host="",port="",lastPath=""]=match.slice(1);let path="",projectId=lastPath;const split=projectId.split("/");if(split.length>1&&(path=split.slice(0,-1).join("/"),projectId=split.pop()),projectId){const projectMatch=projectId.match(/^\d+/);projectMatch&&(projectId=projectMatch[0])}return dsnFromComponents({host,pass,path,projectId,port,protocol,publicKey})}(from):dsnFromComponents(from);if(components&&function validateDsn(dsn){if(!debug_build.T)return!0;const{port,projectId,protocol}=dsn;return!(["protocol","publicKey","host","projectId"].find((component=>!dsn[component]&&(esm_logger.vF.error(`Invalid Sentry Dsn: ${component} missing`),!0)))||(projectId.match(/^\d+$/)?function isValidProtocol(protocol){return"http"===protocol||"https"===protocol}(protocol)?port&&isNaN(parseInt(port,10))&&(esm_logger.vF.error(`Invalid Sentry Dsn: Invalid port ${port}`),1):(esm_logger.vF.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`),1):(esm_logger.vF.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`),1)))}(components))return components}function getBaseApiEndpoint(dsn){const protocol=dsn.protocol?`${dsn.protocol}:`:"",port=dsn.port?`:${dsn.port}`:"";return`${protocol}//${dsn.host}${port}${dsn.path?`/${dsn.path}`:""}/api/`}const debug_build_DEBUG_BUILD="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;const helpers_WINDOW=__webpack_require__("./node_modules/@sentry/utils/build/esm/worldwide.js").O;function showReportDialog(options={}){if(!helpers_WINDOW.document)return void(debug_build_DEBUG_BUILD&&esm_logger.vF.error("Global document not defined in showReportDialog call"));const scope=(0,currentScopes.o5)(),client=scope.getClient(),dsn=client&&client.getDsn();if(!dsn)return void(debug_build_DEBUG_BUILD&&esm_logger.vF.error("DSN not configured for showReportDialog call"));if(scope&&(options.user={...scope.getUser(),...options.user}),!options.eventId){const eventId=(0,esm_exports.Q)();eventId&&(options.eventId=eventId)}const script=helpers_WINDOW.document.createElement("script");script.async=!0,script.crossOrigin="anonymous",script.src=function getReportDialogEndpoint(dsnLike,dialogOptions){const dsn=makeDsn(dsnLike);if(!dsn)return"";const endpoint=`${getBaseApiEndpoint(dsn)}embed/error-page/`;let encodedOptions=`dsn=${function dsnToString(dsn,withPassword=!1){const{host,path,pass,port,projectId,protocol,publicKey}=dsn;return`${protocol}://${publicKey}${withPassword&&pass?`:${pass}`:""}@${host}${port?`:${port}`:""}/${path?`${path}/`:path}${projectId}`}(dsn)}`;for(const key in dialogOptions)if("dsn"!==key&&"onClose"!==key)if("user"===key){const user=dialogOptions.user;if(!user)continue;user.name&&(encodedOptions+=`&name=${encodeURIComponent(user.name)}`),user.email&&(encodedOptions+=`&email=${encodeURIComponent(user.email)}`)}else encodedOptions+=`&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key])}`;return`${endpoint}?${encodedOptions}`}(dsn,options),options.onLoad&&(script.onload=options.onLoad);const{onClose}=options;if(onClose){const reportDialogClosedMessageHandler=event=>{if("__sentry_reportdialog_closed__"===event.data)try{onClose()}finally{helpers_WINDOW.removeEventListener("message",reportDialogClosedMessageHandler)}};helpers_WINDOW.addEventListener("message",reportDialogClosedMessageHandler)}const injectionPoint=helpers_WINDOW.document.head||helpers_WINDOW.document.body;injectionPoint?injectionPoint.appendChild(script):debug_build_DEBUG_BUILD&&esm_logger.vF.error("Not injecting report dialog. No injection point found in HTML")}__webpack_require__("./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js");var react=__webpack_require__("./node_modules/react/index.js");const esm_debug_build_DEBUG_BUILD="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;var is=__webpack_require__("./node_modules/@sentry/utils/build/esm/is.js");function captureReactException(error,{componentStack},hint){if(function isAtLeastReact17(reactVersion){const reactMajor=reactVersion.match(/^([^.]+)/);return null!==reactMajor&&parseInt(reactMajor[0])>=17}(react.version)&&(0,is.bJ)(error)&&componentStack){const errorBoundaryError=new Error(error.message);errorBoundaryError.name=`React ErrorBoundary ${error.name}`,errorBoundaryError.stack=componentStack,function setCause(error,cause){const seenErrors=new WeakSet;!function recurse(error,cause){if(!seenErrors.has(error))return error.cause?(seenErrors.add(error),recurse(error.cause,cause)):void(error.cause=cause)}(error,cause)}(error,errorBoundaryError)}return(0,esm_exports.Cp)(error,{...hint,captureContext:{contexts:{react:{componentStack}}}})}const INITIAL_STATE={componentStack:null,error:null,eventId:null};class ErrorBoundary extends react.Component{constructor(props){super(props),ErrorBoundary.prototype.__init.call(this),this.state=INITIAL_STATE,this._openFallbackReportDialog=!0;const client=(0,currentScopes.KU)();client&&props.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=client.on("afterSendEvent",(event=>{!event.type&&this._lastEventId&&event.event_id===this._lastEventId&&showReportDialog({...props.dialogOptions,eventId:this._lastEventId})})))}componentDidCatch(error,errorInfo){const{componentStack}=errorInfo,passedInComponentStack=null==componentStack?void 0:componentStack,{beforeCapture,onError,showDialog,dialogOptions}=this.props;(0,currentScopes.v4)((scope=>{beforeCapture&&beforeCapture(scope,error,passedInComponentStack);const eventId=captureReactException(error,errorInfo,{mechanism:{handled:!!this.props.fallback}});onError&&onError(error,passedInComponentStack,eventId),showDialog&&(this._lastEventId=eventId,this._openFallbackReportDialog&&showReportDialog({...dialogOptions,eventId})),this.setState({error,componentStack,eventId})}))}componentDidMount(){const{onMount}=this.props;onMount&&onMount()}componentWillUnmount(){const{error,componentStack,eventId}=this.state,{onUnmount}=this.props;onUnmount&&onUnmount(error,componentStack,eventId),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}__init(){this.resetErrorBoundary=()=>{const{onReset}=this.props,{error,componentStack,eventId}=this.state;onReset&&onReset(error,componentStack,eventId),this.setState(INITIAL_STATE)}}render(){const{fallback,children}=this.props,state=this.state;if(state.error){let element;return element="function"==typeof fallback?react.createElement(fallback,{error:state.error,componentStack:state.componentStack,resetError:this.resetErrorBoundary,eventId:state.eventId}):fallback,react.isValidElement(element)?element:(fallback&&esm_debug_build_DEBUG_BUILD&&esm_logger.vF.warn("fallback did not produce a valid ReactElement"),null)}return"function"==typeof children?children():children}}},"./node_modules/@sentry/utils/build/esm/debug-build.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{T:()=>DEBUG_BUILD});const DEBUG_BUILD="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},"./node_modules/@sentry/utils/build/esm/is.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Qd:()=>isPlainObject,Qg:()=>isThenable,bJ:()=>isError});const objectToString=Object.prototype.toString;function isError(wat){switch(objectToString.call(wat)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return isInstanceOf(wat,Error)}}function isBuiltin(wat,className){return objectToString.call(wat)===`[object ${className}]`}function isPlainObject(wat){return isBuiltin(wat,"Object")}function isThenable(wat){return Boolean(wat&&wat.then&&"function"==typeof wat.then)}function isInstanceOf(wat,base){try{return wat instanceof base}catch(_e){return!1}}},"./node_modules/@sentry/utils/build/esm/logger.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{pq:()=>consoleSandbox,vF:()=>logger});var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@sentry/utils/build/esm/debug-build.js"),_worldwide_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@sentry/utils/build/esm/worldwide.js");const CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],originalConsoleMethods={};function consoleSandbox(callback){if(!("console"in _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.O))return callback();const console=_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.O.console,wrappedFuncs={},wrappedLevels=Object.keys(originalConsoleMethods);wrappedLevels.forEach((level=>{const originalConsoleMethod=originalConsoleMethods[level];wrappedFuncs[level]=console[level],console[level]=originalConsoleMethod}));try{return callback()}finally{wrappedLevels.forEach((level=>{console[level]=wrappedFuncs[level]}))}}const logger=function makeLogger(){let enabled=!1;const logger={enable:()=>{enabled=!0},disable:()=>{enabled=!1},isEnabled:()=>enabled};return _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.T?CONSOLE_LEVELS.forEach((name=>{logger[name]=(...args)=>{enabled&&consoleSandbox((()=>{_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.O.console[name](`Sentry Logger [${name}]:`,...args)}))}})):CONSOLE_LEVELS.forEach((name=>{logger[name]=()=>{}})),logger}()},"./node_modules/@sentry/utils/build/esm/version.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{M:()=>SDK_VERSION});const SDK_VERSION="8.24.0"},"./node_modules/@sentry/utils/build/esm/worldwide.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{B:()=>getGlobalSingleton,O:()=>GLOBAL_OBJ});var _version_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@sentry/utils/build/esm/version.js");const GLOBAL_OBJ=globalThis;function getGlobalSingleton(name,creator,obj){const gbl=obj||GLOBAL_OBJ,__SENTRY__=gbl.__SENTRY__=gbl.__SENTRY__||{},versionedCarrier=__SENTRY__[_version_js__WEBPACK_IMPORTED_MODULE_0__.M]=__SENTRY__[_version_js__WEBPACK_IMPORTED_MODULE_0__.M]||{};return versionedCarrier[name]||(versionedCarrier[name]=creator())}},"./node_modules/@tanstack/react-query/build/modern/useMutation.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{n:()=>useMutation});var react=__webpack_require__("./node_modules/react/index.js"),mutation=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/mutation.js"),notifyManager=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/notifyManager.js"),subscribable=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/subscribable.js"),utils=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/utils.js"),MutationObserver=class extends subscribable.Q{#client;#currentResult=void 0;#currentMutation;#mutateOptions;constructor(client,options){super(),this.#client=client,this.setOptions(options),this.bindMethods(),this.#updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(options){const prevOptions=this.options;this.options=this.#client.defaultMutationOptions(options),(0,utils.f8)(this.options,prevOptions)||this.#client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#currentMutation,observer:this}),prevOptions?.mutationKey&&this.options.mutationKey&&(0,utils.EN)(prevOptions.mutationKey)!==(0,utils.EN)(this.options.mutationKey)?this.reset():"pending"===this.#currentMutation?.state.status&&this.#currentMutation.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#currentMutation?.removeObserver(this)}onMutationUpdate(action){this.#updateResult(),this.#notify(action)}getCurrentResult(){return this.#currentResult}reset(){this.#currentMutation?.removeObserver(this),this.#currentMutation=void 0,this.#updateResult(),this.#notify()}mutate(variables,options){return this.#mutateOptions=options,this.#currentMutation?.removeObserver(this),this.#currentMutation=this.#client.getMutationCache().build(this.#client,this.options),this.#currentMutation.addObserver(this),this.#currentMutation.execute(variables)}#updateResult(){const state=this.#currentMutation?.state??(0,mutation.$)();this.#currentResult={...state,isPending:"pending"===state.status,isSuccess:"success"===state.status,isError:"error"===state.status,isIdle:"idle"===state.status,mutate:this.mutate,reset:this.reset}}#notify(action){notifyManager.j.batch((()=>{if(this.#mutateOptions&&this.hasListeners()){const variables=this.#currentResult.variables,context=this.#currentResult.context;"success"===action?.type?(this.#mutateOptions.onSuccess?.(action.data,variables,context),this.#mutateOptions.onSettled?.(action.data,null,variables,context)):"error"===action?.type&&(this.#mutateOptions.onError?.(action.error,variables,context),this.#mutateOptions.onSettled?.(void 0,action.error,variables,context))}this.listeners.forEach((listener=>{listener(this.#currentResult)}))}))}},QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),modern_utils=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/utils.js");function useMutation(options,queryClient){const client=(0,QueryClientProvider.jE)(queryClient),[observer]=react.useState((()=>new MutationObserver(client,options)));react.useEffect((()=>{observer.setOptions(options)}),[observer,options]);const result=react.useSyncExternalStore(react.useCallback((onStoreChange=>observer.subscribe(notifyManager.j.batchCalls(onStoreChange))),[observer]),(()=>observer.getCurrentResult()),(()=>observer.getCurrentResult())),mutate=react.useCallback(((variables,mutateOptions)=>{observer.mutate(variables,mutateOptions).catch(modern_utils.l)}),[observer]);if(result.error&&(0,modern_utils.G)(observer.options.throwOnError,[result.error]))throw result.error;return{...result,mutate,mutateAsync:result.mutate}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":(module,__unused_webpack_exports,__webpack_require__)=>{var anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js");module.exports=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value)}catch(error){iteratorClose(iterator,"throw",error)}}},"./node_modules/core-js/internals/create-iter-result-object.js":module=>{module.exports=function(value,done){return{value,done}}},"./node_modules/core-js/internals/define-built-ins.js":(module,__unused_webpack_exports,__webpack_require__)=>{var defineBuiltIn=__webpack_require__("./node_modules/core-js/internals/define-built-in.js");module.exports=function(target,src,options){for(var key in src)defineBuiltIn(target,key,src[key],options);return target}},"./node_modules/core-js/internals/iterator-create-proxy.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),create=__webpack_require__("./node_modules/core-js/internals/object-create.js"),createNonEnumerableProperty=__webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),defineBuiltIns=__webpack_require__("./node_modules/core-js/internals/define-built-ins.js"),wellKnownSymbol=__webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),InternalStateModule=__webpack_require__("./node_modules/core-js/internals/internal-state.js"),getMethod=__webpack_require__("./node_modules/core-js/internals/get-method.js"),IteratorPrototype=__webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype,createIterResultObject=__webpack_require__("./node_modules/core-js/internals/create-iter-result-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),setInternalState=InternalStateModule.set,createIteratorProxyPrototype=function(IS_ITERATOR){var getInternalState=InternalStateModule.getterFor(IS_ITERATOR?"WrapForValidIterator":"IteratorHelper");return defineBuiltIns(create(IteratorPrototype),{next:function next(){var state=getInternalState(this);if(IS_ITERATOR)return state.nextHandler();try{var result=state.done?void 0:state.nextHandler();return createIterResultObject(result,state.done)}catch(error){throw state.done=!0,error}},return:function(){var state=getInternalState(this),iterator=state.iterator;if(state.done=!0,IS_ITERATOR){var returnMethod=getMethod(iterator,"return");return returnMethod?call(returnMethod,iterator):createIterResultObject(void 0,!0)}if(state.inner)try{iteratorClose(state.inner.iterator,"normal")}catch(error){return iteratorClose(iterator,"throw",error)}return iteratorClose(iterator,"normal"),createIterResultObject(void 0,!0)}})},WrapForValidIteratorPrototype=createIteratorProxyPrototype(!0),IteratorHelperPrototype=createIteratorProxyPrototype(!1);createNonEnumerableProperty(IteratorHelperPrototype,TO_STRING_TAG,"Iterator Helper"),module.exports=function(nextHandler,IS_ITERATOR){var IteratorProxy=function Iterator(record,state){state?(state.iterator=record.iterator,state.next=record.next):state=record,state.type=IS_ITERATOR?"WrapForValidIterator":"IteratorHelper",state.nextHandler=nextHandler,state.counter=0,state.done=!1,setInternalState(this,state)};return IteratorProxy.prototype=IS_ITERATOR?WrapForValidIteratorPrototype:IteratorHelperPrototype,IteratorProxy}},"./node_modules/core-js/internals/iterator-map.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),aCallable=__webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorDirect=__webpack_require__("./node_modules/core-js/internals/get-iterator-direct.js"),createIteratorProxy=__webpack_require__("./node_modules/core-js/internals/iterator-create-proxy.js"),callWithSafeIterationClosing=__webpack_require__("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),IteratorProxy=createIteratorProxy((function(){var iterator=this.iterator,result=anObject(call(this.next,iterator));if(!(this.done=!!result.done))return callWithSafeIterationClosing(iterator,this.mapper,[result.value,this.counter++],!0)}));module.exports=function map(mapper){return anObject(this),aCallable(mapper),new IteratorProxy(getIteratorDirect(this),{mapper})}},"./node_modules/core-js/modules/esnext.iterator.map.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),map=__webpack_require__("./node_modules/core-js/internals/iterator-map.js");$({target:"Iterator",proto:!0,real:!0,forced:__webpack_require__("./node_modules/core-js/internals/is-pure.js")},{map})}}]); \ No newline at end of file +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[756],{"./node_modules/@sentry/core/build/esm/currentScopes.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{KU:()=>getClient,o5:()=>getCurrentScope,rm:()=>getIsolationScope,v4:()=>currentScopes_withScope});var worldwide=__webpack_require__("./node_modules/@sentry/utils/build/esm/worldwide.js"),version=__webpack_require__("./node_modules/@sentry/utils/build/esm/version.js");function carrier_getMainCarrier(){return carrier_getSentryCarrier(worldwide.O),worldwide.O}function carrier_getSentryCarrier(carrier){const __SENTRY__=carrier.__SENTRY__=carrier.__SENTRY__||{};return __SENTRY__.version=__SENTRY__.version||version.M,__SENTRY__[version.M]=__SENTRY__[version.M]||{}}var is=__webpack_require__("./node_modules/@sentry/utils/build/esm/is.js"),esm_scope=__webpack_require__("./node_modules/@sentry/core/build/esm/scope.js");class AsyncContextStack{constructor(scope,isolationScope){let assignedScope,assignedIsolationScope;assignedScope=scope||new esm_scope.H,assignedIsolationScope=isolationScope||new esm_scope.H,this._stack=[{scope:assignedScope}],this._isolationScope=assignedIsolationScope}withScope(callback){const scope=this._pushScope();let maybePromiseResult;try{maybePromiseResult=callback(scope)}catch(e){throw this._popScope(),e}return(0,is.Qg)(maybePromiseResult)?maybePromiseResult.then((res=>(this._popScope(),res)),(e=>{throw this._popScope(),e})):(this._popScope(),maybePromiseResult)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const scope=this.getScope().clone();return this._stack.push({client:this.getClient(),scope}),scope}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function getAsyncContextStack(){const sentry=carrier_getSentryCarrier(carrier_getMainCarrier());return sentry.stack=sentry.stack||new AsyncContextStack(function getDefaultCurrentScope(){return(0,worldwide.B)("defaultCurrentScope",(()=>new esm_scope.H))}(),function getDefaultIsolationScope(){return(0,worldwide.B)("defaultIsolationScope",(()=>new esm_scope.H))}())}function withScope(callback){return getAsyncContextStack().withScope(callback)}function withSetScope(scope,callback){const stack=getAsyncContextStack();return stack.withScope((()=>(stack.getStackTop().scope=scope,callback(scope))))}function withIsolationScope(callback){return getAsyncContextStack().withScope((()=>callback(getAsyncContextStack().getIsolationScope())))}function asyncContext_getAsyncContextStrategy(carrier){const sentry=carrier_getSentryCarrier(carrier);return sentry.acs?sentry.acs:function getStackAsyncContextStrategy(){return{withIsolationScope,withScope,withSetScope,withSetIsolationScope:(_isolationScope,callback)=>withIsolationScope(callback),getCurrentScope:()=>getAsyncContextStack().getScope(),getIsolationScope:()=>getAsyncContextStack().getIsolationScope()}}()}function getCurrentScope(){return asyncContext_getAsyncContextStrategy(carrier_getMainCarrier()).getCurrentScope()}function getIsolationScope(){return asyncContext_getAsyncContextStrategy(carrier_getMainCarrier()).getIsolationScope()}function currentScopes_withScope(...rest){const acs=asyncContext_getAsyncContextStrategy(carrier_getMainCarrier());if(2===rest.length){const[scope,callback]=rest;return scope?acs.withSetScope(scope,callback):acs.withScope(callback)}return acs.withScope(rest[0])}function getClient(){return getCurrentScope().getClient()}},"./node_modules/@sentry/core/build/esm/exports.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Cp:()=>captureException,Q:()=>lastEventId});var currentScopes=__webpack_require__("./node_modules/@sentry/core/build/esm/currentScopes.js"),scope=__webpack_require__("./node_modules/@sentry/core/build/esm/scope.js");new WeakMap;function parseEventHintOrCaptureContext(hint){if(hint)return function hintIsScopeOrFunction(hint){return hint instanceof scope.H||"function"==typeof hint}(hint)||function hintIsScopeContext(hint){return Object.keys(hint).some((key=>captureContextKeys.includes(key)))}(hint)?{captureContext:hint}:hint}const captureContextKeys=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function captureException(exception,hint){return(0,currentScopes.o5)().captureException(exception,parseEventHintOrCaptureContext(hint))}function lastEventId(){return(0,currentScopes.rm)().lastEventId()}},"./node_modules/@sentry/core/build/esm/scope.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{H:()=>Scope});var worldwide=__webpack_require__("./node_modules/@sentry/utils/build/esm/worldwide.js");function misc_uuid4(){const gbl=worldwide.O,crypto=gbl.crypto||gbl.msCrypto;let getRandomByte=()=>16*Math.random();try{if(crypto&&crypto.randomUUID)return crypto.randomUUID().replace(/-/g,"");crypto&&crypto.getRandomValues&&(getRandomByte=()=>{const typedArray=new Uint8Array(1);return crypto.getRandomValues(typedArray),typedArray[0]})}catch(_){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(c=>(c^(15&getRandomByte())>>c/4).toString(16)))}function generatePropagationContext(){return{traceId:misc_uuid4(),spanId:misc_uuid4().substring(16)}}var is=__webpack_require__("./node_modules/@sentry/utils/build/esm/is.js");const ONE_SECOND_IN_MS=1e3;function dateTimestampInSeconds(){return Date.now()/ONE_SECOND_IN_MS}const time_timestampInSeconds=function createUnixTimestampInSecondsFunc(){const{performance}=worldwide.O;if(!performance||!performance.now)return dateTimestampInSeconds;const approxStartingTimeOrigin=Date.now()-performance.now(),timeOrigin=null==performance.timeOrigin?approxStartingTimeOrigin:performance.timeOrigin;return()=>(timeOrigin+performance.now())/ONE_SECOND_IN_MS}();let _browserPerformanceTimeOriginMode;(()=>{const{performance}=worldwide.O;if(!performance||!performance.now)return void(_browserPerformanceTimeOriginMode="none");const performanceNow=performance.now(),dateNow=Date.now(),timeOriginDelta=performance.timeOrigin?Math.abs(performance.timeOrigin+performanceNow-dateNow):36e5,timeOriginIsReliable=timeOriginDelta<36e5,navigationStart=performance.timing&&performance.timing.navigationStart,navigationStartDelta="number"==typeof navigationStart?Math.abs(navigationStart+performanceNow-dateNow):36e5;timeOriginIsReliable||navigationStartDelta<36e5?timeOriginDelta<=navigationStartDelta?(_browserPerformanceTimeOriginMode="timeOrigin",performance.timeOrigin):_browserPerformanceTimeOriginMode="navigationStart":_browserPerformanceTimeOriginMode="dateNow"})();var logger=__webpack_require__("./node_modules/@sentry/utils/build/esm/logger.js");function updateSession(session,context={}){if(context.user&&(!session.ipAddress&&context.user.ip_address&&(session.ipAddress=context.user.ip_address),session.did||context.did||(session.did=context.user.id||context.user.email||context.user.username)),session.timestamp=context.timestamp||time_timestampInSeconds(),context.abnormal_mechanism&&(session.abnormal_mechanism=context.abnormal_mechanism),context.ignoreDuration&&(session.ignoreDuration=context.ignoreDuration),context.sid&&(session.sid=32===context.sid.length?context.sid:misc_uuid4()),void 0!==context.init&&(session.init=context.init),!session.did&&context.did&&(session.did=`${context.did}`),"number"==typeof context.started&&(session.started=context.started),session.ignoreDuration)session.duration=void 0;else if("number"==typeof context.duration)session.duration=context.duration;else{const duration=session.timestamp-session.started;session.duration=duration>=0?duration:0}context.release&&(session.release=context.release),context.environment&&(session.environment=context.environment),!session.ipAddress&&context.ipAddress&&(session.ipAddress=context.ipAddress),!session.userAgent&&context.userAgent&&(session.userAgent=context.userAgent),"number"==typeof context.errors&&(session.errors=context.errors),context.status&&(session.status=context.status)}var debug_build=__webpack_require__("./node_modules/@sentry/utils/build/esm/debug-build.js");function object_addNonEnumerableProperty(obj,name,value){try{Object.defineProperty(obj,name,{value,writable:!0,configurable:!0})}catch(o_O){debug_build.T&&logger.vF.log(`Failed to add non-enumerable property "${name}" to object`,obj)}}function _setSpanForScope(scope,span){span?object_addNonEnumerableProperty(scope,"_sentrySpan",span):delete scope._sentrySpan}function _getSpanForScope(scope){return scope._sentrySpan}class ScopeClass{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=generatePropagationContext()}clone(){const newScope=new ScopeClass;return newScope._breadcrumbs=[...this._breadcrumbs],newScope._tags={...this._tags},newScope._extra={...this._extra},newScope._contexts={...this._contexts},newScope._user=this._user,newScope._level=this._level,newScope._session=this._session,newScope._transactionName=this._transactionName,newScope._fingerprint=this._fingerprint,newScope._eventProcessors=[...this._eventProcessors],newScope._requestSession=this._requestSession,newScope._attachments=[...this._attachments],newScope._sdkProcessingMetadata={...this._sdkProcessingMetadata},newScope._propagationContext={...this._propagationContext},newScope._client=this._client,newScope._lastEventId=this._lastEventId,_setSpanForScope(newScope,_getSpanForScope(this)),newScope}setClient(client){this._client=client}setLastEventId(lastEventId){this._lastEventId=lastEventId}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(callback){this._scopeListeners.push(callback)}addEventProcessor(callback){return this._eventProcessors.push(callback),this}setUser(user){return this._user=user||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&updateSession(this._session,{user}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(requestSession){return this._requestSession=requestSession,this}setTags(tags){return this._tags={...this._tags,...tags},this._notifyScopeListeners(),this}setTag(key,value){return this._tags={...this._tags,[key]:value},this._notifyScopeListeners(),this}setExtras(extras){return this._extra={...this._extra,...extras},this._notifyScopeListeners(),this}setExtra(key,extra){return this._extra={...this._extra,[key]:extra},this._notifyScopeListeners(),this}setFingerprint(fingerprint){return this._fingerprint=fingerprint,this._notifyScopeListeners(),this}setLevel(level){return this._level=level,this._notifyScopeListeners(),this}setTransactionName(name){return this._transactionName=name,this._notifyScopeListeners(),this}setContext(key,context){return null===context?delete this._contexts[key]:this._contexts[key]=context,this._notifyScopeListeners(),this}setSession(session){return session?this._session=session:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(captureContext){if(!captureContext)return this;const scopeToMerge="function"==typeof captureContext?captureContext(this):captureContext,[scopeInstance,requestSession]=scopeToMerge instanceof Scope?[scopeToMerge.getScopeData(),scopeToMerge.getRequestSession()]:(0,is.Qd)(scopeToMerge)?[captureContext,captureContext.requestSession]:[],{tags,extra,user,contexts,level,fingerprint=[],propagationContext}=scopeInstance||{};return this._tags={...this._tags,...tags},this._extra={...this._extra,...extra},this._contexts={...this._contexts,...contexts},user&&Object.keys(user).length&&(this._user=user),level&&(this._level=level),fingerprint.length&&(this._fingerprint=fingerprint),propagationContext&&(this._propagationContext=propagationContext),requestSession&&(this._requestSession=requestSession),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,_setSpanForScope(this,void 0),this._attachments=[],this._propagationContext=generatePropagationContext(),this._notifyScopeListeners(),this}addBreadcrumb(breadcrumb,maxBreadcrumbs){const maxCrumbs="number"==typeof maxBreadcrumbs?maxBreadcrumbs:100;if(maxCrumbs<=0)return this;const mergedBreadcrumb={timestamp:dateTimestampInSeconds(),...breadcrumb},breadcrumbs=this._breadcrumbs;return breadcrumbs.push(mergedBreadcrumb),this._breadcrumbs=breadcrumbs.length>maxCrumbs?breadcrumbs.slice(-maxCrumbs):breadcrumbs,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(attachment){return this._attachments.push(attachment),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_getSpanForScope(this)}}setSDKProcessingMetadata(newData){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...newData},this}setPropagationContext(context){return this._propagationContext=context,this}getPropagationContext(){return this._propagationContext}captureException(exception,hint){const eventId=hint&&hint.event_id?hint.event_id:misc_uuid4();if(!this._client)return logger.vF.warn("No client configured on scope - will not capture exception!"),eventId;const syntheticException=new Error("Sentry syntheticException");return this._client.captureException(exception,{originalException:exception,syntheticException,...hint,event_id:eventId},this),eventId}captureMessage(message,level,hint){const eventId=hint&&hint.event_id?hint.event_id:misc_uuid4();if(!this._client)return logger.vF.warn("No client configured on scope - will not capture message!"),eventId;const syntheticException=new Error(message);return this._client.captureMessage(message,level,{originalException:message,syntheticException,...hint,event_id:eventId},this),eventId}captureEvent(event,hint){const eventId=hint&&hint.event_id?hint.event_id:misc_uuid4();return this._client?(this._client.captureEvent(event,{...hint,event_id:eventId},this),eventId):(logger.vF.warn("No client configured on scope - will not capture event!"),eventId)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((callback=>{callback(this)})),this._notifyingListeners=!1)}}const Scope=ScopeClass},"./node_modules/@sentry/react/build/esm/errorboundary.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{tH:()=>ErrorBoundary});var currentScopes=__webpack_require__("./node_modules/@sentry/core/build/esm/currentScopes.js"),esm_exports=__webpack_require__("./node_modules/@sentry/core/build/esm/exports.js"),debug_build=__webpack_require__("./node_modules/@sentry/utils/build/esm/debug-build.js"),esm_logger=__webpack_require__("./node_modules/@sentry/utils/build/esm/logger.js");const DSN_REGEX=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function dsnFromComponents(components){return{protocol:components.protocol,publicKey:components.publicKey||"",pass:components.pass||"",host:components.host,port:components.port||"",path:components.path||"",projectId:components.projectId}}function makeDsn(from){const components="string"==typeof from?function dsnFromString(str){const match=DSN_REGEX.exec(str);if(!match)return void(0,esm_logger.pq)((()=>{console.error(`Invalid Sentry Dsn: ${str}`)}));const[protocol,publicKey,pass="",host="",port="",lastPath=""]=match.slice(1);let path="",projectId=lastPath;const split=projectId.split("/");if(split.length>1&&(path=split.slice(0,-1).join("/"),projectId=split.pop()),projectId){const projectMatch=projectId.match(/^\d+/);projectMatch&&(projectId=projectMatch[0])}return dsnFromComponents({host,pass,path,projectId,port,protocol,publicKey})}(from):dsnFromComponents(from);if(components&&function validateDsn(dsn){if(!debug_build.T)return!0;const{port,projectId,protocol}=dsn;return!(["protocol","publicKey","host","projectId"].find((component=>!dsn[component]&&(esm_logger.vF.error(`Invalid Sentry Dsn: ${component} missing`),!0)))||(projectId.match(/^\d+$/)?function isValidProtocol(protocol){return"http"===protocol||"https"===protocol}(protocol)?port&&isNaN(parseInt(port,10))&&(esm_logger.vF.error(`Invalid Sentry Dsn: Invalid port ${port}`),1):(esm_logger.vF.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`),1):(esm_logger.vF.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`),1)))}(components))return components}function getBaseApiEndpoint(dsn){const protocol=dsn.protocol?`${dsn.protocol}:`:"",port=dsn.port?`:${dsn.port}`:"";return`${protocol}//${dsn.host}${port}${dsn.path?`/${dsn.path}`:""}/api/`}const debug_build_DEBUG_BUILD="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;const helpers_WINDOW=__webpack_require__("./node_modules/@sentry/utils/build/esm/worldwide.js").O;function showReportDialog(options={}){if(!helpers_WINDOW.document)return void(debug_build_DEBUG_BUILD&&esm_logger.vF.error("Global document not defined in showReportDialog call"));const scope=(0,currentScopes.o5)(),client=scope.getClient(),dsn=client&&client.getDsn();if(!dsn)return void(debug_build_DEBUG_BUILD&&esm_logger.vF.error("DSN not configured for showReportDialog call"));if(scope&&(options.user={...scope.getUser(),...options.user}),!options.eventId){const eventId=(0,esm_exports.Q)();eventId&&(options.eventId=eventId)}const script=helpers_WINDOW.document.createElement("script");script.async=!0,script.crossOrigin="anonymous",script.src=function getReportDialogEndpoint(dsnLike,dialogOptions){const dsn=makeDsn(dsnLike);if(!dsn)return"";const endpoint=`${getBaseApiEndpoint(dsn)}embed/error-page/`;let encodedOptions=`dsn=${function dsnToString(dsn,withPassword=!1){const{host,path,pass,port,projectId,protocol,publicKey}=dsn;return`${protocol}://${publicKey}${withPassword&&pass?`:${pass}`:""}@${host}${port?`:${port}`:""}/${path?`${path}/`:path}${projectId}`}(dsn)}`;for(const key in dialogOptions)if("dsn"!==key&&"onClose"!==key)if("user"===key){const user=dialogOptions.user;if(!user)continue;user.name&&(encodedOptions+=`&name=${encodeURIComponent(user.name)}`),user.email&&(encodedOptions+=`&email=${encodeURIComponent(user.email)}`)}else encodedOptions+=`&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key])}`;return`${endpoint}?${encodedOptions}`}(dsn,options),options.onLoad&&(script.onload=options.onLoad);const{onClose}=options;if(onClose){const reportDialogClosedMessageHandler=event=>{if("__sentry_reportdialog_closed__"===event.data)try{onClose()}finally{helpers_WINDOW.removeEventListener("message",reportDialogClosedMessageHandler)}};helpers_WINDOW.addEventListener("message",reportDialogClosedMessageHandler)}const injectionPoint=helpers_WINDOW.document.head||helpers_WINDOW.document.body;injectionPoint?injectionPoint.appendChild(script):debug_build_DEBUG_BUILD&&esm_logger.vF.error("Not injecting report dialog. No injection point found in HTML")}__webpack_require__("./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js");var react=__webpack_require__("./node_modules/react/index.js");const esm_debug_build_DEBUG_BUILD="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;var is=__webpack_require__("./node_modules/@sentry/utils/build/esm/is.js");function captureReactException(error,{componentStack},hint){if(function isAtLeastReact17(reactVersion){const reactMajor=reactVersion.match(/^([^.]+)/);return null!==reactMajor&&parseInt(reactMajor[0])>=17}(react.version)&&(0,is.bJ)(error)&&componentStack){const errorBoundaryError=new Error(error.message);errorBoundaryError.name=`React ErrorBoundary ${error.name}`,errorBoundaryError.stack=componentStack,function setCause(error,cause){const seenErrors=new WeakSet;!function recurse(error,cause){if(!seenErrors.has(error))return error.cause?(seenErrors.add(error),recurse(error.cause,cause)):void(error.cause=cause)}(error,cause)}(error,errorBoundaryError)}return(0,esm_exports.Cp)(error,{...hint,captureContext:{contexts:{react:{componentStack}}}})}const INITIAL_STATE={componentStack:null,error:null,eventId:null};class ErrorBoundary extends react.Component{constructor(props){super(props),ErrorBoundary.prototype.__init.call(this),this.state=INITIAL_STATE,this._openFallbackReportDialog=!0;const client=(0,currentScopes.KU)();client&&props.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=client.on("afterSendEvent",(event=>{!event.type&&this._lastEventId&&event.event_id===this._lastEventId&&showReportDialog({...props.dialogOptions,eventId:this._lastEventId})})))}componentDidCatch(error,errorInfo){const{componentStack}=errorInfo,passedInComponentStack=null==componentStack?void 0:componentStack,{beforeCapture,onError,showDialog,dialogOptions}=this.props;(0,currentScopes.v4)((scope=>{beforeCapture&&beforeCapture(scope,error,passedInComponentStack);const eventId=captureReactException(error,errorInfo,{mechanism:{handled:!!this.props.fallback}});onError&&onError(error,passedInComponentStack,eventId),showDialog&&(this._lastEventId=eventId,this._openFallbackReportDialog&&showReportDialog({...dialogOptions,eventId})),this.setState({error,componentStack,eventId})}))}componentDidMount(){const{onMount}=this.props;onMount&&onMount()}componentWillUnmount(){const{error,componentStack,eventId}=this.state,{onUnmount}=this.props;onUnmount&&onUnmount(error,componentStack,eventId),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}__init(){this.resetErrorBoundary=()=>{const{onReset}=this.props,{error,componentStack,eventId}=this.state;onReset&&onReset(error,componentStack,eventId),this.setState(INITIAL_STATE)}}render(){const{fallback,children}=this.props,state=this.state;if(state.error){let element;return element="function"==typeof fallback?react.createElement(fallback,{error:state.error,componentStack:state.componentStack,resetError:this.resetErrorBoundary,eventId:state.eventId}):fallback,react.isValidElement(element)?element:(fallback&&esm_debug_build_DEBUG_BUILD&&esm_logger.vF.warn("fallback did not produce a valid ReactElement"),null)}return"function"==typeof children?children():children}}},"./node_modules/@sentry/utils/build/esm/debug-build.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{T:()=>DEBUG_BUILD});const DEBUG_BUILD="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},"./node_modules/@sentry/utils/build/esm/is.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Qd:()=>isPlainObject,Qg:()=>isThenable,bJ:()=>isError});const objectToString=Object.prototype.toString;function isError(wat){switch(objectToString.call(wat)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return isInstanceOf(wat,Error)}}function isBuiltin(wat,className){return objectToString.call(wat)===`[object ${className}]`}function isPlainObject(wat){return isBuiltin(wat,"Object")}function isThenable(wat){return Boolean(wat&&wat.then&&"function"==typeof wat.then)}function isInstanceOf(wat,base){try{return wat instanceof base}catch(_e){return!1}}},"./node_modules/@sentry/utils/build/esm/logger.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{pq:()=>consoleSandbox,vF:()=>logger});var _debug_build_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@sentry/utils/build/esm/debug-build.js"),_worldwide_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@sentry/utils/build/esm/worldwide.js");const CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],originalConsoleMethods={};function consoleSandbox(callback){if(!("console"in _worldwide_js__WEBPACK_IMPORTED_MODULE_0__.O))return callback();const console=_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.O.console,wrappedFuncs={},wrappedLevels=Object.keys(originalConsoleMethods);wrappedLevels.forEach((level=>{const originalConsoleMethod=originalConsoleMethods[level];wrappedFuncs[level]=console[level],console[level]=originalConsoleMethod}));try{return callback()}finally{wrappedLevels.forEach((level=>{console[level]=wrappedFuncs[level]}))}}const logger=function makeLogger(){let enabled=!1;const logger={enable:()=>{enabled=!0},disable:()=>{enabled=!1},isEnabled:()=>enabled};return _debug_build_js__WEBPACK_IMPORTED_MODULE_1__.T?CONSOLE_LEVELS.forEach((name=>{logger[name]=(...args)=>{enabled&&consoleSandbox((()=>{_worldwide_js__WEBPACK_IMPORTED_MODULE_0__.O.console[name](`Sentry Logger [${name}]:`,...args)}))}})):CONSOLE_LEVELS.forEach((name=>{logger[name]=()=>{}})),logger}()},"./node_modules/@sentry/utils/build/esm/version.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{M:()=>SDK_VERSION});const SDK_VERSION="8.24.0"},"./node_modules/@sentry/utils/build/esm/worldwide.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{B:()=>getGlobalSingleton,O:()=>GLOBAL_OBJ});var _version_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@sentry/utils/build/esm/version.js");const GLOBAL_OBJ=globalThis;function getGlobalSingleton(name,creator,obj){const gbl=obj||GLOBAL_OBJ,__SENTRY__=gbl.__SENTRY__=gbl.__SENTRY__||{},versionedCarrier=__SENTRY__[_version_js__WEBPACK_IMPORTED_MODULE_0__.M]=__SENTRY__[_version_js__WEBPACK_IMPORTED_MODULE_0__.M]||{};return versionedCarrier[name]||(versionedCarrier[name]=creator())}},"./node_modules/@tanstack/react-query/build/modern/useMutation.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{n:()=>useMutation});var react=__webpack_require__("./node_modules/react/index.js"),mutation=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/mutation.js"),notifyManager=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/notifyManager.js"),subscribable=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/subscribable.js"),utils=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/utils.js"),MutationObserver=class extends subscribable.Q{#client;#currentResult=void 0;#currentMutation;#mutateOptions;constructor(client,options){super(),this.#client=client,this.setOptions(options),this.bindMethods(),this.#updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(options){const prevOptions=this.options;this.options=this.#client.defaultMutationOptions(options),(0,utils.f8)(this.options,prevOptions)||this.#client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#currentMutation,observer:this}),prevOptions?.mutationKey&&this.options.mutationKey&&(0,utils.EN)(prevOptions.mutationKey)!==(0,utils.EN)(this.options.mutationKey)?this.reset():"pending"===this.#currentMutation?.state.status&&this.#currentMutation.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#currentMutation?.removeObserver(this)}onMutationUpdate(action){this.#updateResult(),this.#notify(action)}getCurrentResult(){return this.#currentResult}reset(){this.#currentMutation?.removeObserver(this),this.#currentMutation=void 0,this.#updateResult(),this.#notify()}mutate(variables,options){return this.#mutateOptions=options,this.#currentMutation?.removeObserver(this),this.#currentMutation=this.#client.getMutationCache().build(this.#client,this.options),this.#currentMutation.addObserver(this),this.#currentMutation.execute(variables)}#updateResult(){const state=this.#currentMutation?.state??(0,mutation.$)();this.#currentResult={...state,isPending:"pending"===state.status,isSuccess:"success"===state.status,isError:"error"===state.status,isIdle:"idle"===state.status,mutate:this.mutate,reset:this.reset}}#notify(action){notifyManager.j.batch((()=>{if(this.#mutateOptions&&this.hasListeners()){const variables=this.#currentResult.variables,context=this.#currentResult.context;"success"===action?.type?(this.#mutateOptions.onSuccess?.(action.data,variables,context),this.#mutateOptions.onSettled?.(action.data,null,variables,context)):"error"===action?.type&&(this.#mutateOptions.onError?.(action.error,variables,context),this.#mutateOptions.onSettled?.(void 0,action.error,variables,context))}this.listeners.forEach((listener=>{listener(this.#currentResult)}))}))}},QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),modern_utils=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/utils.js");function useMutation(options,queryClient){const client=(0,QueryClientProvider.jE)(queryClient),[observer]=react.useState((()=>new MutationObserver(client,options)));react.useEffect((()=>{observer.setOptions(options)}),[observer,options]);const result=react.useSyncExternalStore(react.useCallback((onStoreChange=>observer.subscribe(notifyManager.j.batchCalls(onStoreChange))),[observer]),(()=>observer.getCurrentResult()),(()=>observer.getCurrentResult())),mutate=react.useCallback(((variables,mutateOptions)=>{observer.mutate(variables,mutateOptions).catch(modern_utils.l)}),[observer]);if(result.error&&(0,modern_utils.G)(observer.options.throwOnError,[result.error]))throw result.error;return{...result,mutate,mutateAsync:result.mutate}}},"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":(module,__unused_webpack_exports,__webpack_require__)=>{var anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js");module.exports=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value)}catch(error){iteratorClose(iterator,"throw",error)}}},"./node_modules/core-js/internals/create-iter-result-object.js":module=>{module.exports=function(value,done){return{value,done}}},"./node_modules/core-js/internals/define-built-ins.js":(module,__unused_webpack_exports,__webpack_require__)=>{var defineBuiltIn=__webpack_require__("./node_modules/core-js/internals/define-built-in.js");module.exports=function(target,src,options){for(var key in src)defineBuiltIn(target,key,src[key],options);return target}},"./node_modules/core-js/internals/iterator-create-proxy.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),create=__webpack_require__("./node_modules/core-js/internals/object-create.js"),createNonEnumerableProperty=__webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),defineBuiltIns=__webpack_require__("./node_modules/core-js/internals/define-built-ins.js"),wellKnownSymbol=__webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),InternalStateModule=__webpack_require__("./node_modules/core-js/internals/internal-state.js"),getMethod=__webpack_require__("./node_modules/core-js/internals/get-method.js"),IteratorPrototype=__webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype,createIterResultObject=__webpack_require__("./node_modules/core-js/internals/create-iter-result-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),setInternalState=InternalStateModule.set,createIteratorProxyPrototype=function(IS_ITERATOR){var getInternalState=InternalStateModule.getterFor(IS_ITERATOR?"WrapForValidIterator":"IteratorHelper");return defineBuiltIns(create(IteratorPrototype),{next:function next(){var state=getInternalState(this);if(IS_ITERATOR)return state.nextHandler();try{var result=state.done?void 0:state.nextHandler();return createIterResultObject(result,state.done)}catch(error){throw state.done=!0,error}},return:function(){var state=getInternalState(this),iterator=state.iterator;if(state.done=!0,IS_ITERATOR){var returnMethod=getMethod(iterator,"return");return returnMethod?call(returnMethod,iterator):createIterResultObject(void 0,!0)}if(state.inner)try{iteratorClose(state.inner.iterator,"normal")}catch(error){return iteratorClose(iterator,"throw",error)}return iteratorClose(iterator,"normal"),createIterResultObject(void 0,!0)}})},WrapForValidIteratorPrototype=createIteratorProxyPrototype(!0),IteratorHelperPrototype=createIteratorProxyPrototype(!1);createNonEnumerableProperty(IteratorHelperPrototype,TO_STRING_TAG,"Iterator Helper"),module.exports=function(nextHandler,IS_ITERATOR){var IteratorProxy=function Iterator(record,state){state?(state.iterator=record.iterator,state.next=record.next):state=record,state.type=IS_ITERATOR?"WrapForValidIterator":"IteratorHelper",state.nextHandler=nextHandler,state.counter=0,state.done=!1,setInternalState(this,state)};return IteratorProxy.prototype=IS_ITERATOR?WrapForValidIteratorPrototype:IteratorHelperPrototype,IteratorProxy}},"./node_modules/core-js/internals/iterator-map.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),aCallable=__webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorDirect=__webpack_require__("./node_modules/core-js/internals/get-iterator-direct.js"),createIteratorProxy=__webpack_require__("./node_modules/core-js/internals/iterator-create-proxy.js"),callWithSafeIterationClosing=__webpack_require__("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),IteratorProxy=createIteratorProxy((function(){var iterator=this.iterator,result=anObject(call(this.next,iterator));if(!(this.done=!!result.done))return callWithSafeIterationClosing(iterator,this.mapper,[result.value,this.counter++],!0)}));module.exports=function map(mapper){return anObject(this),aCallable(mapper),new IteratorProxy(getIteratorDirect(this),{mapper})}},"./node_modules/core-js/modules/esnext.iterator.map.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),map=__webpack_require__("./node_modules/core-js/internals/iterator-map.js");$({target:"Iterator",proto:!0,real:!0,forced:__webpack_require__("./node_modules/core-js/internals/is-pure.js")},{map})}}]); \ No newline at end of file diff --git a/storybook/789.98ebf2b2.iframe.bundle.js b/storybook/789.98ebf2b2.iframe.bundle.js deleted file mode 100644 index 4a482c54d..000000000 --- a/storybook/789.98ebf2b2.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[789],{"./src/components/common/Modal/Modal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>Modal_Modal});var react=__webpack_require__("./node_modules/react/index.js"),react_dom=__webpack_require__("./node_modules/react-dom/index.js");const hooks_useDisableBackgroundScroll=isOpen=>{(0,react.useEffect)((()=>{if(isOpen)return document.body.style.overflow="hidden",()=>{document.body.style.overflow="auto"}}),[isOpen])},hooks_useModalEscClose=(isOpen,onModalClose)=>{(0,react.useEffect)((()=>{const handleKeyDown=event=>{isOpen&&"Escape"===event.key&&onModalClose()};return document.addEventListener("keydown",handleKeyDown),()=>{document.removeEventListener("keydown",handleKeyDown)}}),[isOpen,onModalClose])};var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const modalBackdropLayout={name:"1lmx8ya",styles:"display:flex;position:fixed;justify-content:center;align-items:center;background-color:rgb(0 0 0 / 50%);inset:0"},modalContentWrapper=({position})=>(0,emotion_react_browser_esm.AH)("display:flex;position:fixed;left:50%;flex-direction:column;gap:1.6rem;width:24rem;height:fit-content;max-height:70vh;min-height:1.2rem;transform:translateX(-50%);margin:0;padding:2.4rem;border:none;border-radius:",Theme.S.borderRadius.radius10,";background-color:white;box-sizing:border-box;",(()=>{switch(position){case"top":return"\n top: 0;\n transform: translate(-50%, 0%);\n ";case"bottom":return"\n bottom: 0;\n transform: translate(-50%, 0%);\n ";default:return"\n top: 50%;\n transform: translate(-50%, -50%);\n "}})(),";",""),modalHeaderLayout={name:"14q0t56",styles:"display:flex;justify-content:space-between;align-items:center;margin:0;font-weight:bold"},modalHeaderEmptyBox=position=>(0,emotion_react_browser_esm.AH)("display:","center"===position?"block":"none",";width:1.6rem;",""),modalTitle=({fontSize="bold",fontWeight="2rem"})=>(0,emotion_react_browser_esm.AH)("font-weight:",fontWeight,";font-size:",fontSize,";",""),modalIconButton=({imgSize="1.6rem"})=>(0,emotion_react_browser_esm.AH)("width:",imgSize,";height:",imgSize,";padding:0;border:none;&:focus{outline:none;}img{width:100%;}",""),modalTextButton=({buttonWidth="100%",buttonHeight="100%",fontSize="1.6rem",backgroundColor=Theme.S.color.peanut400,fontColor="#000000"})=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;width:",buttonWidth,";height:",buttonHeight,";padding:1rem;border:none;border-radius:0.8rem;background-color:",backgroundColor,";color:",fontColor,";font-weight:bold;font-size:",fontSize,";&:focus{outline:none;}",""),modalContentLayout=({fontSize="1.2rem"})=>(0,emotion_react_browser_esm.AH)("*{box-sizing:border-box;}font-size:",fontSize,";",""),modalInputLayout={name:"56h6cs",styles:"width:100%;padding:0.8rem;border:1px solid #000"},modalFooter=({buttonPosition="center",buttonGap="1.2rem"})=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:",buttonPosition,";gap:",buttonGap,";","");var closeIcon=__webpack_require__("./src/assets/images/closeIcon.png"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Modal=({children,isOpen,onClose,position="center",...restProps})=>{const modalRef=(0,react.useRef)(null);hooks_useModalEscClose(isOpen,onClose),hooks_useDisableBackgroundScroll(isOpen);const handleOutsideClick=event=>{isOpen&&modalRef.current&&!modalRef.current.contains(event.target)&&onClose()};if(!isOpen)return null;const modalContent=(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:modalBackdropLayout,onClick:handleOutsideClick,onKeyDown:handleOutsideClick,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:modalContentWrapper({position}),ref:modalRef,...restProps,children})});return react_dom.createPortal(modalContent,document.body)};Modal.Header=({position="center",children,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:modalHeaderLayout,...restProps,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:modalHeaderEmptyBox(position)}),children]}),Modal.Title=({fontSize,fontWeight,children,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:modalTitle({fontSize,fontWeight}),...restProps,children}),Modal.IconButton=({type="button",src=closeIcon,imgSize,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:modalIconButton({imgSize}),type,...restProps,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src,alt:"닫기 버튼"})}),Modal.TextButton=({type="button",onConfirm,buttonWidth,buttonHeight,fontSize,backgroundColor,fontColor,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:modalTextButton({buttonWidth,buttonHeight,fontSize,backgroundColor,fontColor}),type,onClick:onConfirm,...restProps}),Modal.Content=({children,fontSize,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("section",{css:modalContentLayout({fontSize:"1.4rem"}),...restProps,children}),Modal.Input=({...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("input",{css:modalInputLayout,...restProps}),Modal.Footer=({children,buttonPosition,buttonGap,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:modalFooter({buttonPosition,buttonGap}),...restProps,children});const Modal_Modal=Modal},"./src/assets/images/closeIcon.png":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/closeIcon.cc1a712e.png"}}]); \ No newline at end of file diff --git a/storybook/9.7de1a6b4.iframe.bundle.js b/storybook/9.7de1a6b4.iframe.bundle.js deleted file mode 100644 index 05fadfd13..000000000 --- a/storybook/9.7de1a6b4.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[9],{"./src/components/common/AlertModal/AlertModal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>AlertModal_AlertModal});__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");var react=__webpack_require__("./node_modules/react/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const alertModalTitle=(0,emotion_react_browser_esm.AH)(Theme.S.typography.headline3,";",""),messageContainer={name:"1azakc",styles:"text-align:center"},alertText={name:"255c6r",styles:"word-break:keep-all"};var Modal=__webpack_require__("./src/components/common/Modal/Modal.tsx"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const AlertModal=({isOpen,onClose,message,title})=>(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A,{isOpen,onClose,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)(Modal.A.Header,{position:"center",children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Title,{css:alertModalTitle,children:title||"알림"}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.IconButton,{onClick:onClose})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Content,{css:messageContainer,children:message.split("\n").map((text=>(0,emotion_react_jsx_runtime_browser_esm.FD)(react.Fragment,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:alertText,children:text}),(0,emotion_react_jsx_runtime_browser_esm.Y)("br",{})]},text)))}),(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.Footer,{buttonPosition:"center",children:(0,emotion_react_jsx_runtime_browser_esm.Y)(Modal.A.TextButton,{onClick:onClose,children:"닫기"})})]}),AlertModal_AlertModal=AlertModal;AlertModal.__docgenInfo={description:"",methods:[],displayName:"AlertModal",props:{isOpen:{required:!0,tsType:{name:"boolean"},description:""},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},message:{required:!0,tsType:{name:"string"},description:""},title:{required:!1,tsType:{name:"string"},description:""}}}},"./src/components/common/Button/Button.styled.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>bottomButtonLayout,l:()=>buttonLayout});var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const utils_getFontSize=fontSize=>{switch(fontSize){case"small":return Theme.S.typography.caption.fontSize;case"medium":default:return Theme.S.typography.headline2.fontSize;case"large":return Theme.S.typography.headline1.fontSize}};var _ref={name:"10t0zvp",styles:"width:32rem;padding:2rem 0"},_ref2={name:"10t0zvp",styles:"width:32rem;padding:2rem 0"},_ref3={name:"1d06pcm",styles:"width:12rem;padding:1.6rem 0"},_ref4={name:"g089ls",styles:"width:6.8rem;padding:0.8rem 0"};const utils_getSizeStyles=size=>{switch(size){case"small":return _ref4;case"medium":return _ref3;case"large":return _ref2;default:return _ref}};var Button_styled_ref={name:"1wsejju",styles:"position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%"};const buttonLayout=({disabled,size,radius,fontSize,bottom})=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;",utils_getSizeStyles(size),";border:none;border-radius:",(0,getBorderRadius.A)(radius),";background-color:",disabled?Theme.S.color.peanut300:Theme.S.color.peanut400,";font-weight:bold;font-size:",utils_getFontSize(fontSize),";cursor:",disabled?"not-allowed":"pointer",";",bottom&&Button_styled_ref,";",""),bottomButtonLayout={name:"o8a8jf",styles:"position:fixed;bottom:0;width:100%"}},"./src/components/common/Button/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _Button_styled__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/common/Button/Button.styled.ts"),_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Button=({text,onClick,disabled,size,radius,fontSize,bottom,...props})=>(0,_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Y)("button",{onClick,disabled,css:(0,_Button_styled__WEBPACK_IMPORTED_MODULE_1__.l)({disabled,size,radius,fontSize,bottom}),...props,children:text}),__WEBPACK_DEFAULT_EXPORT__=Button;Button.__docgenInfo={description:"",methods:[],displayName:"Button",props:{text:{required:!0,tsType:{name:"string"},description:""},onClick:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:""},style:{required:!1,tsType:{name:"ReactCSSProperties",raw:"React.CSSProperties"},description:""},size:{required:!1,tsType:{name:"union",raw:"'small' | 'medium' | 'large'",elements:[{name:"literal",value:"'small'"},{name:"literal",value:"'medium'"},{name:"literal",value:"'large'"}]},description:""},radius:{required:!1,tsType:{name:"union",raw:"'small' | 'medium' | 'large'",elements:[{name:"literal",value:"'small'"},{name:"literal",value:"'medium'"},{name:"literal",value:"'large'"}]},description:""},fontSize:{required:!1,tsType:{name:"union",raw:"'small' | 'medium' | 'large'",elements:[{name:"literal",value:"'small'"},{name:"literal",value:"'medium'"},{name:"literal",value:"'large'"}]},description:""},bottom:{required:!1,tsType:{name:"boolean"},description:""}},composes:["ButtonHTMLAttributes"]}},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}}}]); \ No newline at end of file diff --git a/storybook/995.9f5daff9.iframe.bundle.js b/storybook/995.9f5daff9.iframe.bundle.js new file mode 100644 index 000000000..4a24dcc05 --- /dev/null +++ b/storybook/995.9f5daff9.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[995],{"./src/components/common/Modal/Modal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>Modal_Modal});var react=__webpack_require__("./node_modules/react/index.js"),react_dom=__webpack_require__("./node_modules/react-dom/index.js");const hooks_useModalEscClose=(isOpen,onModalClose)=>{(0,react.useEffect)((()=>{const handleKeyDown=event=>{isOpen&&"Escape"===event.key&&onModalClose()};return document.addEventListener("keydown",handleKeyDown),()=>{document.removeEventListener("keydown",handleKeyDown)}}),[isOpen,onModalClose])};var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const modalBackdropLayout={name:"1lmx8ya",styles:"display:flex;position:fixed;justify-content:center;align-items:center;background-color:rgb(0 0 0 / 50%);inset:0"},modalContentWrapper=({position})=>(0,emotion_react_browser_esm.AH)("display:flex;position:fixed;left:50%;flex-direction:column;gap:1.6rem;width:24rem;height:fit-content;max-height:70vh;min-height:1.2rem;transform:translateX(-50%);margin:0;padding:2.4rem;border:none;border-radius:",Theme.S.borderRadius.radius10,";background-color:white;box-sizing:border-box;",(()=>{switch(position){case"top":return"\n top: 0;\n transform: translate(-50%, 0%);\n ";case"bottom":return"\n bottom: 0;\n transform: translate(-50%, 0%);\n ";default:return"\n top: 50%;\n transform: translate(-50%, -50%);\n "}})(),";",""),modalHeaderLayout={name:"14q0t56",styles:"display:flex;justify-content:space-between;align-items:center;margin:0;font-weight:bold"},modalHeaderEmptyBox=position=>(0,emotion_react_browser_esm.AH)("display:","center"===position?"block":"none",";width:1.6rem;",""),modalTitle=({fontSize="bold",fontWeight="2rem"})=>(0,emotion_react_browser_esm.AH)("font-weight:",fontWeight,";font-size:",fontSize,";",""),modalIconButton=({imgSize="1.6rem"})=>(0,emotion_react_browser_esm.AH)("width:",imgSize,";height:",imgSize,";padding:0;border:none;&:focus{outline:none;}img{width:100%;}",""),modalTextButton=({buttonWidth="100%",buttonHeight="100%",fontSize="1.6rem",backgroundColor=Theme.S.color.peanut400,fontColor="#000000"})=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;width:",buttonWidth,";height:",buttonHeight,";padding:1rem;border:none;border-radius:0.8rem;background-color:",backgroundColor,";color:",fontColor,";font-weight:bold;font-size:",fontSize,";&:focus{outline:none;}",""),modalContentLayout=({fontSize="1.2rem"})=>(0,emotion_react_browser_esm.AH)("*{box-sizing:border-box;}font-size:",fontSize,";",""),modalInputLayout={name:"56h6cs",styles:"width:100%;padding:0.8rem;border:1px solid #000"},modalFooter=({buttonPosition="center",buttonGap="1.2rem"})=>(0,emotion_react_browser_esm.AH)("display:flex;justify-content:",buttonPosition,";gap:",buttonGap,";","");var closeIcon=__webpack_require__("./src/assets/images/closeIcon.png"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const Modal=({children,isOpen,onClose,position="center",...restProps})=>{const modalRef=(0,react.useRef)(null);hooks_useModalEscClose(isOpen,onClose);const handleOutsideClick=event=>{isOpen&&modalRef.current&&!modalRef.current.contains(event.target)&&onClose()};if(!isOpen)return null;const modalContent=(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:modalBackdropLayout,onClick:handleOutsideClick,onKeyDown:handleOutsideClick,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:modalContentWrapper({position}),ref:modalRef,...restProps,children})});return react_dom.createPortal(modalContent,document.body)};Modal.Header=({position="center",children,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.FD)("header",{css:modalHeaderLayout,...restProps,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:modalHeaderEmptyBox(position)}),children]}),Modal.Title=({fontSize,fontWeight,children,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:modalTitle({fontSize,fontWeight}),...restProps,children}),Modal.IconButton=({type="button",src=closeIcon,imgSize,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:modalIconButton({imgSize}),type,...restProps,children:(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src,alt:"닫기 버튼"})}),Modal.TextButton=({type="button",onConfirm,buttonWidth,buttonHeight,fontSize,backgroundColor,fontColor,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("button",{css:modalTextButton({buttonWidth,buttonHeight,fontSize,backgroundColor,fontColor}),type,onClick:onConfirm,...restProps}),Modal.Content=({children,fontSize,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("section",{css:modalContentLayout({fontSize:"1.4rem"}),...restProps,children}),Modal.Input=({...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("input",{css:modalInputLayout,...restProps}),Modal.Footer=({children,buttonPosition,buttonGap,...restProps})=>(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:modalFooter({buttonPosition,buttonGap}),...restProps,children});const Modal_Modal=Modal},"./src/assets/images/closeIcon.png":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/closeIcon.cc1a712e.png"}}]); \ No newline at end of file diff --git a/storybook/components-CategoryContainer-CategoryContainer-stories.9a882966.iframe.bundle.js b/storybook/components-CategoryContainer-CategoryContainer-stories.9a882966.iframe.bundle.js new file mode 100644 index 000000000..a6f7b5b5f --- /dev/null +++ b/storybook/components-CategoryContainer-CategoryContainer-stories.9a882966.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[623],{"./src/components/CategoryContainer/CategoryContainer.stories.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본값:()=>기본값});const meta={title:"CategoryContainer",component:__webpack_require__("./src/components/CategoryContainer/CategoryContainer.tsx").A},기본값={args:{category:"재미"}},__WEBPACK_DEFAULT_EXPORT__=meta,__namedExportsOrder=["기본값"];기본값.parameters={...기본값.parameters,docs:{...기본값.parameters?.docs,source:{originalSource:"{\n args: {\n category: '재미'\n }\n}",...기본값.parameters?.docs?.source}}}},"./node_modules/@tanstack/react-query/build/modern/useMutation.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{n:()=>useMutation});var react=__webpack_require__("./node_modules/react/index.js"),mutation=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/mutation.js"),notifyManager=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/notifyManager.js"),subscribable=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/subscribable.js"),utils=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/utils.js"),MutationObserver=class extends subscribable.Q{#client;#currentResult=void 0;#currentMutation;#mutateOptions;constructor(client,options){super(),this.#client=client,this.setOptions(options),this.bindMethods(),this.#updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(options){const prevOptions=this.options;this.options=this.#client.defaultMutationOptions(options),(0,utils.f8)(this.options,prevOptions)||this.#client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#currentMutation,observer:this}),prevOptions?.mutationKey&&this.options.mutationKey&&(0,utils.EN)(prevOptions.mutationKey)!==(0,utils.EN)(this.options.mutationKey)?this.reset():"pending"===this.#currentMutation?.state.status&&this.#currentMutation.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#currentMutation?.removeObserver(this)}onMutationUpdate(action){this.#updateResult(),this.#notify(action)}getCurrentResult(){return this.#currentResult}reset(){this.#currentMutation?.removeObserver(this),this.#currentMutation=void 0,this.#updateResult(),this.#notify()}mutate(variables,options){return this.#mutateOptions=options,this.#currentMutation?.removeObserver(this),this.#currentMutation=this.#client.getMutationCache().build(this.#client,this.options),this.#currentMutation.addObserver(this),this.#currentMutation.execute(variables)}#updateResult(){const state=this.#currentMutation?.state??(0,mutation.$)();this.#currentResult={...state,isPending:"pending"===state.status,isSuccess:"success"===state.status,isError:"error"===state.status,isIdle:"idle"===state.status,mutate:this.mutate,reset:this.reset}}#notify(action){notifyManager.j.batch((()=>{if(this.#mutateOptions&&this.hasListeners()){const variables=this.#currentResult.variables,context=this.#currentResult.context;"success"===action?.type?(this.#mutateOptions.onSuccess?.(action.data,variables,context),this.#mutateOptions.onSettled?.(action.data,null,variables,context)):"error"===action?.type&&(this.#mutateOptions.onError?.(action.error,variables,context),this.#mutateOptions.onSettled?.(void 0,action.error,variables,context))}this.listeners.forEach((listener=>{listener(this.#currentResult)}))}))}},QueryClientProvider=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js"),modern_utils=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/utils.js");function useMutation(options,queryClient){const client=(0,QueryClientProvider.jE)(queryClient),[observer]=react.useState((()=>new MutationObserver(client,options)));react.useEffect((()=>{observer.setOptions(options)}),[observer,options]);const result=react.useSyncExternalStore(react.useCallback((onStoreChange=>observer.subscribe(notifyManager.j.batchCalls(onStoreChange))),[observer]),(()=>observer.getCurrentResult()),(()=>observer.getCurrentResult())),mutate=react.useCallback(((variables,mutateOptions)=>{observer.mutate(variables,mutateOptions).catch(modern_utils.l)}),[observer]);if(result.error&&(0,modern_utils.G)(observer.options.throwOnError,[result.error]))throw result.error;return{...result,mutate,mutateAsync:result.mutate}}},"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./src/components/CategoryContainer/CategoryContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>CategoryContainer_CategoryContainer});var es=__webpack_require__("./node_modules/recoil/es/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const categoryContainerLayout=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:space-evenly;align-items:center;width:100%;height:10rem;padding:1.6rem 0 2.4rem;border-radius:",(0,getBorderRadius.A)("medium"),";background-color:",Theme.S.color.peanut400,";cursor:pointer;",""),roomSettingBox={name:"4zk4ri",styles:"display:flex;flex-direction:column;gap:1rem"},bigTitle={name:"whr9hd",styles:"font-weight:800;font-size:2.8rem"},smallTitle={name:"9mlb8s",styles:"font-weight:800;font-size:2rem"},roomSettingLabel={name:"16ceglb",styles:"font-weight:600"};var RoomSettingModal=__webpack_require__("./src/components/common/RoomSettingModal/RoomSettingModal.tsx"),useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts"),useModal=__webpack_require__("./src/hooks/useModal.ts"),atom=__webpack_require__("./src/recoil/atom.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const CategoryContainer=()=>{const{roomSetting}=(0,useGetRoomInfo.$)(),{isOpen,show,close}=(0,useModal.A)(),{isMaster}=(0,es.vc)(atom.u);return(0,emotion_react_jsx_runtime_browser_esm.FD)(emotion_react_jsx_runtime_browser_esm.FK,{children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("button",{"aria-label":"카테고리 설정",css:categoryContainerLayout,onClick:isMaster?show:()=>{},children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingBox,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingLabel,children:"라운드"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:smallTitle,children:roomSetting.totalRound})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingBox,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingLabel,children:"카테고리"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h2",{css:bigTitle,children:roomSetting.category.label})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roomSettingBox,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:roomSettingLabel,children:"타이머"}),(0,emotion_react_jsx_runtime_browser_esm.FD)("h2",{css:smallTitle,children:[roomSetting.timeLimit/1e3,"초"]})]})]}),isOpen&&(0,emotion_react_jsx_runtime_browser_esm.Y)(RoomSettingModal.A,{isOpen,onClose:close})]})},CategoryContainer_CategoryContainer=CategoryContainer;CategoryContainer.__docgenInfo={description:"",methods:[],displayName:"CategoryContainer"}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");const __WEBPACK_DEFAULT_EXPORT__=()=>{const[isOpen,setIsOpen]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return{isOpen,show:()=>{setIsOpen(!0)},close:()=>{setIsOpen(!1)}}}},"./src/recoil/atom.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>roomUuidState,u:()=>memberInfoState});var recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js");const memberInfoState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"memberInfo",default:{memberId:null,nickname:null,isMaster:!1}}),roomUuidState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"roomUuid",default:""})},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":(module,__unused_webpack_exports,__webpack_require__)=>{var anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js");module.exports=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value)}catch(error){iteratorClose(iterator,"throw",error)}}},"./node_modules/core-js/internals/create-iter-result-object.js":module=>{module.exports=function(value,done){return{value,done}}},"./node_modules/core-js/internals/define-built-ins.js":(module,__unused_webpack_exports,__webpack_require__)=>{var defineBuiltIn=__webpack_require__("./node_modules/core-js/internals/define-built-in.js");module.exports=function(target,src,options){for(var key in src)defineBuiltIn(target,key,src[key],options);return target}},"./node_modules/core-js/internals/iterator-create-proxy.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),create=__webpack_require__("./node_modules/core-js/internals/object-create.js"),createNonEnumerableProperty=__webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),defineBuiltIns=__webpack_require__("./node_modules/core-js/internals/define-built-ins.js"),wellKnownSymbol=__webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),InternalStateModule=__webpack_require__("./node_modules/core-js/internals/internal-state.js"),getMethod=__webpack_require__("./node_modules/core-js/internals/get-method.js"),IteratorPrototype=__webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype,createIterResultObject=__webpack_require__("./node_modules/core-js/internals/create-iter-result-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),setInternalState=InternalStateModule.set,createIteratorProxyPrototype=function(IS_ITERATOR){var getInternalState=InternalStateModule.getterFor(IS_ITERATOR?"WrapForValidIterator":"IteratorHelper");return defineBuiltIns(create(IteratorPrototype),{next:function next(){var state=getInternalState(this);if(IS_ITERATOR)return state.nextHandler();try{var result=state.done?void 0:state.nextHandler();return createIterResultObject(result,state.done)}catch(error){throw state.done=!0,error}},return:function(){var state=getInternalState(this),iterator=state.iterator;if(state.done=!0,IS_ITERATOR){var returnMethod=getMethod(iterator,"return");return returnMethod?call(returnMethod,iterator):createIterResultObject(void 0,!0)}if(state.inner)try{iteratorClose(state.inner.iterator,"normal")}catch(error){return iteratorClose(iterator,"throw",error)}return iteratorClose(iterator,"normal"),createIterResultObject(void 0,!0)}})},WrapForValidIteratorPrototype=createIteratorProxyPrototype(!0),IteratorHelperPrototype=createIteratorProxyPrototype(!1);createNonEnumerableProperty(IteratorHelperPrototype,TO_STRING_TAG,"Iterator Helper"),module.exports=function(nextHandler,IS_ITERATOR){var IteratorProxy=function Iterator(record,state){state?(state.iterator=record.iterator,state.next=record.next):state=record,state.type=IS_ITERATOR?"WrapForValidIterator":"IteratorHelper",state.nextHandler=nextHandler,state.counter=0,state.done=!1,setInternalState(this,state)};return IteratorProxy.prototype=IS_ITERATOR?WrapForValidIteratorPrototype:IteratorHelperPrototype,IteratorProxy}},"./node_modules/core-js/internals/iterator-map.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),aCallable=__webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorDirect=__webpack_require__("./node_modules/core-js/internals/get-iterator-direct.js"),createIteratorProxy=__webpack_require__("./node_modules/core-js/internals/iterator-create-proxy.js"),callWithSafeIterationClosing=__webpack_require__("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),IteratorProxy=createIteratorProxy((function(){var iterator=this.iterator,result=anObject(call(this.next,iterator));if(!(this.done=!!result.done))return callWithSafeIterationClosing(iterator,this.mapper,[result.value,this.counter++],!0)}));module.exports=function map(mapper){return anObject(this),aCallable(mapper),new IteratorProxy(getIteratorDirect(this),{mapper})}},"./node_modules/core-js/modules/esnext.iterator.map.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),map=__webpack_require__("./node_modules/core-js/internals/iterator-map.js");$({target:"Iterator",proto:!0,real:!0,forced:__webpack_require__("./node_modules/core-js/internals/is-pure.js")},{map})}}]); \ No newline at end of file diff --git a/storybook/components-CategoryContainer-CategoryContainer-stories.e50043aa.iframe.bundle.js b/storybook/components-CategoryContainer-CategoryContainer-stories.e50043aa.iframe.bundle.js deleted file mode 100644 index 8fd3ab07c..000000000 --- a/storybook/components-CategoryContainer-CategoryContainer-stories.e50043aa.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[623],{"./src/components/CategoryContainer/CategoryContainer.stories.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본값:()=>기본값});const meta={title:"CategoryContainer",component:__webpack_require__("./src/components/CategoryContainer/CategoryContainer.tsx").A},기본값={args:{category:"재미"}},__WEBPACK_DEFAULT_EXPORT__=meta,__namedExportsOrder=["기본값"];기본값.parameters={...기본값.parameters,docs:{...기본값.parameters?.docs,source:{originalSource:"{\n args: {\n category: '재미'\n }\n}",...기본값.parameters?.docs?.source}}}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _utils_error__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/utils/error.ts");const __WEBPACK_DEFAULT_EXPORT__={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.e({...apiError,status:response.status})}return response}catch(error){if(error instanceof _utils_error__WEBPACK_IMPORTED_MODULE_0__.e)throw error;throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.D}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/apis/room.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gn:()=>exitRoom,ew:()=>applyRoomSetting,qE:()=>getRoomInfo,rm:()=>getCategoryList,zj:()=>startGame});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const getRoomInfo=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.getRoomInfo(roomId)});return await res.json()},startGame=async roomId=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.startGame(roomId)})},getCategoryList=async()=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.categoryList});return await res.json()},applyRoomSetting=async(roomId,roomSetting)=>{const{totalRound,timeLimit,category}=roomSetting;await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.applyRoomSetting(roomId),headers:{"Content-Type":"application/json"},body:{totalRound,timeLimit,category}})},exitRoom=async(roomId,memberId)=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.delete({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.deleteRoom(roomId,memberId)})}},"./src/components/CategoryContainer/CategoryContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>CategoryContainer_CategoryContainer});var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts"),getBorderRadius=__webpack_require__("./src/styles/utils/getBorderRadius.ts");const categoryContainerLayout=(0,emotion_react_browser_esm.AH)("display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;height:10rem;padding:1.6rem 0 2.4rem;border-radius:",(0,getBorderRadius.A)("medium"),";background-color:",Theme.S.color.peanut400,";",""),title={name:"whr9hd",styles:"font-weight:800;font-size:2.8rem"},subtitle={name:"16ceglb",styles:"font-weight:600"};var useGetRoomInfo=__webpack_require__("./src/hooks/useGetRoomInfo.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const CategoryContainer=()=>{const{roomSetting}=(0,useGetRoomInfo.$)();return(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:categoryContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:subtitle,children:"카테고리"}),(0,emotion_react_jsx_runtime_browser_esm.Y)("h1",{css:title,children:roomSetting.category.label})]})},CategoryContainer_CategoryContainer=CategoryContainer;CategoryContainer.__docgenInfo={description:"",methods:[],displayName:"CategoryContainer"}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/hooks/useGetRoomInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>useGetRoomInfo});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-router/dist/index.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_config__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/constants/config.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const useGetRoomInfo=()=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.g)(),{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.roomMembers,Number(roomId)],queryFn:()=>(0,_apis_room__WEBPACK_IMPORTED_MODULE_0__.qE)(Number(roomId)),refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=_constants_config__WEBPACK_IMPORTED_MODULE_4__.A3)&&_constants_config__WEBPACK_IMPORTED_MODULE_4__.S2,refetchIntervalInBackground:!0,gcTime:0});return{members:data?.members,roomSetting:data?.roomSetting,master:data?.master,isGameStart:data?.isGameStart}}},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}},"./src/utils/error.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>CustomError,D:()=>NetworkError});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 5초, 10초, 15초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}}}]); \ No newline at end of file diff --git a/storybook/components-ReadyMembersContainer-ReadyMembersContainer-stories.19b53f1b.iframe.bundle.js b/storybook/components-ReadyMembersContainer-ReadyMembersContainer-stories.19b53f1b.iframe.bundle.js deleted file mode 100644 index 85122cf17..000000000 --- a/storybook/components-ReadyMembersContainer-ReadyMembersContainer-stories.19b53f1b.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[167],{"./src/components/ReadyMembersContainer/ReadyMembersContainer.stories.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본값:()=>기본값});var _ReadyMembersContainer__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/components/ReadyMembersContainer/ReadyMembersContainer.tsx"),_mocks_data_roomInfo_json__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/mocks/data/roomInfo.json");const meta={title:"ReadyMembersContainer",component:_ReadyMembersContainer__WEBPACK_IMPORTED_MODULE_0__.A},기본값={args:{members:_mocks_data_roomInfo_json__WEBPACK_IMPORTED_MODULE_1__.members}},__WEBPACK_DEFAULT_EXPORT__=meta,__namedExportsOrder=["기본값"];기본값.parameters={...기본값.parameters,docs:{...기본값.parameters?.docs,source:{originalSource:"{\n args: {\n members: roomInfo.members\n }\n}",...기본값.parameters?.docs?.source}}}},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":(module,__unused_webpack_exports,__webpack_require__)=>{var anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js");module.exports=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value)}catch(error){iteratorClose(iterator,"throw",error)}}},"./node_modules/core-js/internals/create-iter-result-object.js":module=>{module.exports=function(value,done){return{value,done}}},"./node_modules/core-js/internals/define-built-ins.js":(module,__unused_webpack_exports,__webpack_require__)=>{var defineBuiltIn=__webpack_require__("./node_modules/core-js/internals/define-built-in.js");module.exports=function(target,src,options){for(var key in src)defineBuiltIn(target,key,src[key],options);return target}},"./node_modules/core-js/internals/iterator-create-proxy.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),create=__webpack_require__("./node_modules/core-js/internals/object-create.js"),createNonEnumerableProperty=__webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),defineBuiltIns=__webpack_require__("./node_modules/core-js/internals/define-built-ins.js"),wellKnownSymbol=__webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),InternalStateModule=__webpack_require__("./node_modules/core-js/internals/internal-state.js"),getMethod=__webpack_require__("./node_modules/core-js/internals/get-method.js"),IteratorPrototype=__webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype,createIterResultObject=__webpack_require__("./node_modules/core-js/internals/create-iter-result-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),setInternalState=InternalStateModule.set,createIteratorProxyPrototype=function(IS_ITERATOR){var getInternalState=InternalStateModule.getterFor(IS_ITERATOR?"WrapForValidIterator":"IteratorHelper");return defineBuiltIns(create(IteratorPrototype),{next:function next(){var state=getInternalState(this);if(IS_ITERATOR)return state.nextHandler();try{var result=state.done?void 0:state.nextHandler();return createIterResultObject(result,state.done)}catch(error){throw state.done=!0,error}},return:function(){var state=getInternalState(this),iterator=state.iterator;if(state.done=!0,IS_ITERATOR){var returnMethod=getMethod(iterator,"return");return returnMethod?call(returnMethod,iterator):createIterResultObject(void 0,!0)}if(state.inner)try{iteratorClose(state.inner.iterator,"normal")}catch(error){return iteratorClose(iterator,"throw",error)}return iteratorClose(iterator,"normal"),createIterResultObject(void 0,!0)}})},WrapForValidIteratorPrototype=createIteratorProxyPrototype(!0),IteratorHelperPrototype=createIteratorProxyPrototype(!1);createNonEnumerableProperty(IteratorHelperPrototype,TO_STRING_TAG,"Iterator Helper"),module.exports=function(nextHandler,IS_ITERATOR){var IteratorProxy=function Iterator(record,state){state?(state.iterator=record.iterator,state.next=record.next):state=record,state.type=IS_ITERATOR?"WrapForValidIterator":"IteratorHelper",state.nextHandler=nextHandler,state.counter=0,state.done=!1,setInternalState(this,state)};return IteratorProxy.prototype=IS_ITERATOR?WrapForValidIteratorPrototype:IteratorHelperPrototype,IteratorProxy}},"./node_modules/core-js/internals/iterator-map.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),aCallable=__webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorDirect=__webpack_require__("./node_modules/core-js/internals/get-iterator-direct.js"),createIteratorProxy=__webpack_require__("./node_modules/core-js/internals/iterator-create-proxy.js"),callWithSafeIterationClosing=__webpack_require__("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),IteratorProxy=createIteratorProxy((function(){var iterator=this.iterator,result=anObject(call(this.next,iterator));if(!(this.done=!!result.done))return callWithSafeIterationClosing(iterator,this.mapper,[result.value,this.counter++],!0)}));module.exports=function map(mapper){return anObject(this),aCallable(mapper),new IteratorProxy(getIteratorDirect(this),{mapper})}},"./node_modules/core-js/modules/esnext.iterator.map.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),map=__webpack_require__("./node_modules/core-js/internals/iterator-map.js");$({target:"Iterator",proto:!0,real:!0,forced:__webpack_require__("./node_modules/core-js/internals/is-pure.js")},{map})}}]); \ No newline at end of file diff --git a/storybook/components-ReadyMembersContainer-ReadyMembersContainer-stories.4893e338.iframe.bundle.js b/storybook/components-ReadyMembersContainer-ReadyMembersContainer-stories.4893e338.iframe.bundle.js new file mode 100644 index 000000000..ca4494f52 --- /dev/null +++ b/storybook/components-ReadyMembersContainer-ReadyMembersContainer-stories.4893e338.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[167],{"./src/components/ReadyMembersContainer/ReadyMembersContainer.stories.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본값:()=>기본값});var _ReadyMembersContainer__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/components/ReadyMembersContainer/ReadyMembersContainer.tsx"),_mocks_data_roomInfo_json__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/mocks/data/roomInfo.json");const meta={title:"ReadyMembersContainer",component:_ReadyMembersContainer__WEBPACK_IMPORTED_MODULE_0__.A},기본값={args:{members:_mocks_data_roomInfo_json__WEBPACK_IMPORTED_MODULE_1__.members}},__WEBPACK_DEFAULT_EXPORT__=meta,__namedExportsOrder=["기본값"];기본값.parameters={...기본값.parameters,docs:{...기본값.parameters?.docs,source:{originalSource:"{\n args: {\n members: roomInfo.members\n }\n}",...기본값.parameters?.docs?.source}}}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _utils_error__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/utils/error.ts");const __WEBPACK_DEFAULT_EXPORT__={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.e({...apiError,status:response.status})}return response}catch(error){if(error instanceof _utils_error__WEBPACK_IMPORTED_MODULE_0__.e)throw error;throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.D}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/apis/room.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gn:()=>exitRoom,ew:()=>applyRoomSetting,qE:()=>getRoomInfo,rm:()=>getCategoryList,zj:()=>startGame});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const getRoomInfo=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.getRoomInfo(roomId)});return await res.json()},startGame=async roomId=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.startGame(roomId)})},getCategoryList=async()=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.categoryList});return await res.json()},applyRoomSetting=async(roomId,roomSetting)=>{const{totalRound,timeLimit,category}=roomSetting;await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.patch({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.applyRoomSetting(roomId),headers:{"Content-Type":"application/json"},body:{totalRound,timeLimit,category}})},exitRoom=async(roomId,memberId)=>{await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.delete({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.deleteRoom(roomId,memberId)})}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/hooks/useGetRoomInfo.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>useGetRoomInfo});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),react_router_dom__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-router/dist/index.js"),_apis_room__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/room.ts"),_constants_config__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/constants/config.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const useGetRoomInfo=()=>{const{roomId}=(0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.g)(),{data}=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_3__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.roomMembers,Number(roomId)],queryFn:()=>(0,_apis_room__WEBPACK_IMPORTED_MODULE_0__.qE)(Number(roomId)),refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=_constants_config__WEBPACK_IMPORTED_MODULE_4__.A3)&&_constants_config__WEBPACK_IMPORTED_MODULE_4__.S2,refetchIntervalInBackground:!0,gcTime:0});return{members:data?.members,roomSetting:data?.roomSetting,master:data?.master,isGameStart:data?.isGameStart}}},"./src/hooks/useModal.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js");const __WEBPACK_DEFAULT_EXPORT__=()=>{const[isOpen,setIsOpen]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return{isOpen,show:()=>{setIsOpen(!0)},close:()=>{setIsOpen(!1)}}}},"./src/styles/utils/getBorderRadius.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _styles_Theme__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/styles/Theme.ts");const __WEBPACK_DEFAULT_EXPORT__=radius=>{switch(radius){case"small":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius10;case"medium":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius20;case"large":return _styles_Theme__WEBPACK_IMPORTED_MODULE_0__.S.borderRadius.radius30;default:return"0"}}},"./src/utils/error.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>CustomError,D:()=>NetworkError});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 5초, 10초, 15초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":(module,__unused_webpack_exports,__webpack_require__)=>{var anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js");module.exports=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value)}catch(error){iteratorClose(iterator,"throw",error)}}},"./node_modules/core-js/internals/create-iter-result-object.js":module=>{module.exports=function(value,done){return{value,done}}},"./node_modules/core-js/internals/define-built-ins.js":(module,__unused_webpack_exports,__webpack_require__)=>{var defineBuiltIn=__webpack_require__("./node_modules/core-js/internals/define-built-in.js");module.exports=function(target,src,options){for(var key in src)defineBuiltIn(target,key,src[key],options);return target}},"./node_modules/core-js/internals/iterator-create-proxy.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),create=__webpack_require__("./node_modules/core-js/internals/object-create.js"),createNonEnumerableProperty=__webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),defineBuiltIns=__webpack_require__("./node_modules/core-js/internals/define-built-ins.js"),wellKnownSymbol=__webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),InternalStateModule=__webpack_require__("./node_modules/core-js/internals/internal-state.js"),getMethod=__webpack_require__("./node_modules/core-js/internals/get-method.js"),IteratorPrototype=__webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype,createIterResultObject=__webpack_require__("./node_modules/core-js/internals/create-iter-result-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),setInternalState=InternalStateModule.set,createIteratorProxyPrototype=function(IS_ITERATOR){var getInternalState=InternalStateModule.getterFor(IS_ITERATOR?"WrapForValidIterator":"IteratorHelper");return defineBuiltIns(create(IteratorPrototype),{next:function next(){var state=getInternalState(this);if(IS_ITERATOR)return state.nextHandler();try{var result=state.done?void 0:state.nextHandler();return createIterResultObject(result,state.done)}catch(error){throw state.done=!0,error}},return:function(){var state=getInternalState(this),iterator=state.iterator;if(state.done=!0,IS_ITERATOR){var returnMethod=getMethod(iterator,"return");return returnMethod?call(returnMethod,iterator):createIterResultObject(void 0,!0)}if(state.inner)try{iteratorClose(state.inner.iterator,"normal")}catch(error){return iteratorClose(iterator,"throw",error)}return iteratorClose(iterator,"normal"),createIterResultObject(void 0,!0)}})},WrapForValidIteratorPrototype=createIteratorProxyPrototype(!0),IteratorHelperPrototype=createIteratorProxyPrototype(!1);createNonEnumerableProperty(IteratorHelperPrototype,TO_STRING_TAG,"Iterator Helper"),module.exports=function(nextHandler,IS_ITERATOR){var IteratorProxy=function Iterator(record,state){state?(state.iterator=record.iterator,state.next=record.next):state=record,state.type=IS_ITERATOR?"WrapForValidIterator":"IteratorHelper",state.nextHandler=nextHandler,state.counter=0,state.done=!1,setInternalState(this,state)};return IteratorProxy.prototype=IS_ITERATOR?WrapForValidIteratorPrototype:IteratorHelperPrototype,IteratorProxy}},"./node_modules/core-js/internals/iterator-map.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),aCallable=__webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorDirect=__webpack_require__("./node_modules/core-js/internals/get-iterator-direct.js"),createIteratorProxy=__webpack_require__("./node_modules/core-js/internals/iterator-create-proxy.js"),callWithSafeIterationClosing=__webpack_require__("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),IteratorProxy=createIteratorProxy((function(){var iterator=this.iterator,result=anObject(call(this.next,iterator));if(!(this.done=!!result.done))return callWithSafeIterationClosing(iterator,this.mapper,[result.value,this.counter++],!0)}));module.exports=function map(mapper){return anObject(this),aCallable(mapper),new IteratorProxy(getIteratorDirect(this),{mapper})}},"./node_modules/core-js/modules/esnext.iterator.map.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),map=__webpack_require__("./node_modules/core-js/internals/iterator-map.js");$({target:"Iterator",proto:!0,real:!0,forced:__webpack_require__("./node_modules/core-js/internals/is-pure.js")},{map})}}]); \ No newline at end of file diff --git a/storybook/components-TabContentContainer-TabContentContainer-stories.32c9ba48.iframe.bundle.js b/storybook/components-TabContentContainer-TabContentContainer-stories.32c9ba48.iframe.bundle.js deleted file mode 100644 index e264729d4..000000000 --- a/storybook/components-TabContentContainer-TabContentContainer-stories.32c9ba48.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[867],{"./src/components/TabContentContainer/TabContentContainer.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>TabContentContainer_stories,투표_통계:()=>투표_통계,투표_현황:()=>투표_현황});var dist=__webpack_require__("./node_modules/react-router/dist/index.js");const getDominantVote=totalResult=>{const{firstOption,secondOption}=totalResult,isEven=firstOption.percent===secondOption.percent,dominantOption=firstOption.percent>secondOption.percent?firstOption:secondOption;return{isEven,dominantPercent:dominantOption.percent,dominantName:dominantOption.name}};var emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const contentWrapperStyle=(0,emotion_react_browser_esm.AH)("display:flex;flex-direction:column;gap:15%;height:50vh;overflow-y:scroll;padding:2.4rem;border:0.3rem solid ",Theme.S.color.peanut400,";border-radius:0.8rem;",""),roundVoteResultContainer={name:"4zk4ri",styles:"display:flex;flex-direction:column;gap:1rem"},categoryContainer={name:"s4usvj",styles:"display:flex;justify-content:space-between;gap:0.8rem;font-weight:bold;font-size:1.4rem"},barWrapperStyle={name:"9kcjqh",styles:"display:flex;overflow:hidden;align-items:center;width:inherit;border-radius:1.6rem"},barWrapper={name:"zur63y",styles:"display:flex;justify-content:center;align-items:center;height:8vh;color:black;font-weight:bold;font-size:1.6rem;transition:all 1s"},firstBar=(percent,isBigFirstOption)=>(0,emotion_react_browser_esm.AH)(barWrapper," overflow:hidden;width:",percent,"%;border-radius:1.6rem 0 0 1.6rem;background-color:",isBigFirstOption?Theme.S.color.peanut400:Theme.S.color.gray,";transform:translateX(5px);clip-path:",100===percent?"none":"polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%)",";",""),secondBar=(percent,isBigFirstOption)=>(0,emotion_react_browser_esm.AH)(barWrapper," overflow:hidden;width:",percent,"%;border-radius:0 1.6rem 1.6rem 0;background-color:",isBigFirstOption?Theme.S.color.gray:Theme.S.color.peanut400,";transform:translateX(-5px);clip-path:",100===percent?"none":"polygon(10px 0, 100% 0, 100% 100%, 0 100%)",";",""),noVoteTextContainer={name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"},noVoteText=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;height:8vh;",Theme.S.typography.headline3,";",""),angryImage={name:"ne5uve",styles:"width:16rem;height:14rem"},totalResultInfoContainer={name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"},totalResultInfoText={name:"1w0tudv",styles:"font-size:1.4rem;line-height:2rem"},emphasizeText={name:"1efi8gv",styles:"font-weight:bold"};const optionParticipantsContainerLayout={name:"koo7tc",styles:"display:flex;flex-direction:column;width:100%;row-gap:1.2rem"},horizontalDivider=(0,emotion_react_browser_esm.AH)("width:100%;height:1px;margin:1.4rem 0;background-color:",Theme.S.color.gray300,";","");__webpack_require__("./node_modules/core-js/modules/esnext.iterator.map.js");const optionParticipantsLayout={name:"ch4q08",styles:"display:flex;flex-direction:column;gap:2rem;width:100%"},optionInfo={name:"1akzvke",styles:"font-weight:bold;font-size:1.6rem"},participantsListWrapper={name:"qrhm24",styles:"display:grid;grid-template-columns:repeat(2, 1fr);row-gap:1.4rem"};var es=__webpack_require__("./node_modules/recoil/es/index.js");const nicknameItemLayout={name:"10fbv33",styles:"display:flex;align-items:center;gap:0.6rem"},nicknameText=isUser=>(0,emotion_react_browser_esm.AH)("font-weight:",isUser?"bold":400,";font-size:1.2rem;",""),profileImage={name:"h3hy14",styles:"width:1.8rem;height:1.8rem"};var sillyDdangkong=__webpack_require__("./src/assets/images/sillyDdangkong.png"),atom=__webpack_require__("./src/recoil/atom.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const NicknameItem=({member})=>{const isUser=(0,es.vc)(atom.u).nickname===member;return(0,emotion_react_jsx_runtime_browser_esm.FD)("li",{css:nicknameItemLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:sillyDdangkong,alt:"사용자 프로필",css:profileImage}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:nicknameText(isUser),children:member})]})},NicknameItem_NicknameItem=NicknameItem;NicknameItem.__docgenInfo={description:"",methods:[],displayName:"NicknameItem",props:{member:{required:!0,tsType:{name:"string"},description:""}}};const OptionParticipants=({optionName,memberCount,members})=>(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:optionParticipantsLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("p",{css:optionInfo,children:[optionName,": ",memberCount]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("ul",{css:participantsListWrapper,children:members.map(((member,index)=>(0,emotion_react_jsx_runtime_browser_esm.Y)(NicknameItem_NicknameItem,{member},index)))})]}),OptionParticipants_OptionParticipants=OptionParticipants;OptionParticipants.__docgenInfo={description:"",methods:[],displayName:"OptionParticipants",props:{optionName:{required:!0,tsType:{name:"string"},description:""},memberCount:{required:!0,tsType:{name:"number"},description:""},members:{required:!0,tsType:{name:"Array",elements:[{name:"string"}],raw:"string[]"},description:""}}};var useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),react=__webpack_require__("./node_modules/react/index.js"),useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),balanceContent=__webpack_require__("./src/apis/balanceContent.ts"),config=__webpack_require__("./src/constants/config.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useMyGameStatusQuery=({roomId,currentRound})=>{const myGameStatusQuery=(0,useQuery.I)({queryKey:[queryKeys.e.myGameStatus,roomId,currentRound],queryFn:()=>{if(!currentRound)throw new Error("balanceContent 가 존재하지 않습니다.");return(0,balanceContent.bR)({roomId,currentRound})},enabled:!!currentRound,refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=config.A3)&&config.S2,refetchIntervalInBackground:!0,gcTime:0});return{...myGameStatusQuery,isRoundFinished:myGameStatusQuery.data?.isRoundFinished,isGameFinished:myGameStatusQuery.data?.isGameFinished}};var routes=__webpack_require__("./src/constants/routes.ts");const hooks_useMyGameStatus=({roomId})=>{const navigate=(0,dist.Zp)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{isRoundFinished,isGameFinished}=hooks_useMyGameStatusQuery({roomId:Number(roomId),currentRound:balanceContent?.currentRound});(0,react.useEffect)((()=>{isGameFinished&&navigate(routes.b.gameResult(Number(roomId))),isRoundFinished&&navigate(routes.b.game(Number(roomId)))}),[isRoundFinished,isGameFinished])},roundVoteResultInitialValue_namespaceObject=JSON.parse('{"group":{"firstOption":{"optionId":1,"name":"Loading...","members":[],"memberCount":0,"percent":50},"secondOption":{"optionId":2,"name":"Loading...","members":[],"memberCount":0,"percent":50},"giveUp":{"members":[],"memberCount":0}},"total":{"firstOption":{"optionId":1,"name":"Loading...","percent":50},"secondOption":{"optionId":2,"name":"Loading...","percent":50}}}'),hooks_useRoundVoteResultQuery=({roomId,contentId})=>{const roundVoteResultQuery=(0,useQuery.I)({queryKey:[queryKeys.e.roundVoteResult,roomId,contentId],queryFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");if(void 0===roomId)throw new Error("방이 존재하지 않습니다.");return await(0,balanceContent.O)({roomId,contentId})},placeholderData:roundVoteResultInitialValue_namespaceObject,enabled:!!contentId});return{...roundVoteResultQuery,groupRoundResult:roundVoteResultQuery.data?.group,totalResult:roundVoteResultQuery.data?.total}},OptionParticipantsContainer=()=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{groupRoundResult}=hooks_useRoundVoteResultQuery({roomId:Number(roomId),contentId:balanceContent?.contentId});return hooks_useMyGameStatus({roomId:Number(roomId)}),groupRoundResult?(0,emotion_react_jsx_runtime_browser_esm.Y)(emotion_react_jsx_runtime_browser_esm.FK,{children:(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:optionParticipantsContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipants_OptionParticipants,{optionName:groupRoundResult.firstOption.name,members:groupRoundResult.firstOption.members,memberCount:groupRoundResult.firstOption.memberCount}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:horizontalDivider}),(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipants_OptionParticipants,{optionName:groupRoundResult.secondOption.name,members:groupRoundResult.secondOption.members,memberCount:groupRoundResult.secondOption.memberCount}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:horizontalDivider}),(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipants_OptionParticipants,{optionName:"투표에 참여하지 않으셨어요",members:groupRoundResult.giveUp.members,memberCount:groupRoundResult.giveUp.memberCount})]})}):(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{children:"데이터가 없습니다"})},OptionParticipantsContainer_OptionParticipantsContainer=OptionParticipantsContainer;OptionParticipantsContainer.__docgenInfo={description:"",methods:[],displayName:"OptionParticipantsContainer"};const hooks_useCountAnimation=({target,start=50,duration=2e3})=>{const[count,setCount]=(0,react.useState)(start);return(0,react.useEffect)((()=>{if(void 0===target||target===start)return;const totalFrame=Math.round(duration/8.333333333333334);let currentNumber=start;const counter=setInterval((()=>{const progress=1===(timingRate=++currentNumber/totalFrame)?1:1-Math.pow(2,-10*timingRate);var timingRate;setCount(Math.round(target*progress)),1===progress&&clearInterval(counter)}),8.333333333333334);return()=>clearInterval(counter)}),[target,start,duration]),count},RoundVoteContainer_hook=groupRoundResult=>({animatedFirstPercent:hooks_useCountAnimation({target:groupRoundResult?.firstOption.percent}),animatedSecondPercent:hooks_useCountAnimation({target:groupRoundResult?.secondOption.percent})});var TopicContainer=__webpack_require__("./src/components/TopicContainer/TopicContainer.tsx");const angryDdangkong_namespaceObject=__webpack_require__.p+"static/media/angryDdangkong.b55fdd75.png",TabContentContainer=({isVoteStatisticsTabActive})=>{const{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{groupRoundResult,totalResult}=hooks_useRoundVoteResultQuery({roomId:Number(roomId),contentId:balanceContent?.contentId});hooks_useMyGameStatus({roomId:Number(roomId)});const{animatedFirstPercent,animatedSecondPercent}=RoundVoteContainer_hook(groupRoundResult);if(!groupRoundResult)return;const isBigFirstOption=groupRoundResult.firstOption.percent>=50,isVote=0!==groupRoundResult.firstOption.percent||0!==groupRoundResult.secondOption.percent,dominantVoteData=totalResult?getDominantVote(totalResult):null;return(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:contentWrapperStyle,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)(TopicContainer.A,{}),isVote&&isVoteStatisticsTabActive&&(0,emotion_react_jsx_runtime_browser_esm.FD)(emotion_react_jsx_runtime_browser_esm.FK,{children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roundVoteResultContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:categoryContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{children:groupRoundResult.firstOption.name}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{children:groupRoundResult.secondOption.name})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:barWrapperStyle,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:firstBar(groupRoundResult.firstOption.percent,isBigFirstOption),children:[animatedFirstPercent,"%"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:secondBar(groupRoundResult.secondOption.percent,isBigFirstOption),children:[animatedSecondPercent,"%"]})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:(isActiveGroupTab=isVoteStatisticsTabActive,(0,emotion_react_browser_esm.AH)("display:flex;visibility:",isActiveGroupTab?"visible":"hidden",";justify-content:space-between;align-items:center;height:1.2rem;font-weight:bold;font-size:1.2rem;","")),children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{children:[groupRoundResult.firstOption.memberCount,"명"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{children:[groupRoundResult.secondOption.memberCount,"명"]})]})]}),totalResult&&dominantVoteData&&(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:totalResultInfoContainer,children:dominantVoteData.isEven?(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:totalResultInfoText,children:"🥜 땅콩 유저들 사이에서 선택이 팽팽하게 갈렸어요! 😲"}):(0,emotion_react_jsx_runtime_browser_esm.FD)(emotion_react_jsx_runtime_browser_esm.FK,{children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:totalResultInfoText,children:["🥜 땅콩 유저 중"," ",(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:emphasizeText,children:[dominantVoteData.dominantPercent,"%"]}),"는"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:totalResultInfoText,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:emphasizeText,children:dominantVoteData.dominantName}),"를 선택했어요 !"]})]})})]}),isVote&&!isVoteStatisticsTabActive&&(0,emotion_react_jsx_runtime_browser_esm.Y)(OptionParticipantsContainer_OptionParticipantsContainer,{}),!isVote&&(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:noVoteTextContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:angryDdangkong_namespaceObject,alt:"화난 땅콩",css:angryImage}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:noVoteText,children:["아무도 투표하지 않으셨네요 :",")"]})]})]});var isActiveGroupTab},TabContentContainer_TabContentContainer=TabContentContainer;TabContentContainer.__docgenInfo={description:"",methods:[],displayName:"TabContentContainer",props:{isVoteStatisticsTabActive:{required:!0,tsType:{name:"boolean"},description:""}}};const TabContentContainer_stories={title:"TabContentContainer",component:TabContentContainer_TabContentContainer},투표_통계={args:{isVoteStatisticsTabActive:!0}},투표_현황={args:{isVoteStatisticsTabActive:!1}},__namedExportsOrder=["투표_통계","투표_현황"];투표_통계.parameters={...투표_통계.parameters,docs:{...투표_통계.parameters?.docs,source:{originalSource:"{\n args: {\n isVoteStatisticsTabActive: true\n }\n}",...투표_통계.parameters?.docs?.source}}},투표_현황.parameters={...투표_현황.parameters,docs:{...투표_현황.parameters?.docs,source:{originalSource:"{\n args: {\n isVoteStatisticsTabActive: false\n }\n}",...투표_현황.parameters?.docs?.source}}}},"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _utils_error__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/utils/error.ts");const __WEBPACK_DEFAULT_EXPORT__={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.e({...apiError,status:response.status})}return response}catch(error){if(error instanceof _utils_error__WEBPACK_IMPORTED_MODULE_0__.e)throw error;throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.D}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/components/TopicContainer/TopicContainer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>TopicContainer_TopicContainer});var dist=__webpack_require__("./node_modules/react-router/dist/index.js");const topicContainerLayout={name:"1u3km2u",styles:"display:flex;flex-basis:20%;flex-direction:column;justify-content:center;align-items:center;gap:2rem"},categoryText={name:"ywz92v",styles:"font-weight:bold;font-size:1.2rem"},topicText={name:"1akzvke",styles:"font-weight:bold;font-size:1.6rem"};var routes=__webpack_require__("./src/constants/routes.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const TopicContainer=()=>{const location=(0,dist.zy)(),{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),isGamePage=location.pathname===routes.b.game(Number(roomId));return(0,emotion_react_jsx_runtime_browser_esm.FD)("section",{css:topicContainerLayout,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:categoryText,children:isGamePage&&balanceContent.category}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{css:topicText,children:balanceContent.question})]})},TopicContainer_TopicContainer=TopicContainer;TopicContainer.__docgenInfo={description:"",methods:[],displayName:"TopicContainer"}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}},"./src/recoil/atom.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{k:()=>roomUuidState,u:()=>memberInfoState});var recoil__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/recoil/es/index.js");const memberInfoState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"memberInfo",default:{memberId:null,nickname:null,isMaster:!1}}),roomUuidState=(0,recoil__WEBPACK_IMPORTED_MODULE_0__.eU)({key:"roomUuid",default:""})},"./src/utils/error.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>CustomError,D:()=>NetworkError});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 5초, 10초, 15초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":(module,__unused_webpack_exports,__webpack_require__)=>{var anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js");module.exports=function(iterator,fn,value,ENTRIES){try{return ENTRIES?fn(anObject(value)[0],value[1]):fn(value)}catch(error){iteratorClose(iterator,"throw",error)}}},"./node_modules/core-js/internals/create-iter-result-object.js":module=>{module.exports=function(value,done){return{value,done}}},"./node_modules/core-js/internals/define-built-ins.js":(module,__unused_webpack_exports,__webpack_require__)=>{var defineBuiltIn=__webpack_require__("./node_modules/core-js/internals/define-built-in.js");module.exports=function(target,src,options){for(var key in src)defineBuiltIn(target,key,src[key],options);return target}},"./node_modules/core-js/internals/iterator-create-proxy.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),create=__webpack_require__("./node_modules/core-js/internals/object-create.js"),createNonEnumerableProperty=__webpack_require__("./node_modules/core-js/internals/create-non-enumerable-property.js"),defineBuiltIns=__webpack_require__("./node_modules/core-js/internals/define-built-ins.js"),wellKnownSymbol=__webpack_require__("./node_modules/core-js/internals/well-known-symbol.js"),InternalStateModule=__webpack_require__("./node_modules/core-js/internals/internal-state.js"),getMethod=__webpack_require__("./node_modules/core-js/internals/get-method.js"),IteratorPrototype=__webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype,createIterResultObject=__webpack_require__("./node_modules/core-js/internals/create-iter-result-object.js"),iteratorClose=__webpack_require__("./node_modules/core-js/internals/iterator-close.js"),TO_STRING_TAG=wellKnownSymbol("toStringTag"),setInternalState=InternalStateModule.set,createIteratorProxyPrototype=function(IS_ITERATOR){var getInternalState=InternalStateModule.getterFor(IS_ITERATOR?"WrapForValidIterator":"IteratorHelper");return defineBuiltIns(create(IteratorPrototype),{next:function next(){var state=getInternalState(this);if(IS_ITERATOR)return state.nextHandler();try{var result=state.done?void 0:state.nextHandler();return createIterResultObject(result,state.done)}catch(error){throw state.done=!0,error}},return:function(){var state=getInternalState(this),iterator=state.iterator;if(state.done=!0,IS_ITERATOR){var returnMethod=getMethod(iterator,"return");return returnMethod?call(returnMethod,iterator):createIterResultObject(void 0,!0)}if(state.inner)try{iteratorClose(state.inner.iterator,"normal")}catch(error){return iteratorClose(iterator,"throw",error)}return iteratorClose(iterator,"normal"),createIterResultObject(void 0,!0)}})},WrapForValidIteratorPrototype=createIteratorProxyPrototype(!0),IteratorHelperPrototype=createIteratorProxyPrototype(!1);createNonEnumerableProperty(IteratorHelperPrototype,TO_STRING_TAG,"Iterator Helper"),module.exports=function(nextHandler,IS_ITERATOR){var IteratorProxy=function Iterator(record,state){state?(state.iterator=record.iterator,state.next=record.next):state=record,state.type=IS_ITERATOR?"WrapForValidIterator":"IteratorHelper",state.nextHandler=nextHandler,state.counter=0,state.done=!1,setInternalState(this,state)};return IteratorProxy.prototype=IS_ITERATOR?WrapForValidIteratorPrototype:IteratorHelperPrototype,IteratorProxy}},"./node_modules/core-js/internals/iterator-map.js":(module,__unused_webpack_exports,__webpack_require__)=>{var call=__webpack_require__("./node_modules/core-js/internals/function-call.js"),aCallable=__webpack_require__("./node_modules/core-js/internals/a-callable.js"),anObject=__webpack_require__("./node_modules/core-js/internals/an-object.js"),getIteratorDirect=__webpack_require__("./node_modules/core-js/internals/get-iterator-direct.js"),createIteratorProxy=__webpack_require__("./node_modules/core-js/internals/iterator-create-proxy.js"),callWithSafeIterationClosing=__webpack_require__("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),IteratorProxy=createIteratorProxy((function(){var iterator=this.iterator,result=anObject(call(this.next,iterator));if(!(this.done=!!result.done))return callWithSafeIterationClosing(iterator,this.mapper,[result.value,this.counter++],!0)}));module.exports=function map(mapper){return anObject(this),aCallable(mapper),new IteratorProxy(getIteratorDirect(this),{mapper})}},"./node_modules/core-js/modules/esnext.iterator.map.js":(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{var $=__webpack_require__("./node_modules/core-js/internals/export.js"),map=__webpack_require__("./node_modules/core-js/internals/iterator-map.js");$({target:"Iterator",proto:!0,real:!0,forced:__webpack_require__("./node_modules/core-js/internals/is-pure.js")},{map})},"./src/assets/images/sillyDdangkong.png":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=__webpack_require__.p+"static/media/sillyDdangkong.301fa659.png"}}]); \ No newline at end of file diff --git a/storybook/components-TabContentContainer-TabContentContainer-stories.62fb07fa.iframe.bundle.js b/storybook/components-TabContentContainer-TabContentContainer-stories.62fb07fa.iframe.bundle.js new file mode 100644 index 000000000..ef348ac50 --- /dev/null +++ b/storybook/components-TabContentContainer-TabContentContainer-stories.62fb07fa.iframe.bundle.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[867],{"./src/components/TabContentContainer/TabContentContainer.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>TabContentContainer_stories,그룹_탭:()=>그룹_탭,전체_탭:()=>전체_탭});var dist=__webpack_require__("./node_modules/react-router/dist/index.js"),emotion_react_browser_esm=__webpack_require__("./node_modules/@emotion/react/dist/emotion-react.browser.esm.js"),Theme=__webpack_require__("./src/styles/Theme.ts");const contentWrapperStyle=(0,emotion_react_browser_esm.AH)("display:flex;flex-direction:column;justify-content:center;gap:3.2rem;height:100%;padding:2.4rem;border:0.3rem solid ",Theme.S.color.peanut400,";border-radius:0.8rem;",""),alertText=isGroupTabActive=>(0,emotion_react_browser_esm.AH)("display:flex;visibility:",isGroupTabActive?"hidden":"visible",";justify-content:center;align-items:center;width:100%;",Theme.S.typography.body2," font-weight:bold;",""),roundVoteResultContainer={name:"4zk4ri",styles:"display:flex;flex-direction:column;gap:1rem"},categoryContainer={name:"s4usvj",styles:"display:flex;justify-content:space-between;gap:0.8rem;font-weight:bold;font-size:1.4rem"},barWrapperStyle={name:"9kcjqh",styles:"display:flex;overflow:hidden;align-items:center;width:inherit;border-radius:1.6rem"},barWrapper={name:"zur63y",styles:"display:flex;justify-content:center;align-items:center;height:8vh;color:black;font-weight:bold;font-size:1.6rem;transition:all 1s"},firstBar=(percent,isBigFirstOption)=>(0,emotion_react_browser_esm.AH)(barWrapper," overflow:hidden;width:",percent,"%;border-radius:1.6rem 0 0 1.6rem;background-color:",isBigFirstOption?Theme.S.color.peanut400:Theme.S.color.gray,";transform:translateX(5px);clip-path:",100===percent?"none":"polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%)",";",""),secondBar=(percent,isBigFirstOption)=>(0,emotion_react_browser_esm.AH)(barWrapper," overflow:hidden;width:",percent,"%;border-radius:0 1.6rem 1.6rem 0;background-color:",isBigFirstOption?Theme.S.color.gray:Theme.S.color.peanut400,";transform:translateX(-5px);clip-path:",100===percent?"none":"polygon(10px 0, 100% 0, 100% 100%, 0 100%)",";",""),noVoteTextContainer={name:"zigog8",styles:"display:flex;flex-direction:column;align-items:center"},noVoteText=(0,emotion_react_browser_esm.AH)("display:flex;justify-content:center;align-items:center;height:8vh;",Theme.S.typography.headline3,";",""),angryImage={name:"ne5uve",styles:"width:16rem;height:14rem"},currentVoteButtonWrapper=isGroupTabActive=>(0,emotion_react_browser_esm.AH)("display:flex;visibility:",isGroupTabActive?"visible":"hidden",";justify-content:flex-end;align-items:center;",""),buttonStyle={name:"ubi0jc",styles:"color:black;font-weight:bold"};var react=__webpack_require__("./node_modules/react/index.js");const hooks_useCountAnimation=({target,start=50,duration=2e3})=>{const[count,setCount]=(0,react.useState)(start);return(0,react.useEffect)((()=>{if(void 0===target||target===start)return;const totalFrame=Math.round(duration/8.333333333333334);let currentNumber=start;const counter=setInterval((()=>{const progress=1===(timingRate=++currentNumber/totalFrame)?1:1-Math.pow(2,-10*timingRate);var timingRate;setCount(Math.round(target*progress)),1===progress&&clearInterval(counter)}),8.333333333333334);return()=>clearInterval(counter)}),[target,start,duration]),count},RoundVoteContainer_hook=(groupRoundResult,totalResult)=>({animatedFirstPercent:hooks_useCountAnimation({target:groupRoundResult?.firstOption.percent}),animatedSecondPercent:hooks_useCountAnimation({target:groupRoundResult?.secondOption.percent}),animatedTotalFirstPercent:hooks_useCountAnimation({target:totalResult?.firstOption.percent}),animatedTotalSecondPercent:hooks_useCountAnimation({target:totalResult?.secondOption.percent})}),angryDdangkong_namespaceObject=__webpack_require__.p+"static/media/angryDdangkong.b55fdd75.png";var routes=__webpack_require__("./src/constants/routes.ts"),useBalanceContentQuery=__webpack_require__("./src/hooks/useBalanceContentQuery.ts"),useQuery=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useQuery.js"),balanceContent=__webpack_require__("./src/apis/balanceContent.ts"),config=__webpack_require__("./src/constants/config.ts"),queryKeys=__webpack_require__("./src/constants/queryKeys.ts");const hooks_useMyGameStatusQuery=({roomId,currentRound})=>{const myGameStatusQuery=(0,useQuery.I)({queryKey:[queryKeys.e.myGameStatus,roomId,currentRound],queryFn:()=>{if(!currentRound)throw new Error("balanceContent 가 존재하지 않습니다.");return(0,balanceContent.bR)({roomId,currentRound})},enabled:!!currentRound,refetchInterval:query=>!(query.state.error&&query.state.fetchFailureCount>=config.A3)&&config.S2,refetchIntervalInBackground:!0,gcTime:0});return{...myGameStatusQuery,isRoundFinished:myGameStatusQuery.data?.isRoundFinished,isGameFinished:myGameStatusQuery.data?.isGameFinished}},hooks_useMyGameStatus=({roomId})=>{const navigate=(0,dist.Zp)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{isRoundFinished,isGameFinished}=hooks_useMyGameStatusQuery({roomId:Number(roomId),currentRound:balanceContent?.currentRound});(0,react.useEffect)((()=>{isGameFinished&&navigate(routes.b.gameResult(Number(roomId))),isRoundFinished&&navigate(routes.b.game(Number(roomId)))}),[isRoundFinished,isGameFinished])},roundVoteResultInitialValue_namespaceObject=JSON.parse('{"group":{"firstOption":{"optionId":1,"name":"Loading...","members":[],"memberCount":0,"percent":50},"secondOption":{"optionId":2,"name":"Loading...","members":[],"memberCount":0,"percent":50},"giveUp":{"members":[],"memberCount":0}},"total":{"firstOption":{"optionId":1,"name":"Loading...","percent":50},"secondOption":{"optionId":2,"name":"Loading...","percent":50}}}'),hooks_useRoundVoteResultQuery=({roomId,contentId})=>{const roundVoteResultQuery=(0,useQuery.I)({queryKey:[queryKeys.e.roundVoteResult,roomId,contentId],queryFn:async()=>{if(void 0===contentId)throw new Error("contentId 가 존재하지 않습니다.");if(void 0===roomId)throw new Error("방이 존재하지 않습니다.");return await(0,balanceContent.O)({roomId,contentId})},placeholderData:roundVoteResultInitialValue_namespaceObject,enabled:!!contentId});return{...roundVoteResultQuery,groupRoundResult:roundVoteResultQuery.data?.group,totalResult:roundVoteResultQuery.data?.total}};var emotion_react_jsx_runtime_browser_esm=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const isGroup=value=>"memberCount"in value.firstOption,TabContentContainer=({isGroupTabActive})=>{const navigate=(0,dist.Zp)(),{roomId}=(0,dist.g)(),{balanceContent}=(0,useBalanceContentQuery.A)(Number(roomId)),{groupRoundResult,totalResult}=hooks_useRoundVoteResultQuery({roomId:Number(roomId),contentId:balanceContent?.contentId});hooks_useMyGameStatus({roomId:Number(roomId)});const{animatedFirstPercent,animatedSecondPercent,animatedTotalFirstPercent,animatedTotalSecondPercent}=RoundVoteContainer_hook(groupRoundResult,totalResult),roundResult=isGroupTabActive?groupRoundResult:totalResult,isBigFirstOption=roundResult&&roundResult.firstOption.percent>=50,isVote=0!==roundResult?.firstOption.percent||0!==roundResult?.secondOption.percent;return roundResult?(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:contentWrapperStyle,children:isVote?(0,emotion_react_jsx_runtime_browser_esm.FD)(emotion_react_jsx_runtime_browser_esm.FK,{children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:alertText(isGroupTabActive),children:"다른 사람들은 이렇게 생각했어요 🥜"}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:roundVoteResultContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:categoryContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{children:roundResult.firstOption.name}),(0,emotion_react_jsx_runtime_browser_esm.Y)("span",{children:roundResult.secondOption.name})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:barWrapperStyle,children:[(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:firstBar(roundResult.firstOption.percent,isBigFirstOption),children:[isGroup(roundResult)?animatedFirstPercent:animatedTotalFirstPercent,"%"]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:secondBar(roundResult.secondOption.percent,isBigFirstOption),children:[isGroup(roundResult)?animatedSecondPercent:animatedTotalSecondPercent,"%"]})]}),(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:(isActiveGroupTab=isGroupTabActive,(0,emotion_react_browser_esm.AH)("display:flex;visibility:",isActiveGroupTab?"visible":"hidden",";justify-content:space-between;align-items:center;height:1.2rem;font-weight:bold;font-size:1.2rem;","")),children:[isGroup(roundResult)&&(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{children:[roundResult.firstOption.memberCount,"명"]}),isGroup(roundResult)&&(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{children:[roundResult.secondOption.memberCount,"명"]})]})]}),(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{css:currentVoteButtonWrapper(isGroupTabActive),children:(0,emotion_react_jsx_runtime_browser_esm.FD)("button",{css:buttonStyle,onClick:()=>{navigate(routes.b.roundResultStatus(Number(roomId)))},children:["투표 현황 ",">"]})})]}):(0,emotion_react_jsx_runtime_browser_esm.FD)("div",{css:noVoteTextContainer,children:[(0,emotion_react_jsx_runtime_browser_esm.Y)("img",{src:angryDdangkong_namespaceObject,alt:"화난 땅콩",css:angryImage}),(0,emotion_react_jsx_runtime_browser_esm.FD)("span",{css:noVoteText,children:["아무도 투표하지 않으셨네요 :",")"]})]})}):(0,emotion_react_jsx_runtime_browser_esm.Y)("div",{children:"데이터가 없습니다"});var isActiveGroupTab},TabContentContainer_TabContentContainer=TabContentContainer;TabContentContainer.__docgenInfo={description:"",methods:[],displayName:"TabContentContainer",props:{isGroupTabActive:{required:!0,tsType:{name:"boolean"},description:""}}};const TabContentContainer_stories={title:"TabContentContainer",component:TabContentContainer_TabContentContainer},그룹_탭={args:{isGroupTabActive:!0}},전체_탭={args:{isGroupTabActive:!1}},__namedExportsOrder=["그룹_탭","전체_탭"];그룹_탭.parameters={...그룹_탭.parameters,docs:{...그룹_탭.parameters?.docs,source:{originalSource:"{\n args: {\n isGroupTabActive: true\n }\n}",...그룹_탭.parameters?.docs?.source}}},전체_탭.parameters={...전체_탭.parameters,docs:{...전체_탭.parameters?.docs,source:{originalSource:"{\n args: {\n isGroupTabActive: false\n }\n}",...전체_탭.parameters?.docs?.source}}}},"./node_modules/@tanstack/react-query/build/modern/useQuery.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>useQuery});var _tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@tanstack/query-core/build/modern/queryObserver.js"),_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useBaseQuery.js");function useQuery(options,queryClient){return(0,_useBaseQuery_js__WEBPACK_IMPORTED_MODULE_0__.t)(options,_tanstack_query_core__WEBPACK_IMPORTED_MODULE_1__.$,queryClient)}},"./src/apis/balanceContent.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Gd:()=>fetchBalanceContent,O:()=>fetchRoundVoteResult,bR:()=>checkMyGameStatus,jd:()=>fetchVoteIsFinished,sl:()=>voteBalanceContent});var _fetcher__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/fetcher.ts"),_constants_url__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/url.ts");const fetchBalanceContent=async roomId=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.balanceContent(roomId)});return await res.json()},voteBalanceContent=async({optionId,contentId,roomId,memberId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.post({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.vote(roomId,contentId),headers:{"Content-Type":"application/json"},body:{memberId,optionId}});return await res.json()},fetchRoundVoteResult=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.roundVoteResult(roomId,contentId)});return await res.json()},checkMyGameStatus=async({roomId,currentRound})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.myGameStatus(roomId,currentRound),headers:{"Content-Type":"application/json"}});return await res.json()},fetchVoteIsFinished=async({contentId,roomId})=>{const res=await _fetcher__WEBPACK_IMPORTED_MODULE_0__.A.get({url:_constants_url__WEBPACK_IMPORTED_MODULE_1__.H$.voteIsFinished(roomId,contentId)});return await res.json()}},"./src/apis/fetcher.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _utils_error__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/utils/error.ts");const __WEBPACK_DEFAULT_EXPORT__={async request({url,method,body,headers}){try{const response=await fetch(url,{method,body:body&&JSON.stringify(body),headers:headers&&headers});if(!response.ok){const apiError=await response.json();throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.e({...apiError,status:response.status})}return response}catch(error){if(error instanceof _utils_error__WEBPACK_IMPORTED_MODULE_0__.e)throw error;throw new _utils_error__WEBPACK_IMPORTED_MODULE_0__.D}},get({url,headers}){return this.request({url,method:"GET",headers})},post({url,body,headers}){return this.request({url,method:"POST",body,headers})},delete({url,headers}){return this.request({url,method:"DELETE",headers})},patch({url,body,headers}){return this.request({url,method:"PATCH",body,headers})},put({url,headers}){return this.request({url,method:"PUT",headers})}}},"./src/constants/queryKeys.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>QUERY_KEYS});const QUERY_KEYS={balanceContent:"balanceContent",matchingResult:"matchingResult",roundVoteResult:"roundVoteResult",myGameStatus:"myGameStatus",roundIsFinished:"roundIsFinished",roomMembers:"roomMembers",isRoomInitial:"isRoomInitial",categoryList:"categoryList"}},"./src/constants/routes.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{b:()=>ROUTES});const ROUTES={main:"/",nickname:"/nickname",ready:roomId=>`/${roomId}/ready`,game:roomId=>`/${roomId}/game`,roundResult:roomId=>`/${roomId}/round/result`,roundResultVote:"/round/result/vote",gameResult:roomId=>`/${roomId}/game/result`,roundResultStatus:roomId=>`/${roomId}/round/result/status`}},"./src/hooks/useBalanceContentQuery.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js"),_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./src/apis/balanceContent.ts"),_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/constants/queryKeys.ts");const __WEBPACK_DEFAULT_EXPORT__=roomId=>{const balanceContentQuery=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.U)({queryKey:[_constants_queryKeys__WEBPACK_IMPORTED_MODULE_1__.e.balanceContent,Number(roomId)],queryFn:async()=>await(0,_apis_balanceContent__WEBPACK_IMPORTED_MODULE_0__.Gd)(Number(roomId))});return{...balanceContentQuery,balanceContent:balanceContentQuery.data}}},"./src/utils/error.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{e:()=>CustomError,D:()=>NetworkError});const ERROR_MESSAGE={NOT_READY_ROOM:"해당 방의 게임이 이미 시작되었어요. 게임이 끝날 때까지 기다려볼까요?",NOT_PROGRESSED_ROOM:"이미 게임이 종료되었어요. 최종 결과를 확인해볼까요?",NOT_FINISHED_ROOM:"해당 방의 게임이 아직 종료되지 않았어요.",NOT_FOUND_ROOM:"해당 방을 찾을 수 없어요. 방을 새로 만들어주세요!",NOT_ROOM_MEMBER:"사용자가 해당 방에 존재하지 않아요. 다시 접속해볼까요?",EXCEED_MAX_MEMBER_COUNT:"방의 최대 인원을 초과했습니다.",ALREADY_EXIST_MASTER:"이미 방장이 존재합니다.",ALREADY_MASTER:"해당 멤버는 이미 방장입니다.",INVALID_MASTER_CREATION:"방에 멤버가 존재하면 방장을 생성할 수 없습니다.",NOT_EXIST_MASTER:"방장이 존재하지 않습니다.",NOT_EXIST_COMMON:"일반 멤버가 존재하지 않습니다.",INVALID_TIME_LIMIT:"타이머는 5초, 10초, 15초로만 설정 가능합니다.",INVALID_RANGE_TOTAL_ROUND:"총 라운드는 5, 7, 10 라운드로만 설정 가능합니다.",EMPTY_VOTE_DEADLINE:"라운드 종료 시간이 설정되지 않았습니다.",MISMATCH_ROUND:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",ROUND_LESS_THAN_START_ROUND:"startRound보다 크거나 같아야 합니다.",ROUND_GREATER_THAN_CURRENT_ROUND:"currentRound보다 작거나 같아야 합니다.",INVALID_ROUND_GAP:"currentRound과 round의 차이는 ?이하여야 합니다.",NOT_FOUND_BALANCE_CONTENT:"존재하지 않는 컨텐츠네요. 게임을 다시 진행해주세요!",NOT_FOUND_ROOM_CONTENT:"해당 방에 존재하지 않은 컨텐츠입니다. 게임을 다시 진행해주세요!",NO_RESOURCE_FOUND:"요청한 리소스를 찾을 수 없습니다. 게임을 다시 진행해주세요!",NOT_FOUND_BALANCE_OPTION:"옵션을 올바르게 선택해주세요.",ALREADY_VOTED:"이미 투표가 반영되었어요. 해당 라운드가 끝날 때까지 기다려볼까요?",VOTE_FINISHED:"투표가 이미 종료되었어요.",VOTE_NOT_FINISHED:"이미 다음 라운드가 시작되었어요. 해당 라운드가 끝날 때까지 잠시만 기다려주세요!",CAN_NOT_CHECK_MATCHING_PERCENT:"종료되지 않은 방의 투표 매칭도는 확인할 수 없습니다.",FIELD_ERROR:"필드값 입력이 잘못되었습니다.",URL_PARAMETER_ERROR:"URL parameter 입력이 잘못되었습니다.",METHOD_ARGUMENT_TYPE_MISMATCH:"입력한 값의 타입이 잘못되었습니다.",METHOD_NOT_SUPPORTED:"허용되지 않은 메서드입니다.",INTERNAL_SERVER_ERROR:"서버에 오류가 발생했어요. 다시 시도해 주세요!"};class CustomError extends Error{constructor({errorCode,status}){super(),this.errorCode=errorCode,this.message=ERROR_MESSAGE[errorCode],this.status=status}}class NetworkError extends Error{status=555;message="네트워크가 불안정해요. 다시 시도해주세요!"}}}]); \ No newline at end of file diff --git a/storybook/components-common-AlertModal-AlertModal-stories.2d411958.iframe.bundle.js b/storybook/components-common-AlertModal-AlertModal-stories.2d411958.iframe.bundle.js deleted file mode 100644 index f90852c1f..000000000 --- a/storybook/components-common-AlertModal-AlertModal-stories.2d411958.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkddangkong_frontend=self.webpackChunkddangkong_frontend||[]).push([[979],{"./src/components/common/AlertModal/AlertModal.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__,기본_알림_모달:()=>기본_알림_모달});var _storybook_test__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@storybook/test/dist/index.mjs"),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/index.js"),_AlertModal__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/common/AlertModal/AlertModal.tsx"),_Button_Button__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/common/Button/Button.tsx"),_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js");const __WEBPACK_DEFAULT_EXPORT__={title:"modal/AlertModal",component:_AlertModal__WEBPACK_IMPORTED_MODULE_2__.A,args:{onClose:(0,_storybook_test__WEBPACK_IMPORTED_MODULE_0__.fn)()}},기본_알림_모달={render:()=>{const[isOpen,setIsOpen]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!0);return(0,_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.FD)(_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.FK,{children:[(0,_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Y)(_Button_Button__WEBPACK_IMPORTED_MODULE_3__.A,{text:"알림 모달 열기",onClick:()=>setIsOpen(!0)}),(0,_emotion_react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Y)(_AlertModal__WEBPACK_IMPORTED_MODULE_2__.A,{isOpen,onClose:()=>setIsOpen(!1),title:"알림 모달 제목",message:"에러 메세지 발생!!!\n다시 시도해주세요!"})]})}},__namedExportsOrder=["기본_알림_모달"];기본_알림_모달.parameters={...기본_알림_모달.parameters,docs:{...기본_알림_모달.parameters?.docs,source:{originalSource:'{\n render: () => {\n const [isOpen, setIsOpen] = useState(true);\n return <>\n