{"version":3,"file":"SmartDownloadButton.tLUt5XCh.mjs","names":[],"sources":["https:/framerusercontent.com/modules/sxJsO6zBuRcyKmmyQzDS/T3wZtYBHdFeYmUE59dPg/SmartDownloadButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// URLからmc_eidを取得するヘルパー関数\nfunction getMcEid(){if(RenderTarget.current()!==\"CANVAS\"){return new URLSearchParams(window.location.search).get(\"mc_eid\")||\"\";}return\"\";}// これが新しいスマートボタン部品です\nexport function SmartDownloadButton(props){const{text,pdfUrl,eventName,tagToAdd,fontSize,borderRadius}=props;const handleClick=()=>{const mc_eid=getMcEid();if(!mc_eid){console.warn(\"mc_eid not found in URL. Opening PDF directly.\");if(pdfUrl)window.open(pdfUrl,\"_blank\");return;}fetch(\"https://zenmovlabodl.taichi-suga.workers.dev\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({mc_eid:mc_eid,eventName:eventName,tagToAdd:tagToAdd})}).catch(error=>console.error(\"Fetch Error:\",error)).finally(()=>{if(pdfUrl)window.open(pdfUrl,\"_blank\");});};// プロパティで設定した値を使って、ボタンの見た目を動的に変更します\nconst buttonStyle={width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",textAlign:\"center\",color:\"white\",backgroundColor:\"rgb(255, 143, 64)\",cursor:\"pointer\",fontWeight:500,fontFamily:'\"Inter\", sans-serif',// ↓プロパティの値をCSSに適用\nfontSize:`${fontSize}px`,borderRadius:`${borderRadius}px`};return /*#__PURE__*/_jsx(\"div\",{style:buttonStyle,onClick:RenderTarget.current()!==\"CANVAS\"?handleClick:undefined,children:text});}// 右側のプロパティパネルで設定できるようになる項目\naddPropertyControls(SmartDownloadButton,{text:{title:\"ボタンテキスト\",type:ControlType.String,defaultValue:\"資料をダウンロード\"},pdfUrl:{title:\"PDFのURL\",type:ControlType.String,defaultValue:\"\"},eventName:{title:\"Mailchimpイベント名\",type:ControlType.String,defaultValue:\"\"},tagToAdd:{title:\"追加するMailchimpタグ\",type:ControlType.String,defaultValue:\"\"},// ↓ここから追加\nfontSize:{title:\"文字サイズ\",type:ControlType.Number,defaultValue:27,min:10,max:60,step:1,unit:\"px\"},borderRadius:{title:\"ボタンの丸み\",type:ControlType.Number,defaultValue:50,min:0,max:100,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"SmartDownloadButton\":{\"type\":\"reactComponent\",\"name\":\"SmartDownloadButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmartDownloadButton.map"],"mappings":"iLACA,SAAS,GAAU,CAA6G,OAAzG,EAAa,SAAS,GAAG,SAAsF,GAArE,IAAI,gBAAgB,EAAO,SAAS,OAAO,CAAC,IAAI,SAAS,EAAE,GAC5H,SAAgB,EAAoB,EAAM,CAAC,GAAK,CAAC,OAAK,SAAO,YAAU,WAAS,WAAS,gBAAc,EAE5C,OAAoB,EAAK,MAAM,CAAC,MADzE,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,UAAU,SAAS,MAAM,QAAQ,gBAAgB,oBAAoB,OAAO,UAAU,WAAW,IAAI,WAAW,sBACzN,SAAS,GAAG,EAAS,IAAI,aAAa,GAAG,EAAa,IAAI,CAAmD,QAAQ,EAAa,SAAS,GAAG,SAAqB,IAAA,OAFhC,CAAC,IAAM,EAAO,GAAU,CAAC,GAAG,CAAC,EAAO,CAAC,QAAQ,KAAK,iDAAiD,CAAI,GAAO,EAAO,KAAK,EAAO,SAAS,CAAC,OAAQ,MAAM,+CAA+C,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,CAAC,KAAK,KAAK,UAAU,CAAQ,SAAiB,YAAmB,WAAS,CAAC,CAAC,CAAC,CAAC,MAAM,GAAO,QAAQ,MAAM,eAAe,EAAM,CAAC,C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