{"version":3,"file":"Availability.CaUE8v7p.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/AUGPFLaVtzjXXBUz3zwG/nPLRD1IfE1Oko6qVPUtg/Availability.js"],"sourcesContent":["// Availability indicator component with customizable work hours and layout\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo,useState}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Availability(props){const{previewMode=false,previewState=\"available\",workStartHour=9,workEndHour=17,workdays=[1,2,3,4,5],availableText=\"Available\",unavailableText=\"Unavailable\",availableHoverText=\"\",unavailableHoverText=\"\",indicatorPosition=\"left\",indicatorSize=12,availableColor=\"#22CC66\",unavailableColor=\"#FF5588\",textColor=\"#000000\",backgroundColor=\"#FFFFFF\",font,blendMode=\"difference\",borderRadius=8,link=\"\",emailToCopy=\"\",mailSubject=\"\",mailBody=\"\",gap=12,style}=props;const[isHovered,setIsHovered]=useState(false);const isAvailable=useMemo(()=>{// If preview mode is enabled, use the preview state\nif(previewMode){return previewState===\"available\";}if(typeof window===\"undefined\")return true;const now=new Date;const currentHour=now.getHours();const currentDay=now.getDay();// Check if current day is a workday\nif(!workdays.includes(currentDay)){return false;}// Check if current hour is within work hours\nif(workStartHour<=workEndHour){return currentHour>=workStartHour&&currentHour<workEndHour;}else{return currentHour>=workStartHour||currentHour<workEndHour;}},[previewMode,previewState,workStartHour,workEndHour,workdays]);const displayText=isAvailable?availableText:unavailableText;const hoverText=isAvailable?availableHoverText:unavailableHoverText;const finalText=isHovered&&hoverText?hoverText:displayText;const indicatorColor=isAvailable?availableColor:unavailableColor;const containerStyle={...style,display:\"flex\",flexDirection:indicatorPosition===\"left\"?\"row\":\"row-reverse\",alignItems:\"center\",gap:gap,width:\"max-content\",backgroundColor:backgroundColor,padding:\"8px 12px\",borderRadius:borderRadius,mixBlendMode:blendMode,cursor:link||props.onClick?\"pointer\":\"default\"};const indicatorStyle={width:indicatorSize,height:indicatorSize,borderRadius:\"50%\",backgroundColor:indicatorColor,flexShrink:0,animation:isAvailable?\"pulse 2s ease-in-out infinite\":\"none\"};const textStyle={...font,color:textColor,margin:0,whiteSpace:\"nowrap\"};const handleClick=()=>{// Copy email to clipboard if provided\nif(emailToCopy&&typeof navigator!==\"undefined\"&&navigator.clipboard){navigator.clipboard.writeText(emailToCopy).catch(err=>{console.error(\"Failed to copy email:\",err);});}// Open link with mailto parameters if provided\nif(link){let finalLink=link;// If it's a mailto link and we have subject or body, append them\nif(link.startsWith(\"mailto:\")&&(mailSubject||mailBody)){const params=[];if(mailSubject)params.push(`subject=${encodeURIComponent(mailSubject)}`);if(mailBody)params.push(`body=${encodeURIComponent(mailBody)}`);finalLink=`${link}?${params.join(\"&\")}`;}window.open(finalLink);}if(props.onClick){props.onClick();}};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,onClick:handleClick,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes pulse {\n                    0%, 100% {\n                        opacity: 0.5;\n                        transform: scale(1);\n                    }\n                    50% {\n                        opacity: 1;\n                        transform: scale(1.5);\n                    }\n                }\n            `}),/*#__PURE__*/_jsx(\"div\",{style:indicatorStyle}),/*#__PURE__*/_jsx(\"span\",{style:textStyle,children:finalText})]});}addPropertyControls(Availability,{previewMode:{type:ControlType.Boolean,title:\"Preview Mode\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},previewState:{type:ControlType.Enum,title:\"Preview State\",options:[\"available\",\"unavailable\"],optionTitles:[\"Available\",\"Unavailable\"],defaultValue:\"available\",displaySegmentedControl:true,hidden:({previewMode})=>!previewMode},workdays:{type:ControlType.Array,title:\"Work Days\",control:{type:ControlType.Enum,options:[0,1,2,3,4,5,6],optionTitles:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"]},defaultValue:[1,2,3,4,5]},workStartHour:{type:ControlType.Number,title:\"Start Hour\",defaultValue:9,min:0,max:23,step:1,displayStepper:true},workEndHour:{type:ControlType.Number,title:\"End Hour\",defaultValue:17,min:0,max:23,step:1,displayStepper:true},availableText:{type:ControlType.String,title:\"Available Text\",defaultValue:\"Available\"},availableHoverText:{type:ControlType.String,title:\"Available Hover\",defaultValue:\"\",placeholder:\"Optional hover text\"},unavailableText:{type:ControlType.String,title:\"Unavailable Text\",defaultValue:\"Unavailable\"},unavailableHoverText:{type:ControlType.String,title:\"Unavailable Hover\",defaultValue:\"\",placeholder:\"Optional hover text\"},indicatorSize:{type:ControlType.Number,title:\"Indicator Size\",defaultValue:12,min:6,max:32,step:1,unit:\"px\"},availableColor:{type:ControlType.Color,title:\"Available Color\",defaultValue:\"#22CC66\"},unavailableColor:{type:ControlType.Color,title:\"Unavailable Color\",defaultValue:\"#FF5588\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"rgba(255, 255, 255, 0)\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},blendMode:{type:ControlType.Enum,title:\"Text Blend Mode\",options:[\"normal\",\"multiply\",\"screen\",\"overlay\",\"darken\",\"lighten\",\"color-dodge\",\"color-burn\",\"hard-light\",\"soft-light\",\"difference\",\"exclusion\",\"hue\",\"saturation\",\"color\",\"luminosity\"],optionTitles:[\"Normal\",\"Multiply\",\"Screen\",\"Overlay\",\"Darken\",\"Lighten\",\"Color Dodge\",\"Color Burn\",\"Hard Light\",\"Soft Light\",\"Difference\",\"Exclusion\",\"Hue\",\"Saturation\",\"Color\",\"Luminosity\"],defaultValue:\"difference\"},link:{type:ControlType.Link,title:\"Link\"},emailToCopy:{type:ControlType.String,title:\"Email to Copy\",defaultValue:\"\",placeholder:\"email@example.com\"},mailSubject:{type:ControlType.String,title:\"Mail Subject\",defaultValue:\"\",placeholder:\"Subject line\"},mailBody:{type:ControlType.String,title:\"Mail Body\",defaultValue:\"\",placeholder:\"Email body text\",displayTextArea:true},indicatorPosition:{type:ControlType.Enum,title:\"Indicator Position\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true},gap:{type:ControlType.Number,title:\"LED-Text Spacing\",defaultValue:12,min:0,max:50,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Roundness\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Availability\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Availability.map"],"mappings":"mMAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,cAAY,GAAM,eAAa,YAAY,gBAAc,EAAE,cAAY,GAAG,WAAS,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,gBAAc,YAAY,kBAAgB,cAAc,qBAAmB,GAAG,uBAAqB,GAAG,oBAAkB,OAAO,gBAAc,GAAG,iBAAe,UAAU,mBAAiB,UAAU,YAAU,UAAU,kBAAgB,UAAU,OAAK,YAAU,aAAa,eAAa,EAAE,OAAK,GAAG,cAAY,GAAG,cAAY,GAAG,WAAS,GAAG,MAAI,GAAG,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAQ,EAAYC,MAAY,CACnkB,GAAG,EAAa,OAAO,IAAe,YAAa,GAAU,IAAS,OAAY,MAAO,GAAK,IAAM,EAAI,IAAI,KAAW,EAAY,EAAI,SAAS,EAAQ,EAAW,EAAI,OAAO,EAE9E,OAD5F,EAAS,SAAS,CAAU,EAC7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