{"version":3,"file":"MasterclassNotification.BDLU9lOc.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/3f2PyVjh87etGkcB2SA2/eCkYpmHVDbNruX8nW1TC/MasterclassNotification.js"],"sourcesContent":["// MasterclassNotification component that shows a countdown and displays \"Masterclass is starting now\" when it reaches zero\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function MasterclassNotification(props){const{duration=60,backgroundColor=\"#FFFFFF\",textColor=\"#000000\",messageColor=\"#FF0000\",font,messageFont,borderRadius=8,showMessage=true,customMessage=\"Masterclass is starting now\"}=props;const[timeLeft,setTimeLeft]=useState(duration);const[isFinished,setIsFinished]=useState(false);const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic)return;if(timeLeft<=0){startTransition(()=>setIsFinished(true));return;}const timer=setInterval(()=>{startTransition(()=>{setTimeLeft(prev=>{if(prev<=1){setIsFinished(true);return 0;}return prev-1;});});},1e3);return()=>clearInterval(timer);},[timeLeft,isStatic]);const formatTime=seconds=>{const mins=Math.floor(seconds/60);const secs=seconds%60;return`${mins.toString().padStart(2,\"0\")}:${secs.toString().padStart(2,\"0\")}`;};const isFixedWidth=props?.style&&props.style.width===\"100%\";if(isFinished&&showMessage){return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,position:\"relative\",...isFixedWidth?{...props?.style}:{minWidth:\"max-content\"},backgroundColor,borderRadius,padding:20,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",textAlign:\"center\",color:messageColor,...messageFont},children:customMessage});}return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,position:\"relative\",...isFixedWidth?{...props?.style}:{minWidth:\"max-content\"},backgroundColor,borderRadius,padding:20,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",textAlign:\"center\",color:textColor,...font},children:formatTime(timeLeft)});}addPropertyControls(MasterclassNotification,{duration:{type:ControlType.Number,title:\"Duration (seconds)\",defaultValue:60,min:1,max:3600,step:1},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"MasterclassNotification Color\",defaultValue:\"#000000\"},messageColor:{type:ControlType.Color,title:\"Message Color\",defaultValue:\"#FF0000\"},font:{type:ControlType.Font,title:\"MasterclassNotification Font\",defaultValue:{fontSize:\"32px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},messageFont:{type:ControlType.Font,title:\"Message Font\",defaultValue:{fontSize:\"22px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},showMessage:{type:ControlType.Boolean,title:\"Show Message\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},customMessage:{type:ControlType.String,title:\"Custom Message\",defaultValue:\"Masterclass is starting now\",displayTextArea:true,hidden:({showMessage})=>!showMessage}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MasterclassNotification\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MasterclassNotification.map"],"mappings":"gMAIG,SAAwB,EAAwB,EAAM,CAAC,GAAK,CAAC,WAAS,GAAG,kBAAgB,UAAU,YAAU,UAAU,eAAa,UAAU,OAAK,cAAY,eAAa,EAAE,cAAY,GAAK,gBAAc,+BAA+B,EAAW,CAAC,EAAS,GAAaA,EAAS,EAAS,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAO,EAAS,GAAqB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