{"version":3,"file":"HelloAssoWidget.zip2LX2s.mjs","names":["React.useRef","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","p","c","init_jsx_runtime","ce","de","init_framer_Bf4_tcb2","addPropertyControls","ControlType","HelloAssoWidget","props","iframeRef","isButton","mode","isVignette","src","buttonUrl","vignetteUrl","formUrl","height","buttonHeight","vignetteHeight","minHeight","iframeId","handleMessage","data","event","dataHeight","iframe","style","radius","borderColor","loadingText","init_HelloAssoWidget"],"sources":["https:/framerusercontent.com/modules/8pTFkuWi65jsaB6NYRet/8IjbFr6ryOzJ1uZv00uH/HelloAssoWidget.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function HelloAssoWidget(props){const{mode,formUrl,buttonUrl,vignetteUrl,minHeight,buttonHeight,vignetteHeight,radius,background,borderColor,loadingText,style}=props;const iframeRef=React.useRef(null);const isButton=mode===\"button\";const isVignette=mode===\"vignette\";const src=isButton?buttonUrl:isVignette?vignetteUrl:formUrl;const height=isButton?buttonHeight:isVignette?vignetteHeight:minHeight;const iframeId=isButton?\"haWidgetButton\":isVignette?\"haWidgetVignette\":\"haWidget\";React.useEffect(()=>{if(isButton||isVignette)return;function handleMessage(event){const data=event.data;const dataHeight=typeof data===\"object\"&&data!==null?Number(data.height):Number.NaN;const iframe=iframeRef.current;if(!iframe||!Number.isFinite(dataHeight)||dataHeight<=0)return;const currentHeight=parseFloat(iframe.style.height||String(minHeight));if(dataHeight>currentHeight){iframe.style.height=dataHeight+\"px\";}}window.addEventListener(\"message\",handleMessage);return()=>window.removeEventListener(\"message\",handleMessage);},[isButton,isVignette,minHeight]);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",minHeight:height,borderRadius:radius,border:isButton?\"none\":\"1px solid \"+borderColor,background,overflow:\"hidden\",boxSizing:\"border-box\",position:\"relative\"},children:[/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,id:iframeId,title:isButton?\"Bouton HelloAsso\":isVignette?\"Vignette HelloAsso\":\"Formulaire HelloAsso\",allow:isButton||isVignette?undefined:\"payment 'self' https://paymenthub.helloassopay.com https://helloasso.com\",allowTransparency:true,scrolling:\"auto\",src:src,style:{width:\"100%\",height,border:\"none\",display:\"block\",background:\"transparent\"}}),/*#__PURE__*/_jsx(\"noscript\",{children:loadingText})]});}HelloAssoWidget.defaultProps={mode:\"form\",formUrl:\"https://www.helloasso.com/associations/les-rosalmees/adhesions/2026-2027/widget\",buttonUrl:\"https://www.helloasso.com/associations/les-rosalmees/adhesions/2026-2027/widget-bouton\",vignetteUrl:\"https://www.helloasso.com/associations/les-rosalmees/adhesions/2026-2027/widget-vignette\",minHeight:750,buttonHeight:70,vignetteHeight:513,radius:20,background:\"#FFFDFC\",borderColor:\"rgba(13, 45, 73, 0.08)\",loadingText:\"Chargement HelloAsso…\"};addPropertyControls(HelloAssoWidget,{mode:{type:ControlType.Enum,title:\"Mode\",options:[\"form\",\"button\",\"vignette\"],optionTitles:[\"Formulaire\",\"Bouton\",\"Vignette\"],defaultValue:\"form\",displaySegmentedControl:true},formUrl:{type:ControlType.String,title:\"Form URL\",defaultValue:\"https://www.helloasso.com/associations/les-rosalmees/adhesions/2026-2027/widget\",hidden:props=>props.mode!==\"form\"},buttonUrl:{type:ControlType.String,title:\"Button URL\",defaultValue:\"https://www.helloasso.com/associations/les-rosalmees/adhesions/2026-2027/widget-bouton\",hidden:props=>props.mode!==\"button\"},vignetteUrl:{type:ControlType.String,title:\"Vignette URL\",defaultValue:\"https://www.helloasso.com/associations/les-rosalmees/adhesions/2026-2027/widget-vignette\",hidden:props=>props.mode!==\"vignette\"},minHeight:{type:ControlType.Number,title:\"Height\",min:360,max:1400,step:10,unit:\"px\",defaultValue:750,hidden:props=>props.mode!==\"form\"},buttonHeight:{type:ControlType.Number,title:\"Button H\",min:50,max:160,step:5,unit:\"px\",defaultValue:70,hidden:props=>props.mode!==\"button\"},vignetteHeight:{type:ControlType.Number,title:\"Vignette H\",min:320,max:900,step:10,unit:\"px\",defaultValue:513,hidden:props=>props.mode!==\"vignette\"},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:48,step:1,unit:\"px\",defaultValue:20},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFDFC\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"rgba(13, 45, 73, 0.08)\"},loadingText:{type:ControlType.String,title:\"Fallback\",defaultValue:\"Chargement HelloAsso…\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HelloAssoWidget\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HelloAssoWidget.map"],"mappings":"A,sMAGG,SAAwBa,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,UAAQ,YAAU,cAAY,YAAU,eAAa,iBAAe,SAAO,aAAW,cAAY,cAAY,SAAOC,EAAYC,EAAUf,EAAa,IAAI,EAAQgB,EAASC,IAAO,SAAeC,EAAWD,IAAO,WAAiBE,EAAIH,EAASI,EAAUF,EAAWG,EAAYC,EAAcC,EAAOP,EAASQ,EAAaN,EAAWO,EAAeC,EAAgBC,EAASX,EAAS,iBAAiBE,EAAW,mBAAmB,WAAikB,OAAtjBV,MAAoB,CAAC,GAAGQ,GAAUE,EAAW,OAAO,SAASU,EAAc,EAAM,CAAC,IAAMC,EAAKC,EAAM,KAAWC,EAAW,OAAOF,GAAO,UAAUA,EAAY,OAAOA,EAAK,MAAM,EAAE,IAAiBG,EAAOjB,EAAU,QAAW,CAACiB,GAAQ,CAAC,OAAO,SAASD,CAAU,GAAGA,GAAY,GAAmFA,EAAtD,WAAWC,EAA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