1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6113],{9608:(e,s,t)=>{"use strict";t.d(s,{L:()=>h});var l=t(37876),r=t(61875),i=t(19512),a=t(14232),n=t(88992),d=t(91408),c=t(96415);function o({register:e,errors:s,watchFields:t}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mt-1",children:(0,l.jsx)(r.L0,{fullWidth:!0,autoFocus:!0,placeholder:"artist email",field:"email",register:e,errors:s})}),(0,l.jsx)(r.Kw,{errors:s,field:"email"}),(0,l.jsxs)("div",{className:"mt-2",children:[(0,l.jsx)(r.L0,{autoComplete:"off",fullWidth:!0,placeholder:"confirm email",field:"email_confirm",register:e,errors:s}),(0,l.jsx)(r.Kw,{className:"mt-2",errors:s,field:"email_confirm"})]})]})}function h({name:e="",sellerId:s,sellers:t=[],transferSellerId:m,description:x="",buttonText:j="",onSuccess:u=(e,s,t)=>{},onSubmit:p=e=>e(),onError:f=e=>{}}){let v={name:"matches-email",exclusive:!1,params:{},message:"Emails must match",test:function(e){return this.parent.email==this.parent.email_confirm}},g=d.Yj().trim().transform(e=>e||null).nullable(),N=d.Yj().trim(),[y,b]=(0,a.useState)(!0),w=m||y,_=d.Ik().shape({name:d.Yj().required("Seller is required"),email:w?g.required("email is required").test(v):g,email_confirm:w?N.required("please confirm email").test(v):N,seller_id:d.Yj()}),A={resolver:(0,c.t)(_),shouldFocusError:!1,defaultValues:{name:e,seller_id:s||t[0]?.id,transfer_seller_id:m,email:"",email_confirm:""}},{register:S,handleSubmit:F,watch:k,reset:C,setValue:T,formState:E,control:L}=(0,n.mN)(A),{errors:P}=E,I=k();async function M(e){console.log("onSuccess",e);let{email_confirm:s,...t}=e;try{await fetch("/api/edit/invite/artist",{headers:{"Content-Type":"application/json"},method:"PUT",body:JSON.stringify(t)}).then(async s=>{let t=await s.json();if(!(s.status<400))return f(t.error);console.log("Invite created",t),console.log("Submitting",e,t?.invite,t?.artist),u(e,t?.invite,t?.artist)}).catch(e=>{console.log("Caught error",e),f(e)})}catch(e){console.log("FAILED",e),f(e)}}function q(e){console.log("onFail",e)}function O(e){return p(()=>M(e))}function U(){return console.log("Submitting..."),F(O,q)()}return j||(j=I.email?"Add artist and invite":"Add Artist"),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-neutral-400",children:x}),m?"":(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(r.L0,{fullWidth:!0,autoComplete:"new-password",label:"Artist Name",placeholder:"Artist Name",inputProps:{style:{padding:10,fontSize:"1em"}},field:"name",register:S,errors:P})}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsxs)("div",{children:["An artist profile for '",I.name,"' will be created and added to your account."]})}),(0,l.jsxs)("ul",{className:"ml-4 px-2 text-neutral-400 text-sm list-disc",children:[(0,l.jsx)("li",{children:"Please make sure the artist does not already exist."}),(0,l.jsx)("li",{children:'Do not combine artist\'s eg "Tom & James" unless they are a single Act and you would expect them to have their own profile page.'})]}),(0,l.jsx)("div",{className:"mt-4 text-sm text-brand",children:"Please note, you can only allocate royalties to artists after they have completed setting up their profile."}),(0,l.jsx)("div",{className:"mt-4 ",children:"Do you have the artist's email address?"}),(0,l.jsx)("div",{className:"my-4 child:p-3 child-hover:bg-neutral-700 child:rounded-md",children:(0,l.jsxs)("label",{htmlFor:"haveEmail",className:`${y?"bg-neutral-600":"text-neutral-500"}`,children:[(0,l.jsx)("input",{type:"checkbox",checked:y,onChange:e=>b(e.target.checked),className:"mr-2",name:"NAME",id:"haveEmail"}),"Yes"]})}),y?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mt-6 px-2 text-neutral-400 ",children:(0,l.jsx)("div",{children:"Great, please enter it and we will invite them to setup their profile."})}),(0,l.jsx)(o,{register:S,errors:P,watchFields:I}),(0,l.jsx)("div",{className:"text-center mt-8 ",children:(0,l.jsx)(i.A,{onClick:U,variant:"contained",component:"label",children:"Add Artist and Invite"})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mt-6 px-2 text-neutral-400 ",children:"No problem, you can create the artist now and transfer it later."}),(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"mt-1 px-2 text-neutral-500 text-sm",children:(0,l.jsx)("div",{className:"text-brand/70",children:"Please ask the artist for their email address so you can transfer their profile. That way, they can set up their artwork, bio etc and you will be able to allocate royalties to them."})})}),(0,l.jsx)("div",{className:"text-center mt-8 ",children:(0,l.jsx)(i.A,{onClick:U,variant:"contained",component:"label",children:"Create Artist and Transfer later"})})]})]}),m?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{children:["Transfer ",(0,l.jsx)("span",{className:"font-bold",children:e})," to another user."]}),(0,l.jsxs)("div",{className:"mt-4 text-neutral-400 text-sm",children:["An invitation will be sent to the email provided so they can take ownership of the profile '",e,"'."]}),(0,l.jsx)("div",{className:"mt-2 text-brand",children:"This action can not be undone so use wisely"}),(0,l.jsx)("div",{className:"mt-2 text-neutral-300",children:"Enter the email address of the person who you would like to transfer this profile to."}),(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(o,{register:S,errors:P,watchFields:I})}),(0,l.jsxs)("div",{className:"mt-4 text-neutral-400",children:["Profile to be transferred: ",(0,l.jsx)("span",{className:"font-bold text-neutral-200",children:e})]}),s?"":(0,l.jsxs)("div",{className:"text-neutral-400",children:["Who to say is transferring the ownership:",(0,l.jsx)("select",{value:I.seller_id,onChange:e=>{T("seller_id",e.target.value)},children:t.sort((e,s)=>e.name>s.name?1:-1).map(e=>(0,l.jsx)("option",{value:e.id,children:e.name}))})]}),(0,l.jsx)("div",{className:"text-center mt-8 ",children:(0,l.jsx)(i.A,{onClick:U,variant:"contained",component:"label",children:j})})]}):""]})}},26135:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>b});
1var l=t(37876),r=t(14232),i=t(95364),a=t(77328),n=t.n(a),d=t(48230),c=t.n(d),o=t(19512),h=t(4186),m=t(71134),x=t(9608),j=t(72702),u=t(11613);function p({sellers:e,primarySellers:s,firstRow:t,invites:r=[],allowManage:i=!0,...a}){return e?(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:t}),(0,l.jsx)("table",{className:"text-sm w-full border-separate border-spacing-x-none border-spacing-y-[8px] poppins ",children:(0,l.jsx)("tbody",{children:e.map(e=>{var t;let n=(0,j.Tm)(e),d=(t=e.id,r.find(e=>e.transfer_seller_id===t));return(0,l.jsxs)("tr",{className:"child:bg-neutral-900 place-items-center ",children:[(0,l.jsx)("td",{className:" hidden md:block w-[50px] rounded-l-md",children:(0,l.jsx)("img",{className:"p-1 h-[50px] w-[50px]",height:"50",width:"50",src:n.image_display_url})}),(0,l.jsxs)("td",{className:" w-4/12 text-sm md:text-base px-2",children:[e.name,(0,l.jsx)("div",{className:"md:inline text-xs ml-2 italic text-neutral-500",children:e.seller_type})]}),i?(0,l.jsx)("td",{className:"w-2/12 pt-2 align-top text-center ",children:(0,l.jsx)(c(),{href:`/manage?sellerId=${e.id}`,children:(0,l.jsxs)(o.A,{variant:"text",children:["Manage ",e.seller_type]})})}):(0,l.jsx)("td",{}),(0,l.jsx)("td",{className:"hidden md:table-cell w-2/12 p-3 text-center ",children:(0,l.jsxs)("a",{target:"_blank",href:(0,m.vD)(e),children:[(0,m.TF)(e.seller_type)," page ",(0,l.jsx)(h.tOh,{className:"inline text-xs"})," "]})}),(0,l.jsx)("td",{className:"w-4/12 pt-2 align-top rounded-r-md",children:(0,l.jsxs)("div",{className:"flex flex-col md:flex-row ",children:[(0,l.jsx)("div",{className:"ml-2",children:(0,l.jsx)(o.A,{onClick:()=>{var t;t=e,a.setPopupMessage({title:"Transfer ownership",makeChildren:({close:e})=>(0,l.jsx)(x.L,{name:t.name,transferSellerId:t.id,sellers:s,onSubmit:s=>{confirm("This cannot be undone, are you sure you wish to transfer this seller to another user?")&&(s(),(0,u.VX)("Sent transfer request"),e())},buttonText:"Transfer"})})},children:"Transfer"})}),d?(0,l.jsxs)("div",{className:"pl-2",children:[(0,l.jsxs)("div",{children:["Sent to ",d?.email]}),(0,l.jsxs)("div",{children:["on ",(0,m.XV)(d?.created_date)]})]}):""]})})]},e.id)})})})]}):(0,l.jsx)(l.Fragment,{children:"Loading"})}var f=t(10553),v=t(61875),g=t(75656),N=t(45880),y=t(75919);function b(e){let{data:s}=(0,f.useSession)(),[t,a]=(0,r.useState)(!1),{data:d,error:h}=(0,g.Ay)(s?"/api/seller/user":void 0,e=>fetch(e).then(e=>e.json())),m=d?.sellers,x=d?.invites,j=d?.invitedSellers,u=m?.filter(e=>!e.transfer_flag),b=[...m?.filter(e=>e.seller_type_id==N.d_)||[],...m?.filter(e=>e.seller_type_id==N.Ot)||[]];return(0,l.jsxs)(i.Ay,{...e,home:!0,hideNav:!0,nav:(0,l.jsx)("div",{}),children:[(0,l.jsx)(n(),{children:(0,l.jsx)("title",{children:"Seller"})}),(0,l.jsxs)(y.InnerSection1200NoMargin,{children:[(0,l.jsx)(v.Av,{children:"Artists and Labels"}),(0,l.jsxs)("div",{className:"",children:[s&&!t&&b&&b.length?(0,l.jsx)("div",{className:"mt-10",children:(0,l.jsx)(o.A,{variant:"contained",component:"label",onClick:()=>a(!0),children:"Create another Artist or Label"})}):(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 poppins",children:[(0,l.jsxs)("section",{children:[(0,l.jsx)(v.FF,{children:"Artist Profile"}),(0,l.jsxs)("ul",{className:"ml-8 list-disc text-sm text-neutral-400 ",children:[(0,l.jsx)("li",{children:"Set your own prices"}),(0,l.jsx)("li",{children:"Manage your own releases"}),(0,l.jsx)("li",{children:"Split royalties with collaborators"}),(0,l.jsx)("li",{children:"Unlimited uploads"}),(0,l.jsx)("li",{children:"No setup fees, upload fees or monthly fees"}),(0,l.jsx)("li",{children:"Straightforward revenue share"})]}),(0,l.jsx)("div",{}),(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(c(),{href:"/edit/artist",children:(0,l.jsx)(o.A,{variant:"contained",component:"label",children:"Setup as an Artist"})})})]}),(0,l.jsxs)("section",{children:[(0,l.jsx)(v.FF,{children:"Label Management"}),(0,l.jsx)("div",{children:(0,l.jsxs)("ul",{className:"ml-8 list-disc text-sm text-neutral-400 ",children:[(0,l.jsx)("li",{children:"Manage your portfolio of artist releases."}),(0,l.jsx)("li",{children:"Split royalties with artists and artists are paid directly."}),(0,l.jsx)("li",{children:"Allocate expenses which are deducted before royalties paid."}),(0,l.jsx)("li",{children:"Unlimited uploads"}),(0,l.jsx)("li",{children:"Unlimited artists"}),(0,l.jsx)("li",{children:"No setup fees, upload fees or monthly fees"}),(0,l.jsx)("li",{children:"Straightforward revenue share"})]})}),(0,l.jsx)("div",{className:"mt-4",children:(0,l.jsx)(c(),{href:"/edit/label",children:(0,l.jsx)(o.A,{variant:"contained",component:"label",children:"Setup as a label"})})})]})]}),s?(0,l.jsx)(l.Fragment,{children:b?.length?(0,l.jsxs)("section",{className:"mt-6",children:[(0,l.jsx)(v.Ap,{children:"Artists/Labels you manage"}),(0,l.jsx)("div",{children:(0,l.jsx)(p,{primarySellers:u,sellers:b,invites:x,firstRow:(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("ul",{})}),...e})}),j.length?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.Ap,{children:"Unclaimed artists you created"}),(0,l.jsx)("div",{children:(0,l.jsx)(p,{primarySellers:u,sellers:j,invites:x,firstRow:(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("ul",{})}),...e})})]}):""]}):""}):""]})]})]})}},79282:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/seller",function(){return t(26135)}])}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=79282)),_N_E=e.O()}]);
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.