{"version":3,"file":"VideoFrameShared.Cg2wjmes.mjs","names":["useState","useId"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/6ffgsaDzsjdxRp9dCkQD/MorESSBKyWuMljhmD7Xu/VideoFrameShared.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{ControlType}from\"framer\";import{useId}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{motion}from\"framer-motion\";export const VIDEO_ID_ATTRIBUTE=\"custom-video-id\";export const useVideoStore=createStore({});export const speeds=[\"0.25\",\"0.5\",\"0.75\",\"1\",\"1.25\",\"1.5\",\"2\",\"3\"];export const playbackQualityOptions=[\"small\",\"medium\",\"large\",\"hd720\",\"hd1080\",\"highres\",\"default\"];export const playbackQualityTitles={small:[\"Small\",\"240p\"],medium:[\"Medium\",\"360p\"],large:[\"Large\",\"480p\"],hd720:[\"HD 720\",\"720p\"],hd1080:[\"HD 1080\",\"1080p\"],highres:[\"4K\",\"4K\"],default:[\"Auto\",\"Auto\"]};export const createId=()=>\"a\"+String(Math.floor(Math.random()*999999999));export const useInstanceId=()=>{const id=useId();const cleanId=id.replace(/:/g,\"\");const instanceId=`superfields-${cleanId}`;return instanceId;};export function getVideoId(element){while(element){let id=element.getAttribute(VIDEO_ID_ATTRIBUTE);if(id){return id;}element=element.parentElement;}return null;}export function Icon({image,color,size,style={},defaultImage}){let colorValue=color||((image===null||image===void 0?void 0:image.src)?undefined:\"#999\");return /*#__PURE__*/_jsx(\"div\",{\"aria-label\":image===null||image===void 0?void 0:image.alt,style:{width:size,height:size,minWidth:size,minHeight:size,pointerEvents:\"none\",backgroundColor:colorValue,backgroundImage:colorValue?\"none\":`url('${image===null||image===void 0?void 0:image.src}')`,maskImage:(image===null||image===void 0?void 0:image.src)?`url('${image===null||image===void 0?void 0:image.src}')`:defaultImage,backgroundSize:\"contain\",backgroundPosition:\"center\",maskSize:\"contain\",maskPosition:\"center\",...style}});}Icon.displayName=\"VideoFrame/Icon\";export function borderProp({defaultValue=false}={}){return{type:ControlType.Object,optional:true,defaultValue:defaultValue?{color:\"#999\"}:undefined,controls:{color:{type:ControlType.Color,defaultValue:\"#999\"},width:{type:ControlType.Padding,defaultValue:\"1px\"},style:{type:ControlType.Enum,defaultValue:\"solid\",options:[\"solid\",\"dashed\",\"dotted\",\"double\"],optionTitles:[\"Solid\",\"Dashed\",\"Dotted\",\"Double\"]}}};}export function Border({width,style,color,borderRadius=\"inherit\",transition=null,opacity=1}){return /*#__PURE__*/_jsx(motion.div,{animate:{borderColor:color,opacity},style:{position:\"absolute\",inset:0,borderWidth:width,borderStyle:style,borderRadius,pointerEvents:\"none\"},initial:false,transition:transition});}Border.displayName=\"VideoFrame/Border\";\nexport const __FramerMetadata__ = {\"exports\":{\"Icon\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"getVideoId\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"playbackQualityOptions\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useInstanceId\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Border\":{\"type\":\"reactComponent\",\"name\":\"Border\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"useVideoStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"speeds\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"VIDEO_ID_ATTRIBUTE\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"borderProp\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"playbackQualityTitles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"createId\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoFrameShared.map"],"mappings":"iPAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,C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