{"version":3,"file":"RewindVimeo.DOKTuStg.mjs","names":["React.useRef","React.useCallback","__esmMin","init_npm_react_18_3_1","ne","init_ssg_sandbox_shims","c","init_jsx_runtime","ce","de","window","init_framer_CaDWdxiz","addPropertyControls","ControlType","RewindVimeo","frame","id","video","send","value","receive","event","data","style","init_RewindVimeo"],"sources":["https:/framerusercontent.com/modules/qV9DKJXlqQwhcdvgoI78/eI57P8PuZU6MUVsrx0D2/RewindVimeo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/** @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any */export default function RewindVimeo({video=\"https://vimeo.com/1243911491\",title=\"Project video\",style}){const frame=React.useRef(null);const id=(video.match(/vimeo.com\\/(?:video\\/)?(\\d+)/)||[])[1]||\"1243911491\";const send=React.useCallback((method,value)=>{frame.current?.contentWindow?.postMessage(JSON.stringify({method,...value===undefined?{}:{value}}),\"https://player.vimeo.com\");},[]);React.useEffect(()=>{const receive=event=>{if(event.origin!==\"https://player.vimeo.com\"||event.source!==frame.current?.contentWindow)return;let data;try{data=typeof event.data===\"string\"?JSON.parse(event.data):event.data;}catch{return;}if(data?.event===\"ready\"||data?.method===\"ping\")send(\"addEventListener\",\"finish\");if(data?.event===\"finish\"){send(\"pause\");send(\"setCurrentTime\",0);}};window.addEventListener(\"message\",receive);send(\"ping\");return()=>window.removeEventListener(\"message\",receive);},[send,id]);return /*#__PURE__*/_jsx(\"div\",{style:{...style,overflow:\"hidden\",background:\"transparent\"},children:/*#__PURE__*/_jsx(\"iframe\",{ref:frame,title:title,src:\"https://player.vimeo.com/video/\"+id+\"?api=1&autoplay=0&loop=0&controls=1\",onLoad:()=>{send(\"addEventListener\",\"finish\");send(\"ping\");},allow:\"autoplay; fullscreen; picture-in-picture\",allowFullScreen:true,style:{display:\"block\",width:\"100%\",height:\"100%\",border:0}})});}addPropertyControls(RewindVimeo,{video:{type:ControlType.String,title:\"Video URL\",defaultValue:\"https://vimeo.com/1243911491\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Project video\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RewindVimeo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RewindVimeo.map"],"mappings":"A,sMACsC,SAAwBc,EAAY,CAAC,QAAM,+BAA+B,QAAM,gBAAgB,SAAO,CAAC,IAAMC,EAAMf,EAAa,IAAI,EAAQgB,GAAIC,EAAM,MAAM,8BAA8B,GAAG,CAAC,EAAA,CAAG,IAAI,aAAmBC,EAAKjB,GAAmB,EAAO,IAAQ,CAACc,EAAM,SAAS,eAAe,YAAY,KAAK,UAAU,CAAC,SAAO,GAAGI,IAAQ,IAAA,GAAU,CAAC,EAAE,CAAC,OAAK,CAAC,CAAC,EAAE,0BAA0B,CAAE,EAAE,CAAC,CAAC,EAAkgB,OAAhgBX,MAAoB,CAAC,IAAMY,EAAQ,GAAO,CAAC,GAAGC,EAAM,SAAS,4BAA4BA,EAAM,SAASN,EAAM,SAAS,cAAc,OAAO,IAAIO,EAAK,GAAG,CAAC,EAAK,OAAOD,EAAM,MAAO,SAAS,KAAK,MAAMA,EAAM,IAAI,EAAEA,EAAM,IAAK,MAAM,CAAC,MAAO,EAAIC,GAAM,QAAQ,SAASA,GAAM,SAAS,SAAOJ,EAAK,mBAAmB,QAAQ,EAAKI,GAAM,QAAQ,WAAUJ,EAAK,OAAO,EAAEA,EAAK,iBAAiB,CAAC,EAAG,EAA0D,OAAxDR,EAAO,iBAAiB,UAAUU,CAAO,EAAEF,EAAK,MAAM,MAAYR,EAAO,oBAAoB,UAAUU,CAAO,CAAE,EAAE,CAACF,EAAKF,CAAE,CAAC,EAAsB,gBAAK,MAAM,CAAC,MAAM,CAAC,GA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