1import{a1 as We,v as De,w as Ae,j as e,$ as v,z as Je,A as et,aR as tt,bp as st,a5 as it,o as T,r as x,i as t,M as be,B as E,q,a_ as ne,U as nt,J as k,L as f,aG as G,m as ae,S as A,aI as Ne,R as ee,T as at,b9 as rt,k as ot,Q as dt,e as lt}from"./index-H-7Mdjgq.js";import{u as X}from"./use-form-D9Jyjn3K.js";import{u as K}from"./useFormErrorResponseHandler-viwrO7mQ.js";import{b as C,a as L,I as ce}from"./notifications-DPyM_svh.js";import{C as N}from"./index-DBKgDYDB.js";import{H as M}from"./index-Bqn835nm.js";import{T as z}from"./TextInput-DJngKYsH.js";import{u as Q}from"./useGetOrganizerSettings-BFh3t3YG.js";import{u as W}from"./useUpdateOrganizerSettings-r0hQFR-O.js";import{S as fe}from"./Select-CUl8WB_F.js";import{G as re,u as oe}from"./useGetOrganizer-Bnd8E-1a.js";import{I as $}from"./index-AYshx105.js";import{a as ct}from"./currencies-Bpubr7kl.js";import{t as ut}from"./timezones-1fqAkILf.js";import{E as mt}from"./index-DDHyo999.js";import{u as H}from"./useMutation--MIpdzpW.js";import{G as Fe,u as pt}from"./useGetOrganizers-Cut8w_qe.js";import{C as _t}from"./Collapse-B08Wcx-V.js";import{b as Ve,a as ht,c as gt,I as ft}from"./IconShare-zBM68g9o.js";import{I as xt,a as yt,b as Be,c as bt,d as jt,e as It,f as vt,g as Ct,h as St,i as wt}from"./IconBrandYoutube-B1HWlzLz.js";import{I as Et,b as zt,c as Pt,a as kt}from"./IconBrandX-B4vsluRJ.js";import{I as Lt}from"./IconChevronUp-4TkTtVk0.js";import{I as Tt}from"./IconChevronDown-CoK4zxDw.js";import{L as Rt,T as ie}from"./index-Csi_IeJw.js";import{u as Dt}from"./useCreateLocation-DFGgQkbL.js";import{i as Ee,s as At}from"./addressUtilities-C-s79fwM.js";import{u as Nt,a as Ft,b as Vt,c as Bt,d as Mt,e as Gt,E as Ot,S as Ut,P as qt,D as ze,f as Pe,I as Xt,g as Kt,N as Ht}from"./index-B0sPMrh6.js";import{C as Yt}from"./index-jKz7tH7O.js";import{I as Zt}from"./IconUsers-Bn5-2tBM.js";import{I as $t}from"./IconUser-D2amDXfM.js";import{A as Qt}from"./ActionIcon-BNTNX0_j.js";import{A as te}from"./Accordion-DKPWLYnX.js";import{A as ue}from"./Anchor-BD_bJ-DV.js";import{B}from"./Badge-C29QpBn8.js";import{C as Wt}from"./CopyButton-Cy0jN_Md.js";import{D as me}from"./Divider-CF0mt4lW.js";import{T as Jt}from"./Tooltip-BbNYwxJq.js";import{C as O}from"./index-Dy5yeMe7.js";import{I as je}from"./IconAlertCircle-CVFoVtYz.js";import{I as Me}from"./IconClock-CbvAb4Pq.js";import{A as pe}from"./Alert-DLVO74mh.js";import{R as _e}from"./Radio-B7VZgpj4.js";import{I as es}from"./IconRefresh-DXm8uwM2.js";import{I as ts}from"./IconCircleCheck-C-D8XvEk.js";import{I as ss}from"./IconCopy-BlrMLj_W.js";import{I as ke}from"./IconExternalLink-DW-6uZkM.js";import{I as xe}from"./IconBrandStripe-CCFdjjX_.js";import{I as is}from"./IconBolt-hy1dVKo4.js";import{I as ns}from"./IconWorld-D-A6sajZ.js";import{I as as}from"./IconShieldCheck-BpMJkke0.js";import{u as rs}from"./useUpdateOrganizerStatus-BrJhzCoA.js";import{c as os}from"./confirmationDialog-C7tBR8qg.js";import{O as se}from"./types-CGG0ephI.js";import{u as ds}from"./useIsCurrentUserAdmin-BNNqwOEs.js";import{B as ls}from"./index-CJj2W511.js";import{I as cs}from"./IconTrash-B6R0mN6D.js";import{I as us}from"./IconArchive-B08c5gRk.js";import{C as ms}from"./Checkbox-CtejIHf4.js";import{u as Ge}from"./useGetAccount-D3lj8z5a.js";import{I as ps}from"./IconBrandGoogle-Bn55ZnxE.js";import{I as _s}from"./IconTag-Dv0TUlaZ.js";import{P as hs}from"./index-BVAu9I3X.js";import{P as gs}from"./index-DxMQb_eP.js";import{I as fs}from"./IconInfoCircle-DpzxY1ET.js";import{I as xs}from"./IconCalendarEvent-DL1QIzwe.js";import{I as ys}from"./IconMapPin-D1K6gabn.js";import{I as bs}from"./IconMail-BJxAQRRn.js";import{I as js}from"./IconChartBar--uukbP30.js";import{I as Is}from"./IconAlertTriangle-B4FSTlL-.js";import{I as vs}from"./IconPercentage-CCne9XUG.js";import"./IconX-BeJ4A9dL.js";import"./InputBase-CV4iOMG7.js";import"./Combobox-CBkX19bG.js";import"./Popover-BuwKeRzp.js";import"./get-floating-position-7n5UPPCU.js";import"./CheckIcon-fa6XWshr.js";import"./SimpleGrid-DImrleVX.js";import"./Skeleton-DxmOCu5F.js";import"./use-debounced-value-DTvAnQDq.js";import"./countries-v3LrK451.js";import"./useGeoStatus-B-rLaxZ0.js";import"./IconPencil-cHfHDkQ0.js";import"./IconSearch-DOvTLW64.js";import"./IconArrowLeft-CnE2W4jE.js";import"./AccordionChevron-DzJ21-8m.js";import"./LoadingOverlay-CLu_ym7D.js";import"./use-disclosure-B6DxwJDq.js";import"./Tabs-CaWN3ye2.js";import"./get-safe-id-Bp3H8K0-.js";import"./get-auto-contrast-value-Da6zqqWm.js";import"./create-scoped-keydown-handler-BD9FwJwO.js";import"./Typography-D_bpUzBF.js";import"./IconEye-DwpddlQe.js";import"./useGetEvent-DMiQpiL_.js";import"./IconEdit-D8fU8mvI.js";import"./IconPlus-CTVlcGBk.js";
1import"./Grid-BPsvdGH9.js";import"./NumberInput-DTWnASdc.js";import"./clamp-DTmYCdls.js";import"./SegmentedControl-BaV3pyH_.js";import"./get-env-B-6RN2XZ.js";import"./currency-BuWXkOSu.js";import"./IconArrowRight-ChvJtw0b.js";import"./use-clipboard-cUyoVtI8.js";const[Cs,Ss]=We("List component was not found in tree");var Ie={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const ve=De(i=>{const{classNames:s,className:n,style:r,styles:o,vars:_,icon:m,children:l,mod:d,...y}=Ae("ListItem",null,i),u=Ss(),c=m||u.icon,a={classNames:s,styles:o};return e.jsx(v,{...u.getStyles("item",{...a,className:n,style:r}),component:"li",mod:[{"with-icon":!!c,centered:u.center},d],...y,children:e.jsxs("div",{...u.getStyles("itemWrapper",a),children:[c&&e.jsx("span",{...u.getStyles("itemIcon",a),children:c}),e.jsx("span",{...u.getStyles("itemLabel",a),children:l})]})})});ve.classes=Ie;ve.displayName="@mantine/core/ListItem";const ws={type:"unordered"},Oe=et((i,{size:s,spacing:n})=>({root:{"--list-fz":it(s),"--list-lh":st(s),"--list-spacing":tt(n)}})),U=De(i=>{const s=Ae("List",ws,i),{classNames:n,className:r,style:o,styles:_,unstyled:m,vars:l,children:d,type:y,withPadding:u,icon:c,spacing:a,center:p,listStyleType:g,mod:S,attributes:R,...j}=s,w=Je({name:"List",classes:Ie,props:s,className:r,style:o,classNames:n,styles:_,unstyled:m,attributes:R,vars:l,varsResolver:Oe});return e.jsx(Cs,{value:{center:p,icon:c,getStyles:w},children:e.jsx(v,{...w("root",{style:{listStyleType:g}}),component:y==="unordered"?"ul":"ol",mod:[{"with-padding":u,type:c?"none":g},S],...j,children:d})})});U.classes=Ie;U.varsResolver=Oe;U.displayName="@mantine/core/List";U.Item=ve;const Es=()=>{const{organizerId:i}=T(),s=Q(i),n=W(),r=X({initialValues:{allow_search_engine_indexing:!0,seo_title:"",seo_description:"",seo_keywords:""}}),o=K();x.useEffect(()=>{s!=null&&s.isFetched&&(s!=null&&s.data)&&r.setValues({allow_search_engine_indexing:s.data.allow_search_engine_indexing,seo_title:s.data.seo_title,seo_description:s.data.seo_description,seo_keywords:s.data.seo_keywords})},[s.isFetched]);const _=m=>{n.mutate({organizerSettings:m,organizerId:i},{onSuccess:()=>{C(t._({id:"0Dk/l8"}))},onError:l=>{o(r,l)}})};return e.jsxs(N,{children:[e.jsx(M,{heading:t._({id:"GfWoKv"}),description:t._({id:"iJhSxe"})}),e.jsx("form",{onSubmit:r.onSubmit(_),children:e.jsxs("fieldset",{disabled:s.isLoading||n.isPending,children:[e.jsx(z,{...r.getInputProps("seo_title"),description:t._({id:"esY5SG"}),label:t._({id:"rXngLf"}),placeholder:t._({id:"vX8/tc"})}),e.jsx(z,{...r.getInputProps("seo_description"),description:t._({id:"h179TP"}),label:t._({id:"j1VfcT"}),placeholder:t._({id:"/bhMdO"})}),e.jsx(z,{...r.getInputProps("seo_keywords"),description:t._({id:"yPI7n9"}),label:t._({id:"/SIY6o"}),placeholder:t._({id:"ApOYO8"})}),e.jsx(be,{...r.getInputProps("allow_search_engine_indexing",{type:"checkbox"}),description:t._({id:"LRbt6D"}),label:t._({id:"ipYKgM"})}),e.jsx(E,{loading:n.isPending,type:"submit",children:t._({id:"tfDRzk"})})]})})]})},zs=()=>{const i=q();return H({mutationFn:({organizerId:s,organizerData:n})=>ne.update(s,n),onSuccess:(s,n)=>Promise.all([i.invalidateQueries({queryKey:[re,n.organizerId]}),i.invalidateQueries({queryKey:[Fe]})])})},Ps=()=>{const{organizerId:i}=T(),{data:s}=oe(i),n=zs(),r=X({initialValues:{name:"",email:"",phone:"",website:"",description:"",currency:"",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}),o=_=>{n.mutate({organizerId:i,organizerData:_},{onSuccess:()=>{C(t._({id:"5n+Wwp"}))},onError:m=>{K()(r,m)}})};return x.useEffect(()=>{r.setValues({name:String(s==null?void 0:s.name),email:String(s==null?void 0:s.email),currency:String(s==null?void 0:s.currency),timezone:String(s==null?void 0:s.timezone),phone:String((s==null?void 0:s.phone)||""),website:String((s==null?void 0:s.website)||""),description:String((s==null?void 0:s.description)||"")})},[s]),e.jsxs(N,{children:[e.jsx(M,{heading:t._({id:"jIPNJG"}),description:t._({id:"3ep0Gx"})}),e.jsx("form",{onSubmit:r.onSubmit(o),children:e.jsxs("fieldset",{disabled:n.isPending,children:[e.jsxs($,{children:[e.jsx(z,{...r.getInputProps("name"),required:!0,label:t._({id:"Pa6G7v"}),description:t._({id:"dFJnia"}),placeholder:t._({id:"Yrbm6T"})}),e.jsx(z,{...r.getInputProps("email"),label:t._({id:"O3oNi5"}),required:!0,description:t._({id:"kvpxIU"}),placeholder:t._({id:"V7yhws"})})]}),e.jsx(mt,{label:t._({id:"Nu4oKW"}),value:r.values.description||"",editorType:"simple",description:t._({id:"/z/bH1"}),onChange:_=>r.setFieldValue("description",_),maxLength:1e3}),e.jsxs($,{children:[e.jsx(z,{...r.getInputProps("phone"),label:t._({id:"zmwvG2"}),placeholder:t._({id:"zGiMDM"})}),e.jsx(z,{...r.getInputProps("website"),label:t._({id:"On0aF2"}),type:"url",placeholder:t._({id:"FONsLE"})})]}),e.jsxs($,{children:[e.jsx(fe,{...r.getInputProps("currency"),searchable:!0,required:!0,data:Object.entries(ct).map(([_,m])=>({value:m,label:_})),label:t._({id:"Q2lUR2"}),placeholder:t._({id:"5/63nR"}),description:t._({id:"QXlz+n"})}),e.jsx(fe,{...r.getInputProps("timezone"),searchable:!0,required:!0,data:ut,label:t._({id:"40Gx0U"}),placeholder:t._({id:"vgwVkd"}),description:t._({id:"mnafgQ"})})]}
1),e.jsx(E,{loading:n.isPending,type:"submit",children:t._({id:"tfDRzk"})})]})})]})},Z=[{name:t._({id:"DwuoH0"}),field:"facebook_handle",icon:Ve,placeholder:"username",priority:"primary"},{name:t._({id:"CTWsuc"}),field:"instagram_handle",icon:xt,placeholder:"username",priority:"primary"},{name:t._({id:"nhtR6Y"}),field:"twitter_handle",icon:Et,placeholder:"username",priority:"primary"},{name:t._({id:"gggTBm"}),field:"linkedin_handle",icon:ht,placeholder:"username",priority:"primary"},{name:t._({id:"9Q6UKX"}),field:"youtube_handle",icon:yt,placeholder:"channel",priority:"primary"},{name:t._({id:"zyUxcw"}),field:"tiktok_handle",icon:Be,placeholder:"username",priority:"primary"},{name:t._({id:"OdPOhy"}),field:"discord_handle",icon:bt,placeholder:"user_id",priority:"secondary"},{name:t._({id:"9wu8nm"}),field:"snapchat_handle",icon:jt,placeholder:"username",priority:"secondary"},{name:t._({id:"dBeuY2"}),field:"twitch_handle",icon:It,placeholder:"username",priority:"secondary"},{name:t._({id:"JjMIKU"}),field:"reddit_handle",icon:zt,placeholder:"username",priority:"secondary"},{name:t._({id:"zFIMat"}),field:"pinterest_handle",icon:Pt,placeholder:"username",priority:"secondary"},{name:t._({id:"2+ExvJ"}),field:"whatsapp_handle",icon:gt,placeholder:"phone_number",priority:"secondary"},{name:t._({id:"SchpMp"}),field:"telegram_handle",icon:kt,placeholder:"username",priority:"secondary"},{name:t._({id:"RkXlPZ"}),field:"github_handle",icon:vt,placeholder:"username",priority:"secondary"},{name:t._({id:"6dp/Hz"}),field:"vimeo_handle",icon:Ct,placeholder:"username",priority:"secondary"},{name:t._({id:"SS4mGB"}),field:"vk_handle",icon:St,placeholder:"username",priority:"secondary"},{name:t._({id:"vKLEXy"}),field:"weibo_handle",icon:wt,placeholder:"username",priority:"secondary"}],ks=()=>{const{organizerId:i}=T(),s=Q(i),n=W(),[r,o]=x.useState(!1),_=Z.reduce((a,p)=>(a[p.field]="",a),{}),m=X({initialValues:_}),l=K();x.useEffect(()=>{if(s!=null&&s.isFetched&&(s!=null&&s.data)){const a={};s.data.website_url&&(a.website_url=s.data.website_url),s.data.social_media_handles&&Z.forEach(p=>{if(p.field!=="website_url"){const g=p.field.replace("_handle","");s.data.social_media_handles[g]&&(a[p.field]=s.data.social_media_handles[g])}}),m.setValues(a)}},[s.isFetched]);const d=x.useMemo(()=>Z.filter(a=>a.priority==="secondary").some(a=>m.values[a.field]&&m.values[a.field].trim()!==""),[m.values]);x.useEffect(()=>{d&&o(!0)},[d]);const y=a=>{n.mutate({organizerSettings:a,organizerId:i},{onSuccess:()=>{C(t._({id:"MhOoLQ"}))},onError:p=>{l(m,p)}})},u=Z.filter(a=>a.priority==="primary"),c=Z.filter(a=>a.priority==="secondary");return e.jsxs(N,{children:[e.jsx(M,{heading:t._({id:"j/TOB3"}),description:t._({id:"NsWqSP"})}),e.jsx("form",{onSubmit:m.onSubmit(y),children:e.jsxs("fieldset",{disabled:s.isLoading||n.isPending,children:[e.jsx($,{children:u.map(a=>{const p=a.icon;
1return e.jsx(z,{...m.getInputProps(a.field),label:a.name,placeholder:a.placeholder,leftSection:e.jsx(p,{size:18}),type:a.field==="website_url"?"url":"text"},a.field)})}),e.jsx(nt,{onClick:()=>o(!r),style:{width:"100%",padding:"12px",marginTop:"20px",marginBottom:"20px",borderRadius:"8px",backgroundColor:"var(--mantine-color-gray-0)",border:"1px solid var(--mantine-color-gray-3)",transition:"all 0.2s"},onMouseEnter:a=>{a.currentTarget.style.backgroundColor="var(--mantine-color-gray-1)"},onMouseLeave:a=>{a.currentTarget.style.backgroundColor="var(--mantine-color-gray-0)"},children:e.jsxs(k,{justify:"center",gap:"xs",children:[r?e.jsx(Lt,{size:18}):e.jsx(Tt,{size:18}),e.jsx(f,{size:"sm",fw:500,children:r?t._({id:"UVPI5D"}):d?t._({id:"cMW+gm",values:{0:c.filter(a=>m.values[a.field]).length}}):t._({id:"b33PL9"})})]})}),e.jsx(_t,{expanded:r,children:e.jsx($,{children:c.map(a=>{const p=a.icon;return e.jsx(z,{...m.getInputProps(a.field),label:a.name,placeholder:a.placeholder,leftSection:e.jsx(p,{size:18}),type:a.field==="website_url"?"url":"text"},a.field)})})}),e.jsx(E,{loading:n.isPending,type:"submit",mt:"xl",children:t._({id:"KZrfYJ"})})]})})]})},Ls=()=>{const i=q();return H({mutationFn:({organizerId:s,locationId:n})=>ne.updateLocation(s,n),onSuccess:(s,n)=>i.invalidateQueries({queryKey:[re,n.organizerId]})})},Ts=()=>{const{organizerId:i}=T(),s=oe(i),n=Dt(),r=Ls(),o=X({initialValues:{location:null},validate:{location:d=>d&&d.kind==="new"&&!Ee(d.address)?t._({id:"SKx/0u"}):null}}),_=K();x.useEffect(()=>{if(s!=null&&s.isFetched&&s.data){const d=s.data;o.setValues({location:d.location_id&&d.location?{kind:"saved",location:{...d.location,id:d.location.id??d.location_id}}:null})}},[s.isFetched]);const m=async d=>{var a,p,g;if(d.kind==="saved")return d.location.id?Number(d.location.id):null;if(!i||!Ee(d.address))return null;const y=((a=s.data)==null?void 0:a.location_id)??null,u=((g=(p=s.data)==null?void 0:p.location)==null?void 0:g.structured_address)??null;return y!==null&&u!==null&&At(u,d.address)?Number(y):(await n.mutateAsync({organizerId:i,payload:{name:d.address.venue_name||null,structured_address:d.address,latitude:d.latitude,longitude:d.longitude,provider:d.provider,provider_place_id:d.providerPlaceId}})).data.id??null},l=async d=>{var y;if(i)try{const u=d.location?await m(d.location):null,c=((y=s.data)==null?void 0:y.location_id)??null;(u!==null||c!==null)&&await r.mutateAsync({organizerId:i,locationId:u}),C(t._({id:"RuaKfn"}))}catch(u){_(o,u)}};return e.jsxs(N,{children:[e.jsx(M,{heading:t._({id:"Du6bPw"}),description:t._({id:"Xd1R1a"})}),e.jsx("form",{onSubmit:o.onSubmit(l),children:e.jsxs("fieldset",{disabled:s.isLoading||n.isPending||r.isPending,children:[i&&e.jsx(Rt,{organizerId:i,value:o.values.location,onChange:d=>o.setFieldValue("location",d),error:o.errors.location,clearable:!0}),e.jsx(E,{loading:n.isPending||r.isPending,type:"submit",children:t._({id:"tfDRzk"})})]})})]})},Rs=({organizerId:i})=>{const[s,n]=x.useState(!1),{data:r,isLoading:o}=Nt(i,{include_inactive:!0}),{data:_}=Ft(s),m=Vt(),l=Bt(),d=Mt(),y=Gt(),u=(r==null?void 0:r.data)||[],c=a=>{_||n(!0)};return e.jsx(Ot,{contextId:i,contextType:"organizer",templates:u,defaultTemplates:_,isLoading:o,createMutation:m,updateMutation:l,deleteMutation:d,previewMutation:y,onCreateTemplate:c})},Ds=()=>{const{organizerId:i}=T(),s=Q(i),n=W(),r=X({initialValues:{default_attendee_details_collection_method:"PER_ORDER",default_show_marketing_opt_in:!0,default_allow_attendee_self_edit:!1}}),o=[{icon:e.jsx(Zt,{}),label:t._({id:"hauDFf"}),value:"PER_TICKET",description:t._({id:"4bUH9i"})},{icon:e.jsx($t,{}),label:t._({id:"VlXNyK"}),value:"PER_ORDER",description:t._({id:"0k4cdb"})}],_=K();x.useEffect(()=>{s!=null&&s.isFetched&&(s!=null&&s.data)&&r.setValues({default_attendee_details_collection_method:s.data.default_attendee_details_collection_method||"PER_ORDER",default_show_marketing_opt_in:s.data.default_show_marketing_opt_in??!0,default_allow_attendee_self_edit:s.data.default_allow_attendee_self_edit??!1})},[s.isFetched]);const m=l=>{n.mutate({organizerSettings:l,organizerId:i},{onSuccess:()=>{C(t._({id:"kzx0uD"}))},onError:d=>{_(r,d)}})};return e.jsxs(N,{children:[e.jsx(M,{heading:t._({id:"0Zptey"}),description:t._({id:"eXssj5"})}),e.jsx("form",{onSubmit:r.onSubmit(m),children:e.jsxs("fieldset",{disabled:s.isLoading||n.isPending,children:[e.jsx(Yt,{optionList:o,form:r,name:"default_attendee_details_collection_method",label:t._({id:"JtI4vj"}),required:!0}),e.jsx(be,{mt:"md",label:t._({id:"SXzpzO"}),description:t._({id:"blXLKj"}),...r.getInputProps("default_show_marketing_opt_in",{type:"checkbox"})}),e.jsx(Ut,{value:r.values.default_allow_attendee_self_edit,onChange:l=>r.setFieldValue("default_allow_attendee_self_edit",l),isDefault:!0}
1),e.jsx(E,{loading:n.isPending,type:"submit",children:t._({id:"tfDRzk"})})]})})]})},de={createOrGetConnectDetails:async(i,s)=>(await G.post(`organizers/${i}/stripe/connect`,{platform:s})).data,getConnectAccounts:async i=>(await G.get(`organizers/${i}/stripe/connect_accounts`)).data,copyConnection:async(i,s)=>(await G.post(`organizers/${i}/stripe/copy_from/${s}`,{})).data,disconnectAccount:async(i,s)=>{await G.delete(`organizers/${i}/stripe/connect_accounts/${s}`)}},Ce="getOrganizerStripeConnect",As=(i,s)=>ae({queryKey:[Ce,i],queryFn:async()=>{const{data:n}=await de.getConnectAccounts(i);return n},...s}),Ue="getOrganizerStripeConnectDetails",Ns=(i,s,n)=>ae({queryKey:[Ue,i,n],queryFn:async()=>{const{data:r}=await de.createOrGetConnectDetails(i,n);return r},enabled:s,retry:!1}),Fs=()=>{const i=q();return H({mutationFn:({organizerId:s,sourceOrganizerId:n})=>de.copyConnection(s,n),onSuccess:(s,n)=>Promise.all([i.invalidateQueries({queryKey:[Ce,n.organizerId]}),i.invalidateQueries({queryKey:[re,n.organizerId]})])})},Vs=()=>{const i=q();return H({mutationFn:({organizerId:s,stripeAccountId:n})=>de.disconnectAccount(s,n),onSuccess:(s,n)=>(i.removeQueries({queryKey:[Ue,n.organizerId]}),Promise.all([i.invalidateQueries({queryKey:[Ce,n.organizerId]}),i.invalidateQueries({queryKey:[re,n.organizerId]})]))})},Bs={card_payments:"Card payments",transfers:"Transfers",link_payments:"Link",klarna_payments:"Klarna",afterpay_clearpay_payments:"Afterpay / Clearpay",affirm_payments:"Affirm",bancontact_payments:"Bancontact",eps_payments:"EPS",ideal_payments:"iDEAL",sofort_payments:"SOFORT",sepa_debit_payments:"SEPA Direct Debit",p24_payments:"Przelewy24",blik_payments:"BLIK",mb_way_payments:"MB Way",revolut_pay_payments:"Revolut Pay",pix_payments:"Pix",boleto_payments:"Boleto",apple_pay:"Apple Pay",google_pay:"Google Pay",cashapp_payments:"Cash App Pay",amazon_pay_payments:"Amazon Pay",samsung_pay_payments:"Samsung Pay",payco_payments:"Payco",kakao_pay_payments:"Kakao Pay",naver_pay_payments:"Naver Pay",cartes_bancaires_payments:"Cartes Bancaires",grabpay_payments:"GrabPay",fpx_payments:"FPX",promptpay_payments:"PromptPay",konbini_payments:"Konbini",oxxo_payments:"OXXO",us_bank_account_ach_payments:"ACH Direct Debit",bacs_debit_payments:"Bacs Direct Debit",au_becs_debit_payments:"BECS Direct Debit",acss_debit_payments:"Pre-authorized debit (Canada)",multibanco_payments:"Multibanco"},Ms=i=>i.replace(/_payments?$/i,"").replace(/_/g," ").replace(/\b\w/g,s=>s.toUpperCase()),he=i=>Bs[i]??Ms(i),Gs=i=>i==="active"?e.jsx(B,{color:"green",variant:"light",children:t._({id:"F6pfE9"})}):i==="pending"?e.jsx(B,{color:"yellow",variant:"light",children:t._({id:"UbRKMZ"})}):e.jsx(B,{color:"gray",variant:"light",children:t._({id:"NoNwIX"})}),Os=({capabilities:i})=>{const s=Object.entries(i??{}).sort(([n],[r])=>he(n).localeCompare(he(r)));return s.length===0?e.jsx(f,{c:"dimmed",size:"sm",children:t._({id:"E2vYsO"})}):e.jsx(A,{gap:6,children:s.map(([n,r])=>e.jsxs(k,{justify:"space-between",wrap:"nowrap",children:[e.jsx(f,{size:"sm",children:he(n)}),Gs(r)]},n))})},Le={external_account:"Bank account","individual.verification.document":"Government-issued photo ID","individual.verification.additional_document":"Additional ID verification","individual.address.line1":"Personal address","individual.address.city":"Personal city","individual.address.postal_code":"Personal postal code","individual.dob.day":"Date of birth","individual.email":"Email address","individual.first_name":"First name","individual.last_name":"Last name","individual.phone":"Phone number","individual.ssn_last_4":"Last 4 of SSN","individual.id_number":"Government ID number","business_profile.url":"Business website","business_profile.mcc":"Business category (MCC)","business_profile.product_description":"Business description","business_profile.support_phone":"Customer support phone","company.tax_id":"Business tax ID","company.name":"Legal business name","company.address.line1":"Business address","company.address.city":"Business city","company.address.postal_code":"Business postal code","company.verification.document":"Business verification document","tos_acceptance.date":"Stripe terms acceptance","tos_acceptance.ip":"Stripe terms acceptance"},Us=i=>Le[i]?Le[i]:i.replace(/_/g," ").replace(/\./g," ⣠").replace(/\b\w/g,s=>s.toUpperCase()),ge=({items:i,severity:s="due"})=>
1{if(!(i!=null&&i.length))return null;const n=s==="due"?"orange":"blue",r=s==="due"?je:Me;return e.jsx(U,{spacing:4,size:"sm",icon:e.jsx(ie,{color:n,variant:"light",size:20,radius:"xl",children:e.jsx(r,{size:14})}),children:i.map(o=>e.jsx(U.Item,{children:Us(o)},o))})},qs=["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"],qe=i=>{if(!i||!qs.includes(i.toUpperCase()))return{isEU:!1,isIreland:!1,showVatForm:!1};const s=i.toUpperCase()==="IE";return{isEU:!0,isIreland:s,showVatForm:!s}},Xe={getVatSetting:async i=>(await G.get(`organizers/${i}/vat-settings`)).data,upsertVatSetting:async(i,s)=>(await G.post(`organizers/${i}/vat-settings`,s)).data},Ke="organizerVatSetting",He=(i,s)=>ae({queryKey:[Ke,i],queryFn:async()=>{const{data:n}=await Xe.getVatSetting(i);return n},...s}),Xs=i=>{const s=q();return H({mutationFn:async n=>await Xe.upsertVatSetting(i,n),onSuccess:()=>{s.invalidateQueries({queryKey:[Ke,i]})}})},Ks=/^[A-Z]{2}[0-9A-Z]{8,15}$/,Hs=i=>{const s=i.trim();if(s.includes(" "))return{valid:!1,error:t._({id:"CabI04"})};const n=s.toUpperCase();return Ks.test(n)?{valid:!0}:{valid:!1,error:t._({id:"PMhxAR"})}},Ys=({status:i,error:s,businessName:n,attempts:r})=>{switch(i){case"VALID":return e.jsx(O,{variant:"success",title:t._({id:"gPgdNV"}),children:n&&e.jsx(f,{size:"xs",c:"dimmed",children:n})});case"PENDING":case"VALIDATING":return e.jsxs(pe,{color:"blue",icon:i==="VALIDATING"?e.jsx(Ne,{size:"xs"}):e.jsx(Me,{}),children:[e.jsx(f,{size:"sm",fw:500,children:i==="VALIDATING"?t._({id:"imLQ9Y"}):t._({id:"EmFsMZ"})}),e.jsx(f,{size:"xs",c:"dimmed",children:t._({id:"ZOmUYW"})})]});case"INVALID":return e.jsxs(pe,{color:"red",icon:e.jsx(je,{}),children:[e.jsx(f,{size:"sm",fw:500,children:t._({id:"RUMiLy"})}),e.jsx(f,{size:"xs",c:"dimmed",children:s||t._({id:"injXD7"})})]});case"FAILED":return e.jsxs(pe,{color:"orange",icon:e.jsx(es,{}),children:[e.jsx(f,{size:"sm",fw:500,children:t._({id:"516oLj"})}),e.jsxs(f,{size:"xs",c:"dimmed",children:[t._({id:"x8rEDQ"}),r>0&&` (${t._({id:"BCmibk"})}: ${r})`]})]});default:return null}},Zs=({organizerId:i,onSuccess:s})=>{var R;const[n,r]=x.useState(""),[o,_]=x.useState(""),[m,l]=x.useState(),d=o.trim().length>0,y=He(i,{refetchInterval:j=>{if(!d)return!1;const w=j.state.data;return(w==null?void 0:w.vat_validation_status)==="PENDING"||(w==null?void 0:w.vat_validation_status)==="VALIDATING"?5e3:!1}}),u=Xs(i),c=y.data;x.useEffect(()=>{c&&!n&&(r(c.vat_registered?"yes":"no"),_(c.vat_number||""))},[c,n]);const a=j=>{_(j),m&&l(void 0)},p=async()=>{if(n==="yes"&&!o){L(t._({id:"r+lQXT"}));return}if(n==="yes"){const j=Hs(o);if(!j.valid){l(j.error),L(j.error||t._({id:"N9JsFT"}));return}}try{const j=await u.mutateAsync({vat_registered:n==="yes",vat_number:n==="yes"?o.toUpperCase().trim():null});j.data.vat_registered?j.data.vat_validation_status==="VALID"?C(t._({id:"gPgdNV"})):j.data.vat_validation_status==="INVALID"?L(t._({id:"vqji3Y"})):j.data.vat_validation_status==="PENDING"?C(t._({id:"UvYql/"})):C(t._({id:"Nfbg76"})):C(t._({id:"Nfbg76"})),s==null||s()}catch{L(t._({id:"l6acRV"}))}},g=n&&(n==="no"||n==="yes"&&o.trim().length>=10),S=((R=c==null?void 0:c.vat_number)==null?void 0:R.toUpperCase())===o.toUpperCase().trim();return e.jsxs(A,{gap:"lg",children:[e.jsx(_e.Group,{value:n,onChange:r,label:t._({id:"Uqefyd"}),required:!0,children:e.jsxs(k,{mt:"xs",children:[e.jsx(_e,{value:"no",label:t._({id:"HSw5l3"})}),e.jsx(_e,{value:"yes",label:t._({id:"X/azM1"})})]})}),n==="yes"&&e.jsxs(A,{gap:"md",children:[e.jsx(z,{label:t._({id:"pnVh83"}),description:t._({id:"IdULhL"}),placeholder:"IE1234567A",value:o,onChange:j=>a(j.target.value),maxLength:17,required:!0,error:m}),(c==null?void 0:c.vat_number)&&!m&&S&&e.jsx(Ys,{status:c.vat_validation_status,error:c.vat_validation_error,businessName:c.business_name,attempts:c.vat_validation_attempts})]}),e.jsxs(k,{children:[e.jsx(E,{onClick:p,loading:u.isPending,disabled:!g,children:t._({id:"6/TNCd"})}),n==="yes"&&!S&&e.jsx(f,{size:"xs",c:"dimmed",children:t._({id:"QBlhh4"})})]})]})},$s=({organizerId:i,stripeCountry:s})=>{const n=He(i),r=qe(s);if(!r.isEU)return null;const o=n.data,_=(o==null?void 0:o.vat_registered)==null;return r.isIreland?e.jsx(O,{variant:"info",title:t._({id:"tJylUv"}
1),children:t._({id:"tLf3yJ"})}):e.jsxs(e.Fragment,{children:[_&&e.jsx(O,{variant:"tip",title:t._({id:"AhwTa1"}),style:{marginBottom:24},children:t._({id:"mXPbwY"})}),!_&&e.jsx(f,{size:"sm",c:"dimmed",mb:"lg",lh:1.6,children:t._({id:"FlGprQ"})}),e.jsx(Zs,{organizerId:i})]})},Qs="_heroBullets_3ugyp_16",Ws="_bullet_3ugyp_25",Js="_statusGrid_3ugyp_31",ei="_statusCell_3ugyp_38",ti="_statusCellLabel_3ugyp_47",si="_statusCellValue_3ugyp_52",ii="_reuseInlineRow_3ugyp_58",ni="_connectedHeader_3ugyp_64",ai="_connectedIdentity_3ugyp_77",ri="_connectedMeta_3ugyp_87",oi="_accountIdRow_3ugyp_91",di="_accountIdValue_3ugyp_95",li="_manageButton_3ugyp_100",b={heroBullets:Qs,bullet:Ws,statusGrid:Js,statusCell:ei,statusCellLabel:ti,statusCellValue:si,reuseInlineRow:ii,connectedHeader:ni,connectedIdentity:ai,connectedMeta:ri,accountIdRow:oi,accountIdValue:di,manageButton:li},ci=i=>Object.values(i??{}).filter(s=>s==="active").length,ui=()=>{var Se,we;const{organizerId:i}=T(),[s,n]=x.useState(!1),r=As(i,{enabled:!!i}),o=Ns(i,s&&!!i),_=Fs(),m=Vs(),l=r.data,d=(l!=null&&l.primary_stripe_account_id?(Se=l==null?void 0:l.stripe_connect_accounts)==null?void 0:Se.find(h=>h.stripe_account_id===l.primary_stripe_account_id):void 0)??((we=l==null?void 0:l.stripe_connect_accounts)==null?void 0:we[0]),y=!!(l!=null&&l.has_completed_setup),u=!!d&&!d.is_setup_complete,c=(l==null?void 0:l.reusable_connections)??[],[a,p]=x.useState(null),[g,S]=x.useState(!1),[R,j]=x.useState(!1);x.useEffect(()=>{if(!s||o.isLoading||!o.data)return;const h=o.data.connect_url;if(!h){L(t._({id:"v0aRY1"})),n(!1);return}C(t._({id:"HiGkFu"})),typeof window<"u"&&(window.location.href=String(h))},[s,o.isLoading,o.data]),x.useEffect(()=>{o.isError&&(n(!1),L(t._({id:"ADsQ23"})))},[o.isError]);const w=()=>{n(!0)},P=h=>{if(!i||!h.stripe_account_id)return;const I=h.stripe_account_id;rt.openConfirmModal({title:t._({id:"cALvbl"}),children:e.jsxs(A,{gap:"xs",children:[e.jsx(f,{size:"sm",children:t._({id:"n68908",values:{stripeAccountId:I}})}),e.jsx(f,{size:"sm",c:"dimmed",children:t._({id:"o0qzpM"})})]}),labels:{confirm:t._({id:"+K0AvT"}),cancel:t._({id:"Brhs/U"})},confirmProps:{color:"red","data-testid":"stripe-disconnect-confirm-button"},onConfirm:()=>{m.mutate({organizerId:i,stripeAccountId:I},{onSuccess:()=>{C(t._({id:"S/7MPw"}))},onError:()=>{L(t._({id:"jTee4a"}))}})}})},F=(h,I)=>e.jsxs(v,{mt:"md",children:[e.jsx(me,{my:"sm"}),e.jsx(ue,{component:"button",type:"button",size:"xs",c:"dimmed",underline:"hover",onClick:()=>P(h),"data-testid":"stripe-disconnect-button",children:I})]}),D=()=>{if(!a||!i)return;const h=c.find(I=>String(I.stripe_account_id)===a);h&&_.mutate({organizerId:i,sourceOrganizerId:h.organizer_id},{onSuccess:()=>{C(t._({id:"akZMv8",values:{0:h.organizer_name}})),p(null)},onError:()=>{L(t._({id:"aT/44s"}))}})},Y=()=>{if(c.length===0)return null;const h=c.map(I=>({value:String(I.stripe_account_id),label:I.country?`${I.organizer_name} (${I.country})`:I.organizer_name}));return e.jsxs(v,{mt:"md",children:[e.jsx(me,{my:"sm"}),g?e.jsxs(A,{gap:"xs",children:[e.jsx(f,{size:"xs",c:"dimmed",children:t._({id:"1Zehp4"})}),e.jsxs(k,{gap:"xs",align:"flex-start",wrap:"nowrap",className:b.reuseInlineRow,children:[e.jsx(fe,{placeholder:t._({id:"Zok1Gx"}),data:h,value:a,onChange:p,searchable:!0,nothingFoundMessage:t._({id:"LiLk8u"}),size:"xs",style:{flex:1}}),e.jsx(E,{variant:"light",size:"xs",disabled:!a,loading:_.isPending,onClick:D,children:t._({id:"XFOPle"})})]})]}):e.jsx(ue,{component:"button",type:"button",size:"xs",c:"dimmed",underline:"hover",onClick:()=>S(!0),children:t._({id:"USEpOK"})})]})},J=()=>e.jsxs(e.Fragment,{children:[e.jsxs(k,{gap:"md",mb:"sm",wrap:"nowrap",children:[e.jsx(ie,{size:48,radius:"md",variant:"light",color:"indigo",children:e.jsx(xe,{size:28})}),e.jsxs(v,{children:[e.jsx(ee,{order:4,children:t._({id:"lGYzP6"})}),e.jsx(f,{c:"dimmed",size:"sm",mt:4,children:t._({id:"jegrvW"})})]})]}),e.jsx(f,{size:"sm",mb:"md",lh:1.5,children:t._({id:"1W5XyZ"})}),e.jsxs(v,{className:b.heroBullets,children:[e.jsxs("span",{className:b.bullet,children:[e.jsx(is,{size:16}),t._({id:"5LO38w"})]}),e.jsxs("span",{className:b.bullet,children:[e.jsx(ns,{size:16}),t._({id:"dgKxZ5"})]}),e.jsxs("span",{className:b.bullet,children:[e.jsx(as,{size:16}),t._({id:"4BZj5p"})]})]}),e.jsx(E,{size:"md",leftSection:e.jsx(xe,{size:18}
1),onClick:w,loading:s&&(o.isLoading||!o.data),children:t._({id:"UMGQOh"})}),Y()]}),Ye=h=>{const I=h.requirements.past_due.length>0||h.requirements.currently_due.length>0;return e.jsxs(e.Fragment,{children:[e.jsxs(k,{gap:"md",mb:"md",wrap:"nowrap",children:[e.jsx(ie,{size:40,radius:"md",variant:"light",color:"orange",children:e.jsx(je,{size:22})}),e.jsxs("div",{children:[e.jsx(ee,{order:4,children:t._({id:"g+xRXP"})}),e.jsx(f,{c:"dimmed",size:"sm",children:t._({id:"FzcCHA"})})]})]}),e.jsx(E,{leftSection:e.jsx(ke,{size:16}),onClick:w,loading:s&&(o.isLoading||!o.data),children:t._({id:"bUQMpb"})}),Y(),F(h,t._({id:"DARj+w"})),I&&e.jsxs(v,{mt:"md",children:[e.jsx(ue,{component:"button",type:"button",size:"xs",c:"dimmed",underline:"hover",onClick:()=>j(V=>!V),children:R?t._({id:"VMlRqi"}):t._({id:"JFap6u"})}),R&&e.jsxs(v,{mt:"sm",children:[h.requirements.past_due.length>0&&e.jsxs(v,{mb:"sm",children:[e.jsx(f,{size:"xs",c:"dimmed",mb:4,children:t._({id:"BFjW8X"})}),e.jsx(ge,{items:h.requirements.past_due})]}),h.requirements.currently_due.length>0&&e.jsxs(v,{children:[e.jsx(f,{size:"xs",c:"dimmed",mb:4,children:t._({id:"5ia+r6"})}),e.jsx(ge,{items:h.requirements.currently_due})]})]})]})]})},Ze=h=>{const I=ci(h.capabilities),V=h.stripe_account_id??"",$e=V?`https://dashboard.stripe.com/${V}`:"https://dashboard.stripe.com/";return e.jsxs(e.Fragment,{children:[e.jsxs(v,{className:b.connectedHeader,mb:"md",children:[e.jsxs(v,{className:b.connectedIdentity,children:[e.jsx(ie,{size:48,radius:"md",variant:"light",color:"green",children:e.jsx(ts,{size:26})}),e.jsxs("div",{children:[e.jsx(ee,{order:4,children:t._({id:"s/KaDb"})}),e.jsx(f,{c:"dimmed",size:"sm",className:b.connectedMeta,children:h.country?t._({id:"UqH1Q6",values:{0:h.country,1:h.account_type??"Standard"}}):t._({id:"jzb4Ep",values:{0:h.account_type??"Standard"}})}),V&&e.jsxs(k,{gap:4,mt:2,wrap:"nowrap",className:b.accountIdRow,children:[e.jsx(f,{size:"xs",c:"dimmed",className:b.accountIdValue,children:V}),e.jsx(Wt,{value:V,timeout:1500,children:({copied:le,copy:Qe})=>e.jsx(Jt,{label:le?t._({id:"6V3Ea3"}):t._({id:"4i7smN"}),withArrow:!0,position:"right",children:e.jsx(Qt,{size:"xs",variant:"subtle",color:le?"green":"gray",onClick:Qe,"aria-label":t._({id:"4i7smN"}),children:le?e.jsx(ce,{size:12}):e.jsx(ss,{size:12})})})})]})]})]}),e.jsx(E,{component:"a",href:$e,target:"_blank",rel:"noreferrer",variant:"subtle",leftSection:e.jsx(ke,{size:16}),className:b.manageButton,children:t._({id:"RlzPUE"})})]}),e.jsxs(v,{className:b.statusGrid,children:[e.jsxs("div",{className:b.statusCell,children:[e.jsx("span",{className:b.statusCellLabel,children:t._({id:"Kb+0BT"})}),e.jsx("span",{className:b.statusCellValue,children:h.charges_enabled?e.jsx(B,{color:"green",leftSection:e.jsx(ce,{size:12}),children:t._({id:"RxzN1M"})}):e.jsx(B,{color:"red",children:t._({id:"E/QGRL"})})})]}),e.jsxs("div",{className:b.statusCell,children:[e.jsx("span",{className:b.statusCellLabel,children:t._({id:"C+ylwF"})}),e.jsx("span",{className:b.statusCellValue,children:h.payouts_enabled?e.jsx(B,{color:"green",leftSection:e.jsx(ce,{size:12}),children:t._({id:"RxzN1M"})}):e.jsx(B,{color:"red",children:t._({id:"E/QGRL"})})})]}),e.jsxs("div",{className:b.statusCell,children:[e.jsx("span",{className:b.statusCellLabel,children:t._({id:"kCl6ja"})}),e.jsx("span",{className:b.statusCellValue,children:e.jsx(at,{id:"30bTiU",values:{activeCount:I}})})]})]}),e.jsx(te,{variant:"separated",radius:"md",mt:"md",children:e.jsxs(te.Item,{value:"capabilities",children:[e.jsx(te.Control,{children:t._({id:"6CQ7/B"})}),e.jsx(te.Panel,{children:e.jsx(Os,{capabilities:h.capabilities})})]})}),h.requirements.eventually_due.length>0&&e.jsxs(O,{variant:"tip",title:t._({id:"R1lIMV"}),style:{marginTop:16},children:[e.jsx(f,{size:"sm",mb:"xs",children:t._({id:"2W/7Gz"})}),e.jsx(ge,{items:h.requirements.eventually_due,severity:"eventually"})]}),i&&qe(h.country).isEU&&e.jsxs(v,{mt:"xl",children:[e.jsx(me,{mb:"md"}),e.jsx(ee,{order:4,mb:4,children:t._({id:"khBZkl"})}),e.jsx(f,{c:"dimmed",size:"sm",mb:"md",children:t._({id:"cceMns"})}),e.jsx($s,{organizerId:i,stripeCountry:h.country})]}),F(h,t._({id:"Bst+aq"}))]})};return e.jsxs(N,{children:[e.jsx(M,{heading:t._({id:"C+ylwF"}),description:t._({id:"peBIO+"})}),r.isLoading?e.jsx(k,{justify:"center",p:"xl",children:e.jsx(Ne,{})}):y&&d?Ze(d):u&&d?Ye(d):J()]})},mi=()=>{var l;const{organizerId:i}=T(),s=Q(i),n=oe(i),r=W(),[o,_]=x.useState(!1);x.useEffect(()=>{s!=null&&s.isFetched&&(s!=null&&s.data)&&_(s.data.default_pass_platform_fee_to_buyer??!1)},[s.isFetched,s.data]);const m=d=>{r.mutate({organizerSettings:{default_pass_platform_fee_to_buyer:d},organizerId:i},{onSuccess:()=>{C(t._({id:"DMCX/I"})),_(d)}})};return e.jsx(qt,{configuration:(l=n.data)==null?void 0:l.configuration,currentValue:o,onSave:m,isLoading:s.isLoading,isSaving:r.isPending,heading:t._({id:"br3Y/y"}),description:t._({id:"89xaFU"}),feeHandlingLabel:t._({id:"3R/Tu2"}),feeHandlingDescription:t._({id:"LAW8Vb"})})},pi="getOrganizerDeletionStatus",_i=i=>ae({queryKey:[pi,i],staleTime:0,queryFn:async()=>{const{data:s}=await ne.getDeletionStatus(i);return s}}),hi=()=>{const i=q();return H({mutationFn:({organizerId:s})=>ne.delete(s),onSuccess:()=>i.invalidateQueries({queryKey:[Fe]})})},gi=()=>{var w;const{organizerId:i}=T(),s=ot(),n=ds(),{data:r,isLoading:o}=_i(i),{data:_}=oe(i),{data:m}=pt(),l=hi(),d=rs(),[y,u]=x.useState(""),c=(_==null?void 0:_.status)===se.ARCHIVED,a=t._({id:"HNlEFZ"}),p=y.trim().toLocaleLowerCase()===a.toLocaleLowerCase(),g=((w=m==null?void 0:m.data)==null?void 0:w.filter(P=>P.status!==se.ARCHIVED).length)??0,S=!c&&g<=1,R=()=>{l.mutate({organizerId:i},{onSuccess:()=>{C(t._({id:"GzjTd0"})),s("/manage/events")},onError:P=>{var F,D;L(((D=(F=P==null?void 0:P.response)==null?void 0:F.data)==null?void 0:D.message)||t._({id:"2mkc3c"}))}})},j=()=>{const P=c?se.LIVE:se.ARCHIVED,F=c?t._({id:"7MjfcR"}
1):t._({id:"Trnl3E"});os(F,()=>{d.mutate({organizerId:i,status:P},{onSuccess:()=>{C(c?t._({id:"HF8Bxa"}):t._({id:"P/JHA4"}))},onError:D=>{var Y,J;L(((J=(Y=D==null?void 0:D.response)==null?void 0:Y.data)==null?void 0:J.message)||t._({id:"T2aCOV"}))}})},{confirm:c?t._({id:"yKu/3Y"}):t._({id:"B495Gs"}),cancel:t._({id:"dEgA5A"})})};return n?e.jsxs(ze,{children:[e.jsx(Pe,{title:t._({id:"sY3tIw"}),description:r!=null&&r.can_delete?t._({id:"nJeeX7"}):(r==null?void 0:r.reason)||t._({id:"Z3FXyt"}),action:e.jsxs(e.Fragment,{children:[!o&&!(r!=null&&r.can_delete)&&e.jsx(O,{variant:"info",style:{marginBottom:8},children:r==null?void 0:r.reason}),(r==null?void 0:r.can_delete)&&e.jsxs(A,{gap:"xs",maw:400,children:[e.jsx(f,{size:"sm",c:"dimmed",children:t._({id:"QytzQr"})}),e.jsx(z,{placeholder:a,value:y,onChange:P=>u(P.currentTarget.value)})]}),e.jsx(E,{mt:"sm",color:"red",variant:"outline",onClick:R,loading:l.isPending,disabled:!(r!=null&&r.can_delete)||o||!p,leftSection:e.jsx(cs,{size:16}),children:t._({id:"sY3tIw"})})]})}),e.jsx(Pe,{title:c?t._({id:"/JyMGh"}):t._({id:"BrwnrJ"}),description:c?t._({id:"DDIcqy"}):S?t._({id:"jTDzpA"}):t._({id:"eqFkeI"}),action:e.jsx(E,{color:c?"blue":"orange",variant:"outline",onClick:j,loading:d.isPending,disabled:!c&&S,leftSection:c?e.jsx(Xt,{size:16}):e.jsx(us,{size:16}),children:c?t._({id:"/JyMGh"}):t._({id:"BrwnrJ"})})})]}):e.jsx(ze,{children:e.jsxs("div",{style:{textAlign:"center",padding:"20px 0"},children:[e.jsx(ls,{emoji:"â"}),e.jsx("h3",{children:t._({id:"MKqSg4"})}),e.jsx(f,{size:"sm",c:"dimmed",children:t._({id:"rnoDMF"})})]})})},ye=[{key:"facebook_pixel",label:"Facebook Pixel",icon:Ve,placeholder:"1234567890",description:"Pixel ID (numeric)",pattern:/^\d{9,20}$/,formatHint:"Must be 9-20 digits"},{key:"google_analytics_4",label:"Google Analytics 4",icon:ps,placeholder:"G-XXXXXXXXXX",description:"Measurement ID",pattern:/^G-[a-zA-Z0-9]{6,20}$/,formatHint:"Must start with G- followed by 6-20 characters"},{key:"google_tag_manager",label:"Google Tag Manager",icon:_s,placeholder:"GTM-XXXXXXX",description:"Container ID",pattern:/^GTM-[a-zA-Z0-9]{4,20}$/,formatHint:"Must start with GTM- followed by 4-20 characters"},{key:"tiktok_pixel",label:"TikTok Pixel",icon:Be,placeholder:"CXXXXXXXXXX",description:"Pixel ID",pattern:/^[a-zA-Z0-9]{6,30}$/,formatHint:"Must be 6-30 alphanumeric characters"}];function Te(i){const s={};for(const n of ye)s[n.key]={enabled:!1,pixel_id:""};if(i)for(const n of i)s[n.provider]&&(s[n.provider]={enabled:n.enabled,pixel_id:n.pixel_id});return s}function fi(i){return Object.entries(i).filter(([,s])=>s.pixel_id.trim()!=="").map(([s,n])=>({provider:s,pixel_id:n.pixel_id.trim(),enabled:n.enabled}))}const Re="google_tag_manager",xi=()=>{const{organizerId:i}=T(),{data:s}=Ge(),n=s==null?void 0:s.is_saas_mode_enabled,r=n?ye.filter(u=>u.key!==Re):ye,o=Q(i),_=W(),m=K(),l=X({initialValues:{pixels:Te(void 0),tracking_consent_acknowledged:!1}});x.useEffect(()=>{o!=null&&o.isFetched&&(o!=null&&o.data)&&l.setValues({pixels:Te(o.data.tracking_pixels),tracking_consent_acknowledged:o.data.tracking_consent_acknowledged||!1})},[o.isFetched]);const d=u=>{var p;let c=!1;for(const g of r){const S=(p=u.pixels[g.key])==null?void 0:p.pixel_id.trim();S&&!g.pattern.test(S)&&(l.setFieldError(`pixels.${g.key}.pixel_id`,g.formatHint),c=!0)}let a=fi(u.pixels);n&&(a=a.filter(g=>g.provider!==Re)),a.length>0&&!u.tracking_consent_acknowledged&&(l.setFieldError("tracking_consent_acknowledged",t._({id:"9jJNZY"})),c=!0),!c&&_.mutate({organizerSettings:{tracking_pixels:a,tracking_consent_acknowledged:u.tracking_consent_acknowledged},organizerId:i},{onSuccess:()=>{C(t._({id:"CNSSfp"}))},onError:g=>{m(l,g)}})},y=r.some(u=>{var c;return((c=l.values.pixels[u.key])==null?void 0:c.pixel_id.trim())!==""});return e.jsxs(N,{children:[e.jsx(M,{heading:t._({id:"YwKzpH"}),description:t._({id:"uIv4Op"})}),e.jsx("form",{onSubmit:l.onSubmit(d),children:e.jsxs("fieldset",{disabled:o.isLoading||_.isPending,children:[e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:r.map(u=>{const c=u.icon,a=l.values.pixels[u.key],p=(a==null?void 0:a.pixel_id.trim())!=="";return e.jsxs("div",{style:{padding:"14px 16px",borderRadius:"8px",border:`1px solid var(--mantine-color-${p&&(a!=null&&a.enabled)?"primary-3":"gray-3"})`,backgroundColor:p&&(a!=null&&a.enabled)?"var(--mantine-color-primary-0)":"transparent",transition:"all 0.15s ease"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:p?"10px":0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx(c,{size:20,style:{opacity:.7}}),e.jsxs("div",{children:[e.jsx(f,{size:"sm",fw:500,children:u.label}),!p&&e.jsx(f,{size:"xs",c:"dimmed",children:u.description})]})]}),p&&e.jsx(be,{size:"sm",checked:(a==null?void 0:a.enabled)??!1,onChange:g=>l.setFieldValue(`pixels.${u.key}.enabled`,g.currentTarget.checked)})]}
1),e.jsx(z,{...l.getInputProps(`pixels.${u.key}.pixel_id`),placeholder:u.placeholder,size:"sm",description:p?u.description:void 0,onChange:g=>{l.setFieldValue(`pixels.${u.key}.pixel_id`,g.currentTarget.value),g.currentTarget.value.trim()!==""&&!(a!=null&&a.enabled)&&l.setFieldValue(`pixels.${u.key}.enabled`,!0)},styles:{input:{fontFamily:"monospace",fontSize:"13px"}}})]},u.key)})}),y&&e.jsxs(e.Fragment,{children:[e.jsx(O,{variant:"tip",style:{marginTop:24},children:t._({id:"dg05rc"})}),e.jsx(ms,{...l.getInputProps("tracking_consent_acknowledged",{type:"checkbox"}),label:t._({id:"8Wgd41"}),mb:"md",error:l.errors.tracking_consent_acknowledged})]}),e.jsx(E,{loading:_.isPending,type:"submit",mt:"md",children:t._({id:"tfDRzk"})})]})})]})},ga=()=>{const{organizerId:i}=T(),{data:s}=Ge(),n=s==null?void 0:s.is_saas_mode_enabled,r=x.useMemo(()=>{const a=[{id:"basic-settings",label:t._({id:"jIPNJG"}),icon:fs,component:Ps},{id:"event-defaults",label:t._({id:"0Zptey"}),icon:xs,component:Ds},{id:"address-settings",label:t._({id:"Du6bPw"}),icon:ys,component:Ts},{id:"social-links",label:t._({id:"d0rUsW"}),icon:ft,component:ks},{id:"seo-settings",label:t._({id:"4Ml90q"}),icon:Kt,component:Es},{id:"email-templates",label:t._({id:"6IwNUc"}),icon:bs,component:()=>e.jsx(Rs,{organizerId:i})},{id:"tracking-pixels",label:t._({id:"YwKzpH"}),icon:js,component:xi},{id:"danger-zone",label:t._({id:"ZQKLI1"}),icon:Is,component:gi,color:"red"}];return n&&a.splice(2,0,{id:"payouts",label:t._({id:"C+ylwF"}),icon:xe,component:ui},{id:"platform-fees",label:t._({id:"br3Y/y"}),icon:vs,component:mi}),a},[n,i]),o=dt("(min-width: 1200px)",!0),_=lt(),m=x.useMemo(()=>{var p;const a=((p=_.hash)==null?void 0:p.replace(/^#/,"").split("?")[0])??"";return a&&r.some(g=>g.id===a)?a:null},[_.hash,r]),[l,d]=x.useState(m??"basic-settings");x.useEffect(()=>{if(!m)return;d(m);const p=[0,200,600,1200,2e3].map(g=>window.setTimeout(()=>{var S;(S=document.getElementById(m))==null||S.scrollIntoView({behavior:"auto",block:"start"})},g));return()=>{p.forEach(g=>window.clearTimeout(g))}},[m]);const y=a=>{var p;d(a),(p=document.getElementById(a))==null||p.scrollIntoView({behavior:"smooth"})},u=e.jsx(N,{style:{padding:"15px",marginBottom:0},children:e.jsx(A,{gap:"xs",children:r.map(a=>e.jsx(Ht,{style:{borderRadius:"5px"},active:l===a.id,label:a.label,color:"color"in a?a.color:void 0,leftSection:e.jsx(a.icon,{size:16,stroke:1.5}),onClick:()=>y(a.id)},a.id))})}),c=r.map(({id:a,component:p})=>e.jsx("div",{id:a,style:{scrollMarginTop:"20px"},children:e.jsx(p,{})},a));return e.jsxs(hs,{children:[e.jsx(gs,{children:t._({id:"wpj63n"})}),o?e.jsxs(k,{align:"flex-start",gap:"md",children:[e.jsx(v,{w:240,style:{position:"sticky",top:20},children:u}),e.jsx(v,{style:{flex:1},children:c})]}):e.jsxs(A,{children:[u,c]})]})};export{ga as default};
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.