{"version":3,"file":"SubscriptionButton.CvrYBmvK.mjs","names":["forwardRef","useCallback"],"sources":["https:/asset.29cm.co.kr/contents/framer/components/@shared/SwitchButton/SwitchButton.js","https:/asset.29cm.co.kr/contents/framer/hooks/fetchers/useFetchSubscriptions.js","https:/asset.29cm.co.kr/contents/framer/hooks/useRequestSubscription.js","https:/asset.29cm.co.kr/contents/framer/node_modules/lodash-es/throttle.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/SubscriptionButton/SubscriptionButton.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/SubscriptionButton/SubscriptionButton.js"],"sourcesContent":["import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from \"react\";\nimport \"framer\";\nimport { typography } from \"../../../styles/typography.js\";\nimport { playHaptic } from \"../../../utils/playHaptic.js\";\nconst SwitchButton = forwardRef(({\n  children,\n  style,\n  theme = \"light\",\n  active = false,\n  activeColor,\n  onClick,\n  ...rest\n}) => {\n  const {\n    button,\n    thumb\n  } = getSwitchButtonColors(activeColor)[theme][active ? \"active\" : \"default\"];\n  const handleClick = (e) => {\n    playHaptic(\"rigid\");\n    onClick == null ? void 0 : onClick(e);\n  };\n  return /* @__PURE__ */ jsxs(\"div\", { style: {\n    ...containerStyle,\n    ...style\n  }, ...rest, onClick: handleClick, children: [\n    children ? /* @__PURE__ */ jsx(\"div\", { style: {\n      ...labelStyle,\n      ...labelStyleByTheme[theme]\n    }, children }) : null,\n    /* @__PURE__ */ jsx(\"div\", { style: {\n      ...buttonStyle,\n      backgroundColor: button\n    }, children: /* @__PURE__ */ jsx(\"div\", { style: {\n      ...thumbStyle,\n      backgroundColor: thumb,\n      left: active ? 18 : 2\n    } }) })\n  ] });\n});\nconst getSwitchButtonColors = (activeColor) => ({\n  light: {\n    default: {\n      button: \"#E4E4E4\",\n      thumb: \"#FFFFFF\"\n    },\n    active: {\n      button: activeColor || \"#1E3CF2\",\n      thumb: \"#FFFFFF\"\n    }\n  },\n  dark: {\n    default: {\n      button: \"#27272A\",\n      thumb: \"#A0A0A0\"\n    },\n    active: {\n      button: activeColor || \"#1E3CF2\",\n      thumb: \"#FFFFFF\"\n    }\n  }\n});\nconst containerStyle = {\n  display: \"flex\",\n  alignItems: \"center\",\n  cursor: \"pointer\"\n};\nconst labelStyle = {\n  ...typography(15, 400),\n  paddingRight: 8\n};\nconst labelStyleByTheme = {\n  light: {\n    color: \"#000000\"\n  },\n  dark: {\n    color: \"#A0A0A0\"\n  }\n};\nconst buttonStyle = {\n  position: \"relative\",\n  width: 38,\n  height: 22,\n  padding: 2,\n  borderRadius: 999,\n  transition: \"background-color 0.15s ease-in-out\"\n};\nconst thumbStyle = {\n  position: \"absolute\",\n  top: \"50%\",\n  transform: \"translateY(-50%)\",\n  width: 18,\n  height: 18,\n  borderRadius: 999,\n  transition: \"background-color 0.15s ease-in-out, left 0.15s ease-in-out\"\n};\nexport {\n  SwitchButton\n};\n","import useSWR from \"../../node_modules/swr/core/dist/index.js\";\nimport { subscriptionApi } from \"../../apis/subscription/SubscriptionApiService.js\";\nimport { useCurrentUser } from \"../useCurrentUser.js\";\nconst SUBSCRIPTIONS_FETCHER_KEY = \"@subscription/list\";\nconst useFetchSubscriptions = (eventKey, groupKey, enabled = true) => {\n  const {\n    logged\n  } = useCurrentUser();\n  const canFetch = groupKey !== \"\" && logged && enabled;\n  const {\n    data,\n    isLoading,\n    ...rest\n  } = useSWR(canFetch ? [SUBSCRIPTIONS_FETCHER_KEY, groupKey ? groupKey : eventKey] : null, () => groupKey ? subscriptionApi.getSubscriptionsByGroupKey(groupKey) : subscriptionApi.getSubscription(eventKey));\n  return {\n    isLoading: isLoading || !canFetch,\n    subscriptions: data ?? [],\n    ...rest\n  };\n};\nexport {\n  SUBSCRIPTIONS_FETCHER_KEY,\n  useFetchSubscriptions\n};\n","import { subscriptionApi } from \"../apis/subscription/SubscriptionApiService.js\";\nimport { useFetchSubscriptions } from \"./fetchers/useFetchSubscriptions.js\";\nimport { shallowUnique } from \"../utils/unique.js\";\nconst useRequestSubscription = (eventKey, groupKey, enabled = true) => {\n  const {\n    subscriptions,\n    mutate\n  } = useFetchSubscriptions(eventKey, groupKey, enabled);\n  const filterSubscription = (incoming) => subscriptions.filter((subscription) => subscription !== incoming);\n  const subscribeMutator = async (incoming) => {\n    const result = await subscriptionApi.subscribe(incoming);\n    return shallowUnique([...subscriptions, ...result]);\n  };\n  const unsubscribeMutator = async (incoming) => {\n    const result = await subscriptionApi.unsubscribe(incoming);\n    return filterSubscription(result);\n  };\n  const requestSubscribe = (incoming) => mutate(subscribeMutator(incoming), {\n    optimisticData: shallowUnique([...subscriptions, ...incoming]),\n    rollbackOnError: true,\n    populateCache: true,\n    revalidate: false\n  });\n  const requestUnsubscribe = (incoming) => mutate(unsubscribeMutator(incoming), {\n    optimisticData: filterSubscription(incoming),\n    rollbackOnError: true,\n    populateCache: true,\n    revalidate: false\n  });\n  return {\n    subscriptions,\n    requestSubscribe,\n    requestUnsubscribe\n  };\n};\nexport {\n  useRequestSubscription\n};\n","import debounce from \"./debounce.js\";\nimport isObject from \"./isObject.js\";\nvar FUNC_ERROR_TEXT = \"Expected a function\";\nfunction throttle(func, wait, options) {\n  var leading = true, trailing = true;\n  if (typeof func != \"function\") {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  if (isObject(options)) {\n    leading = \"leading\" in options ? !!options.leading : leading;\n    trailing = \"trailing\" in options ? !!options.trailing : trailing;\n  }\n  return debounce(func, wait, {\n    \"leading\": leading,\n    \"maxWait\": wait,\n    \"trailing\": trailing\n  });\n}\nexport {\n  throttle as default\n};\n","import { useCallback } from \"react\";\nimport { useNotificationAgreementsToast } from \"../../../@shared/toasts/NotificationAgreementsToast/NotificationAgreementsToast.hooks.js\";\nimport \"../../../../node_modules/@firebase/analytics/dist/esm/index.esm2017.js\";\nimport \"../../../../node_modules/firebase/app/dist/esm/index.esm.js\";\nimport \"../../../../node_modules/swr/core/dist/index.js\";\nimport \"../../../../apis/user-segment/CategoryFirstOrderApiService.js\";\nimport \"../../../../config/index.js\";\nimport \"../../../../apis/taste-sharing/TasteSharingApiService.js\";\nimport \"../../../../node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js\";\nimport \"../../../../node_modules/js-cookie/dist/js.cookie.js\";\nimport \"../../../../apis/preuser/PreuserApiService.js\";\nimport \"framer\";\nimport \"../../../../node_modules/@29cm/snowplow/dist/esm/core/snowplow.js\";\nimport \"../../../../node_modules/swr/mutation/dist/index.js\";\nimport \"../../../../hooks/stores/content/content.store.js\";\nimport \"../../../../hooks/stores/dialog/dialog.store.js\";\nimport \"../../../../hooks/stores/global-layout/global-layout.store.js\";\nimport \"../../../../hooks/stores/toast/toast.store.js\";\nimport \"../../../@shared/providers/ThemeProvider/ThemeProvider.js\";\nimport \"../../../@shared/providers/BreakpointProvider/BreakpointProvider.js\";\nimport \"../../../../hooks/stores/bottom-sheet/bottom-sheet.store.js\";\nimport { useDialog } from \"../../../../hooks/useDialog.js\";\nimport \"framer-motion\";\nimport { useEventCallback } from \"../../../../hooks/useEventCallback.js\";\nimport \"../../../../utils/redirectLogin.js\";\nimport \"react/jsx-runtime\";\nimport \"../../../../utils/event-properties/source.js\";\nimport { useWithLogin } from \"../../../../hooks/useWithLogin.js\";\nimport { useNotificationRequirements } from \"../../../../hooks/useNotificationRequirements.js\";\nimport { useRequestSubscription } from \"../../../../hooks/useRequestSubscription.js\";\nimport { useRequestUserAgreementBottomSheet } from \"../../../../hooks/useRequestUserAgreementBottomSheet.js\";\nimport { useWithApp } from \"../../../../hooks/useWithApp.js\";\nimport { useComponentId, FALLBACK_COMPONENT_ID } from \"../EventTrackingProvider/EventTrackingProvider.hooks.js\";\nimport \"../EventTrackingProvider/EventTrackingProvider.js\";\nimport { useTrackSnowplowEvent } from \"../../../../hooks/snowplow/useTrackSnowplowEvent.js\";\nimport throttle from \"../../../../node_modules/lodash-es/throttle.js\";\nconst SUBSCRIPTION_MESSAGES = {\n  ACCESS_FROM_APP: \"알림 신청 기능은 APP에서만 사용할 수 있어요\\nAPP에서 다시 시도해 주세요.\",\n  SUBSCRIBED: \"알림 설정이 완료되었습니다.\",\n  UNSUBSCRIBED: \"알림 설정이 취소되었습니다.\",\n  ERROR_WHILE_SUBSCRIBE: \"일시적인 오류로 알림 취소에 실패했습니다.\",\n  ERROR_WHILE_UNSUBSCRIBE: \"일시적인 오류로 알림 설정에 실패했습니다.\"\n};\nconst createSubscriptionStorageKey = (key) => `subscription-requirements-viewed-${key}`;\nconst useHandleSubscription = ({\n  sectionKey,\n  groupKey,\n  eventKey,\n  restEventKeys\n}, enabled = true) => {\n  const {\n    subscriptions,\n    requestSubscribe,\n    requestUnsubscribe\n  } = useRequestSubscription(eventKey, groupKey, enabled);\n  const componentId = useComponentId();\n  const trackSnowplowEvent = useTrackSnowplowEvent();\n  const requestRequirements = useSubscriptionRequirements();\n  const requestBulkRequirements = useBulkSubscriptionRequirements();\n  const toast = useNotificationAgreementsToast();\n  const withLogin = useWithLogin();\n  const withApp = useWithApp({\n    content: SUBSCRIPTION_MESSAGES.ACCESS_FROM_APP\n  });\n  const isSubscribed = subscriptions.includes(eventKey);\n  const hasRestEventKeys = restEventKeys.length > 0;\n  const isBulkSubscriptionRequirementsViewed = () => {\n    return localStorage.get(createSubscriptionStorageKey(sectionKey), false) ?? false;\n  };\n  const markAsBulkSubscriptionRequirementsViewed = () => {\n    localStorage.set(createSubscriptionStorageKey(sectionKey), true);\n  };\n  const onErrorWhileSubscribe = (error) => {\n    switch (error) {\n      case \"REQUIREMENTS_CANCELED\":\n        return;\n      default:\n        toast.show(SUBSCRIPTION_MESSAGES.ERROR_WHILE_SUBSCRIBE, true);\n        return;\n    }\n  };\n  const subscribe = async () => {\n    try {\n      await requestRequirements();\n      await requestSubscribe([eventKey]);\n      if (componentId !== FALLBACK_COMPONENT_ID) {\n        trackSnowplowEvent(\"click_button\", {\n          section_name: componentId,\n          section_title: componentId,\n          position: -1,\n          layout_position: -1,\n          button_id: \"subscribe_notification\",\n          button_name: \"알림 받기\"\n        });\n      }\n      if (hasRestEventKeys && !isBulkSubscriptionRequirementsViewed()) {\n        markAsBulkSubscriptionRequirementsViewed();\n        await requestBulkRequirements();\n        await requestSubscribe([eventKey, ...restEventKeys]);\n        toast.show(SUBSCRIPTION_MESSAGES.SUBSCRIBED);\n      }\n    } catch (error) {\n      onErrorWhileSubscribe(error);\n    }\n  };\n  const unsubscribe = async () => {\n    try {\n      await requestUnsubscribe(eventKey);\n      toast.show(SUBSCRIPTION_MESSAGES.UNSUBSCRIBED, true);\n    } catch (error) {\n      toast.show(SUBSCRIPTION_MESSAGES.ERROR_WHILE_UNSUBSCRIBE, true);\n    }\n  };\n  const toggleSubscription = useEventCallback(async () => {\n    if (isSubscribed) {\n      await unsubscribe();\n    } else {\n      await subscribe();\n    }\n  });\n  const throttledToggleSubscription = useCallback(throttle(toggleSubscription, 200), []);\n  return {\n    isSubscribed,\n    toggleSubscription: withApp(withLogin(throttledToggleSubscription))\n  };\n};\nconst localStorage = {\n  get: (key, initialValue) => {\n    try {\n      const value = window.localStorage.getItem(key);\n      if (!value) {\n        return initialValue;\n      }\n      return JSON.parse(value);\n    } catch (error) {\n      return initialValue;\n    }\n  },\n  set: (key, value) => {\n    window.localStorage.setItem(key, JSON.stringify(value));\n  }\n};\nconst useBulkSubscriptionRequirements = () => {\n  const dialog = useDialog();\n  const request = () => {\n    return new Promise((resolve, reject) => {\n      dialog.show({\n        title: \"다른 날 소식도 알려드릴까요?\",\n        content: \"매일매일 새로운 회차가 오픈하는 시간에\\n가장 빠르게 알려드릴게요.\",\n        primaryButtonText: \"예\",\n        secondaryButtonText: \"아니오\",\n        needInAppLayer: false,\n        onPrimaryButtonClick: () => resolve(),\n        onSecondaryButtonClick: () => reject(\n          \"REQUIREMENTS_CANCELED\"\n          /* REQUIREMENTS_CANCELED */\n        )\n      });\n    });\n  };\n  return request;\n};\nconst useSubscriptionRequirements = () => {\n  const requestRequirements = useNotificationRequirements();\n  const {\n    isTargetAppVersion,\n    requestUserAgreementBottomSheet\n  } = useRequestUserAgreementBottomSheet();\n  const request = () => {\n    return new Promise((resolve, reject) => {\n      if (isTargetAppVersion) {\n        requestUserAgreementBottomSheet({\n          type: \"CONTENT_DETAIL_PAGE\",\n          onCancel: () => reject(\n            \"REQUIREMENTS_CANCELED\"\n            /* REQUIREMENTS_CANCELED */\n          ),\n          onConfirm: () => resolve()\n        });\n      } else {\n        requestRequirements({\n          apiEndpoint: \"content-detail-page\",\n          onNotificationEnabled: () => resolve(),\n          onNotificationAgreementsError: () => reject(\n            \"REQUIREMENTS_ERROR\"\n            /* REQUIREMENTS_ERROR */\n          ),\n          onNotificationAgreementsCancel: () => reject(\n            \"REQUIREMENTS_CANCELED\"\n            /* REQUIREMENTS_CANCELED */\n          ),\n          onNotificationDisabled: () => reject(\n            \"REQUIREMENTS_CANCELED\"\n            /* REQUIREMENTS_CANCELED */\n          )\n        });\n      }\n    });\n  };\n  return request;\n};\nexport {\n  useHandleSubscription\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { SwitchButton } from \"../../../@shared/SwitchButton/SwitchButton.js\";\nimport \"react\";\nimport \"../../../../node_modules/@firebase/analytics/dist/esm/index.esm2017.js\";\nimport \"../../../../node_modules/firebase/app/dist/esm/index.esm.js\";\nimport \"../../../../node_modules/swr/core/dist/index.js\";\nimport \"../../../../apis/user-segment/CategoryFirstOrderApiService.js\";\nimport \"../../../../config/index.js\";\nimport \"../../../../apis/taste-sharing/TasteSharingApiService.js\";\nimport \"../../../../node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js\";\nimport \"../../../../node_modules/js-cookie/dist/js.cookie.js\";\nimport \"../../../../apis/preuser/PreuserApiService.js\";\nimport { isCanvas } from \"../../../../utils/framer/isCanvas.js\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport \"../../../../node_modules/@29cm/snowplow/dist/esm/core/snowplow.js\";\nimport \"../../../../node_modules/swr/mutation/dist/index.js\";\nimport \"../../../../hooks/stores/content/content.store.js\";\nimport \"../../../../hooks/stores/dialog/dialog.store.js\";\nimport \"../../../../hooks/stores/global-layout/global-layout.store.js\";\nimport \"../../../../hooks/stores/toast/toast.store.js\";\nimport { useTheme } from \"../../../../hooks/useTheme.js\";\nimport \"../../../@shared/providers/BreakpointProvider/BreakpointProvider.js\";\nimport \"../../../../hooks/stores/bottom-sheet/bottom-sheet.store.js\";\nimport \"react-dom\";\nimport \"../../Dialog/Dialog.module.css.js\";\nimport \"framer-motion\";\nimport \"../../../../containers/DialogContainer/DialogContainer.emitter.js\";\nimport \"../../../../utils/redirectLogin.js\";\nimport \"../../../../utils/event-properties/source.js\";\nimport { useHandleSubscription } from \"./SubscriptionButton.hooks.js\";\nimport { ThemeProvider } from \"../../../@shared/providers/ThemeProvider/ThemeProvider.js\";\nimport { THEME_CONTROLS } from \"../../../../libs/property-controls/theme.js\";\nconst SubscriptionButton = ({\n  sectionKey = \"\",\n  activeColor,\n  eventKey,\n  restEventKeys = []\n}) => {\n  const theme = useTheme();\n  const {\n    isSubscribed,\n    toggleSubscription\n  } = useHandleSubscription({\n    sectionKey,\n    eventKey,\n    restEventKeys\n  });\n  const handleClick = () => {\n    toggleSubscription();\n  };\n  return /* @__PURE__ */ jsx(SwitchButton, { theme, active: isSubscribed || isCanvas(), activeColor, onClick: handleClick, children: \"알림 받기\" });\n};\nconst FramerSubscriptionButton = ({\n  theme,\n  ...rest\n}) => {\n  return /* @__PURE__ */ jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsx(SubscriptionButton, { ...rest }) });\n};\naddPropertyControls(FramerSubscriptionButton, {\n  ...THEME_CONTROLS,\n  activeColor: {\n    type: ControlType.Color,\n    title: \"활성화 상태 색상\",\n    description: \"버튼이 활성화 상태일 때의 색상 설정\",\n    optional: true\n  },\n  eventKey: {\n    type: ControlType.String,\n    title: \"알림 키\",\n    description: \"알림 기능을 활성화할 이벤트를 구분하기 위해 사전에 정의된 키를 입력합니다.\\n\\n키가 필요한 경우 전시콘텐츠팀에 문의해 주세요.\",\n    defaultValue: \"\"\n  }\n});\nexport {\n  FramerSubscriptionButton,\n  SubscriptionButton\n};\n"],"x_google_ignoreList":[3],"mappings":"61BAA8C,IACX,IACnB,KAC2C,KACD,CACpD,EAAeA,GAAY,CAC/B,WACA,QACA,QAAQ,QACR,SAAS,GACT,cACA,UACA,GAAG,KACC,CACJ,GAAM,CACJ,SACA,SACE,EAAsB,EAAY,CAAC,GAAO,EAAS,SAAW,WAC5D,EAAe,GAAM,CACzB,GAAW,QAAQ,CACnB,IAAmC,EAAE,EAEvC,OAAuB,EAAK,MAAO,CAAE,MAAO,CAC1C,GAAG,EACH,GAAG,EACJ,CAAE,GAAG,EAAM,QAAS,EAAa,SAAU,CAC1C,EAA2B,EAAI,MAAO,CAAE,MAAO,CAC7C,GAAG,EACH,GAAG,EAAkB,GACtB,CAAE,WAAU,CAAC,CAAG,KACD,EAAI,MAAO,CAAE,MAAO,CAClC,GAAG,EACH,gBAAiB,EAClB,CAAE,SAA0B,EAAI,MAAO,CAAE,MAAO,CAC/C,GAAG,EACH,gBAAiB,EACjB,KAAM,EAAS,GAAK,EACrB,CAAE,CAAC,CAAE,CAAC,CACR,CAAE,CAAC,EACJ,CACI,EAAyB,IAAiB,CAC9C,MAAO,CACL,QAAS,CACP,OAAQ,UACR,MAAO,UACR,CACD,OAAQ,CACN,OAAQ,GAAe,UACvB,MAAO,UACR,CACF,CACD,KAAM,CACJ,QAAS,CACP,OAAQ,UACR,MAAO,UACR,CACD,OAAQ,CACN,OAAQ,GAAe,UACvB,MAAO,UACR,CACF,CACF,EACK,EAAiB,CACrB,QAAS,OACT,WAAY,SACZ,OAAQ,UACT,CACK,EAAa,CACjB,GAAG,GAAW,GAAI,IAAI,CACtB,aAAc,EACf,CACK,EAAoB,CACxB,MAAO,CACL,MAAO,UACR,CACD,KAAM,CACJ,MAAO,UACR,CACF,CACK,EAAc,CAClB,SAAU,WACV,MAAO,GACP,OAAQ,GACR,QAAS,EACT,aAAc,IACd,W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