{"version":3,"file":"button.CDneWbwj.mjs","names":[],"sources":["https:/asset.29cm.co.kr/contents/framer/types/agreement.js","https:/asset.29cm.co.kr/contents/framer/apis/APIService.types.js","https:/asset.29cm.co.kr/contents/framer/apis/raffle/RaffleApiService.js","https:/asset.29cm.co.kr/contents/framer/libs/property-controls/button.js"],"sourcesContent":["var AgreementType = /* @__PURE__ */ ((AgreementType2) => {\n  AgreementType2[\"PersonalInformation\"] = \"PERSONAL_INFORMATION_AGREEMENT\";\n  AgreementType2[\"Privacy\"] = \"PRIVACY_AGREEMENT\";\n  AgreementType2[\"Advertising\"] = \"ADVERTISING_AGREEMENT\";\n  return AgreementType2;\n})(AgreementType || {});\nexport {\n  AgreementType\n};\n","var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n  __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n  return value;\n};\nclass APIError extends Error {\n  constructor(message, errorCode, data) {\n    super(message);\n    /** 서버에서 반환한 에러 코드 (예: 'COMMON_INVALID_PARAMETER') */\n    __publicField(this, \"errorCode\");\n    /** 서버 응답의 전체 데이터 */\n    __publicField(this, \"data\");\n    this.name = \"APIError\";\n    this.errorCode = errorCode;\n    this.data = data;\n  }\n}\nexport {\n  APIError\n};\n","import { APIService } from \"../APIService.js\";\nimport { AgreementType } from \"../../types/agreement.js\";\nimport { env } from \"../../config/index.js\";\nimport { APIError } from \"../APIService.types.js\";\nimport { GENERAL_ERROR } from \"../../constants/error.js\";\nconst reservedErrorMessages = [\"RAFFLE_CERTIFICATION_FAILED\"];\nconst throwFailError = (response) => {\n  const isFailError = response.result === \"FAIL\" || response.data === null;\n  const isReservedErrorMessage = response.errorCode !== null && reservedErrorMessages.includes(response.errorCode);\n  if (isFailError && isReservedErrorMessage) {\n    throw new Error(response.message ?? GENERAL_ERROR);\n  }\n  if (isFailError) {\n    throw new Error(GENERAL_ERROR);\n  }\n};\nclass RaffleApiService extends APIService {\n  constructor() {\n    super();\n    this.setBaseUrl(env.api.content);\n    this.setMiddleware(throwFailError);\n  }\n  async getRaffleGroup(raffleGroupId) {\n    return this.get(`/api/v4/framers/proxy/content-api/api/v5/raffle-groups/${raffleGroupId}`);\n  }\n  async getRaffleDisplayInformation(raffleGroupId, raffleId) {\n    return this.get(`/api/v4/framers/proxy/content-api/api/v5/raffle-groups/${raffleGroupId}/raffles/${raffleId}/display-information`, void 0, {\n      credentials: \"include\"\n    });\n  }\n  async getRaffleNotificationApplicable(raffleGroupId, raffleId) {\n    return this.get(`/api/v4/framers/proxy/content-api/api/v5/raffle-groups/${raffleGroupId}/raffles/${raffleId}/notification-applicable`, void 0, {\n      credentials: \"include\"\n    });\n  }\n  async getRaffleApplicable(raffleGroupId, raffleId) {\n    return this.get(`/api/v4/framers/proxy/content-api/api/v5/raffle-groups/${raffleGroupId}/raffles/${raffleId}/raffle-applicable`, void 0, {\n      credentials: \"include\"\n    });\n  }\n  async getInfiniteEntryRaffleApplicable(raffleGroupId) {\n    return this.get(`/api/v5/raffle-groups/${raffleGroupId}/raffle-applicable`, void 0, {\n      credentials: \"include\"\n    });\n  }\n  async postRaffleGroupAgreementsAgree({\n    raffleGroupId,\n    raffleId,\n    agreementTypes\n  }) {\n    const agreements = agreementTypes.filter((agreementType) => this.isDefinedRaffleAgreementType(agreementType));\n    return this.post(`/api/v4/framers/proxy/content-api/api/v5/raffle-groups/${raffleGroupId}/raffles/${raffleId}/agreements/agree`, {\n      agreements\n    }, {\n      credentials: \"include\"\n    });\n  }\n  isDefinedRaffleAgreementType(value) {\n    return [AgreementType.Advertising, AgreementType.Privacy, AgreementType.PersonalInformation].includes(value);\n  }\n  async getRaffleGroupAgreementStatus(raffleGroupId, actionType = \"SHARE\") {\n    return this.get(`/api/v5/raffle-groups/${raffleGroupId}/agreements`, {\n      actionType\n    }, {\n      credentials: \"include\"\n    });\n  }\n  async postRaffleGroupAgreements({\n    raffleGroupId,\n    agreementTypes\n  }) {\n    const agreements = agreementTypes.filter((agreementType) => this.isDefinedRaffleAgreementType(agreementType));\n    return this.post(`/api/v5/raffle-groups/${raffleGroupId}/agreements/agree`, {\n      agreements\n    }, {\n      credentials: \"include\"\n    });\n  }\n  async postRaffleApply(raffleGroupId, raffleId) {\n    return this.post(`/api/v4/framers/proxy/content-api/api/v5/raffle-groups/${raffleGroupId}/raffles/${raffleId}/raffle-apply`, void 0, {\n      credentials: \"include\"\n    });\n  }\n  /**\n   * 래플 응모 API (세밀한 에러 처리용)\n   *\n   * @description\n   * 특정 에러 코드별 처리가 필요한 경우 사용하세요.\n   * fetch로 직접 요청하여 APIService middleware를 우회합니다.\n   *\n   * @throws {APIError} COMMON_INVALID_PARAMETER 에러 시 서버 메시지, 기타 에러 시 기본 메시지\n   *\n   * @example\n   * ```typescript\n   * try {\n   *   await raffleApi.fetchRaffleApply(raffleGroupId, raffleId);\n   * } catch (error) {\n   *   if (error instanceof APIError && error.errorCode === 'COMMON_INVALID_PARAMETER') {\n   *     alert(error.message); // 서버 메시지 그대로\n   *   }\n   * }\n   * ```\n   */\n  async fetchRaffleApply(raffleGroupId, raffleId) {\n    const url = `${env.api.content}/api/v4/framers/proxy/content-api/api/v5/raffle-groups/${raffleGroupId}/raffles/${raffleId}/raffle-apply`;\n    const response = await fetch(url, {\n      method: \"POST\",\n      credentials: \"include\",\n      headers: {\n        \"Content-Type\": \"application/json\"\n      }\n    });\n    const data = await response.json();\n    if (!response.ok) {\n      throw new APIError(data.message ?? GENERAL_ERROR, data.errorCode, data);\n    }\n    return data;\n  }\n  async postRaffleGroupShareCallback(raffleGroupId, rewardKey) {\n    return this.post(`/api/v5/raffle-groups/${raffleGroupId}/shares/${rewardKey}/callback`, void 0, {\n      credentials: \"include\"\n    });\n  }\n}\nconst raffleApi = new RaffleApiService();\nexport {\n  raffleApi\n};\n","import { ControlType } from \"framer\";\nimport { ButtonVariant, ButtonSize, ButtonTheme } from \"../../components/@shared/Button/Button.types.js\";\nconst BUTTON_VARIANT_CONTROLS = {\n  variant: {\n    type: ControlType.Enum,\n    title: \"변형\",\n    options: [ButtonVariant.PRIMARY, ButtonVariant.SECONDARY, ButtonVariant.TERTIARY, ButtonVariant.CUSTOM, ButtonVariant.DISABLED],\n    optionTitles: [\"primary\", \"secondary\", \"tertiary\", \"custom\", \"disabled\"]\n  },\n  backgroundColor: {\n    hidden: ({\n      variant\n    }) => variant !== ButtonVariant.CUSTOM,\n    type: ControlType.Color,\n    title: \"배경 색상\",\n    optional: true\n  },\n  color: {\n    hidden: ({\n      variant\n    }) => variant !== ButtonVariant.CUSTOM,\n    type: ControlType.Color,\n    title: \"텍스트 색상\",\n    optional: true\n  }\n};\nconst BUTTON_SIZE_CONTROLS = {\n  size: {\n    type: ControlType.Enum,\n    title: \"크기\",\n    options: [ButtonSize.LARGE, ButtonSize.MEDIUM, ButtonSize.SMALL, ButtonSize.X_SMALL],\n    optionTitles: [\"large\", \"medium\", \"small\", \"xSmall\"],\n    defaultValue: ButtonSize.MEDIUM\n  }\n};\nconst BUTTON_FILL_CONTROLS = {\n  fill: {\n    type: ControlType.Boolean,\n    title: \"반응형 너비\",\n    defaultValue: false\n  }\n};\nconst BUTTON_THEME_CONTROLS = {\n  theme: {\n    type: ControlType.Enum,\n    title: \"테마\",\n    options: [ButtonTheme.LIGHT, ButtonTheme.DARK],\n    optionTitles: [\"light\", \"dark\"],\n    defaultValue: ButtonTheme.LIGHT,\n    displaySegmentedControl: true\n  }\n};\nexport {\n  BUTTON_FILL_CONTROLS,\n  BUTTON_SIZE_CONTROLS,\n  BUTTON_THEME_CONTROLS,\n  BUTTON_VARIANT_CONTROLS\n};\n"],"mappings":"4OAAI,GAAkC,IACpC,EAAe,oBAAyB,iCACxC,EAAe,QAAa,oBAC5B,EAAe,YAAiB,wBACzB,IACN,GAAiB,EAAE,CAAC,sBCLnB,EAAY,OAAO,eACnB,GAAmB,EAAK,EAAK,IAAU,KAAO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