{"version":3,"file":"LessonCheckmark.DmKCk-ro.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","_e","c","init_jsx_runtime","ce","init_framer_DymZktPS","addPropertyControls","ControlType","LessonCheckmark","props","isCompleted","setIsCompleted","cleanUrl","normalizeUrl","embedUrl","storageKey","handleVideoCompleted","activeColor","inactiveColor","init_LessonCheckmark","url"],"sources":["https:/framerusercontent.com/modules/Oh2vncB6Tr7x0Eu9udqJ/EQEezs9WIyeYnvpkNCON/LessonCheckmark.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const normalizeUrl=url=>{if(!url)return\"\";return url.split(\"?\")[0].replace(/\\/$/,\"\").toLowerCase().trim();};export default function LessonCheckmark(props){const{embedUrl,activeColor,inactiveColor}=props;const[isCompleted,setIsCompleted]=useState(false);const cleanUrl=normalizeUrl(embedUrl);const storageKey=cleanUrl?`bunny_done_${cleanUrl}`:\"\";useEffect(()=>{if(!cleanUrl)return;if(localStorage.getItem(storageKey)===\"true\"){setIsCompleted(true);}else{setIsCompleted(false);}const handleVideoCompleted=e=>{if(e.detail?.cleanUrl===cleanUrl){setIsCompleted(true);}};window.addEventListener(\"bunnyVideoCompleted\",handleVideoCompleted);return()=>{window.removeEventListener(\"bunnyVideoCompleted\",handleVideoCompleted);};},[cleanUrl,storageKey]);if(!embedUrl){return /*#__PURE__*/_jsx(\"div\",{style:{color:\"#666\",fontSize:\"10px\"},children:\"No URL\"});}return /*#__PURE__*/_jsx(\"div\",{style:{display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",width:\"18px\",height:\"18px\",borderRadius:\"50%\",backgroundColor:isCompleted?activeColor:\"transparent\",border:isCompleted?\"none\":`2px solid ${inactiveColor}`,color:\"#FFFFFF\",fontSize:\"11px\",fontWeight:\"bold\",fontFamily:\"sans-serif\",transition:\"all 0.2s ease\",flexShrink:0},children:isCompleted?\"✓\":\"\"});}addPropertyControls(LessonCheckmark,{embedUrl:{type:ControlType.String,title:\"Embed URL\",placeholder:\"https://iframe.mediadelivery.net/embed/...\"},activeColor:{type:ControlType.Color,title:\"Done Color\",defaultValue:\"#10B981\"},inactiveColor:{type:ControlType.Color,title:\"Circle Border\",defaultValue:\"#444444\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LessonCheckmark\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LessonCheckmark.map"],"mappings":"A,+LAAiP,SAAwBY,EAAgB,EAAM,CAAC,GAAK,CAAC,WAAS,cAAY,iBAAeC,EAAW,CAACC,EAAYC,GAAgBf,EAAS,EAAK,EAAQgB,EAASC,EAAaC,CAAQ,EAAQC,EAAWH,EAAS,cAAcA,IAAW,GAAwf,OAArfR,MAAc,CAAC,GAAG,CAACQ,EAAS,OAAU,aAAa,QAAQG,CAAU,IAAI,OAAQJ,EAAe,EAAI,EAAQA,EAAe,EAAK,EAAG,IAAMK,EAAqB,GAAG,CAAI,EAAE,QAAQ,WAAWJ,GAAUD,EAAe,EAAI,CAAG,EAAsE,OAApEX,EAAO,iBAAiB,sBAAsBgB,CAAoB,MAAY,CAAChB,EAAO,oBAAoB,sBAAsBgB,CAAoB,CAAE,CAAE,EAAE,CAACJ,EAASG,CAAU,CAAC,EAAMD,EAAwH,gBAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,cAAc,WAAW,SAAS,eAAe,SAAS,MAAM,OAAO,OAAO,OAAO,aAAa,MAAM,gBAAgBJ,EAAYO,EAAY,cAAc,OAAOP,EAAY,OAAO,aAAaQ,IAAgB,MAAM,UAAU,SAAS,OAAO,WAAW,OAAO,WAAW,aAAa,WAAW,gBAAgB,WAAW,CAAC,EAAE,SAASR,EAAY,IAAI,EAAE,CAAC,EAAzd,gBAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO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