{"version":3,"file":"Bookmarks.DxFVVsPR.mjs","names":["useState","useCallback"],"sources":["https:/framerusercontent.com/modules/nksEGI2y2IFDfM6suXaJ/fyp723eq6z6o7v2ROdw7/Bookmarks.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useState,useCallback}from\"react\";/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 80\n * @framerIntrinsicHeight 44\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function BookmarkCinema(props){const{buttonColor,textColor,activeColor,activeTextColor,sentColor,sentTextColor,errorColor,errorTextColor,scriptUrl,pageName,buttonLabel,sheetMessage,sentMessage,errorMessage,sendingMessage,style}=props;const[status,setStatus]=useState(\"idle\");const isCanvas=RenderTarget.current()===RenderTarget.canvas;const handleClick=useCallback(async()=>{if(!scriptUrl||isCanvas||status===\"sent\")return;setStatus(\"sending\");try{await fetch(scriptUrl,{method:\"POST\",mode:\"no-cors\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({pageName:pageName||\"Unknown Page\",response:sheetMessage||\"Sim\"})});setStatus(\"sent\");}catch(err){setStatus(\"error\");setTimeout(()=>setStatus(\"idle\"),2e3);}},[scriptUrl,pageName,sheetMessage,isCanvas,status]);const getBackground=()=>{if(status===\"sent\")return sentColor;if(status===\"error\")return errorColor;if(status===\"sending\")return activeColor;return buttonColor;};const getTextColor=()=>{if(status===\"sent\")return sentTextColor;if(status===\"error\")return errorTextColor;if(status===\"sending\")return activeTextColor;return textColor;};const getLabel=()=>{if(status===\"sending\")return sendingMessage;if(status===\"sent\")return sentMessage;if(status===\"error\")return errorMessage;return buttonLabel;};return /*#__PURE__*/_jsx(\"button\",{onClick:handleClick,disabled:status===\"sending\",style:{...style,padding:\"12px 12px\",backgroundColor:getBackground(),color:getTextColor(),border:\"none\",borderRadius:8,cursor:isCanvas||status===\"sending\"||status===\"sent\"?\"default\":\"pointer\",fontSize:12,fontWeight:500,fontFamily:\"'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif\",letterSpacing:\"0.01em\",transition:\"background-color 0.2s ease, color 0.2s ease\",outline:\"none\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",minWidth:56,width:\"100%\",userSelect:\"none\"},children:isCanvas?/*#__PURE__*/_jsx(\"span\",{style:{fontSize:11},children:!scriptUrl?\"⚠ Add Script URL\":buttonLabel}):getLabel()});}BookmarkCinema.defaultProps={buttonColor:\"#2563eb\",textColor:\"#ffffff\",activeColor:\"#1d4ed8\",activeTextColor:\"#ffffff\",sentColor:\"#22c55e\",sentTextColor:\"#ffffff\",errorColor:\"#ef4444\",errorTextColor:\"#ffffff\",buttonLabel:\"Sim\",sheetMessage:\"Sim\",sentMessage:\"✓\",errorMessage:\"Erro\",sendingMessage:\"...\",pageName:\"Home\",scriptUrl:\"\"};addPropertyControls(BookmarkCinema,{// ─── Content ───────────────────────────────\nbuttonLabel:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Sim\"},sheetMessage:{type:ControlType.String,title:\"Sheet Message\",placeholder:\"Message sent to Google Sheets\",defaultValue:\"Sim\"},sentMessage:{type:ControlType.String,title:\"Sent Message\",defaultValue:\"✓\"},sendingMessage:{type:ControlType.String,title:\"Sending Message\",defaultValue:\"...\"},errorMessage:{type:ControlType.String,title:\"Error Message\",defaultValue:\"Erro\"},// ─── Idle State ────────────────────────────\nbuttonColor:{type:ControlType.Color,title:\"Idle — Button\",defaultValue:\"#2563eb\"},textColor:{type:ControlType.Color,title:\"Idle — Text\",defaultValue:\"#ffffff\"},// ─── Sending State ─────────────────────────\nactiveColor:{type:ControlType.Color,title:\"Sending — Button\",defaultValue:\"#1d4ed8\"},activeTextColor:{type:ControlType.Color,title:\"Sending — Text\",defaultValue:\"#ffffff\"},// ─── Sent State ────────────────────────────\nsentColor:{type:ControlType.Color,title:\"Sent — Button\",defaultValue:\"#22c55e\"},sentTextColor:{type:ControlType.Color,title:\"Sent — Text\",defaultValue:\"#ffffff\"},// ─── Error State ───────────────────────────\nerrorColor:{type:ControlType.Color,title:\"Error — Button\",defaultValue:\"#ef4444\"},errorTextColor:{type:ControlType.Color,title:\"Error — Text\",defaultValue:\"#ffffff\"},// ─── Google Sheets ─────────────────────────\nscriptUrl:{type:ControlType.String,title:\"Apps Script URL\",placeholder:\"https://script.google.com/macros/s/...\",defaultValue:\"\"},pageName:{type:ControlType.String,title:\"Page Name\",placeholder:\"e.g. Home, About, Contact\",defaultValue:\"Home\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BookmarkCinema\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"* @framerIntrinsicWidth 80\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"44\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Bookmarks.map"],"mappings":"wLAMG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,cAAY,YAAU,cAAY,kBAAgB,YAAU,gBAAc,aAAW,iBAAe,YAAU,WAAS,cAAY,eAAa,cAAY,eAAa,iBAAe,SAAO,EAAW,CAAC,EAAO,GAAWA,EAAS,OAAO,CAAO,EAAS,EAAa,SAAS,GAAG,EAAa,OAAa,EAAYC,EAAY,SAAS,CAAI,MAAC,GAAW,GAAU,IAAS,QAAc,GAAU,UAAU,CAAC,GAAG,CAAC,MAAM,MAAM,EAAU,CAAC,OAAO,OAAO,KAAK,UAAU,QAAQ,CAAC,eAAe,mBAAmB,CAAC,KAAK,KAAK,UAAU,CAAC,SAAS,GAAU,eAAe,SAAS,GAAc,MAAM,CAAC,CAAC,CAAC,CAAC,EAAU,OAAO,MAAY,CAAC,EAAU,QAAQ,CAAC,eAAe,EAAU,OAAO,CAAC,IAAI,IAAI,CAAC,EAAU,EAAS,EAAa,EAAS,EAAO,CAAC,CAAO,MAAs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