1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0f45b-c79d-7373-8e26-63a4fd5ebefd")}catch(e){}}();import{j as t,r as Q}from"./1_rjLJJT.js";import{c as D,a as ge,J as Qe,z as Ye,u as Fe,B as $,al as We,t as ee,c_ as Je,c$ as Ge,bY as $e,ae as Ke,cl as Xe,aB as et,cL as tt,de as Ee,df as st,dg as le,T as ue,dh as lt}from"./Cnl0lOne.js";import{D as at,a as nt,A as rt}from"./DO-9_-sO.js";import{b as Ue,d as ze,a as it,D as ot}from"./1wdvSDDz.js";import{u as De,a as He,e as Le}from"./D_1K9NW_.js";import{h as ct}from"./uzzN2ZB4.js";import{z as U}from"./B5dUIQ6s.js";import{u as Oe,c as dt}from"./IR4uT189.js";import{at as ut,au as mt,ah as ft}from"./YLLfQEvQ.js";import{b as ht}from"./DbdHbWbA.js";import{c as be,S as je,a as ve,b as ye,d as N}from"./Bt3tkbpM.js";import{a as pt,T as xt,b as pe,c as xe}from"./D3eA_1Cb.js";import{r as gt}from"./DWeaxL46.js";import"./BnWyCVyG.js";import"./DfakI8mr.js";import"./CgN9xjcd.js";import"./Dt-J0GTc.js";import"./B35B_vHQ.js";import"./DZHzfiV9.js";import"./GqtihGQd.js";import"./Bq04fuRX.js";import"./DSfjkjoJ.js";import"./C_YBBnf9.js";import"./Bz_KDPNB.js";import"./C66g93i7.js";const Re=U.object({website:U.union([U.literal(""),ct]),instagram:U.union([U.string().min(3,{message:"Too short (under 3 characters)"}).max(30,{message:"Too long (over 30 characters)"}).refine(a=>/^[a-zA-Z0-9._]+$/.test(a),{message:"Usernames can only contain letters, numbers, periods, and underscores."}).transform(a=>a.startsWith("https://www.instagram.com/")?a:`https://www.instagram.com/${a}`),U.literal("")]),tiktok:U.union([U.string().min(2,{message:"Too short (under 2 characters)"}).max(24,{message:"Too long (over 24 characters)"}).refine(a=>/^[a-zA-Z0-9._]+$/.test(a),{message:"Usernames can only contain letters, numbers, periods, and underscores."}).transform(a=>a.startsWith("https://www.tiktok.com/@")?a:`https://www.tiktok.com/@${a}`),U.literal("")])});function Me(a){const e=D.c(10),{children:s,isSaving:r}=a,c=r&&"invisible";let l;e[0]!==c?(l=ge("flex flex-col gap-2",c),e[0]=c,e[1]=l):l=e[1];let i;e[2]!==s||e[3]!==l?(i=t.jsx("div",{className:l,children:s}),e[2]=s,e[3]=l,e[4]=i):i=e[4];let o;e[5]!==r?(o=r&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:t.jsx(Qe,{size:24})}),e[5]=r,e[6]=o):o=e[6];let u;return e[7]!==i||e[8]!==o?(u=t.jsxs("div",{className:"relative",children:[i,o]}),e[7]=i,e[8]=o,e[9]=u):u=e[9],u}function Ie(a){const e=D.c(35),{active:s,onChangeStep:r}=a,c=Ye(),l=Oe(),{personId:i}=Fe();let o;e[0]!==r?(o=()=>r("theme"),e[0]=r,e[1]=o):o=e[1];const u=s==="theme"&&"bg-ink-black text-ink-white";let m;e[2]!==u?(m=ge("bg-ink-paper flex flex-row text-ink-black",u),e[2]=u,e[3]=m):m=e[3];let x;e[4]!==o||e[5]!==m?(x=t.jsx($,{variant:"transparent",onClick:o,className:m,size:"sm",children:"Skin"}),e[4]=o,e[5]=m,e[6]=x):x=e[6];let d;e[7]!==r?(d=()=>r("personal"),e[7]=r,e[8]=d):d=e[8];const j=s==="personal"&&"bg-ink-black text-ink-white";let b;e[9]!==j?(b=ge("bg-ink-paper flex flex-row text-ink-black",j),e[9]=j,e[10]=b):b=e[10];let v;e[11]!==d||e[12]!==b?(v=t.jsx($,{variant:"transparent",onClick:d,className:b,size:"sm",children:"Personal"}),e[11]=d,e[12]=b,e[13]=v):v=e[13];let y;e[14]!==r?(y=()=>r("links"),e[14]=r,e[15]=y):y=e[15];const _=s==="links"&&"bg-ink-black text-ink-white";let k;e[16]!==_?(k=ge("bg-ink-paper flex flex-row text-ink-black",_),e[16]=_,e[17]=k):k=e[17];let p;e[18]!==k||e[19]!==y?(p=t.jsx($,{variant:"transparent",onClick:y,className:k,size:"sm",children:"Socials"}),e[18]=k,e[19]=y,e[20]=p):p=e[20];let g;e[21]!==c||e[22]!==l||e[23]!==i?(g=()=>l(c("artistWebsitePages",{personId:i}),{viewTransition:!0}),e[21]=c,e[22]=l,e[23]=i,e[24]=g):g=e[24];const T=s==="pages"&&"bg-ink-black text-ink-white";let C;e[25]!==T?(C=ge("bg-ink-paper flex flex-row text-ink-black",T),e[25]=T,e[26]=C):C=e[26];let w;e[27]!==g||e[28]!==C?(w=t.jsx($,{variant:"transparent",onClick:g,className:C,size:"sm",children:"Pages"}),e[27]=g,e[28]=C,e[29]=w):w=e[29];let S;
1return e[30]!==p||e[31]!==w||e[32]!==x||e[33]!==v?(S=t.jsxs("div",{className:"flex flex-row gap-2",children:[x,v,p,w]}),e[30]=p,e[31]=w,e[32]=x,e[33]=v,e[34]=S):S=e[34],S}function qe(a){const e=D.c(7),{hasChanges:s,onChangeStep:r,save:c}=a,[l,i]=Q.useState(null),o=Q.useRef(null);let u;e[0]!==s||e[1]!==r||e[2]!==c?(u=async d=>{if(o.current){o.current=d,i(d);return}if(!s()){r(d);return}o.current=d,i(d);try{await c()}catch(b){const v=b;throw o.current=null,i(null),v}const j=o.current??d;o.current=null,i(null),r(j)},e[0]=s,e[1]=r,e[2]=c,e[3]=u):u=e[3];const m=u;let x;return e[4]!==m||e[5]!==l?(x={changeStep:m,pendingStep:l},e[4]=m,e[5]=l,e[6]=x):x=e[6],x}const bt=a=>{if(!a)return null;try{return new URL(a).pathname.substring(1)}catch(e){return console.error("Error parsing Instagram URL",e,a),null}},jt=a=>{if(!a)return null;try{return new URL(a).pathname.substring(1).replace(/^@/,"")}catch(e){return console.error("Error parsing TikTok URL",e,a),null}};function vt(a){const e=D.c(76),{onChangeStep:s,onDismiss:r}=a,{toast:c}=We(),{personId:l}=Fe(),i=ee.useUtils(),o=!!l;let u;e[0]!==o?(u={enabled:o},e[0]=o,e[1]=u):u=e[1];const{data:m,isLoading:x}=ee.getPersonalHomepage.useQuery(l||"",u);let d;e[2]!==i?(d=async()=>{await i.getPersonalHomepage.invalidate(),await i.artistWebsite.public.getArtistWebsiteSocials.invalidate()},e[2]=i,e[3]=d):d=e[3];let j;e[4]!==c?(j=()=>{c({title:"Error",description:"Couldn't save your changes. Please try again.",variant:"error"})},e[4]=c,e[5]=j):j=e[5];let b;e[6]!==d||e[7]!==j?(b={onSuccess:d,onError:j},e[6]=d,e[7]=j,e[8]=b):b=e[8];const{mutateAsync:v}=ee.updatePersonalHomepage.useMutation(b);let y;e[9]!==l||e[10]!==v?(y=async P=>{const Z=Re.safeParse(P),{website:oe,instagram:ke,tiktok:ce}=Z.success?Z.data:P;await v({personId:l,websiteUrl:oe||null,instagramUrl:ke||null,tiktokUrl:ce||null})},e[9]=l,e[10]=v,e[11]=y):y=e[11];const _=y,k=m?.websiteUrl||"";let p;e[12]!==m?.instagramUrl?(p=bt(m?.instagramUrl??null)||"",e[12]=m?.instagramUrl,e[13]=p):p=e[13];let g;e[14]!==m?.tiktokUrl?(g=jt(m?.tiktokUrl??null)||"",e[14]=m?.tiktokUrl,e[15]=g):g=e[15];let T;e[16]!==k||e[17]!==p||e[18]!==g?(T={website:k,instagram:p,tiktok:g},e[16]=k,e[17]=p,e[18]=g,e[19]=T):T=e[19];const C=T;let w;e[20]===Symbol.for("react.memo_cache_sentinel")?(w={onChange:Re},e[20]=w):w=e[20];let S;e[21]!==r||e[22]!==_?(S=async P=>{const{value:Z}=P;await _(Z),r()},e[21]=r,e[22]=_,e[23]=S):S=e[23];let H;e[24]!==C||e[25]!==S?(H={defaultValues:C,validators:w,onSubmit:S},e[24]=C,e[25]=S,e[26]=H):H=e[26];const f=De(H),te=He(f.store,_t);let n;e[27]!==f.state||e[28]!==C?(n=()=>!Le(f.state.values,C),e[27]=f.state,e[28]=C,e[29]=n):n=e[29];let F;e[30]!==f.state||e[31]!==_?(F=()=>_(f.state.values),e[30]=f.state,e[31]=_,e[32]=F):F=e[32];let h;e[33]!==s||e[34]!==n||e[35]!==F?(h={hasChanges:n,onChangeStep:s,save:F},e[33]=s,e[34]=n,e[35]=F,e[36]=h):h=e[36];const{changeStep:ne,pendingStep:re}=qe(h);if(x)return null;let me;e[37]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(Ue,{children:"Customize your website"}),e[37]=me):me=e[37];let L;e[38]!==f?(L=P=>{P.preventDefault(),P.stopPropagation(),f.handleSubmit()},e[38]=f,e[39]=L):L=e[39];const de=re??"links";let z;e[40]!==ne||e[41]!==de?(z=t.jsx(Ie,{active:de,onChangeStep:ne}),e[40]=ne,e[41]=de,e[42]=z):z=e[42];const Y=re!==null;let se;e[43]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx(ut,{className:"size-5"}),e[43]=se):se=e[43];let J;e[44]!==f.AppField?(J=t.jsx("div",{children:t.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[se,t.jsx("div",{className:"flex-1",children:t.jsx(f.AppField,{name:"website",children:St})})]})}),e[44]=f.AppField,e[45]=J):J=e[45];let ie;e[46]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Je,{size:20}),e[46]=ie):ie=e[46];let O;e[47]!==f.AppField?(O=t.jsx("div",{children:t.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[ie,t.jsx("div",{className:"flex-1",children:t.jsx(f.AppField,{name:"instagram",children:kt})})]})}),e[47]=f.AppField,e[48]=O):O=e[48];let M;e[49]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Ge,{size:20}),e[49]=M):M=e[49];let G;e[50]!==f.AppField?(G=t.jsx("div",{children:t.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[M,t.jsx("div",{className:"flex-1",children:t.jsx(f.AppField,{name:"tiktok",children:yt})})]})}),e[50]=f.AppField,e[51]=G):G=e[51];let I;e[52]!==Y||e[53]!==J||e[54]!==O||e[55]!==G?(I=t.jsxs(Me,{isSaving:Y,children:[J,O,G]}),e[52]=Y,e[53]=J,e[54]=O,e[55]=G,e[56]=I):I=e[56];let K;e[57]!==z||e[58]!==I?(K=t.jsxs("div",{className:"py-2 px-4 flex flex-col gap-2",children:[z,I]}),e[57]=z,e[58]=I,e[59]=K):K=e[59];let B;e[60]!==L||e[61]!==K?(B=t.jsx("form",{onSubmit:L,children:K}),e[60]=L,e[61]=K,e[62]=B):B=e[62];let E;e[63]!==r?(E=t.jsx($,{variant:"secondary",fullWidth:!0,onClick:r,children:"Cancel"}),e[63]=r,e[64]=E):E=e[64];const X=te||re!==null;let R;e[65]!==f?(R=()=>{f.handleSubmit()},e[65]=f,e[66]=R):R=e[66];let V;e[67]!==X||e[68]!==R?(V=t.jsx($,{variant:"primary",fullWidth:!0,disabled:X,onClick:R,children:"Apply"}),e[67]=X,e[68]=R,e[69]=V):V=e[69];let W;e[70]!==E||e[71]!==V?(W=t.jsxs(ze,{variant:"inline",children:[E,V]}),e[70]=E,e[71]=V,e[72]=W):W=e[72];let q;return e[73]!==B||e[74]!==W?(q=t.jsxs(t.Fragment,{children:[me,B,W]}),e[73]=B,e[74]=W,e[75]=q):q=e[75],q}function yt(a){return t.jsx(a.TextField,{fullWidth:!0,label:"Tiktok handle"})}function kt(a){return t.jsx(a.TextField,{fullWidth:!0,label:"Instagram handle"})}function St(a){return t.jsx(a.TextField,{fullWidth:!0,label:"Website",className:"flex-1"})}function _t(a){return a.isSubmitting}const Ct=a=>new Promise((e,s)=>{const r=new FileReader;
1r.readAsDataURL(a),r.onload=function(){e(r.result)},r.onerror=function(c){s(c)}}),wt=U.object({callToAction:U.string(),locale:U.enum(["en","pt-BR","de","fr","es"]).nullable(),location:U.string().max(255,"Bio must be 255 characters or fewer"),secondaryCallToAction:U.string()});function Nt(a){const e=D.c(90),{onChangeStep:s,onDismiss:r}=a,{toast:c}=We(),{personId:l}=Fe(),[i,o]=Q.useState(null),u=ee.useUtils(),m=!!l;let x;e[0]!==m?(x={enabled:m},e[0]=m,e[1]=x):x=e[1];const{data:d,isLoading:j}=ee.getPersonalHomepage.useQuery(l||"",x);let b;e[2]!==l||e[3]!==u?(b=async()=>{await u.getPersonalHomepage.invalidate(l)},e[2]=l,e[3]=u,e[4]=b):b=e[4];let v;e[5]!==c?(v=()=>{c({title:"Error",description:"Couldn't save your changes. Please try again.",variant:"error"})},e[5]=c,e[6]=v):v=e[6];let y;e[7]!==b||e[8]!==v?(y={onSuccess:b,onError:v},e[7]=b,e[8]=v,e[9]=y):y=e[9];const{mutateAsync:_}=ee.updatePersonalHomepage.useMutation(y),k=d?.callToAction||at,p=d?.locale;let g;e[10]!==p?(g=ht(p),e[10]=p,e[11]=g):g=e[11];const T=d?.location||"",C=d?.secondaryCallToAction||nt;let w;e[12]!==C||e[13]!==k||e[14]!==g||e[15]!==T?(w={callToAction:k,locale:g,location:T,secondaryCallToAction:C},e[12]=C,e[13]=k,e[14]=g,e[15]=T,e[16]=w):w=e[16];const S=w;let H;e[17]!==l||e[18]!==_||e[19]!==i||e[20]!==u?(H=async A=>{i&&(await $e(l,"profile_image",i.file),await u.getOnboardingStatus.invalidate(l),await u.getPersonProfileImageUrl.invalidate(l),await u.getPersonSettings.invalidate(l)),await _({personId:l,callToAction:A.callToAction,locale:A.locale,location:A.location,secondaryCallToAction:A.secondaryCallToAction})},e[17]=l,e[18]=_,e[19]=i,e[20]=u,e[21]=H):H=e[21];const f=H;let te;e[22]===Symbol.for("react.memo_cache_sentinel")?(te={onChange:wt},e[22]=te):te=e[22];let n;e[23]!==r||e[24]!==f?(n=async A=>{const{value:Se}=A;await f(Se),r()},e[23]=r,e[24]=f,e[25]=n):n=e[25];let F;e[26]!==S||e[27]!==n?(F={defaultValues:S,validators:te,onSubmit:n},e[26]=S,e[27]=n,e[28]=F):F=e[28];const h=De(F);let ne,re;e[29]!==h||e[30]!==S?(ne=()=>{h.reset(S)},re=[S,h],e[29]=h,e[30]=S,e[31]=ne,e[32]=re):(ne=e[31],re=e[32]),Q.useEffect(ne,re);const me=He(h.store,Ut);let L;e[33]!==c?(L=async(A,Se)=>{if(A.length===0&&Se.length>0){c({title:"Error",description:"Invalid file type. Please upload an image.",variant:"error"});return}const Ae=await Ct(A[0]);o({file:A[0],dataUrl:Ae})},e[33]=c,e[34]=L):L=e[34];const de=L;let z;e[35]!==h.state||e[36]!==S||e[37]!==i?(z=()=>i!==null||!Le(h.state.values,S),e[35]=h.state,e[36]=S,e[37]=i,e[38]=z):z=e[38];let Y;e[39]!==h.state||e[40]!==f?(Y=()=>f(h.state.values),e[39]=h.state,e[40]=f,e[41]=Y):Y=e[41];let se;e[42]!==s||e[43]!==z||e[44]!==Y?(se={hasChanges:z,onChangeStep:s,save:Y},e[42]=s,e[43]=z,e[44]=Y,e[45]=se):se=e[45];const{changeStep:J,pendingStep:ie}=qe(se);if(j)return null;let O;e[46]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ue,{children:"Customize your website"}),e[46]=O):O=e[46];let M;e[47]!==h?(M=A=>{A.preventDefault(),A.stopPropagation(),h.handleSubmit()},e[47]=h,e[48]=M):M=e[48];const G=ie??"personal";let I;e[49]!==J||e[50]!==G?(I=t.jsx(Ie,{active:G,onChangeStep:J}),e[49]=J,e[50]=G,e[51]=I):I=e[51];const K=ie!==null;let B;e[52]!==d?.profileImagePath||e[53]!==i?.dataUrl?(B=A=>{const{getInputProps:Se,getRootProps:Ae,isDragActive:Be}=A;return t.jsxs("div",{className:"flex flex-row justify-between items-center gap-2 cursor-pointer",...Ae(),children:[Be&&t.jsx("div",{className:"h-18 items-center justify-center flex flex-1 bg-white rounded-md border-2 border-dashed border-ink-black-100",children:"Drop here"}),!Be&&t.jsxs("div",{className:"flex flex-row items-center gap-4",children:[t.jsx(Ke,{pictureUrl:i?.dataUrl||d?.profileImagePath,size:72,ring:!1}),t.jsx($,{className:"focus:outline-none",tabIndex:-1,variant:"primary",size:"sm",children:"Upload Profile Image"})]}),t.jsx("input",{...Se()})]})},e[52]=d?.profileImagePath,e[53]=i?.dataUrl,e[54]=B):B=e[54];let E;e[55]!==de||e[56]!==B?(E=t.jsx(Xe,{children:t.jsx(mt,{accept:et,onDrop:de,maxFiles:1,multiple:!1,children:B})}),e[55]=de,e[56]=B,e[57]=E):E=e[57];let X,R,V;e[58]!==h.AppField?(X=t.jsx("div",{children:t.jsx(h.AppField,{name:"location",children:Pt})}),R=t.jsx("div",{children:t.jsx(h.AppField,{name:"callToAction",children:At})}),V=t.jsx("div",{children:t.jsx(h.AppField,{name:"secondaryCallToAction",children:Ft})}),e[58]=h.AppField,e[59]=X,e[60]=R,e[61]=V):(X=e[59],R=e[60],V=e[61]);let W;e[62]!==h.Field?(W=t.jsx("div",{children:t.jsx(h.Field,{name:"locale",children:Tt})}),e[62]=h.Field,e[63]=W):W=e[63];let q;e[64]!==K||e[65]!==E||e[66]!==X||e[67]!==R||e[68]!==V||e[69]!==W?(q=t.jsxs(Me,{isSaving:K,children:[E,X,R,V,W]}),e[64]=K,e[65]=E,e[66]=X,e[67]=R,e[68]=V,e[69]=W,e[70]=q):q=e[70];let P;e[71]!==I||e[72]!==q?(P=t.jsxs("div",{className:"p-2 flex flex-col gap-2",children:[I,q]}),e[71]=I,e[72]=q,e[73]=P):P=e[73];let Z;e[74]!==M||e[75]!==P?(Z=t.jsx("form",{onSubmit:M,children:P}),e[74]=M,e[75]=P,e[76]=Z):Z=e[76];let oe;e[77]!==r?(oe=t.jsx($,{variant:"secondary",fullWidth:!0,onClick:r,children:"Cancel"}),e[77]=r,e[78]=oe):oe=e[78];const ke=me||ie!==null;
1let ce;e[79]!==h?(ce=()=>{h.handleSubmit()},e[79]=h,e[80]=ce):ce=e[80];let fe;e[81]!==ke||e[82]!==ce?(fe=t.jsx($,{variant:"primary",fullWidth:!0,disabled:ke,onClick:ce,children:"Apply"}),e[81]=ke,e[82]=ce,e[83]=fe):fe=e[83];let he;e[84]!==oe||e[85]!==fe?(he=t.jsxs(ze,{variant:"inline",children:[oe,fe]}),e[84]=oe,e[85]=fe,e[86]=he):he=e[86];let _e;return e[87]!==Z||e[88]!==he?(_e=t.jsxs(t.Fragment,{children:[O,Z,he]}),e[87]=Z,e[88]=he,e[89]=_e):_e=e[89],_e}function Tt(a){return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("label",{className:"text-sm text-ink-black-700",htmlFor:"locale-select",children:"Booking flow language"}),t.jsxs(be,{value:a.state.value??"auto",onValueChange:e=>a.handleChange(e==="auto"?null:e),children:[t.jsx(je,{id:"locale-select",children:t.jsx(ve,{})}),t.jsxs(ye,{children:[t.jsx(N,{value:"auto",children:"Auto-detect (visitor's browser)"}),t.jsx(N,{value:"en",children:"English"}),t.jsx(N,{value:"pt-BR",children:"Português (Brasil)"}),t.jsx(N,{value:"de",children:"Deutsch"}),t.jsx(N,{value:"fr",children:"Français"}),t.jsx(N,{value:"es",children:"Español"})]})]})]})}function Ft(a){return t.jsx(a.TextField,{fullWidth:!0,label:"Secondary Call to Action",maxLength:30})}function At(a){return t.jsx(a.TextField,{fullWidth:!0,label:"Call to Action",maxLength:30})}function Pt(a){return t.jsx(a.TextField,{fullWidth:!0,label:"Bio",placeholder:"Add a bio, current city or status",maxLength:255})}function Ut(a){return a.isSubmitting}function Ce(a){const e=D.c(6),{value:s,onValueChange:r}=a;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ue,{size:"sm",children:"Font"}),e[0]=c):c=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(je,{children:t.jsx(ve,{placeholder:"Font"})}),e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ye,{className:"max-h-[200px] w-fit",children:lt.map(zt)}),e[2]=i):i=e[2];let o;return e[3]!==r||e[4]!==s?(o=t.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[c,t.jsxs(be,{value:s,onValueChange:r,children:[l,i]})]}),e[3]=r,e[4]=s,e[5]=o):o=e[5],o}function zt(a){return t.jsx(N,{value:a,children:t.jsx("div",{className:a,children:a})},a)}function we(a){const e=D.c(6),{value:s,onValueChange:r}=a;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ue,{size:"sm",className:"text-nowrap",children:"Font size"}),e[0]=c):c=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(je,{children:t.jsx(ve,{placeholder:"Font Size"})}),e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(ye,{className:"max-h-[200px] w-fit",children:[t.jsx(N,{value:"sm",children:"Small"}),t.jsx(N,{value:"md",children:"Medium"}),t.jsx(N,{value:"lg",children:"Large"})]}),e[2]=i):i=e[2];let o;return e[3]!==r||e[4]!==s?(o=t.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[c,t.jsxs(be,{value:s,onValueChange:r,children:[l,i]})]}),e[3]=r,e[4]=s,e[5]=o):o=e[5],o}function ae(a){const e=D.c(11),{label:s,value:r,onChange:c,className:l}=a;let i;e[0]!==l?(i=ge("flex flex-row gap-2 items-center",l),e[0]=l,e[1]=i):i=e[1];let o;e[2]!==s?(o=t.jsx(ue,{size:"sm",className:"text-nowrap",children:s}),e[2]=s,e[3]=o):o=e[3];let u;e[4]!==c||e[5]!==r?(u=t.jsx("input",{type:"color",value:r,onChange:c}),e[4]=c,e[5]=r,e[6]=u):u=e[6];let m;return e[7]!==i||e[8]!==o||e[9]!==u?(m=t.jsxs("div",{className:i,children:[o,u]}),e[7]=i,e[8]=o,e[9]=u,e[10]=m):m=e[10],m}function Ve(a){const e=D.c(6),{value:s,onValueChange:r}=a;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ue,{size:"sm",className:"text-nowrap",children:"Shape"}),e[0]=c):c=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(je,{children:t.jsx(ve,{placeholder:"Shape"})}),e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(ye,{className:"max-h-[200px] w-fit",children:[t.jsx(N,{value:"circle",children:"Circle"}),t.jsx(N,{value:"round",children:"Round"}),t.jsx(N,{value:"soft",children:"Soft"}),t.jsx(N,{value:"square",children:"Square"})]}),e[2]=i):i=e[2];let o;return e[3]!==r||e[4]!==s?(o=t.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[c,t.jsxs(be,{value:s,onValueChange:r,children:[l,i]})]}),e[3]=r,e[4]=s,e[5]=o):o=e[5],o}function Pe(a){const e=D.c(6),{value:s,onValueChange:r}=a;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ue,{size:"sm",className:"text-nowrap",children:"Uppercase"}),e[0]=c):c=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(je,{children:t.jsx(ve,{placeholder:"Uppercase"})}),e[1]=l):l=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(ye,{className:"max-h-[200px] w-fit",children:[t.jsx(N,{value:"yes",children:"Yes"}),t.jsx(N,{value:"no",children:"No"})]}),e[2]=i):i=e[2];let o;return e[3]!==r||e[4]!==s?(o=t.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[c,t.jsxs(be,{value:s,onValueChange:r,children:[l,i]})]}),e[3]=r,e[4]=s,e[5]=o):o=e[5],o}const Ze={heading:{sm:"24px",md:"32px",lg:"48px"},body:{sm:"10px",md:"14px",lg:"18px"},button:{sm:"11px",md:"15px",lg:"19px"}},Ne=(a,e)=>Ze[e][a],Te=(a,e)=>Object.entries(Ze[e]).find(([,s])=>s===a)?.[0];function It({onChangeStep:a,onDismiss:e}){const{theme:s,themeId:r,applyThemeById:c,applyTheme:l,restoreTheme:i}=tt(),{personId:o}=Fe(),[u,m]=Q.useState("theme"),[x,d]=Q.useState(!1),j=ee.useUtils(),{data:b}=ee.getPersonalHomepage.useQuery(o,{enabled:!!o}),{mutateAsync:v,isPending:y}=ee.updatePersonalHomepage.useMutation({onSuccess:async()=>
1{await j.getPersonalHomepage.invalidate(o)}}),{mutateAsync:_}=ee.updatePerson.useMutation({onSuccess:async()=>{await j.getPersonalHomepage.invalidate(o)}}),k=Q.useRef(null),p=Q.useRef(null),g=()=>{i(),e()},T=async()=>{await v({personId:o,themeId:s.id??null,theme:s})},C=async n=>{n.preventDefault(),T(),e()},w=async n=>{T(),a(n)},S=async n=>{const F=n.target.files?.[0];if(!(!F||!o)){d(!0);try{await $e(o,"artist_website_background_image",F),await j.getPersonalHomepage.invalidate(o)}catch(h){console.error("Failed to upload background image:",h)}finally{d(!1),p.current&&(p.current.value="")}}},H=async()=>{if(o){d(!0);try{await _({personId:o,artistWebsiteBackgroundImageUrl:null})}catch(n){console.error("Failed to remove background image:",n)}finally{d(!1)}}},f=b?.artistWebsiteBackgroundImageUrl,te=y||x;return t.jsxs(t.Fragment,{children:[t.jsx(Ue,{children:"Customize your website"}),t.jsx("form",{onSubmit:C,ref:k,children:t.jsxs("div",{className:"p-2 flex flex-col gap-2",children:[t.jsx(Ie,{active:"theme",onChangeStep:w}),t.jsx("div",{children:t.jsxs(pt,{value:u,onValueChange:n=>m(n),children:[t.jsxs(xt,{className:"flex-wrap h-auto",children:[t.jsx(pe,{value:"theme",children:"Theme"}),t.jsx(pe,{value:"heading",children:"Heading"}),t.jsx(pe,{value:"body",children:"Body"}),t.jsx(pe,{value:"primary_button",children:"Primary button"}),t.jsx(pe,{value:"secondary_button",children:"Secondary button"}
1),t.jsx(pe,{value:"background",children:"Background"})]}),t.jsx(xe,{value:"theme",children:t.jsxs(be,{disabled:te,value:s.id??"",onValueChange:c,children:[t.jsx(je,{children:t.jsx(ve,{placeholder:"Select Theme"})}),t.jsxs(ye,{className:"max-h-[200px] w-fit",children:[r===Ee&&t.jsx(N,{value:Ee,children:"Custom"}),Object.entries(st).map(([n,F])=>t.jsx(N,{value:n,children:F.name},n))]})]})}),t.jsx(xe,{value:"heading",children:t.jsxs("div",{className:"flex flex-col gap-2 p-2 border rounded-md border-ink-black-100",children:[t.jsx(Ce,{value:s.heading.font_family??le.heading.font_family,onValueChange:n=>{s&&l({...s,heading:{...s.heading,font_family:n}})}}),t.jsx(we,{value:Te(s.heading.font_size??"md","heading"),onValueChange:n=>{s&&l({...s,heading:{...s.heading,font_size:Ne(n,"heading")}})}}),t.jsx(ae,{label:"Text color",value:s.heading.text_color,onChange:n=>{s&&l({...s,heading:{...s.heading,text_color:n.target.value}})}}),t.jsx(Pe,{value:s.heading.uppercase?"yes":"no",onValueChange:n=>{s&&l({...s,heading:{...s.heading,uppercase:n==="yes"}})}})]})}),t.jsx(xe,{value:"body",children:t.jsxs("div",{className:"flex flex-col gap-2 p-2 border rounded-md border-ink-black-100",children:[t.jsx(Ce,{value:s.body.font_family??le.body.font_family,onValueChange:n=>{s&&l({...s,body:{...s.body,font_family:n}})}}),t.jsx(we,{value:Te(s.body.font_size??le.body.font_size,"body"),onValueChange:n=>{s&&l({...s,body:{...s.body,font_size:Ne(n,"body")}})}}),t.jsx(ae,{label:"Text color",value:s.body.text_color,onChange:n=>{s&&l({...s,body:{...s.body,text_color:n.target.value}})}})]})}),t.jsx(xe,{value:"primary_button",children:t.jsxs("div",{className:"flex flex-col gap-2 p-2 border rounded-md border-ink-black-100",children:[t.jsxs("div",{className:"flex flex-row gap-2 justify-between",children:[t.jsx(ae,{className:"flex-col",label:"Fill color",value:s.buttons.primary.fill_color,onChange:n=>{s&&l({...s,buttons:{...s.buttons,primary:{...s.buttons.primary,fill_color:n.target.value}}})}}),t.jsx(ae,{className:"flex-col",label:"Text color",value:s.buttons.primary.text_color,onChange:n=>{s&&l({...s,buttons:{...s.buttons,primary:{...s.buttons.primary,text_color:n.target.value}}})}}),t.jsx(ae,{className:"flex-col",label:"Border color",value:s.buttons.primary.border_color??le.buttons.primary.border_color,onChange:n=>{s&&l({...s,buttons:{...s.buttons,primary:{...s.buttons.primary,border_color:n.target.value}}})}})]}),t.jsx(Ce,{value:s.buttons.primary.font_family??le.buttons.primary.font_family,onValueChange:n=>{s&&l({...s,buttons:{...s.buttons,primary:{...s.buttons.primary,font_family:n}}})}}),t.jsx(we,{value:Te(s.buttons.primary.font_size??le.buttons.primary.font_size,"button"),onValueChange:n=>{s&&l({...s,buttons:{...s.buttons,primary:{...s.buttons.primary,font_size:Ne(n,"button")}}})}}),t.jsx(Ve,{value:s.buttons.primary.shape??"square",onValueChange:n=>{s&&l({...s,buttons:{...s.buttons,primary:{...s.buttons.primary,shape:n}}})}}),t.jsx(Pe,{value:s.buttons.primary.uppercase?"yes":"no",onValueChange:n=>{s&&l({...s,buttons:{...s.buttons,primary:{...s.buttons.primary,uppercase:n==="yes"}}})}})]})}),t.jsx(xe,{value:"secondary_button",children:t.jsxs("div",{className:"flex flex-col gap-2 p-2 border rounded-md border-ink-black-100",children:[t.jsxs("div",{className:"flex flex-row gap-2 justify-between",children:[t.jsx(ae,{className:"flex-col",label:"Fill color",value:s.buttons.secondary.fill_color,onChange:n=>{s&&l({...s,buttons:{...s.buttons,secondary:{...s.buttons.secondary,fill_color:n.target.value}}})}}),t.jsx(ae,{className:"flex-col",label:"Text color",value:s.buttons.secondary.text_color,onChange:n=>{s&&l({...s,buttons:{...s.buttons,secondary:{...s.buttons.secondary,text_color:n.target.value}}})}}),t.jsx(ae,{className:"flex-col",label:"Border color",value:s.buttons.secondary.border_color??le.buttons.secondary.border_color,onChange:n=>{s&&l({...s,buttons:{...s.buttons,secondary:{...s.buttons.secondary,border_color:n.target.value}}})}})]}),t.jsx(Ce,{value:s.buttons.secondary.font_family??le.buttons.secondary.font_family,onValueChange:n=>{s&&l({...s,buttons:{...s.buttons,secondary:{...s.buttons.secondary,font_family:n}}})}}),t.jsx(we,{value:Te(s.buttons.secondary.font_size??le.buttons.secondary.font_size,"button"),onValueChange:n=>{s&&l({...s,buttons:{...s.buttons,secondary:{...s.buttons.secondary,font_size:Ne(n,"button")}}})}}),t.jsx(Ve,{value:s.buttons.secondary.shape??"square",onValueChange:n=>{s&&l({...s,buttons:{...s.buttons,secondary:{...s.buttons.secondary,shape:n}}})}}),t.jsx(Pe,{value:s.buttons.secondary.uppercase?"yes":"no",onValueChange:n=>{s&&l({...s,buttons:{...s.buttons,secondary:{...s.buttons.secondary,uppercase:n==="yes"}}})}})]})}),t.jsx(xe,{value:"background",children:t.jsxs("div",{className:"flex flex-col gap-2 p-2 border rounded-md border-ink-black-100",children:[t.jsx(ae,{label:"Fill color",value:s.background.fill_color,onChange:n=>{s&&l({...s,background:{...s.background,fill_color:n.target.value}})}}),t.jsxs("div",{className:"flex flex-col gap-2 mt-4",children:[t.jsx(ue,{size:"sm",variant:"heading",children:"Custom Backgroun
1d Image"}),f?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"relative w-full h-32 rounded-md overflow-hidden border border-ink-black-100",children:t.jsx("img",{src:f,alt:"Background preview",className:"w-full h-full object-cover"})}),t.jsx($,{variant:"secondary",onClick:H,disabled:x,children:"Remove Custom Background"})]}):t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("input",{ref:p,type:"file",accept:"image/*",onChange:S,className:"hidden",id:"background-image-upload"}),t.jsx("label",{htmlFor:"background-image-upload",children:t.jsxs($,{variant:"secondary",disabled:x,onClick:()=>p.current?.click(),className:"w-full",children:[t.jsx(ft,{className:"mr-2 size-4"}),x?"Uploading...":"Upload Custom Background"]})}),t.jsx(ue,{size:"sm",className:"font-normal text-ink-black-400",children:"Upload an image to replace the theme's default background. Max 1600px, converted to WebP."})]})]})]})})]})})]})}),t.jsxs(ze,{variant:"inline",children:[t.jsx($,{variant:"secondary",fullWidth:!0,onClick:g,children:"Cancel"}),t.jsx($,{variant:"primary",fullWidth:!0,disabled:te,onClick:()=>gt(k),children:"Apply"})]})]})}const Bt=["links","personal","theme"],Et=a=>a!==null&&Bt.includes(a);function Rt(a){const e=D.c(26),{initialStep:s,onHidden:r}=a,[c,l]=Q.useState(s??"personal"),[i,o]=Q.useState(!0);let u,m;e[0]!==s?(u=()=>{l(s??"personal")},m=[s],e[0]=s,e[1]=u,e[2]=m):(u=e[1],m=e[2]),Q.useEffect(u,m);let x;e[3]!==r?(x=()=>{o(!1),r()},e[3]=r,e[4]=x):x=e[4];const d=x;let j;e[5]!==d?(j=T=>{T||d()},e[5]=d,e[6]=j):j=e[6];const b=c==="theme"?"border-t border-x border-ink-black-100":void 0,v=c==="theme"?"bg-transparent dark:bg-transparent backdrop-blur-none":void 0;let y;e[7]!==d||e[8]!==c?(y=c==="theme"&&t.jsx(It,{onChangeStep:l,onDismiss:d}),e[7]=d,e[8]=c,e[9]=y):y=e[9];let _;e[10]!==d||e[11]!==c?(_=c==="personal"&&t.jsx(Nt,{onChangeStep:l,onDismiss:d}),e[10]=d,e[11]=c,e[12]=_):_=e[12];let k;e[13]!==d||e[14]!==c?(k=c==="links"&&t.jsx(vt,{onChangeStep:l,onDismiss:d}),e[13]=d,e[14]=c,e[15]=k):k=e[15];let p;e[16]!==b||e[17]!==v||e[18]!==y||e[19]!==_||e[20]!==k?(p=t.jsxs(it,{showClose:!1,className:b,overlayClassName:v,children:[y,_,k]}),e[16]=b,e[17]=v,e[18]=y,e[19]=_,e[20]=k,e[21]=p):p=e[21];let g;return e[22]!==i||e[23]!==p||e[24]!==j?(g=t.jsx(ot,{open:i,onOpenChange:j,children:p}),e[22]=i,e[23]=p,e[24]=j,e[25]=g):g=e[25],g}function cs(){const a=D.c(7),e=Oe(),[s]=dt();let r;if(a[0]!==s){const o=s.get("step");r=Et(o)?o:void 0,a[0]=s,a[1]=r}else r=a[1];const c=r;let l;a[2]!==e?(l=()=>{e("../",{preventScrollReset:!0})},a[2]=e,a[3]=l):l=a[3];let i;return a[4]!==c||a[5]!==l?(i=t.jsx(rt,{extraPaddingBottom:!0,children:t.jsx(Rt,{initialStep:c,onHidden:l})}),a[4]=c,a[5]=l,a[6]=i):i=a[6],i}export{cs as default}; 2 3//# chunkId=01a0f45b-c79d-7373-8e26-63a4fd5ebefd
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.