{"version":3,"file":"UserDataLabel.BD2ybh5m.mjs","names":["textOptions"],"sources":["https:/framerusercontent.com/modules/mPGYIZ8yu9ABZPVltftl/D5RMCGfm2QWDf35Gx65z/UserDataLabel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,withCSS}from\"framer\";import{textOptions,textOptionsToStyles,fetchUserData}from\"https://framerusercontent.com/modules/diyk5889JEo4mM5y5sJr/WO0BY8LwVoqggEJBPHWk/ThentyShared.js\";function UserDataLabelComponent({type,customFieldName,font,color,prefix,suffix,whenEmpty,emptyText,textOptions,style}){const Tag=textOptions.tag||\"p\";const{loggedIn,userData}=fetchUserData();let text=\"\";if(loggedIn&&userData){switch(type){case\"firstName\":text=userData.name?.split(\" \")[0]??\"\";break;case\"lastName\":text=userData.name?.split(\" \").slice(1).join(\" \")??\"\";break;case\"fullName\":text=userData.name;break;case\"email\":text=userData.email;break;case\"customField\":text=userData[customFieldName.startsWith(\"custom:\")?customFieldName:`custom:${customFieldName}`];break;}}if(!text){if(whenEmpty===\"hide\"){return /*#__PURE__*/_jsx(\"div\",{className:\"thenty-hide-element\"});}else{text=emptyText;}}return /*#__PURE__*/_jsxs(Tag,{style:{color,margin:0,whiteSpace:style?.width?undefined:\"nowrap\",fontWeight:400,textAlign:\"center\",...textOptionsToStyles(textOptions),...font,...style},children:[prefix,text,suffix]});}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerDisableUnlink\n */const UserDataLabel=withCSS(UserDataLabelComponent,[\".thenty-hide-element { display: none; }\",\"div:has(> .thenty-hide-element) { display: none; }\"],\"thenty\");export default UserDataLabel;UserDataLabel.displayName=\"User Data Label\";addPropertyControls(UserDataLabel,{type:{type:ControlType.Enum,options:[\"firstName\",\"lastName\",\"fullName\",\"email\",\"customField\"],optionTitles:[\"First Name\",\"Last Name\",\"Full Name\",\"Email\",\"Custom Field\"],defaultValue:\"firstName\"},customFieldName:{type:ControlType.String,defaultValue:\"custom:\",title:\"Field Name\",placeholder:\"Custom Field Name\",hidden:props=>props.type!==\"customField\"},font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14,lineHeight:1.4,textAlign:\"center\"}},color:{type:ControlType.Color,defaultValue:\"#000000\"},prefix:{type:ControlType.String,defaultValue:\"\"},suffix:{type:ControlType.String,defaultValue:\"\"},whenEmpty:{type:ControlType.Enum,defaultValue:\"text\",options:[\"hide\",\"text\"],optionTitles:[\"Hide\",\"Text\"],displaySegmentedControl:true,title:\"Empty\"},emptyText:{type:ControlType.String,defaultValue:\"Empty\",title:\"Text\",placeholder:\"Empty State Text\",hidden:props=>props.whenEmpty!==\"text\"},textOptions:textOptions()});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"UserDataLabel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"2OAAgR,SAAS,EAAuB,CAAC,OAAK,kBAAgB,OAAK,QAAM,SAAO,SAAO,YAAU,YAAU,YAAA,EAAY,SAAO,CAAC,IAAM,EAAIA,EAAY,KAAK,IAAS,CAAC,WAAS,YAAU,GAAe,CAAK,EAAK,GAAG,GAAG,GAAU,EAAU,OAAO,EAAP,CAAa,IAAI,YAAY,EAAK,EAAS,MAAM,MAAM,IAAI,CAAC,IAAI,GAAG,MAAM,IAAI,WAAW,EAAK,EAAS,MAAM,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,EAAE,GAAG,MAAM,IAAI,WAAW,EAAK,EAAS,KAAK,MAAM,IAAI,QAAQ,EAAK,EAAS,MAAM,MAAM,IAAI,cAAc,EAAK,EAAS,EAAgB,WAAW,UAAU,CAAC,EAAgB,UAAU,KAAmB,MAAQ,GAAG,CAAC,EAA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