{"version":3,"file":"Atest.DTYLiHCP.mjs","names":[],"sources":["https:/framerusercontent.com/modules/0Laasws02h70ML1QjHH2/p0ZAHvcNwk7ED8iD6aVQ/Atest.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useOutsetaStore=createStore({userData:{Account:{}}});/* ───── Persistencia en Outseta ───── */function updateOutsetaField(fieldName,value,store,setStore){if(typeof window===\"undefined\")return;const updated={...store.userData,Account:{...store.userData?.Account??{}}};updated.Account[fieldName]=value;// UI local inmediata\nsetStore({userData:updated});// Guardar en Outseta si está disponible\nconst Outseta=window[\"Outseta\"];if(!Outseta?.getUser)return;Outseta.getUser().then(user=>{Object.assign(user.Account,updated.Account);return user.update(user);}).catch(err=>{console.error(\"No se pudo guardar en Outseta:\",err);// Revertir si falla\nsetStore({userData:store.userData});});}/* ───── Lectura con default ───── */function readField(store,fieldName,defaultValue=\"FALSE\"){const v=store.userData?.Account?.[fieldName];return v===\"TRUE\"?\"TRUE\":v===\"FALSE\"?\"FALSE\":defaultValue;}/* ───── 1) Establecer ATest a un valor fijo (por defecto \"TRUE\") ───── */export function withSetATest(Component){return props=>{const[store,setStore]=useOutsetaStore();const setValue=val=>{updateOutsetaField(\"ATest\",val,store,setStore);};const onPointerDownCapture=e=>{// Captura para que funcione dentro de componentes anidados\ne.stopPropagation();};const handleClick=()=>{setValue(\"TRUE\")// ← Cambia aquí si quieres otro valor por defecto\n;};return /*#__PURE__*/_jsx(\"div\",{role:\"button\",\"data-outseta-button\":\"set-ATest\",onPointerDownCapture:onPointerDownCapture,onClick:handleClick,style:{pointerEvents:\"auto\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}/* ───── 2) Alternar ATest TRUE/FALSE ───── */export function withToggleATest(Component){return props=>{const[store,setStore]=useOutsetaStore();const current=readField(store,\"ATest\",\"FALSE\");const next=current===\"TRUE\"?\"FALSE\":\"TRUE\";const onPointerDownCapture=e=>{// Captura para que funcione dentro de componentes anidados\ne.stopPropagation();};const handleClick=()=>{updateOutsetaField(\"ATest\",next,store,setStore);};return /*#__PURE__*/_jsx(\"div\",{role:\"button\",\"data-outseta-button\":\"toggle-ATest\",onPointerDownCapture:onPointerDownCapture,onClick:handleClick,style:{pointerEvents:\"auto\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSetATest\":{\"type\":\"reactHoc\",\"name\":\"withSetATest\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withToggleATest\":{\"type\":\"reactHoc\",\"name\":\"withToggleATest\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Atest.map"],"mappings":"8OAAoN,SAAS,EAAmB,EAAU,EAAM,EAAM,EAAS,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAQ,CAAC,GAAG,EAAM,SAAS,QAAQ,CAAC,GAAG,EAAM,UAAU,SAAS,EAAE,CAAC,CAAC,CAAC,EAAQ,QAAQ,GAAW,EAC5Z,EAAS,CAAC,SAAS,EAAQ,CAAC,CAC5B,IAAM,EAAQ,EAAO,QAAe,GAAS,SAAe,EAAQ,SAAS,CAAC,KAAK,IAAO,OAAO,OAAO,EAAK,QAAQ,EAAQ,QAAQ,CAAQ,EAAK,OAAO,EAAK,EAAG,CAAC,MAAM,GAAK,CAAC,QAAQ,MAAM,iCAAiC,EAAI,CACjO,EAAS,CAAC,SAAS,EAAM,SAAS,CAAC,EAAG,CAAkR,SAAgB,EAAa,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAU,GAAiB,CAAO,EAAS,GAAK,CAAC,EAAmB,QAAQ,EAAI,EAAM,EAAS,EAAS,EAAqB,GAAG,CAC3f,EAAE,iBAAiB,EAAS,MAAgB,CAAC,EAAS,OAAO,EAC1D,OAAoB,EAAK,MAAM,CAAC,KAAK,SAAS,sBAAsB,YAAiC,uBAAqB,QAAQ,EAAY,MAAM,CAAC,cAAc,OAAO,CAAC,SAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,CAAC,CAAC,yBALrL,IAAqE,CAAM,EAAgB,EAAY,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC"}