1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._posthogReleaseId=e._posthogReleaseId||"01a0d059-0dc8-0000-0784-6ee3765120be";var n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="4220145b-d4b0-5c1e-bbe2-1d35acd54f4c")}catch(e){}}();import{r as z,j as t}from"./1_rjLJJT.js";import{c as $,u as Z,t as L,cc as he,B as O,cE as ne,cF as oe,cG as ae,ae as ve,af as Se,U as ke,L as Je,o as Me,cu as Ye,am as Xe,T as me,Q as Re,b2 as et,O as tt,dO as st}from"./BzLaZ4LI.js";import{g as we,c as Ae,f as Ie,j as Fe,e as Pe,a as Ce,D as Ne,k as lt,m as it}from"./B8Gh17e6.js";import{u as ue,L as Te}from"./CJi0kXOi.js";import{b as Ue,a as ze,c as He,e as Ve,D as Oe,d as qe}from"./CqYXRKlk.js";import{R as Ke,D as Ge,v as nt,aR as Be}from"./CF1GVhvA.js";import{u as ce,a as re,f as _e}from"./BEc5voS0.js";import{r as ge}from"./TbZLusC8.js";import{z as I}from"./BiUYuhao.js";import{m as Qe,z as ot,e as at}from"./DQ0Kz3Tt.js";import{g as $e}from"./DsKN6oxK.js";import{d as be}from"./BkkCmsdY.js";import{T as ye}from"./CwRjIYSi.js";import{a as We}from"./9r5vtoby.js";import{A as rt}from"./D1yjItRL.js";import{a as ct}from"./v9ZcMP--.js";import"./BnWyCVyG.js";import"./eOhqpjg0.js";import"./B7eBE0o_.js";import"./CZEInz57.js";import"./CGkMmlqZ.js";import"./BJkpDQtF.js";import"./GCROyQFE.js";function dt(s){const e=$.c(39),{onHidden:n}=s,[i,y]=z.useState(!0),{personId:c,handle:r}=Z(),_=L.useUtils();let x;e[0]!==c||e[1]!==_?(x=async()=>{_.getPersonInternal.invalidate(c),_.getPersonSettings.invalidate(c),_.getProviderFromRoute.invalidate(),y(!1)},e[0]=c,e[1]=_,e[2]=x):x=e[2];const{mutateAsync:f,isPending:v}=L.archivePerson.useMutation({onSuccess:x,onError:D=>{const M=he(D);N(M||D.message)}}),[P,F]=z.useState(void 0),N=F;let E;e[3]!==c||e[4]!==f||e[5]!==N?(E=async()=>{N(void 0),await f({personId:c})},e[3]=c,e[4]=f,e[5]=N,e[6]=E):E=e[6];const u=E,k=(r?`@${r}`:void 0)??c??"User";let h;e[7]!==n||e[8]!==i?(h=()=>{i||n()},e[7]=n,e[8]=i,e[9]=h):h=e[9];let S;e[10]!==k?(S=t.jsxs(we,{children:["Archive ",k,"?"]}),e[10]=k,e[11]=S):S=e[11];let l;e[12]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(Ae,{children:"This action is disruptive."}),e[12]=l):l=e[12];let m;e[13]!==S?(m=t.jsxs(Ie,{children:[S,l]}),e[13]=S,e[14]=m):m=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[t.jsxs("ul",{className:"list-disc list-inside space-y-2",children:[t.jsx("li",{children:"For all intents and purposes they will behave like they are no longer part of the platform."}),t.jsx("li",{children:"Their handle will be available for reuse"}),t.jsx("li",{children:"They can sign up again using the same email address"}),t.jsx("li",{children:"The artist and their clients will no longer receive notifications (email, SMS, push)"}),t.jsx("li",{children:"Existing pending requests (new and accepted) will behave as archived"}),t.jsx("li",{children:"The artist will be unsubscribed from e-mail marketing"}),t.jsx("li",{children:"Their Stripe account will remain available for our records"})]}),t.jsx("p",{})]}),e[15]=w):w=e[15];let p;e[16]!==P?(p=P&&t.jsx("div",{className:"font-medium text-center text-ink-destructive mt-4",children:P}),e[16]=P,e[17]=p):p=e[17];let o;e[18]!==p?(o=t.jsxs("div",{className:"px-4",children:[w,p]}),e[18]=p,e[19]=o):o=e[19];let a;e[20]!==v?(a=t.jsx(Fe,{asChild:!0,children:t.jsx(O,{disabled:v,variant:"secondary",children:"Cancel"})}),e[20]=v,e[21]=a):a=e[21];let d;e[22]!==u?(d=()=>u(),e[22]=u,e[23]=d):d=e[23];
1const g=v?"Archiving...":`Archive ${k}`;let j;e[24]!==v||e[25]!==d||e[26]!==g?(j=t.jsx(O,{onClick:d,disabled:v,variant:"destructive",children:g}),e[24]=v,e[25]=d,e[26]=g,e[27]=j):j=e[27];let b;e[28]!==a||e[29]!==j?(b=t.jsxs(Pe,{children:[a,j]}),e[28]=a,e[29]=j,e[30]=b):b=e[30];let A;e[31]!==o||e[32]!==b||e[33]!==h||e[34]!==m?(A=t.jsxs(Ce,{showClose:!1,onAnimationEndCapture:h,children:[m,o,b]}),e[31]=o,e[32]=b,e[33]=h,e[34]=m,e[35]=A):A=e[35];let C;return e[36]!==i||e[37]!==A?(C=t.jsx(Ne,{open:i,onOpenChange:y,children:A}),e[36]=i,e[37]=A,e[38]=C):C=e[38],C}function js(){const s=$.c(2),e=ue();let n;return s[0]!==e?(n=t.jsx(dt,{onHidden:()=>{e("../",{preventScrollReset:!0})}}),s[0]=e,s[1]=n):n=s[1],n}function mt(s){const e=$.c(33),{onHidden:n}=s,[i,y]=z.useState(!0),{personId:c}=Z(),r=L.useUtils();let _;e[0]!==c||e[1]!==r?(_=async()=>{r.getPersonInternal.invalidate(c),r.getPersonSettings.invalidate(c),r.getProviderFromRoute.invalidate(),y(!1)},e[0]=c,e[1]=r,e[2]=_):_=e[2];const{mutateAsync:x,isPending:f}=L.disableLogin.useMutation({onSuccess:_,onError:j=>{const b=he(j);F(b||j.message)}}),[v,P]=z.useState(void 0),F=P;let N;e[3]!==c||e[4]!==x||e[5]!==F?(N=async()=>{F(void 0),await x({personId:c,isDisabled:!0})},e[3]=c,e[4]=x,e[5]=F,e[6]=N):N=e[6];const E=N;let u;e[7]!==n||e[8]!==i?(u=()=>{i||n()},e[7]=n,e[8]=i,e[9]=u):u=e[9];let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ue,{children:"Disable Login?"}),e[10]=k):k=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(ze,{children:[k,t.jsx(Ke,{children:t.jsx(He,{children:"Prevents the user from logging in to the app."})})]}),e[11]=h):h=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsxs("ul",{className:"list-disc list-inside text-left text-sm",children:[t.jsx("li",{children:"User will no longer be able to access the app"}),t.jsx("li",{children:"Usually done when we suspect fraud"}),t.jsx("li",{children:"Can only be reversed manually by engineering"})]}),e[12]=S):S=e[12];let l;e[13]!==v?(l=v&&t.jsx("div",{className:"font-medium text-center text-ink-destructive mt-4",children:v}),e[13]=v,e[14]=l):l=e[14];let m;e[15]!==l?(m=t.jsxs("div",{children:[S,l]}),e[15]=l,e[16]=m):m=e[16];let w;e[17]!==f?(w=t.jsx(Ge,{asChild:!0,children:t.jsx(O,{variant:"secondary",disabled:f,children:"Cancel"})}),e[17]=f,e[18]=w):w=e[18];const p=f?"Disabling....":"Disable";let o;e[19]!==E||e[20]!==f||e[21]!==p?(o=t.jsx(O,{variant:"destructive",onClick:E,disabled:f,children:p}),e[19]=E,e[20]=f,e[21]=p,e[22]=o):o=e[22];let a;e[23]!==w||e[24]!==o?(a=t.jsxs(Ve,{children:[w,o]}),e[23]=w,e[24]=o,e[25]=a):a=e[25];let d;e[26]!==a||e[27]!==u||e[28]!==m?(d=t.jsxs(Oe,{showClose:!1,onAnimationEndCapture:u,children:[h,m,a]}),e[26]=a,e[27]=u,e[28]=m,e[29]=d):d=e[29];let g;return e[30]!==i||e[31]!==d?(g=t.jsx(qe,{open:i,onOpenChange:y,children:d}),e[30]=i,e[31]=d,e[32]=g):g=e[32],g}function ys(){const s=$.c(2),e=ue();let n;return s[0]!==e?(n=t.jsx(mt,{onHidden:()=>{e("../",{preventScrollReset:!0})}}),s[0]=e,s[1]=n):n=s[1],n}function ut(s){const e=$.c(35),{onHidden:n}=s,{personId:i}=Z(),[y,c]=z.useState(!1),r=L.useUtils(),_=z.useRef(null),x=!!i;let f;e[0]!==x?(f={enabled:x},e[0]=x,e[1]=f):f=e[1];const{data:v,isLoading:P}=L.getPersonInternal.useQuery(i,f);let F;e[2]!==r?(F={onSuccess:async()=>{await r.getPersonInternal.invalidate()}},e[2]=r,e[3]=F):F=e[3];const{mutateAsync:N}=L.updatePersonInternal.useMutation(F),E=v?!v.useTypeformForCustomRequests:!1;let u;e[4]!==E?(u={allowInkform:E},e[4]=E,e[5]=u):u=e[5];let k;e[6]===Symbol.for("react.memo_cache_sentinel")?(k={onChange:I.object({allowInkform:I.boolean()})},e[6]=k):k=e[6];let h;e[7]!==i||e[8]!==N?(h=async C=>{const{value:D}=C;await N({personId:i,useTypeformForCustomRequests:!D.allowInkform}),c(!0)},e[7]=i,e[8]=N,e[9]=h):h=e[9];let S;e[10]!==u||e[11]!==h?(S={defaultValues:u,validators:k,onSubmit:h},e[10]=u,e[11]=h,e[12]=S):S=e[12];const l=ce(S);if(P||!i||!v)return null;let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"Allow Inkform for custom requests"}),t.jsx(ne,{setHide:c})]}),e[13]=m):m=e[13];let w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(O,{variant:"secondary",onClick:()=>c(!0),children:"Cancel"}),e[14]=w):w=e[14];let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=()=>ge(_),e[15]=p):p=e[15];let o;
1e[16]!==l.SubmitButton?(o=t.jsx(l.SubmitButton,{onClick:p,children:"Apply"}),e[16]=l.SubmitButton,e[17]=o):o=e[17];let a;e[18]!==l.AppForm||e[19]!==o?(a=t.jsxs("div",{className:"flex flex-row justify-between",children:[w,t.jsx(l.AppForm,{children:o})]}),e[18]=l.AppForm,e[19]=o,e[20]=a):a=e[20];let d;e[21]!==l?(d=C=>{C.preventDefault(),l.handleSubmit()},e[21]=l,e[22]=d):d=e[22];let g;e[23]!==l.AppField?(g=t.jsx("div",{className:"p-4",children:t.jsx("div",{className:"flex flex-col gap-4",children:t.jsx(l.AppField,{name:"allowInkform",children:ft})})}),e[23]=l.AppField,e[24]=g):g=e[24];let j;e[25]!==d||e[26]!==g?(j=t.jsx("form",{onSubmit:d,ref:_,children:g}),e[25]=d,e[26]=g,e[27]=j):j=e[27];let b;e[28]!==a||e[29]!==j?(b=t.jsx(oe,{headerSlot:m,footerSlot:a,children:j}),e[28]=a,e[29]=j,e[30]=b):b=e[30];let A;return e[31]!==y||e[32]!==n||e[33]!==b?(A=t.jsx(ae,{hide:y,onHidden:n,children:b}),e[31]=y,e[32]=n,e[33]=b,e[34]=A):A=e[34],A}function ft(s){return t.jsxs("div",{className:"flex flex-row gap-2",children:[t.jsx(s.CheckboxField,{id:"allow-inkform-checkbox"}),t.jsx("label",{htmlFor:"allow-inkform-checkbox",children:"Allow Inkform for custom requests"})]})}function de(s){const e=$.c(5),{sheet:n}=s,i=ue();let y;e[0]!==i?(y=()=>{i("../",{preventScrollReset:!0})},e[0]=i,e[1]=y):y=e[1];let c;return e[2]!==n||e[3]!==y?(c=t.jsx(n,{onHidden:y}),e[2]=n,e[3]=y,e[4]=c):c=e[4],c}function vs(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(de,{sheet:ut}),s[0]=e):e=s[0],e}function ht(s){const e=$.c(41),{onHidden:n}=s,{personId:i}=Z(),y=!!i;let c;e[0]!==y?(c={enabled:y},e[0]=y,e[1]=c):c=e[1];const{data:r,isLoading:_}=L.getPersonInternal.useQuery(i,c),x=L.useUtils();let f;e[2]!==x?(f={onSuccess:async()=>{await x.getPersonInternal.invalidate()}},e[2]=x,e[3]=f):f=e[3];const{mutateAsync:v}=L.updatePersonInternal.useMutation(f),[P,F]=z.useState(!1),N=z.useRef(null),E=r?.bookingDescription??"";let u;e[4]!==E?(u={bookingDescription:E},e[4]=E,e[5]=u):u=e[5];let k;e[6]===Symbol.for("react.memo_cache_sentinel")?(k={onChange:I.object({bookingDescription:I.string().pipe(Qe.shape.bookingDescription)})},e[6]=k):k=e[6];let h;e[7]!==i||e[8]!==v?(h=async R=>{const{value:U}=R;await v({personId:i,bookingDescription:U.bookingDescription}),F(!0)},e[7]=i,e[8]=v,e[9]=h):h=e[9];let S;e[10]!==u||e[11]!==h?(S={defaultValues:u,validators:k,onSubmit:h},e[10]=u,e[11]=h,e[12]=S):S=e[12];const l=ce(S);if(_)return null;let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsxs("div",{className:"font-semibold text-2xl font-impactful",children:["Artist",t.jsx(nt,{className:"inline-block size-4"}),"Booking description"]}),t.jsx(ne,{setHide:F})]}),e[13]=m):m=e[13];let w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(O,{variant:"secondary",onClick:()=>F(!0),children:"Cancel"}),e[14]=w):w=e[14];let p;e[15]===Symbol.for("react.memo_cache_sentinel")?(p=()=>ge(N),e[15]=p):p=e[15];let o;
1e[16]!==l.SubmitButton?(o=t.jsx(l.SubmitButton,{onClick:p,children:"Apply"}),e[16]=l.SubmitButton,e[17]=o):o=e[17];let a;e[18]!==l.AppForm||e[19]!==o?(a=t.jsxs("div",{className:"flex flex-row justify-between",children:[w,t.jsx(l.AppForm,{children:o})]}),e[18]=l.AppForm,e[19]=o,e[20]=a):a=e[20];let d;e[21]!==l?(d=R=>{R.preventDefault(),l.handleSubmit()},e[21]=l,e[22]=d):d=e[22];let g;e[23]!==l.AppField?(g=t.jsx(l.AppField,{name:"bookingDescription",children:pt}),e[23]=l.AppField,e[24]=g):g=e[24];let j;e[25]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("strong",{className:"font-bold",children:"old"}),e[25]=j):j=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("br",{}),e[26]=b):b=e[26];let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("strong",{className:"font-bold",children:"new"}),e[27]=A):A=e[27];let C;e[28]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs("div",{className:"text-ink-black text-sm text-left pl-2",children:["Shown on ",j," Artist landing page.",b,"The ",A," Artist landing page does ",t.jsx("strong",{className:"font-bold",children:"not"})," show this anywhere."]}),e[28]=C):C=e[28];let D;e[29]!==g?(D=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"flex flex-col gap-3",children:[g,C]})}),e[29]=g,e[30]=D):D=e[30];let M;e[31]!==d||e[32]!==D?(M=t.jsx("form",{onSubmit:d,ref:N,children:D}),e[31]=d,e[32]=D,e[33]=M):M=e[33];let T;e[34]!==a||e[35]!==M?(T=t.jsx(oe,{headerSlot:m,footerSlot:a,children:M}),e[34]=a,e[35]=M,e[36]=T):T=e[36];let B;return e[37]!==P||e[38]!==n||e[39]!==T?(B=t.jsx(ae,{hide:P,onHidden:n,children:T}),e[37]=P,e[38]=n,e[39]=T,e[40]=B):B=e[40],B}function pt(s){return t.jsx(s.RichTextField,{placeholder:"Share instructions to clients considering booking the Artist."})}function Ss(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(de,{sheet:ht}),s[0]=e):e=s[0],e}function le(s){const e=$.c(51),{column:n,label:i,onHidden:y}=s,{personId:c}=Z(),r=!!c;let _;e[0]!==r?(_={enabled:r},e[0]=r,e[1]=_):_=e[1];const{data:x,isLoading:f}=L.getPersonInternal.useQuery(c,_),v=L.useUtils();let P;e[2]!==v?(P={onSuccess:async()=>{await v.getPersonInternal.invalidate()}},e[2]=v,e[3]=P):P=e[3];const{mutateAsync:F}=L.updatePersonInternal.useMutation(P),[N,E]=z.useState(!1),u=z.useRef(null);let k;e[4]!==n||e[5]!==x?(k=x?.[n]?.toString()??"",e[4]=n,e[5]=x,e[6]=k):k=e[6];let h;e[7]!==k?(h={fieldValue:k},e[7]=k,e[8]=h):h=e[8];let S;e[9]!==n?(S=I.object({fieldValue:I.string().pipe(Qe.shape[n])}),e[9]=n,e[10]=S):S=e[10];let l;e[11]!==S?(l={onChange:S},e[11]=S,e[12]=l):l=e[12];let m;e[13]!==n||e[14]!==c||e[15]!==F?(m=async U=>{const{value:V}=U;await F({personId:c,[n]:V.fieldValue}),E(!0)},e[13]=n,e[14]=c,e[15]=F,e[16]=m):m=e[16];let w;e[17]!==h||e[18]!==l||e[19]!==m?(w={defaultValues:h,validators:l,onSubmit:m},e[17]=h,e[18]=l,e[19]=m,e[20]=w):w=e[20];const p=ce(w);if(f)return null;let o;e[21]!==i?(o=t.jsxs("div",{className:"font-semibold text-2xl font-impactful",children:["Update ",i]}),e[21]=i,e[22]=o):o=e[22];let a;e[23]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ne,{setHide:E}),e[23]=a):a=e[23];let d;e[24]!==o?(d=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[o,a]}),e[24]=o,e[25]=d):d=e[25];let g;e[26]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(O,{variant:"secondary",onClick:()=>E(!0),children:"Cancel"}),e[26]=g):g=e[26];let j;e[27]===Symbol.for("react.memo_cache_sentinel")?(j=()=>ge(u),e[27]=j):j=e[27];let b;e[28]!==p.SubmitButton?(b=t.jsx(p.SubmitButton,{onClick:j,children:"Apply"}),e[28]=p.SubmitButton,e[29]=b):b=e[29];let A;e[30]!==p.AppForm||e[31]!==b?(A=t.jsxs("div",{className:"flex flex-row justify-between",children:[g,t.jsx(p.AppForm,{children:b})]}),e[30]=p.AppForm,e[31]=b,e[32]=A):A=e[32];let C;e[33]!==p?(C=U=>{U.preventDefault(),p.handleSubmit()},e[33]=p,e[34]=C):C=e[34];let D;e[35]!==i?(D=U=>t.jsx(U.TextField,{fullWidth:!0,label:i}),e[35]=i,e[36]=D):D=e[36];let M;e[37]!==p.AppField||e[38]!==D?(M=t.jsx("div",{className:"p-4",children:t.jsx("div",{className:"flex flex-col gap-2",children:t.jsx(p.AppField,{name:"fieldValue",children:D})})}),e[37]=p.AppField,e[38]=D,e[39]=M):M=e[39];let T;e[40]!==C||e[41]!==M?(T=t.jsx("form",{onSubmit:C,ref:u,children:M}),e[40]=C,e[41]=M,e[42]=T):T=e[42];let B;e[43]!==d||e[44]!==A||e[45]!==T?(B=t.jsx(oe,{headerSlot:d,footerSlot:A,children:T}),e[43]=d,e[44]=A,e[45]=T,e[46]=B):B=e[46];let R;return e[47]!==N||e[48]!==y||e[49]!==B?(R=t.jsx(ae,{hide:N,onHidden:y,children:B}),e[47]=N,e[48]=y,e[49]=B,e[50]=R):R=e[50],R}function ie(s){const e=$.c(8),{column:n,label:i,sheet:y}=s,{personId:c}=Z(),r=ue();if(!c){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ve,{code:Se.hookUseProviderFromRoute}),e[0]=f):f=e[0],f}let _;e[1]!==r?(_=()=>{r("../",{preventScrollReset:!0})}
1,e[1]=r,e[2]=_):_=e[2];let x;return e[3]!==y||e[4]!==n||e[5]!==i||e[6]!==_?(x=t.jsx(y,{column:n,label:i,onHidden:_}),e[3]=y,e[4]=n,e[5]=i,e[6]=_,e[7]=x):x=e[7],x}function _s(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"bookingMethod",label:"Booking method"}),s[0]=e):e=s[0],e}function ks(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"bookingSystem",label:"Booking system"}),s[0]=e):e=s[0],e}function ws(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"bookingsPerMonth",label:"Bookings per month"}),s[0]=e):e=s[0],e}const xt=({paymentSettings:s,feeType:e})=>{if(e==="deposit")return s.depositPlatformFeeBasisPoints;if(e==="full_payment")return s.fullPaymentPlatformFeeBasisPoints;throw new Error(`unknown feeType ${e}`)};function gt(s){const e=$.c(49),{paymentSettings:n,feeType:i,onHidden:y}=s;let c;e[0]!==i||e[1]!==n?(c=xt({paymentSettings:n,feeType:i}),e[0]=i,e[1]=n,e[2]=c):c=e[2];const r=c,_=L.useUtils(),[x,f]=z.useState(!0);let v;e[3]!==r?(v=()=>(r/100).toString(),e[3]=r,e[4]=v):v=e[4];const[P,F]=z.useState(v),[N,E]=z.useState("");let u;e[5]!==n||e[6]!==_?(u=()=>{_.getPaymentSettings.invalidate(n.personId),f(!1)},e[5]=n,e[6]=_,e[7]=u):u=e[7];let k;e[8]===Symbol.for("react.memo_cache_sentinel")?(k=U=>{const V=he(U);E(V||U.message)},e[8]=k):k=e[8];let h;e[9]!==u?(h={onSuccess:u,onError:k},e[9]=u,e[10]=h):h=e[10];const{mutateAsync:S,isPending:l}=L.upsertAdminPaymentSettings.useMutation(h);let m;e[11]!==P||e[12]!==i||e[13]!==n||e[14]!==S?(m=async()=>{E(""),i==="deposit"&&await S({personId:n.personId,depositPlatformFeeBasisPoints:Number(P)*100}),i==="full_payment"&&await S({personId:n.personId,fullPaymentPlatformFeeBasisPoints:Number(P)*100})},e[11]=P,e[12]=i,e[13]=n,e[14]=S,e[15]=m):m=e[15];const w=m,p=i==="deposit"?"Deposit Platform Fee":"Full Payment Platform Fee";let o;e[16]!==r?(o=U=>{f(U),U||F((r/100).toString())},e[16]=r,e[17]=o):o=e[17];let a;e[18]!==y||e[19]!==x?(a=()=>{x||y()},e[18]=y,e[19]=x,e[20]=a):a=e[20];let d;e[21]!==p?(d=t.jsxs(we,{className:"text-center",children:["Venue ",p]}),e[21]=p,e[22]=d):d=e[22];let g;e[23]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ae,{className:"text-center",children:"The fee that Venue collects for providing its service."}),e[23]=g):g=e[23];let j;e[24]!==d?(j=t.jsxs(Ie,{children:[d,g]}),e[24]=d,e[25]=j):j=e[25];let b;e[26]!==P?(b=t.jsxs("div",{className:"text-7xl font-extralight text-ink-black-900 text-center",children:[P,"%"]}),e[26]=P,e[27]=b):b=e[27];let A;e[28]!==N?(A=t.jsx(ke,{errors:[N],className:"justify-center"}),e[28]=N,e[29]=A):A=e[29];let C;e[30]!==P?(C=t.jsx(lt,{onChangeValue:F,value:P,maximumFractionDigits:2}),e[30]=P,e[31]=C):C=e[31];let D;e[32]!==b||e[33]!==A||e[34]!==C?(D=t.jsxs("div",{className:"p-4 flex flex-col gap-6",children:[b,A,C]}),e[32]=b,e[33]=A,e[34]=C,e[35]=D):D=e[35];let M;e[36]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Fe,{asChild:!0,children:t.jsx(O,{variant:"secondary",children:"Cancel"})}),e[36]=M):M=e[36];let T;e[37]!==w||e[38]!==l?(T=t.jsxs(Pe,{variant:"inline",children:[M,t.jsx(O,{variant:"primary",fullWidth:!0,onClick:w,disabled:l,children:"Update fee"})]}),e[37]=w,e[38]=l,e[39]=T):T=e[39];let B;e[40]!==j||e[41]!==D||e[42]!==T||e[43]!==a?(B=t.jsxs(Ce,{onAnimationEndCapture:a,children:[j,D,T]}),e[40]=j,e[41]=D,e[42]=T,e[43]=a,e[44]=B):B=e[44];let R;return e[45]!==x||e[46]!==B||e[47]!==o?(R=t.jsx(Ne,{open:x,onOpenChange:o,children:B}),e[45]=x,e[46]=B,e[47]=o,e[48]=R):R=e[48],R}
1function Ze(s){const e=$.c(11),{feeType:n}=s,{personId:i}=Z(),y=!!i;let c;e[0]!==y?(c={enabled:y},e[0]=y,e[1]=c):c=e[1];const{data:r,isLoading:_}=L.getPaymentSettings.useQuery(i,c),x=ue();if(_){let P;return e[2]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Je,{}),e[2]=P):P=e[2],P}if(!i){let P;return e[3]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(ve,{code:Se.hookUseProviderFromRoute}),e[3]=P):P=e[3],P}if(!r){let P;return e[4]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(ve,{code:Se.getPaymentSettings}),e[4]=P):P=e[4],P}let f;e[5]!==x?(f=()=>{x("../",{preventScrollReset:!0})},e[5]=x,e[6]=f):f=e[6];let v;return e[7]!==n||e[8]!==r||e[9]!==f?(v=t.jsx(gt,{paymentSettings:r,feeType:n,onHidden:f}),e[7]=n,e[8]=r,e[9]=f,e[10]=v):v=e[10],v}function As(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ze,{feeType:"deposit"}),s[0]=e):e=s[0],e}function bt(s){const e=$.c(48),{onHidden:n}=s,{personId:i}=Z(),y=!!i;let c;e[0]!==y?(c={enabled:y},e[0]=y,e[1]=c):c=e[1];const{data:r,isLoading:_}=L.getPersonInternal.useQuery(i,c),x=L.useUtils();let f;e[2]!==x?(f={onSuccess:async()=>{await x.getPersonInternal.invalidate()}},e[2]=x,e[3]=f):f=e[3];const{mutateAsync:v,isPending:P,error:F}=L.generatePersonExternalApiKey.useMutation(f),[N,E]=z.useState(!1);let u;e[4]!==r||e[5]!==v?(u=async()=>{r?.personId&&await v(r.personId)},e[4]=r,e[5]=v,e[6]=u):u=e[6];const k=u;if(_||!r)return null;let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"Personal external API key"}),t.jsx(ne,{setHide:E})]}),e[7]=h):h=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(O,{variant:"secondary",onClick:()=>E(!0),children:"Close"}),e[8]=S):S=e[8];let l;e[9]!==k||e[10]!==P?(l=t.jsxs("div",{className:"flex flex-row justify-between",children:[S,t.jsx(O,{variant:"primary",disabled:P,onClick:k,children:"Generate"})]}),e[9]=k,e[10]=P,e[11]=l):l=e[11];const m=r.externalApiKey?.api_key?r.externalApiKey.api_key:"No personal API key";let w;e[12]!==m?(w=t.jsx(Ye,{children:m}),e[12]=m,e[13]=w):w=e[13];let p;e[14]!==r.externalApiKey?(p=r.externalApiKey?.created_at_utc?$e(r.externalApiKey.created_at_utc,Me()):"",e[14]=r.externalApiKey,e[15]=p):p=e[15];let o;e[16]!==p?(o=t.jsxs("div",{children:["Created at:"," ",p]}),e[16]=p,e[17]=o):o=e[17];const a=r.externalApiKey?.created_by;let d;e[18]!==a?(d=t.jsxs("div",{children:["Created by: ",a]}),e[18]=a,e[19]=d):d=e[19];let g;e[20]!==r.externalApiKey?(g=r.externalApiKey?.last_updated_at_utc?$e(r.externalApiKey.last_updated_at_utc,Me()):"",e[20]=r.externalApiKey,e[21]=g):g=e[21];let j;e[22]!==g?(j=t.jsxs("div",{children:["Last updated at:"," ",g]}),e[22]=g,e[23]=j):j=e[23];const b=r.externalApiKey?.last_updated_by;let A;e[24]!==b?(A=t.jsxs("div",{children:["Last updated by: ",b]}),e[24]=b,e[25]=A):A=e[25];let C;e[26]!==r.isAdmin?(C=r.isAdmin&&t.jsxs("div",{className:"text-orange-500 flex gap-1 items-center",children:[t.jsx(Be,{className:"size-6"}),"API key will not have admin privileges"]}),e[26]=r.isAdmin,e[27]=C):C=e[27];let D;e[28]!==r.managedPersonIds.length?(D=r.managedPersonIds.length>0&&t.jsxs("div",{className:"text-orange-500 flex gap-1 items-center",children:[t.jsx(Be,{className:"size-6"}),"API key will inherit managed person IDs ability"]}),e[28]=r.managedPersonIds.length,e[29]=D):D=e[29];let M;e[30]!==F?(M=!!F&&t.jsx("div",{className:"text-red-500",children:F.message}),e[30]=F,e[31]=M):M=e[31];let T;e[32]!==o||e[33]!==d||e[34]!==j||e[35]!==A||e[36]!==C||e[37]!==D||e[38]!==M||e[39]!==w?(T=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[w,o,d,j,A,C,D,M]})}),e[32]=o,e[33]=d,e[34]=j,e[35]=A,e[36]=C,e[37]=D,e[38]=M,e[39]=w,e[40]=T):T=e[40];let B;e[41]!==T||e[42]!==l?(B=t.jsx(oe,{headerSlot:h,footerSlot:l,children:T}),e[41]=T,e[42]=l,e[43]=B):B=e[43];let R;return e[44]!==N||e[45]!==n||e[46]!==B?(R=t.jsx(ae,{hide:N,onHidden:n,children:B}),e[44]=N,e[45]=n,e[46]=B,e[47]=R):R=e[47],R}function Is(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(de,{sheet:bt}),s[0]=e):e=s[0],e}function Fs(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ze,{feeType:"full_payment"}),s[0]=e):e=s[0],e}const Le=[{value:"DEFAULT",label:"Default (auto)",hint:"Follow the auto-eligibility rules (past payout history, etc.)"},{value:"ELIGIBLE",label:"Eligible (manual override)",hint:"Force eligible regardless of auto rules"},{value:"INELIGIBLE",label:"Ineligible (paused)",hint:"Block instant payouts; artist sees the paused drawer"}];function jt(s){const e=$.c(37),{onHidden:n}=s,{personId:i}=Z(),[y,c]=z.useState(!1),r=L.useUtils(),_=!!i;let x;
1e[0]!==_?(x={enabled:_},e[0]=_,e[1]=x):x=e[1];const{data:f,isLoading:v}=L.getPaymentSettings.useQuery(i,x);let P;e[2]!==i||e[3]!==r?(P={onSuccess:()=>{r.getPaymentSettings.invalidate(i)}},e[2]=i,e[3]=r,e[4]=P):P=e[4];const{mutateAsync:F,isPending:N}=L.upsertAdminPaymentSettings.useMutation(P),E=f?.instantPayoutEligibility??"DEFAULT";let u;e[5]!==f?(u=f?.weeklyInstantPayoutLimitCents?(f.weeklyInstantPayoutLimitCents/100).toString():"",e[5]=f,e[6]=u):u=e[6];let k;e[7]!==E||e[8]!==u?(k={eligibility:E,weeklyLimit:u},e[7]=E,e[8]=u,e[9]=k):k=e[9];let h;e[10]!==i||e[11]!==F?(h=async A=>{const{value:C}=A;await F({personId:i,instantPayoutEligibility:C.eligibility,weeklyInstantPayoutLimitCents:C.weeklyLimit!==""?Math.round(parseFloat(C.weeklyLimit)*100):null}),c(!0)},e[10]=i,e[11]=F,e[12]=h):h=e[12];let S;e[13]!==k||e[14]!==h?(S={defaultValues:k,onSubmit:h},e[13]=k,e[14]=h,e[15]=S):S=e[15];const l=ce(S);if(v||!i||!f)return null;let m;e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"Edit Instant Payout Limits"}),t.jsx(ne,{setHide:c})]}),e[16]=m):m=e[16];let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(O,{variant:"secondary",onClick:()=>c(!0),children:"Cancel"}),e[17]=w):w=e[17];let p;e[18]!==l?(p=()=>{l.handleSubmit()},e[18]=l,e[19]=p):p=e[19];let o;e[20]!==N||e[21]!==p?(o=t.jsxs("div",{className:"flex flex-row justify-between",children:[w,t.jsx(O,{variant:"primary",disabled:N,onClick:p,children:"Apply"})]}),e[20]=N,e[21]=p,e[22]=o):o=e[22];let a;e[23]!==l?(a=A=>{A.preventDefault(),A.stopPropagation(),l.handleSubmit()},e[23]=l,e[24]=a):a=e[24];let d;e[25]!==l.AppField?(d=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(l.AppField,{name:"eligibility",children:vt}),t.jsx(l.AppField,{name:"weeklyLimit",children:yt})]})}),e[25]=l.AppField,e[26]=d):d=e[26];let g;e[27]!==a||e[28]!==d?(g=t.jsx("form",{onSubmit:a,children:d}),e[27]=a,e[28]=d,e[29]=g):g=e[29];let j;
1e[30]!==o||e[31]!==g?(j=t.jsx(oe,{headerSlot:m,footerSlot:o,children:g}),e[30]=o,e[31]=g,e[32]=j):j=e[32];let b;return e[33]!==y||e[34]!==n||e[35]!==j?(b=t.jsx(ae,{hide:y,onHidden:n,children:j}),e[33]=y,e[34]=n,e[35]=j,e[36]=b):b=e[36],b}function yt(s){return t.jsx(s.TextField,{label:"Weekly instant payout limit override (default is $1000)",type:"number",fullWidth:!0})}function vt(s){const e=Le.find(n=>n.value===s.state.value);return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("span",{className:"text-sm font-medium",children:"Instant payout eligibility"}),t.jsx(s.SelectField,{placeholder:"Default (auto)",children:Le.map(St)}),e&&t.jsx("span",{className:"text-xs text-ink-black-500",children:e.hint})]})}function St(s){return t.jsx(be,{value:s.value,children:s.label},s.value)}function Ps(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(de,{sheet:jt}),s[0]=e):e=s[0],e}function Cs(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"marketingAdSpendPerMonth",label:"Marketing ad spend per month"}),s[0]=e):e=s[0],e}function Ns(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"marketingSource",label:"Marketing source"}),s[0]=e):e=s[0],e}function Ds(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"notes",label:"Notes"}),s[0]=e):e=s[0],e}function Es(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"numberOfInstagramFollowers",label:"# of Instagram followers"}),s[0]=e):e=s[0],e}function Ms(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"numberOfInstagramPosts",label:"# of Instagram posts"}),s[0]=e):e=s[0],e}function _t(s){const e=$.c(36),{onHidden:n}=s,{personId:i}=Z(),[y,c]=z.useState(!1),r=L.useUtils(),_=z.useRef(null),x=!!i;let f;e[0]!==x?(f={enabled:x},e[0]=x,e[1]=f):f=e[1];const{data:v,isLoading:P}=L.getPaymentSettings.useQuery(i,f);let F;e[2]!==i||e[3]!==r?(F={onSuccess:()=>{r.getPaymentSettings.invalidate(i)}},e[2]=i,e[3]=r,e[4]=F):F=e[4];const{mutateAsync:N}=L.upsertAdminPaymentSettings.useMutation(F),E=v?.isPaymentLinkImmediatelyEligible===!0;let u;e[5]!==E?(u={isImmediatelyEligible:E},e[5]=E,e[6]=u):u=e[6];let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k={onChange:I.object({isImmediatelyEligible:I.boolean()})},e[7]=k):k=e[7];let h;e[8]!==i||e[9]!==N?(h=async C=>{const{value:D}=C;await N({personId:i,isPaymentLinkImmediatelyEligible:D.isImmediatelyEligible}),c(!0)},e[8]=i,e[9]=N,e[10]=h):h=e[10];let S;e[11]!==u||e[12]!==h?(S={defaultValues:u,validators:k,onSubmit:h},e[11]=u,e[12]=h,e[13]=S):S=e[13];const l=ce(S);if(P||!i||!v)return null;let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"Edit Payment Link Eligibility"}),t.jsx(ne,{setHide:c})]}),e[14]=m):m=e[14];let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(O,{variant:"secondary",onClick:()=>c(!0),children:"Cancel"}),e[15]=w):w=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=()=>ge(_),e[16]=p):p=e[16];let o;e[17]!==l.SubmitButton?(o=t.jsx(l.SubmitButton,{onClick:p,children:"Apply"}),e[17]=l.SubmitButton,e[18]=o):o=e[18];let a;e[19]!==l.AppForm||e[20]!==o?(a=t.jsxs("div",{className:"flex flex-row justify-between",children:[w,t.jsx(l.AppForm,{children:o})]}),e[19]=l.AppForm,e[20]=o,e[21]=a):a=e[21];let d;e[22]!==l?(d=C=>{C.preventDefault(),l.handleSubmit()},e[22]=l,e[23]=d):d=e[23];let g;e[24]!==l.AppField?(g=t.jsx("div",{className:"p-4",children:t.jsx("div",{className:"flex flex-col gap-4",children:t.jsx(l.AppField,{name:"isImmediatelyEligible",children:kt})})}),e[24]=l.AppField,e[25]=g):g=e[25];let j;e[26]!==d||e[27]!==g?(j=t.jsx("form",{onSubmit:d,ref:_,children:g}),e[26]=d,e[27]=g,e[28]=j):j=e[28];let b;e[29]!==a||e[30]!==j?(b=t.jsx(oe,{headerSlot:m,footerSlot:a,children:j}),e[29]=a,e[30]=j,e[31]=b):b=e[31];let A;return e[32]!==y||e[33]!==n||e[34]!==b?(A=t.jsx(ae,{hide:y,onHidden:n,children:b}),e[32]=y,e[33]=n,e[34]=b,e[35]=A):A=e[35],A}function kt(s){return t.jsxs("div",{className:"flex flex-row gap-2",children:[t.jsx(s.CheckboxField,{id:"payment-link-eligibility-checkbox"}),t.jsx("label",{htmlFor:"payment-link-eligibility-checkbox",children:"Make manually eligible"})]})}function Ts(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(de,{sheet:_t}),s[0]=e):e=s[0],e}function Bs(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"providerLegalName",label:"Artist's legal name"}),s[0]=e):e=s[0],e}function $s(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"segment",label:"Segment"}),s[0]=e):e=s[0],e}function Ls(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ie,{sheet:le,column:"websiteUrl",label:"Website address"}),s[0]=e):e=s[0],e}I.object({providerId:I.string()});I.object({campaignId:I.string()});
1I.object({campaignId:I.string(),cursor:I.string().nullish(),limit:I.number().int().min(1).max(100).optional(),search:I.string().trim().optional()});I.object({campaignId:I.string(),addClientIds:I.array(I.string()),removeTouchPointIds:I.array(I.string())});I.object({personId:I.string(),view:I.enum(["draft","sent"]).optional()});I.object({campaignId:I.string()});I.object({personId:I.string(),name:I.string().trim().min(1).max(255),body:I.string().trim().min(1).max(5e3)});I.object({id:I.string(),name:I.string().trim().min(1).max(255),body:I.string().trim().min(1).max(5e3),tag:I.string().trim().min(1).max(12)});I.object({id:I.string()});I.object({id:I.string()});I.object({ids:I.array(I.string())});I.object({trackingCode:I.string(),action:I.enum(["open","click"])});const wt=I.object({personId:I.string(),amount:I.number().int().positive(),referenceId:I.string().trim().optional(),note:I.string().trim().max(255).optional()});I.object({personId:I.string()});I.object({chatMessageIds:I.array(I.string())});I.object({touchPointId:I.string(),action:I.enum(["optIn","optOut"])});function At(s){const e=$.c(62),{onHidden:n}=s,{personId:i}=Z(),{toast:y}=Xe(),c=L.useUtils(),[r,_]=z.useState(!1),[x,f]=z.useState(""),[v,P]=z.useState(""),[F,N]=z.useState(""),E=z.useRef(null);let u;e[0]!==i?(u={personId:i},e[0]=i,e[1]=u):u=e[1];const k=!!i;let h;e[2]!==k?(h={enabled:k},e[2]=k,e[3]=h):h=e[3];const{data:S,isLoading:l}=L.marketingBlasts.getMarketingCreditBalance.useQuery(u,h);let m;e[4]!==y||e[5]!==c?(m=q=>{const{balance:se}=q;c.marketingBlasts.getMarketingCreditBalance.invalidate(),y({title:"Credits granted",description:`New balance: ${se.toLocaleString()} credits`,variant:"success"}),f(""),P(""),N("")},e[4]=y,e[5]=c,e[6]=m):m=e[6];let w;e[7]!==y?(w=q=>{y({title:"Failed to grant credits",description:q.message,variant:"error"})},e[7]=y,e[8]=w):w=e[8];let p;e[9]!==m||e[10]!==w?(p={onSuccess:m,onError:w},e[9]=m,e[10]=w,e[11]=p):p=e[11];const{mutate:o,isPending:a}=L.marketingBlasts.grantMarketingCredits.useMutation(p);let d,g;if(e[12]!==x||e[13]!==o||e[14]!==F||e[15]!==i||e[16]!==v){d=se=>{se.preventDefault(),se.stopPropagation(),g&&o({personId:i,amount:parseInt(x,10),referenceId:v||void 0,note:F||void 0})};let q;e[19]!==x||e[20]!==F||e[21]!==i||e[22]!==v?(q=wt.safeParse({personId:i??"",amount:parseInt(x,10),referenceId:v||void 0,note:F||void 0}),e[19]=x,e[20]=F,e[21]=i,e[22]=v,e[23]=q):q=e[23],g=q.success,e[12]=x,e[13]=o,e[14]=F,e[15]=i,e[16]=v,e[17]=d,e[18]=g}else d=e[17],g=e[18];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(me,{variant:"heading",size:"2xl",children:"Marketing Blast Credits"}),e[24]=j):j=e[24];let b;e[25]!==S||e[26]!==l?(b=l?"...":S?S.balance.toLocaleString():"unknown",e[25]=S,e[26]=l,e[27]=b):b=e[27];let A;e[28]!==b?(A=t.jsxs("div",{children:[j,t.jsxs(me,{variant:"label",children:["Balance:"," ",b," ","credits"]})]}),e[28]=b,e[29]=A):A=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ne,{setHide:_}),e[30]=C):C=e[30];let D;e[31]!==A?(D=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[A,C]}),e[31]=A,e[32]=D):D=e[32];let M;e[33]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(me,{variant:"heading",size:"lg",children:"Grant Credits"}),e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=q=>f(q.target.value),e[34]=T):T=e[34];let B;e[35]!==x||e[36]!==a?(B=t.jsx(ye,{label:"Amount",type:"number",value:x,onChange:T,disabled:a}),e[35]=x,e[36]=a,e[37]=B):B=e[37];let R;e[38]===Symbol.for("react.memo_cache_sentinel")?(R=q=>P(q.target.value),e[38]=R):R=e[38];let U;e[39]!==a||e[40]!==v?(U=t.jsx(ye,{label:"Reference (optional)",value:v,onChange:R,disabled:a,hintText:"Primarily used for provider_message_template ID for blast deductions"}),e[39]=a,e[40]=v,e[41]=U):U=e[41];let V;e[42]===Symbol.for("react.memo_cache_sentinel")?(V=q=>N(q.target.value),e[42]=V):V=e[42];let G;e[43]!==a||e[44]!==F?(G=t.jsx(ye,{label:"Note (optional)",value:F,onChange:V,disabled:a}),e[43]=a,e[44]=F,e[45]=G):G=e[45];const Q=!g||a,W=a?"Granting...":"Grant credits";let H;e[46]!==Q||e[47]!==W?(H=t.jsx("button",{type:"submit",disabled:Q,className:"rounded-full px-4 py-2 text-sm bg-ink-black text-ink-white hover:bg-ink-black/90 disabled:opacity-50",children:W}),e[46]=Q,e[47]=W,e[48]=H):H=e[48];let J;e[49]!==d||e[50]!==B||e[51]!==U||e[52]!==G||e[53]!==H?(J=t.jsx("div",{className:"p-4 flex flex-col gap-6",children:t.jsxs("form",{ref:E,onSubmit:d,className:"flex flex-col gap-4",children:[M,B,U,G,H]})}),e[49]=d,e[50]=B,e[51]=U,e[52]=G,e[53]=H,e[54]=J):J=e[54];let Y;e[55]!==D||e[56]!==J?(Y=t.jsx(oe,{headerSlot:D,children:J}),e[55]=D,e[56]=J,e[57]=Y):Y=e[57];let te;return e[58]!==r||e[59]!==n||e[60]!==Y?(te=t.jsx(ae,{hide:r,onHidden:n,children:Y}),e[58]=r,e[59]=n,e[60]=Y,e[61]=te):te=e[61],te}function Rs(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(de,{sheet:At}),s[0]=e):e=s[0],e}const xe={"no-template":{name:"No template (copy from existing book)",typeformFormId:void 0,bookName:"",serviceTitle:"",maxAppointmentDurationMinutes:void 0,zeroDollarDepositsDisallowed:void 0},"touch-up":{name:"Touch up",typeformFormId:"okmbcBUh",bookName:"Touch up",serviceTitle:"Request a touch up",maxAppointmentDurationMinutes:60,zeroDollarDepositsDisallowed:!1},consult:{name:"Consult",typeformFormId:"gGes2ORq",bookName:"Consult",serviceTitle:"Request a consultation",maxAppointmentDurationMinutes:60,zeroDollarDepositsDisallowed:!1},pmu:{name:"PMU",typeformFormId:"OYBrIvEJ",bookName:"PMU",serviceTitle:"Request a PMU service",maxAppointmentDurationMinutes:null,zeroDollarDepositsDisallowed:!0},piercing:{name:"Piercing",typeformFormId:"DDrtR2oi",bookName:"Piercing",serviceTitle:"Request a piercing",maxAppointmentDurationMinutes:null,zeroDollarDepositsDisallowed:!0},"tooth-gems":{name:"Tooth gems",typeformFormId:"Rhcv4NDW",bookName:"Tooth Gems",serviceTitle:"Request a tooth gem",maxAppointmentDurationMinutes:null,zeroDollarDepositsDisallowed:!0}};function It(s){const e=$.c(73),{onHidden:n}=s,{personId:i}=Z(),y=!!i;let c;e[0]!==y?(c={enabled:y},e[0]=y,e[1]=c):c=e[1];const{data:r,isLoading:_}=L.getBookOptions.useQuery(i,c),x=!!i;let f;e[2]!==x?(f={enabled:x},e[2]=x,e[3]=f):f=e[3];const{data:v,isLoading:P}=L.getStudioOptions.useQuery(i,f),F=L.useUtils();let N;e[4]!==F?(N={onSuccess:async()=>{await F.getPersonSettings.invalidate()}},e[4]=F,e[5]=N):N=e[5];const{mutateAsync:E}=L.createBook.useMutation(N),[u,k]=z.useState(!1);let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h={template:"no-template",typeformSource:"book",name:"",serviceTitle:"",defaultStudioId:"",copyBookId:"",maxAppointmentDurationMinutes:"",zeroDollarDepositsDisallowedMode:"never"},e[6]=h):h=e[6];let S;e[7]!==E?(S={defaultValues:h,onSubmit:async K=>{const{value:X}=K,je=xe[X.template],ee=X.typeformSource==="template";await E({defaultStudioId:X.defaultStudioId,name:X.name,customFormTitle:X.serviceTitle||void 0,copyBookId:X.copyBookId,templateTypeformFormId:ee?je.typeformFormId:void 0,templateFormBodyKey:ee&&X.template!=="no-template"?X.template:void 0,maxAppointmentDurationMinutes:X.maxAppointmentDurationMinutes===""?null:Number(X.maxAppointmentDurationMinutes),zeroDollarDepositsDisallowed:X.zeroDollarDepositsDisallowedMode==="always"}),k(!0)}},e[7]=E,e[8]=S):S=e[8];const l=ce(S),m=re(l.store,Rt),w=re(l.store,Lt),p=re(l.store,$t);let o,a;if(e[9]!==l||e[10]!==m?(o=()=>
1{if(m){const K=xe[m];l.setFieldValue("typeformSource",m==="no-template"?"book":"template"),K.bookName&&l.setFieldValue("name",K.bookName),K.serviceTitle&&l.setFieldValue("serviceTitle",K.serviceTitle),K.maxAppointmentDurationMinutes!==void 0&&l.setFieldValue("maxAppointmentDurationMinutes",K.maxAppointmentDurationMinutes?.toString()||""),K.zeroDollarDepositsDisallowed!==void 0&&l.setFieldValue("zeroDollarDepositsDisallowedMode",K.zeroDollarDepositsDisallowed?"always":"never")}},a=[m,l],e[9]=l,e[10]=m,e[11]=o,e[12]=a):(o=e[11],a=e[12]),z.useEffect(o,a),_||P)return null;const d=p;let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"Add Book"}),t.jsx(ne,{setHide:k})]}),e[13]=g):g=e[13];let j;e[14]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(O,{variant:"secondary",onClick:()=>k(!0),children:"Cancel"}),e[14]=j):j=e[14];let b;e[15]!==l?(b=()=>{l.handleSubmit()},e[15]=l,e[16]=b):b=e[16];let A;e[17]!==d||e[18]!==b?(A=t.jsxs("div",{className:"flex flex-row justify-between",children:[j,t.jsx(O,{variant:"primary",disabled:d,onClick:b,children:"Create"})]}),e[17]=d,e[18]=b,e[19]=A):A=e[19];let C;e[20]!==l?(C=K=>{K.preventDefault(),K.stopPropagation(),l.handleSubmit()},e[20]=l,e[21]=C):C=e[21];let D;e[22]!==l.AppField?(D=t.jsx("div",{className:"",children:t.jsx(l.AppField,{name:"template",children:Tt})}),e[22]=l.AppField,e[23]=D):D=e[23];let M;e[24]===Symbol.for("react.memo_cache_sentinel")?(M={onChange:I.string().min(1,"Source Book is required")},e[24]=M):M=e[24];let T;e[25]!==r?(T=K=>t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{children:t.jsxs("label",{className:"flex flex-col gap-2",children:[t.jsx("div",{children:"Copy Book settings from"}),t.jsx(K.SelectField,{placeholder:"Source Book",className:"h-full",children:(r??[]).map(Mt)})]})}),t.jsx(me,{size:"sm",className:"text-gray-500",children:"Will copy booking terms, working hours, and many other settings from the selected book."})]}),e[25]=r,e[26]=T):T=e[26];let B;e[27]!==l.AppField||e[28]!==M||e[29]!==T?(B=t.jsx("div",{children:t.jsx(l.AppField,{name:"copyBookId",validators:M,children:T})}),e[27]=l.AppField,e[28]=M,e[29]=T,e[30]=B):B=e[30];let R;e[31]!==r||e[32]!==w||e[33]!==m?(R=K=>{const X=xe[m],je=r?.find(ee=>ee.id===w);return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(me,{size:"sm",children:"Typeform Source"}),t.jsx(K.RadioGroupField,{name:"typeformSource",disabled:m==="no-template",className:"flex flex-col gap-2",children:["template","book"].map(ee=>{const De=ee==="template"&&m==="no-template",Ee=ee==="template"?X.typeformFormId:je?.requestTypeformFormId;return t.jsxs("div",{className:"flex flex-row items-center gap-2",children:[t.jsxs(Re,{htmlFor:`tfs${ee}`,className:`flex flex-row gap-1 items-center ${De?"opacity-50 cursor-not-allowed":""}`,children:[t.jsx(We,{id:`tfs${ee}`,value:ee,disabled:De}),ee==="template"?"Use Template form (inkform or typeform)":"Use Book form (inkform or typeform)"]}),Ee&&t.jsx(et,{href:`https://admin.typeform.com/form/${Ee}/create`,className:"text-sm text-blue-600 hover:text-blue-800",children:"View typeform"})]},ee)})})]})},e[31]=r,e[32]=w,e[33]=m,e[34]=R):R=e[34];let U;e[35]!==l.AppField||e[36]!==R?(U=t.jsx("div",{children:t.jsx(l.AppField,{name:"typeformSource",children:R})}),e[35]=l.AppField,e[36]=R,e[37]=U):U=e[37];let V,G;e[38]!==l.AppField?(V=t.jsx("div",{children:t.jsx(l.AppField,{name:"name",children:Et})}),G=t.jsx("div",{children:t.jsx(l.AppField,{name:"serviceTitle",children:Dt})}),e[38]=l.AppField,e[39]=V,e[40]=G):(V=e[39],G=e[40]);let Q;e[41]===Symbol.for("react.memo_cache_sentinel")?(Q={onChange:I.string().pipe(ot.or(I.literal("")))},e[41]=Q):Q=e[41];let W;e[42]!==l.AppField||e[43]!==Q?(W=t.jsx("div",{children:t.jsx(l.AppField,{name:"maxAppointmentDurationMinutes",validators:Q,children:Nt})}),e[42]=l.AppField,e[43]=Q,e[44]=W):W=e[44];let H;e[45]!==l.AppField?(H=t.jsx("div",{children:t.jsx(l.AppField,{name:"zeroDollarDepositsDisallowedMode",children:Pt})}),e[45]=l.AppField,e[46]=H):H=e[46];let J;e[47]===Symbol.for("react.memo_cache_sentinel")?(J={onChange:I.str
1ing().min(1,"Studio is required")},e[47]=J):J=e[47];let Y;e[48]!==v?(Y=K=>t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(me,{size:"sm",children:"Studio"}),t.jsx("div",{children:t.jsx(K.SelectField,{placeholder:"Studio",className:"h-full",children:(v??[]).map(Ft)})})]}),e[48]=v,e[49]=Y):Y=e[49];let te;e[50]!==l.AppField||e[51]!==J||e[52]!==Y?(te=t.jsx("div",{children:t.jsx(l.AppField,{name:"defaultStudioId",validators:J,children:Y})}),e[50]=l.AppField,e[51]=J,e[52]=Y,e[53]=te):te=e[53];let q;e[54]!==D||e[55]!==B||e[56]!==U||e[57]!==V||e[58]!==G||e[59]!==W||e[60]!==H||e[61]!==te?(q=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[D,B,U,V,G,W,H,te]})}),e[54]=D,e[55]=B,e[56]=U,e[57]=V,e[58]=G,e[59]=W,e[60]=H,e[61]=te,e[62]=q):q=e[62];let se;e[63]!==C||e[64]!==q?(se=t.jsx("form",{onSubmit:C,children:q}),e[63]=C,e[64]=q,e[65]=se):se=e[65];let fe;e[66]!==A||e[67]!==se?(fe=t.jsx(oe,{headerSlot:g,footerSlot:A,children:se}),e[66]=A,e[67]=se,e[68]=fe):fe=e[68];let pe;return e[69]!==u||e[70]!==n||e[71]!==fe?(pe=t.jsx(ae,{hide:u,onHidden:n,children:fe}),e[69]=u,e[70]=n,e[71]=fe,e[72]=pe):pe=e[72],pe}function Ft(s){return t.jsx(be,{value:s.id,children:s.name},s.id)}function Pt(s){return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(me,{size:"sm",children:"$0 deposits"}),t.jsx(s.RadioGroupField,{name:"zeroDollarDepositsDisallowedMode",className:"flex flex-col gap-2",children:["never","always"].map(Ct)})]})}function Ct(s){return t.jsxs(Re,{htmlFor:`zdd${s}`,className:"flex flex-row gap-1 items-center",children:[t.jsx(We,{id:`zdd${s}`,value:s}),s==="never"?"Always allow $0 deposits":"Never allow $0 deposits"]},s)}function Nt(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Max. appointment duration (minutes)",type:"number",min:"0",placeholder:"Leave blank for no limit"})}function Dt(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Service Title"})}function Et(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Book Name"})}function Mt(s){return t.jsx(be,{value:s.id,children:s.name},s.id)}function Tt(s){return t.jsx("div",{className:"flex flex-col gap-2",children:t.jsx("div",{children:t.jsxs("label",{className:"flex flex-col gap-2",children:[t.jsx("div",{children:"Template"}),t.jsx(s.SelectField,{placeholder:"Select a template",className:"h-full",children:Object.entries(xe).map(Bt)})]})})})}function Bt(s){const[e,n]=s;return t.jsx(be,{value:e,children:n.name},e)}function $t(s){return s.isSubmitting}function Lt(s){return s.values.copyBookId}function Rt(s){return s.values.template}function Us(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(de,{sheet:It}),s[0]=e):e=s[0],e}const Ut=I.object({name:I.string().min(1,"Name is required"),googlePlaceId:I.string().min(1,"Address is required"),timeZone:I.string().min(1,"Time zone is required")});function zt(s){const e=$.c(48),{onHidden:n}=s,{personId:i}=Z(),y=L.useUtils();let c;e[0]!==y?(c={onSuccess:async()=>{await y.getPersonSettings.invalidate()}},e[0]=y,e[1]=c):c=e[1];const{mutateAsync:r}=L.createStudio.useMutation(c),_=ct("add-studio-sheet"),[x,f]=z.useState(!1),[v,P]=z.useState(void 0);let F;e[2]!==v?(F={type:"lat_long",...v},e[2]=v,e[3]=F):F=e[3];const N=v!==void 0;let E;e[4]!==N?(E={enabled:N},e[4]=N,e[5]=E):E=e[5];const{data:u}=L.getTimeZone.useQuery(F,E);let k,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(k={name:"",googlePlaceId:"",timeZone:""},h={onChange:Ut},e[6]=k,e[7]=h):(k=e[6],h=e[7]);let S;e[8]!==_||e[9]!==i||e[10]!==r?(S={defaultValues:k,validators:h,onSubmit:async Q=>{const{value:W}=Q,H=await _(W.googlePlaceId);await r({personId:i,name:W.name,timeZone:W.timeZone,googlePlaceId:W.googlePlaceId,addressLine1:H?.line1||void 0,addressLine2:H?.line2||void 0,locality:H?.locality||void 0,region:H?.region||void 0,postalCode:H?.postalCode||void 0,country:H?.country||void 0,latitude:H?.latitude||null,longitude:H?.longitude||null}),f(!0)}},e[8]=_,e[9]=i,e[10]=r,e[11]=S):S=e[11];const l=ce(S),m=re(l.store,Kt),w=re(l.store,qt);let p,o;e[12]!==_||e[13]!==m?(p=()=>{(async function(){if(!m)return;const H=await _(m);H?.latitude&&H?.longitude&&P({latitude:H.latitude,longitude:H.longitude})})()},o=[m,_],e[12]=_,e[13]=m,e[14]=p,e[15]=o):(p=e[14],o=e[15]),z.useEffect(p,o);let a,d;e[16]!==l||e[17]!==u?(a=()=>{u&&l.setFieldValue("timeZone",u)},d=[u,l],e[16]=l,e[17]=u,e[18]=a,e[19]=d):(a=e[18],d=e[19]),z.useEffect(a,d);const g=w;let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs("div",{className:"flex flex-row items-center justify-between gap-2",children:[t.jsx("div",{className:"font-semibold text-2xl font-impactful",children:"Add Studio"}),t.jsx(ne,{setHide:f})]}),e[20]=j):j=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(O,{variant:"secondary",onClick:()=>f(!0),children:"Cancel"}),e[21]=b):b=e[21];let A;e[22]!==l?(A=()=>{l.handleSubmit()},e[22]=l,e[23]=A):A=e[23];let C;e[24]!==g||e[25]!==A?(C=t.jsxs("div",{className:"flex flex-row justify-between",children:[b,t.jsx(O,{variant:"primary",disabled:g,onClick:A,children:"Create"})]}),e[24]=g,e[25]=A,e[26]=C):C=e[26];let D;e[27]!==l?(D=Q=>{Q.preventDefault(),Q.stopPropagation(),l.handleSubmit()},e[27]=l,e[28]=D):D=e[28];let M;e[29]!==l.AppField?(M=t.jsx("div",{children:t.jsx(l.AppField,{name:"name",children:Ot})}),e[29]=l.AppField,e[30]=M):M=e[30];let T,B;e[31]!==l.Field?(T=t.jsx("div",{children:t.jsx(l.Field,{name:"googlePlaceId",children:Vt})}),B=t.jsx("div",{children:t.jsx(l.Field,{name:"timeZone",children:Ht})}),e[31]=l.Field,e[32]=T,e[33]=B):(T=e[32],B=e[33]);let R;e[34]!==M||e[35]!==T||e[36]!==B?(R=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[M,T,B]})}),e[34]=M,e[35]=T,e[36]=B,e[37]=R):R=e[37];let U;e[38]!==D||e[39]!==R?(U=t.jsx("form",{onSubmit:D,children:R}),e[38]=D,e[39]=R,e[40]=U):U=e[40];let V;e[41]!==C||e[42]!==U?(V=t.jsx(oe,{headerSlot:j,footerSlot:C,children:U}),e[41]=C,e[42]=U,e[43]=V):V=e[43];let G;return e[44]!==x||e[45]!==n||e[46]!==V?(G=t.jsx(ae,{hide:x,onHidden:n,children:V}),e[44]=x,e[45]=n,e[46]=V,e[47]=G):G=e[47],G}function Ht(s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{children:t.jsx(it,{invalid:_e(s).length>0,label:"Time zone",onChange:e=>s.handleChange(e),value:s.state.value})}),t.jsx(ke,{errors:_e(s)})]})}function Vt(s){return t.jsxs(t.Fragment,{children:[t.jsx("div",{children:t.jsx(rt,{fullWidth:!0,label:"Address",onResultClick:e=>s.handleChange(e)}
1)}),t.jsx(ke,{errors:_e(s)})]})}function Ot(s){return t.jsx(s.TextField,{fullWidth:!0,label:"Studio Name"})}function qt(s){return s.isSubmitting}function Kt(s){return s.values.googlePlaceId}function zs(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(de,{sheet:zt}),s[0]=e):e=s[0],e}function Gt(s){const e=$.c(33),{onHidden:n}=s,[i,y]=z.useState(!0),{personId:c}=Z(),r=L.useUtils();let _;e[0]!==c||e[1]!==r?(_=async()=>{await new Promise(Qt),r.getPersonInternal.invalidate(c),r.getPersonSettings.invalidate(c),r.getProviderFromRoute.invalidate(),y(!1)},e[0]=c,e[1]=r,e[2]=_):_=e[2];const{mutateAsync:x,isPending:f}=L.publishJob.useMutation({onSuccess:_,onError:j=>{const b=he(j);F(b||j.message)}}),[v,P]=z.useState(void 0),F=P;let N;e[3]!==c||e[4]!==x||e[5]!==F?(N=async()=>{F(void 0),await x({jobName:"remove-person-from-studio",jobPayloads:[{providerId:c}]})},e[3]=c,e[4]=x,e[5]=F,e[6]=N):N=e[6];const E=N;let u;e[7]!==n||e[8]!==i?(u=()=>{i||n()},e[7]=n,e[8]=i,e[9]=u):u=e[9];let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ue,{children:"Remove from Studio?"}),e[10]=k):k=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(ze,{children:[k,t.jsx(Ke,{children:t.jsx(He,{children:"Removes the person from their current studio."})})]}),e[11]=h):h=e[11];let S;e[12]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsxs("ul",{className:"list-disc list-inside text-left text-sm",children:[t.jsx("li",{children:"Artist will be removed from their studio"}),t.jsx("li",{children:"Artist will still be able to use Venue on their own"}),t.jsx("li",{children:"If using studio's Stripe account, it will be cleared so they can set up their own"}),t.jsx("li",{children:"This action is hard to reverse (requires engineering intervention)"})]}),e[12]=S):S=e[12];let l;e[13]!==v?(l=v&&t.jsx("div",{className:"font-medium text-center text-ink-destructive mt-4",children:v}),e[13]=v,e[14]=l):l=e[14];let m;e[15]!==l?(m=t.jsxs("div",{children:[S,l]}),e[15]=l,e[16]=m):m=e[16];let w;e[17]!==f?(w=t.jsx(Ge,{asChild:!0,children:t.jsx(O,{variant:"secondary",disabled:f,children:"Cancel"})}),e[17]=f,e[18]=w):w=e[18];const p=f?"Removing...":"Remove from Studio";let o;e[19]!==E||e[20]!==f||e[21]!==p?(o=t.jsx(O,{variant:"destructive",onClick:E,disabled:f,children:p}),e[19]=E,e[20]=f,e[21]=p,e[22]=o):o=e[22];let a;e[23]!==w||e[24]!==o?(a=t.jsxs(Ve,{children:[w,o]}),e[23]=w,e[24]=o,e[25]=a):a=e[25];let d;e[26]!==a||e[27]!==u||e[28]!==m?(d=t.jsxs(Oe,{showClose:!1,onAnimationEndCapture:u,children:[h,m,a]}),e[26]=a,e[27]=u,e[28]=m,e[29]=d):d=e[29];let g;return e[30]!==i||e[31]!==d?(g=t.jsx(qe,{open:i,onOpenChange:y,children:d}),e[30]=i,e[31]=d,e[32]=g):g=e[32],g}function Qt(s){return setTimeout(s,1e3)}function Hs(){const s=$.c(2),e=ue();let n;return s[0]!==e?(n=t.jsx(Gt,{onHidden:()=>{e("../",{preventScrollReset:!0})}}),s[0]=e,s[1]=n):n=s[1],n}function Wt({onHidden:s}){const[e,n]=z.useState(!0),{personId:i,handle:y}=Z(),c=tt(),r=L.useUtils(),{data:_,isLoading:x}=L.checkPersonUnarchiveConflicts.useQuery(i,{enabled:!!i}),f=!!_?.handleConflict,v=!!_?.emailConflict,{mutateAsync:P,isPending:F}=L.unarchivePerson.useMutation({onSuccess:async()=>{r.getPersonInternal.invalidate(i),r.getPersonSettings.invalidate(i),r.getProviderFromRoute.invalidate(),n(!1)},onError:o=>{const a=he(o);E(a||o.message)}}),[N,E]=z.useState(void 0),u=ce({defaultValues:{handle:""},onSubmit:async({value:o})=>{E(void 0);try{await P({personId:i,...f?{newHandle:o.handle}:{}})}catch{}}}),k=re(u.store,o=>o.values.handle),h=re(u.store,o=>o.canSubmit),S=re(u.store,o=>o.isValidating),l=k===y||k==="",m=(y?`@${y}`:void 0)??i??"User",w=!v&&!F&&!x&&(!f||h&&!S),p=_?.emailConflict?c("staffSettings",{personId:_.emailConflict.personId}):null;return t.jsx(Ne,{open:e,onOpenChange:n,children:t.jsxs(Ce,{showClose:!1,onAnimationEndCapture:()=>{e||s()},children:[t.jsxs(Ie,{children:[t.jsxs(we,{children:["Unarchive ",m,"?"]}),!f&&t.jsx(Ae,{children:"They will be restored to the platform as an active user."})]}),t.jsxs("div",{className:"px-4 flex flex-col gap-3",children:[f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("p",{className:"text-sm leading-tight text-ink-destructive p-3 bg-ink-destructive/10 rounded-xl border-2 border-ink-destructive/20",children:["Their handle"," ",t.jsxs("span",{className:"font-medium",children:["@",_.handleConflict.handle]})," ","has now been taken by someone else (",t.jsx(Te,{to:c("bookings",{personId:_.handleConflict.personId}),className:"underline text-ink-forest",onClick:()=>n(!1),children:_.handleConflict.personId}),"). Choose a new one to continue."]}),t.jsx(u.AppField,{name:"handle",validators:{onChange:at,onChangeAsyncDebounceMs:250,onChangeAsync:async({value:o})=>{const a=await st.getPersonIdByHandle.query(o);return!a||a===i?void 0:{message:"Handle is taken"}}},children:o=>t.jsx(o.TextField,{label:"New handle",autoCapitalize:"none",autoCorrect:"off"})})]}),v&&p&&t.jsxs("p",{className:"text-sm leading-tight text-ink-destructive p-3 bg-ink-destructive/10 rounded-xl border-2 border-ink-destructive/20",children:["Email is already in use by"," ",t.jsx(Te,{to:p,className:"underline text-ink-forest",onClick:()=>n(!1),children:_.emailConflict.handle?`@${_.emailConflict.handle}`:"another user"}),". Unarchiving is not possible until that user is archived or their email is changed."]}),N&&t.jsx("p",{className:"font-medium text-center leading-tight text-ink-destructive p-3 bg-ink-destructive/10 rounded-xl border-2 border-ink-destructive/20",children:N})]}),t.jsxs(Pe,{children:[t.jsx(Fe,{asChild:!0,children:t.jsx(O,{disabled:F,variant:"secondary",children:"Cancel"})}),t.jsx(O,{onClick:()=>{u.handleSubmit()},disabled:!w,children:F?"Unarchiving...":`Unarchive ${l?m:`as @${k}`}`})]})]})})}function Vs(){const s=$.c(2),e=ue();let n;return s[0]!==e?(n=t.jsx(Wt,{onHidden:()=>{e("../",{preventScrollReset:!0})}}),s[0]=e,s[1]=n):n=s[1],n}export{js as ArchivePerson,ys as DisableLogin,vs as EditAllowInkform,Ss as EditBookingDescription,_s as EditBookingMethod,ks as EditBookingSystem,ws as EditBookingsPerMonth,As as EditDepositPlatformFee,Is as EditExternalApiKey,Fs as EditFullPaymentPlatformFee,Ps as EditInstantPayoutLimit,Cs as EditMarketingAdSpendPerMonth,Ns as EditMarketingSource,Ds as EditNotes,Es as EditNumberOfInstagramFollowers,Ms as EditNumberOfInstagramPosts,Ts as EditPaymentLinkEligibility,Bs as EditProviderLegalName,$s as EditSegment,Ls as EditWebsiteUrl,Rs as MarketingBlastCredits,Us as NewBook,zs as NewStudio,Hs as RemoveFromStudio,Vs as UnarchivePerson}
1; 2 3//# chunkId=4220145b-d4b0-5c1e-bbe2-1d35acd54f4c
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.