{"version":3,"file":"UseProfileAskContext.DXeGZAT9.mjs","names":[],"sources":["https:/framerusercontent.com/modules/mgbpvD7PPWkiWfUg3jzV/wkYgfK1Gzg19UUDWchx7/UseProfileAskContext.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{setAskContext,clearAskContext,cleanText,cleanInterests}from\"https://framerusercontent.com/modules/DzEnaOY30W8OS4CIB9TD/4IDCRvT4NbhCoWRplkcT/AskContextStore.js\";function firstText(...values){for(const value of values){const cleaned=cleanText(value);if(cleaned){return cleaned;}}return undefined;}export function useProfileAskContext(profile,currentUserId){const profileId=firstText(profile?.id,profile?.user_id)||undefined;const username=cleanText(profile?.username,80);const displayName=firstText(profile?.display_name,profile?.displayName,profile?.full_name,profile?.fullName,profile?.name,profile?.username);const role=cleanText(profile?.role,100);const headline=cleanText(profile?.headline,180);const bio=cleanText(profile?.bio,1200);const interests=cleanInterests(profile?.interests);const creatorIntentIsPublic=profile?.creator_intent_public===true||profile?.creatorIntentPublic===true||profile?.share_creator_intent===true;const creatorIntent=creatorIntentIsPublic?firstText(profile?.creator_intent,profile?.creatorIntent):undefined;useEffect(()=>{if(!profileId){return;}const label=displayName||username||\"CreateFolk member\";setAskContext({type:\"profile\",id:profileId,label,isOwn:Boolean(currentUserId)&&profileId===currentUserId,publicData:{username,displayName,role,headline,bio,creatorIntent,interests}});return()=>{clearAskContext(\"profile\",profileId);};},[profileId,currentUserId,username,displayName,role,headline,bio,creatorIntent,JSON.stringify(interests)]);}export default function UseProfileAskContext(){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:\"#111111\",color:\"#ffffff\",fontFamily:\"Inter, sans-serif\",fontSize:14},children:\"Profile Ask Context OK\"});}\nexport const __FramerMetadata__ = {\"exports\":{\"useProfileAskContext\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"UseProfileAskContext\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"qLAA+O,SAAS,EAAU,GAAG,EAAO,CAAC,IAAI,IAAM,KAAS,EAAO,CAAC,IAAM,EAAQ,EAAU,CAAK,EAAE,GAAG,EAAS,OAAO,CAAS,CAAkB,CAAC,SAAgB,EAAqB,EAAQ,EAAc,CAAC,IAAM,EAAU,EAAU,GAAS,GAAG,GAAS,OAAO,GAAG,IAAA,GAAgB,EAAS,EAAU,GAAS,SAAS,EAAE,EAAQ,EAAY,EAAU,GAAS,aAAa,GAAS,YAAY,GAAS,UAAU,GAAS,SAAS,GAAS,KAAK,GAAS,QAAQ,EAAQ,EAAK,EAAU,GAAS,KAAK,GAAG,EAAQ,EAAS,EAAU,GAAS,SAAS,GAAG,EAAQ,EAAI,EAAU,GAAS,IAAI,IAAI,EAAQ,EAAU,EAAe,GAAS,SAAS,EAAqJ,EAAvH,GAAS,wBAAwB,IAAM,GAAS,sBAAsB,IAAM,GAAS,uBAAuB,GAA+C,EAAU,GAAS,eAAe,GAAS,aAAa,EAAE,IAAA,GAAU,MAAc,CAAK,KAAiQ,OAAvL,EAAc,CAAC,KAAK,UAAU,GAAG,EAAU,MAAtF,GAAa,GAAU,oBAAqE,MAAM,EAAQ,GAAgB,IAAY,EAAc,WAAW,CAAC,WAAS,cAAY,OAAK,WAAS,MAAI,gBAAc,WAAS,CAAC,CAAC,MAAY,CAAC,EAAgB,UAAU,CAAS,CAAE,CAAE,EAAE,CAAC,EAAU,EAAc,EAAS,EAAY,EAAK,EAAS,EAAI,EAAc,KAAK,UAAU,CAAS,CAAC,CAAC,CAAE,iBAAt+C,IAA6B,IAAuK"}