1"use strict";(self.webpackChunkmangane_fe=self.webpackChunkmangane_fe||[]).push([[34],{1194:function(e,t,a){a.r(t),a.d(t,{default:function(){return N}});var l=a(1855),i=a(1840),o=(a(1),a(42),a(21),a(0)),s=a(1841),r=a(1842),n=a(1871),d=a(13),c=a(47),u=a(12),f=a(1878),h=a(272),p=a(2),_=a(929),b=a(3),g=a(31),v=a(258),Z=a(98),m=a(117),y=function(e){var t=e.account,a=(0,b.Dn)().displayFqn;return(0,l.Z)("div",{className:"bg-white dark:bg-slate-800 rounded-lg text-black dark:text-white sm:shadow dark:sm:shadow-inset overflow-hidden"},void 0,(0,l.Z)("div",{},void 0,(0,l.Z)("div",{className:"relative w-full h-32 md:rounded-t-lg bg-gray-200 dark:bg-slate-900/50"},void 0,(0,l.Z)(Z.Z,{alt:"",src:t.header,className:"absolute inset-0 object-cover md:rounded-t-lg"}))),(0,l.Z)(p.Ug,{space:3,alignItems:"center",className:"p-3"},void 0,(0,l.Z)("div",{className:"relative"},void 0,(0,l.Z)("div",{className:"h-12 w-12 bg-gray-400 rounded-full"},void 0,(0,l.Z)(Z.Z,{alt:"",className:"h-12 w-12 rounded-full",src:t.avatar})),t.verified&&(0,l.Z)("div",{className:"absolute -top-1.5 -right-1.5"},void 0,(0,l.Z)(m.Z,{}))),(0,l.Z)(p.Kq,{className:"truncate"},void 0,(0,l.Z)(p.xv,{weight:"medium",size:"sm",truncate:!0},void 0,t.display_name),(0,l.Z)(p.xv,{theme:"muted",size:"sm"},void 0,"@",a?t.fqn:t.acct))))},w=function(e,t,a){if(a||2===arguments.length)for(var l,i=0,o=t.length;i<o;i++)!l&&i in t||(l||(l=Array.prototype.slice.call(t,0,i)),l[i]=t[i]);return e.concat(l||Array.prototype.slice.call(t))};function M(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,l)}return a}function k(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?M(Object(a),!0).forEach((function(t){(0,i.Z)(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):M(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var x=function(e){var t=e.pleroma.toJS(),a=t.hide_followers,l=t.hide_follows,i=t.hide_followers_count,o=t.hide_follows_count;return Boolean(a&&l&&i&&o)},P=(0,s.vU)({heading:{id:"column.edit_profile",defaultMessage:"Edit profile"},header:{id:"edit_profile.header",defaultMessage:"Edit Profile"},metaFieldLabel:{id:"edit_profile.fields.meta_fields.label_placeholder",defaultMessage:"Label"},metaFieldContent:{id:"edit_profile.fields.meta_fields.content_placeholder",defaultMessage:"Content"},success:{id:"edit_profile.success",defaultMessage:"Profile saved!"},error:{id:"edit_profile.error",defaultMessage:"Profile update failed"},bioPlaceholder:{id:"edit_profile.fields.bio_placeholder",defaultMessage:"Tell us about yourself."},displayNamePlaceholder:{id:"edit_profile.fields.display_name_placeholder",defaultMessage:"Name"},websitePlaceholder:{id:"edit_profile.fields.website_placeholder",defaultMessage:"Display a Link"},locationPlaceholder:{id:"edit_profile.fields.location_placeholder",defaultMessage:"Location"},statusExpiryPlaceholder:{id:"edit_profile.fields.status_expiry_placeholder",defaultMessage:"Number of days"},cancel:{id:"common.cancel",defaultMessage:"Cancel"}}),C=function(e){var t=e.value,a=e.onChange,i=(0,r.Z)(),o=function(e){return function(l){var i;a(k(k({},t),{},((i={})[e]=l.currentTarget.value,i)))}};return(0,l.Z)(p.Ug,{space:2,grow:!0},void 0,(0,l.Z)(p.II,{type:"text",outerClassName:"w-2/5 flex-grow",value:t.name,onChange:o("name"),placeholder:i.formatMessage(P.metaFieldLabel)}),(0,l.Z)(p.II,{type:"text",outerClassName:"w-3/5 flex-grow",value:t.value,onChange:o("value"),placeholder:i.formatMessage(P.metaFieldContent)}))},N=function(){var e=(0,r.Z)(),t=(0,b.TL)(),a=(0,b.Tr)(),i=(0,b.hz)(),s=(0,b.CG)((function(e){return e.instance.pleroma.getIn(["metadata","fields_limits","max_fields"],4)})),Z=(0,o.useState)(!1),m=Z[0],M=Z[1],N=(0,o.useState)({}),I=N[0],O=N[1],S=(0,o.useState)(!1),D=S[0],T=S[1];(0,o.useEffect)((function(){if(a){var e=function(e){var t=x(e);return{discoverable:e.discoverable,bot:e.bot,display_name:e.display_name,note:e.source.get("note"),locked:e.locked,fields_attributes:w([],e.source.get("fields",[]).toJS(),!0),stranger_notifications:!0===e.getIn(["pleroma","notification_settings","block_from_strangers"]),accepts_email_list:!0===e.getIn(["pleroma","accepts_email_list"]),hide_followers:t,hide_follows:t,hide_followers_count:t,hide_follows_count:t,website:e.website,location:e.location,birthday:e.birthday,status_ttl_days:e.akkoma.get("status_ttl_days")}}(a),t=!0===a.getIn(["pleroma","notification_settings","block_from_strangers"]);O(e),T(t)}}),[null==a?void 0:a.id]);var j,L=function(e,t){O((function(a){var l;return k(k({},a),{},((l={})[e]=t,l))}))},E=function(e){return function(t){L(e,t.target.checked)}},z=function(e){return function(t){L(e,t.target.value)}},F=function(e,t){return function(a){var l,i=null===(l=a.target.files)||void 0===l?void 0:l.item(0);i&&(0,v.Z)(i,t).then((function(t){L(e,t)})).catch(console.error)}},G=(0,o.useMemo)((function(){return I.avatar?URL.createObjectURL(I.avatar):null==a?void 0:a.avatar}),[I.avatar,null==a?void 0:a.avatar]),H=(0,o.useMemo)((function(){return I.header?URL.createObjectURL(I.header):null==a?void 0:a.header}),[I.header,null==a?void 0:a.header]),U=(0,o.useMemo)((function(){return(0,g.WT)(k(k(k({},null==a?void 0:a.toJS()),I),{},{avatar:G,header:H}))}),[null==a?void 0:a.id,I.display_name,G,H]);return(0,l.Z)(p.sg,{label:e.formatMessage(P.header)},void 0,(0,l.Z)(p.l0,{onSubmit:function(a){return l=void 0,o=void 0,r=function(){var l;return function(e,t){var a,l,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;
1function r(o){return function(r){return function(o){if(a)throw new TypeError("Generator is already executing.");for(;s;)try{if(a=1,l&&(i=2&o[0]?l.return:o[0]?l.throw||((i=l.return)&&i.call(l),0):l.next)&&!(i=i.call(l,o[1])).done)return i;switch(l=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,l=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],l=0}finally{a=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,r])}}}(this,(function(o){switch(o.label){case 0:a.preventDefault(),M(!0),o.label=1;case 1:return o.trys.push([1,5,6,7]),i.muteStrangers?[4,t((0,d.lUE)({block_from_strangers:D}))]:[3,3];case 2:o.sent(),o.label=3;case 3:return[4,t((0,c.sQ)(k(k({},I),{},{status_ttl_days:null===I.status_ttl_days?-1:I.status_ttl_days}),!0))];case 4:return o.sent(),t(u.ZP.success(e.formatMessage(P.success))),[3,7];case 5:return l=o.sent(),console.error(l),t(u.ZP.error(e.formatMessage(P.error))),[3,7];case 6:return M(!1),[7];case 7:return[2]}}
1))},new((s=void 0)||(s=Promise))((function(e,t){function a(e){try{n(r.next(e))}catch(e){t(e)}}function i(e){try{n(r.throw(e))}catch(e){t(e)}}function n(t){var l;t.done?e(t.value):(l=t.value,l instanceof s?l:new s((function(e){e(l)}))).then(a,i)}n((r=r.apply(l,o||[])).next())}));var l,o,s,r}},void 0,(0,l.Z)(p.cw,{labelText:(0,l.Z)(n.Z,{id:"edit_profile.fields.display_name_label",defaultMessage:"Display name"})},void 0,(0,l.Z)(p.II,{type:"text",value:I.display_name,onChange:z("display_name"),placeholder:e.formatMessage(P.displayNamePlaceholder)})),i.birthdays&&(0,l.Z)(p.cw,{labelText:(0,l.Z)(n.Z,{id:"edit_profile.fields.birthday_label",defaultMessage:"Birthday"})},void 0,(0,l.Z)(f.Z,{value:I.birthday,onChange:function(e){L("birthday",e)}})),i.accountLocation&&(0,l.Z)(p.cw,{labelText:(0,l.Z)(n.Z,{id:"edit_profile.fields.location_label",defaultMessage:"Location"})},void 0,(0,l.Z)(p.II,{type:"text",value:I.location,onChange:z("location"),placeholder:e.formatMessage(P.locationPlaceholder)})),i.accountWebsite&&(0,l.Z)(p.cw,{labelText:(0,l.Z)(n.Z,{id:"edit_profile.fields.website_label",defaultMessage:"Website"})},void 0,(0,l.Z)(p.II,{type:"text",value:I.website,onChange:z("website"),placeholder:e.formatMessage(P.websitePlaceholder)})),(0,l.Z)(p.cw,{labelText:(0,l.Z)(n.Z,{id:"edit_profile.fields.bio_label",defaultMessage:"Bio"})},void 0,(0,l.Z)(p.gx,{value:I.note,onChange:z("note"),autoComplete:"off",placeholder:e.formatMessage(P.bioPlaceholder)})),(0,l.Z)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4"},void 0,(0,l.Z)(y,{account:U}),(0,l.Z)("div",{className:"space-y-4"},void 0,(0,l.Z)(p.cw,{labelText:(0,l.Z)(n.Z,{id:"edit_profile.fields.header_label",defaultMessage:"Choose Background Picture"}),hintText:(0,l.Z)(n.Z,{id:"edit_profile.hints.header",defaultMessage:"PNG, GIF or JPG. Will be downscaled to {size}",values:{size:"1920x1080px"}})},void 0,(0,l.Z)(p.S2,{onChange:F("header",2073600)})),(0,l.Z)(p.cw,{labelText:(0,l.Z)(n.Z,{id:"edit_profile.fields.avatar_label",defaultMessage:"Choose Profile Picture"}),hintText:(0,l.Z)(n.Z,{id:"edit_profile.hints.avatar",defaultMessage:"PNG, GIF or JPG. Will be downscaled to {size}",values:{size:"400x400px"}})},void 0,(0,l.Z)(p.S2,{onChange:F("avatar",16e4)})))),(0,l.Z)(h.Z,{},void 0,i.followRequests&&(0,l.Z)(h.H,{label:(0,l.Z)(n.Z,{id:"edit_profile.fields.locked_label",defaultMessage:"Lock account"}),hint:(0,l.Z)(n.Z,{id:"edit_profile.hints.locked",defaultMessage:"Requires you to manually approve followers"})},void 0,(0,l.Z)(p.ZD,{checked:I.locked,onChange:E("locked")})),i.hideNetwork&&(0,l.Z)(h.H,{label:(0,l.Z)(n.Z,{id:"edit_profile.fields.hide_network_label",defaultMessage:"Hide network"}),hint:(0,l.Z)(n.Z,{id:"edit_profile.hints.hide_network",defaultMessage:"Who you follow and who follows you will not be shown on your profile"})},void 0,(0,l.Z)(p.ZD,{checked:!!a&&x(a),onChange:function(e){var t=e.target.checked;O((function(e){return k(k({},e),{},{hide_followers:t,hide_follows:t,hide_followers_count:t,hide_follows_count:t})}))}})),i.bots&&(0,l.Z)(h.H,{label:(0,l.Z)(n.Z,{id:"edit_profile.fields.bot_label",defaultMessage:"This is a bot account"}),hint:(0,l.Z)(n.Z,{id:"edit_profile.hints.bot",defaultMessage:"This account mainly performs automated actions and might not be monitored"})},void 0,(0,l.Z)(p.ZD,{checked:I.bot,onChange:E("bot")})),i.muteStrangers&&(0,l.Z)(h.H,{label:(0,l.Z)(n.Z,{id:"edit_profile.fields.stranger_notifications_label",defaultMessage:"Block notifications from strangers"}),hint:(0,l.Z)(n.Z,{id:"edit_profile.hints.stranger_notifications",defaultMessage:"Only show notifications from people you follow"})},void 0,(0,l.Z)(p.ZD,{checked:D,onChange:function(e){return T(e.target.checked)}})),i.profileDirectory&&(0,l.Z)(h.H,{label:(0,l.Z)(n.Z,{id:"edit_profile.fields.discoverable_label",defaultMessage:"Allow account discovery"}),hint:(0,l.Z)(n.Z,{id:"edit_profile.hints.discoverable",defaultMessage:"Display account in profile directory and allow indexing by external services"})},void 0,(0,l.Z)(p.ZD,{checked:I.discoverable,onChange:E("discoverable")})),i.statusExpiry&&(0,l.Z)(h.H,{label:(0,l.Z)(n.Z,{id:"edit_profile.fields.status_expiry_label",defaultMessage:"Scheduled post deleti
1on"}),hint:(0,l.Z)(n.Z,{id:"edit_profile.hints.status_expiry",defaultMessage:"Delete posts after a set amount of days (let empty to disable)"})},void 0,(0,l.Z)(p.II,{type:"number",value:I.status_ttl_days,onChange:(j="status_ttl_days",function(e){var t=parseInt(e.target.value,10);Number.isNaN(t)?L(j,null):L(j,t)}),placeholder:e.formatMessage(P.statusExpiryPlaceholder)})),i.emailList&&(0,l.Z)(h.H,{label:(0,l.Z)(n.Z,{id:"edit_profile.fields.accepts_email_list_label",defaultMessage:"Subscribe to newsletter"}),hint:(0,l.Z)(n.Z,{id:"edit_profile.hints.accepts_email_list",defaultMessage:"Opt-in to news and marketing updates."})},void 0,(0,l.Z)(p.ZD,{checked:I.accepts_email_list,onChange:E("accepts_email_list")}))),i.profileFields&&(0,l.Z)(_.Z,{label:(0,l.Z)(n.Z,{id:"edit_profile.fields.meta_fields_label",defaultMessage:"Profile fields"}),hint:(0,l.Z)(n.Z,{id:"edit_profile.hints.meta_fields",defaultMessage:"You can have up to {count, plural, one {# custom field} other {# custom fields}} displayed on your profile.",values:{count:s}}),values:I.fields_attributes||[],onChange:function(e){L("fields_attributes",e)},onAddItem:function(){var e=I.fields_attributes||[],t=w(w([],e,!0),[{name:"",value:""}],!1);L("fields_attributes",t)},onRemoveItem:function(e){var t=I.fields_attributes||[],a=w([],t,!0);a.splice(e,1),L("fields_attributes",a)},component:C,maxItems:s}),(0,l.Z)(p.iN,{},void 0,(0,l.Z)(p.zx,{to:"/settings",theme:"ghost"},void 0,e.formatMessage(P.cancel)),(0,l.Z)(p.zx,{theme:"primary",type:"submit",disabled:m},void 0,(0,l.Z)(n.Z,{id:"edit_profile.save",defaultMessage:"Save"})))))}}}]); 2//# sourceMappingURL=edit_profile-2034e61de43912694a7a.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.