PageSourceSearch

https://www.bouncelife.com/_next/static/chunks/5361-3cae8e7ee873a8c2.js

js bouncelife.com collected 2026-09-24 09:51:47 UTC 301,574 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5361],{68552:function(e,t,s){"use strict";s.d(t,{$N:function(){return useCreatePrePurchaseFormMutation},Y8:function(){return useCreatePrePurchaseResponseMutation},NI:function(){return useDeletePrePurchaseForm},zb:function(){return useGetPrePurchaseForm},Jr:function(){return useGetPrePurchaseResponse},me:function(){return useUpdatePrePurchaseFormMutation},QE:function(){return useUpdatePrePurchaseResponseMutation}});var i=s(88767),n=s(890);async function createPrePurchaseForm(e){let{eventId:t,schema:s}=e,{data:i}=await n.Z.post("/api/events/".concat(t,"/pre-purchase-questions"),{schema:s});return i}async function updatePrePurchaseForm(e){let{eventId:t,schema:s}=e,{data:i}=await n.Z.put("/api/events/".concat(t,"/pre-purchase-questions"),{schema:s});return i}async function createPrePurchaseResponse(e){let{eventId:t,response:s}=e,{data:i}=await n.Z.post("/api/users/me/events/".concat(t,"/pre-purchase-questions/responses"),s);return i}async function updatePrePurchaseResponse(e){let{eventId:t,response:s}=e,{data:i}=await n.Z.put("/api/users/me/events/".concat(t,"/pre-purchase-questions/responses"),s);return i}async function getPrePurchaseForm(e){let{data:t}=await n.Z.get("/api/events/".concat(e,"/pre-purchase-questions"));return t}async function getPrePurchaseResponse(e){let{data:t}=await n.Z.get("/api/users/me/events/".concat(e,"/pre-purchase-questions/responses"));return t}async function deletePrePurchaseForm(e){let{data:t}=await n.Z.delete("/api/events/".concat(e,"/pre-purchase-questions"));return t}function useCreatePrePurchaseFormMutation(){return(0,i.useMutation)(e=>{let{eventId:t,schema:s}=e;return createPrePurchaseForm({eventId:t,schema:s})})}function useUpdatePrePurchaseFormMutation(){return(0,i.useMutation)(e=>{let{eventId:t,schema:s}=e;return updatePrePurchaseForm({eventId:t,schema:s})})}function useCreatePrePurchaseResponseMutation(){return(0,i.useMutation)(e=>{let{eventId:t,response:s}=e;return createPrePurchaseResponse({eventId:t,response:s})})}function useUpdatePrePurchaseResponseMutation(){return(0,i.useMutation)(e=>{let{eventId:t,response:s}=e;return updatePrePurchaseResponse({eventId:t,response:s})})}function useGetPrePurchaseForm(e,t){let{eventId:s}=e;return(0,i.useQuery)(["prePurchaseForm",{eventId:s}],()=>getPrePurchaseForm(s),{enabled:null==t?void 0:t.enabled})}function useGetPrePurchaseResponse(e,t){let{eventId:s}=e;return(0,i.useQuery)(["prePurchaseResponse",{eventId:s}],()=>getPrePurchaseResponse(s),{enabled:null==t?void 0:t.enabled,retry:0})}function useDeletePrePurchaseForm(){let e=(0,i.useQueryClient)();return(0,i.useMutation)(deletePrePurchaseForm,{onSuccess:(t,s)=>{e.resetQueries(["prePurchaseForm",{eventId:s}])}})}},65295:function(e,t,s){"use strict";s.d(t,{BU:function(){return useDeleteFile},$G:function(){return useGetAssociationFormById},nY:function(){return useGetAssociationForms},m0:function(){return useUpdateFormResponse},nc:function(){return useUploadFiles}});var i=s(88767),n=s(890);async function getAssociationForms(e){let{data:t}=await n.Z.get("/api/associations/".concat(e,"/forms"));return t}async function getAssociationFormById(e){let{associationId:t,formId:s}=e,{data:i}=await n.Z.get("/api/associations/".concat(t,"/forms/").concat(s));return i}async function updateFormResponse(e){let{associationId:t,formId:s,responseId:i,response:r}=e,{data:a}=await n.Z.put("/api/associations/".concat(t,"/forms/").concat(s,"/responses/").concat(i),r);return a}async function uploadFiles(e){let{associationId:t,file:s}=e,i=new FormData;i.append("file",s);let{data:r}=await n.Z.post("/api/associations/".concat(t,"/forms/files"),i,{headers:{"Content-Type":"multipart/form-data"}});return r}async function deleteFile(e){let{associationId:t,filename:s}=e,{data:i}=await n.Z.delete("/api/associations/".concat(t,"/forms/files/").concat(s));return i}function useGetAssociationForms(e,t){var s;let{associationId:n}=e;return(0,i.useQuery)(["associationForms",{associationId:n}],()=>getAssociationForms(n),{enabled:!!n&&(null===(s=null==t?void 0:t.enabled)||void 0===s||s)})}function useGetAssociationFormById(e){let{associationId:t,formId:s}=e;return(0,i.useQuery)(["associationForms",{associationId:t,formId:s}],()=>getAssociationFormById({associationId:t,formId:s}
1),{enabled:!!t&&!!s})}function useUpdateFormResponse(){let e=(0,i.useQueryClient)();return(0,i.useMutation)(updateFormResponse,{onSuccess:(t,s)=>{let{associationId:i,formId:n,responseId:r}=s;e.invalidateQueries(["associationFormResponses",{associationId:i,formId:n}]),e.invalidateQueries(["associationFormResponses",{associationId:i,formId:n,responseId:r}])}})}function useUploadFiles(){return uploadFiles}function useDeleteFile(){return deleteFile}},36606:function(e,t,s){"use strict";s.d(t,{lz:function(){return useCreateAssociationWorkflowSubmission},Zr:function(){return useCreateAssociationWorkflowSubmissionReview},zL:function(){return useGetAssociationWorkflow},_C:function(){return useGetAssociationWorkflowSubmission},zr:function(){return useGetAssociationWorkflowSubmissions},GC:function(){return useGetAssociationWorkflows},fy:function(){return useGetMyWorkflowSubmissions}});var i=s(88767),n=s(80454),r=s(890);async function getAssociationWorkflows(e){let{data:t}=await r.Z.get("/api/associations/".concat(e,"/workflows"));return t}async function getAssociationWorkflowSubmissions(e){let{associationId:t,cursor:s,numberOfItems:i,filters:n}=e,{data:a}=await r.Z.get("/api/associations/".concat(t,"/workflows/submissions"),{params:{limit:i||20,cursor:s,query:(null==n?void 0:n.query)||void 0,status:(null==n?void 0:n.status)||void 0,workflowId:(null==n?void 0:n.workflowId)||void 0,sort:(null==n?void 0:n.sort)||void 0,order:(null==n?void 0:n.order)||void 0}});return a}async function getAssociationWorkflow(e){let{associationId:t,workflowId:s}=e,{data:i}=await r.Z.get("/api/associations/".concat(t,"/workflows/").concat(s));return i}async function createAssociationWorkflowSubmission(e){let{associationId:t,workflowId:s,submission:i}=e,{data:n}=await r.Z.post("/api/associations/".concat(t,"/workflows/").concat(s,"/submissions"),i);return n}async function getAssociationWorkflowSubmission(e){let{associationId:t,workflowId:s,submissionId:i}=e,{data:n}=await r.Z.get("/api/associations/".concat(t,"/workflows/").concat(s,"/submissions/").concat(i));return n}async function getMyWorkflowSubmissions(e){let{associationId:t,cursor:s,numberOfItems:i,filters:n}=e,{data:a}=await r.Z.get("/api/users/me/associations/".concat(t,"/workflows/submissions"),{params:{limit:i||20,cursor:s,query:(null==n?void 0:n.query)||void 0,status:(null==n?void 0:n.status)||void 0,workflowId:(null==n?void 0:n.workflowId)||void 0,sort:(null==n?void 0:n.sort)||void 0,order:(null==n?void 0:n.order)||void 0}});return a}async function createAssociationWorkflowSubmissionReview(e){let{associationId:t,workflowId:s,submissionId:i,review:n}=e,{data:a}=await r.Z.post("/api/associations/".concat(t,"/workflows/").concat(s,"/submissions/").concat(i,"/reviews"),n);return a}let a={all:["associationWorkflows"],lists:e=>["associationWorkflows",{associationId:e}],detail:(e,t)=>["associationWorkflows",{associationId:e,workflowId:t}],submissions:e=>["associationWorkflowSubmissions",{associationId:e}],submissionDetail:(e,t,s)=>["associationWorkflowSubmissions",{associationId:e,workflowId:t,submissionId:s}],mySubmissions:e=>["myWorkflowSubmissions",{associationId:e}]};function useGetAssociationWorkflows(e,t){var s;let{associationId:n}=e;return(0,i.useQuery)(a.lists(n),()=>getAssociationWorkflows(n),{enabled:!!n&&(null===(s=null==t?void 0:t.enabled)||void 0===s||s)})}function useGetAssociationWorkflowSubmissions(e){let{associationId:t,numberOfItems:s,filters:i}=e,{data:r,...a}=(0,n.p)(["associationWorkflowSubmissions",t,s,i],(e,n)=>getAssociationWorkflowSubmissions({associationId:t,cursor:n,numberOfItems:s,filters:i}),{keepPreviousData:!0,select:e=>({...e,currentPage:e.currentPage+1})});return{data:r||null,...a}}function useGetAssociationWorkflow(e){let{associationId:t,workflowId:s}=e;return(0,i.useQuery)(a.detail(t,s),()=>getAssociationWorkflow({associationId:t,workflowId:s}))}function useGetAssociationWorkflowSubmission(e){let{associationId:t,workflowId:s,submissionId:n}=e;return(0,i.useQuery)(a.submissionDetail(t,s,n),()=>getAssociationWorkflowSubmission({associationId:t,workflowId:s,submissionId:n}))}function useGetMyWorkflowSubmissions(e){let{associationId:t,numberOfItems:s,filters:i}=e,{data:r,...a}=(0,n.p)(["myWorkflowSubmissions",t,s,i],(e,n)=>getMyWorkflowSubmissions({associationId:t,cursor:n,numberOfItems:s,filters:i}),{keepPreviousData:!0,select:e=>({...e,currentPage:e.currentPage+1})});return{data:r||null,...a}}function useCreateAssociationWorkflowSubmission(){let e=(0,i.useQueryClient)();return(0,i.useMutation)(createAssociationWorkflowSubmission,{onSuccess:(t,s)=>{let{associationId:i}=s;
1e.invalidateQueries(a.submissions(i)),e.invalidateQueries(a.mySubmissions(i))}})}function useCreateAssociationWorkflowSubmissionReview(){let e=(0,i.useQueryClient)();return(0,i.useMutation)(createAssociationWorkflowSubmissionReview,{onSuccess:(t,s)=>{let{associationId:i,workflowId:n,submissionId:r}=s;e.invalidateQueries(a.submissions(i)),e.invalidateQueries(a.mySubmissions(i)),e.invalidateQueries(a.submissionDetail(i,n,r))}})}},94543:function(e,t,s){"use strict";s.d(t,{qE:function(){return components_Avatar},MX:function(){return components_AvatarBadge},HE:function(){return components_AvatarGroup},qF:function(){return u},LW:function(){return c},cf:function(){return d},EF:function(){return o}});var i,n,r,a,l,o,d,c,u,m,x,p=s(85893);s(67294);var v=s(93967),g=s.n(v);(i=o||(o={})).Xs="6",i.Sm="8",i.Md="10",i.Lg="12",i.Xl="16",i.Xxl="24",i.X3l="32",(n=d||(d={})).Full="full",n.Lg="lg",(r=c||(c={})).Stack="stack",r.Grid="grid",(a=u||(u={})).Clear="clear",a.None="none",(l=m||(m={})).Md="5",l.Lg="10",(x||(x={})).BottomRight="bottomRight";let f={[o.Xs]:"1",[o.Sm]:"1",[o.Md]:"2",[o.Lg]:"2"},h={[o.Xs]:"xs",[o.Sm]:"xs",[o.Md]:"xs",[o.Lg]:"lg"};var components_Avatar=function(e){let{src:t,size:s=o.Lg,radius:i=d.Full,isBordered:n=!0,label:r,className:a,children:l,onClick:c}=e;return(0,p.jsxs)("div",{className:"relative",children:[(0,p.jsx)("div",{className:g()("border-primary-300 overflow-hidden flex align-center bg-white justify-center relative","".concat(c&&"cursor-pointer"),"text-".concat(h[s]),"w-".concat(s," h-").concat(s),"rounded-".concat(i),n&&"border-".concat(f[s]),a),onClick:c,children:r||(0,p.jsx)("img",{src:t||"/img/search/user.svg"})}),l]})},components_AvatarBadge=function(e){let{children:t,size:s=m.Md,position:i=x.BottomRight}=e;return(0,p.jsx)("div",{className:g()("bg-primary-50 border-2 border-white absolute rounded-full overflow-hidden flex items-center justify-center","w-".concat(s," h-").concat(s),i===x.BottomRight&&"bottom-0 right-0"),children:t})},b=s(85906),j=s.n(b),components_AvatarGroup=function(e){let{children:t,additionalCount:s=0,type:i=c.Stack,additionalCountSize:n=o.Lg,additionalCountType:r=u.None,onClick:a,secondaryOnClick:l}=e;return(0,p.jsxs)("div",{className:g()("flex items-center justify-center",i===c.Grid?"gap-1":j()["avatar-group--stack"],a&&"cursor-pointer"),onClick:a||void 0,children:[t,s>0&&(0,p.jsxs)(p.Fragment,{children:[r===u.Clear&&(0,p.jsx)("div",{className:"ml-4 mt-[2px] cursor-pointer",onClick:l,children:(0,p.jsxs)("p",{className:"text-xs font-medium",children:["+",s>=1e3?"".concat((s/1e3).toFixed(1).replace(/\.0$/,""),"k"):s]})}),r===u.None&&(0,p.jsx)(components_Avatar,{onClick:l,label:"+".concat(s),size:n})]})]})}},59875:function(e,t,s){"use strict";var i=s(85893);s(67294);var n=s(45230);t.Z=e=>{let{data:t,onChange:s,disabled:r,value:a,textValueStyle:l,controlStyle:o,placeholder:d,menuPlacement:c="auto"}=e,u=t.find(e=>e.value===a);return(0,i.jsx)(n.ZP,{closeMenuOnSelect:!0,options:t,onChange:e=>{s(e.value)},value:u,placeholder:d,isDisabled:r,menuPlacement:c,styles:{control:e=>({...e,borderRadius:6,fontSize:14,height:44,...o}),placeholder:e=>({...e,color:"#B1B1B1"}),indicatorSeparator:e=>({...e,display:"none"}),option:e=>({...e,paddingLeft:8,paddingRight:8,paddingTop:12,paddingBottom:12,fontSize:14}),menuList:e=>({...e,paddingTop:12,paddingBottom:12}),singleValue:e=>({...e,...l})}})}},31776:function(e,t,s){"use strict";s.d(t,{K:function(){return useSurveyFileHandlers}});var i=s(67294),n=s(65295);let useSurveyFileHandlers=e=>{let{associationId:t}=e,s=(0,n.nc)(),r=(0,n.BU)(),a=(0,i.useRef)(new Set),l=(0,i.useCallback)((e,i)=>{let n=i.files.map(e=>s({associationId:t,file:e}));Promise.all(n).then(e=>{let t=new Map(e.map(e=>[e.originalName,e.url])),s=i.files.map(e=>({file:e,content:t.get(e.name)}));i.callback(s)}).catch(()=>{i.callback([],"File upload failed")})},[t,s]),o=(0,i.useCallback)(async(e,t)=>{if(!t.value||0===t.value.length)return t.callback("success");let s=t.fileName?t.value.filter(e=>e.name===t.fileName):t.value;if(0===s.length)return t.callback("error");s.forEach(e=>{a.current.add(e.name)});let i=t.value.filter(e=>!s.some(t=>t.name===e.name));return t.fileName?t.callback("success",i):t.callback("success",[])},[]),d=(0,i.useCallback)(async()=>
1{if(0===a.current.size)return;let e=Array.from(a.current);a.current.clear();try{await Promise.all(e.map(e=>r({associationId:t,filename:e})))}catch(e){console.error("Failed to delete some files:",e)}},[t,r]),c=(0,i.useCallback)(()=>{a.current.clear()},[]);return{onUploadFiles:l,onClearFiles:o,executePendingDeletions:d,clearPendingDeletions:c}}},97342:function(e,t,s){"use strict";var i=s(85893);s(67294),t.Z=e=>{let{children:t}=e;return(0,i.jsx)("div",{className:"container mx-auto max-w-6xl p-2 bg-white rounded-2xl",children:t})}},73996:function(e,t,s){"use strict";s.d(t,{g:function(){return n},Z:function(){return wysiwyg_form_EventUsersBadge}});var i,n,r=s(85893),a=s(67294),wysiwyg_form_SquareBadges=e=>{let{data:t,additionalUsers:s}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[t.map((e,t)=>(0,r.jsx)(a.Fragment,{children:(0,r.jsx)("div",{className:"w-12 h-12 object-cover rounded-lg border-2 border-primary-300 overflow-hidden align-center justify-center flex",children:(0,r.jsx)("img",{alt:e.name,src:(null==e?void 0:e.badgeImageUrl)||"/img/search/user.svg"})})},"".concat(e.id,"-").concat(t)||t)),s>0&&(0,r.jsxs)("div",{className:"w-12 h-12 object-cover rounded-lg border-2 border-primary-300 overflow-hidden align-center justify-center flex",children:["+",s]})]})},l=s(93967),o=s.n(l),wysiwyg_form_CircleBadges=e=>{let{data:t,additionalUsers:s,fluid:i}=e;return(0,r.jsxs)("div",{className:"flex items-center",children:[t.map((e,n)=>{var a;return(0,r.jsx)("div",{className:o()("w-12 object-cover rounded-full border-2 border-primary-300 overflow-hidden align-center justify-center flex",(n<t.length-1||s>0)&&"-mr-3",!i&&"h-12"),children:(0,r.jsx)("img",{alt:"".concat(e.name,"'s badge"),src:e.photoUrl||(null===(a=e.photo)||void 0===a?void 0:a.url)||"/img/search/user.svg"})},"".concat(e._id,"-").concat(n)||n)}),s>0&&(0,r.jsx)("div",{className:o()("w-12 object-cover rounded-full border-2 border-primary-300 overflow-hidden bg-white align-center justify-center flex",i?"self-stretch justify-self-stretch":"h-12"),children:(0,r.jsxs)("span",{children:["+",s]})})]})};(i=n||(n={})).Regular="regular",i.Large="large";var wysiwyg_form_EventUsersBadge=e=>{let{onClick:t,data:s,squareBadges:i,additionalGuests:n,title:a,secondaryDefaultText:l,badgeType:d="regular"}=e;return(0,r.jsxs)("div",{className:o()("p-4 flex items-center justify-between border-1 rounded-md cursor-pointer","large"===d&&"min-w-[250px] gap-4"),onClick:()=>{t()},children:[(0,r.jsxs)("div",{className:"flex flex-col justify-center",children:[(0,r.jsx)("div",{className:o()("text-neutral-500","large"===d?"text-sm font-bold":"text-base font-semibold"),children:a}),(0,r.jsx)("div",{className:o()("font-normal","large"===d?"text-lg text-gray-600":"text-sm"),children:l})]}),(0,r.jsx)("div",{className:o()("large"===d&&"overflow-hidden"),children:i?(0,r.jsx)(wysiwyg_form_SquareBadges,{data:s,additionalUsers:n}):(0,r.jsx)(wysiwyg_form_CircleBadges,{data:s,additionalUsers:n,fluid:!0})})]})}},93105:function(e,t,s){"use strict";s.d(t,{I:function(){return n}});var i,n,r=s(85893),a=s(93967),l=s.n(a),o=s(67294),d=s(6650),c=s(29791),u=s(47516),m=s(67421);(i=n||(n={}))[i.OneToOne=1]="OneToOne",i[i.FourToFive=.8]="FourToFive",i[i.ThreeToTwo=1.5]="ThreeToTwo",i[i.NineToSixteen=.5625]="NineToSixteen";let UploadPhoto=e=>{let{preview:t,onClick:s,photoUrl:i,label:n,maxLabel:a,aspectRatio:o,disabled:d,buttonStyle:c={},defaultIconSize:u}=e,{t:x}=(0,m.$G)(["events"]);return(0,r.jsx)("button",{type:"button",onClick:s,className:"w-full h-full",disabled:d,children:t||i?(0,r.jsx)("img",{src:t||i,className:"w-full object-cover object-center"}):(0,r.jsxs)("div",{className:l()("w-full h-full bg-primary-200 text-center flex flex-col items-center justify-center"),style:c,children:[(0,r.jsx)("p",{className:l()(!u&&1===o&&"text-3xl",!u&&1!==o&&"text-6xl"),style:u?{fontSize:u}:{},children:"\uD83D\uDDBC"}),(0,r.jsx)("p",{className:l()("text-xs decoration-[#575757] font-light",1===o?"mt-0 w-full text-xs":"w-[140px] md:px-4 mt-3",c&&"w-full mt-1"),children:n||"4:5"}),null!==a&&(0,r.jsx)("p",{className:"text-xs decoration-[#575757] font-semibold",children:a||x("events:host.eventPoster")})]})})},EditImageIcon=e=>{let{onClick:t}=e;return(0,r.jsx)("div",{className:"absolute right-0",children:(0,r.jsx)("div",{className:"mr-2 mt
1-2 rounded-full p-1 bg-blue-200 w-[32px] h-[32px] flex items-center justify-center",style:{backgroundColor:"#EEF1FF"},onClick:()=>null==t?void 0:t(),children:(0,r.jsx)(u.Yjd,{size:18,color:"#3853C4"})})})};t.Z=e=>{let{label:t,maxLabel:s,className:i,aspectRatio:n=.8,onUploadPhoto:a,isUploading:u,photoUrl:m,error:x,onSetError:p,disabled:v,buttonStyle:g,defaultIconSize:f,editIconOnly:h}=e,[b,j]=(0,o.useState)(""),onUploadPhotoButtonClicked=e=>{j(URL.createObjectURL(e)),a(e)},y=(0,o.useCallback)(e=>{let{onClick:i}=e;return(0,r.jsx)(UploadPhoto,{onClick:i,photoUrl:m,preview:b,maxLabel:s,disabled:v,aspectRatio:n,label:t,buttonStyle:g,defaultIconSize:f})},[b,m,v,g,f]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:l()(i,{"animate-pulse":u}),children:(0,r.jsxs)("div",{className:l()("md:mx-auto relative transition-transform",!h&&"hover:scale-105"),children:[m&&!h&&(0,r.jsx)(d.Z,{cropShape:"rect",aspectRatio:n,ButtonComponent:EditImageIcon,uploadPhoto:onUploadPhotoButtonClicked}),m&&h&&(0,r.jsx)(EditImageIcon,{}),(!m||m&&!h)&&(0,r.jsx)("div",{className:l()("rounded-lg shadow-xl overflow-hidden",{"border-1 border-red-700":!!x},1===n&&"rounded-2xl",1===n&&!x&&"border-white border-2",1===n&&!!x&&"border-red-700 border-2"),style:g||{aspectRatio:n.toString()},children:(0,r.jsx)(d.Z,{cropShape:"rect",aspectRatio:n,ButtonComponent:y,uploadPhoto:onUploadPhotoButtonClicked,onSetError:p})}),(0,r.jsx)(c.Z,{error:x})]})})})}},83738:function(e,t,s){"use strict";var i=s(85893);s(67294);var n=s(5434),r=s(73003);t.Z=e=>{let{id:t,message:s,position:a="right"}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z,{place:a,effect:"solid",id:t,message:s}),(0,i.jsx)("div",{className:"flex items-center","data-tip":!0,"data-for":t,children:(0,i.jsx)(n.eJU,{size:16,className:"ml-1 text-gray-600"})})]})}},67355:function(e,t,s){"use strict";s.d(t,{Z:function(){return wysiwyg_form_LocationPicker}});var i=s(85893),n=s(67294),r=s(6259),a=s.n(r),l=s(93967),o=s.n(l),d=s(40849),c=s(48837),u=s(37668),wysiwyg_form_LocationPicker=e=>{let{initialValue:t,className:s,placeholder:r,searchOptions:l,locationFieldName:m,coordinatesFieldName:x,showCurrentLocationButton:p,disabled:v}=e,[g,f]=(0,n.useState)(""),[h,b]=(0,n.useState)([]),[j,y]=(0,n.useState)(!1),{setFieldValue:N}=(0,u.u6)();(0,n.useEffect)(()=>{f(t[m])},[t[m]]);let handleChange=e=>{v||(f(e),N(m,e))},handleSelect=e=>{N(m,e),(0,c.NU)(e).then(e=>(0,c.WV)(e[0])).then(e=>{b([e.lng,e.lat]),x&&N(x,[e.lng,e.lat])})},handleClick=e=>{handleChange(e),handleSelect(e)},setCurrentLocation=async()=>{try{y(!0);let e=await new Promise((e,t)=>{navigator.geolocation.getCurrentPosition(s=>{let i=new window.google.maps.Geocoder;i.geocode({location:{lat:s.coords.latitude,lng:s.coords.longitude}},(i,n)=>{"OK"===n?(i.forEach(t=>{t.types.includes("administrative_area_level_2")&&e({location:t.formatted_address,latitude:s.coords.latitude,longitude:s.coords.longitude})}),t(Error("No results found."))):t(Error("Geocoder failed due to: ".concat(n)))})},e=>{t(e)})});f(e.location),b([e.longitude,e.latitude]),N(m,e.location),x&&N(x,[e.longitude,e.latitude]),y(!1)}catch(e){y(!1)}};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.ZP,{value:g,onChange:handleChange,onSelect:handleSelect,searchOptions:l,children:e=>{let{getInputProps:l,suggestions:c,getSuggestionItemProps:u,loading:x}=e;return(0,i.jsxs)("div",{className:a().AutoCompleteWrapper,children:[(0,i.jsx)("input",{"data-cy":"location-input",value:t[m],...l({placeholder:r||"Enter your Location",className:s})}),p&&(0,i.jsx)(i.Fragment,{children:x||j?(0,i.jsx)(d.Z,{size:"mini",active:!0,className:a().InputIcon}):(0,i.jsx)("img",{onClick:setCurrentLocation,src:"/img/icons/marker.svg",className:a().InputIcon})}),(0,i.jsx)("div",{className:o()(a().Suggestions,{[a().Active]:c&&!!c.length}),children:c.map(e=>{let t=o()(a().SuggestionItem,{[a().Active]:e.active});return(0,n.createElement)("div",{...u(e,{className:t,onClick:()=>{handleClick(e.description)}}),key:e.placeId},(0,i.jsx)("span",{children:e.description}))})})]})}}),(0,i.jsx)("input",{type:"hidden",value:g,name:m}),(0,i.jsx)("input",{type:"hidden",value:h.join(","),name:x})]})}},80708:function(e,t,s){"use strict";var i=s(85893);s(67294);var n=s(5434),r=s(41664),a=s.n(r),l=s(11163),o=s(9194);t.Z=e=>{let{users:t,onDelete:s,isEditable:r}=e,d=(0,l.useRouter)(),c=(0,o.XH)(d.query),onDeleteHandler=e=>()=>{s(e)};return(0,i.jsx)("ul",{className:"flex flex-col gap-4",children:t.map(e=>{let t=(null==e?void 0:e._id)||(null==e?void 0:e.id);return(0,i.jsxs)("li",{className:"flex align-center bg-primary-50 pl-2 py-2 rounded-lg",children:[(0,i.jsxs)(a(),{href:c?"":"/organizations/".concat(t),className:"flex align-center flex-1",children:[(0,i.jsx)("div",{className:"flex items-center w-14 h-14 roun
1ded-lg justify-center overflow-hidden",children:(0,i.jsx)("img",{src:(null==e?void 0:e.badgeImageUrl)||"/img/search/user.svg",alt:e.name})}),(0,i.jsxs)("div",{className:"flex flex-1 flex-col pl-3.5",children:[(0,i.jsx)("div",{className:"text-base pb-1",children:e.name}),(0,i.jsxs)("div",{className:"text-gray-400 flex align-center",children:[(0,i.jsx)(n.FpO,{className:"mr-1",size:16}),"Public Organization"]})]})]},e.id),r&&(0,i.jsx)("button",{className:"p-4",onClick:onDeleteHandler(e),type:"button",children:(0,i.jsx)("img",{src:"/img/icons/delete.svg",alt:"Delete"})})]},e.id)})})}},16851:function(e,t,s){"use strict";var i=s(85893),n=s(67294),r=s(67421),a=s(73996);t.Z=e=>{let{isEditable:t,onClick:s,data:{groups:l,cohosts:o,scanners:d,operators:c,photographers:u,host:m}}=e,{t:x}=(0,r.$G)(["events"]),p=1+l.length+d.length+c.length+o.length+u.length,v=(0,n.useMemo)(()=>l.slice(0,5),[l]),g=(0,n.useMemo)(()=>m?[...o.slice(0,4),m]:[],[o,m]);return(0,i.jsx)("div",{className:"mt-6",children:(0,i.jsx)(a.Z,{onClick:s,title:x("events:eventDetails.organizers"),squareBadges:v.length>0,secondaryDefaultText:1===p&&t?x("events:eventDetails.justYouSoFar"):x("events:eventDetails.total",{count:p}),data:v.length>0?v:g,additionalGuests:v.length>0?Math.max(l.length-5,0):Math.max(o.length-4,0)})})}},66254:function(e,t,s){"use strict";var i=s(85893);s(67294);var n=s(93967),r=s.n(n),a=s(37106),l=s(93463),o=s(37668);t.Z=e=>{let{id:t,name:s,label:n,disabled:d,placeholder:c,RightIcon:u,className:m,handleRightIconClick:x,error:p}=e,[v]=(0,o.U$)(s);return(0,i.jsxs)("div",{className:"w-full mb-6",children:[(0,i.jsxs)("div",{className:"flex justify-between",children:[n&&(0,i.jsx)("div",{className:"text-sm font-normal",children:n}),u&&(0,i.jsx)("div",{children:(0,i.jsx)("div",{className:"text-primary-400 cursor-pointer","data-tip":"Add Link",onClick:()=>{x()},children:(0,i.jsx)(u,{})})})]}),(0,i.jsx)("div",{className:"w-full relative",children:(0,i.jsx)(l.Z,{id:t,...v,disabled:d,className:r()(m||"mt-1 w-full border rounded-md px-4 py-3 appearance-none min-h-[78px] text-black",p?"border-red-800":"border-gray-200"),placeholder:c})}),p&&(0,i.jsxs)("div",{className:"mt-2 text-red-800 flex items-center gap-1 font-normal",children:[(0,i.jsx)(a.m2k,{size:16})," ",p]})]})}},98829:function(e,t,s){"use strict";var i=s(85893);s(67294);var n=s(27361),r=s.n(n),a=s(37668),l=s(85098),o=s(83738),d=s(93967),c=s.n(d);t.Z=e=>{let{name:t,label:s,toolTipMessage:n,labelClassName:d}=e,{values:u,setFieldValue:m}=(0,a.u6)();return(0,i.jsxs)("div",{className:"w-full text-sm font-normal text-gray-900 flex items-center justify-between",children:[(0,i.jsxs)("div",{className:c()("flex items-center",d),children:[s,n&&(0,i.jsx)(o.Z,{id:"toggle-".concat(t,"-tooltip"),message:n})]}),(0,i.jsx)(l.Z,{isActive:r()(u,t),onClick:()=>{m(t,!r()(u,t))}})]})}},73003:function(e,t,s){"use strict";var i=s(85893);s(67294);var n=s(24762);t.Z=e=>{let{id:t,place:s="top",effect:r="solid",message:a}=e;return(0,i.jsx)(n.Z,{place:s,effect:r,id:t,children:(0,i.jsx)("div",{className:"max-w-xs",children:(0,i.jsx)("p",{children:a})})})}},60939:function(e,t,s){"use strict";var i=s(85893);s(67294);var n=s(41664),r=s.n(n),a=s(11163),l=s(9194);t.Z=e=>{let{users:t,onDelete:s,isEditable:n}=e,o=(0,a.useRouter)(),d=(0,l.XH)(o.query),onDeleteHandler=e=>()=>{s(e)};return(0,i.jsx)("ul",{className:"flex flex-col gap-4",children:t.map(e=>{var t;return(0,i.jsxs)("li",{className:"flex align-center",children:[(0,i.jsxs)(r(),{href:d?"":"/profile/".concat(e._id),"data-testid":"organizer-link",className:"flex flex-1 align-center",children:[(0,i.jsx)("div",{className:"flex items-center w-10 h-10 rounded-full justify-center overflow-hidden border-2 border-primary-400",children:(0,i.jsx)("img",{src:(null==e?void 0:null===(t=e.photo)||void 0===t?void 0:t.url)||"/img/search/user.svg",alt:"".concat(e.firstName,"'s Profile Pic")})}),(0,i.jsx)("div",{className:"flex-1 pl-4",children:"".concat(e.firstName," ").concat(e.lastName)})]}),n&&(0,i.jsx)("button",{className:"p-4",onClick:onDeleteHandler(e),type:"button",children:(0,i.jsx)("img",{src:"/img/icons/delete.svg",alt:"Delete"})})]},e._id)})})}},72880:function(e,t,s){"use strict";s.d(t,{_:function(){return useImageUploadCommand}});var i=s(88767),n=s(890);async function uploadImage(e){let{blob:t}=e,s=new FormData;s.append("image",t);let{data:i}=await n.Z.post("/api/uploads/images",s,{headers:{"Content-Type":"multipart/form-data"}});return i}function useImageUploadCommand(){return(0,i.useMutation)(uploadImage)}},44319:function(e,t,s){"use strict";s.d(t,{Z:function(){return analytics_AnalyticsActions}});var i=s(85893),n=s(77773),r=s.n(n),a=s(93967),l=s.n(a),o=s(67294),d=s(67421),c=s(210),u=s(48905),m=s(74231),x=s(37668),p=s(5434),v=s(96671),g=s(28950);let f=m.Ry().shape({name:m.Z_().required("Required").max(50,"Name should not be more than 50 characters")});var tracking_link_TrackingLinkForm=e=>{let{eventId:t,isLoading:s=!1,errorMessage:n="",onClose:r,onSubmit:a}=e,{t:l}=(0,d.$G)("events");return(0,i.jsx)(x.J9,{initialValues:{name:""},onSubmit:e=>{a({eventId:t,name:e.name})},validationSchema:f,children:e=>{let{submitForm:t}=e;return(0,i.jsx)(v.Z,{visible:!0,autoHeight:!0,onClose:r,type:v.w.SMALL,shouldStopModalClose:s,title:l("settings.trackingLinks.form.title"),icon:(0,i.jsx)(p.fVQ,{size:20}),renderFooter:()=>(0,i.jsx)(u.ZP,{type:u.L$.Primary,onClick:t,loading:s,children:l("settings.trackingLinks.form.saveButton")}),children:(0,i.jsx)(x.l0,{children:(0,i.jsxs)("div",{className:"px-4 pt-4 flex flex-col justify-between",children:[(0,i.jsx)("p",{className:"mt-4 text-base font-normal",children:l("settings.trackingLinks.form.description")}),(0,i.jsx)("div",{className:"mt-4",children:(0,i.jsx)(g.Z,{id:"name",name:"name",label:l("settings.trackingLinks.form.nameLabel"),placeholder:l("settings.trackingLinks.form.namePlaceholder"),disabled:s})}),(0,i.jsx)("div",{className:"text-red-500 text-center pb-2",children:n})]})})})}})},h=s(93162),analytics_AnalyticsActions=e=>{var t;let{eventId:s}=e,{t:n}=(0,d.$G)("events"),a=(0,c.xY)(),{refetch:m,isLoading:x}=(0,c.gb)(s,{isEnabled:!1}),onDownloadExcelSheet=async()=>{let{data:e}=await m(),t=new Blob([e],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"});(0,h.saveAs)(t,"Bounce-Event-Analytics.xlsx")},[p,v]=(0,o.useState)(!1),closeTrackingLinkForm=()=>{v(!1),a.reset()};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:l()("w-full bg-white fixed bottom-0 left-0 p-4 z-10 pb-12",r().shadow),children:(0,i.jsx)("div",{className:"w-full md:w-[630px] mx-auto",children:(0,i.jsxs)("div",{className:"md:flex gap-4 w-full",children:[(0,i.jsx)("div",{className:"w-full",children:(0,i.jsx)(u.ZP,{onClick:onDownloadExcelSheet,loading:x,children:(0,i.jsx)("div",{className:"flex items-center justify-center",children:n("dashboard.analytics.downloadExcelSheet")})})}),(0,i.jsx)("div",{className:"mt-3 md:mt-0 w-full",children:(0,i.jsx)(u.ZP,{type:u.L$.Primary,onClick:()=>{v(!0)},children:(0,i.jsx)("div",{className:"flex items-center justify-center",children:n("dashboard.analytics.addTrackingLink")})})})]})})}),p&&(0,i.jsx)(tracking_link_TrackingLinkForm,{eventId:s,onSubmit:e=>{a.mutate(e,{onSuccess:closeTrackingLinkForm})},onClose:closeTrackingLinkForm,isLoading:a.isLoading,errorMessage:null===(t=a.error)||void 0===t?void 0:t.message})]})}},69120:function(e,t,s){"use strict";s.d(t,{Z:function(){return analytics_OverallNumbers}});var i=s(85893);s(67294);
1var n=s(67421),r=s(93967),a=s.n(r),l=s(89583),o=s(47516),d=s(5434),analytics_AnalyticsSkeleton=()=>(0,i.jsxs)("div",{className:"rounded-2xl bg-primary-200 p-5 animate-pulse",children:[(0,i.jsx)("div",{className:"flex justify-between",children:(0,i.jsx)("div",{className:"text-2xl font-semibold h-4 w-40 bg-gray-300 rounded-full"})}),(0,i.jsxs)("div",{className:"mt-4 bg-white p-5 rounded-2xl",children:[(0,i.jsx)("div",{className:"text-base flex items-center font-normal h-3 w-32 bg-gray-300 rounded-full"}),(0,i.jsx)("div",{className:"mt-6 text-3xl font-semibold h-3 w-10 bg-gray-300 rounded-full"})]}),(0,i.jsxs)("div",{className:"mt-4 flex",children:[(0,i.jsxs)("div",{className:"w-full bg-white p-5 rounded-2xl mr-2",children:[(0,i.jsx)("div",{className:"text-base flex items-center font-normal h-3 w-32 bg-gray-300 rounded-full"}),(0,i.jsx)("div",{className:"mt-6 text-3xl font-semibold h-3 w-10 bg-gray-300 rounded-full"})]}),(0,i.jsxs)("div",{className:"w-full bg-white p-5 rounded-2xl ml-2",children:[(0,i.jsx)("div",{className:"text-base flex items-center font-normal h-3 w-32 bg-gray-300 rounded-full"}),(0,i.jsx)("div",{className:"mt-6 text-3xl font-semibold h-3 w-10 bg-gray-300 rounded-full"})]})]})]}),c=s(75810),analytics_OverallNumbers=e=>{let{views:t,sales:s,revenue:r,isLoading:u,error:m,onBack:x}=e,{t:p}=(0,n.$G)(["events"]);return u?(0,i.jsx)("div",{className:"relative w-full bg-primary-200",children:(0,i.jsx)("div",{className:"w-full md:w-[630px] mx-auto",children:(0,i.jsx)(analytics_AnalyticsSkeleton,{})})}):(0,i.jsxs)("div",{className:"relative w-full bg-primary-200",children:[x&&(0,i.jsx)("div",{className:"pl-2 pt-2 md:absolute md:p-0 left-2 top-2 md:left-40 md:top-10 cursor-pointer",onClick:()=>x(),children:(0,i.jsx)(o.u_m,{className:"text-primary-500 text-4xl"})}),(0,i.jsx)("div",{className:a()("w-full md:w-[630px] mx-auto",{"blur-sm":!!(null==m?void 0:m.message)}),children:(0,i.jsxs)("div",{className:"rounded-2xl bg-primary-200 p-5",children:[(0,i.jsx)("div",{className:"flex justify-between",children:(0,i.jsx)("div",{className:"text-2xl font-semibold flex items-center",children:p("events:settings.trackingLinks.page.overallNumbers")})}),(0,i.jsxs)("div",{className:"mt-6 bg-white p-5 rounded-2xl",children:[(0,i.jsxs)("div",{className:"text-sm text-gray-500 flex items-center font-normal",children:[(0,i.jsx)(d.FpO,{className:"mr-1 text-xl font-normal"}),p("events:settings.trackingLinks.page.totalViews")]}),(0,i.jsx)("div",{className:"mt-2 text-3xl font-semibold",children:t||0})]}),(0,i.jsxs)("div",{className:"mt-6 flex",children:[(0,i.jsxs)("div",{className:"w-full bg-white p-5 rounded-2xl mr-2",children:[(0,i.jsxs)("div",{className:"text-sm text-gray-500 flex items-center font-normal",children:[(0,i.jsx)(d.Zp5,{size:14,className:"mr-1"}),p("events:settings.trackingLinks.page.totalSales")]}),(0,i.jsx)("div",{className:"mt-2 text-3xl font-semibold",children:s})]}),(0,i.jsxs)("div",{className:"w-full bg-white p-5 rounded-2xl ml-2",children:[(0,i.jsxs)("div",{className:"text-sm text-gray-500 flex items-center font-normal",children:[(0,i.jsx)(d.Mu3,{size:14,className:"mr-1"}),p("events:settings.trackingLinks.page.totalRevenue")]}),(0,i.jsx)("div",{className:"mt-2 text-3xl font-semibold",children:(0,c.O)(r)})]})]}),(0,i.jsx)("p",{className:"text-xs my-5 text-gray-400 font-normal",children:p("events:settings.trackingLinks.page.dataNote")})]})}),(null==m?void 0:m.message)&&(0,i.jsx)("div",{className:"absolute left-0 right-0 top-0 bottom-0 flex flex-col items-center justify-center pointer-events-none",children:(0,i.jsxs)("div",{className:"p-4 bg-gray-100 rounded-2xl text-center shadow-md border-1 border-gray-400",children:[(0,i.jsxs)("p",{className:"text-xl flex justify-center items-center",children:[(0,i.jsx)(l.DAO,{className:"mr-2",size:"12"}),m.message]}),(0,i.jsx)("p",{className:"mt-4 text-lg font-semibold",children:p("events:settings.trackingLinks.page.errorTryAgain")})]})})]})}},9422:function(e,t,s){"use strict";s.d(t,{Z:function(){return analytics_TrackingLinks}});var i=s(85893);s(67294);var n=s(67421),r=s(37106),a=s(8193),l=s(5434),o=s(78716),tracking_link_TrackingLink=e=>{let{trackingLink:t}=e,s="".concat(window.location.origin).concat(t.pathname);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)(l.nlo,{className:"mr-2",size:24}),(0,i.jsx)("h2",{className:"text-base font-semibold",children:t.name})]}),(0,i.jsxs)("div",{className:"flex mt-3 items-center",children:[(0,i.jsx)("div",{className:"w-full border-1 border-gray-200 rounded-2xl px-4 py-2",children:(0,i.jsx)("input",{className:"w-full text-gray-400 truncate",value:s})}),(0,i.jsx)("div",{className:"w-[100px] ml-4",children:(0,i.jsx)(o.Z,{message:"Copy",copyText:s})})]})]})},d=s(75810),analytics_TrackingLinks=e=>{let{trackingLinks:t}=e,{t:s}=(0,n.$G)(["events"]);return(0,i.jsxs)("div",{className:"w-full md:w-[496px] mx-auto mt-4 p-4 pb-10",children:[(null==t?void 0:t.length)===0?(0,i.jsxs)("div",{className:"py-10 mx-auto text-center",children:[(0,i.jsx)("img",{src:"/img/events/create/tracking-links.png",className:"mx-auto"}),(0,i.jsx)("div",{className:"text-sn font-normal text-gray-500",children:s("events:settings.trackingLinks.page.emptyState")})]}):(0,i.jsx)("h2",{className:"text-base font-semibold",children:s("events:settings.trackingLinks.page.title")}),null==t?void 0:t.map(e=>(0,i.jsxs)("div",{className:"mt-6 bg-white shadow-xl rounded-2xl border-gray-100 border-1",children:[(0,i.jsx)("div",{className:"px-4 py-8",children:(0,i.jsx)(tracking_link_TrackingLink,{trackingLink:e})}),(0,i.jsxs)("div",{className:"flex bg-primary-200 justify-between p-6",children:[(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"text-base flex items-center font-normal",children:[(0,i.jsx)(a.nf1,{className:"mr-1 text-lg font-normal"}),s("events:settings.trackingLinks.page.uniqueViewers")]}),(0,i.jsx)("div",{className:"mt-2 text-3xl font-semibold",children:e.views||0})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"text-base flex items-center font-normal",children:[(0,i.jsx)(r.uy7,{className:"mr-1 text-lg"}),s("events:settings.trackingLinks.page.sales")]}),(0,i.jsx)("div",{className:"mt-2 text-3xl font-semibold",children:e.sales||0})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"text-base flex items-center font-normal",children:[(0,i.jsx)("img",{src:"/img/events/cash.svg",className:"mr-1"}),s("events:settings.trackingLinks.page.revenue")]}),(0,i.jsx)("div",{className:"mt-2 text-3xl font-semibold",children:(0,d.O)(e.revenue)})]})]})]},e.id))]})}},28973:function(e,t,s){"use strict";s.d(t,{G:function(){return n}});var i,n,r=s(85893),a=s(85098),l=s(83738),o=s(73003);s(67294);var d=s(93967),c=s.n(d);(i=n||(n={})).Button="button",i.Toggle="toggle",t.Z=e=>{let{icon:t,title:s,type:i="button",isActive:n,value:d,actionLabel:u,disabled:m,tooltipMessage:x,disabledTooltipMessage:p,onClick:v}=e;return(0,r.jsxs)("div",{className:c()("flex items-center justify-between px-4 py-5 border-1 border-gray-300 text-black rounded-lg mt-4",m?"bg-neutral-100 cursor-default":"cursor-pointer"),onClick:()=>{m||null==v||v()},children:[(0,r.jsxs)("div",{className:"flex items-center",children:[t,(0,r.jsx)("span",{className:"ml-2 text-base",children:s}),x&&(0,r.jsx)(l.Z,{id:"".concat(s,"-tooltip"),message:x})]}),"toggle"===i&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{"data-tip":!0,"data-for":"".concat(s,"-disabled-tooltip"),children:(0,r.jsx)(a.Z,{isActive:n,disabled:m})}),p&&m&&(0,r.jsx)(o.Z,{place:"right",effect:"solid",id:"".concat(s,"-disabled-tooltip"),message:p})]}),"button"===i&&(0,r.jsx)("button",{type:"button",className:"max-w-[150px] md:max-w-sm text-sm text-primary-400 font-semibold text-right whitespace-nowrap text-ellipsis overflow-hidden",disabled:m,children:d?(0,r.jsx)("span",{className:"font-normal text-gray-500",children:d}):(0,r.jsx)("span",{children:"".concat(u?"+ ".concat(u):"")})})]})}},94580:function(e,t,s){"use strict";s.d(t,{Z:function(){return discount_codes_DiscountCodeForm}});var i=s(85893),n=s(67294),r=s(74231),a=s(5434),l=s(37668),o=s(67421),d=s(10646),c=s(70784),u=s(80967),discount_codes_DiscountCodeKindButton=e=>{let{form:t}=e;return(0,i.jsxs)(u.Z.Group,{style:{display:"flex",alignItems:"center"},children:[(0,i.jsx)(u.Z,{type:"button",style:{height:"40px",borderRadius:"16px 0 0 16px",cursor:"pointer",fontSize:"1rem",color:"percentage"!==t.values.kind&&t.values.kind?"rgba(0,0,0,0.8)":"#fff",backgroundColor:"percentage"!==t.values.kind&&t.values.kind?"rgba(0,0,0,0.1)":"#6586ff"},onClick:e=>{e.preventDefault(),t.setFieldValue("kind","percentage")},positive:"percentage"===t.values.kind||!t.values.kind,children:"%"}),(0,i.jsx)(u.Z,{style:{height:"40px",borderRadius:"0 16px 16px 0",cursor:"pointer",fontSize:"1rem",color:"amount"===t.values.kind?"#fff":"rgba(0,0,0,0.8)",backgroundColor:"amount"===t.values.kind?"#6586ff":"rgba(0,0,0,0.1)"},type:"button",onClick:e=>{e.preventDefault(),t.setFieldValue("kind","amount")},positive:"amount"===t.values.kind,children:"$"})]})},m=s(210),x=s(75810),discount_codes_TierSelectionField=e=>{let{eventId:t,selectedTierIds:s,onChange:r,disabled:l=!1}=e,{t:d}=(0,o.$G)("events"),{data:c,isLoading:u}
1=(0,m.LA)(t),[p,v]=(0,n.useState)(!1),[g,f]=(0,n.useState)(""),h=(0,n.useMemo)(()=>{var e;let t=(null==c?void 0:null===(e=c.items)||void 0===e?void 0:e.filter(e=>"admission"===e.type&&!1!==e.isVisible))||[];return g.trim()&&(t=t.filter(e=>{var t;return e.name.toLowerCase().includes(g.toLowerCase())||(null===(t=e.description)||void 0===t?void 0:t.toLowerCase().includes(g.toLowerCase()))})),t.sort((e,t)=>{let i=s.includes(e.id),n=s.includes(t.id);return i!==n?n?1:-1:e.name.localeCompare(t.name)})},[null==c?void 0:c.items,g,s]),handleTierToggle=e=>{if(l)return;let t=s.includes(e);r(t?s.filter(t=>t!==e):[...s,e])},b=s.length===h.length&&h.length>0,j=s.length>0&&s.length<h.length;return u?(0,i.jsxs)("div",{className:"mt-6 space-y-2",children:[(0,i.jsx)("div",{className:"block text-sm font-medium text-gray-700",children:d("settings.discountCodes.page.tierSelectionLabel")}),(0,i.jsx)("div",{className:"text-sm text-gray-500",children:d("settings.discountCodes.page.loadingTiers")})]}):h.length||g?(0,i.jsxs)("div",{className:"mt-6 space-y-2",children:[(0,i.jsx)("div",{className:"block text-sm font-medium text-gray-700",children:d("settings.discountCodes.page.tierSelectionLabel")}),(0,i.jsxs)("div",{className:"border rounded-lg bg-white",children:[(0,i.jsxs)("div",{className:"p-3 cursor-pointer border-b flex items-center justify-between hover:bg-gray-50",onClick:()=>v(!p),children:[(0,i.jsx)("div",{className:"flex items-center space-x-2",children:(0,i.jsx)("span",{className:"text-sm font-medium",children:0===s.length||s.length===h.length?d("settings.discountCodes.page.allTiers"):d("settings.discountCodes.page.selectedTiers",{count:s.length,total:h.length})})}),p?(0,i.jsx)(a.Faw,{size:20}):(0,i.jsx)(a.Yc6,{size:20})]}),p&&(0,i.jsxs)("div",{className:"p-3 space-y-2",children:[(0,i.jsx)("div",{className:"text-xs text-gray-500 mb-3",children:d("settings.discountCodes.page.tierSelectionHelper")}),(null==c?void 0:c.items)&&c.items.length>5&&(0,i.jsxs)("div",{className:"relative mb-3",children:[(0,i.jsx)(a.vU7,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",size:16}),(0,i.jsx)("input",{type:"text",placeholder:d("settings.discountCodes.page.searchTiers"),className:"w-full pl-10 pr-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",value:g,onChange:e=>f(e.target.value),disabled:l}),g&&(0,i.jsx)("button",{type:"button",className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",onClick:()=>f(""),children:"\xd7"})]}),(0,i.jsxs)("div",{className:"max-h-60 overflow-y-auto space-y-2",children:[(0,i.jsxs)("div",{className:"flex items-center space-x-2 p-2 rounded cursor-pointer hover:bg-gray-50 ".concat(l?"opacity-50 cursor-not-allowed":""),onClick:()=>{l||(s.length===h.length?r([]):r(h.map(e=>e.id)))},children:[b?(0,i.jsx)(a.y5A,{size:20,className:"text-blue-600"}):j?(0,i.jsx)(a.y5A,{size:20,className:"text-blue-400"}):(0,i.jsx)(a.hrt,{size:20,className:"text-gray-400"}),(0,i.jsx)("span",{className:"text-sm font-medium",children:d("settings.discountCodes.page.selectAllTiers")})]}),(0,i.jsx)("hr",{}),0===h.length&&g?(0,i.jsx)("div",{className:"text-center text-sm text-gray-500 py-4",children:d("settings.discountCodes.page.noTiersFound")}):h.map(e=>{let t=s.includes(e.id);return(0,i.jsxs)("div",{className:"flex items-center space-x-2 p-2 rounded cursor-pointer hover:bg-gray-50 ".concat(l?"opacity-50 cursor-not-allowed":""),onClick:()=>handleTierToggle(e.id),children:[t?(0,i.jsx)(a.y5A,{size:20,className:"text-blue-600"}):(0,i.jsx)(a.hrt,{size:20,className:"text-gray-400"}),(0,i.jsxs)("div",{className:"flex-1",children:[(0,i.jsx)("div",{className:"text-sm font-medium",children:e.name}),e.description&&(0,i.jsx)("div",{className:"text-xs text-gray-500",children:e.description})]}),(0,i.jsx)("div",{className:"text-xs text-gray-500",children:(0,x.O)(e.price)})]},e.id)})]})]})]}),0===s.length&&(0,i.jsx)("div",{className:"text-xs text-gray-500",children:d("settings.discountCodes.page.noTierRestriction")})]}):(0,i.jsxs)("div",{className:"mt-6 space-y-2",children:[(0,i.jsx)("div",{className:"block text-sm font-medium text-gray-700",children:d("settings.discountCodes.page.tierSelectionLabel")}),(0,i.jsx)("div",{className:"text-sm text-gray-500",children:d("settings.discountCodes.page.noTiersAvailable")})]})},p=s(96671),v=s(48905),g=s(19771),f=s(27484),h=s.n(f),b=s(28950),j=s(63141);let y="h:mm A";var discount_codes_DiscountCodeForm=e=>{let{eventId:t,errorMessage:s="",initialValues:u,title:x,onClose:f,onSubmit:N,onDelete:w}=e,{t:C}=(0,o.$G)("events"),k=(0,d.Vb)(),{data:S,isLoading:T}=(0,m.Q3)(t),_=(0,n.useMemo)(()=>r.Ry().shape({code:r.Z_().matches(j.y,C("settings.discountCodes.page.validation.invalidCode")).required(C("settings.discountCodes.page.validation.codeRequired")).max(20,C("settings.discountCodes.page.validation.codeMaxLength")),amount:r.Rx().required(C("settings.discountCodes.page.validation.discountRequired")).min(0,C("settings.discountCodes.page.validation.discountMinValue"))}),[C]),I=(0,n.useMemo)(()=>
1{if(T||!S)return null;let e=new Date(S.startDate);return e.setDate(e.getDate()+1),S.endDate?S.endDate:e.toISOString()},[S,T]);return(0,i.jsx)(l.J9,{initialValues:{code:(null==u?void 0:u.code)||"",amount:(null==u?void 0:u.discount.value)||void 0,kind:(null==u?void 0:u.discount.kind)||void 0,startDate:(null==u?void 0:u.startDate)||void 0,endDate:(null==u?void 0:u.endDate)||void 0,startDateTime:(null==u?void 0:u.startDate)?h()(null==u?void 0:u.startDate).format(y):void 0,endDateTime:(null==u?void 0:u.endDate)?h()(null==u?void 0:u.endDate).format(y):void 0,maxUsage:(null==u?void 0:u.maxUsage)||void 0,tierIds:k[c.h.ENABLE_TIERS_DISCOUNT_CODES]&&(null==u?void 0:u.tierIds)||[],isActive:"boolean"!=typeof(null==u?void 0:u.isActive)||u.isActive},onSubmit:e=>{N({id:(null==u?void 0:u.id)||void 0,eventId:t,code:e.code.toUpperCase(),discount:{value:e.amount,kind:"string"==typeof e.kind?e.kind:"percentage"},startDate:e.startDate,endDate:e.endDate,maxUsage:e.maxUsage,tierIds:k[c.h.ENABLE_TIERS_DISCOUNT_CODES]&&e.tierIds.length>0?e.tierIds:void 0,isActive:e.isActive})},validationSchema:_,children:e=>{let{values:n,submitForm:r,setFieldValue:o}=e;return(0,i.jsx)(p.Z,{type:p.w.SMALL,visible:!0,onClose:f,shouldStopModalClose:T,title:x||C("settings.discountCodes.page.formTitle"),icon:(0,i.jsx)(a.BVL,{size:22}),renderFooter:()=>(0,i.jsxs)("div",{className:"w-full",children:[(0,i.jsx)("div",{className:"text-red-500",children:s}),(0,i.jsx)(v.ZP,{loading:T,onClick:r,children:C("settings.discountCodes.page.saveButton")}),"function"==typeof w&&(0,i.jsx)("div",{className:"mt-4",children:(0,i.jsx)(v.ZP,{type:v.L$.Danger,loading:T,onClick:()=>{w(null==u?void 0:u.id)},children:C("settings.discountCodes.page.deleteDiscountCode")})})]}),children:(0,i.jsx)(l.l0,{children:(0,i.jsxs)("div",{className:"p-4 pb-52 mt-4 flex flex-col justify-between",children:[(0,i.jsx)("p",{className:"mt-2 mb-6 text-sm font-normal",children:C("settings.discountCodes.page.formDescription")}),(0,i.jsx)(b.Z,{id:"code",name:"code",type:"text",label:C("settings.discountCodes.page.codeLabel"),placeholder:C("settings.discountCodes.page.codePlaceholder"),helper:C("settings.discountCodes.page.codeHelper")}),(0,i.jsxs)("div",{className:"flex items-center justify-center gap-4",children:[(0,i.jsx)(b.Z,{id:"kind",name:"kind",label:C("settings.discountCodes.page.discountTypeLabel"),render:discount_codes_DiscountCodeKindButton}),(0,i.jsx)(b.Z,{id:"amount",name:"amount",type:"number",label:C("settings.discountCodes.page.discountAmountLabel"),placeholder:"amount"===n.kind?C("settings.discountCodes.page.amountPlaceholder"):C("settings.discountCodes.page.percentagePlaceholder"),disabled:T})]}),(0,i.jsx)(b.Z,{id:"maxUsage",name:"maxUsage",type:"number",label:C("settings.discountCodes.page.usageLimitLabel"),placeholder:C("settings.discountCodes.page.usageLimitPlaceholder"),disabled:T}),(0,i.jsx)(g.Z,{minStartDate:new Date().toISOString(),maxEndDate:I}),k[c.h.ENABLE_TIERS_DISCOUNT_CODES]&&(0,i.jsx)(discount_codes_TierSelectionField,{eventId:t,selectedTierIds:n.tierIds,onChange:e=>o("tierIds",e),disabled:T})]})})})}})}},20057:function(e,t,s){"use strict";var i=s(85893);s(67294);var n=s(67421),r=s(48905);t.Z=e=>{let{handleAddDiscountCode:t}=e,{t:s}=(0,n.$G)("events");return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"w-full bg-white fixed bottom-0 left-0 p-4 z-10 border-t pb-12 md:pb-4",children:(0,i.jsx)("div",{className:"w-full md:w-[343px] mx-auto",children:(0,i.jsx)("div",{className:"flex gap-4",children:(0,i.jsx)(r.ZP,{type:r.L$.Primary,onClick:t,children:(0,i.jsx)("div",{className:"flex items-center justify-center",children:s("settings.discountCodes.page.addDiscountCode")})})})})})})}},57921:function(e,t,s){"use strict";var i=s(85893),n=s(97342);s(67294),t.Z=()=>(0,i.jsxs)(n.Z,{children:[(0,i.jsx)("div",{className:"fixed top-0 md:top-[50px] left-0 w-full px-4 py-2 md:py-6 bg-white shadow-sm z-50 h-[40px] md:h-[65px]"}),(0,i.jsxs)("div",{className:"animate-pulse pt-[90px] md:pt-[180px] -mt-[90px] pb-20 md:w-[630px] md:mx-auto",children:[(0,i.jsx)("div",{className:"md:w-[276px] md:mx-auto",children:(0,i.jsx)("div",{className:"aspect-ratio-4-5 rounded-lg shadow-xl overflow-hidden bg-gray-200"})}
1),(0,i.jsx)("div",{className:"mt-16 w-[60%] text-2xl flex items-center col-span-3 h-[30px] bg-gray-200"}),(0,i.jsx)("div",{className:"mt-3 w-[30%] text-2xl flex items-center col-span-3 h-[15px] bg-gray-200"}),(0,i.jsx)("div",{className:"mt-3 w-[60%] text-2xl flex items-center col-span-3 h-[20px] bg-gray-200"}),(0,i.jsx)("div",{className:"mt-4 w-[30%] text-2xl flex items-center col-span-3 h-[20px] bg-gray-200"}),(0,i.jsx)("div",{className:"mt-6 text-2xl flex items-center col-span-3 h-px bg-gray-200"}),(0,i.jsx)("div",{className:"mt-6 text-2xl flex items-center col-span-3 h-[40px] bg-gray-200 rounded-xl"}),(0,i.jsx)("div",{className:"mt-6 text-2xl flex items-center col-span-3 h-[130px] bg-gray-200 rounded-xl"}),(0,i.jsx)("div",{className:"mt-6 text-2xl flex items-center col-span-3 h-px bg-gray-200"}),(0,i.jsx)("div",{className:"mt-6 text-2xl flex items-center col-span-3 h-[60px] bg-gray-200 rounded-xl"}),(0,i.jsx)("div",{className:"mt-6 text-2xl flex items-center col-span-3 h-[60px] bg-gray-200 rounded-xl"})]})]})},92872:function(e,t,s){"use strict";var i=s(85893);s(67294);var n=s(210),r=s(67421);t.Z=e=>{let{eventId:t,seriesId:s}=e,{t:a}=(0,r.$G)(["events"]),{data:l}=(0,n.OQ)({eventId:t},{enabled:!!t&&!!s});return s&&(null==l?void 0:l.eventIds)&&(0,i.jsxs)("div",{className:"rounded-full bg-primary-100 p-2 flex items-center justify-center gap-1 text-primary-700",children:[(0,i.jsx)("img",{src:"/img/icons/sync-blue.svg",className:"w-[24px]"}),(0,i.jsx)("p",{className:"text-base font-normal",children:a("events:eventDetails.recurringEventBadge",{index:l.eventIds.indexOf(t)+1,total:l.eventIds.length})})]})}},16960:function(e,t,s){"use strict";s.d(t,{Kb:function(){return shouldEnableOrganizationFee},RS:function(){return getEventPricing},b6:function(){return applyDiscount}});var i=s(75810);function applyDiscount(e,t){if(!t||!t.discount)return e;switch(t.discount.kind){case"percentage":return e*(100-t.discount.value)/100;case"amount":return Math.max(e-t.discount.value,0);default:return e}}function getEventPricing(e,t){var s,n;let r=null==e?void 0:null===(n=e.pricing)||void 0===n?void 0:null===(s=n.tiers)||void 0===s?void 0:s.filter(e=>!e.private);if(!(null==r?void 0:r.length))return"Pricing varies";let a=[...r].sort((e,t)=>e.price-t.price),l=a[0].price||0,o=a[a.length-1].price;if(l===o&&0===l)return"Free";let d=applyDiscount(l,t),c=applyDiscount(o,t);return d===c?(0,i.O)(d):"".concat((0,i.O)(d)," - ").concat((0,i.O)(c))}let shouldEnableOrganizationFee=e=>{for(let s=0;s<(null==e?void 0:e.length);s++){var t;if(null===(t=e[s])||void 0===t?void 0:t.canEnableEventOrganizerFee)return!0}return!1}},46191:function(e,t,s){"use strict";s.d(t,{_:function(){return useGetEventAnalyticsTicketScanByTier}});var i=s(88767),n=s(9840);function useGetEventAnalyticsTicketScanByTier(e){let{eventId:t}=e;return(0,i.useQuery)(["data/ticketScansByTier",{eventId:t}],()=>(0,n.PY)({eventId:t}),{retry:0,enabled:!!t})}},35361:function(e,t,s){"use strict";s.d(t,{Z:function(){return CreateEvent_screen}});var i,n,r,a,l,o,d,c,u,m,x,p,v,g,f,h,b=s(85893),j=s(74231),y=s(37668),N=s(11163),w=s(67294),C=s(67421),k=s(30381),S=s.n(k),T=s(52396),_=s(78718),I=s.n(_),P=s(19302),F=s(17371),D=s(210),O=s(99837),E=s(9194),A=s(92476),R=s(16498),hooks_useEventCreation=e=>{var t,s,i,n;let{t:r}=(0,C.$G)("events"),{orgId:a,startDate:l}=null!=e?e:{},{data:o}=(0,F.po)(),d=(0,N.useRouter)(),c=(0,D.Q3)(null==e?void 0:e.eventId),{data:u}=(0,R.Ng)({groupId:a}),m=(0,D._x)(),x=(0,D.fi)(),p=(0,D.Tf)(),v=(0,D.L)(),[g,f]=(0,w.useState)(!0),[h,b]=(0,w.useState)(!1),[j,y]=(0,w.useState)(null),[k,_]=(0,w.useState)(null);(0,w.useEffect)(()=>{let e=null==c?void 0:c.data;(null==e?void 0:e.isDraft)&&(null==e?void 0:e.shouldRequestToPublish)&&(b(!0),c.data.requestToPublishFormId&&y(c.data.requestToPublishFormId),c.data.requestToPublishWorkflowId&&_(c.data.requestToPublishWorkflowId))},[c,h]);let getInitialData=()=>{let e=S()().clone().add(1,"hours").startOf("hour"),t=l||e.toISOString();return{title:"",startDate:t,address:"",description:"",private:!1,showGuests:!0,ticketNotesRequest:null,googleForms:null,maxTicketsPerTransaction:5,maxCapacity:void 0,metaPixelId:void 0,_id:void 0,isDraft:void 0,seriesId:void 0,groups:u&&a?[u]:void 0,pricing:{currency:O.OI[null==o?void 0:o.country],tiers:[{name:r("pricingTiers.defaultTicketName"),price:0}],transactionFeesPaidBy:"guest"}}},createDraft=async e=>{try{var t;f(!1);let s={...getInitialData(),...e},i={...s,groups:(null===(t=s.groups)||void 0===t?void 0:t.map(e=>e.id||e))||[]},n=await m.mutateAsync({event:i});return d.replace("/events/create?eventId=".concat(n._id)),n}catch(e){return(0,T.x2)({title:"Error saving event",message:null==e?void 0:e.message}),(0,E.XH)(d.query)&&(0,E.mG)(A.iA),null}},formatUpdateForAPI=e=>{var t,s,i,n,r,a;let l=I()(e,["title","description","startDate","endDate","address","coordinates","private","cohosts","operators","scanners","photographers","groups","showGuests","ticketNotesRequest","googleForms","video","maxTicketsPerTransaction","maxCapacity","metaPixelId","waiver","chargeOrganizationFee","momentsPermissions","photo","pricing","isDraft","guestQuestions"]),o=I()(l.pricing,["currency","tax","tips","transactionFeesPaidBy",e._id?void 0:"tiers"]);return{...l,pricing:o,cohosts:(null===(t=l.cohosts)||void 0===t?void 0:t.map(e=>e._id))||[],groups:(null===(s=l.groups)||void 0===s?void 0:s.map(e=>e.id))||[],operators:(null===(i=l.operators)||void 0===i?void 0:i.map(e=>e._id))||[],scanners:(null===(n=l.scanners)||void 0===n?void 0:n.map(e=>e._id))||[],photographers:(null===(r=l.photographers)||void 0===r?void 0:r.map(e=>e._id))||[],guestQuestions:(null===(a=l.guestQuestions)||void 0===a?void 0:a.map(e=>{let{question:t}=e;return{question:t}}))||[]}},update=async t=>{if(null==e?void 0:e.eventId){let s=formatUpdateForAPI(t);try{let t=await x.mutateAsync({eventId:null==e?void 0:e.eventId,event:s});t.isDraft&&t.shouldRequestToPublish&&(b(!0),t.requestToPublishFormId&&y(t.requestToPublishFormId),t.requestToPublishWorkflowId&&_(t.requestToPublishWorkflowId))}catch(e){(0,T.x2)({title:"Error saving event",message:null==e?void 0:e.message})}}else createDraft(formatUpdateForAPI(t))},requestPublication=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{await p.mutateAsync({eventId:e.eventId,eventSeriesId:c.data.seriesId,...t})}catch(e){(0,T.x2)({title:"Cannot request to publish event",message:null==e?void 0:e.message})}},requestPublicationWorkflow=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{await v.mutateAsync({eventId:e.eventId,eventSeriesId:c.data.seriesId,responseData:t})}catch(e){(0,T.x2)({title:"Cannot request to publish event",message:null==e?void 0:e.message})}},publish=async t=>{try{await x.mutateAsync({eventId:e.eventId,event:{...formatUpdateForAPI(t),isDraft:!1}}),(0,E.XH)(d.query)&&(0,E.mG)(A.zs,{_id:e.eventId})}catch(e){(0,T.x2)({title:"Cannot publish event",message:null==e?void 0:e.message})}},M=(0,P.Z)(update,500);return{eventId:e.eventId,event:null==c?void 0:c.data,associationId:null==c?void 0:null===(t=c.data)||void 0===t?void 0:t.associationId,lastUpdated:(null===(s=x.data)||void 0===s?void 0:s.updatedAt)||(null===(i=m.data)||void 0===i?void 0:i.createdAt)||(null==c?void 0:null===(n=c.data)||void 0===n?void 0:n.updatedAt),isLoading:m.isLoading||x.isLoading,isLoadingEvent:null==c?void 0:c.isLoading,shouldShowEventLoading:g,shouldRequestToPublish:h,requestToPublishFormId:j,requestToPublishWorkflowId:k,initialValues:(null==c?void 0:c.data)||getInitialData(),createDraft,update:M,publish,requestPublication,requestPublicationWorkflow,refetchEvent:null==c?void 0:c.refetch}},M=s(27361),L=s.n(M),Z=s(10646),q=s(70784),B=s(85098),U=s(83738),create_event_Guests=()=>{let{values:e,setFieldValue:t}=(0,y.u6)(),{t:s}=(0,C.$G)(["events","common"]);return(0,b.jsxs)("div",{className:"mt-6 p-4 border-1 rounded-md",children:[(0,b.jsxs)("div",{className:"flex flex-col justify-center",children:[(0,b.jsx)("div",{className:"text-lg font-semibold",children:s("events:eventDetails.guestList")}),(e.isDraft||void 0===e.isDraft||null===e.isDraft)&&(0,b.jsx)("div",{className:"text-sm text-gray-400 font-normal",children:s("events:host.inviteGuests")})]}),(0,b.jsxs)("div",{className:"w-full mt-4 mr-10 text-base text-gray-500 flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"text-base font-normal flex items-center",children:[s("common:buttons.hide"),(0,b.jsx)(U.Z,{id:"hide-tooltip",message:s("events:host.hideTooltip")})]}),(0,b.jsx)(B.Z,{isActive:!e.showGuests,onClick:()=>{t("showGuests",!e.showGuests)}})]})]})},z=s(5434),G=s(96671),V=s(48905),settings_OrganizersSelectList=e=>{let{field:t,label:s,SearchComponent:i,ListComponent:n,placeholder:r,...a}=e,{values:l,setFieldValue:o}=(0,y.u6)(),d=l[t];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(i,{...a,label:s,field:t,selectedUsers:d,onChange:e=>{o(t,[...d,e])},placeholder:r}),d.length>0&&(0,b.jsx)("div",{className:"pt-4",children:(0,b.jsx)(n,{users:d,onDelete:e=>{o(t,d.filter(t=>t._id&&e._id&&t._id!==e._id||t.id&&e.id&&t.id!==e.id))},isEditable:!0})})]})},$=s(89298),H=s(765),W=s(45230),Q=s(39978),wysiwyg_form_SearchDropdown=e=>{let{label:t,id:s,data:i,selectedUsers:n,optionDataFormatter:r,...a}=e,l=(0,w.useMemo)(()=>(null==i?void 0:i.reduce((e,t)=>
1{let s=n.some(e=>e.id&&t.id&&e.id===t.id||e._id&&t._id&&e._id===t._id);return s||e.push(r(t)),e},[]))||[],[i,n]);return(0,b.jsxs)("div",{className:"flex flex-col pt-7",children:[(0,b.jsx)("label",{htmlFor:s,className:"pb-1",children:t}),(0,b.jsx)(W.ZP,{...a,id:s,closeMenuOnSelect:!0,options:l,styles:{control:e=>({...e,borderRadius:6,fontSize:14,height:44}),placeholder:e=>({...e,color:"#B1B1B1"}),indicatorSeparator:e=>({...e,display:"none"})},components:{Option:e=>{var t,s;return(0,b.jsx)(Q.c.Option,{...e,children:(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("img",{className:"w-10 mr-4 rounded-full",src:(null===(s=e.data)||void 0===s?void 0:null===(t=s.photo)||void 0===t?void 0:t.url)||"/img/search/user.svg"}),e.label]})})}}})]})};function formatUserOption(e){return{...e,label:null==e?void 0:e.name,id:null==e?void 0:e._id}}var wysiwyg_form_UsersSearch=e=>{let{label:t,field:s,placeholder:i,onChange:n,selectedUsers:r=[],associationId:a,...l}=e,{t:o}=(0,C.$G)("events"),[d,c]=(0,w.useState)(""),[u]=(0,$.Z)(d,200),{data:m,isLoading:x}=(0,H.gl)(u,a);return(0,b.jsx)(wysiwyg_form_SearchDropdown,{id:"".concat(s,"-dropdown"),data:m,isLoading:x,label:t,noOptionsMessage:()=>o("userSearch.noUsersFound"),onChange:e=>{n(e),c("")},onInputChange:c,optionDataFormatter:formatUserOption,placeholder:i,selectedUsers:r,value:d,...l})};function formatOrganizationOption(e){return{...e,label:null==e?void 0:e.name,photo:{url:null==e?void 0:e.badgeImageUrl}}}var wysiwyg_form_OrganizationsSearch=e=>{let{onChange:t,label:s,field:i,placeholder:n,selectedUsers:r=[],...a}=e,[l,o]=(0,w.useState)(""),{data:d,isLoading:c}=(0,R.Fd)({role:["admin","owner"]});return(0,b.jsx)(wysiwyg_form_SearchDropdown,{id:"".concat(i,"-dropdown"),data:null==d?void 0:d.items,isLoading:c,label:s,noOptionsMessage:()=>"No organizations found",onChange:e=>{t(e),o("")},onInputChange:o,optionDataFormatter:formatOrganizationOption,placeholder:n,selectedUsers:r,value:l,...a})},wysiwyg_form_Checkbox=e=>{let{id:t,checked:s,onChange:i,label:n}=e;return(0,b.jsxs)("label",{htmlFor:t,className:"flex items-start cursor-pointer font-normal text-base text-gray-600",children:[(0,b.jsx)("input",{id:t,className:"mt-1 mr-2",type:"checkbox",checked:s,onChange:i}),n]})},Y=s(80708),K=s(60939),X=s(16960),settings_OrganizersHostModal=function(e){let{onClose:t,isOpen:s}=e,{t:i}=(0,C.$G)(["events"]),{values:{groups:n=[],cohosts:r=[],scanners:a=[],photographers:l=[],operators:o=[],...d},setValues:c}=(0,y.u6)(),[u,m]=(0,w.useState)((null==n?void 0:n.length)>0),toggleHostedByOrganization=()=>{m(e=>!e)},onCloseHandler=()=>{m(!1),t()};return(0,w.useEffect)(()=>{s&&(null==n?void 0:n.length)>0&&!u&&m(!0)},[n,s]),(0,b.jsx)(y.J9,{initialValues:{organizations:n,cohosts:r,operators:o,scanners:a,photographers:l},enableReinitialize:!0,onSubmit:e=>{let t=[];u&&(t=e.organizations),c({...d,cohosts:e.cohosts,groups:t,operators:e.operators,scanners:e.scanners,photographers:e.photographers,chargeOrganizationFee:(0,X.Kb)(e.organizations)}),onCloseHandler()},children:e=>{var t,n;let{submitForm:r,resetForm:a,values:l}=e,o=null===(n=l.organizations)||void 0===n?void 0:null===(t=n.find(e=>e.associationDependentId))||void 0===t?void 0:t.associationDependentId;return(0,b.jsx)(G.Z,{visible:s,onClose:()=>{a(),onCloseHandler()},type:G.w.SMALL,title:i("events:eventDetails.organizers"),icon:(0,b.jsx)(z.oG,{size:20}),renderFooter:()=>(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:r,children:i("events:host.saveOrganizers")}),children:(0,b.jsxs)("div",{className:"pt-7 pb-[70px] px-4",children:[(0,b.jsx)("p",{className:"font-normal text-base text-gray-500 pb-7",children:i("events:host.manageEventOrganizers")}),(0,b.jsx)(wysiwyg_form_Checkbox,{id:"is-hosted-by-org",label:i("events:host.isHostedByOrganization"),checked:u,onChange:toggleHostedByOrganization}),u&&(0,b.jsx)(settings_OrganizersSelectList,{field:"organizations",label:i("events:host.organizations"),placeholder:i("events:host.selectOrganizations"),SearchComponent:wysiwyg_form_OrganizationsSearch,ListComponent:Y.Z}),(0,b.jsx)(settings_OrganizersSelectList,{field:"cohosts",label:i("events:host.cohosts"),placeholder:i("events:host.selectCohosts"),SearchComponent:wysiwyg_form_UsersSearch,ListComponent:K.Z,associationId:o}),(0,b.jsx)(settings_OrganizersSelectList,{field:"operators",label:i("events:host.operators"),placeholder:i("events:host.selectOperators"),SearchComponent:wysiwyg_form_UsersSearch,ListComponent:K.Z,associationId:o}),(0,b.jsx)(settings_OrganizersSelectList,{field:"scanners",label:i("events:host.scanners"),placeholder:i("events:host.selectScanners"),SearchComponent:wysiwyg_form_UsersSearch,ListComponent:K.Z,associationId:o}),(0,b.jsx)(settings_OrganizersSelectList,{field:"photographers",label:i("events:host.photographers"),placeholder:i("events:host.selectPhotographers"),SearchComponent:wysiwyg_form_UsersSearch,ListComponent:K.Z,menuPlacement:"top",associationId:o})]})})}})},J=s(16851),create_event_Organizers=()=>{let e=(0,F.po)(),[t,s]=(0,w.useState)(!1),{values:{groups:i=[],cohosts:n=[],scanners:r=[],operators:a=[],photographers:l=[]}}=(0,y.u6)(),toggleOrganizersModal=()=>{s(e=>!e)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(J.Z,{onClick:toggleOrganizersModal,isEditable:!0,data:{groups:i,cohosts:n,scanners:r,operators:a,photographers:l,host:e}}),(0,b.jsx)(settings_OrganizersHostModal,{isOpen:t,onClose:toggleOrganizersModal})]})},ee=s(58535),et=s(29791),es=s(93967),ei=s.n(es);let en="title";var wysiwyg_form_Title=()=>{let{errors:e,touched:t}=(0,y.u6)(),{t:s}=(0,C.$G)(["events"]),i=!!L()(e,en)&&!!L()(t,en);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(y.gN,{id:"title",name:en,className:ei()("w-full mt-4 p-1 text-2xl font-semibold rounded-md placeholder:text-gray-500",i?"bg-red-100":"bg-transparent"),placeholder:s("events:host.eventNamePlaceholder")}),i&&(0,b.jsx)(et.Z,{error:L()(e,en)})]})},er=s(33011),ea=s(69274),el=s(67355);let eo="address";var wysiwyg_form_Location=()=>{let{errors:e,touched:t,values:s}=(0,y.u6)(),{t:i}
1=(0,C.$G)(["events"]),n=!!L()(e,eo)&&!!L()(t,eo);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:ei()("mt-6 text-base placeholder:text-gray-500 flex items-center w-full rounded-md font-normal",{"bg-red-100 p-1":n}),children:[(0,b.jsx)(ea.JQy,{size:24,className:"mr-2 text-gray-500"}),(0,b.jsx)(el.Z,{name:"address",className:"text-base font-normal w-full bg-transparent",locationFieldName:"address",placeholder:i("events:host.locationPlaceholder"),initialValue:{address:s.address,coordinates:s.coordinates},coordinatesFieldName:"coordinates",showCurrentLocationButton:!1})]}),n&&(0,b.jsx)(et.Z,{error:L()(e,eo)})]})},ed=s(97927),ec=s.n(ed),eu=s(89583),em=s(89584),ex=s(19379),ep=s(39153);let DateField=e=>{let{field:t,form:s,onChange:i,disabled:n}=e;return(0,b.jsx)("input",{type:"date",className:ei()(ec().datepicker,n&&ec().disabled),name:t.name,value:em.WU(t.value,"YYYY-MM-DD"),onChange:e=>{s.setFieldValue(t.name,em.Y6(e.target.value)),i&&i()},onBlur:t.onBlur,disabled:n,min:em.WU(new Date,"YYYY-MM-DD")})},TimeField=e=>{let{field:t,form:s,onChange:i,disabled:n}=e;return(0,b.jsx)("input",{type:"time",className:ei()(ec().datepicker,n&&ec().disabled),name:t.name,value:em.WU(t.value,"HH:mm"),onChange:e=>{let[n,r]=e.target.value.split(":");s.setFieldValue(t.name,em.Y6(em.t8(s.values[t.name],{hour:parseInt(n),minute:parseInt(r)}))),i&&i()},disabled:n,onBlur:t.onBlur})};(i=u||(u={})).Default="default",i.Input="input";var wysiwyg_form_DateTime=e=>{let{name:t,datePlaceholder:s,timePlaceholder:i,min:n,max:r,startDate:a,dateLabel:l,timeLabel:o,inputStyle:d="default",onChange:c,disabled:u=!1}=e,{values:m,touched:x,errors:p,setFieldValue:v}=(0,y.u6)(),g=!!L()(p,t)&&!!L()(x,t);return w.useEffect(()=>{a&&v(t,em.Y6(a))},[a,t,v]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:ei()("default"===d&&"mt-10","input"===d&&"gap-5","flex",ec().datetimePicker,{"bg-red-100 p-1 rounded-md":g}),children:[(0,b.jsxs)("div",{className:ei()("input"===d&&"flex-1"),children:["input"===d&&(0,b.jsx)("label",{className:"text-base font-normal",htmlFor:t,children:l}),(0,b.jsxs)("div",{className:ei()(!m[t]&&!u&&"text-gray-500","text-base flex items-center","default"===d&&"mr-4 md:mr-10","input"===d&&"px-3 py-4 mt-1 border-1 rounded-md",u?"bg-neutral-100 text-gray-400":"cursor-pointer border-neutral-300"),children:[(0,b.jsx)(eu.tpH,{size:20,className:"mr-2 text-gray-500"}),(0,b.jsxs)("div",{className:ei()("input"===d&&"flex-1","relative"),children:[m[t]?em.WU(m[t],"input"===d?"YYYY-MM-DD":"dddd, MMM D, YYYY"):s,(0,b.jsxs)("div",{className:"absolute left-0 top-0 w-full",children:[(0,b.jsx)("div",{className:"block md:hidden",children:(0,b.jsx)(y.gN,{id:t,name:t,component:DateField,onChange:c,disabled:u})}),(0,b.jsx)("div",{className:"hidden md:block",children:(0,b.jsx)(ex.Z,{name:t,className:"border-0 opacity-0",placeholderText:"YYY-MM-DD",disabledBefore:new Date(n),disabledAfter:new Date(r),onChange:c,disabled:u})})]})]})]})]}),(0,b.jsxs)("div",{className:ei()("input"===d&&"flex-1"),children:["input"===d&&(0,b.jsx)("label",{className:"text-base font-normal",htmlFor:"".concat(t,"Time"),children:o}),(0,b.jsxs)("div",{className:ei()(!m[t]&&!u&&"text-gray-500","text-base flex items-center","default"===d&&"mr-4 md:mr-10","input"===d&&"px-3 py-4 mt-1 border-1 rounded-md",u?"bg-neutral-100 text-gray-400":"cursor-pointer border-neutral-300"),children:[(0,b.jsx)(z.o2E,{size:20,className:"mr-2 text-gray-500"}),(0,b.jsxs)("div",{className:ei()("input"===d&&"flex-1","relative pr-2"),children:[em.WU(m[t],"hh:mm a")||i,(0,b.jsxs)("div",{className:"absolute left-0 top-0 w-full",children:[(0,b.jsx)("div",{className:"block md:hidden",children:(0,b.jsx)(y.gN,{id:t,name:t,component:TimeField,onChange:c,disabled:u})}),(0,b.jsx)("div",{className:"hidden md:block",children:(0,b.jsx)(ep.Z,{name:"".concat(t,"Time"),className:"border-0 opacity-0",placeholderText:"YYY-MM-DD",disabledBefore:new Date(n),disabledAfter:new Date(r),compareDate:m[t],onChange:c,disabled:u})})]})]})]})]})]}),g&&(0,b.jsx)(et.Z,{error:L()(p,t)})]})},ev=s(93105),eg=s(47516),ef=s(83913);let noop=()=>{}
1,eh={playsInline:!0};var upload_video_UploadVideoModal=e=>{let{preview:t,isLoading:s,errorMessage:i,cropShape:n,aspectRatio:r,onClose:a,uploadVideo:l,children:o,isUploadButtonDisabled:d}=e,[c,u]=(0,w.useState)(null),{t:m}=(0,C.$G)(["common"]),handleSaveChanges=async()=>{try{await l(),a()}catch(e){u(e.message)}};return(0,b.jsx)(G.Z,{visible:!0,type:G.w.VERY_SMALL,onClose:a,minHeight:"500px",children:(0,b.jsxs)("div",{className:"py-12 px-10 h-full overflow-hidden",children:[(0,b.jsx)("div",{className:"w-full aspect-ratio-4-5 mx-auto relative rounded-xl overflow-hidden",children:(0,b.jsx)(ef.ZP,{aspect:r||1,crop:{x:0,y:0},zoom:1,video:t,cropShape:n||"round",showGrid:!1,restrictPosition:!0,onCropChange:noop,onZoomChange:noop,objectFit:"contain",onCropComplete:noop,mediaProps:eh,setVideoRef:e=>{e.current.pause()}})}),(0,b.jsx)("div",{className:"mt-6 text-caption text-gray-500 flex justify-center",children:m("common:videos.confirmVideoPosition")}),o,(0,b.jsxs)("div",{className:"mt-10",children:[i||c&&(0,b.jsx)("div",{className:"mb-2 text-center text-red-500",children:i||c}),(0,b.jsx)(V.ZP,{disabled:d,loading:s,onClick:()=>handleSaveChanges(),children:m("common:buttons.upload")})]})]})})},upload_video_UploadVideoButton=e=>{let{preview:t,setPreview:s,label:i,isLoading:n,cropShape:r,aspectRatio:a,errorMessage:l,ButtonComponent:o,children:d,isUploadButtonDisabled:c,uploadVideo:u,onSetError:m}=e,[x,p]=(0,w.useState)(),[v,g]=(0,w.useState)(null),f=(0,w.useRef)(null),{t:h}=(0,C.$G)(["common","validations"]),[j,y]=(0,w.useState)(!1),openSelectFile=()=>{f.current.click()};return(0,b.jsxs)(b.Fragment,{children:[o?(0,b.jsx)(o,{onClick:openSelectFile}):(0,b.jsx)(V.ZP,{onClick:openSelectFile,children:i||h("common:videos.uploadVideo")}),v&&(0,b.jsx)("div",{className:"mt-2 text-red-500 text-center",children:v}),(0,b.jsx)("input",{type:"file",ref:f,id:"upload-video",className:"hidden",accept:"video/*",onChange:e=>{let t=e.target.files[0],i=m||g;if(i(null),t){if(!t.type.includes("video/")){e.target.value="",i(h("validations:videoFileNotSupported",{type:t.type}));return}if(t.size>104857600){e.target.value="",i(h("validations:fileTooLarge",{size:100}));return}e.target.value="",p(t),s(URL.createObjectURL(t)),y(!0)}}}),j&&(0,b.jsx)(upload_video_UploadVideoModal,{preview:t,cropShape:r,isLoading:n,aspectRatio:a,isUploadButtonDisabled:c,errorMessage:l,onClose:()=>{y(!1)},uploadVideo:()=>u(t,x),children:d})]})},eb=s(16156),ej=s.n(eb);(n=m||(m={}))[n.OneToOne=1]="OneToOne",n[n.FourToFive=.8]="FourToFive",n[n.ThreeToTwo=1.5]="ThreeToTwo",n[n.NineToSixteen=.5625]="NineToSixteen";let UploadVideo=e=>{let{preview:t,onClick:s,videoUrl:i,label:n,maxLabel:r,aspectRatio:a,disabled:l,buttonStyle:o={},defaultIconSize:d}=e,c=(0,w.useRef)(null),{t:u}=(0,C.$G)(["events"]);return(0,w.useEffect)(()=>{var e,t;null===(t=c.current)||void 0===t||null===(e=t.pause)||void 0===e||e.call(t)},[c.current]),(0,b.jsx)("button",{type:"button",onClick:s,className:"w-full h-full",disabled:l,children:t||i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:ei()("h-[350px] w-full absolute bottom-0",ej().videoUploaderGradient)}),(0,b.jsx)("video",{ref:c,loop:!0,playsInline:!0,autoPlay:!0,muted:!0,className:"w-full h-full object-cover object-center",children:(0,b.jsx)("source",{src:t||i,type:"video/mp4"})})]}):(0,b.jsxs)("div",{className:"md:justify-center w-full h-full bg-neutral-100 text-center flex flex-col items-center pt-32 md:pt-0 relative",style:o,children:[(0,b.jsx)("div",{className:ei()("h-[350px] w-full absolute bottom-0",ej().videoUploaderGradient)}),(0,b.jsx)("p",{className:ei()(!d&&1===a&&"text-3xl",!d&&1!==a&&"text-9xl md:-mt-[40%]"),style:d?{fontSize:d}:{},children:"\uD83C\uDFA5"}),(0,b.jsx)("p",{className:ei()("text-sm decoration-[#575757] font-light",1===a?"mt-0 w-full text-xs":"w-[140px] mt-0",o&&"w-full mt-1"),children:n||"9:16 • 100 Megabytes"}),null!==r&&(0,b.jsx)("p",{className:"text-sm decoration-[#575757] font-semibold",children:r||u("events:host.hypeVideoOptional")})]})})},EditVideoIcon=e=>{let{onClick:t}=e;return(0,b.jsx)("div",{className:"absolute right-0",children:(0,b.jsx)("div",{className:"mr-2 mt
1-2 rounded-full p-1 bg-blue-200 w-[32px] h-[32px] flex items-center justify-center",style:{backgroundColor:"#EEF1FF"},onClick:()=>null==t?void 0:t(),children:(0,b.jsx)(eg.Yjd,{size:18,color:"#3853C4"})})})};var wysiwyg_form_VideoUpload=e=>{let{label:t,maxLabel:s,className:i,aspectRatio:n=.5625,onUploadVideo:r,isUploading:a,videoUrl:l,error:o,disabled:d,buttonStyle:c,defaultIconSize:u,editIconOnly:m,onSetError:x}=e,[p,v]=(0,w.useState)(""),onUploadVideoButtonClicked=(e,t)=>{v(e),r(t)},g=(0,w.useCallback)(e=>{let{onClick:i}=e;return(0,b.jsx)(UploadVideo,{onClick:i,videoUrl:l,preview:p,maxLabel:s,disabled:d,aspectRatio:n,label:t,buttonStyle:c,defaultIconSize:u})},[p,l,d,c,u]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(et.Z,{error:o}),(0,b.jsx)("div",{className:ei()(i,{"animate-pulse":a}),children:(0,b.jsxs)("div",{className:"md:mx-auto relative",children:[l&&!m&&(0,b.jsx)(upload_video_UploadVideoButton,{preview:p,setPreview:v,cropShape:"rect",aspectRatio:n,ButtonComponent:EditVideoIcon,uploadVideo:onUploadVideoButtonClicked}),l&&m&&(0,b.jsx)(EditVideoIcon,{}),(!l||l&&!m)&&(0,b.jsx)("div",{className:ei()("overflow-hidden w-full mx-auto max-h-[850px] md:max-h-[800px]",{"border-1 border-red-700":!!o},1===n&&"rounded-2xl",1===n&&!o&&"border-white border-2",1===n&&!!o&&"border-red-700 border-2"),style:c||{aspectRatio:n.toString()},children:(0,b.jsx)(upload_video_UploadVideoButton,{preview:p,setPreview:v,cropShape:"rect",aspectRatio:n,ButtonComponent:g,uploadVideo:onUploadVideoButtonClicked,onSetError:x})})]})})]})},ey=s(66254),eN=s(18624),ew=s.n(eN),eC=s(37106),settings_LinkForm=e=>{let{title:t,onClose:s,onSubmit:i}=e,{t:n}=(0,C.$G)(["validations","common"]);return(0,b.jsx)(y.J9,{initialValues:{link:"",text:""},onSubmit:e=>{i({text:e.text,link:e.link})},validationSchema:j.Ry().shape({link:j.Z_().url().required(n("validations:fieldIsRequired",{field:n("common:link")})),text:j.Z_().required(n("validations:fieldIsRequired",{field:n("common:text")}))}),children:e=>{let{errors:i,touched:r,submitForm:a}=e,l=!!L()(i,"link")&&!!L()(r,"link"),o=!!L()(i,"text")&&!!L()(r,"text");return(0,b.jsx)(G.Z,{type:G.w.SMALL,autoHeight:!0,onClose:s,visible:!0,icon:(0,b.jsx)("img",{src:"/img/icons/link.svg",className:"w-6 h-6"}),title:t||n("events:host.addLink"),renderFooter:()=>(0,b.jsx)(V.ZP,{disabled:l||o,type:V.L$.Primary,onClick:a,children:n("common:buttons.save")}),children:(0,b.jsx)(y.l0,{className:"h-full",children:(0,b.jsxs)("div",{className:"p-4 pt-0 mt-4 flex flex-col justify-between",children:[(0,b.jsx)("h2",{className:"mt-2 text-sm font-normal text-gray-500",children:n("events:host.addLinkURLAndDisplayText")}),(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)("label",{htmlFor:"code",className:"mt-2.5 mb-2.5 p-0 text-xs text-left text-gray-900 font-normal",children:n("common:linkURL")}),(0,b.jsx)(y.gN,{id:"link",name:"link",type:"text",maxLength:120,required:!0,className:ei()("w-full h-10 border border-gray-300 rounded-md px-4 text-base bg-white placeholder-gray-800/40",(r.link&&(null==i?void 0:i.link)||(null==i?void 0:i.link))&&ew().errorField),placeholder:"e.g. https://www.bouncelife.com/","data-testId":"display-name-input"}),l&&(0,b.jsxs)("div",{className:"mt-2 text-red-800 flex items-center gap-1 font-normal",children:[(0,b.jsx)(eC.m2k,{size:16})," ",L()(i,"link")]})]}),(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)("label",{htmlFor:"text",className:"mt-2.5 mb-2.5 p-0 text-xs text-left text-gray-900 font-normal",children:n("common:text")}),(0,b.jsx)("div",{className:"relative",children:(0,b.jsx)(y.gN,{id:"text",name:"text",maxLength:30,type:"text",required:!0,className:ei()("w-full h-10 border border-gray-300 rounded-md px-4 text-base bg-white placeholder-gray-800/40",(r.text&&(null==i?void 0:i.text)||(null==i?void 0:i.link))&&ew().errorField),placeholder:n("events:host.addLinkURLAndDisplayTextPlaceholder"),"data-testId":"code-input"})}),o&&(0,b.jsxs)("div",{className:"mt-2 text-red-800 flex items-center gap-1 font-normal",children:[(0,b.jsx)(eC.m2k,{size:16})," ",L()(i,"text")]})]})]})})})}})};let ek="description";var wysiwyg_form_Description=()=>{let{t:e}=(0,C.$G)(["events"]),[t,s]=(0,w.useState)(!1),toggleModal=()=>{s(!t)},{errors:i,values:n,touched:r,setFieldValue:a}=(0,y.u6)(),l=!!L()(i,ek)&&!!L()(r,ek);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"pt-7 text-base text-gray-800 font-semibold",children:e("events:host.aboutTheEvent")}),(0,b.jsx)("div",{className:ei()("text-base placeholder:text-gray-500 w-full",{"bg-red-100 rounded-md px-1":l}),children:(0,b.jsx)(ey.Z,{className:"w-full bg-transparent py-4",id:"description",name:"description",placeholder:e("events:host.tellUsMoreAboutYourEvent")})}),l&&(0,b.jsx)(et.Z,{error:L()(i,ek)}),(0,b.jsxs)("button",{type:"button",className:"mt-4 text-primary-500 font-semibold text-base flex items-center",onClick:toggleModal,children:[(0,b.jsx)(z.fVQ,{size:24,className:"mr-1"}),e("common:buttons.addHyperlink")]}),t&&(0,b.jsx)(settings_LinkForm,{onClose:toggleModal,onSubmit:e=>{let{text:t,link:s}=e;a("description","".concat(n.description,"\n[").concat(t,"](").concat(s,")")),toggleModal()},title:e("common:buttons.addHyperlink")})]})},wysiwyg_form_PrivateToggle=()=>{let{values:e,setFieldValue:t}=(0,y.u6)(),{t:s}=(0,C.$G)(["events"]);return(0,b.jsxs)("div",{className:"w-full mr-10 pt-6 text-base text-gray-500 flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)(z.wU4,{size:20,className:"mr-2"}),s("events:host.privateEvent"),(0,b.jsx)(U.Z,{id:"private-event-tooltip",message:s("events:host.privateEventTooltip")})]}),(0,b.jsx)(B.Z,{isActive:e.private,onClick:()=>{t("private",!e.private)}})]})},eS=s(2580),eT=s(52300);let tusUploadOptions=e=>
1({chunkSize:10485760,metadata:{filename:e.name,filetype:e.type}}),tusUpload=async(e,t,s)=>await new Promise((i,n)=>{let r=new eS.gq(e,{...tusUploadOptions(e),uploadUrl:t,onSuccess:()=>{i()},onError:n,onProgress:s.onProgress});r.start()}),useVideoUploadCommand=()=>{let[e,t]=(0,w.useState)(0),[s,i]=(0,w.useState)(!1),n=(0,D.l4)(),onProgress=(e,s)=>{t(e/s*100)},useVideoUpload=async e=>{i(!0);try{let{uploadUrl:t,videoId:s}=await new Promise((t,s)=>{n.mutate({uploadLength:String(e.size),uploadMetadata:"filename=".concat(eT.cv(String(e.name)),";filetype=").concat(eT.cv(String(e.type)))},{onSuccess:t,onError:s})});return await tusUpload(e,t,{onProgress}),s}finally{i(!1)}};return{progress:e,isUploading:s,useVideoUpload}};var e_=s(51649),eI=s(27484),eP=s.n(eI),eF=s(59967),eD=s(85831);let computeFrequency=(e,t,s,i)=>{let n=eD.Dr[e],r=eP()(t).format("dddd");return i("events:host.repeatingEventFrequency",{frequency:n,startDay:r,numberOfEvents:s})};var wysiwyg_form_RecurringEvent=e=>{let{navigateToRecurringSettings:t,eventId:s}=e,{t:i}=(0,C.$G)(["events","common"]),[n,r]=(0,w.useState)(!1),{values:a}=(0,y.u6)(),{data:l,isLoading:o}=(0,D.OQ)({eventId:s},{enabled:!!s&&!!a.seriesId}),toggleRequirementsModal=()=>{r(e=>!e)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"w-full mr-10 pt-7 text-base text-gray-500 flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("img",{src:"/img/icons/sync.svg",className:"mr-2 w-[20px]"}),i("events:host.repeat"),(0,b.jsx)(U.Z,{id:"recurring-event-tooltip",message:i("events:host.repeatingEventTooltip")})]}),o?(0,b.jsx)(eF.Z,{type:eF.d.PRIMARY}):(0,b.jsx)("button",{type:"button",className:"py-1 pl-2 text-primary-500 text-base font-semibold",onClick:()=>{var e;return s&&a.title&&(null===(e=a.photo)||void 0===e?void 0:e.url)&&a.description&&a.address&&a.coordinates?t():toggleRequirementsModal()},children:l?computeFrequency(l.frequency,l.startDate,l.eventIds.length,i):i("events:host.doesNotRepeat")})]}),(0,b.jsx)(G.Z,{visible:n,onClose:toggleRequirementsModal,type:G.w.SMALL,autoHeight:!0,title:i("events:host.requiredFieldsMissing"),icon:(0,b.jsx)("div",{className:"bg-yellow-100 flex-1 h-full flex items-center justify-center text-yellow-800",children:(0,b.jsx)(e_.iUH,{size:20})}),renderFooter:()=>(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:toggleRequirementsModal,newRadius:!0,children:i("common:buttons.ok")}),children:(0,b.jsx)("div",{className:"p-4",children:(0,b.jsx)("p",{className:"text-base font-normal text-neutral-600",children:i("events:host.repeatingEventTooltipDescription")})})})]})},eO=s(92872),eE=s(36355),eA=s(70231),create_event_ActionBar=e=>{let{eventId:t,shouldRequestToPublish:s,onClickEventSettings:i,togglePricingTiersModal:n}=e,r=(0,N.useRouter)(),{t:a}=(0,C.$G)(["events"]),{values:l}=(0,y.u6)();return(0,b.jsxs)(b.Fragment,{children:[l.isDraft&&(s?(0,b.jsx)("button",{type:"submit",className:" bg-primary-800 py-4 w-full  mb-8 md:mb-4 text-white text-base flex items-center justify-center disabled:opacity-70",children:a("events:host.requestToPublish")}):(0,b.jsxs)("button",{type:"submit",className:" bg-primary-800 py-4 w-full  mb-8 md:mb-4 text-white text-base flex items-center justify-center disabled:opacity-70",children:[a("events:host.publishEvent")," ",(0,b.jsx)(z.WeY,{className:"ml-2",size:20})]})),(0,b.jsxs)("div",{className:"w-full fixed left-0 bottom-0 bg-white pb-8 z-50 md:pb-4",children:[!1===l.isDraft&&(0,b.jsxs)("button",{type:"button",className:" bg-primary-800 py-4 w-full  text-white text-base flex items-center justify-center disabled:opacity-70",onClick:()=>{r.push("/events/".concat(t)),(0,E.XH)()&&(0,E.mG)(A.jj)},children:[a("events:host.doneEditing")," ",(0,b.jsx)(eA.l_A,{className:"ml-2",size:14})]}),(0,b.jsxs)("div",{className:"md:w-[630px] md:mx-auto  flex items-center justify-between pt-4 px-4",children:[(0,b.jsx)("div",{className:"md:w-full p-3 rounded-full bg-primary-200 flex items-center justify-center",children:(0,b.jsxs)("button",{type:"button",className:"w-full text-primary-700 text-base flex items-center justify-center",onClick:i,children:[(0,b.jsx)(eA.mdD,{size:20,className:"md:mr-2"}),(0,b.jsx)("span",{className:"hidden md:block",children:a("events:host.eventSettings")})]})}),(0,b.jsx)("div",{className:"w-full pl-3",children:(0,b.jsx)("div",{className:"bg-primary-200 py-3 rounded-full flex items-center justify-center",onClick:n,children:(0,b.jsxs)("button",{type:"button",className:"text-primary-700 text-base flex items-center",children:[(0,b.jsx)(z.Zp5,{size:20,className:"mr-2"}),a("events:host.pricingTiers")]})})})]})]})]})};(r=x||(x={})).CREATE_OFFER="create_offer",r.OFFERS_LIST="offers_list",r.EDIT_OFFER="edit_offer",r.OFFER_DETAILS="offer_details";var eR=s(46191);(a=p||(p={})).BASIC_FORM="basicForm",a.REQUEST_TO_PUBLISH_FORM="requestToPublishForm",a.EVENT_SETTINGS="eventSettings",a.TRACKING_LINKS="trackingLinks",a.DISCOUNT_CODES="discountCodes",a.RECURRING_SETTINGS="recurringSettings",a.PRICING_TIERS="pricingTiers",a.OFFERS="offers",a.PRE_PURCHASE_QUESTIONS="prePurchaseQuestions";let eM=(0,w.createContext)(void 0),EventEditorProvider=e=>{let{children:t,associationId:s,eventId:i,event:n,isDraft:r,isEditing:a,isLoading:l,lastUpdated:o,eventSeriesId:d,eventShareToken:c,shouldRequestToPublish:u,requestToPublishFormId:m,requestToPublishWorkflowId:p,startDate:v,offersStep:g,setOffersStep:f,createDraft:h,requestPublication:j,requestPublicationWorkflow:y,refetchEvent:C,currentScreen:k,setCurrentScreen:S}
1=e,T=(0,N.useRouter)(),[_,I]=(0,w.useState)(void 0),{data:P,isLoading:F,refetch:D}=(0,eR._)({eventId:i}),navigateToScreen=e=>{S(e)},handleOfferBackNavigation=()=>{switch(g){case x.EDIT_OFFER:f(x.OFFER_DETAILS);break;case x.OFFER_DETAILS:f(x.OFFERS_LIST);break;default:navigateToScreen("eventSettings")}};return(0,b.jsx)(eM.Provider,{value:{associationId:s,eventId:i,event:n,isDraft:r,isEditing:a,isLoading:l,lastUpdated:o,eventSeriesId:d,eventShareToken:c,shouldRequestToPublish:u,requestToPublishFormId:m,requestToPublishWorkflowId:p,startDate:v,offersStep:g,setOffersStep:f,tierScansData:P,isTierScansLoading:F,refetchTierScans:D,handleBack:()=>{switch(k){case"eventSettings":case"recurringSettings":case"pricingTiers":case"requestToPublishForm":navigateToScreen("basicForm");break;case"trackingLinks":case"discountCodes":case"prePurchaseQuestions":navigateToScreen("eventSettings");break;case"offers":handleOfferBackNavigation();break;default:T.back(),(0,E.XH)()&&(0,E.mG)(A.jj)}},navigateToScreen,navigateToBasicForm:()=>navigateToScreen("basicForm"),navigateToEventSettings:()=>navigateToScreen("eventSettings"),navigateToRecurringSettings:()=>navigateToScreen("recurringSettings"),navigateToTrackingLinks:()=>navigateToScreen("trackingLinks"),navigateToDiscountCodes:()=>navigateToScreen("discountCodes"),navigateToOffersPage:()=>navigateToScreen("offers"),navigateToSeriesSettings:()=>navigateToScreen("recurringSettings"),togglePricingTiersModal:()=>navigateToScreen("pricingTiers"),handleOfferBackNavigation,navigateToPrePurchaseQuestions:()=>navigateToScreen("prePurchaseQuestions"),createDraft:h,requestPublication:j,requestPublicationWorkflow:y,refetchEvent:C,currentScreen:k,addTierToSectionId:_,setAddTierToSectionId:I},children:t})},useEventEditorContext=()=>{let e=(0,w.useContext)(eM);if(void 0===e)throw Error("useEventEditorContext must be used within an EventEditorProvider");return e};var create_event_BasicForm=()=>{var e;let{t}=(0,C.$G)(["events"]),{eventId:s,createDraft:i,navigateToRecurringSettings:n,isDraft:r,isEditing:a,isLoading:l,lastUpdated:o,handleBack:d,navigateToEventSettings:c,togglePricingTiersModal:u,shouldRequestToPublish:m,startDate:x}=useEventEditorContext(),p=(0,Z.Vb)(),v=(0,D.Oo)(),g=(0,D.r4)(),{isUploading:f,useVideoUpload:h}=useVideoUploadCommand(),{values:j,errors:N,setFieldValue:k,setFieldError:S}=(0,y.u6)(),[T,_]=w.useState(!1);(0,w.useEffect)(()=>{j.endDate&&_(!0)},[j.endDate]);let onUploadPhoto=async e=>{let t=s;if(!t){let e=await i();t=e._id}v.mutate({eventId:t,blob:e},{onSuccess:e=>{let{photo:t}=e;k("photo.url",null==t?void 0:t.url)}})},onUploadVideo=async e=>{let t=s;if(!t){let e=await i();t=e._id}let n=await h(e);g.mutate({eventId:t,videoId:n},{onSuccess:e=>{let{hypeVideoUrl:t}=e;k("hypeVideoUrl",t)}})};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:r,isEditing:a,title:t("events:host.createEvent"),isLoading:l,lastUpdated:o,onBack:d,onMenuClick:c}),(0,b.jsx)(ee.Z,{children:(0,b.jsxs)("div",{className:"md:mt-[47px] md:w-[630px] md:mx-auto pb-20 -mt-[40px]",children:[(0,b.jsx)("div",{className:"absolute z-10 m-4",children:(0,b.jsx)(eO.Z,{eventId:s,seriesId:j.seriesId})}),(0,b.jsx)(wysiwyg_form_VideoUpload,{className:"w-full",videoUrl:null==j?void 0:j.hypeVideoUrl,onUploadVideo:onUploadVideo,isUploading:f||g.isLoading,error:L()(N,"hypeVideo.url"),onSetError:e=>S("hypeVideo.url",e)}),(0,b.jsx)(ev.Z,{className:"md:-mt-[240px] ml-4 w-28 md:w-[140px] -mt-[340px]",photoUrl:null==j?void 0:null===(e=j.photo)||void 0===e?void 0:e.url,isUploading:v.isLoading,onUploadPhoto:onUploadPhoto,error:L()(N,"photo.url"),onSetError:e=>e&&S("photo.url",e)}),(0,b.jsxs)("div",{className:"w-full px-4 mx-auto relative",children:[(0,b.jsx)(wysiwyg_form_Title,{}),(0,b.jsx)(wysiwyg_form_Location,{}),(0,b.jsx)(wysiwyg_form_DateTime,{name:"startDate",datePlaceholder:t("events:host.startDatePlaceholder"),timePlaceholder:t("events:host.startTimePlaceholder"),min:new Date,max:j.endDate,startDate:x}),T?(0,b.jsx)(wysiwyg_form_DateTime,{name:"endDate",datePlaceholder:t("events:host.endDatePlaceholder"),timePlaceholder:t("events:host.endTimePlaceholder"),min:j.startDate}):(0,b.jsx)("button",{type:"button",onClick:()=>{_(e=>!e)},className:"mt-4 text-primary-500 text-base font-semibold",children:t("events:host.doesItEnd")}),p[q.h.ENABLE_RECURRING_EVENTS]&&(0,b.jsx)(wysiwyg_form_RecurringEvent,{eventId:s,navigateToRecurringSettings:n}),(0,b.jsx)(wysiwyg_form_PrivateToggle,{}),(0,b.jsx)(er.Z,{}),(0,b.jsx)(create_event_Organizers,{}),(0,b.jsx)(create_event_Guests,{}),(0,b.jsx)(er.Z,{}),(0,b.jsx)(wysiwyg_form_Description,{})]})]})}),(0,b.jsx)(create_event_ActionBar,{eventId:s,shouldRequestToPublish:m,onClickEventSettings:c,togglePricingTiersModal:u})]})},eL=s(28973);(l=v||(v={})).Admin="admin",l.Member="member";var settings_MomentSettings=()=>{var e,t,s;let{t:i}=(0,C.$G)(["events"]),{values:n,setFieldValue:r}=(0,y.u6)(),a=null!==(s=null==n?void 0:n.momentsPermissions)&&void 0!==s?s:{createMoments:"member",commentMoments:"member"};return(0,b.jsxs)("div",{className:"mt-6",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:i("events:settings.moments")}),(0,b.jsx)(eL.Z,{icon:(0,b.jsx)("img",{src:"/img/events/create/moments.svg",className:"w-6 h-6"}),title:i("events:settings.momentPermissions.onlyAdminsUpload"),t
1ype:eL.G.Toggle,isActive:(null==n?void 0:null===(e=n.momentsPermissions)||void 0===e?void 0:e.createMoments)==="admin",onClick:()=>{"admin"===a.createMoments?r("momentsPermissions",{...a,createMoments:"member"}):r("momentsPermissions",{...a,createMoments:"admin"})}}),(0,b.jsx)(eL.Z,{icon:(0,b.jsx)("img",{src:"/img/events/create/moments.svg",className:"w-6 h-6"}),title:i("events:settings.momentPermissions.onlyAdminsComment"),type:eL.G.Toggle,isActive:(null==n?void 0:null===(t=n.momentsPermissions)||void 0===t?void 0:t.commentMoments)==="admin",onClick:()=>{"admin"===a.commentMoments?r("momentsPermissions",{...a,commentMoments:"member"}):r("momentsPermissions",{...a,commentMoments:"admin"})}})]})},eZ=s(28950),settings_MaxTicketsModal=e=>{let{initialValues:t,onClose:s,onSave:i}=e,{t:n}=(0,C.$G)(["events"]),r=j.Ry().shape({maxTicketsPerTransaction:j.Rx().max(10,"must be less than or equal to 10").min(1,"must be less than or equal to 1").required("Required field")});return(0,b.jsx)(y.J9,{initialValues:t,onSubmit:e=>{i(e.maxTicketsPerTransaction),s()},enableReinitialize:!0,validationSchema:r,children:e=>{let{submitForm:t}=e;return(0,b.jsx)(G.Z,{type:G.w.SMALL,onClose:s,autoHeight:!0,visible:!0,icon:(0,b.jsx)(z.Zp5,{size:20}),title:n("events:settings.maxTickets.modal.title"),renderFooter:()=>(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:t,children:n("events:settings.maxTickets.modal.saveButton")}),children:(0,b.jsx)("div",{className:"px-4 pt-6",children:(0,b.jsx)(eZ.Z,{type:"number",label:n("events:settings.maxTickets.modal.maxTicketsLabel"),id:"maxTicketsPerTransaction",name:"maxTicketsPerTransaction",clearable:!0,placeholder:n("events:settings.maxTickets.modal.maxTicketsPlaceholder")})})})}})},settings_MaxTicketsSettings=()=>{let{t:e}=(0,C.$G)(["events"]),{values:t,setFieldValue:s}=(0,y.u6)(),[i,n]=(0,w.useState)(!1),toggleMaxTicketsModal=()=>{n(e=>!e)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eL.Z,{icon:(0,b.jsx)(z.Zp5,{size:20}),title:e("events:settings.maxTickets.title"),actionLabel:e("events:settings.maxTickets.actionLabel"),value:null==t?void 0:t.maxTicketsPerTransaction,onClick:toggleMaxTicketsModal,tooltipMessage:e("events:settings.maxTickets.tooltip"),type:eL.G.Button}),i&&(0,b.jsx)(settings_MaxTicketsModal,{onClose:toggleMaxTicketsModal,onSave:e=>{s("maxTicketsPerTransaction",e)},initialValues:{maxTicketsPerTransaction:(null==t?void 0:t.maxTicketsPerTransaction)||""}})]})},settings_GuestQuestionSetting=e=>{let{navigateToPrePurchaseQuestions:t}=e,{t:s}=(0,C.$G)(["events"]);return(0,b.jsx)(eL.Z,{icon:(0,b.jsx)(eg.KRG,{size:20}),title:s("events:settings.guestQuestion.title"),actionLabel:s("events:settings.guestQuestion.actionLabel"),onClick:t,tooltipMessage:s("events:settings.guestQuestion.tooltip"),type:eL.G.Button})};let eq=j.Ry().shape({taxId:j.Z_().min(9).label("Tax ID").when("name",{is:e=>!!e,then:e=>e.required("Required")}),name:j.Z_().max(20).label("Tax name").when("taxId",{is:e=>!!e,then:e=>e.required("Required")}),ratePercent:j.Rx().min(0).max(50).label("Tax rate")},[["taxId","name"]]),eB={taxId:"",name:"",ratePercent:0};var settings_TaxModal=e=>{let{initialValues:t,onClose:s,onSave:i}=e,{t:n}=(0,C.$G)(["events"]);return(0,b.jsx)(y.J9,{initialValues:t||eB,onSubmit:e=>{i(e.taxId?e:null),s()},enableReinitialize:!0,validationSchema:eq,children:e=>{let{setValues:t,submitForm:i}=e;return(0,b.jsx)(G.Z,{type:G.w.SMALL,onClose:s,autoHeight:!0,visible:!0,icon:(0,b.jsx)(z.gw_,{size:20}),title:n("events:settings.tax.modal.title"),renderFooter:()=>(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:i,children:n("events:settings.tax.modal.saveButton")}),children:(0,b.jsxs)("div",{className:"px-4 pt-6",children:[(0,b.jsx)(eZ.Z,{label:"Tax ID",id:"taxId",name:"taxId",placeholder:"e.g. 1234556RT0001",clearable:!0,onClear:()=>{t(eB)}}),(0,b.jsxs)("div",{className:"flex gap-4",children:[(0,b.jsx)(eZ.Z,{label:n("events:settings.tax.modal.taxNameLabel"),id:"name",name:"name",placeholder:n("events:settings.tax.modal.taxNamePlaceholder")}),(0,b.jsx)(eZ.Z,{type:"number",label:n("events:settings.tax.modal.taxRateLabel"),id:"ratePercent",name:"ratePercent",placeholder:n("events:settings.tax.modal.taxRatePlaceholder")})]})]})})}})},settings_TaxSettings=()=>{var e,t,s;let{t:i}=(0,C.$G)(["events"]),{values:n,setFieldValue:r}=(0,y.u6)(),[a,l]=(0,w.useState)(!1),toggleTaxModal=()=>{l(e=>!e)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eL.Z,{icon:(0,b.jsx)(z.gw_,{size:20}),title:i("events:settings.tax.title"),actionLabel:i("events:settings.tax.actionLabel"),value:null==n?void 0:null===(t=n.pricing)||void 0===t?void 0:null===(e=t.tax)||void 0===e?void 0:e.taxId,onClick:toggleTaxModal,tooltipMessage:i("events:settings.tax.tooltip"),type:eL.G.Button}),a&&(0,b.jsx)(settings_TaxModal,{onClose:toggleTaxModal,onSave:e=>{r("pricing.tax",e||null)},initialValues:null==n?void 0:null===(s=n.pricing)||void 0===s?void 0:s.tax})]})},settings_TrackingLinksSettings=e=>{var t,s;let{eventId:i,navigateToTrackingLinks:n}=e,{t:r}=(0,C.$G)(["events"]),{data:a}=(0,D.Q3)(i),{data:l}=(0,D._t)(i,{enabled:null==a?void 0:a.isOrganizer});return(0,b.jsx)(eL.Z,{icon:(0,b.jsx)(z.fVQ,{size:20}),title:r("events:settings.trackingLinks.title"),actionLabel:r("events:settings.trackingLinks.actionLabel"),onClick:n,value:(null==l?void 0:null===(t=l.trackingLinks)||void 0===t?void 0:t.length)?r("events:settings.trackingLinks.totalCount",{count:null==l?void 0:null===(s=l.trackingLinks)||void 0===s?void 0:s.length}):"",type:eL.G.Button})},hooks_useWaiverChangeHandler=e=>{let{mutateAsync:t,isLoading:s}=(0,D.qj)(e),{mutateAsync:i,isLoading:n}=(0,D.s3)(e),{mutateAsync:r,isLoading:a}=(0,D.a3)(e),handleWaiversChange=async(e,s)=>{let n=new Map(e.map(e=>[e.id,e])),a=new Map(s.map(e=>[e.id,e])),l=[],o=[],d=[],isPlaceholderWaiver=e=>""===e.id&&""===e.title.trim(),isWaiverCreated=e=>!n.has(e.id)||""===e.id,isWaiverUpdated=e=>JSON.stringify(n.get(e.id))!==JSON.stringify(e);
1s.forEach(e=>{isPlaceholderWaiver(e)||(isWaiverCreated(e)?l.push(e):isWaiverUpdated(e)&&o.push(e))}),e.forEach(e=>{a.has(e.id)||d.push(e)});try{await Promise.all([...l.map(e=>{let{id:s,...i}=e;return t(i)}),...o.map(e=>{let{id:t,...s}=e;return i({waiverId:t,waiverData:s})}),...d.map(e=>r({waiverId:e.id}))])}catch(e){(0,T.x2)({title:"Error saving waiver",message:null==e?void 0:e.message})}};return{handleWaiversChange,createEventWaiverLoading:s,updateEventWaiverLoading:n,deleteEventWaiverLoading:a}},settings_WaiverModal=e=>{let{initialValues:t,onClose:s,eventId:i,refetchEvent:n}=e,{t:r}=(0,C.$G)(["events"]),[a,l]=(0,w.useState)(!1),[o,d]=(0,w.useState)(null),{handleWaiversChange:c,createEventWaiverLoading:u,updateEventWaiverLoading:m,deleteEventWaiverLoading:x}=hooks_useWaiverChangeHandler(i),toggleModal=()=>{l(!a)},handleRightIconClick=e=>{toggleModal(),d(e)},handleLinkFormSubmit=e=>{let{text:t,link:s,values:i,setFieldValue:n}=e;if(null!==o&&""!==t.trim()){let e=[...i.waivers];e[o].content+="\n[".concat(t,"](").concat(s,")"),n("waivers",e)}toggleModal()},removeWaiver=(e,t,s)=>{let i=[...t];i.splice(e,1),0===i.length&&i.push({title:"",content:"",id:""}),s("waivers",i)},addNewWaiver=(e,t)=>{t("waivers",[...e,{title:"",content:"",id:""}])},handleOnSubmit=async e=>{await c(t.waivers,e.waivers),n(),s()};return(0,b.jsx)(y.J9,{initialValues:t,onSubmit:handleOnSubmit,validationSchema:j.Ry().shape({waivers:j.IX().of(j.Ry().shape({title:j.Z_().when("content",{is:e=>e&&""!==e.trim(),then:j.Z_().required(r("events:settings.waiver.modal.titleRequired")),otherwise:j.Z_()}),content:j.Z_().when("title",{is:e=>e&&""!==e.trim(),then:j.Z_().required(r("events:settings.waiver.modal.contentRequired")),otherwise:j.Z_()}).max(5e3,r("events:settings.waiver.modal.contentTooLong",{limit:5e3}))},[["title","content"]]))}),enableReinitialize:!0,children:e=>{let{values:t,submitForm:i,setFieldValue:n,errors:l}=e;return(0,b.jsxs)(G.Z,{type:G.w.SMALL,onClose:s,visible:!0,isBehind:a,icon:(0,b.jsx)("img",{src:"/img/events/create/waiver.svg",className:"w-6 h-6"}),title:r("events:settings.waiver.modal.title"),renderFooter:()=>{var e;return(0,b.jsx)(V.ZP,{disabled:(null==l?void 0:null===(e=l.waivers)||void 0===e?void 0:e.length)>0,loading:u||m||x,type:V.L$.Primary,onClick:i,children:r("events:settings.waiver.modal.saveButton")})},children:[(0,b.jsxs)("div",{className:"px-4 pt-6 pb-12",children:[(0,b.jsx)("p",{className:"text-sm text-gray-500 mb-2 font-normal",children:r("events:settings.waiver.modal.description")}),t.waivers.map((e,s)=>{var i,a;return(0,b.jsx)(ee.Z,{children:(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)(eZ.Z,{label:r("events:settings.waiver.modal.nameLabel"),id:"waiver-title-".concat(s),name:"waivers[".concat(s,"].title"),clearable:!0,placeholder:r("events:settings.waiver.modal.namePlaceholder")}),(0,b.jsx)(ey.Z,{label:r("events:settings.waiver.modal.textLabel"),id:"waiver-content-".concat(s),name:"waivers[".concat(s,"].content"),placeholder:r("events:settings.waiver.modal.textPlaceholder"),RightIcon:()=>(0,b.jsx)(z.$l_,{size:20}),handleRightIconClick:()=>handleRightIconClick(s),error:null===(i=null==l?void 0:null===(a=l.waivers)||void 0===a?void 0:a[s])||void 0===i?void 0:i.content}),(0,b.jsxs)("div",{className:"mt-2  flex flex-row justify-between items-center",children:[(0,b.jsx)("div",{className:"border-b-1 border-gray-200 w-4/5"}),(0,b.jsx)("div",{className:"cursor-pointer text-red-600 text-sm font-medium",onClick:()=>removeWaiver(s,t.waivers,n),children:r("events:settings.waiver.modal.removeButton")})]})]},e.id)},e.id)}),(0,b.jsx)("button",{type:"button",className:"mt-4 text-blue-600 font-normal font-sfprotext text-base leading-5 tracking-tight",onClick:()=>addNewWaiver(t.waivers,n),children:r("events:settings.waiver.modal.addAnotherButton")})]}),a&&(0,b.jsx)(settings_LinkForm,{onClose:toggleModal,onSubmit:e=>{let{text:s,link:i}=e;return handleLinkFormSubmit({text:s,link:i,values:t,setFieldValue:n})}})]})}})},eU=s(50361),ez=s.n(eU),settings_WaiverSetting=e=>{var t,s;let{refetchEvent:i}=e,{t:n}=(0,C.$G)(["events"]),{values:r}=(0,y.u6)(),[a,l]=(0,w.useState)(!1),toggleWaiverModal=()=>{l(e=>!e)},o=(0,w.useMemo)(()=>{var e;return(null==r?void 0:null===(e=r.waivers)||void 0===e?void 0:e.length)>0?ez()(r.waivers.map(e=>({content:e.content,title:e.title,id:e._id}))):[{content:"",title:"",id:""}]},[null==r?void 0:r.waivers]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eL.Z,{icon:(0,b.jsx)(z.fb2,{size:20}),title:n("events:settings.waiver.title"),actionLabel:n("events:settings.waiver.actionLabel"),value:(null==r?void 0:null===(t=r.waivers)||void 0===t?void 0:t.length)&&n("events:settings.waiver.totalCount",{count:null==r?void 0:null===(s=r.waivers)||void 0===s?void 0:s.length}),onClick:toggleWaiverModal,tooltipMessage:n("events:settings.waiver.tooltip"),type:eL.G.Button}),a&&(0,b.jsx)(settings_WaiverModal,{refetchEvent:i,eventId:r._id,onClose:toggleWaiverModal,initialValues:{waivers:o}})]})},settings_DiscountCodesSettings=e=>{let{eventId:t,navigateToDiscountCodes:s}=e,{t:i}=(0,C.$G)(["events"]),{data:n}=(0,D.xi)(t,{enabled:!0});return(0,b.jsx)(eL.Z,{icon:(0,b.jsx)(z.BVL,{size:20}),title:i("events:settings.discountCodes.title"),actionLabel:i("events:settings.discountCodes.actionLabel"),onClick:s,value:(null==n?void 0:n.discountCodes.length)?i("events:settings.discountCodes.totalCount",{count:null==n?void 0:n.discountCodes.length}):"",type:eL.G.Button})},eG=s(8193),EventOrganizerfee=()=>{var e;let{t}=(0,C.$G)(["events"]),{values:s,setFieldValue:i}=(0,y.u6)();return(null==s?void 0:null===(e=s.groups)||void 0===e?void 0:e.length)>0?(0,b.jsx)(eL.Z,{icon:(0,b.jsx)(eG.Gig,{size:20}),title:t("events:settings.eventOrganizerFee.title"),type:eL.G.Toggle,onClick:()=>{i("chargeOrganizationFee",!s.chargeOrganizationFee)},disabled:!(0,X.Kb)(null==s?void 0:s.groups),isActive:null==s?void 0:s.chargeOrganizationFee,tooltipMessage:t("events:settings.eventOrganizerFee.tooltip"),disabledTooltipMessage:t("events:settings.eventOrganizerFee.disabledTooltip")}):null},eV=s(56697),e$=s(3855),settings_DangerZone=e=>{let{eventId:t,navigateToSeriesSettings:s}=e,{t:i}=(0,C.$G)(["events"]),[n,r]=(0,w.useState)(!1),a=(0,N.useRouter)(),l=(0,D.uW)(),{data:o}=(0,D.Q3)(t),{setFieldValue:d}=(0,y.u6)(),toggleSeriesWarningModal=()=>{r(e=>!e)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"mt-6",children:[(0,b.jsx)("h3",{className:"font-semibold text-lg",children:i("events:dangerZone.title")}),(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-5 border-1 border-red-700 rounded-lg mt-4 bg-red-50",children:[(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)(e_.hME,{size:24}),(0,b.jsx)("span",{className:"ml-2 text-base",children:i("events:dangerZone.deleteEvent")})]}),(0,b.jsx)("button",{type:"button",className:"text-base text-red-700 font-bold cursor-pointer",onClick:()=>{o.seriesId?toggleSeriesWarningModal():eV.Z.confirm({title:i("events:dangerZone.deleteEvent"),icon:(0,b.jsx)(e$.default,{}),content:i("events:dangerZone.deleteEventConfirmation"),centered:!0,okText:i("events:dangerZone.yes"),okType:"danger",cancelText:i("events:dangerZone.no"),onOk(){l.mutate(t,{onSuccess:()=>{(0,E.XH)()?(0,E.mG)(A.jj):a.push("/host")}})}})},children:i("events:dangerZone.deleteButton")})]})]}),(0,b.jsx)(G.Z,{visible:n,onClose:toggleSeriesWarningModal,type:G.w.SMALL,autoHeight:!0,title:i("events:dangerZone.seriesModal.title"),icon:(0,b.jsx)("div",{className:"bg-red-100 flex-1 h-full flex items-center justify-center text-red-800",children:(0,b.jsx)(e_.iUH,{size:20})}),children:(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsx)("p",{className:"text-base font-normal text-neutral-600",children:i("events:dangerZone.seriesModal.description")}),(0,b.jsxs)("div",{className:"flex gap-4 pt-8 pb-4",children:[(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:s,newRadius:!0,children:i("events:dangerZone.seriesModal.updateSettings")}),(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:()=>{d("private",!0),toggleSeriesWarningModal()},newRadius:!0,children:i("events:dangerZone.seriesModal.setToPrivate")})]}),(0,b.jsx)(V.ZP,{type:V.L$.Inverted,onClick:toggleSeriesWarningModal,newRadius:!0,children:i("events:dangerZone.seriesModal.cancel")})]})})]})};let eH=j.Ry().shape({metaPixelId:j.Z_()});var settings_MetaPixelModal=e=>{let{initialValues:t,onClose:s,onSave:i}=e,{t:n}=(0,C.$G)(["events"]);return(0,b.jsx)(y.J9,{initialValues:t,onSubmit:e=>{i(e.metaPixelId),s()},enableReinitialize:!0,validationSchema:eH,children:e=>{let{submitForm:t}=e;return(0,b.jsxs)(G.Z,{type:G.w.SMALL,onClose:s,autoHeight:!0,visible:!0,icon:(0,b.jsx)(eA.pnU,{size:20}),title:n("events:settings.metaPixel.modal.title"),renderFooter:()=>(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:t,children:n("events:settings.metaPixel.modal.saveButton")}),children:[(0,b.jsx)("p",{className:"px-6 pt-6 text-base font-normal",children:n("events:settings.metaPixel.modal.description")}),(0,b.jsx)("div",{className:"px-4 pt-6",children:(0,b.jsx)(eZ.Z,{type:"text",label:n("events:settings.metaPixel.modal.pixelIdLabel"),id:"metaPixelId",name:"metaPixelId",clearable:!0,placeholder:n("events:settings.metaPixel.modal.pixelIdPlaceholder")})})]})}})},settings_MetaPixelSettings=()=>{let{t:e}=(0,C.$G)(["events"]),{values:t,setFieldValue:s}=(0,y.u6)(),[i,n]=(0,w.useState)(!1),toggleMetaPixelModal=()=>{n(e=>!e)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eL.Z,{icon:(0,b.jsx)(eA.pnU,{size:20}),title:e("events:settings.metaPixel.title"),actionLabel:e("events:settings.metaPixel.actionLabel"),onClick:toggleMetaPixelModal,value:null==t?void 0:t.metaPixelId,type:eL.G.Button}),i&&(0,b.jsx)(settings_MetaPixelModal,{onClose:toggleMetaPixelModal,onSave:e=>{s("metaPixelId",e)},initialValues:{metaPixelId:(null==t?void 0:t.metaPixelId)||""}})]})},settings_MaxCapacityModal=e=>{let{initialValues:t,onClose:s,onSave:i}=e,{t:n}=(0,C.$G)(["events"]),r=j.Ry().shape({maxCapacity:j.Z_().required("Required field").matches(/^\d+$/,"Must be a valid number").test("min","must be greater than or equal to 1",e=>!e||parseInt(e,10)>=1)});return(0,b.jsx)(y.J9,{initialValues:{maxCapacity:t.maxCapacity.toString()},onSubmit:e=>{i(parseInt(e.maxCapacity,10)),s()},enableReinitialize:!0,validationSchema:r,children:e=>{let{submitForm:t}=e;return(0,b.jsx)(G.Z,{type:G.w.SMALL,onClose:s,autoHeight:!0,visible:!0,icon:(0,b.jsx)(z.J8I,{size:20}),title:n("events:settings.maxCapacity.modal.title"),renderFooter:()=>(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:t,children:n("events:settings.maxCapacity.modal.saveButton")}),children:(0,b.jsx)("div",{className:"px-4 pt-6",children:(0,b.jsx)(eZ.Z,{type:"text",label:n("events:settings.maxCapacity.modal.maxCapacityLabel"),id:"maxCapacity",name:"maxCapacity",clearable:!0,placeholder:n("events:settings.maxCapacity.modal.maxCapacityPlaceholder")})})})}})}
1,settings_MaxCapacitySettings=()=>{let{t:e}=(0,C.$G)(["events"]),{values:t,setFieldValue:s}=(0,y.u6)(),[i,n]=(0,w.useState)(!1),toggleMaxCapacityModal=()=>{n(e=>!e)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eL.Z,{icon:(0,b.jsx)(z.J8I,{size:20}),title:e("events:settings.maxCapacity.title"),actionLabel:e("events:settings.maxCapacity.actionLabel"),value:null==t?void 0:t.maxCapacity,onClick:toggleMaxCapacityModal,tooltipMessage:e("events:settings.maxCapacity.tooltip"),type:eL.G.Button}),i&&(0,b.jsx)(settings_MaxCapacityModal,{onClose:toggleMaxCapacityModal,onSave:e=>{s("maxCapacity",e)},initialValues:{maxCapacity:(null==t?void 0:t.maxCapacity)||""}})]})},settings_OffersSettings=e=>{let{navigateToOffers:t,eventId:s,setOffersStep:i}=e,{t:n}=(0,C.$G)(["events"]),r=(0,Z.Vb)(),{data:a}=(0,D.Wf)(s,{enabled:!!s});if((0,w.useEffect)(()=>{var e;(null==a?void 0:null===(e=a.offers)||void 0===e?void 0:e.length)?i(x.OFFERS_LIST):i(x.CREATE_OFFER)},[a]),r[q.h.ENABLE_PROMOTER_OFFERS]){var l,o;return(0,b.jsx)(eL.Z,{icon:(0,b.jsx)("img",{src:"/img/events/create/offer.svg",height:16,width:16}),title:n("events:settings.promoterOffers.title"),actionLabel:n("events:settings.promoterOffers.actionLabel"),onClick:t,tooltipMessage:n("events:settings.promoterOffers.tooltip"),value:(null==a?void 0:null===(l=a.offers)||void 0===l?void 0:l.length)?n("events:settings.promoterOffers.totalCount",{count:null==a?void 0:null===(o=a.offers)||void 0===o?void 0:o.length}):"",type:eL.G.Button})}return null},create_event_EventSettings=()=>{let{t:e}=(0,C.$G)(["events"]),{eventId:t,navigateToTrackingLinks:s,navigateToDiscountCodes:i,navigateToSeriesSettings:n,navigateToOffersPage:r,refetchEvent:a,createDraft:l,setOffersStep:o,isDraft:d,isEditing:c,isLoading:u,lastUpdated:m,handleBack:x,navigateToEventSettings:p,navigateToPrePurchaseQuestions:v}=useEventEditorContext();return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:d,isEditing:c,title:e("events:settings.title"),isLoading:u,lastUpdated:m,onBack:x,onMenuClick:p}),(0,b.jsx)(ee.Z,{children:(0,b.jsxs)("div",{className:"pt-[90px] md:pt-[180px] -mt-[90px] pb-20 md:w-[630px] md:mx-auto px-4 ",onClick:async()=>{t||await l()},children:[(0,b.jsx)("h3",{className:"text-lg font-semibold",children:e("events:settings.guest")}),(0,b.jsx)(settings_WaiverSetting,{refetchEvent:a}),(0,b.jsx)(settings_GuestQuestionSetting,{navigateToPrePurchaseQuestions:v}),(0,b.jsx)("h3",{className:"mt-6 text-lg font-semibold",children:e("events:settings.analytics")}),(0,b.jsx)(settings_TrackingLinksSettings,{eventId:t,navigateToTrackingLinks:s}),(0,b.jsx)(settings_DiscountCodesSettings,{eventId:t,navigateToDiscountCodes:i}),(0,b.jsx)(settings_OffersSettings,{eventId:t,navigateToOffers:r,setOffersStep:o}),(0,b.jsx)(settings_MetaPixelSettings,{}),(0,b.jsx)("h3",{className:"mt-6 text-lg font-semibold",children:e("events:settings.advancedOptions")}),(0,b.jsx)(settings_MaxTicketsSettings,{}),(0,b.jsx)(settings_MaxCapacitySettings,{}),(0,b.jsx)(settings_TaxSettings,{}),(0,b.jsx)(EventOrganizerfee,{}),(0,b.jsx)(settings_MomentSettings,{}),t&&(0,b.jsx)(settings_DangerZone,{eventId:t,navigateToSeriesSettings:n})]})})]})},eW=s(86034),eQ=s(18446),eY=s.n(eQ),eK=s(88767),eX=s(17608),hooks_useManageProducts=e=>{let t=(0,eK.useQueryClient)(),{data:s,isLoading:i}=(0,eX.UG)({eventId:e}),[n,r]=(0,w.useState)([]),[a,l]=(0,w.useState)([]),[o,d]=(0,w.useState)(null),[c,u]=(0,w.useState)(null),m=(0,w.useRef)(!1),x=(0,eX.z)(),p=(0,eX.bk)(),v=(0,eX.G7)(),g=(0,eX.uZ)(),f=(0,eX.cx)(),h=(0,eX.vo)();(0,w.useEffect)(()=>{(null==s?void 0:s.items)&&!eY()(n,s.items)&&!m.current&&r(s.items),(null==s?void 0:s.sections)&&!eY()(a,s.sections)&&l(s.sections)},[s]);let b=(0,w.useCallback)(()=>{t.setQueryData(["eventProducts",{eventId:e}],{items:n,sections:a})},[e,t,n,a]),j=(0,w.useCallback)(()=>{b(),t.invalidateQueries(["eventProducts",{eventId:e}])},[e,t,b]),y=(0,w.useCallback)((t,s)=>(x.mutate({eventId:e,product:t},{onSuccess:e=>{var t;r(t=>[...t,e]),j(),null==s||null===(t=s.onSuccess)||void 0===t||t.call(s,e)},onError:e=>{var t;null==s||null===(t=s.onError)||void 0===t||t.call(s,e)}}),null),[x,e,j]),N=(0,w.useCallback)((t,s)=>(p.mutate({eventId:e,product:t},{onSuccess:e=>{var t;r(t=>[...t,e]),j(),null==s||null===(t=s.onSuccess)||void 0===t||t.call(s,e)},onError:e=>{var t;null==s||null===(t=s.onError)||void 0===t||t.call(s,e)}}),null),[p,e,j]),C=(0,w.useCallback)((t,s,i)=>{let a=n.find(e=>e.id===t);return a?(v.mutate({eventId:e,productId:t,product:s},{onSuccess:e=>{var s;r(s=>s.map(s=>s.id===t?e:s)),j(),null==i||null===(s=i.onSuccess)||void 0===s||s.call(i,e)},onError:e=>{var t;null==i||null===(t=i.onError)||void 0===t||t.call(i,e)}}),a):null},[v,e,j,n]),k=(0,w.useCallback)((t,s,i)=>{let a=n.find(e=>e.id===t);return a?(g.mutate({eventId:e,productId:t,product:s},{onSuccess:e=>{var s;r(s=>s.map(s=>s.id===t?e:s)),j(),null==i||null===(s=i.onSuccess)||void 0===s||s.call(i,e)},onError:e=>{var t;null==i||null===(t=i.onError)||void 0===t||t.call(i,e)}}),a):null},[g,e,j,n]),S=(0,w.useCallback)((t,s)=>{let i=n.find(e=>e.id===t);return!!i&&"bundle"!==i.type&&(f.mutate({eventId:e,productId:t},{onSuccess:()=>{var e;r(e=>e.filter(e=>e.id!==t)),j(),null==s||null===(e=s.onSuccess)||void 0===e||e.call(s)},onError:e=>{var t;null==s||null===(t=s.onError)||void 0===t||t.call(s,e)}}),!0)},[f,e,j,n]),T=(0,w.useCallback)((t,s)=>{let i=n.find(e=>e.id===t);return!!i&&"bundle"===i.type&&(f.mutate({eventId:e,productId:t},{onSuccess:()=>{var e;r(e=>e.filter(e=>e.id!==t)),j(),null==s||null===(e=s.onSuccess)||void 0===e||e.call(s)},onError:e=>{var t;null==s||null===(t=s.onError)||void 0===t||t.call(s,e)}}),!0)},[f,e,j,n]),_=(0,w.useCallback)((t,s,i)=>{var a,l,o,d,c;let u=n.find(e=>e.id===t);if(!u||"bundle"===u.type)return null;let m={name:u.name,description:u.description,price:u.price,isPrivate:u.isPrivate,isActive:s,isVisible:u.isVisible,imageUrl:u.imageUrl,startDate:u.startDate,endD
1ate:u.endDate,maxQuantity:u.maxQuantity,purchaseRequirements:{requiresApproval:(null===(a=u.purchaseRequirements)||void 0===a?void 0:a.requiresApproval)||!1,questions:(null===(o=u.purchaseRequirements)||void 0===o?void 0:null===(l=o.questions)||void 0===l?void 0:l.map(e=>({id:e.id,question:e.question})))||[],requiredOrganizationIds:(null===(d=u.purchaseRequirements)||void 0===d?void 0:d.requiredOrganizationIds)||[],requiredAssociationIds:(null===(c=u.purchaseRequirements)||void 0===c?void 0:c.requiredAssociationIds)||[]}};return v.mutate({eventId:e,productId:t,product:m},{onSuccess:e=>{var s;r(s=>s.map(s=>s.id===t?e:s)),j(),null==i||null===(s=i.onSuccess)||void 0===s||s.call(i)},onError:e=>{var t;null==i||null===(t=i.onError)||void 0===t||t.call(i,e)}}),u},[n,v,e,j]),I=(0,w.useCallback)((t,s,i)=>{let a=n.find(e=>e.id===t);if(!a||"bundle"!==a.type)return null;let l={name:a.name,description:a.description,price:a.price,isPrivate:a.isPrivate,isActive:s,imageUrl:a.imageUrl,startDate:a.startDate,endDate:a.endDate,components:a.components||[],isVisible:a.isVisible};return g.mutate({eventId:e,productId:t,product:l},{onSuccess:e=>{var s;r(s=>s.map(s=>s.id===t?e:s)),j(),null==i||null===(s=i.onSuccess)||void 0===s||s.call(i)},onError:e=>{var t;null==i||null===(t=i.onError)||void 0===t||t.call(i,e)}}),a},[n,g,e,j]),P=(0,w.useCallback)((t,s)=>{var i,a,l,o,d;let c=n.find(e=>e.id===t);if(!c||"bundle"===c.type)return null;let u={name:c.name,description:c.description,price:c.price,isPrivate:c.isPrivate,isActive:c.isActive,isVisible:!c.isVisible,imageUrl:c.imageUrl,startDate:c.startDate,endDate:c.endDate,maxQuantity:c.maxQuantity,purchaseRequirements:{requiresApproval:(null===(i=c.purchaseRequirements)||void 0===i?void 0:i.requiresApproval)||!1,questions:(null===(l=c.purchaseRequirements)||void 0===l?void 0:null===(a=l.questions)||void 0===a?void 0:a.map(e=>({id:e.id,question:e.question})))||[],requiredOrganizationIds:(null===(o=c.purchaseRequirements)||void 0===o?void 0:o.requiredOrganizationIds)||[],requiredAssociationIds:(null===(d=c.purchaseRequirements)||void 0===d?void 0:d.requiredAssociationIds)||[]}};return v.mutate({eventId:e,productId:t,product:u},{onSuccess:e=>{var i;r(s=>s.map(s=>s.id===t?e:s)),j(),null==s||null===(i=s.onSuccess)||void 0===i||i.call(s)},onError:e=>{var t;null==s||null===(t=s.onError)||void 0===t||t.call(s,e)}}),c},[n,v,e,j]),F=(0,w.useCallback)((t,s)=>{let i=n.find(e=>e.id===t);if(!i||"bundle"!==i.type)return null;let a={name:i.name,description:i.description,price:i.price,isPrivate:i.isPrivate,isActive:i.isActive,imageUrl:i.imageUrl,startDate:i.startDate,endDate:i.endDate,components:i.components||[],isVisible:!i.isVisible};return g.mutate({eventId:e,productId:t,product:a},{onSuccess:e=>{var i;r(s=>s.map(s=>s.id===t?e:s)),j(),null==s||null===(i=s.onSuccess)||void 0===i||i.call(s)},onError:e=>{var t;null==s||null===(t=s.onError)||void 0===t||t.call(s,e)}}),i},[n,g,e,j]),D=(0,w.useCallback)((t,s,i)=>(m.current=!0,x.mutate({eventId:e,product:s},{onSuccess:s=>{let r=n.filter(e=>(e.sectionId||"default")===(t||"default")),l=r.length>0?Math.max(...r.map(e=>e.sortIndex||0))+1:0,o=n.map(e=>
1({productId:e.id,sortIndex:e.sortIndex||0,sectionId:e.sectionId}));o.push({productId:s.id,sortIndex:l,sectionId:"default"===t?void 0:t});let d={products:o,sections:a.map(e=>({id:e.id,sortIndex:e.sortIndex||0}))};h.mutate({eventId:e,data:d},{onSuccess:()=>{var e;m.current=!1,j(),null==i||null===(e=i.onSuccess)||void 0===e||e.call(i,s)},onError:e=>{var t;m.current=!1,null==i||null===(t=i.onError)||void 0===t||t.call(i,e)}})},onError:e=>{var t;m.current=!1,null==i||null===(t=i.onError)||void 0===t||t.call(i,e)}}),null),[x,n,a,h,e,j]),O=(0,w.useCallback)((t,s,i)=>(m.current=!0,p.mutate({eventId:e,product:s},{onSuccess:s=>{let r=n.filter(e=>(e.sectionId||"default")===(t||"default")),l=r.length>0?Math.max(...r.map(e=>e.sortIndex||0))+1:0,o=n.map(e=>({productId:e.id,sortIndex:e.sortIndex||0,sectionId:e.sectionId}));o.push({productId:s.id,sortIndex:l,sectionId:"default"===t?void 0:t});let d={products:o,sections:a.map(e=>({id:e.id,sortIndex:e.sortIndex||0}))};h.mutate({eventId:e,data:d},{onSuccess:()=>{var e;m.current=!1,j(),null==i||null===(e=i.onSuccess)||void 0===e||e.call(i,s)},onError:e=>{var t;m.current=!1,null==i||null===(t=i.onError)||void 0===t||t.call(i,e)}})},onError:e=>{var t;m.current=!1,null==i||null===(t=i.onError)||void 0===t||t.call(i,e)}}),null),[p,n,a,h,e,j]),E=(0,w.useCallback)((t,s,i)=>{let n=[],a=[];return r(e=>(n=[...e],e.map(e=>{let s=t.find(t=>t.productId===e.id);return s?{...e,sortIndex:s.sortIndex,sectionId:s.sectionId}:e}))),l(e=>(a=[...e],e.map(e=>{let t=s.find(t=>t.id===e.id);return t?{...e,sortIndex:t.sortIndex}:e}))),h.mutate({eventId:e,data:{products:t,sections:s}},{onSuccess:()=>{var e;null==i||null===(e=i.onSuccess)||void 0===e||e.call(i)},onError:e=>{var t;r(n),l(a),null==i||null===(t=i.onError)||void 0===t||t.call(i,e)}}),!0},[h,e,j]),A=(0,w.useCallback)((t,s)=>{let i=[],o=[],d=n.filter(e=>void 0===e.sectionId).map((e,t)=>({...e,sortIndex:t})),c=n.filter(e=>e.sectionId===t).map((e,t)=>({...e,sortIndex:d.length+t})),u=[...d,...c].map(e=>
1({productId:e.id,sortIndex:e.sortIndex||0,sectionId:e.sectionId===t?void 0:e.sectionId})),m=a.filter(e=>e.id!==t).map(e=>({id:e.id,sortIndex:e.sortIndex||0}));return r(e=>(i=[...e],e.map(e=>e.sectionId===t?{...e,sectionId:void 0}:e))),l(e=>(o=[...e],e.filter(e=>e.id!==t))),h.mutate({eventId:e,data:{products:u,sections:m}},{onSuccess:()=>{var e;null==s||null===(e=s.onSuccess)||void 0===e||e.call(s,c)},onError:e=>{var t;r(i),l(o),null==s||null===(t=s.onError)||void 0===t||t.call(s,e)}}),!0},[n,a,h,e,j]),R=null==n?void 0:n.sort((e,t)=>e.isPrivate===t.isPrivate?0:e.isPrivate?1:-1),M=R.filter(e=>!e.isPrivate),L=R.filter(e=>e.isPrivate);return{products:n,sections:a,publicProducts:M,privateProducts:L,sortedProducts:R,selectedProduct:c,selectedIndex:o,isLoading:i,setSelectedProduct:u,setSelectedIndex:d,addStandardProduct:y,addBundleProduct:N,updateStandardProduct:C,updateBundleProduct:k,deleteStandardProduct:S,deleteBundleProduct:T,toggleStandardProductActive:_,toggleBundleProductActive:I,toggleStandardProductVisibility:P,toggleBundleProductVisibility:F,addStandardProductToSection:D,addBundleProductToSection:O,reorderProducts:E,deleteSection:A,invalidateProductQueries:j}};let eJ="animate-highlight",useTicketHighlight=()=>{let e=(0,w.useRef)(null),t=(0,w.useRef)(null),s=(0,w.useRef)(null);(0,w.useEffect)(()=>()=>{e.current&&clearTimeout(e.current),t.current&&clearTimeout(t.current),s.current&&s.current.classList.remove(eJ)},[]);let clearHighlight=()=>{e.current&&(clearTimeout(e.current),e.current=null),s.current&&(s.current.classList.remove(eJ),s.current=null)},highlightTicket=function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3;clearHighlight();let n=document.querySelector('[data-ticket-id="'.concat(t,'"]'));n&&(n.classList.add(eJ),s.current=n,e.current=setTimeout(()=>{n.classList.remove(eJ),s.current=null,e.current=null},i))},scrollToTicket=e=>{let t=document.querySelector('[data-ticket-id="'.concat(e,'"]'));return!!t&&(window.scrollTo({top:t.getBoundingClientRect().top+window.pageYOffset-200,behavior:"smooth"}),!0)};return{scrollToRecentlyModifiedProduct:e=>{e&&(t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{let s=scrollToTicket(e);s&&setTimeout(()=>{highlightTicket(e)},500),t.current=null},400))},highlightTickets:t=>{clearHighlight();let i=t.map(e=>document.querySelector('[data-ticket-id="'.concat(e,'"]'))).filter(Boolean);0!==i.length&&(i.forEach(e=>{e.classList.add(eJ)}),e.current=setTimeout(()=>{i.forEach(e=>{e.classList.remove(eJ)}),s.current=null,e.current=null},2e3),s.current=i[0])}}};var e0=s(28627),e1=s(55788),e2=s(75810),e5=s(73466),components_PrivateTicketInfo=e=>{let{ticket:t,shareUrl:s}=e,{t:i}=(0,C.$G)(["events"]),n=(0,w.useCallback)(e=>{e.stopPropagation(),(0,e5.v)(t.shareToken),T.CF({type:"success",message:i("events:pricingTiers.toastMessages.privateCodeCopied")})},[t.shareToken]),r=(0,w.useCallback)(e=>{e.stopPropagation(),(0,e5.v)(s),T.CF({type:"success",message:i("events:pricingTiers.toastMessages.unlockUrlCopied")})},[s]);return t.isPrivate?(0,b.jsxs)("div",{className:"flex mt-4 font-semibold text-gray-500",children:[(0,b.jsxs)("div",{className:"mr-2 flex items-center",onClick:n,children:[(0,b.jsxs)("span",{children:[i("events:pricingTiers.tierManagement.privateCode"),": ",t.shareToken]}),(0,b.jsx)("div",{className:"px-2",children:(0,b.jsx)(z.Fqs,{size:16,className:"text-primary-600"})})]}),(0,b.jsxs)("div",{className:"flex items-center",onClick:r,children:[(0,b.jsx)("span",{children:i("events:pricingTiers.tierManagement.unlockUrl")}),(0,b.jsx)("div",{className:"px-2",children:(0,b.jsx)(z.Fqs,{size:16,className:"text-primary-600"})})]})]}):null},components_TicketStats=e=>{let{tierScansData:t,maxAttendance:s,requiresApproval:i,questions:n,testId:r,purchases:a}=e,{t:l}=(0,C.$G)(["events"]);return(0,b.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,b.jsxs)("div",{className:"flex items-center text-[#575757] mr-4 text-sm",children:[(0,b.jsx)("span",{className:"mr-1",children:"\uD83C\uDF9F"}),(0,b.jsx)("span",{children:a||0}),"number"==typeof s&&s>
10&&(0,b.jsxs)("span",{"data-testid":"".concat(r,"-maxAttendance"),children:["/",s]}),(0,b.jsx)("span",{className:"ml-1",children:l("events:pricingTiers.tierManagement.soldLabel")})]}),(0,b.jsxs)("div",{className:"flex items-center text-[#575757] mr-4 text-sm",children:[(0,b.jsx)("span",{className:"mr-1",children:(0,b.jsx)("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("path",{d:"M0.666016 12V8.66667H1.99935V10.6667H3.99935V12H0.666016ZM11.9993 12V10.6667H13.9993V8.66667H15.3327V12H11.9993ZM2.66602 10V2H3.99935V10H2.66602ZM4.66602 10V2H5.33268V10H4.66602ZM6.66602 10V2H7.99935V10H6.66602ZM8.66602 10V2H10.666V10H8.66602ZM11.3327 10V2H11.9993V10H11.3327ZM12.666 10V2H13.3327V10H12.666ZM0.666016 3.33333V0H3.99935V1.33333H1.99935V3.33333H0.666016ZM13.9993 3.33333V1.33333H11.9993V0H15.3327V3.33333H13.9993Z",fill:"#575757"})})}),(0,b.jsx)("span",{children:(null==t?void 0:t.ticketsScanned)||0}),(0,b.jsx)("span",{className:"ml-1",children:l("events:pricingTiers.tierManagement.scannedLabel")})]}),i&&(0,b.jsxs)("div",{className:"text-sm text-[#575757]",children:["\uD83D\uDC4D ",l("events:pricingTiers.tierManagement.requiresApproval")," ",(null==n?void 0:n.length)>0&&"(".concat(n.length," q's)")]})]})},icons_PauseIcon=e=>{let{className:t=""}=e;return(0,b.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,b.jsx)("path",{d:"M0 14H4V0H0V14ZM8 0V14H12V0H8Z",fill:"#202020"})})},icons_HideIcon=e=>{let{className:t=""}=e;return(0,b.jsx)("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:(0,b.jsx)("path",{d:"M11 3.97505C14.79 3.97505 18.17 6.10505 19.82 9.47505C19.23 10.695 18.4 11.745 17.41 12.595L18.82 14.005C20.21 12.775 21.31 11.235 22 9.47505C20.27 5.08505 16 1.97505 11 1.97505C9.73 1.97505 8.51 2.17505 7.36 2.54505L9.01 4.19505C9.66 4.06505 10.32 3.97505 11 3.97505ZM9.93 5.11505L12 7.18505C12.57 7.43505 13.03 7.89505 13.28 8.46505L15.35 10.535C15.43 10.195 15.49 9.83505 15.49 9.46505C15.5 6.98505 13.48 4.97505 11 4.97505C10.63 4.97505 10.28 5.02505 9.93 5.11505ZM1.01 1.84505L3.69 4.52505C2.06 5.80505 0.77 7.50505 0 9.47505C1.73 13.865 6 16.975 11 16.975C12.52 16.975 13.98 16.685 15.32 16.155L18.74 19.575L20.15 18.165L2.42 0.425049L1.01 1.84505ZM8.51 9.34505L11.12 11.955C11.08 11.965 11.04 11.975 11 11.975C9.62 11.975 8.5 10.855 8.5 9.47505C8.5 9.42505 8.51 9.39505 8.51 9.34505ZM5.11 5.94505L6.86 7.69505C6.63 8.24505 6.5 8.84505 6.5 9.47505C6.5 11.955 8.52 13.975 11 13.975C11.63 13.975 12.23 13.845 12.77 13.615L13.75 14.595C12.87 14.835 11.95 14.975 11 14.975C7.21 14.975 3.83 12.845 2.18 9.47505C2.88 8.04505 3.9 6.86505 5.11 5.94505Z",fill:"#202020"})})},components_TicketToggles=e=>{let{ticket:t,toggleTicketTier:s,toggleHideTier:i}=e,{t:n}=(0,C.$G)(["events"]),r=(0,w.useCallback)(e=>{if(e.stopPropagation(),!(null==t?void 0:t.isActive)){s(!1);return}s(!0)},[null==t?void 0:t.isActive,s]),a=(0,w.useCallback)(e=>{e.stopPropagation(),i()},[i]);return(0,b.jsxs)("div",{className:"mt-4 flex flex-col gap-3",children:[(0,b.jsxs)("div",{className:"flex flex-row justify-between",children:[(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)(icons_PauseIcon,{}),(0,b.jsx)("span",{className:"text-sm text-[#202020]",children:n("events:pricingTiers.tierManagement.pauseTierSales")})]}),(0,b.jsx)("div",{className:"ml-2",children:(0,b.jsx)(B.Z,{isActive:!(null==t?void 0:t.isActive),onClick:r})})]}),(0,b.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex -ml-1 gap-2",children:[(0,b.jsx)(icons_HideIcon,{}),(0,b.jsx)("span",{className:"text-sm text-[#202020]",children:n("events:pricingTiers.tierManagement.hideTierFromPurchasers")})]}),(0,b.jsx)("div",{className:"ml-2",children:(0,b.jsx)(B.Z,{isActive:!(null==t?void 0:t.isVisible),onClick:a})})]})]})},e4=s(17563),e3=s(32420);let useShareUrl=(e,t,s)=>(0,w.useMemo)(()=>{if(!e||!s)return"";let i=e4.stringify({tierShareToken:s,invite:t});return"".concat(e3.Z.SITE_URL,"events/").concat(e,"?").concat(i)},[e,t,s]);var components_Ticket=e=>{var t,s;let{eventId:i,eventShareToken:n,ticket:r,testId:a,onClick:l,toggleTicketTier:o,isSortable:d,toggleHideTier:c,tierScansData:u}=e,m=(0,w.useRef)(null),x=useShareUrl(i,n,r.shareToken);return(0,b.jsx)("div",{onClick:l,"data-testid":a,ref:m,children:(0,b.jsx)("div",{className:ei()("relative w-full max-w-[550
1px]",{"opacity-60":!r.isActive}),children:(0,b.jsxs)("div",{className:ei()("w-full flex justify-between relative cursor-pointer border-1 rounded-2xl p-4 border-gray-200 hover:border-gray-500"),children:[d&&(0,b.jsx)("div",{className:"absolute top-5 right-4",children:(0,b.jsx)(e1.GZz,{size:25,className:"cursor-grab text-[#787878]"})}),(0,b.jsxs)("div",{className:"w-full",children:[(0,b.jsx)("div",{className:"flex items-center w-[85%]",children:(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-start font-normal text-base text-[#202020]",children:[r.isPrivate&&(0,b.jsx)("span",{"data-testid":"".concat(a,"-lock-icon"),children:(0,b.jsx)(z.ppH,{size:20,className:"mr-1"})}),(0,b.jsx)("span",{"data-testid":"".concat(a,"-name"),children:r.name})]}),(0,b.jsx)("div",{className:"text-base font-bold text-[#202020]",children:(0,e2.O)(r.price)})]})}),(0,b.jsx)(components_PrivateTicketInfo,{ticket:r,shareUrl:x}),r.description&&(0,b.jsx)("div",{"data-testid":"".concat(a,"-description"),className:"text-[#575757] text-base font-normal mt-4",children:r.description}),(0,b.jsx)("div",{className:"mt-4 w-full border-t border-[#EBEBEB]"}),(0,b.jsx)(components_TicketStats,{tierScansData:u,purchases:r.purchases,maxAttendance:r.maxQuantity,requiresApproval:null===(t=r.purchaseRequirements)||void 0===t?void 0:t.requiresApproval,questions:null===(s=r.purchaseRequirements)||void 0===s?void 0:s.questions,testId:a}),(0,b.jsx)("div",{className:"mt-4 w-full border-t border-[#EBEBEB]"}),(0,b.jsx)(components_TicketToggles,{ticket:r,toggleTicketTier:o,toggleHideTier:c})]})]})})})},components_Tickets=e=>{let{eventId:t,eventShareToken:s,tickets:i,isSortable:n,toggleTicketTier:r,toggleHideTier:a,setSelectedIndex:l,setSelectedTicket:o,sectionId:d}=e,{t:c}=(0,C.$G)(["events"]),{tierScansData:u}=useEventEditorContext(),m=(0,w.useMemo)(()=>i.sort((e,t)=>e.sortIndex-t.sortIndex),[i]);return n?(0,b.jsx)("div",{className:"bg-white",children:(0,b.jsx)(e0.bK,{droppableId:d,type:"tiers",children:(e,i)=>(0,b.jsxs)("div",{className:ei()("mx-2 my-6 py-2 max-w-[550px] rounded-2xl border-2 border-dashed border-transparent bg-[#FDFDFD] transition-all duration-200 ease-in",{"bg-[#EFF2FF]! border-[#6585FF]!":i.isDraggingOver}),ref:e.innerRef,"data-rfd-droppable-context-id":e.droppableProps["data-rfd-droppable-context-id"],"data-rfd-droppable-id":e.droppableProps["data-rfd-droppable-id"],children:[(0,b.jsx)("div",{className:"flex flex-col gap-4",children:m.map((e,d)=>(0,b.jsx)(e0._l,{index:d,draggableId:e.id,children:(d,c)=>{var m;return(0,b.jsx)("div",{ref:d.innerRef,"data-ticket-id":e.id,...d.draggableProps,...d.dragHandleProps,className:ei()("relative transition-[margin] p-0 duration-200 ease-in",{"bg-white rounded-2xl shadow-[-3px_14px_19.3px_0px_rgba(32,32,32,0.1) border-2 border-[#6585FF]":c.isDragging,"bg-white rounded-2xl":!c.isDragging,"mx-2!":i.isDraggingOver&&!c.draggingOver}),children:(0,b.jsx)(components_Ticket,{eventId:t,eventShareToken:s,ticket:e,tierScansData:null==u?void 0:null===(m=u.data)||void 0===m?void 0:m.find(t=>t.tierId===e.id),toggleTicketTier:t=>{r(e.id,t)},toggleHideTier:()=>a((null==e?void 0:e._id)||e.id),onClick:()=>{o(e),l(e.id)},isSortable:n})})}},e.id))}),(null==m?void 0:m.length)===0?(0,b.jsx)("div",{className:ei()("flex items-center justify-center py-32 -my-2 border-2 border-dashed rounded-2xl bg-[#FDFDFD] transition-colors duration-200 ease-in",{"bg-[#EFF2FF]! border-transparent":i.isDraggingOver}),children:(0,b.jsx)("p",{className:"text-[#575757]",children:c("events:pricingTiers.categories.dragAndDropTiers")})}):e.placeholder]})})}):(0,b.jsx)("div",{className:"w-full py-6 pb-10",children:(0,b.jsx)("div",{className:"flex flex-col gap-4",children:m.map(e=>(0,b.jsx)("div",{"data-ticket-id":e.id,children:(0,b.jsx)(components_Ticket,{eventId:t,eventShareToken:s,ticket:e,toggleTicketTier:t=>{r(e.id,t)},onClick:()=>{o(e),l(e.id)},isSortable:n,toggleHideTier:()=>a((null==e?void 0:e._id)||e.id)})},e.id))})})};let feesLabel=(e,t,s)=>{let i=e||10,[n,r]=[(0,e2.O)(parseFloat(t?i:1.029*i+1.3)),(0,e2.O)(parseFloat(t?.971*i-1.3:i))];return s("events:pricingTiers.feeExample",{amount:(0,e2.O)(i),guestAmount:n,hostAmou
1nt:r})},FeesPaidBy_Button=e=>{let{label:t,isActive:s,onClick:i,isDisabled:n}=e;return(0,b.jsx)("div",{className:ei()("w-full text-center text-base font-semibold rounded-md py-2 cursor-pointer",{"bg-white":s},n&&"cursor-not-allowed text-neutral-500"),onClick:i,children:t})};var components_FeesPaidBy=()=>{var e,t,s,i,n;let{t:r}=(0,C.$G)(["events"]),{values:a,setFieldValue:l}=(0,y.u6)(),o=(null==a?void 0:null===(e=a.pricing)||void 0===e?void 0:e.tiers)||[],d=(null==a?void 0:null===(t=a.pricing)||void 0===t?void 0:t.transactionFeesPaidBy)==="host",c=(0,w.useMemo)(()=>o.find(e=>e.price>0),[o]),u=null!==(n=null==c?void 0:c.price)&&void 0!==n?n:0;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"w-full p-[6px] bg-gray-200 rounded-lg flex items-center justify-between",children:[(0,b.jsx)(FeesPaidBy_Button,{label:r("events:pricingTiers.feesPaidBy.guestPaysFees"),isDisabled:!(null==a?void 0:a.isDraft),isActive:(null==a?void 0:null===(s=a.pricing)||void 0===s?void 0:s.transactionFeesPaidBy)==="guest",onClick:()=>{(null==a?void 0:a.isDraft)&&l("pricing.transactionFeesPaidBy","guest")}}),(0,b.jsx)(FeesPaidBy_Button,{label:r("events:pricingTiers.feesPaidBy.hostPaysFees"),isDisabled:!(null==a?void 0:a.isDraft),isActive:(null==a?void 0:null===(i=a.pricing)||void 0===i?void 0:i.transactionFeesPaidBy)==="host",onClick:()=>{(null==a?void 0:a.isDraft)&&l("pricing.transactionFeesPaidBy","host")}})]}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-3",children:feesLabel(u,d,r)})]})},e6=s(9840),forms_ComplimentaryTicketForm=e=>{let{onCancel:t,eventId:s,refetchTickets:i,isDraft:n=!1,isEditing:r=!1,isLoading:a=!1,lastUpdated:l}=e,{t:o}=(0,C.$G)(["events"]),{mutate:d}=(0,D.zk)(),c=j.Ry().shape({name:j.Z_().max(100).required(o("events:pricingTiers.complimentaryTicketForm.validation.required")).label(o("events:pricingTiers.complimentaryTicketForm.validation.nameLabel")),quantity:j.Rx().min(0).max(999999).required(o("events:pricingTiers.complimentaryTicketForm.validation.required")).label(o("events:pricingTiers.complimentaryTicketForm.validation.availableTicketsLabel"))});return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:n,isEditing:r,title:o("events:pricingTiers.complimentaryTicketForm.title"),isLoading:a,lastUpdated:l,onBack:t}),(0,b.jsx)("div",{className:"pt-[50px] md:pt-[180px] -mt-[90px] pb-20 md:w-[630px] md:mx-auto",children:(0,b.jsx)("div",{className:"p-4",children:(0,b.jsx)(y.J9,{initialValues:{name:"",quantity:""},onSubmit:e=>{let{name:n,quantity:r}=e;d({eventId:s,name:n,quantity:r},{onSuccess:()=>{i(),t()},onError:()=>{t()}})},validationSchema:c,children:e=>{let{isValid:t,submitForm:s}=e;return(0,b.jsxs)("div",{className:"p-4 bg-white rounded-lg shadow-sm",children:[(0,b.jsx)(y.l0,{children:(0,b.jsxs)("div",{className:"mb-6",children:[(0,b.jsx)(eZ.Z,{id:"name",name:"name",type:"text",label:o("events:pricingTiers.complimentaryTicketForm.nameLabel"),placeholder:o("events:pricingTiers.complimentaryTicketForm.namePlaceholder")}),(0,b.jsx)(eZ.Z,{id:"quantity",name:"quantity",type:"number",label:o("events:pricingTiers.complimentaryTicketForm.availableTicketsLabel"),placeholder:o("events:pricingTiers.complimentaryTicketForm.availableTicketsPlaceholder")})]})}),(0,b.jsx)("div",{className:"flex justify-center w-full fixed left-0 bottom-0 bg-white pb-8 z-50 md:pb-4 border-t-1 px-4 py-4 shadow-primary-50 shadow-top md:shadow-none",children:(0,b.jsx)(V.ZP,{className:"w-full md:max-w-[343px] bg-[#3853C4]! text-white",type:V.L$.Primary,disabled:!t,testId:"button-confirm-ticket",onClick:s,children:o("events:pricingTiers.complimentaryTicketForm.createTicketsButton")})})]})}})})})]})},settings_ComplimentaryTickets=e=>{let{tickets:t=[]}=e;return(0,b.jsx)("div",{className:"w-full py-6 pb-10",children:t.map(e=>(0,b.jsx)("div",{className:"w-full mb-4",children:(0,b.jsxs)("div",{className:"border-1 rounded-2xl p-6 border-gray-200",children:[(0,b.jsx)("div",{className:"text-gray-700 text-lg",children:(0,b.jsx)("span",{className:"truncate",children:e.name})}),(0,b.jsx)("div",{className:"text-gray-400 text-base font-normal mt-3 truncate",children:"Complimentary"})]})},e.id))})},e7=s(20314);(o=g||(g={})).Main="Main",o.MemberOnlyAccess="MemberOnlyAccess";var e9=s(94543);let e8=(0,w.forwardRef)((e,t)=>{let{name:s,image:i,id:n,onSelect:r,isSelected:a,isDisabled:l}=e;return(0,b.jsxs)("li",{ref:t,className:ei()("rounded-lg flex p-2 items-center gap-3 cursor-pointer",a&&"bg-primary-50",!a&&l&&"opacity-50 cursor-not-allowed"),onClick:()=>{(a||!l)&&r(n)},children:[(0,b.jsx)(e9.qE,{radius:e9.cf.Lg,src:i,size:e9.EF.Lg}),(0,b.jsx)("div",{className:"flex-1 font-bold  text-base",children:s}),(0,b.jsx)("input",{className:"mt-1 mr-2",type:"checkbox",checked:a,onChange:()=>{}})]})});
1var components_OrgsOnlyAccess=e=>{let{isSelectionDisabled:t,selectedOrgs:s,setSelectedOrgs:i}=e,n=(0,w.useRef)(null),[r,a]=(0,w.useState)(""),[l]=(0,$.Z)(r,200),{data:o,isLoading:d,hasNextPage:c,isFetchingNextPage:u,fetchNextPage:m}=(0,R.IV)({search:l}),x=(0,w.useCallback)(e=>{d||u||(n.current&&n.current.disconnect(),n.current=new IntersectionObserver(e=>{e[0].isIntersecting&&c&&m()}),e&&n.current.observe(e))},[d,c]),handleSelect=e=>{let t=[...s],n=s.indexOf(e);n>-1?t.splice(n,1):t.push(e),i(t)};return(0,b.jsx)("div",{className:"h-full pb-24 md:pb-16 overflow-auto max-h-[95vh] md:max-h-[600px]",children:(0,b.jsxs)("div",{className:"p-4 pb-40",children:[(0,b.jsxs)("div",{className:"relative shrink-0 flex h-12 border-1 border-gray-300 rounded-full mt-2",children:[(0,b.jsx)(z.Zh8,{className:"absolute left-3 text-gray-400 self-center justify-center",size:24}),(0,b.jsx)("input",{type:"text",className:"w-full h-full px-11 rounded-full text-base text-gray-600 placeholder:text-gray-400",placeholder:"Search organizations",value:r,onChange:e=>{let{currentTarget:t}=e;a(t.value)}})]}),(0,b.jsxs)("div",{className:"py-6 flex",children:[(0,b.jsx)("div",{className:"flex-1 font-bold text-base",children:"".concat(s.length," ").concat(1===s.length?"organization":"organizations"," selected")}),s.length>0&&(0,b.jsx)("button",{type:"button","aria-label":"Clear selected organizations",className:"font-bold text-base text-primary-500",onClick:()=>{i([])},children:"Clear"})]}),d?(0,b.jsx)("div",{className:"flex flex-1 h-400 items-center justify-center",children:(0,b.jsx)(eF.Z,{type:eF.d.PRIMARY})}):(0,b.jsx)("ul",{className:"flex flex-col gap-2",children:o.map(e=>(0,b.jsx)(e8,{id:e.id,image:e.badgeImageUrl,name:e.name,isSelected:s.indexOf(e.id)>-1,onSelect:handleSelect,isDisabled:t,ref:x},e.id))})]})})},components_AssociationsOnlyAccess=e=>{let{isSelectionDisabled:t,selectedAssociations:s,setSelectedAssociations:i}=e,{data:n,isLoading:r}=(0,R.LS)(),handleSelect=e=>{let t=[...s],n=s.indexOf(e);n>-1?t.splice(n,1):t.push(e),i(t)};return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("div",{className:"h-full pb-24 md:pb-16 overflow-auto max-h-[95vh] md:max-h-[600px]",children:(0,b.jsxs)("div",{className:"p-4 pb-40",children:[(0,b.jsxs)("div",{className:"pt-2 pb-6 flex",children:[(0,b.jsx)("div",{className:"flex-1 font-bold text-base",children:"".concat(s.length," ").concat(1===s.length?"association":"associations"," selected")}),s.length>0&&(0,b.jsx)("button",{type:"button","aria-label":"Clear selected associations",className:"font-bold text-base text-primary-500",onClick:()=>{i([])},children:"Clear"})]}),r?(0,b.jsx)("div",{className:"flex flex-1 h-400 items-center justify-center",children:(0,b.jsx)(eF.Z,{type:eF.d.PRIMARY})}):(0,b.jsx)("ul",{className:"flex flex-col gap-2",children:n.map(e=>(0,b.jsx)(e8,{name:e.name,image:e.logoImage,id:e.id,isSelected:s.indexOf(e.id)>-1,onSelect:handleSelect,isDisabled:t},e.id))})]})})})},components_MemberOnlyTabButton=e=>{let{tabId:t,onClick:s,selectedTab:i,children:n}=e;return(0,b.jsxs)("button",{type:"button",className:ei()("px-3 pt-3 font-bold text-base cursor-pointer",i!==t&&"text-neutral-400"),onClick:()=>s(t),children:[n,(0,b.jsx)("div",{className:ei()("border-b-4 mt-2.5 rounded-lg",i===t?"border-primary-500":"border-transparent")})]})};(d=f||(f={})).Orgs="Orgs",d.Associations="Associations";var te=s(98845);let TypeButton=e=>{let{disabled:t,children:s,onClick:i,id:n,selected:r}=e;return(0,b.jsxs)("button",{className:ei()("w-full text-center text-base font-semibold rounded-md py-2 cursor-pointer flex align-center justify-center",{"bg-white":r},t&&"cursor-not-allowed text-neutral-500"),disabled:t,type:"button",onClick:()=>i(n),children:[t&&r&&(0,b.jsx)(z.RTn,{size:20,className:"mr-1"}),s]})};var components_ProductTypeSelector=e=>{let{disabled:t=!1,isPrivate:s=!1}=e,{t:i}=(0,C.$G)(["events"]),{event:n}=useEventEditorContext(),{values:r,setFieldValue:a}=(0,y.u6)();(0,te.Z)({eventId:n._id});let l={admission:i("events:pricingTiers.ticketForm.admissionDescription"),addon:i("events:pricingTiers.ticketForm.addonDescription"),bundle:i("events:pricingTiers.ticketForm.bundleDescription")},o=[{id:"admission",label:i("events:pricingTiers.ticketForm.admission")},{id:"addon",label:i("events:pricingTiers.ticketForm.addon")},{id:"bundle",label:i("events:pricingTiers.ticketForm.bundle")}],onButtonClick=e=>{a("type",e)},d=(0,w.useMemo)(()=>{let e=o;return s&&(e=e.filter(e=>"bundle"!==e.id)),e},[s,o]);return(0,b.jsxs)("div",{className:"mb-6",children:[(0,b.jsx)("div",{className:"w-full p-1 md:p-[6px] bg-gray-200 rounded-lg flex items-center justify-between",children:d.map(e=>(0,b.jsx)(TypeButton,{disabled:t,id:e.id,selected:r.type===e.id,onClick:onButtonClick,children:e.label},e.id))}),(0,b.jsx)("p",{className:"text-xs text-gray-500 mt-3",children:l[r.type]||""})]})},tt=s(98829),settings_TicketQuestions=e=>{let{name:t}=e,{values:s,setFieldValue:i}=(0,y.u6)(),n=L()(s,t)||[];return(0,w.useEffect)(()=>{0===n.length&&i(t,[{question:""}])},[t,n,i]),(0,b.jsx)(y.F2,{name:t,render:e=>(0,b.jsxs)("div",{className:"mt-4 p-4 border-1 border-gray-200 rounded-md",children:[n.map((s,i)=>(0,b.jsx)("div",{children:(0,b.jsxs)(ee.Z,{children:[(0,b.jsx)(eZ.Z,{id:"".concat(t,"[").concat(i,"].question"),name:"".concat(t,"[").concat(i,"].question"),label:"Screening question (Optional)"}),(0,b.jsxs)("div",{className:"-mt-4 flex items-center",children:[(0,b.jsx)("div",{className:"w-full border-b-1 border-gray-200"}),(0,b.jsx)("button",{type:"button",className:"pl-4 text-red-700 text-sm",onClick:()=>e.remove(i),children:"Remove"})]})]})},i)),n.length>0&&(0,b.jsx)("button",{type:"button",className:"mt-2 text-primary-500 font-semibold text-sm",onClick:()=>e.push({question:""}),children:"+ Add another question"})]})})},ts=s(87259),ti=s(18567),tn=s.n(ti),product_types_StandardProductFields=e=>{var t;let{isAddon:s,user:i,isUnsaved:n}=e,{t:r}=(0,C.$G)(["events"]),{values:a}=(0,y.u6)(),l=r(s?"events:pricingTiers.ticketForm.availableItems":"events:pricingTiers.ticketForm.availableTickets");return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(eZ.Z,{name:"name",id:"name",type:"text",label:"".concat(r(s?"events:pricingTiers.ticketForm.addonName":"events:pricingTiers.ticketForm.ticketName"),"* ").concat(n("name")?r("events:pricingTiers.ticketForm.unsaved"):""),disabled:!a.canDelete,placeholder:r(s?"events:pricingTiers.ticketForm.addonNamePlaceholder":"events:pricingTiers.ticketForm.ticketNamePlaceholder")}),(0,b.jsx)(eZ.Z,{type:"text",id:"description",name:"description",label:"".concat(r("events:pricingTiers.ticketForm.description"),"* ").concat(n("description")?r("events:pricingTiers.ticketForm.unsaved"):""),placeholder:r(s?"events:pricingTiers.ticketForm.addonDescriptionPlaceholder":"events:pricingTiers.ticketForm.descriptionPlaceholder")})]}),(0,b.jsxs)("div",{className:"flex gap-6",children:[(0,b.jsx)(eZ.Z,{id:"maxQuantity",name:"maxQuantity",type:"number",label:"".concat(l,"*"),placeholder:r("events:pricingTiers.ticketForm.availableQuantityPlaceholder")}),!a.canDelete&&(0,b.jsx)("span",{className:tn().tooltip,children:(0,b.jsx)(ts.Z,{hoverable:!0,position:"right center",trigger:(0,b.jsx)("i",{className:"fa fa-info-circle"}),size:"tiny",content:r("events:pricingTiers.ticketForm.priceCannotBeEdited")})}),(0,b.jsx)(eZ.Z,{id:"price",name:"price",type:"number",disabled:!a.canDelete,label:"".concat(r("events:pricingTiers.ticketForm.price")," (").concat(O.OI[null==i?void 0:i.country],")* ").concat(n("price")?r("events:pricingTiers.ticketForm.unsaved"):""),placeholder:r("events:pricingTiers.ticketForm.pricePlaceholder")})]}),(0,b.jsxs)("div",{className:"mt-6",children:[(0,b.jsx)(tt.Z,{name:"purchaseRequirements.requiresApproval",label:r("events:pricingTiers.ticketForm.requiresApproval")}),(null===(t=a.purchaseRequirements)||void 0===t?void 0:t.requiresApproval)&&(0,b.jsx)(settings_TicketQuestions,{name:"purchaseRequirements.questions"})]})]})},tr=s(60155),components_FormikSelectField=e=>{let{label:t,name:s,options:i,placeholder:n="Select...",disabled:r=!1,className:a=""}=e,[l,o,d]=(0,y.U$)(s),{touched:c,error:u}=o,{setValue:m,setTouched:x}=d,p=!!(c&&u),v="".concat(s,"-select"),[g,f]=(0,w.useState)(!1),h=(0,w.useRef)(null);(0,w.useEffect)(()=>{let handleClickOutside=e=>{h.current&&!h.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",handleClickOutside),()=>{document.removeEventListener("mousedown",handleClickOutside)}},[]);let handleSelect=e=>{m(e),x(!0),f(!1)},j=i.find(e=>e.value===l.value);return(0,b.jsxs)("div",{className:"w-full ".concat(a),children:[(0,b.jsx)("label",{htmlFor:v,className:"block text-sm font-medium text-gray-700 mb-1",children:t}),(0,b.jsxs)("div",{className:"relative",ref:h,children:[(0,b.jsxs)("div",{onClick:()=>!r&&f(!g),className:ei()("mt-1 relative flex items-center w-full px-4 py-3 text-base border focus:outline-none focus:ring-indigo-500 sm:text-sm rounded-md cursor-pointer",p?"border-red-800 focus:border-red-800":"border-gray-300 focus:border-indigo-500",r?"bg-gray-100 cursor-not-allowed":"",l.value?"text-gray-900":"text-gray-500"),children:[(0,b.jsx)("div",{className:"flex flex-1",children:j?j.label:n}),(0,b.jsx)("div",{className:"flex items-center pointer-events-none",children:(0,b.jsx)(tr.V7A,{className:"text-gray-400 transition-transform ".concat(g?"transform rotate-180":"")})})]}),g&&!r&&(0,b.jsx)("ul",{className:"absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",children:0===i.length?(0,b.jsx)("li",{className:"text-gray-500 select-none relative py-3 pl-4 pr-9",children:"No options available"}):i.map(e=>(0,b.jsx)("li",{onClick:()=>handleSelect(e.value),className:ei()("cursor-pointer select-none relative py-3 pl-4 pr-9",e.value===l.value?"bg-indigo-100 text-indigo-900":"text-gray-900 hover:bg-gray-100"),children:(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("span",{className:"flex flex-1",children:e.label}),e.value===l.value&&(0,b.jsx)("span",{className:"text-indigo-600 absolute inset-y-0 right-0 flex items-center pr-4",children:(0,b.jsx)("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,b.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]})},e.value))}),(0,b.jsxs)("select",{id:v,name:l.name,value:l.value,onChange:l.onChange,onBlur:l.onBlur,disabled:r,className:"sr-only","aria-hidden":"true",children:[(0,b.jsx)("option",{value:"",children:n}),i.map(e=>(0,b.jsx)("option",{value:e.value,children:e.label},e.value))]})]}),p&&(0,b.jsxs)("div",{className:"mt-2 text-red-800 flex items-center gap-1 font-normal text-sm",children:[(0,b.jsx)(eC.m2k,{size:16})," ",u]})]})},components_FormikNumberField=e=>{let{label:t,name:s,placeholder:i="",disabled:n=!1,className:r="",min:a,max:l}=e,[o,d]=(0,y.U$)(s),{touched:c,error:u}=d,m=!!(c&&u),x="".concat(s,"-input");return(0,b.jsxs)("div",{className:"".concat(r),children:[(0,b.jsx)("label",{htmlFor:x,className:"block text-sm font-medium text-gray-700 mb-1",children:t}),(0,b.jsx)("div",{className:"relative",children:(0,b.jsx)("input",{id:x,type:"number",name:o.name,value:o.value,onChange:e=>
1{o.onChange(e),e.target.focus()},onBlur:o.onBlur,disabled:n,placeholder:i,min:a,max:l,className:ei()("mt-1 block w-full px-4 py-3 text-base border focus:outline-none focus:ring-indigo-500 sm:text-sm rounded-md",m?"border-red-800 focus:border-red-800":"border-gray-300 focus:border-indigo-500"),style:{WebkitAppearance:"none",MozAppearance:"textfield",appearance:"textfield",margin:0,boxSizing:"border-box"}})}),m&&(0,b.jsxs)("div",{className:"mt-2 text-red-800 flex items-center gap-1 font-normal text-sm",children:[(0,b.jsx)(eC.m2k,{size:16})," ",u]})]})},icons_TrashIcon=()=>(0,b.jsx)("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("path",{d:"M6 19.5C6 20.6 6.9 21.5 8 21.5H16C17.1 21.5 18 20.6 18 19.5V7.5H6V19.5ZM19 4.5H15.5L14.5 3.5H9.5L8.5 4.5H5V6.5H19V4.5Z",fill:"currentColor"})}),icons_CheckmarkIcon=()=>(0,b.jsx)("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("path",{d:"M8.79508 16.3749L4.62508 12.2049L3.20508 13.6149L8.79508 19.2049L20.7951 7.20492L19.3851 5.79492L8.79508 16.3749Z",fill:"currentColor"})}),icons_AlertTriangleIcon=()=>(0,b.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-4 h-4 inline-block mr-1",children:(0,b.jsx)("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})}),product_types_BundleFields=e=>{let{standardProducts:t,user:s,isUnsaved:i}=e,{t:n}=(0,C.$G)(["events"]),{values:r,errors:a,submitCount:l}=(0,y.u6)();return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"mb-6",children:[(0,b.jsx)(eZ.Z,{name:"name",id:"name",type:"text",label:"".concat(n("events:pricingTiers.ticketForm.bundleName"),"* ").concat(i("name")?n("events:pricingTiers.ticketForm.unsaved"):""),disabled:!r.canDelete,placeholder:n("events:pricingTiers.ticketForm.bundleNamePlaceholder")}),(0,b.jsx)(eZ.Z,{type:"text",id:"description",name:"description",label:"".concat(n("events:pricingTiers.ticketForm.description"),"* ").concat(i("description")?n("events:pricingTiers.ticketForm.unsaved"):""),placeholder:n("events:pricingTiers.ticketForm.bundleDescriptionPlaceholder")})]}),(0,b.jsxs)("div",{className:"flex gap-6 mb-6",children:[!r.canDelete&&(0,b.jsx)("span",{className:tn().tooltip,children:(0,b.jsx)(ts.Z,{hoverable:!0,position:"right center",trigger:(0,b.jsx)("i",{className:"fa fa-info-circle"}),size:"tiny",content:n("events:pricingTiers.ticketForm.priceCannotBeEdited")})}),(0,b.jsxs)("div",{className:"grow",children:[(0,b.jsx)(eZ.Z,{id:"price",name:"price",type:"number",disabled:!r.canDelete,label:"".concat(n("events:pricingTiers.ticketForm.bundlePrice")," (").concat(O.OI[null==s?void 0:s.country],")* ").concat(i("price")?n("events:pricingTiers.ticketForm.unsaved"):""),placeholder:n("events:pricingTiers.ticketForm.pricePlaceholder")}),(()=>{var e;let s=(null===(e=r.components)||void 0===e?void 0:e.filter(e=>e.productId&&e.quantity).map(e=>{let s=t.find(t=>t.id===e.productId);return{...e,price:(null==s?void 0:s.price)||0}}))||[],i=s.reduce((e,t)=>e+t.price*t.quantity,0),a=Number(r.price)||0,l=i-a;return 0!==s.length&&a?(0,b.jsx)("p",{className:"".concat(l>0?"text-[#048300]":"text-[#969696]"," font-normal text-sm -mt-4"),children:l>0?n("events:pricingTiers.ticketForm.customerSavings",{amount:l.toFixed(2)}):n("events:pricingTiers.ticketForm.noSavingsLabel")}):(0,b.jsx)("p",{className:"text-[#969696] font-normal text-sm -mt-4",children:n("events:pricingTiers.ticketForm.setPriceAndAddTiers")})})()]})]}),(0,b.jsxs)("div",{className:" mb-2",children:[(0,b.jsx)("h3",{className:"text-lg font-semibold mb-2 text-[#202020]",children:n("events:pricingTiers.ticketForm.ticketTiersInBundle")}),(0,b.jsx)("p",{className:"text-sm text-[#575757] font-normal mb-4",children:n("events:pricingTiers.ticketForm.addTicketTiersDescription")}),(0,b.jsx)(y.F2,{name:"components",children:e=>{var s,i;let{push:o,remove:d}=e,c=(null===(s=r.components)||void 0===s?void 0:s.map(e=>e.productId))||[],u=t.filter(e=>!c.includes(e.id));return(0,b.jsxs)("div",{className:"",children:[(0,b.jsx)("div",{className:"space-y-4",children:null===(i=r.components)||void 0===i?void 0:i.map((e,s)=>{let i=[...u,...e.productId?t.filter(t=>t.id===e.productId):[]].sort((e,t)=>
1e.name.localeCompare(t.name)).map(e=>({value:e.id,label:"".concat(e.name," - ($").concat(e.price,")")})),a=e.productId?"".concat(e.productId,"-").concat(e.quantity,"-").concat(s):"new-component-".concat(s);return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex gap-2 items-start",children:[(0,b.jsx)("div",{className:"w-full",children:(0,b.jsx)(components_FormikSelectField,{label:n("events:pricingTiers.ticketForm.ticketTier"),name:"components.".concat(s,".productId"),options:i,placeholder:n("events:pricingTiers.ticketForm.selectTicketTier"),disabled:!r.canDelete})}),(0,b.jsx)("div",{className:"max-w-[72px]",children:(0,b.jsx)(components_FormikNumberField,{label:n("events:pricingTiers.ticketForm.quantity"),name:"components.".concat(s,".quantity"),placeholder:"1",min:1,disabled:!r.canDelete})})]}),(0,b.jsxs)("div",{className:"ml-1 mr-1 mt-1 flex items-center",children:[(0,b.jsx)("div",{className:"w-full border-b-1 border-gray-200"}),(0,b.jsx)("button",{type:"button",className:"text-sm pl-4 ".concat(r.canDelete?"text-red-700":"text-red-300 cursor-not-allowed"),onClick:()=>d(s),disabled:!r.canDelete,children:n("events:pricingTiers.ticketForm.remove")})]})]},a)})}),Object.keys(a).filter(e=>e.startsWith("components")).length>0&&l>0&&(0,b.jsxs)("div",{className:"mt-2 mb-4 text-red-800 flex items-center gap-1 font-normal text-sm",children:[(0,b.jsx)("span",{className:"text-red-800",children:(0,b.jsx)(icons_AlertTriangleIcon,{})}),"string"==typeof a.components?a.components:n("events:pricingTiers.ticketForm.someTicketTiersIncomplete")]}),(0,b.jsx)("button",{type:"button",className:"mt-0 px-3 py-2 text-sm bg-white font-semibold transition-colors duration-200 flex items-center ".concat(0!==u.length&&r.canDelete?"text-[#3853C4]":"text-[#8DA0E3] cursor-not-allowed"),disabled:0===u.length||!r.canDelete,onClick:()=>o({productId:"",quantity:1}),children:n("events:pricingTiers.ticketForm.addAnotherTicketTier")})]})}})]})]})},components_ProductTypeFactory=e=>{let{standardProducts:t,user:s,isUnsaved:i}=e,{values:n}=(0,y.u6)(),r=n.type;switch(r){case"bundle":return(0,b.jsx)(product_types_BundleFields,{standardProducts:t,user:s,isUnsaved:i});case"admission":default:return(0,b.jsx)(product_types_StandardProductFields,{isAddon:!1,user:s,isUnsaved:i});case"addon":return(0,b.jsx)(product_types_StandardProductFields,{isAddon:!0,user:s,isUnsaved:i})}},ta=s(72880),tl=s(44841),helpers_computeMemberOnlyLabel=(e,t)=>
1{let s=(null==e?void 0:e.length)===1?"association":"associations",i=(null==t?void 0:t.length)===1?"organization":"organizations";return"".concat(null==e?void 0:e.length," ").concat(s," + ").concat(null==t?void 0:t.length," ").concat(i)},components_AdditionalOptions=e=>{var t,s,i,n,r,a,l,o;let{isEditing:d,ticket:c,goToStep:u,isUnsaved:m}=e,{values:x,setFieldValue:p}=(0,y.u6)(),v=(0,ta._)(),[f,h]=(0,w.useState)(!!(null==c?void 0:c.endDate)),[j,N]=(0,w.useState)(!!(null==x?void 0:x.imageUrl)||!!(null==c?void 0:c.startDate)||!!(null==x?void 0:null===(t=x.requiredOrganizationIds)||void 0===t?void 0:t.length)||!!(null==x?void 0:null===(s=x.requiredAssociationIds)||void 0===s?void 0:s.length)),onImageUploadSuccess=e=>{let{imageUrl:t}=e;p("imageUrl",t)},onImageUploadError=e=>{(0,T.x2)({title:"Error uploading image",message:e.message})};return(0,w.useEffect)(()=>{window.scrollTo({top:0,behavior:"auto"})},[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"mt-4 text-sm tracking-[0.01em] font-bold text-[#3853C4] cursor-pointer",onClick:()=>N(e=>!e),children:j?"Hide additional options":"Show additional options"}),j&&(0,b.jsxs)("div",{className:ew().group,children:["bundle"!==x.type&&(0,b.jsxs)("div",{className:"mb-8",children:[(0,b.jsx)("div",{className:"text-sm font-normal pb-2",children:"Member-Only Access"}),(0,b.jsxs)("button",{className:"border-1 flex flex-1 w-full p-3.5 rounded-lg items-center",type:"button",onClick:()=>u(g.MemberOnlyAccess),children:[(null===(n=x.purchaseRequirements)||void 0===n?void 0:null===(i=n.requiredOrganizationIds)||void 0===i?void 0:i.length)===0&&(null===(a=x.purchaseRequirements)||void 0===a?void 0:null===(r=a.requiredAssociationIds)||void 0===r?void 0:r.length)===0?(0,b.jsx)("div",{className:"flex-1 text-left text-neutral-400",children:"Select Organizations and/or Associations"}):(0,b.jsx)("div",{className:"flex-1 text-left",children:helpers_computeMemberOnlyLabel(null===(l=x.purchaseRequirements)||void 0===l?void 0:l.requiredAssociationIds,null===(o=x.purchaseRequirements)||void 0===o?void 0:o.requiredOrganizationIds)}),(0,b.jsx)(tr.CgR,{size:15})]})]}),(0,b.jsx)("div",{className:"mb-8",children:(0,b.jsx)(ev.Z,{label:"Add your 3:2 cover photo*",maxLabel:"Max 3840 x 2560",aspectRatio:ev.I.ThreeToTwo,photoUrl:null==x?void 0:x.imageUrl,isUploading:v.isLoading,onUploadPhoto:e=>{v.mutate({blob:e},{onSuccess:onImageUploadSuccess,onError:onImageUploadError})},error:""})}),(!d||!!c.startDate||!!c.endDate)&&(0,b.jsxs)("div",{className:"mt-4",children:[(!d||!!c.startDate)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("label",{className:ew().label,children:"Start Date/Time ".concat(m("startDate")?"(unsaved)":"")}),(0,b.jsx)(tl.Z,{name:"startDate"})]}),f&&(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)("label",{className:ew().label,children:"End Date/Time ".concat(m("endDate")?"(unsaved)":"")}),(0,b.jsx)(tl.Z,{name:"endDate",disabledBefore:new Date(x.startDate)})]}),(0,b.jsx)("div",{className:"mt-4 mb-20",children:(0,b.jsx)(V.ZP,{isSubmit:!1,onClick:()=>{delete x.endDate,delete x.endDateTime,h(!f)},children:f?"Remove End Time":"Show End Time"})})]})]})]})};let to={publicTier:{cta:"Save public tier"},privateTier:{cta:"Save private tier"}};var helpers_computeInitialValues=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"admission";if(e){var i,n,r,a,l,o,d,c;let t={type:e.type,name:e.name,description:e.description||"",price:e.price,isPrivate:e.isPrivate,isActive:e.isActive||!0,imageUrl:e.imageUrl,startDate:e.startDate,endDate:e.endDate,canDelete:e.canDelete,isVisible:e.isVisible,purchases:e.purchases||0,purchaseRequirements:{requiresApproval:(null===(i=e.purchaseRequirements)||void 0===i?void 0:i.requiresApproval)||!1,questions:(null===(n=e.purchaseRequirements)||void 0===n?void 0:n.questions)||[],requiredOrganizationIds:(null===(r=e.purchaseRequirements)||void 0===r?void 0:r.requiredOrganizationIds)||[],requiredAssociationIds:(null===(a=e.purchaseRequirements)||void 0===a?void 0:a.requiredAssociationIds)||[]}};return"bundle"===e.type?{...t,components:e.components||[]}:{...t,maxQuantity:e.maxQuantity,purchaseRequirements:{requiresApproval:(null===(l=e.purchaseRequirements)||void 0===l?void 0:l.requiresApproval)||!1,questions:(null===(o=e.purchaseRequirements)||void 0===o?void 0:o.questions)||[],requiredOrganizationIds:(null===(d=e.purchaseRequirements)||void 0===d?void 0:d.requiredOrganizationIds)||[],requiredAssociationIds:(null===(c=e.purchaseRequirements)||void 0===c?void 0:c.requiredAssociationIds)||[]}}}let u={type:s,name:"",description:"",price:null,isPrivate:t,isActive:!0,canDelete:!0,purchases:0};return"bundle"===s?{...u,components:[],purchaseRequirements:{requiresApproval:!1,questions:[],requiredOrganizationIds:[],requiredAssociationIds:[]}}:{...u,maxQuantity:void 0,purchaseRequirements:{requiresApproval:!1,questions:[],requiredOrganizationIds:[],requiredAssociationIds:[]}}},hooks_useUnsavedChanges=(e,t)=>{let s=(0,N.useRouter)(),[i,n]=(0,w.useState)(!1),[r,a]=(0,w.useState)(null);return(0,w.useEffect)(()=>{let beforeUnloadHandler=t=>
1{if(e)return t.preventDefault(),"Changes you made may not be saved."},beforeRouteHandler=t=>{e&&s.pathname!==t&&(a(t),n(!0),s.events.emit("routeChangeError"))};return e?(window.addEventListener("beforeunload",beforeUnloadHandler),s.events.on("routeChangeStart",beforeRouteHandler)):(window.removeEventListener("beforeunload",beforeUnloadHandler),s.events.off("routeChangeStart",beforeRouteHandler)),()=>{window.removeEventListener("beforeunload",beforeUnloadHandler),s.events.off("routeChangeStart",beforeRouteHandler)}},[e,s]),{showUnsavedChangesAlert:i,handleCancel:()=>{e?n(!0):t()},handleDiscardChanges:()=>{n(!1),r&&(s.push(r),a(null)),t()},closeAlert:()=>n(!1)}},hooks_useProductTypeChange=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!!t,n=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(i&&t&&"bundle"===t.type){var s,n,r,a,l,o;(null===(n=e.current)||void 0===n?void 0:null===(s=n.values)||void 0===s?void 0:s.components)&&e.current.values.components.length||null===(l=e.current)||void 0===l||l.setFieldValue("components",t.components||[]),(null===(a=e.current)||void 0===a?void 0:null===(r=a.values)||void 0===r?void 0:r.type)||null===(o=e.current)||void 0===o||o.setFieldValue("type","bundle")}},[i,t]);let handleTypeChange=()=>{if(!e.current||i)return;let t=e.current.values.type;if(t===n.current||(n.current=t,Object.keys(e.current.errors).length>0))return;let r=helpers_computeInitialValues(null,s,t);["name","description","price","isPrivate","isActive"].forEach(t=>{e.current.values[t]&&(r[t]=e.current.values[t])}),"bundle"===t&&(r.components=r.components||[]),e.current.resetForm({values:r})};return(0,w.useEffect)(()=>{if(!e.current||i)return;let t=e.current;t.setFieldValue("type",t.values.type,!1),t.validateField("type");let s=setInterval(()=>{let e=t.values.type;e!==n.current&&handleTypeChange()},300);return()=>{clearInterval(s)}},[e.current,i]),{handleTypeChange}};let td={name:j.Z_().max(100).required("Required field").label("Name"),description:j.Z_().max(300).label("Description").required("Required field"),price:j.Rx().transform((e,t)=>""===t||isNaN(e)?void 0:e).typeError("Please enter a valid price").min(0,"Price must be 0 or higher").max(999999,"Price cannot exceed 999,999").required("Please enter a price").label("Price"),isPrivate:j.O7().required("Required field"),isActive:j.O7().required("Required field"),imageUrl:j.Z_(),startDate:j.Z_(),endDate:j.Z_()};var AdmissionProductSchema=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=j.Ry().shape({type:j.Z_().required("Required field").oneOf(["admission"],"Must be an admission type"),...td,maxQuantity:j.nK().transform(e=>{if(""===e||null==e)return;let t=Number(e);return isNaN(t)?void 0:t}).optional().test("min-value","You cannot decrease the number of available tickets to less than the number of tickets already sold.",function(t){let{purchases:s}=this.parent;return void 0===t||0===t||t>=(s||e)}).test("max-value","Value must not exceed 999999",e=>void 0===e||e<=999999).label("Available Tickets"),purchaseRequirements:j.Ry().shape({requiresApproval:j.O7(),questions:j.IX(j.Ry().shape({question:j.Z_()})),requiredOrganizationIds:j.IX(j.Z_()),requiredAssociationIds:j.IX(j.Z_())}).required("Required field")});return t},AddonProductSchema=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=j.Ry().shape({type:j.Z_().required("Required field").oneOf(["addon"],"Must be an addon type"),...td,maxQuantity:j.nK().transform(e=>{if(""===e||null==e)return;let t=Number(e);return isNaN(t)?void 0:t}).optional().test("min-value","You cannot decrease the number of available items to less than the number of items already sold.",function(t){let{purchases:s}=this.parent;return void 0===t||0===t||t>=(s||e)}).test("max-value","Value must not exceed 999999",e=>void 0===e||e<=999999).label("Available Items"),purchaseRequirements:j.Ry().shape({requiresApproval:j.O7(),questions:j.IX(j.Ry().shape({question:j.Z_()})),requiredOrganizationIds:j.IX(j.Z_()),requiredAssociationIds:j.IX(j.Z_())}).required("Required field")});return t},BundleProductSchema=()=>{let e=j.Ry().shape({type:j.Z_().required("Required field").oneOf(["bundle"],"Must be a bundle type"),...td,maxQuantity:j.Rx().test("max-not-below-sold","Cannot reduce available tickets below the number already sold",function(e){let{purchases:t}=this.parent;return!t||void 0===e||0===e||e>=t}),components:j.IX(j.Ry().shape({productId:j.Z_().required("Ticket tier selection is required"),quantity:j.Rx().required("Quantity is required").min(1,"Minimum quantity is 1")})).min(1,"At least one ticket tier must be added to the bundle").required("Bundle components are required")});return e};let tc={publicTier:{newTitle:"New public tier",editTitle:"Edit public tier"},privateTier:{newTitle:"New private tier",editTitle:"Edit private tier"}},tu={[g.Main]:{icon:(0,b.jsx)(z.Zp5,{size:20}),onBack:null,title:(e,t)=>
1t?e.editTitle:e.newTitle,Component:e=>{let{isTierPrivate:t,ticket:s,user:i,isEditing:n,goToStep:r,setIsDirty:a,handleSubmit:l,handleRemoveClick:o,isRemoveLoading:d,isSubmitLoading:c}=e,u=to[t?"privateTier":"publicTier"],{values:m,dirty:x,setFieldValue:p}=(0,y.u6)(),{eventId:v}=useEventEditorContext(),{products:g}=hooks_useManageProducts(v),f=!!s,h=g.filter(e=>("admission"===e.type||"addon"===e.type)&&e.isActive&&e.id!==(null==s?void 0:s.id)),isUnsaved=e=>x&&m[e]!==(null==s?void 0:s[e]);return(0,w.useEffect)(()=>{a(x)},[x]),(0,w.useEffect)(()=>{"bundle"!==m.type||m.components&&0!==m.components.length||p("components",[{productId:"",quantity:1}])},[m.type,p]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"pb-24 md:pb-16",children:(0,b.jsx)("div",{className:"p-4",children:(0,b.jsxs)(y.l0,{children:[(0,b.jsx)(components_ProductTypeSelector,{disabled:f,isPrivate:t}),(0,b.jsx)(components_ProductTypeFactory,{standardProducts:h,user:i,isUnsaved:isUnsaved}),(0,b.jsx)(components_AdditionalOptions,{isEditing:f,ticket:s,goToStep:r,isUnsaved:isUnsaved})]})})}),(0,b.jsx)("div",{className:"w-full fixed left-0 bottom-0 bg-white pb-8 z-50 md:pb-4 border-t-1 px-4 py-4 shadow-primary-50 shadow-top md:shadow-none",children:(0,b.jsxs)("div",{className:"flex gap-3 justify-center",children:[n&&(0,b.jsx)(V.ZP,{type:V.L$.Danger,className:"w-full md:max-w-[343px] ".concat(s&&!s.canDelete?"opacity-50 cursor-not-allowed":""),onClick:o,loading:d,children:"Remove"}),(0,b.jsx)(V.ZP,{className:"w-full md:max-w-[343px] bg-[#3853C4]! text-white",type:V.L$.Primary,onClick:l,loading:c,children:u.cta})]})})]})},autoHeight:!0},[g.MemberOnlyAccess]:{icon:null,onBack:e=>()=>e(g.Main),title:()=>"Member-Only Access",Component:e=>{var t,s;let{goToStep:i}=e,{values:n,setFieldValue:r}=(0,y.u6)(),[a,l]=(0,w.useState)("Orgs"),[o,d]=(0,w.useState)((null==n?void 0:null===(t=n.purchaseRequirements)||void 0===t?void 0:t.requiredOrganizationIds)||[]),[c,u]=(0,w.useState)((null==n?void 0:null===(s=n.purchaseRequirements)||void 0===s?void 0:s.requiredAssociationIds)||[]),m=o.length+c.length,x=m>=10,setActiveTab=e=>l(e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"flex flex-1 justify-center pt-3 pb-1 gap-3",children:[(0,b.jsx)(components_MemberOnlyTabButton,{tabId:"Orgs",onClick:setActiveTab,selectedTab:a,children:"Organizations"}),(0,b.jsx)(components_MemberOnlyTabButton,{tabId:"Associations",onClick:setActiveTab,selectedTab:a,children:"Associations"})]}),"Orgs"===a?(0,b.jsx)(components_OrgsOnlyAccess,{selectedOrgs:o,setSelectedOrgs:d,isSelectionDisabled:x}):(0,b.jsx)(components_AssociationsOnlyAccess,{selectedAssociations:c,isSelectionDisabled:x,setSelectedAssociations:u}),(0,b.jsx)("div",{className:"flex justify-center fixed w-full left-0 bottom-0 bg-white pb-8 z-50 md:pb-4 border-t-1 px-4 py-4 shadow-primary-50 shadow-top md:shadow-none",children:(0,b.jsx)("div",{className:"w-full max-w-[343px]",children:(0,b.jsxs)(V.ZP,{className:"w-full bg-[#3853C4]! text-white",type:V.L$.Primary,onClick:()=>{r("purchaseRequirements.requiredOrganizationIds",o),r("purchaseRequirements.requiredAssociationIds",c),i(g.Main)},disabled:m>10,children:["Save Selection • ","".concat(m,"/").concat(10)]})})})]})},autoHeight:!1}};var forms_TicketForm=e=>{let{onCancel:t,ticket:s,isTierPrivate:i,onSubmit:n,onRemove:r,isDraft:a=!1,isEditing:l=!1,isLoading:o=!1,formTitle:d,...c}=e,{event:u}=useEventEditorContext(),m=!!s,x=tc[i?"privateTier":"publicTier"],[p,v]=(0,w.useState)(g.Main),[f,h]=(0,w.useState)(!1),[j,N]=(0,w.useState)(!1),[C,k]=(0,w.useState)(!1),S=(0,w.useRef)(null),_=(null==s?void 0:s.type)||"admission",{showUnsavedChangesAlert:I,handleCancel:P,handleDiscardChanges:F,closeAlert:D}=hooks_useUnsavedChanges(f,t);hooks_useProductTypeChange(S,s,i);let O=tu[p],handleFormSubmit=()=>{S.current&&S.current.submitForm()},handleRemoveClick=()=>{if(s&&!s.canDelete){(0,T.x2)({title:"Cannot Remove Tier",message:"This tier cannot be deleted because tickets have already been purchased."});return}N(!0),r&&r()},goToStep=e=>{v(e)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:a,isEditing:l,title:d||
1(p===g.MemberOnlyAccess?"Member-Only Access":m?x.editTitle:x.newTitle),isLoading:o,onBack:()=>{p===g.MemberOnlyAccess?goToStep(g.Main):P()},description:null==u?void 0:u.title}),(0,b.jsx)("div",{className:"pt-[50px] md:pt-[180px] -mt-[90px] pb-20 max-w-[630px] md:mx-auto",children:(0,b.jsx)("div",{className:"px-4",children:(0,b.jsx)(y.J9,{initialValues:helpers_computeInitialValues(s,i,_),onSubmit:e=>{k(!0);let t={...e};if(null==t||delete t.startDateTime,null==t||delete t.endDateTime,t.purchaseRequirements){var s;let e=(null===(s=t.purchaseRequirements.questions)||void 0===s?void 0:s.filter(e=>{let{question:t}=e;return""!==t}))||[];t.purchaseRequirements.questions=e}if("bundle"===t.type){let e=t.components.some(e=>!e.productId);if(e){k(!1);return}}n(t)},validate:e=>{let t=function(e,t){let s=(null==t?void 0:t.purchases)||0;switch(e){case"admission":default:return AdmissionProductSchema(s);case"addon":return AddonProductSchema(s);case"bundle":return BundleProductSchema()}}(e.type,s);try{return t.validateSync(e,{abortEarly:!1}),{}}catch(e){return e.inner.reduce((e,t)=>({...e,[t.path]:t.message}),{})}},innerRef:S,children:()=>(0,b.jsx)(O.Component,{goToStep:goToStep,ticket:s,isEditing:m,isTierPrivate:i,setIsDirty:h,handleSubmit:handleFormSubmit,handleRemoveClick:handleRemoveClick,isRemoveLoading:j,isSubmitLoading:C,...c})})})}),I&&(0,b.jsx)(e7.Z,{title:"Unsaved Changes",message:"You have unsaved changes that will be lost.",submitLabel:"Discard",submitButtonType:V.L$.Danger,onSubmit:F,onCancel:D})]})};let useSectionManagement=()=>{let[e,t]=(0,w.useState)(),[s,i]=(0,w.useState)({}),[n,r]=(0,w.useState)({}),a=(0,w.useCallback)((s,n)=>{e!==s&&(t(s),i(e=>({...e,[s]:n})))},[e]),l=(0,w.useCallback)((e,t)=>{i(s=>({...s,[e]:t}))},[]),o=(0,w.useCallback)(e=>{r(t=>({...t,[e]:!t[e]}))},[]),d=(0,w.useCallback)(()=>{t(void 0)},[]),c=(0,w.useCallback)(()=>{i({})},[]);return{selectedSection:e,sectionNames:s,expandedSections:n,editSection:a,handleNameChange:l,toggleSection:o,clearSelectedSection:d,clearSectionNames:c,setSelectedSection:t}},tm={SECTIONS:"sections",TIERS:"tiers"},useSectionMutations=e=>{let{eventId:t,onDeleteSection:s,onSectionUpdated:i}=e,n=(0,D.OU)(),r=(0,D.IO)(),a=(0,D.R0)(),l=(0,w.useCallback)((e,s)=>new Promise(n=>{r.mutate({eventId:t,sectionId:e,name:s},{onSuccess:()=>{null==i||i(),n()},onError:e=>{T.x2({title:"Error updating section",message:e.message}),n()}})}),[t,r,i]),o=(0,w.useCallback)(e=>{a.mutate({eventId:t,sectionId:e},{onSuccess:()=>{null==s||s(e)},onError:e=>{T.x2({title:"Error deleting section",message:e.message})}})},[t,a,s]);return{createSectionMutation:n,updateSectionMutation:r,deleteSectionMutation:a,updateSectionName:l,deleteSection:o}},useSectionHelpers=e=>{let{tiers:t,sections:s}=e,i=(0,w.useMemo)(()=>t?t.reduce((e,t)=>{let s=t.sectionId||"default";return e[s]=[...e[s]||[],t],e},{}):{},[t]),n=(0,w.useMemo)(()=>{if(s)return[...s].sort((e,t)=>e.sortIndex-t.sortIndex)},[s]),r=(0,w.useMemo)(()=>n&&n.length>0,[n]),a=(0,w.useMemo)(()=>(null==t?void 0:t.length)||0,[t]),l=(0,w.useMemo)(()=>{var e;return(null===(e=i.default)||void 0===e?void 0:e.length)||0},[i]),o=(0,w.useMemo)(()=>n?n.reduce((e,t)=>{var s,n;return e[t.id]={tierCount:(null===(s=i[t.id])||void 0===s?void 0:s.length)||0,isEmpty:!(null===(n=i[t.id])||void 0===n?void 0:n.length)},e},{}):{},[n,i]);return{tiersBySection:i,sortedSections:n,hasCustomSections:r,totalTierCount:a,defaultTierCount:l,sectionStats:o}},tx=(0,w.createContext)(null),useSectionsContext=()=>{let e=(0,w.useContext)(tx);if(!e)throw Error("useSectionsContext must be used within a SectionsProvider");return e},SectionsProvider=e=>{let{value:t,children:s}=e;return(0,b.jsx)(tx.Provider,{value:t,children:s})};var tp=s(32933);let handleDragEnd=e=>{let{result:t,sections:s,tiers:i,onReorder:n}=e;if(!t.destination||!n)return;let r=Array.from(s||[]),a=Array.from(i||[]).sort((e,t)=>e.sortIndex-t.sortIndex);t.type===tm.SECTIONS?handleSectionReorder(t,r,a,n):t.type===tm.TIERS&&handleTierReorder(t,r,a,n)},handleSectionReorder=(e,t,s,i)=>{if("default-section"===e.draggableId)return;let[n]=t.splice(e.source.index,1);t.splice(e.destination.index,0,n);let r=t.map((e,t)=>({...e,sortIndex:t}));i(s,r)},handleTierReorder=(e,t,s,i)=>{let n=e.source.droppableId,r=e.destination.droppableId,a=e.source.index,l=e.destination.index,o=s.filter(e=>(e.sectionId||"default")===n),d=o[a],c=s.findIndex(e=>e.id===d.id);s.splice(c,1);let u=s.filter(e=>(e.sectionId||"default")===r),m=Math.min(l,u.length),x=u[m],p=x?s.findIndex(e=>e.id===x.id):s.length,v={...d,sectionId:"default"===r?void 0:r};s.splice(p,0,v);let g=s.map((e,t)=>({...e,sortIndex:t}));i(g,t)};var icons_AlertIcon=()=>(0,b.jsx)("svg",{width:"22",height:"18",viewBox:"0 0 22 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("path",{d:"M1.72479 18C1.54146 18 1.37479 17.9542 1.22479 17.8625C1.07479 17.7708 0.958123 17.65 0.87479 
117.5C0.791456 17.35 0.745623 17.1875 0.73729 17.0125C0.728956 16.8375 0.77479 16.6667 0.87479 16.5L10.1248 0.5C10.2248 0.333333 10.354 0.208333 10.5123 0.125C10.6706 0.0416667 10.8331 0 10.9998 0C11.1665 0 11.329 0.0416667 11.4873 0.125C11.6456 0.208333 11.7748 0.333333 11.8748 0.5L21.1248 16.5C21.2248 16.6667 21.2706 16.8375 21.2623 17.0125C21.254 17.2833 21.2081 17.35 21.1248 17.5C21.0415 17.65 20.9248 17.7708 20.7748 17.8625C20.6248 17.9542 20.4581 18 20.2748 18H1.72479ZM10.9998 15C11.2831 15 11.5206 14.9042 11.7123 14.7125C11.904 14.5208 11.9998 14.2833 11.9998 14C11.9998 13.7167 11.904 13.4792 11.7123 13.2875C11.5206 13.0958 11.2831 13 10.9998 13C10.7165 13 10.479 13.0958 10.2873 13.2875C10.0956 13.4792 9.99979 13.7167 9.99979 14C9.99979 14.2833 10.0956 14.5208 10.2873 14.7125C10.479 14.9042 10.7165 15 10.9998 15ZM10.9998 12C11.2831 12 11.5206 11.9042 11.7123 11.7125C11.904 11.5208 11.9998 11.2833 11.9998 11V8C11.9998 7.71667 11.904 7.47917 11.7123 7.2875C11.5206 7.09583 11.2831 7 10.9998 7C10.7165 7 10.479 7.09583 10.2873 7.2875C10.0956 7.47917 9.99979 7.71667 9.99979 8V11C9.99979 11.2833 10.0956 11.5208 10.2873 11.7125C10.479 11.9042 10.7165 12 10.9998 12Z",fill:"currentColor"})}),components_DeleteConfirmationModal=e=>{let{isOpen:t,onConfirm:s,onCancel:i,isDeleting:n}=e,{t:r}=(0,C.$G)(["events"]);return t?(0,b.jsx)(G.Z,{type:G.w.SMALL,visible:t,autoHeight:!0,title:r("events:pricingTiers.categories.deleteModal.title"),icon:(0,b.jsx)(icons_AlertIcon,{}),iconVariant:"danger",onClose:i,children:(0,b.jsxs)("div",{className:"p-6 pb-0",children:[(0,b.jsxs)("div",{className:"text-left mb-6 text-base font-normal text-[#575757]",children:[(0,b.jsx)("p",{children:r("events:pricingTiers.categories.deleteModal.line1")}),(0,b.jsx)("p",{children:r("events:pricingTiers.categories.deleteModal.line2")}),(0,b.jsx)("p",{children:r("events:pricingTiers.categories.deleteModal.line3")})]}),(0,b.jsxs)("div",{className:"flex justify-center space-x-4 w-full",children:[(0,b.jsx)("button",{type:"button",onClick:i,disabled:n,className:"py-2 px-8 rounded-full bg-[#EFF2FF] text-[#3853C4] font-medium hover:bg-[#e0e5ff] transition-colors w-full",children:r("events:pricingTiers.categories.deleteModal.cancel")}),(0,b.jsx)("button",{type:"button",onClick:s,disabled:n,className:"py-2 px-8 rounded-full bg-[#A4332A] text-white font-medium hover:bg-[#8a2b24] transition-colors w-full",children:n?(0,b.jsx)(eG.Z7b,{size:20,className:"animate-spin mx-auto"}):r("events:pricingTiers.categories.deleteModal.delete")})]})]})}):null},tv=s(9404),components_AddCategoryButton=e=>{let{eventId:t,className:s}=e,{t:i}=(0,C.$G)(["events"]),n=(0,D.OU)();return(0,b.jsx)(b.Fragment,{children:n.isLoading?(0,b.jsx)(eG.Z7b,{size:20,className:"animate-spin"}):(0,b.jsxs)(tv.Z,{variant:"secondary",className:s,onClick:()=>{n.mutate({eventId:t,name:i("events:pricingTiers.categories.newCategory")})},children:["+ ",i("events:pricingTiers.buttons.addCategory")]})})};let UncategorizedSection=()=>{let{t:e}=(0,C.$G)(["events"]),{hasCustomSections:t,expandedSections:s,toggleSection:i,tiersBySection:n,children:r}=useSectionsContext(),a=n.default||[];return(0,b.jsxs)("div",{className:"w-full order-first md:order-last",children:[(0,b.jsx)("div",{className:ei()("border-t-2 border-[#EBEBEB] -mx-4 md:mx-6 bg-white",{hidden:!t,block:t})}),(0,b.jsxs)("div",{className:ei()("md:px-6 pt-4 flex-col gap-3 bg-white rounded-lg",{hidden:!t,flex:t}),children:[(0,b.jsxs)("button",{type:"button",className:"flex items-center justify-between cursor-pointer text-left w-full",onClick:()=>i("default"),children:[(0,b.jsxs)("h3",{className:"text-lg font-semibold text-black",children:[e("events:pricingTiers.categories.uncategorized"),a.length>0&&(0,b.jsxs)("span",{children:[" (",a.length,")"]})]}),(0,b.jsx)(tr.CgR,{size:24,className:"ml-2 text-black transition-transform duration-200 ".concat(s.default?"":"transform rotate-180")})]}),(0,b.jsx)("p",{className:"text-sm text-[#575757] pb-2",children:e("events:pricingTiers.categories.uncategorizedDescription")})]}),(0,b.jsx)(e0.bK,{droppableId:"default",type:tm.TIERS,children:e=>(0,b.jsxs)("div",{ref:e.innerRef,...e.droppableProps,className:"mb-2 px-2 rounded-2xl",children:[!s.default&&r(a.sort((e,t)=>
1e.sortIndex-t.sortIndex),"default"),e.placeholder]})}),(0,b.jsx)("div",{className:"pb-4"}),(0,b.jsx)("div",{className:ei()("border-b-2 border-[#EBEBEB] -mx-10 md:mx-2",{hidden:!t,"hidden md:block":t})})]})};var components_EditSectionButton=e=>{let{section:t,onDelete:s,deleteMutation:i,editSection:n,handleNameBlur:r,isSelected:a=!1}=e,{t:l}=(0,C.$G)(["events"]),[o,d]=(0,w.useState)(!1);if(a){var c;return(0,b.jsxs)("div",{className:"flex items-center my-5 mx-4 gap-2 ",children:[(0,b.jsx)("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),s(t.id)},type:"button",className:"group p-1 transition-colors",title:l("events:pricingTiers.accessibility.deleteSection"),"aria-label":"".concat(l("events:pricingTiers.accessibility.deleteSection")," ").concat(t.name," section"),children:(0,b.jsx)("div",{className:"group-hover:[&_path]:fill-red-500",children:(null==i?void 0:null===(c=i.variables)||void 0===c?void 0:c.sectionId)===t.id?(0,b.jsx)(eG.Z7b,{size:20,className:"animate-spin"}):(0,b.jsx)(icons_TrashIcon,{})})}),(0,b.jsx)("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),d(!0),r(t.id).finally(()=>{d(!1)})},type:"button",disabled:o,className:"group p-1 transition-colors","aria-label":l("events:pricingTiers.accessibility.saveSectionName"),children:o?(0,b.jsx)(eG.Z7b,{size:20,className:"animate-spin text-black m-[2px]"}):(0,b.jsx)("div",{className:"group-hover:[&_path]:fill-green-500",children:(0,b.jsx)(icons_CheckmarkIcon,{})})})]})}return(0,b.jsx)("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),n(t.id,t.name||"")},type:"button",className:"ml-4 mr-2 text-[#3853C4] text-base font-semibold",title:l("events:pricingTiers.accessibility.editSection"),children:l("events:pricingTiers.categories.edit")})};let SectionHeader=e=>{let{section:t,isEditing:s,isExpanded:i,sectionName:n,tierCount:r,onToggleSection:a,onNameChange:l,onNameBlur:o,onDeleteSection:d,onEditSection:c,onCancelEdit:u,deleteMutation:m,inputRef:x}=e,{t:p}=(0,C.$G)(["events"]);return(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("div",{children:(0,b.jsx)(e1.GZz,{size:25,className:"cursor-grab text-[#787878]"})}),s?(0,b.jsxs)("div",{className:"flex items-center flex-1",children:[(0,b.jsx)("input",{ref:x,placeholder:p("events:pricingTiers.categories.newCategoryPlaceholder"),value:n,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),o()):"Escape"===e.key&&(e.preventDefault(),u())},className:"text-xl font-medium text-gray-500 border rounded px-2 py-1 flex-1"}),(0,b.jsx)("div",{className:"flex items-center",children:(0,b.jsx)(components_EditSectionButton,{section:t,onDelete:d,deleteMutation:m,editSection:c,handleNameBlur:o,isSelected:s})})]}):(0,b.jsxs)("div",{className:"flex items-center justify-between cursor-pointer py-6 pr-4 pl-2 flex-1",onClick:a,children:[(0,b.jsxs)("p",{className:"text-lg font-medium text-black",children:[n,r>0&&(0,b.jsxs)("span",{className:"text-gray-600",children:[" (",r,")"]})]}),(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)(components_EditSectionButton,{section:t,onDelete:d,deleteMutation:m,editSection:c,handleNameBlur:o,isSelected:s}),(0,b.jsx)(tr.CgR,{size:24,className:"ml-2 text-black transition-transform duration-200 ".concat(i?"":"transform rotate-180")})]})]})]})};var components_AddTierToCategoryButton=e=>{let{sectionId:t,onAddTier:s,productsLength:i}=e,{t:n}=(0,C.$G)(["events"]);return(0,b.jsx)("div",{className:"mb-3 px-2",children:(0,b.jsxs)(tv.Z,{variant:"secondary",className:"mt-0 text-base text-[#3853C4] bg-white font-semibold transition-transform active:scale-95",onClick:()=>s(t),disabled:i>=e6._l,children:["+ ",n("events:pricingTiers.buttons.addPublicTierToCategory")]})})};let tg=(0,w.forwardRef)((e,t)=>{var s;let{section:i,provided:n,snapshot:r,snapshotSections:a,onNameBlur:l,onDeleteSection:o,onCancelEdit:d,inputRef:c}=e,{selectedSection:u,sectionNames:m,expandedSections:x,tiersBySection:p,tiers:v,toggleSection:g,handleNameChange:f,editSection:h,deleteMutation:j,addEventPricingTierToSection:y,setAddTierToSectionId:N,children:C}=useSectionsContext(),k=u===i.id,S=p[i.id]||[],T=!x[i.id],_=null!==(s=m[i.id])&&void 0!==s?s:i.name,I=(0,w.useCallback)(()=>{g(i.id)},[g,i.id]),P=(0,w.useCallback)(e=>{f(i.id,e)},[f,i.id]),F=(0,w.useCallback)(()=>l(i.id),[l,i.id]),D=(0,w.useCallback)(()=>{o(i.id)},[o,i.id]),O=(0,w.useCallback)(()=>{h(i.id,i.name)},[h,i.id,i.name]),E=(0,w.useCallback)(e=>{null==N||N(e)},[N]);return(0,b.jsx)("div",{ref:t,...n.draggableProps,...n.dragHandleProps,className:ei()("relative px-0 w-full border-2 border-transparent roun
1ded-lg transition-colors",{"border-[#6585FF] shadow-lg":r.isDragging}),children:(0,b.jsxs)("div",{className:"w-full",children:[(0,b.jsx)("div",{className:"flex items-center",children:(0,b.jsxs)("div",{className:ei()("pl-2 md:pl-5 w-full ml-auto flex flex-col bg-white rounded-2xl transition-all p-0 duration-200 ease-in",{"shadow-[-3px_14px_19.3px_0px_rgba(32,32,32,0.1)] border-2 border-[#6585FF]":r.isDragging,"!mx-1":!r.draggingOver&&a.isDraggingOver}),children:[(0,b.jsx)(SectionHeader,{section:i,isEditing:k,isExpanded:T,sectionName:_,tierCount:S.length,onToggleSection:I,onNameChange:P,onNameBlur:F,onDeleteSection:D,onEditSection:O,onCancelEdit:d,deleteMutation:j,inputRef:c}),(0,b.jsxs)("div",{className:ei()("md:-ml-4 mr-4",{"-mt-4 md:-mt-6":T}),children:[T&&C(S.sort((e,t)=>e.sortIndex-t.sortIndex),i.id),y&&T&&(0,b.jsx)(components_AddTierToCategoryButton,{sectionId:i.id,productsLength:(null==v?void 0:v.length)||0,onAddTier:E})]})]})}),(0,b.jsx)("div",{className:ei()("border-b-2 border-[#EBEBEB] -mx-10 md:mx-2 transition-opacity",{"opacity-0":r.isDragging||a.isDraggingOver,"opacity-100":!r.isDragging&&!a.isDraggingOver})})]})})});tg.displayName="SectionItem";let LoadingSkeleton=e=>{let{count:t=3,showUncategorized:s=!0}=e;return(0,b.jsx)("div",{className:"animate-pulse",children:(0,b.jsxs)("div",{className:"grid grid-flow-row md:grid-flow-col-dense md:auto-cols-fr",children:[s&&(0,b.jsxs)("div",{className:"w-full order-first md:order-last",children:[(0,b.jsx)("div",{className:"border-t-2 border-gray-200 -mx-4 md:mx-6"}),(0,b.jsxs)("div",{className:"md:px-6 pt-4 bg-white",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,b.jsx)("div",{className:"h-6 bg-gray-200 rounded w-36"}),(0,b.jsx)("div",{className:"h-6 w-6 bg-gray-200 rounded"})]}),(0,b.jsx)("div",{className:"h-4 bg-gray-200 rounded w-full max-w-md mb-2"})]}),(0,b.jsxs)("div",{className:"px-2 space-y-2",children:[(0,b.jsx)("div",{className:"h-20 bg-gray-100 rounded-lg"}),(0,b.jsx)("div",{className:"h-20 bg-gray-100 rounded-lg"})]}),(0,b.jsx)("div",{className:"pb-4"}),(0,b.jsx)("div",{className:"border-b-2 border-gray-200 -mx-10 md:mx-2 hidden md:block"})]}),(0,b.jsxs)("div",{className:"w-full order-last md:order-first",children:[(0,b.jsx)("div",{className:"border-t-2 border-gray-200 -mx-4 md:mx-6"}),Array.from({length:t}).map((e,t)=>(0,b.jsx)("div",{className:"relative px-0 w-full",children:(0,b.jsxs)("div",{className:"w-full",children:[(0,b.jsxs)("div",{className:"pl-2 md:pl-5 w-full bg-white rounded-2xl",children:[(0,b.jsxs)("div",{className:"flex items-center py-4",children:[(0,b.jsx)("div",{className:"h-6 w-6 bg-gray-200 rounded mr-2"}),(0,b.jsxs)("div",{className:"flex items-center justify-between flex-1 py-2 pr-4 pl-2",children:[(0,b.jsx)("div",{className:"h-6 bg-gray-200 rounded w-40"}),(0,b.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,b.jsx)("div",{className:"h-6 bg-gray-200 rounded w-12"}),(0,b.jsx)("div",{className:"h-6 w-6 bg-gray-200 rounded"})]})]})]}),(0,b.jsxs)("div",{className:"md:-ml-4 mr-4 space-y-3 pb-4",children:[(0,b.jsx)("div",{className:"h-16 bg-gray-100 rounded-lg"}),(0,b.jsx)("div",{className:"h-16 bg-gray-100 rounded-lg"}),(0,b.jsx)("div",{className:"h-10 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200"})]})]}),(0,b.jsx)("div",{className:"border-b-2 border-gray-200 -mx-10 md:mx-2"})]})},t)),(0,b.jsx)("div",{className:"flex justify-center mt-4 pl-8",children:(0,b.jsx)("div",{className:"h-10 bg-gray-200 rounded w-32"})})]})]})})},SectionsContent=()=>{let e=(0,tp.a)("(min-width: 768px)"),t=(0,w.useRef)(null),[s,i]=(0,w.useState)(!1),[n,r]=(0,w.useState)(null),{eventId:a,sections:l,sortedSections:o,hasCustomSections:d,selectedSection:c,sectionNames:u,handleNameChange:m,clearSelectedSection:x,setSelectedSection:p,createSectionMutation:v,deleteMutation:g,updateSectionName:f,deleteSection:h,onReorder:j,tiers:y,isEventLoading:N}=useSectionsContext();(0,w.useEffect)(()=>{c&&t.current&&t.current.focus()},[c]),(0,w.useEffect)(()=>{if(v.isSuccess&&(null==l?void 0:l.length)>0){let e=l.reduce((e,t)=>
1t.sortIndex>e.sortIndex?t:e);p(e.id),m(e.id,e.name),v.reset()}},[v.isSuccess,l,p,m,v]),(0,w.useEffect)(()=>{g.isSuccess&&(x(),g.reset())},[g.isSuccess,x,g]);let C=(0,w.useCallback)(e=>f(e,u[e]),[f,u]),k=(0,w.useCallback)(e=>{t.current&&t.current.blur(),r(e),i(!0)},[]),S=(0,w.useCallback)(()=>{if(c){let e=null==l?void 0:l.find(e=>e.id===c);e&&m(c,e.name),x()}},[c,l,m,x]),T=(0,w.useCallback)(()=>{var e;n&&(null===(e=g.variables)||void 0===e?void 0:e.sectionId)!==n&&(c===n&&x(),h(n),i(!1),r(null))},[n,g,c,x,h]),_=(0,w.useCallback)(e=>{handleDragEnd({result:e,sections:o,tiers:y,onReorder:j})},[o,y,j]);return N?(0,b.jsx)(LoadingSkeleton,{count:1,showUncategorized:!1}):(0,b.jsxs)("div",{children:[(0,b.jsx)(components_DeleteConfirmationModal,{isOpen:s,onConfirm:T,onCancel:()=>{i(!1),r(null),x()},isDeleting:g.isLoading}),(0,b.jsxs)(e0.Z5,{onDragEnd:_,children:[(0,b.jsx)(e0.bK,{droppableId:"sections",type:tm.SECTIONS,children:(s,i)=>(0,b.jsx)("div",{className:"w-full",ref:s.innerRef,...s.droppableProps,children:(0,b.jsxs)("div",{className:"grid grid-flow-row md:grid-flow-col-dense md:auto-cols-fr",children:[(0,b.jsx)(UncategorizedSection,{}),(0,b.jsxs)("div",{className:ei()("w-full order-last md:order-first transition-colors duration-200 rounded-2xl border-2 border-dashed border-transparent ease-in",{hidden:!d,"bg-[#EFF2FF] !border-[#6585FF]":i.isDraggingOver}),children:[(0,b.jsx)("div",{className:"border-t-2 border-[#EBEBEB] -mx-4 md:mx-6"}),null==o?void 0:o.map((e,s)=>(0,b.jsx)(e0._l,{index:s,draggableId:e.id,children:(s,n)=>(0,b.jsx)(tg,{ref:s.innerRef,section:e,provided:s,snapshot:n,snapshotSections:i,onNameBlur:C,onDeleteSection:k,onCancelEdit:S,inputRef:t})},e.id)),e&&!i.isDraggingOver&&(0,b.jsx)("div",{className:"flex justify-center mt-4 pl-8",children:(0,b.jsx)(components_AddCategoryButton,{eventId:a})}),s.placeholder]})]})})}),(!e||e&&!d)&&(0,b.jsx)("div",{className:"flex flex-col items-center justify-center mb-24",children:(0,b.jsx)(components_AddCategoryButton,{eventId:a})})]})]})};var components_Sections=e=>{let{eventId:t,tiers:s,sections:i,isEventLoading:n,children:r,onReorder:a,onDeleteSection:l,addEventPricingTierToSection:o,setAddTierToSectionId:d}=e,c=useSectionManagement(),u=useSectionMutations({eventId:t,onDeleteSection:l,onSectionUpdated:()=>{c.clearSectionNames(),c.clearSelectedSection()}}),m=useSectionHelpers({tiers:s,sections:i}),x=(0,w.useMemo)(()=>({eventId:t,tiers:s,sections:i,isEventLoading:n,...m,...c,createSectionMutation:u.createSectionMutation,deleteMutation:u.deleteSectionMutation,updateSectionName:u.updateSectionName,deleteSection:u.deleteSection,onDeleteSection:l,addEventPricingTierToSection:o,setAddTierToSectionId:d,onReorder:a,children:r}),[t,s,i,n,m,c,u,l,o,d,a,r]);return(0,b.jsx)(SectionsProvider,{value:x,children:(0,b.jsx)(SectionsContent,{})})};(c=h||(h={})).MAIN="MAIN",c.CREATE_PRODUCT="CREATE_PRODUCT",c.CREATE_PRODUCT_FOR_SECTION="CREATE_PRODUCT_FOR_SECTION",c.EDIT_PRODUCT="EDIT_PRODUCT",c.CREATE_COMPLIMENTARY="CREATE_COMPLIMENTARY";var settings_PricingTiers=()=>{let{t:e}=(0,C.$G)(["events"]),{eventId:t,eventShareToken:s,refetchEvent:i,createDraft:n,isDraft:r,isEditing:a,isLoading:l,lastUpdated:o,handleBack:d,addTierToSectionId:c,setAddTierToSectionId:u}=useEventEditorContext(),[m,x]=(0,w.useState)(0),{data:p,refetch:v}=(0,D.Yq)(t),{products:g,sections:f,publicProducts:h,privateProducts:j,selectedProduct:y,selectedIndex:N,isLoading:k,setSelectedProduct:S,setSelectedIndex:_,addStandardProduct:I,addBundleProduct:P,updateStandardProduct:O,updateBundleProduct:E,deleteStandardProduct:A,deleteBundleProduct:R,toggleStandardProductActive:M,toggleStandardProductVisibility:L,toggleBundleProductActive:Z,toggleBundleProductVisibility:q,addStandardProductToSection:B,addBundleProductToSection:U,reorderProducts:z,deleteSection:G}=hooks_useManageProducts(t),{data:$}=(0,F.po)(),[H,W]=(0,w.useState)("MAIN"),Q=(0,w.useRef)(null),{scrollToRecentlyModifiedProduct:Y,highlightTickets:K}=useTicketHighlight();(0,w.useEffect)(()=>{c&&W("CREATE_PRODUCT_FOR_SECTION")},[c]),(0,w.useEffect)(()=>{t||n()},[t]);let navigateToCreateProduct=()=>{W("CREATE_PRODUCT")},navigateToMain=()=>{W("MAIN"),S(null),u(void 0)},X=0===m?"public":1===m?"private":2===m?"complimentary":null,handleAddProductToSection=(t,s)=>{if("admission"===s.type||"addon"===s.type){var n,r,a,l;let o={type:s.type,name:s.name,description:s.description,price:s.price,isPrivate:s.isPrivate,isActive:s.isActive,imageUrl:s.imageUrl,startDate:s.startDate,endD
1ate:s.endDate,maxQuantity:s.maxQuantity,purchaseRequirements:{requiresApproval:(null===(n=s.purchaseRequirements)||void 0===n?void 0:n.requiresApproval)||!1,questions:(null===(r=s.purchaseRequirements)||void 0===r?void 0:r.questions)||[],requiredOrganizationIds:(null===(a=s.purchaseRequirements)||void 0===a?void 0:a.requiredOrganizationIds)||[],requiredAssociationIds:(null===(l=s.purchaseRequirements)||void 0===l?void 0:l.requiredAssociationIds)||[]}};B(t,o,{onSuccess:e=>{Y(e.id),i(),u(void 0),navigateToMain()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.addProductToSection"),message:null==t?void 0:t.message})}})}else{let n={name:s.name,description:s.description,price:s.price,isPrivate:s.isPrivate,isActive:s.isActive,imageUrl:s.imageUrl,startDate:s.startDate,endDate:s.endDate,components:s.components||[]};U(t,n,{onSuccess:e=>{Y(e.id),i(),u(void 0),navigateToMain()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.addProductToSection"),message:null==t?void 0:t.message})}})}return!0},handleToggleProductActiveState=(t,s)=>{let n=g.find(e=>e.id===t);n&&"bundle"===n.type?Z(t,s,{onSuccess:()=>{i()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.toggleBundleProductStatus"),message:null==t?void 0:t.message})}}):M(t,s,{onSuccess:()=>{i()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.toggleStandardProductStatus"),message:null==t?void 0:t.message})}})},handleToggleProductVisibility=t=>{let s=g.find(e=>e.id===t);s&&"bundle"===s.type?q(t,{onSuccess:()=>{i()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.toggleBundleProductVisibility"),message:null==t?void 0:t.message})}}):L(t,{onSuccess:()=>{i()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.toggleStandardProductVisibility"),message:null==t?void 0:t.message})}})},handleProductSelect=(e,t)=>{_(t),S(e),W("EDIT_PRODUCT")};if(!t||!g)return(0,b.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,b.jsx)(eF.Z,{type:eF.d.PRIMARY})});switch(H){case"CREATE_PRODUCT":return(0,b.jsx)(forms_TicketForm,{user:$,onSubmit:t=>{if("admission"===t.type||"addon"===t.type){var s,n,r,a;let l={type:t.type,name:t.name,description:t.description,price:t.price,isPrivate:t.isPrivate,isActive:t.isActive,imageUrl:t.imageUrl,startDate:t.startDate,endDate:t.endD
1ate,maxQuantity:t.maxQuantity,purchaseRequirements:{requiresApproval:(null===(s=t.purchaseRequirements)||void 0===s?void 0:s.requiresApproval)||!1,questions:(null===(n=t.purchaseRequirements)||void 0===n?void 0:n.questions)||[],requiredOrganizationIds:(null===(r=t.purchaseRequirements)||void 0===r?void 0:r.requiredOrganizationIds)||[],requiredAssociationIds:(null===(a=t.purchaseRequirements)||void 0===a?void 0:a.requiredAssociationIds)||[]}};I(l,{onSuccess:e=>{Y(e.id),i(),navigateToMain()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.addProduct"),message:null==t?void 0:t.message})}})}else{let s={name:t.name,description:t.description,price:t.price,isPrivate:t.isPrivate,isActive:t.isActive,imageUrl:t.imageUrl,startDate:t.startDate,endDate:t.endDate,components:t.components||[]};P(s,{onSuccess:e=>{Y(e.id),i(),navigateToMain()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.addBundleProduct"),message:null==t?void 0:t.message})}})}},onCancel:navigateToMain,isTierPrivate:"private"===X,isDraft:r,isEditing:a,isLoading:l||k,lastUpdated:o});case"CREATE_PRODUCT_FOR_SECTION":return(0,b.jsx)(forms_TicketForm,{user:$,onSubmit:e=>c&&handleAddProductToSection(c,e),onCancel:()=>{navigateToMain(),u(void 0)},isTierPrivate:!1,isDraft:r,isEditing:a,isLoading:l||k,lastUpdated:o,formTitle:e("events:pricingTiers.ticketForm.addTierToSection")});case"EDIT_PRODUCT":return(0,b.jsx)(forms_TicketForm,{user:$,ticket:y||null,onSubmit:t=>{if(y){if("admission"===y.type||"addon"===y.type){var s,n,r,a;let l={name:t.name,description:t.description,price:t.price,isPrivate:t.isPrivate,isActive:t.isActive,isVisible:t.isVisible,imageUrl:t.imageUrl,startDate:t.startDate,endDate:t.endD
1ate,maxQuantity:t.maxQuantity,purchaseRequirements:{requiresApproval:(null===(s=t.purchaseRequirements)||void 0===s?void 0:s.requiresApproval)||!1,questions:(null===(n=t.purchaseRequirements)||void 0===n?void 0:n.questions)||[],requiredOrganizationIds:(null===(r=t.purchaseRequirements)||void 0===r?void 0:r.requiredOrganizationIds)||[],requiredAssociationIds:(null===(a=t.purchaseRequirements)||void 0===a?void 0:a.requiredAssociationIds)||[]}};O(y.id,l,{onSuccess:e=>{i(),navigateToMain(),Y(e.id)},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.updateProduct"),message:null==t?void 0:t.message})}})}else{let s={name:t.name,description:t.description,price:t.price,isPrivate:t.isPrivate,isActive:t.isActive,isVisible:t.isVisible,imageUrl:t.imageUrl,startDate:t.startDate,endDate:t.endDate,components:t.components||[]};E(y.id,s,{onSuccess:e=>{Y(e.id),i(),navigateToMain()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.updateBundleProduct"),message:null==t?void 0:t.message})}})}i(),navigateToMain()}},onCancel:navigateToMain,onRemove:()=>{y&&("admission"===y.type||"addon"===y.type?A(y.id,{onSuccess:()=>{i(),navigateToMain()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.deleteProduct"),message:null==t?void 0:t.message}),navigateToMain()}}):R(y.id,{onSuccess:()=>{i(),navigateToMain()},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.deleteBundleProduct"),message:null==t?void 0:t.message}),navigateToMain()}}))},isTierPrivate:"private"===X,isDraft:r,isEditing:a,isLoading:l||k,lastUpdated:o});case"CREATE_COMPLIMENTARY":return(0,b.jsx)(forms_ComplimentaryTicketForm,{eventId:t,refetchTickets:v,onCancel:navigateToMain,isDraft:r,isEditing:a,isLoading:l||k,lastUpdated:o});default:var J;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:r,isEditing:a,title:e("events:pricingTiers.title"),isLoading:l||k,lastUpdated:o,onBack:d}),(0,b.jsx)("div",{ref:Q,className:"pt-[50px] md:pt-[180px] -mt-[90px] pb-20 max-w-[630px] md:max-w-[1128px] md:mx-auto flex justify-center overflow-x-hidden",children:(0,b.jsxs)("div",{className:"p-4 ",children:[(0,b.jsx)("div",{className:"max-w-[630px] mx-auto",children:(0,b.jsx)(components_FeesPaidBy,{})}),(0,b.jsx)("div",{className:"py-6",children:(0,b.jsxs)(eW.mQ,{selectedIndex:m,onSelect:e=>x(e),children:[(0,b.jsxs)(eW.td,{className:"flex text-center justify-between border-b text-base border-gray-100 text-gray-500 max-w-[630px] mx-auto md:mt-8",children:[(0,b.jsxs)(eW.OK,{className:"w-full py-3 text-center cursor-pointer",selectedClassName:"text-primary-500 border-b-4 border-primary-400 ",children:[e("events:pricingTiers.tabs.public")," (",h.length,"/",e6._l,")"]}),(0,b.jsxs)(eW.OK,{className:"w-full py-3 text-center cursor-pointer",selectedClassName:"text-primary-500 border-b-4 border-primary-400",children:[e("events:pricingTiers.tabs.private")," (",j.length,"/",e6.cA,")"]}),(0,b.jsxs)(eW.OK,{className:"w-full py-3 text-center cursor-pointer",selectedClassName:"text-primary-500 border-b-4 border-primary-400",children:[e("events:pricingTiers.tabs.comp")," (",(null==p?void 0:p.items.length)||0,"/",e6.dQ,")"]})]}),(0,b.jsxs)(eW.x4,{children:[(0,b.jsx)("p",{className:"pt-6 pb-4 font-normal text-base text-gray-500 max-w-[630px] mx-auto md:mb-12",children:e("events:pricingTiers.descriptions.publicTickets")}),(0,b.jsx)(components_Sections,{eventId:t,sections:f,tiers:h,isEventLoading:l||k,onReorder:(t,s)=>{let i=g.map(e=>{let s=t.find(t=>t.id===e.id);return s?{productId:e.id,sortIndex:s.sortIndex||0,sectionId:"default"===s.sectionId?void 0:s.sectionId}
1:{productId:e.id,sortIndex:e.sortIndex||0,sectionId:e.sectionId}}),n=s.map(e=>({id:e.id,sortIndex:e.sortIndex||0}));z(i,n,{onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.reorderProducts"),message:null==t?void 0:t.message})}})},onDeleteSection:t=>{G(t,{onSuccess:e=>{K(e.map(e=>e.id))},onError(t){(0,T.x2)({title:e("events:pricingTiers.errors.deleteSection"),message:null==t?void 0:t.message})}})},addEventPricingTierToSection:handleAddProductToSection,setAddTierToSectionId:u,children:(e,i)=>(0,b.jsx)(components_Tickets,{eventId:t,eventShareToken:s,tickets:e,selectedIndex:N,selectedTicket:y||null,toggleTicketTier:(e,t)=>handleToggleProductActiveState(e,!t),toggleHideTier:handleToggleProductVisibility,setSelectedIndex:e=>{let t=g.find(t=>t.id===e),s=g.findIndex(t=>t.id===e);t&&-1!==s&&handleProductSelect(t,s)},setSelectedTicket:e=>{let t=g.find(t=>t.id===e.id),s=g.findIndex(t=>t.id===e.id);t&&-1!==s&&handleProductSelect(t,s)},isSortable:!0,sectionId:i})}),(0,b.jsx)("div",{className:"mt-6 flex justify-center w-full fixed left-0 bottom-0 bg-white pb-8 z-50 md:pb-4 border-t-1 px-4 py-4 shadow-primary-50 shadow-top md:shadow-none",children:(0,b.jsx)(V.ZP,{type:V.L$.Primary,className:"w-full md:max-w-[343px] bg-[#3853C4]! text-white",disabled:h.length>=e6._l,onClick:navigateToCreateProduct,children:e("events:pricingTiers.buttons.addTicketTier")})})]}),(0,b.jsxs)(eW.x4,{children:[(0,b.jsx)("p",{className:"pt-6 font-normal text-base text-gray-500 max-w-[630px] mx-auto md:mb-12",children:e("events:pricingTiers.descriptions.privateTickets")}),(0,b.jsx)(components_Tickets,{eventId:t,eventShareToken:s,tickets:j,selectedIndex:N,selectedTicket:y||null,toggleTicketTier:(e,t)=>handleToggleProductActiveState(e,!t),toggleHideTier:handleToggleProductVisibility,setSelectedIndex:e=>{let t=g.find(t=>t.id===e),s=g.findIndex(t=>t.id===e);t&&-1!==s&&handleProductSelect(t,s)},setSelectedTicket:e=>{let t=g.find(t=>t.id===e.id),s=g.findIndex(t=>t.id===e.id);t&&-1!==s&&handleProductSelect(t,s)}}),(0,b.jsx)("div",{className:"mt-6 flex justify-center w-full fixed left-0 bottom-0 bg-white pb-8 z-50 md:pb-4 border-t-1 px-4 py-4 shadow-primary-50 shadow-top md:shadow-none",children:(0,b.jsx)(V.ZP,{type:V.L$.Primary,className:"w-full md:max-w-[343px] bg-[#3853C4]! text-white",disabled:j.length>=e6.cA,onClick:navigateToCreateProduct,children:e("events:pricingTiers.buttons.addPrivateProduct")})})]}),(0,b.jsx)(eW.x4,{children:t?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("p",{className:"pt-6 font-normal text-base text-gray-500 max-w-[630px] mx-auto md:mb-12",children:e("events:pricingTiers.complimentaryInfo")}),(0,b.jsx)(settings_ComplimentaryTickets,{tickets:null==p?void 0:p.items}),(0,b.jsx)("div",{className:"mt-6 flex justify-center w-full fixed left-0 bottom-0 bg-white pb-8 z-50 md:pb-4 border-t-1 px-4 py-4 shadow-primary-50 shadow-top md:shadow-none",children:(0,b.jsx)(V.ZP,{type:V.L$.Primary,className:"w-full md:max-w-[343px] bg-[#3853C4]! text-white",disabled:(null==p?void 0:null===(J=p.items)||void 0===J?void 0:J.length)>=e6.dQ||!t,onClick:()=>{W("CREATE_COMPLIMENTARY")},children:e("events:pricingTiers.buttons.addComplimentaryTicket")})})]}):(0,b.jsx)("p",{className:"pt-6 font-normal text-base text-red-500 text-center max-w-[630px] mx-auto md:mb-12",children:e("events:pricingTiers.messages.addEventTitleFirst")})})]})})]})})]})}},tf=s(69120),th=s(9422),tb=s(44319),create_event_TrackingLinksPage=()=>{var e,t;let{t:s}=(0,C.$G)(["events"]),{eventId:i,isDraft:n,isEditing:r,isLoading:a,lastUpdated:l,handleBack:o,navigateToEventSettings:d}=useEventEditorContext(),{data:c}=(0,D.Q3)(i),{data:u,isLoading:m,error:x}=(0,D._t)(i,{enabled:null==c?void 0:c.isOrganizer}),{data:p}=(0,D.cI)(i,null==c?void 0:c.isOrganizer),v=(null==p?void 0:null===(e=p.totals)||void 0===e?void 0:e.payoutAmount)||0,g=(null==p?void 0:null===(t=p.totals)||void 0===t?void 0:t.ticketsSold)||0;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:n,isEditing:r,title:s("events:settings.trackingLinks.page.title"),isLoading:a,lastUpdated:l,onBack:o,onMenuClick:d}),(0,b.jsx)(ee.Z,{children:(0,b.jsxs)("div",{className:"pt-[36x] md:pt-[90px] -mt-[36px] pb-20 md:mx-auto",children:[(0,b.jsx)(tf.Z,{error:x,views:null==u?void 0:u.views,sales:g,revenue:v,isLoading:m}),(0,b.jsx)(th.Z,{trackingLinks:null==u?void 0:u.trackingLinks})]})}),(0,b.jsx)(tb.Z,{eventId:i})]})},tj=s(78716),ty=s(10554),tN=s(14416),tw=s(63750),tC=s(94580),tk=s(20057);let DiscountCodeActionsMenu=e=>{let{code:t,onEditButtonClick:s,onDeleteButtonClick:i,onClose:n}=e,{t:r}=(0,C.$G)("events");return(0,b.jsx)(G.Z,{visible:!0,type:G.w.ALERT,onClose:n,children:(0,b.jsxs)("div",{className:"m-8",children:[(0,b.jsxs)("div",{className:"flex items-center text-ellipsis overflow-hidden",children:[(0,b.jsx)(eu.YxP,{className:"mr-2",size:24}),(0,b.jsx)("h2",{className:"text-base font-semibold",children:t})]}),(0,b.jsx)("div",{className:"mt-8",children:(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:s,children:r("settings.discountCodes.page.editDiscountCode")})}),(0,b.jsx)("div",{className:"mt-4",children:(0,b.jsx)(V.ZP,{type:V.L$.Danger,onClick:i,children:r("settings.discountCodes.page.deleteDiscountCode")})})]})})},DiscountCodeCardSkeleton=()=>(0,b.jsxs)("div",{className:"mt-6 bg-white shadow-xl rounded-2xl border-gray-100 border-1 animate-pulse",children:[(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsx)("div",{className:"flex items-center justify-between",children:(0,b.jsxs)("div",{className:"flex items-center text-ellipsis overflow-hidden",children:[(0,b.jsx)(eu.YxP,{className:"mr-2",size:24}),(0,b.jsx)("div",{className:"text-3xl font-semibold h-3 w-20 bg-gray-300 rounded-full"})]})}),(0,b.jsx)("div",{className:"flex mt-3 items-center",children:(0,b.jsx)("div",{className:"font-semibold h-3 w-20 bg-gray-300 rounded-full"})})]}),(0,b.jsxs)("div",{className:"flex bg-primary-200 justify-between p-6",children:[(0,b.jsx)("div",{className:"mt-2 text-3xl font-semibold h-12 w-12 bg-gray-300 rounded-full"}),(0,b.jsx)("div",{className:"mt-2 text-3xl font-semibold h-12 w-12 bg-gray-300 rounded-full"})]})]}),DiscountCodeCard=e=>{let{discountCode:t,analytics:s,onEdit:i,onDelete:n}=e,{t:r}=(0,C.$G)("events"),a=(0,tN.I0)(),l="".concat(window.location.origin,"/events/").concat(t.eventId,"?discountCode=").concat(t.code),[o,d]=(0,w.useState)(!1),[c,u]=(0,w.useState)(!1),handleCloseEditForm=()=>u(!1),handleOpenDeleteConfirmation=()=>{n(t)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"mb-6 mx-auto md:w-[472px] bg-white shadow-xl rounded-2xl border-gray-100 border-1",children:[(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center text-ellipsis overflow-hidden",children:[(0,b.jsx)(eu.YxP,{className:"mr-2",size:24}),(0,b.jsx)("h2",{className:"text-base font-semibold",children:t.code})]}),(0,b.jsx)("div",{children:(0,b.jsx)(V.ZP,{type:V.L$.Text,icon:(0,b.jsx)(tw.evw,{className:"text-gray-400",size:24}),onClick:()=>d(!0)})})]}),(0,b.jsxs)("div",{className:"flex mt-3 items-center",children:[(0,b.jsx)("div",{className:"w-full border-1 border-gray-200 rounded-2xl px-4 py-2",children:(0,b.jsx)("input",{className:"w-full text-gray-400 truncate",value:l})}),(0,b.jsx)("div",{className:"w-[100px] ml-4",children:(0,b.jsx)(tj.Z,{message:r("settings.discountCodes.page.copy"),copyText:l})})]}),(0,b.jsxs)("div",{className:"mt-3 flex items-center",children:[t.isActive?(0,b.jsx)("div",{className:"mx-1 text-primary-500 font-normal",children:r("settings.discountCodes.page.active")}):(0,b.jsx)("div",{className:"mx-1 text-gray-400 font-normal",children:r("settings.discountCodes.page.paused")}),(0,b.jsx)("div",{className:"ml-2 mt-1 mb-1 cursor-pointer",children:(0,b.jsx)(B.Z,{size:B.h.MEDIUM,isActive:t.isActive,onClick:e=>{if(e.stopPropagation(),t.isActive){i({...t,isActive:!1});return}i({...t,isActive:!0})}})})]})]}),(0,b.jsxs)("div",{className:"flex bg-primary-200 justify-between p-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"text-base flex items-center font-normal",children:[(0,b.jsx)(eu.ZXh,{className:"mr-1 text-lg font-normal"}),r("settings.discountCodes.page.discount")]}),(0,b.jsxs)("div",{className:"mt-2 text-3xl font-semibold",children:["amount"===t.discount.kind&&"$",t.discount.value||0,"percentage"===t.discount.kind&&"%"]})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"text-base flex items-center font-normal",children:[(0,b.jsx)(eC.uy7,{className:"mr-1 text-lg"}),r("settings.discountCodes.page.sales")]}),(0,b.jsxs)("div",{className:"mt-2 text-3xl font-semibold",children:[t.numberOfUses||0,!!t.maxUsage&&(0,b.jsxs)("span",{className:"text-xl",children:["/",t.maxUsage]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"text-base flex items-center font-normal",children:[(0,b.jsx)("img",{src:"/img/events/cash.svg",className:"mr-1"}),r("settings.discountCodes.page.revenue")]}),(0,b.jsx)("div",{className:"mt-2 text-3xl font-semibold",children:(0,e2.O)(null==s?void 0:s.revenue)})]})]})]}),o&&(0,b.jsx)(DiscountCodeActionsMenu,{code:t.code,onEditButtonClick:()=>{d(!1),u(!0)},onDeleteButtonClick:handleOpenDeleteConfirmation,onClose:()=>d(!1)}),c&&(0,b.jsx)(tC.Z,{initialValues:t,title:r("settings.discountCodes.page.editDiscountCode"),eventId:t.eventId,onDelete:handleOpenDeleteConfirmation,onSubmit:e=>{i({...t,...e,discount:{value:e.discount.value,kind:e.discount.kind}},()=>{a((0,ty.K4)("ALERT",{type:"success",message:r("settings.discountCodes.page.updateSuccess",{code:e.code})}))}),handleCloseEditForm()},onClose:handleCloseEditForm})]})};var DiscountCodePage=()=>{let{t:e}=(0,C.$G)("events"),{eventId:t,isDraft:s,isEditing:i,isLoading:n,lastUpdated:r,handleBack:a,navigateToEventSettings:l}=useEventEditorContext(),o=(0,tN.I0)(),d=(0,eK.useQueryClient)(),[c,u]=(0,w.useState)(!1),handleCloseCreateForm=()=>u(!1),{data:m,isLoading:x,error:p}=(0,D.xi)(t,{enabled:!0}),{data:v,isLoading:g,error:f}=(0,D.av)(t,{enabled:!0}),h=(0,w.useMemo)(()=>g||f?{}:v.reduce((e,t)=>
1(e[t.discountCodeId]=t,e),{}),[g,f,v]),j=(0,D.u$)(),y=(0,D.Pp)(),N=(0,D.ik)(),handleCreateDiscountCode=s=>{j.mutate({eventId:t,body:s},{onSuccess:t=>{let s=d.getQueryData(["events/discountCodes",t.eventId]);d.setQueryData(["events/discountCodes",t.eventId],{...s,discountCodes:[...s.discountCodes,t]}),handleCloseCreateForm(),o((0,ty.K4)("ALERT",{type:"success",message:e("settings.discountCodes.page.createSuccess",{code:t.code})}))},onError:e=>{o((0,ty.K4)("ALERT",{message:null==e?void 0:e.message}))}})},handleUpdateDiscountCode=(e,t)=>{y.mutate({eventId:e.eventId,discountCodeId:e.id,body:{code:e.code,discount:e.discount,...e.maxUsage&&{maxUsage:e.maxUsage},...e.startDate&&{startDate:e.startDate},...e.endDate&&{endDate:e.endDate},...e.tierIds&&{tierIds:e.tierIds},isActive:e.isActive}},{onSuccess:e=>{let s=d.getQueryData(["events/discountCodes",e.eventId]);d.setQueryData(["events/discountCodes",e.eventId],{...s,discountCodes:s.discountCodes.map(t=>e.id===t.id?e:t)}),t&&t()},onError:e=>{o((0,ty.K4)("ALERT",{message:null==e?void 0:e.message}))}})},handleDeleteDiscountCode=s=>{N.mutate({eventId:s.eventId,discountCodeId:s.id},{onSuccess:()=>{let i=d.getQueryData(["events/discountCodes",t]);d.setQueryData(["events/discountCodes",t],{...i,discountCodes:i.discountCodes.filter(e=>
1e.id!==s.id)}),o((0,ty.K4)("ALERT",{type:"success",message:e("settings.discountCodes.page.deleteSuccess",{code:s.code})}))},onError:e=>{o((0,ty.K4)("ALERT",{message:null==e?void 0:e.message}))}})},handleOpenDeleteConfirmation=t=>{o((0,ty.K4)("CONFIRMATION",{message:e("settings.discountCodes.page.deleteConfirmation",{code:t.code}),onSuccess:e=>{let{close:s}=e;handleDeleteDiscountCode(t),s()}}))};return x||g?(0,b.jsxs)("div",{className:"w-full px-4 md:w-[472px] mx-auto md:pt-[90px] pb-20",children:[(0,b.jsx)(DiscountCodeCardSkeleton,{}),(0,b.jsx)(DiscountCodeCardSkeleton,{}),(0,b.jsx)(DiscountCodeCardSkeleton,{})]}):((p||f)&&o((0,ty.K4)("ALERT",{message:(null==p?void 0:p.message)||f})),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:s,isEditing:i,title:e("settings.discountCodes.page.title"),isLoading:n,lastUpdated:r,onBack:a,onMenuClick:l}),(0,b.jsx)(ee.Z,{children:(0,b.jsxs)("div",{className:"relative w-full rounded-2xl px-4 md:pt-[90px] pb-20",children:[(null==m?void 0:m.discountCodes.length)===0&&(0,b.jsxs)("div",{className:"py-52 mx-auto text-center",children:[(0,b.jsx)("img",{src:"/img/events/create/discount-codes.png",className:"mx-auto"}),(0,b.jsx)("div",{className:"text-sn font-normal text-gray-500",children:e("settings.discountCodes.page.emptyState")})]}),(0,b.jsx)("div",{className:ei()("w-full mx-auto",{"blur-sm":!!(null==p?void 0:p.message)}),children:null==m?void 0:m.discountCodes.map(e=>(0,b.jsx)(DiscountCodeCard,{discountCode:e,analytics:h[e.id],onEdit:handleUpdateDiscountCode,onDelete:handleOpenDeleteConfirmation},e.id))})]})}),(0,b.jsx)(tk.Z,{handleAddDiscountCode:()=>u(!0)}),c&&(0,b.jsx)(tC.Z,{eventId:t,onSubmit:e=>{handleCreateDiscountCode({code:e.code,discount:{value:e.discount.value,kind:e.discount.kind},...e.maxUsage&&{maxUsage:e.maxUsage},...e.startDate&&{startDate:e.startDate},...e.endDate&&{endDate:e.endDate},...e.tierIds&&{tierIds:e.tierIds}})},onClose:handleCloseCreateForm})]}))},create_event_PublishModal=e=>{let{isLoading:t,onClose:s,onPublish:i}=e,{t:n}=(0,C.$G)(["events"]);return(0,b.jsx)(G.Z,{visible:!0,type:G.w.ALERT,children:(0,b.jsxs)("div",{className:"px-4 text-center",children:[(0,b.jsx)("p",{className:"text-6xl py-6",children:"\uD83D\uDE80"}),(0,b.jsx)("p",{className:"text-xl px-10 font-semibold",children:n("events:createEvent.confirmation.title")}),(0,b.jsx)("p",{className:"mt-6 text-lg px-10 font-normal",children:n("events:createEvent.confirmation.subtitle")}),(0,b.jsx)("div",{className:"mt-8",children:(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:i,loading:t,children:n("events:createEvent.confirmation.makeOfficial")})}),(0,b.jsx)("button",{type:"button",className:"text-base text-primary-500 mt-2 p-2 font-semibold",onClick:s,children:n("events:createEvent.confirmation.backToBuilder")})]})})},tS=s(57921),create_event_PublicationRequestedModal=e=>{let{eventCoverImgUrl:t}=e,{t:s}=(0,C.$G)("organizations"),i=(0,N.useRouter)();return(0,b.jsx)(G.Z,{visible:!0,type:G.w.ALERT,children:(0,b.jsxs)("div",{className:"p-4 text-center",children:[(0,b.jsx)("div",{className:"px-10 py-6",children:(0,b.jsx)("img",{src:t,className:"rounded-xl"})}),(0,b.jsx)("p",{className:"text-2xl font-bold",children:s("publicationRequest.title")}),(0,b.jsx)("p",{className:"my-4 text-lg px-6 font-semibold text-gray-600",children:s("publicationRequest.message")}),(0,b.jsx)("p",{className:"text-xs px-6 text-gray-400",children:s("publicationRequest.description")}),(0,b.jsx)("div",{className:"mt-10",children:(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:()=>{i.push("/dashboard"),(0,E.XH)()&&(0,E.mG)(A.jj)},children:s("publicationRequest.backToHome")})})]})})},tT=s(63322),t_=s(61458),tI=s(33703),tP=s(90379),tF=s(46718),tD=s(36606),tO=s(31776);s(31614);var tE=s(65295);let SurveyWrapper=e=>{let{schema:t,onSubmit:s,onUploadFiles:i,onClearFiles:n}=e,r=new t_.Hnr(t);return r.applyTheme(tF.Q),r.onComplete.add(s),r.onUploadFiles.add(i),r.onClearFiles.add(n),(0,b.jsx)(tT.md,{model:r})};var create_event_RequestToPublishForm=()=>{let{associationId:e,requestToPublishFormId:t,requestToPublishWorkflowId:s,requestPublication:i,requestPublicationWorkflow:n,isDraft:r,isEditing:a,isLoading:l,lastUpdated:o,handleBack:d,navigateToEventSettings:c}=useEventEditorContext(),[u,m]=(0,w.useState)(!1),[x,p]=(0,w.useState)({}),{data:v,isLoading:g,isError:f}=(0,D.Vv)(t),h=(0,D.Ws)(),{data:j,isLoading:y,isError:N}=(0,tD.zL)({associationId:e,workflowId:s}),{data:C,isLoading:k,isError:S}=(0,tE.$G)({associationId:e,formId:null==j?void 0:j.formId}),{onUploadFiles:T,onClearFiles:_,executePendingDeletions:I,clearPendingDeletions:P}=(0,tO.K)({associationId:e});return(w.useEffect(()=>()=>P(),[P]),(0,w.useEffect)(()=>{(null==C?void 0:C.schema)?p(C.schema):(null==v?void 0:v.schema)&&!(null==C?void 0:C.schema)&&p(v.schema)},[null==v?void 0:v.schema,null==C?void 0:C.schema]),g||u||y||k)?(0,b.jsx)(tP.Z,{isLoading:!0}):f||s&&N||S&&t||t&&!(null==v?void 0:v.id)?(0,b.jsx)(tI.Z,{to:"/404"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:r,isEditing:a,title:"Request to publish",isLoading:l,lastUpdated:o,onBack:d,onMenuClick:c}),(0,b.jsx)(ee.Z,{children:(0,b.jsx)("div",{className:"pt-[50px] md:pt-[120px] -mt-[90px] pb-20",children:(0,b.jsx)(SurveyWrapper,{schema:x,onSubmit:e=>{let{data:r}=e;m(!0),s?n(r):h.mutate({formId:t,body:r},{onSuccess:async e=>{await I(),i({responseId:e.id})},onError:()=>{P(),m(!1)}})},onUploadFiles:T,onClearFiles:_})})})]})},tA=s(59704),tR=s.n(tA),tM=s(98913),tL=s.n(tM),tZ=s(59875),components_ConfirmModal=e=>{let{seriesId:t,initialEventStartDate:s,initialSeriesStartDate:i,initialSeriesEndDate:n,toggleConfirmModal:r,isOpen:a}=e,{values:l,submitForm:o}=(0,y.u6)(),d=!i&&!eP()(s).isSame(l.startDate)||i&&!eP()(i).isSame(l.startDate),c="Create Recurring Drafts?";t?c="Updating Recurring Settings":d&&(c="Update First Event and Create Series");let u="This will create the selected number of linked drafts, each with the same details and settings as your first event. These drafts can be individually edited after creation.";return t&&(u=l.repeats?l.endsAfter!==n?"Changing the “ends after” date will remove all events beyond the new end date. This includes any events with custom edits. Are you sure you want to proceed?":"These 
1changes will overwrite any custom edits made to individual events in this recurring series.":'Setting this event to "Does not repeat" will keep the first event but delete all draft instances in the series, including those with custom edits. Are you sure you want to continue?'),(0,b.jsx)(G.Z,{visible:a,onClose:r,type:G.w.SMALL,autoHeight:!0,title:c,icon:(0,b.jsx)("div",{className:"bg-yellow-100 flex-1 h-full flex items-center justify-center text-yellow-800",children:(0,b.jsx)(e_.iUH,{size:20})}),renderFooter:()=>(0,b.jsxs)("div",{className:"flex gap-5",children:[(0,b.jsx)(V.ZP,{type:V.L$.Inverted,onClick:r,newRadius:!0,children:"Cancel"}),(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:o,newRadius:!0,children:t?"Confirm Changes":"Ok, Continue"})]}),children:(0,b.jsxs)("div",{className:"p-4",children:[d&&(0,b.jsx)("p",{className:"text-base font-normal text-neutral-600 pb-5",children:"Updating the start date / time will adjust the current start date / time of your first draft."}),(0,b.jsx)("p",{className:"text-base font-normal text-neutral-600",children:u})]})})};let tq={[eD.P3.Weekly]:{value:1,type:"week"},[eD.P3.BiWeekly]:{value:2,type:"weeks"},[eD.P3.Monthly]:{value:1,type:"month"}},tB=[{value:eD.P3.Weekly,label:eD.Dr[eD.P3.Weekly]},{value:eD.P3.BiWeekly,label:eD.Dr[eD.P3.BiWeekly]},{value:eD.P3.Monthly,label:eD.Dr[eD.P3.Monthly]}];var forms_RecurringSettingsForm=e=>{let t,{eventId:s,createDraft:i,isLoading:n,seriesId:r,initialEventStartDate:a,initialSeriesStartDate:l,initialSeriesEndDate:o,showTierDatesWarning:d,canEdit:c=!0}=e,{values:m,setFieldValue:x}=(0,y.u6)(),[p,v]=(0,w.useState)(!1);t=!c||(r?m.repeats&&!m.endsAfter:!m.repeats||m.repeats&&!m.endsAfter);let toggleConfirmModal=()=>{v(e=>!e)},resetEndsAfter=()=>{m.endsAfter&&x("endsAfter","")},g=(0,w.useMemo)(()=>{let e={value:"",label:"Does not repeat"};if(!m.startDate)return[e];let t=eP()(m.startDate).format("dddd");return[e,...tB.map(e=>({value:e.value,label:"".concat(e.label," on ").concat(t)}))]},[m.startDate]),f=(0,w.useMemo)(()=>{let e={value:"",label:"Select a number of events"};if(!m.startDate||!m.repeats)return[e];let t=[];return tL()(9).forEach(e=>{let s;let i=e>0?t[e-1].value:m.startDate;s=m.repeats===eD.P3.Monthly?function(e,t){let s=eP()(e),i=s.day(),n=s.date(),r=eP()(t).add(1,"month").startOf("month"),a=r.day()<=i?r.day(i):r.add(1,"week").day(i);return a.add(Math.ceil(n/7)-1,"weeks")}(m.startDate,i):eP()(i).add(tq[m.repeats].value,tq[m.repeats].type),t.push({value:s.toISOString(),label:"".concat(s.format("MMMM D, YYYY")," (").concat(e+2," events)")})}),[e,...t]},[m.startDate,m.repeats]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ee.Z,{children:(0,b.jsxs)("div",{className:"pt-[84px] md:pt-[180px] -mt-[90px] pb-48 md:w-[630px] md:mx-auto px-4",onClick:async()=>{s||await i()},children:[(0,b.jsx)("p",{className:"text-base font-normal text-neutral-600",children:"Repeating an event creates up to 10 linked drafts with all details and settings copied. Each draft in the series can be edited individually."}),d&&(0,b.jsxs)("div",{className:"bg-yellow-100 p-4 text-yellow-800 text-base font-normal mt-4 rounded-xl",children:[(0,b.jsx)("h3",{className:"text-yellow-800 text-sm font-semibold pb-2",children:"REMINDER ABOUT TICKET TIERS"}),(0,b.jsxs)("p",{className:"text-base",children:["If you've set specific dates for ticket tiers, these dates will ",(0,b.jsx)("em",{children:"NOT"})," automatically adjust when you modify event dates. Please remember to:"]}),(0,b.jsxs)("ul",{className:"list-disc list-inside",children:[(0,b.jsx)("li",{children:"Review your ticket tier start / end dates."}),(0,b.jsx)("li",{children:"Manually update them to align with your new event schedule."})]})]}),(0,b.jsx)("h3",{className:"text-base font-semibold pb-4 pt-9",children:"Start Date & Time (Linked to First Draft)"}),(0,b.jsx)(wysiwyg_form_DateTime,{name:"startDate",dateLabel:"Start date*",timeLabel:"Start time*",datePlaceholder:"Select a date",timePlaceholder:"Select a time",min:new Date,inputStyle:u.Input,onChange:resetEndsAfter,disabled:!c}),(0,b.jsxs)("div",{className:"flex flex-col pt-9",children:[(0,b.jsx)("h3",{className:"text-base font-semibold pb-4",children:"Recurring Schedule"}),(0,b.jsx)("label",{className:"text-base font-normal pb-1",children:"Repeats"}),(0,b.jsx)(tZ.Z,{onChange:e=>{x("repeats",e),resetEndsAfter()},value:m.repeats,data:g,disabled:!c||!m.startDate})]}),m.repeats&&(0,b.jsxs)("div",{className:"flex flex-col pt-7",children:[(0,b.jsx)("label",{className:"text-base font-normal pb-1",children:"Ends after (Max 10 events)"}),(0,b.jsx)(tZ.Z,{onChange:e=>x("endsAfter",e),value:m.endsAfter,data:f,disabled:!c})]})]})}),(0,b.jsx)("div",{className:"w-full fixed left-0 bottom-0 bg-white pb-8 z-1 md:pb-4 border-t-1 border-neutral-200",children:(0,b.jsxs)("div",{className:"mx-auto flex items-center justify-between pt-4 px-4 md:max-w-[500px] flex-col gap-4",children:[!c&&(0,b.jsx)("p",{className:"text-sm text-neutral-600 font-normal",children:"Recurring event settings lock once an event is published. You can still adjust individual unpublished events."}
1),(0,b.jsx)(V.ZP,{newRadius:!0,type:V.L$.Primary,onClick:toggleConfirmModal,loading:n,disabled:t,children:r?"Save Changes":"Create Events"})]})}),(0,b.jsx)(components_ConfirmModal,{seriesId:r,isOpen:p,toggleConfirmModal:toggleConfirmModal,initialSeriesStartDate:l,initialSeriesEndDate:o,initialEventStartDate:a})]})};let tU=j.Ry().shape({startDate:j.hT().required("Start date is required"),repeats:j.Z_(),endsAfter:j.Z_()});var create_event_RecurringSettings=()=>{let{eventId:e,eventSeriesId:t,createDraft:s,navigateToBasicForm:i,isDraft:n,isEditing:r,isLoading:a,lastUpdated:l,handleBack:o,navigateToEventSettings:d}=useEventEditorContext(),c=(0,N.useRouter)(),{values:u}=(0,y.u6)(),{data:m}=(0,D.Q3)(e),{data:x}=(0,D.LA)(e),p=(null==x?void 0:x.items)||[],{data:v,isLoading:g}=(0,D.OQ)({eventId:e},{enabled:!!e&&!!t}),{mutateAsync:f,isLoading:h}=(0,D.vu)(),{mutateAsync:j,isLoading:w}=(0,D.lD)(),C=tR()(p,e=>e.startDate||e.endDate),showSuccessMessage=e=>{T.pl({image:{url:m.photo.url,aspectRatio:ev.I.FourToFive},text:e,link:{text:"Go to drafts",...(0,E.XH)(c.query)?{onClick:()=>{(0,E.mG)(A.jj)}}:{href:"/host"}}})},onSubmit=async s=>{if(t)try{let t=await j({eventId:e,startDate:s.startDate,seriesEndDate:s.endsAfter||void 0,frequency:s.repeats||void 0});t.seriesId?(showSuccessMessage("".concat(m.title," series updated successfully")),t.eventIds.includes(e)&&s.repeats&&s.endsAfter?i():(i(),c.replace("/events/".concat(t.eventIds[0],"/?view=edit")))):T.vU("Error updating series. Please try again later")}catch(e){T.vU(e.message||"Error updating series")}else try{let t=await f({eventId:e,startDate:s.startDate,seriesEndDate:s.endsAfter,frequency:s.repeats});t.seriesId?(showSuccessMessage(1===t.eventIds.length?"1 new draft of ".concat(m.title," has been created."):"".concat(t.eventIds.length," new drafts of ").concat(m.title," have been created.")),i()):T.vU("Error creating series. Please try again later")}catch(e){T.vU(e.message||"Error creating series")}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:n,isEditing:r,title:"Recurring Settings",isLoading:a,lastUpdated:l,onBack:o,onMenuClick:d}),g?(0,b.jsx)(tP.Z,{isLoading:!0}):(0,b.jsx)(y.J9,{initialValues:{startDate:(null==v?void 0:v.startDate)||u.startDate,repeats:(null==v?void 0:v.frequency)||"",endsAfter:(null==v?void 0:v.endDate)||""},onSubmit:onSubmit,enableReinitialize:!0,validationSchema:tU,children:(0,b.jsx)(forms_RecurringSettingsForm,{eventId:e,canEdit:null==v?void 0:v.canEdit,initialEventStartDate:u.startDate,createDraft:s,isLoading:h||w,seriesId:null==v?void 0:v.seriesId,initialSeriesStartDate:null==v?void 0:v.startDate,initialSeriesEndDate:null==v?void 0:v.endDate,showTierDatesWarning:C})})]})},CheckBox=e=>{let{checked:t,onChange:s}=e;return(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("input",{type:"checkbox",checked:t,onChange:s,className:"hidden"}),(0,b.jsx)("div",{className:"w-4 h-4 border-2 rounded-sm flex items-center justify-center cursor-pointer ".concat(t?"bg-blue-500 border-blue-500":"bg-white border-gray-300"),onClick:s,children:t&&(0,b.jsx)("p",{className:"text-white",children:"✓"})})]})},tz=s(25934),components_EmptyItemSelectionList=e=>{let{message:t}=e;return(0,b.jsxs)("div",{className:"h-[30vh] flex flex-col items-center justify-center mt-6",children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)("div",{className:"bg-[#EBEBEB] h-[80px] w-[80px] rounded-full"}),(0,b.jsx)("p",{className:"text-[81px] -rotate-20 absolute -top-8 left-0",children:"\uD83D\uDC65"})]}),(0,b.jsxs)("p",{className:"text-base font-normal mt-4",children:[" ",t]})]})};let tG=(0,w.forwardRef)((e,t)=>{let{name:s,image:i,id:n,onSelect:r,isSelected:a,isDisabled:l,claimedUsers:o=[],avatarRadius:d=e9.cf.Lg}=e,{t:c}=(0,C.$G)(["common"]);return(0,b.jsxs)("li",{ref:t,className:ei()("rounded-lg flex p-2 items-center gap-3 cursor-pointer",a&&"bg-primary-50",l&&"opacity-50 cursor-not-allowed"),onClick:()=>{!a&&l||null!=o&&o.includes(n)||r(n)},children:[(0,b.jsx)(e9.qE,{radius:d,src:i,size:e9.EF.Lg}),(0,b.jsxs)("div",{className:"flex-1 flex flex-col items-start justify-center",children:[(0,b.jsx)("div",{className:"flex-1 font-bold  text-base",children:s}),l&&(0,b.jsx)("div",{className:"text-sm text-gray-500",children:c("Claimed")})]}),(0,b.jsx)("input",{className:"mt-1 mr-2",type:"checkbox",checked:a,onChange:()=>{}})]})});var components_ItemList=e=>{let{isLoading:t,items:s,onSelect:i,selectedItems:n,search:r,onClearAll:a,clearButtonText:l,lastElementRef:o,avatarRadius:d,claimedUsers:c}=e;if(!t&&s&&(null==s?void 0:s.length)===0)return(0,b.jsx)("div",{className:"h-[30vh] flex flex-col items-center justify-center mt-6",children:(0,b.jsx)("p",{className:"text-base font-normal mt-4",children:" No Items Found "})});let u=n.length>0&&""===r,m=c&&(null==s?void 0:s.some(e=>null==c?void 0:c.includes(e.id)));return(0,b.jsx)("div",{className:"w-full h-[30vh]",children:t?(0,b.jsx)("div",{className:"flex flex-1 items-center justify-center",children:(0,b.jsx)(eF.Z,{type:eF.d.PRIMARY})}):(0,b.jsxs)(b.Fragment,{children:[u&&l&&(0,b.jsxs)("div",{className:"flex flex-row justify-between items-center rounded-full my-6",children:[(0,b.jsx)("p",{className:"text-sm text-[#202020] font-bold",children:l}),(0,b.jsx)("button",{type:"button",className:"text-sm font-normal text-[#3853C4] text-bold disabled:opacity-60 disabled:cursor-not-allowed",disabled:m,onClick:a,children:"Clear"})]}),(0,b.jsx)("ul",{className:"flex flex-col gap-2",children:null==s?void 0:s.map(e=>(0,b.jsx)(tG,{name:e.name,onSelect:()=>i(e),id:e.id,image:e.photoUrl,isSelected:n.some(t=>t.id===e.id),isDisabled:null==c?void 0:c.includes(e.id),ref:o,avatarRadius:d,claimedUsers:c},e.id))})]})})},components_UserSelectionModal=e=>{let{users:t,contracts:s,onClose:i,onSubmit:n}=e,{t:r}=(0,C.$G)(["events"]),[a,l]=(0,w.useState)(t),[o,d]=(0,w.useState)(""),[c]=(0,$.Z)(o,200),{data:u,isLoading:m}=(0,H.gl)(c),x=s.flatMap(e=>e.promoter.id),handleSubmit=()=>{o.length>0?d(""):n(a)},p=a.length>0?"• ".concat(a.length):"",v=o.length>0?r("settings.promoterOffers.userSelection.saveSelection"):"".concat(r("settings.promoterOffers.userSelection.addEligibleUsers")," ").concat(p),g=!m&&!c&&!(null==u?void 0:u.length)&&!(null==a?void 0:a.length),f=o.length>0?null==u?void 0:u.map(e=>{var t;return{id:e._id,name:e.name,photoUrl:(null==e?void 0:null===(t=e.photo)||void 0===t?void 0:t.url)||""}}):a;return(0,b.jsx)(G.Z,{visible:!0,autoHeight:!0,type:G.w.SMALL,onClose:i,shouldStopModalClose:!1,title:r("settings.promoterOffers.userSelection.selectBounceUsers"),icon:(0,b.jsx)(z.fVQ,{size:20}),renderFooter:()=>(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:handleSubmit,loading:!1,children:v}),children:(0,b.jsxs)("div",{className:"px-4 pt-4 flex flex-col justify-between",children:[(0,b.jsx)("p",{className:"mt-4 text-base font-normal",children:r("settings.promoterOffers.userSelection.description")}),(0,b.jsxs)("div",{className:"relative shrink-0 flex h-12 border-1 border-gray-300 rounded-full mt-6",children:[(0,b.jsx)(z.Zh8,{className:"absolute left-3 text-gray-400 self-center justify-center",size:24}),(0,b.jsx)("input",{type:"text",className:"w-full h-full px-11 rounded-full text-base text-gray-600 placeholder:text-gray-400",placeholder:r("settings.promoterOffers.userSelection.searchPlaceholder"),value:o,onChange:e=>{let{currentTarget:t}=e;d(t.value)}})]}),(0,b.jsx)("div",{children:g?(0,b.jsx)(components_EmptyItemSelectionList,{message:r("settings.promoterOffers.selectionModals.users.emptyState")}):(0,b.jsx)("div",{className:"overflow-y-auto mt-4",children:(0,b.jsx)(components_ItemList,{isLoading:m,items:f,onSelect:e=>{let t=a.some(t=>t.id===e.id)?a.filter(t=>t.id!==e.id):[...a,e];l(t)},selectedItems:a,search:o,onClearAll:()=>{l([])},clearButtonText:"".concat(a.length," Bounce Users"),avatarRadius:e9.cf.Full,claimedUsers:x})})})]})})},components_OrganizationSelectionModal=e=>{let{organizations:t,onClose:s,onSubmit:i}=e,{t:n}=(0,C.$G)(["events"]),[r,a]=(0,w.useState)(t),[l,o]=(0,w.useState)(""),[d]=(0,$.Z)(l,200),c=(0,w.useRef)(),{data:u,isLoading:m,hasNextPage:x,isFetchingNextPage:p,fetchNextPage:v}=(0,R.IV)({search:d}),handleSubmit=()=>{l.length>0?o(""):i(r)},g=r.length>0?"• ".concat(r.length):"",f=l.length>0?n("settings.promoterOffers.selectionModals.organizations.saveSelection"):"".concat(n("settings.promoterOffers.selectionModals.organizations.addEligible")," ").concat(g),h=!m&&!d&&!(null==r?void 0:r.length),j=(0,w.useCallback)(e=>
1{m||p||(c.current&&c.current.disconnect(),c.current=new IntersectionObserver(e=>{e[0].isIntersecting&&x&&v()}),e&&c.current.observe(e))},[m,x]),y=l.length>0?null==u?void 0:u.map(e=>({id:e.id,name:e.name,photoUrl:(null==e?void 0:e.badgeImageUrl)||""})):r;return(0,b.jsx)(G.Z,{visible:!0,autoHeight:!0,type:G.w.SMALL,onClose:s,shouldStopModalClose:!1,title:n("settings.promoterOffers.selectionModals.organizations.title"),icon:(0,b.jsx)(z.fVQ,{size:20}),renderFooter:()=>(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:handleSubmit,loading:!1,children:f}),children:(0,b.jsxs)("div",{className:"px-4 pt-4 flex flex-col justify-between",children:[(0,b.jsx)("p",{className:"mt-4 text-base font-normal",children:n("settings.promoterOffers.selectionModals.organizations.description")}),(0,b.jsxs)("div",{className:"relative shrink-0 flex h-12 border-1 border-gray-300 rounded-full mt-6",children:[(0,b.jsx)(z.Zh8,{className:"absolute left-3 text-gray-400 self-center justify-center",size:24}),(0,b.jsx)("input",{type:"text",className:"w-full h-full px-11 rounded-full text-base text-gray-600 placeholder:text-gray-400",placeholder:n("settings.promoterOffers.selectionModals.organizations.searchPlaceholder"),value:l,onChange:e=>{let{currentTarget:t}=e;o(t.value)}})]}),(0,b.jsx)("div",{children:h?(0,b.jsx)(components_EmptyItemSelectionList,{message:n("settings.promoterOffers.selectionModals.organizations.emptyState")}):(0,b.jsx)("div",{className:"overflow-y-auto mt-4",children:(0,b.jsx)(components_ItemList,{isLoading:m,items:y,onSelect:e=>{let t=r.some(t=>t.id===e.id)?r.filter(t=>t.id!==e.id):[...r,e];a(t)},selectedItems:r,search:l,onClearAll:()=>{a([])},lastElementRef:j,clearButtonText:"".concat(r.length," ").concat(n("settings.promoterOffers.selectionModals.organizations.clearButton"))})})})]})})},components_AssociationSelectionModal=e=>{let{associations:t,onClose:s,onSubmit:i}=e,{t:n}=(0,C.$G)(["events"]),[r,a]=(0,w.useState)(t),[l,o]=(0,w.useState)(""),[d]=(0,$.Z)(l,200),c=(0,w.useRef)(),{data:u,isLoading:m,hasNextPage:x,isFetchingNextPage:p,fetchNextPage:v}=(0,R.LS)(d),handleSubmit=()=>{l.length>0?o(""):i(r)},g=r.length>0?"• ".concat(r.length):"",f=l.length>0?n("settings.promoterOffers.selectionModals.associations.saveSelection"):"".concat(n("settings.promoterOffers.selectionModals.associations.addEligible")," ").concat(g),h=!m&&!d&&!(null==r?void 0:r.length),j=(0,w.useCallback)(e=>{m||p||(c.current&&c.current.disconnect(),c.current=new IntersectionObserver(e=>{e[0].isIntersecting&&x&&v()}),e&&c.current.observe(e))},[m,x]),y=l.length>0?u.map(e=>({id:e.id,name:e.name,photoUrl:(null==e?void 0:e.logoImage)||""})):r;return(0,b.jsx)(G.Z,{visible:!0,autoHeight:!0,type:G.w.SMALL,onClose:s,shouldStopModalClose:!1,title:n("settings.promoterOffers.selectionModals.associations.title"),icon:(0,b.jsx)(z.fVQ,{size:20}),renderFooter:()=>(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:handleSubmit,loading:!1,children:f}),children:(0,b.jsxs)("div",{className:"px-4 pt-4 flex flex-col justify-between",children:[(0,b.jsx)("p",{className:"mt-4 text-base font-normal",children:n("settings.promoterOffers.selectionModals.associations.description")}),(0,b.jsxs)("div",{className:"relative shrink-0 flex h-12 border-1 border-gray-300 rounded-full mt-6",children:[(0,b.jsx)(z.Zh8,{className:"absolute left-3 text-gray-400 self-center justify-center",size:24}),(0,b.jsx)("input",{type:"text",className:"w-full h-full px-11 rounded-full text-base text-gray-600 placeholder:text-gray-400",placeholder:n("settings.promoterOffers.selectionModals.associations.searchPlaceholder"),value:l,onChange:e=>{let{currentTarget:t}=e;o(t.value)}})]}),(0,b.jsx)("div",{children:h?(0,b.jsx)(components_EmptyItemSelectionList,{message:n("settings.promoterOffers.selectionModals.associations.emptyState")}):(0,b.jsx)("div",{className:"overflow-y-auto mt-4",children:(0,b.jsx)(components_ItemList,{isLoading:m,items:y,onSelect:e=>{let t=r.some(t=>t.id===e.id)?r.filter(t=>t.id!==e.id):[...r,e];a(t)},selectedItems:r,search:l,onClearAll:()=>{a([])},lastElementRef:j,clearButtonText:"".concat(r.length," ").concat(n("settings.promoterOffers.selectionModals.associations.clearButton"))})})})]})})},components_ItemSelection=e=>{var t,s,i;let{eligibility:n,setItemSelectionModal:r,index:a,placeholder:l}=e,{t:o}=(0,C.$G)(["events"]),{errors:d}=(0,y.u6)(),c=(null==n?void 0:null===(t=n.items)||void 0===t?void 0:t.length)||0,u=null==n?void 0:null===(s=n.items)||void 0===s?void 0:s.slice(0,2).map(e=>e.name).join(", "),m=c-2>0?"... +".concat(c-2," ").concat(o("settings.promoterOffers.itemSelection.more")):"",x=c>0?"".concat(u," ").concat(m):"";return(0,b.jsx)("div",{children:(0,b.jsx)("div",{className:"relative",children:(0,b.jsxs)("div",{className:"cursor-pointer",onClick:()=>{r({id:n.id,show:!0})},children:[(0,b.jsx)("input",{type:"text",id:"selectedItems",name:"selectedItems",value:x,placeholder:l,className:ei()("w-full border-1 border-[#DCDCDC] px-4 py-2 mx-auto h-12 rounded-md mt-2",{[ew().errorField]:(null==d?void 0:d.eligibilityCriteria)&&(null==d?void 0:d.eligibilityCriteria[a])}),readOnly:!0}),(0,b.jsx)("span",{className:ei()("absolute right-3 top-1/2 transform -translate-y-1/4",{"top-1/3":(null==d?void 0:d.eligibilityCriteria)&&(null==d?void 0:d.eligibilityCriteria[a])}),children:(0,b.jsx)(eu.Dli,{className:"text-[#B1B1B1] h-4 w-4"})}),(null==d?void 0:d.eligibilityCriteria)&&(null==d?void 0:d.eligibilityCriteria[a])&&(0,b.jsx)("div",{className:ei()(ew().error),children:null===(i=d.eligibilityCriteria[a])||void 0===i?void 0:i.items})]})})})};let tV={color:"#202020",fontWeight:400,fontSize:14},t$={borderColor:"#DCDCDC"};var OfferEligibility=()=>{var e,t,s;let{t:i}=(0,C.$G)(["events"]),{values:n,setFieldValue:r}=(0,y.u6)(),a=n.eligibilityCriteria,l=n.contracts,[o,d]=(0,w.useState)({id:"",show:!1}),[c,u]=(0,w.useState)({id:"",show:!1}),[m,x]=(0,w.useState)({id:"",show:!1}),handleUserSelectionModalClose=()=>{d({id:"",show:!1})},handleOrganizationSelectionModalClose=()=>{u({id:"",show:!1})},handleAssociationSelectionModalClose=()=>{x({id:"",show:!1})},handleItemSelectionModalSubmit=(e,t,s)=>{let i=[...a],n=i.findIndex(e=>e.id===t);i[n].items=e,r("eligibilityCriteria",i),s()},handleMustHaveTicketChange=e=>{let t=[...a],s=t.findIndex(t=>t.id===e);t[s].mustHaveTicket=!t[s].mustHaveTicket,r("eligibilityCriteria",t)},handleRemoveEligibility=e=>{let t=[...a],s=t.findIndex(t=>t.id===e);t.splice(s,1),r("eligibilityCriteria",t)},handleEligibilityChange=(e,t)=>
1{let s=[...a],i=s.findIndex(t=>t.id===e);s[i].selector=t,r("eligibilityCriteria",s)},p=[{value:eD.yi.USERS,label:i("settings.promoterOffers.eligibility.individualBounceUser")},{value:eD.yi.ORGANIZATIONS,label:i("settings.promoterOffers.eligibility.organizationMembers")},{value:eD.yi.ASSOCIATIONS,label:i("settings.promoterOffers.eligibility.associationMembers")}];return(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:"flex flex-col mt-6",children:[(0,b.jsx)("div",{className:"text-[16px] font-bold text-[#202020]",children:i("settings.promoterOffers.eligibility.whoIsEligible")}),a.map((e,t)=>(0,b.jsx)(ee.Z,{children:(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)(tZ.Z,{onChange:t=>{handleEligibilityChange(e.id,t)},value:e.selector,textValueStyle:tV,controlStyle:t$,data:p}),e.selector===eD.yi.USERS&&(0,b.jsx)(components_ItemSelection,{eligibility:e,setItemSelectionModal:d,index:t,placeholder:i("settings.promoterOffers.eligibility.selectBounceUsers")}),e.selector===eD.yi.ORGANIZATIONS&&(0,b.jsx)(components_ItemSelection,{eligibility:e,setItemSelectionModal:u,index:t,placeholder:i("settings.promoterOffers.eligibility.selectBounceOrganizations")}),e.selector===eD.yi.ASSOCIATIONS&&(0,b.jsx)(components_ItemSelection,{eligibility:e,setItemSelectionModal:x,index:t,placeholder:i("settings.promoterOffers.eligibility.selectBounceAssociations")}),(0,b.jsxs)("div",{className:"flex flex-row mt-2 justify-between",children:[(0,b.jsx)("div",{className:"text-sm font-bold text-[#575757]",children:i("settings.promoterOffers.eligibility.mustHaveTicket")}),(0,b.jsx)(CheckBox,{checked:e.mustHaveTicket,onChange:()=>handleMustHaveTicketChange(e.id)})]}),(null==a?void 0:a.length)===1&&(0,b.jsx)("div",{className:"w-full border-b-1 border-gray-200 py-2"}),(null==a?void 0:a.length)>1&&(0,b.jsxs)("div",{className:"mt-4 flex items-center",children:[(0,b.jsx)("div",{className:"w-full border-b-1 border-gray-200"}),(0,b.jsx)("button",{type:"button",className:"pl-4 text-red-700 text-sm",onClick:()=>handleRemoveEligibility(e.id),children:i("settings.promoterOffers.eligibility.remove")})]}),(0,b.jsx)("button",{type:"button",className:"mt-3 text-[#3853C4] font-bold text-sm",onClick:()=>{r("eligibilityCriteria",[...a,{id:(0,tz.Z)(),selector:eD.yi.USERS,mustHaveTicket:!1,items:[]}])},children:i("settings.promoterOffers.eligibility.addMoreUsers")})]})},e.id)),o.show&&(0,b.jsx)(components_UserSelectionModal,{contracts:l,users:(null===(e=a.find(e=>e.id===o.id))||void 0===e?void 0:e.items)||[],onClose:handleUserSelectionModalClose,onSubmit:e=>handleItemSelectionModalSubmit(e,o.id,handleUserSelectionModalClose)}),c.show&&(0,b.jsx)(components_OrganizationSelectionModal,{organizations:(null===(t=a.find(e=>e.id===c.id))||void 0===t?void 0:t.items)||[],onClose:handleOrganizationSelectionModalClose,onSubmit:e=>handleItemSelectionModalSubmit(e,c.id,handleOrganizationSelectionModalClose)}),m.show&&(0,b.jsx)(components_AssociationSelectionModal,{associations:(null===(s=a.find(e=>e.id===m.id))||void 0===s?void 0:s.items)||[],onClose:handleAssociationSelectionModalClose,onSubmit:e=>handleItemSelectionModalSubmit(e,m.id,handleAssociationSelectionModalClose)})]})})};let tH=(0,w.forwardRef)((e,t)=>{var s,i,n,r,a;let{product:l,id:o,onSelect:d,isSelected:c,isDisabled:u}=e,m=null!==(r=null===(s=l.purchaseRequirements)||void 0===s?void 0:s.requiresApproval)&&void 0!==r&&r,x=null!==(a=null===(n=l.purchaseRequirements)||void 0===n?void 0:null===(i=n.questions)||void 0===i?void 0:i.length)&&void 0!==a?a:0,p=(null==l?void 0:l.maxQuantity)&&(null==l?void 0:l.maxQuantity)>0;return(0,b.jsxs)("li",{ref:t,className:ei()("rounded-2xl p-4 items-center gap-3 mr-4 cursor-pointer border border-[#DCDCDC] ",c&&"bg-primary-50",!c&&u&&"opacity-50 cursor-not-allowed"),onClick:()=>{(c||!u)&&d(o)},children:[(0,b.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-row",children:[l.isPrivate&&(0,b.jsx)(eA.kUi,{className:"mr-2 mt-1 self-start"}),(0,b.jsx)("div",{className:"font-normal text-base text-[#202020]",children:l.name})]}),(0,b.jsxs)("div",{className:"text-sm font-bold text-[#202020]",children:["$",l.price]})]}),(0,b.jsx)("input",{className:"mt-1 mr-2",type:"checkbox",checked:c,onChange:()=>{}})]}),l.description&&(0,b.jsx)("div",{className:"flex flex-row items-center justify-between my-2",children:(0,b.jsx)("div",{className:"text-sm font-normal text-[#202020]",children:l.description})}),(0,b.jsx)("div",{className:"h-px bg-[#EBEBEB] my-4"}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"font-normal text-sm flex gap-2 align-center pb-2",children:[(0,b.jsx)("img",{alt:"Ticket icon",src:"/img/icons/ticket-admit-one.svg",width:16,height:16}),l.purchases," ",p?"/".concat(l.maxQuantity," sold"):"sold"]}),m&&(0,b.jsxs)("div",{className:"font-normal text-sm flex gap-2 align-center pb-2",children:[(0,b.jsx)("div",{className:"self-start",children:"\uD83D\uDC4D"}),(0,b.jsxs)("div",{children:["Requires Approval"," ",x>0&&"(".concat(x," q's)")]})]}),(l.startDate||l.endDate)&&(0,b.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,b.jsx)("div",{className:"self-start",children:"⏰"}),(0,b.jsxs)("div",{className:"flex flex-col",children:[l.startDate&&(0,b.jsxs)("div",{className:"font-normal text-sm flex gap-2 align-center pb-2",children:["Start Date:"," ",eP()(l.startDate).format("MMM D, YYYY h:mm A")]}),l.endDate&&(0,b.jsxs)("div",{className:"font-normal text-sm flex gap-2 align-center pb-2",children:["End Date: ",eP()(l.endDate).format("MMM D, YYYY h:mm A")]})]})]})]})]})});var components_TierList=e=>{let{isLoading:t,items:s,onSelect:i,selectedItems:n,lastElementRef:r}=e;return!t&&s&&(null==s?void 0:s.length)===0?(0,b.jsx)("div",{className:"h-[30vh] flex flex-col items-center justify-center mt-6",children:(0,b.jsx)("p",{className:"text-base font-normal mt-4",children:" No Items Found "})}):(0,b.jsx)("div",{className:"w-full h-[30vh]",children:t?(0,b.jsx)("div",{className:"flex flex-1 items-center justify-center",children:(0,b.jsx)(eF.Z,{type:eF.d.PRIMARY})}):(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("ul",{className:"flex flex-col gap-4 ",children:null==s?void 0:s.map(e=>(0,b.jsx)(tH,{product:e,onSelect:()=>i(e),id:e.id,isSelected:n.some(t=>t.id===e.id),isDisabled:!1,ref:r},e.id))})})})},components_TierSelectionModal=e=>{let{onClose:t,onSubmit:s,tiers:i}=e,[n,r]=(0,w.useState)(i),{eventId:a}=useEventEditorContext(),{data:l,isLoading:o}=(0,eX.UG)({eventId:a}),handleSubmit=()=>{s(n)},d="Add Eligible Tiers ".concat(n.length>0?"• ".concat(n.length):"");return(0,b.jsx)(G.Z,{visible:!0,autoHeight:!0,type:G.w.SMALL,onClose:t,shouldStopModalClose:!1,title:"Select a Ticket Tiers",icon:(0,b.jsx)(e_.UkU,{size:20,color:"#000"}),renderFooter:()=>(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:handleSubmit,loading:!1,children:d}),children:(0,b.jsx)("div",{className:"px-4 flex flex-col justify-between",children:(0,b.jsx)("div",{children:o?(0,b.jsx)("div",{className:"h-[30vh] flex flex-col items-center justify-center mt-6",children:(0,b.jsx)(eF.Z,{type:eF.d.PRIMARY})}):(0,b.jsx)("div",{className:"overflow-y-auto mt-4",children:(0,b.jsx)(components_TierList,{isLoading:o,items:(null==l?void 0:l.items)||[],onSelect:e=>{let t=n.some(t=>t.id===e.id)?n.filter(t=>t.id!==e.id):[...n,e];r(t)},selectedItems:n})})})})})},components_TierSelection=e=>{var t;let{tiers:s,handleOnPress:i}=e,{values:n}=(0,y.u6)(),r=(null==s?void 0:s.length)||0,a=(null===(t=n.contracts)||void 0===t?void 0:t.length)>0,l=null==s?void 0:s.slice(0,2).map(e=>"".concat(e.name," ($").concat(e.price,")")).join(", "),o=r>0?"".concat(l," ").concat(r-2>0?"... +".concat(r-2," more"):""):"Any Tier";return(0,b.jsx)("div",{children:(0,b.jsx)("div",{className:"relative",children:(0,b.jsxs)("div",{className:"cursor-pointer",onClick:i,children:[(0,b.jsx)("input",{type:"text",id:"selectedTiers",name:"selectedTiers",value:o,disabled:a,className:ei()("w-full border-1 border-[#DCDCDC] px-2 py-2 mx-auto h-12 rounded-md mt-2 text-black"),readOnly:!0}),(0,b.jsx)("span",{className:ei()("absolute right-3 top-1/2 transform -translate-y-1/4"),children:(0,b.jsx)(eu.Dli,{className:"text-[#B1B1B1] h-4 w-4"})})]})})})},components_EligibleTiers=()=>{let{values:e,setFieldValue:t}=(0,y.u6)(),[s,i]=(0,w.useState)(!1),n=e.rewards.kickbackRewards.saleConditions,r=n.tiers||[];return(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)("div",{className:"text-xs font-bold text-[#575757] mb-2 leading-[14px]",children:"Select eligible ticket tiers"}),(0,b.jsx)(components_TierSelection,{tiers:r,handleOnPress:()=>i(!0)}),s&&(0,b.jsx)(components_TierSelectionModal,{tiers:n.tiers||[],onClose:()=>i(!1),onSubmit:e=>{t("rewards.kickbackRewards.saleConditions.tiers",e),i(!1)}})]})},tW=s(80967),components_KickbackKindButton=e=>{let{kind:t="percentage",handleChange:s,disabled:i=!1}=e,n={height:"36px",borderRadius:"8px",cursor:"pointer"},r={...n,backgroundColor:"percentage"===t?"#FFFFFF":"#EBEBEB"},a={...n,backgroundColor:"amount"===t?"#FFFFFF":"#EBEBEB"};return(0,b.jsxs)(tW.Z.Group,{className:"flex items-center bg-[#EBEBEB] rounded-lg p-1",children:[(0,b.jsx)(tW.Z,{type:"button",style:r,className:"px-6",disabled:i,onClick:e=>{e.preventDefault(),s("percentage")},positive:"percentage"===t,children:(0,b.jsx)("div",{className:"text-[14px] text-[#202020]",children:"%"})}),(0,b.jsx)(tW.Z,{style:a,type:"button",className:"px-6",disabled:i,onClick:e=>{e.preventDefault(),s("amount")},positive:"amount"===t,children:(0,b.jsx)("div",{className:"text-[14px] text-[#202020]",children:"$"})})]})};let tQ={color:"#202020",fontWeight:400,fontSize:14},tY={borderColor:"#DCDCDC"};var components_Reward=()=>{var e,t,s,i,n,r,a;let{t:l}=(0,C.$G)("events"),{values:o,setFieldValue:d,errors:c}=(0,y.u6)(),u=o.rewards.kickbackRewards,handleChange=e=>{d("rewards.kickbackRewards.kind",e)},m=(null===(e=o.contracts)||void 0===e?void 0:e.length)>0;return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"mt-6",children:[(0,b.jsx)("div",{className:"text-[16px] text-[#202020] font-bold",children:l("settings.promoterOffers.offerForm.kickback")}),(0,b.jsx)("div",{className:"text-sm mt-2 text-[#575757] font-normal",children:l("settings.promoterOffers.offerForm.kickbackDescription")})]}),(0,b.jsxs)("div",{className:"mt-4 flex flex-row",children:[(0,b.jsx)(y.gN,{id:"kind",name:"kind",label:l("settings.promoterOffers.offerForm.discountType"),render:()=>(0,b.jsx)(components_KickbackKindButton,{kind:u.kind,handleChange:handleChange,disabled:m}),className:"flex"}),(0,b.jsx)(y.gN,{id:"amount",name:"amount",type:"number",label:l("settings.promoterOffers.offerForm.discountAmount"),disabled:m,placeholder:l("percentage"===u.kind?"settings.promoterOffers.offerForm.percentagePlaceholder":"settings.promoterOffers.offerForm.dollarPlaceholder"),value:u.value,onChange:e=>d("rewards.kickbackRewards.value",e.target.value),className:ei()("border-1 border-[#DCDCDC] rounded-md flex ml-2 max-w-[100px] px-2",{[ew().errorField]:null===(s=c.rewards)||void 0===s?void 0:null===(t=s.kickbackRewards)||void 0===t?void 0:t.value})}),(0,b.jsx)("div",{className:"flex-1 ml-2",children:(0,b.jsx)(tZ.Z,{onChange:e=>d("rewards.kickbackRewards.saleConditions.unit",e),value:u.saleConditions.unit,data:[{value:"ticket",label:l("settings.promoterOffers.offerForm.perTicket")}],textValueStyle:tQ,controlStyle:tY})})]}),(null===(n=c.rewards)||void 0===n?void 0:null===(i=n.kickbackRewards)||void 0===i?void 0:i.value)&&(0,b.jsx)("div",{className:ei()(ew().error),children:null===(a=c.rewards)||void 0===a?void 0:null===(r=a.kickbackRewards)||void 0===r?void 0:r.value})]})},tK=s(40987),components_SaleThreshold=()=>{var e;let{t}=(0,C.$G)("events"),{values:s,setFieldValue:i}=(0,y.u6)(),n=s.rewards.kickbackRewards.saleConditions,r=null==n?void 0:n.minSalesThresholdEnabled,a=(null===(e=s.contracts)||void 0===e?void 0:e.length)>0;return(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsxs)("div",{className:"flex flex-row justify-between items-center",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("div",{className:"text-sm font-bold text-[#575757] mb-2 leading-[18px]",children:t("settings.promoterOffers.offerForm.minSalesThreshold")}),(0,b.jsx)("div",{className:"text-xs font-normal text-[#575757] mb-2 leading-[14px]",children:t("settings.promoterOffers.offerForm.minSalesThresholdDescription")})]}),(0,b.jsx)("div",{children:(0,b.jsx)(tK.Z,{checked:r,disabled:a,onChange:e=>{i("rewards.kickbackRewards.saleConditions.minSalesThresholdEnabled",e)}})})]}),(0,b.jsx)(y.gN,{id:"minSalesThreshold",name:"minSalesThreshold",type:"number",placeholder:t("settings.promoterOffers.offerForm.minSalesThresholdPlaceholder"),disabled:!r||a,value:(null==n?void 0:n.minSalesThreshold)||"",onChange:e=>{i("rewards.kickbackRewards.saleConditions.minSalesThreshold",Number(e.target.value))},className:ei()("w-full border-1 border-[#DCDCDC] px-4 py-2 mx-auto h-12 rounded-md placeholder:text-[#B1B1B1] placeholder:text-sm placeholder:font-normal text-[#151515] text-sm font-normal ",{"opacity-50":!r})})]})},offer_create_Kickback=()=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(components_Reward,{}),(0,b.jsx)(components_EligibleTiers,{}),(0,b.jsx)(components_SaleThreshold,{})]}),offer_create_OfferName=()=>{var e;let{t}=(0,C.$G)("events"),{values:s,setFieldValue:i,errors:n}=(0,y.u6)(),r=(null===(e=s.contracts)||void 0===e?void 0:e.length)>0;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"flex flex-col mb-1 text-[12px] text-[#2A2A2A] leading-[15px]",children:t("settings.promoterOffers.offerForm.offerN
1ame")}),(0,b.jsx)(y.gN,{type:"text",name:"name",disabled:r,onChange:e=>i("name",e.target.value),value:s.name,placeholder:t("settings.promoterOffers.offerForm.offerNamePlaceholder"),className:ei()("w-full border-1 border-[#DCDCDC] px-4 py-2 mx-auto h-12 rounded-md placeholder:text-[#B1B1B1] placeholder:text-sm placeholder:font-normal text-[#151515] text-sm font-normal",{[ew().errorField]:n.name})}),n.name&&(0,b.jsx)("div",{className:ei()(ew().error),children:n.name})]})},offer_create_CreateOfferActions=e=>{let{handleSubmit:t,isEditMode:s,disabled:i=!1}=e,{t:n}=(0,C.$G)(["events"]);return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("div",{className:"w-full bg-white fixed bottom-0 left-0 p-4 z-10 border-t pb-12 md:pb-4",children:(0,b.jsx)("div",{className:"w-full md:w-[343px] mx-auto",children:(0,b.jsx)("div",{className:"flex gap-4",children:(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:t,disabled:i,children:(0,b.jsx)("div",{className:"flex items-center justify-center",children:n(s?"settings.promoterOffers.createOffer.updateOffer":"settings.promoterOffers.createOffer.createOffer")})})})})})})},tX=s(19771);let tJ="h:mm A";var components_PromoterDiscountCodeForm=e=>{let{eventId:t,errorMessage:s="",initialValues:i,onClose:n,onSubmit:r}=e,{t:a}=(0,C.$G)("events"),{data:l,isLoading:o}=(0,D.Q3)(t),d=(0,w.useMemo)(()=>j.Ry().shape({amount:j.Rx().required(a("settings.promoterOffers.promoterDiscount.validation.discountRequired")).min(0,a("settings.promoterOffers.promoterDiscount.validation.discountMinValue"))}),[a]),c=(0,w.useMemo)(()=>{if(o||!l)return null;let e=new Date(l.startDate);return e.setDate(e.getDate()+1),l.endDate?l.endDate:e.toISOString()},[l,o]);return(0,b.jsx)(y.J9,{initialValues:{amount:(null==i?void 0:i.value)||void 0,kind:(null==i?void 0:i.kind)||"percentage",startDate:(null==i?void 0:i.startDate)||void 0,endDate:(null==i?void 0:i.endDate)||void 0,startDateTime:(null==i?void 0:i.startDate)?eP()(null==i?void 0:i.startDate).format(tJ):void 0,endDateTime:(null==i?void 0:i.endDate)?eP()(null==i?void 0:i.endDate).format(tJ):void 0,maxUsage:(null==i?void 0:i.usageLimitPerContract)||void 0},onSubmit:e=>{r({eventId:t,value:e.amount,kind:"string"==typeof e.kind?e.kind:"percentage",startDate:e.startDate,endDate:e.endDate,maxUsage:e.maxUsage})},validationSchema:d,children:e=>{let{values:t,submitForm:i,setFieldValue:r}=e,handleChange=e=>{r("kind",e)};return(0,b.jsx)(G.Z,{type:G.w.SMALL,visible:!0,onClose:n,shouldStopModalClose:o,title:a("settings.promoterOffers.promoterDiscount.modalTitle"),icon:(0,b.jsx)(z.BVL,{size:22}),renderFooter:()=>(0,b.jsxs)("div",{className:"w-full",children:[(0,b.jsx)("div",{className:"text-red-500",children:s}),(0,b.jsx)(V.ZP,{loading:o,onClick:i,children:a("settings.promoterOffers.promoterDiscount.saveButton")})]}),children:(0,b.jsx)(y.l0,{children:(0,b.jsxs)("div",{className:"p-4 pb-52 mt-4 flex flex-col justify-between",children:[(0,b.jsx)("p",{className:"mt-2 mb-6 text-sm font-normal",children:a("settings.promoterOffers.promoterDiscount.formDescription")}),(0,b.jsxs)("div",{className:"flex flex-row",children:[(0,b.jsx)("div",{className:"flex-1 flex-row mr-4",children:(0,b.jsx)(eZ.Z,{id:"kind",name:"kind",label:a("settings.promoterOffers.promoterDiscount.discountTypeLabel"),render:()=>(0,b.jsx)(components_KickbackKindButton,{kind:t.kind,handleChange:handleChange})})}),(0,b.jsx)(eZ.Z,{id:"amount",name:"amount",type:"number",label:a("settings.promoterOffers.promoterDiscount.discountAmountLabel"),placeholder:"amount"===t.kind?a("settings.promoterOffers.promoterDiscount.amountPlaceholder"):a("settings.promoterOffers.promoterDiscount.percentagePlaceholder"),disabled:o})]}),(0,b.jsx)(eZ.Z,{id:"maxUsage",name:"maxUsage",type:"number",label:a("settings.promoterOffers.promoterDiscount.usageLimitLabel"),placeholder:a("settings.promoterOffers.promoterDiscount.usageLimitPlaceholder"),disabled:o}),(0,b.jsx)(tX.Z,{minStartDate:new Date().toISOString(),maxEndDate:c})]})})})}})},components_PromoterDiscountCard=e=>{var t;let{setShouldShowCreateForm:s}=e,{t:i}=(0,C.$G)("events"),{values:n,setFieldValue:r}=(0,y.u6)(),a=n.discount,l=null===(t=null==a?void 0:a.isActive)||void 0===t||t,o=(null==a?void 0:a.kind)==="percentage"?"%":"$";return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"cursor-pointer mt-4 border border-[#
1EBEBEB] rounded-lg p-4",onClick:()=>s(!0),children:[(0,b.jsxs)("div",{className:"flex flex-row",children:[(0,b.jsx)(z.BVL,{size:20,color:"#575757"}),(0,b.jsxs)("div",{className:"text-sm font-bold text-[#575757] ml-2",children:[a.value," ",o]}),(null==a?void 0:a.usageLimitPerContract)&&(0,b.jsxs)("div",{className:"text-sm font-bold text-[#575757] ml-2",children:["• ",a.usageLimitPerContract," ",i("settings.promoterOffers.promoterDiscount.card.times")]})]}),(0,b.jsxs)("div",{className:"flex flex-row mt-4 items-center",onClick:e=>{e.stopPropagation(),r("discount.isActive",!l)},children:[(0,b.jsx)("div",{children:i("settings.promoterOffers.promoterDiscount.card.active")}),(0,b.jsx)(tK.Z,{checked:l,className:"ml-2"})]})]}),(0,b.jsxs)("div",{className:"mt-4 flex items-center",children:[(0,b.jsx)("div",{className:"w-full border-b-1 border-gray-200"}),(0,b.jsx)("button",{type:"button",className:"pl-4 text-red-700 text-sm",onClick:()=>r("discount",null),children:i("settings.promoterOffers.promoterDiscount.card.remove")})]})]})},components_PromoterDiscount=e=>{var t;let{eventId:s}=e,{t:i}=(0,C.$G)("events"),{values:n,setFieldValue:r}=(0,y.u6)(),[a,l]=(0,w.useState)(!1),o=n.discount,d=(null===(t=n.contracts)||void 0===t?void 0:t.length)>0;return(0,b.jsxs)("div",{children:[o?(0,b.jsx)(components_PromoterDiscountCard,{setShouldShowCreateForm:l}):(0,b.jsx)("div",{className:"text-sm font-bold text-[#3853C4] cursor-pointer mt-4",onClick:()=>!d&&l(!0),style:{opacity:d?.5:1,cursor:d?"not-allowed":"pointer"},children:i("settings.promoterOffers.advanceOptions.setPurchaserDiscount")}),a&&(0,b.jsx)(components_PromoterDiscountCodeForm,{eventId:s,onSubmit:e=>{l(!1);let t={value:e.value,kind:e.kind,usageLimitPerContract:e.maxUsage,startDate:e.startDate,endDate:e.endDate};r("discount",t)},onClose:()=>{l(!1)},initialValues:o})]})},components_AdvanceOptions=e=>{let{setShowAdvanceOptions:t,eventId:s}=e,{t:i}=(0,C.$G)("events"),n=i("settings.promoterOffers.advanceOptions.tooltipRules.rule1"),r=i("settings.promoterOffers.advanceOptions.tooltipRules.rule2"),a="1. ".concat(n," 2. ").concat(r);return(0,b.jsx)(ee.Z,{children:(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{onClick:()=>t(!1),className:"text-sm font-bold text-[#3853C4] cursor-pointer",children:i("settings.promoterOffers.advanceOptions.hideAdvanceOptions")}),(0,b.jsxs)("div",{className:"mt-10",children:[(0,b.jsxs)("div",{className:"items-center justify-start flex",children:[(0,b.jsx)("div",{className:"text-base font-bold text-[#202020]",children:i("settings.promoterOffers.advanceOptions.includeDiscount")}),(0,b.jsx)(U.Z,{id:"tooltip",message:a,position:"top"})]}),(0,b.jsx)("div",{className:"mt-2 text-[#575757] text-sm font-normal",children:i("settings.promoterOffers.advanceOptions.discountDescription")})]}),(0,b.jsx)(components_PromoterDiscount,{eventId:s})]})})},AdvanceOfferOptions=e=>{let{eventId:t}=e,{t:s}=(0,C.$G)(["events"]),[i,n]=(0,w.useState)(!1);return(0,b.jsx)("div",{className:"mt-10",children:i?(0,b.jsx)(components_AdvanceOptions,{setShowAdvanceOptions:n,eventId:t}):(0,b.jsx)("div",{className:"text-sm font-bold text-[#3853C4] cursor-pointer",onClick:()=>n(!0),children:s("settings.promoterOffers.advanceOptions.showAdvanceOptions")})})},t0=s(97342),offers_OfferLoadingSkeleton=()=>(0,b.jsx)(t0.Z,{children:(0,b.jsxs)("div",{className:"animate-pulse pt-[90px] md:pt-[180px] -mt-[90px] pb-20 md:w-[630px] md:mx-auto",children:[(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/6"}),(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-5/6 rounded-xl"})]}),(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full mt-8",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/6"}),(0,b.jsx)("div",{className:"h-5 bg-gray-200 rounded w-3/6"}),(0,b.jsxs)("div",{className:"flex flex-row w-full",children:[(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-1/6 mr-2 rounded-xl"}),(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-3/6 mr-2 rounded-xl"}),(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-1/6 mr-2 rounded-xl"})]})]}),(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full mt-8",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/6"}),(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-5/6 rounded-xl"})]}),(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full mt-8",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/6"}),(0,b.jsx)("div",{className:"h-5 bg-gray-200 rounded w-3/6"}),(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-5/6 rounded-xl"})]}),(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full mt-8",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/6"}),(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-5/6 rounded-xl"}),(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-5/6 rounded-xl"}),(0,b.jsx)("div",{className:"h-5 bg-gray-200 rounded w-2/6"})]}),(0,b.jsx)("div",{className:"mt-2 text-2xl flex items-center col-span-3 h-px bg-gray-200"}),(0,b.jsx)("div",{className:"h-5 bg-gray-200 rounded w-2/6 mt-2"}),(0,b.jsx)("div",{className:"h-5 bg-gray-200 rounded w-2/6 mt-8"})]})});let t1=j.Ry({name:j.Z_().required("Name is required"),rewards:j.Ry().shape({kickbackRewards:j.Ry().shape({value:j.Rx().min(.01,"Value must be greater than 0").required()})}),eligibilityCriteria:j.IX().of(j.Ry().shape({selector:j.Z_().required(),items:j.IX().when("selector",{is:eD.yi.USERS,then:j.IX().min(1,"Users are required").required(),otherwise:j.IX().notRequired()}).when("selector",{is:eD.yi.ASSOCIATIONS,then:j.IX().min(1,"Associations are required").required(),otherwise:j.IX().notRequired()}).when("selector",{is:eD.yi.ORGANIZATIONS,then:j.IX().min(1,"Organizations are required").required(),otherwise:j.IX().notRequired()})}))}),createInitialValuesFromExistingOffer=e=>{var t,s,i,n,r,a;return{name:e.name,eligibilityCriteria:e.eligibilityCriteria.map(e=>({id:(0,tz.Z)(),mustHaveTicket:e.mustHaveTicket,selector:e.selector,...e.selector===eD.yi.USERS&&{items:e.users},...e.selector===eD.yi.ORGANIZATIONS&&{items:e.organizations},...e.selector===eD.yi.ASSOCIATIONS&&{items:e.associations}})),rewards:{kickbackRewards:{kind:(null===(t=e.rewards.kickbackRewards[0])||void 0===t?void 0:t.kind)||"percentage",value:(null===(s=e.rewards.kickbackRewards[0])||void 0===s?void 0:s.value)||0,saleConditions:{unit:(null===(i=e.rewards.kickbackRewards[0])||void 0===i?void 0:i.saleConditions.unit)||"ticket",tiers:(null===(n=e.rewards.kickbackRewards[0])||void 0===n?void 0:n.saleConditions.tiers)||[],minSalesThreshold:null===(r=e.rewards.kickbackRewards[0])||void 0===r?void 0:r.saleConditions.minSalesThreshold,minSalesThresholdEnabled:!!(null===(a=e.rewards.kickbackRewards[0])||void 0===a?void 0:a.saleConditions.minSalesThreshold)}}},discount:e.discount,contracts:e.contracts}},createDefaultInitialValues=()=>({name:"",eligibilityCriteria:[{id:(0,tz.Z)(),mustHaveTicket:!1,selector:eD.yi.USERS,items:[]}],rewards:{kickbackRewards:{kind:"percentage",value:0,saleConditions:{unit:"ticket",tiers:[],minSalesThresholdEnabled:!1}}},contracts:[]}),getInitialValues=(e,t)=>e&&t?createInitialValuesFromExistingOffer(t):createDefaultInitialValues(),getUpd
1atedOfferWithIds=e=>{let{contracts:t,...s}=e,{minSalesThresholdEnabled:i,minSalesThreshold:n,tiers:r,...a}=s.rewards.kickbackRewards.saleConditions,l={...s,rewards:{kickbackRewards:[{...s.rewards.kickbackRewards,saleConditions:{...a,tierIds:(null==r?void 0:r.map(e=>e.id))||[],minSalesThreshold:i?n:void 0}}]},eligibilityCriteria:s.eligibilityCriteria.map(e=>{var t;return{mustHaveTicket:e.mustHaveTicket,selector:e.selector,ids:(null===(t=e.items)||void 0===t?void 0:t.map(e=>e.id))||[]}})};return l},useOfferFormSubmission=e=>{let{eventId:t,offerId:s,isEditMode:i,initialValues:n,setOffersStep:r}=e,a=(0,tN.I0)(),l=(0,D.ML)(),o=(0,D.yf)();return{handleSubmit:e=>{let d=getUpdatedOfferWithIds(e),c=getUpdatedOfferWithIds(n),u=function(e,t){let removeIds=e=>({...e,eligibilityCriteria:e.eligibilityCriteria.map(e=>({mustHaveTicket:e.mustHaveTicket,selector:e.selector,ids:e.ids||[]}))}),s=removeIds(e),i=removeIds(t),n={},r=Object.keys(i);return r.forEach(e=>{let r=s[e],a=i[e];!function promoterOfferHelper_isEqual(e,t){if(e===t)return!0;if(null==e||null==t)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,s)=>promoterOfferHelper_isEqual(e,t[s]));if("object"==typeof e&&"object"==typeof t){let s=Object.keys(e),i=Object.keys(t);return s.length===i.length&&s.every(s=>i.includes(s)&&promoterOfferHelper_isEqual(e[s],t[s]))}return!1}(r,a)&&(n[e]=t[e])}),n}(c,d),onSuccess=()=>{r(x.OFFERS_LIST)},onError=e=>{a((0,ty.K4)("ALERT",{message:(null==e?void 0:e.message)||"Something went wrong"}))};i?o.mutate({offerId:s,offer:u},{onSuccess,onError}):l.mutate({eventId:t,body:d},{onSuccess,onError})},isSubmitting:l.isLoading||o.isLoading}};var Offers_CreateOfferPage=e=>{let{eventId:t,offerId:s,setOffersStep:i}=e,n=!!s,{data:r,isLoading:a}=(0,D.BX)(s||"",{enabled:n}),l=getInitialValues(n,r),{handleSubmit:o}=useOfferFormSubmission({eventId:t,offerId:s,isEditMode:n,initialValues:l,setOffersStep:i});return n&&a?(0,b.jsx)(offers_OfferLoadingSkeleton,{}):(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(y.J9,{validationSchema:t1,initialValues:l,onSubmit:o,children:e=>{let{handleSubmit:s,dirty:i}=e;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ee.Z,{children:(0,b.jsx)("div",{className:"pt-[36x] md:pt-[90px] -mt-[36px] pb-20 md:w-[630px] md:mx-auto",children:(0,b.jsx)("form",{onSubmit:s,children:(0,b.jsx)("div",{className:"flex flex-row mt-4 mb-4 ml-4 mr-4",children:(0,b.jsxs)("div",{className:"w-full flex flex-col",children:[(0,b.jsx)(offer_create_OfferName,{}),(0,b.jsx)(offer_create_Kickback,{}),(0,b.jsx)(OfferEligibility,{}),(0,b.jsx)(AdvanceOfferOptions,{eventId:t})]})})})})}),(0,b.jsx)(offer_create_CreateOfferActions,{handleSubmit:s,isEditMode:n,disabled:n&&!i})]})}})})},offer_details_OfferDetailsHeader=e=>{var t,s,i;let{data:n}=e,{t:r}=(0,C.$G)(["events"]),a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=["users","organizations","associations"].reduce((t,s)=>{let i=e.filter(e=>e.selector===s).reduce((e,t)=>e+t.ids.length,0);return i>0&&(t[s]=i),t},{});return Object.entries(t).map(e=>{let[t,s]=e;return"".concat(s," ").concat(t)}).join(", ")}(null==n?void 0:n.eligibilityCriteria),l=null==n?void 0:null===(t=n.rewards)||void 0===t?void 0:t.kickbackRewards,{kind:o,value:d,saleConditions:{unit:c}}=l[0],u=null==n?void 0:n.discount;return(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-base font-bold text-[#202020]",children:null==n?void 0:n.name}),(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)("div",{className:"text-xs font-bold text-[#575757] uppercase",children:r("settings.promoterOffers.offerDetails.rewards")}),(0,b.jsx)("div",{className:"mt-1 text-[#202020] text-sm font-bold",children:"".concat(d).concat("amount"===o?"$":"%"," ").concat(r("settings.promoterOffers.offerDetails.per")," ").concat(c)})]}),(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)("div",{className:"text-xs font-bold text-[#575757] uppercase",children:r("settings.promoterOffers.offerDetails.eligibility")}),(0,b.jsx)("div",{className:"mt-1 text-[#202020] text-sm font-bold",children:a})]}),u&&(0,b.jsxs)("div",{className:"mt-4",children:[(0,b.jsx)("div",{className:"text-xs font-bold text-[#575757] uppercase",children:r("settings.promoterOffers.offerDetails.purchaserBenefits")}),(0,b.jsxs)("div",{className:"flex flex-row",children:[(0,b.jsx)("div",{className:"text-[#202020] text-sm font-normal",children:r("settings.promoterOffers.offerDetails.purchasersPayLess")}),(0,b.jsxs)("div",{className:"font-semibold ml-1 text-[#202020] text-sm",children:[null==n?void 0:null===(s=n.discount)||void 0===s?void 0:s.value," ",(null==n?void 0:null===(i=n.discount)||void 0===i?void 0:i.kind)==="amount"?"$":"%"," ",r("settings.promoterOffers.offerDetails.discount")]})]})]})]})},offers_OfferStat=e=>{let{title:t,description:s}=e;return(0,b.jsxs)("div",{className:"flex flex-col gap-1 flex-1",children:[(0,b.jsx)("div",{className:"text-sm font-bold text-[#787878]",children:t}),(0,b.jsx)("div",{className:"text-lg font-extrabold text-[#202020]",children:s})]})},offer_details_OfferDetailsStats=e=>{let{data:t}=e,{t:s}=(0,C.$G)(["events"]),{views:i,sales:n,revenue:r,earnings:a}=t.analytics;return(0,b.jsxs)("div",{className:"flex flex-col mt-6",children:[(0,b.jsxs)("div",{className:"flex flex-row ",children:[(0,b.jsx)("div",{className:"flex-1",children:(0,b.jsx)(offers_OfferStat,{title:s("settings.promoterOffers.statistics.views"),description:i.toString()})}),(0,b.jsx)("div",{className:"flex-1",children:(0,b.jsx)(offers_OfferStat,{title:s("settings.promoterOffers.statistics.sales"),description:n.toString()})})]}),(0,b.jsxs)("div",{className:"flex flex-row mt-4",children:[(0,b.jsx)("div",{className:"flex-1",children:(0,b.jsx)(offers_OfferStat,{title:s("settings.promoterOffers.statistics.salesRevenue"),description:(0,e2.O)(r)})}),(0,b.jsx)("div",{className:"flex-1",children:(0,b.jsx)(offers_OfferStat,{title:s("settings.promoterOffers.statistics.promoterEarnings"),description:(0,e2.O)(a)})})]})]})},modals_PromoterActionModal=e=>{let{onClose:t,promoterId:s,handlePausePromoter:i,isPaused:n}=e,{t:r}=(0,C.$G)(["events"]),a=(0,N.useRouter)(),l=r(n?"settings.promoterOffers.modals.promoterActions.resumePromoter":"settings.promoterOffers.modals.promoterActions.pausePromoter");return(0,b.jsx)(G.Z,{visible:!0,autoHeight:!0,onClose:t,type:G.w.SMALL,title:r("settings.promoterOffers.modals.promoterActions.title"),icon:(0,b.jsx)(e_.mZq,{size:20}),children:(0,b.jsxs)("div",{className:"mx-4",children:[(0,b.jsx)("div",{className:"flex flex-col gap-2 mt-6",children:(0,b.jsx)(V.ZP,{type:V.L$.Inverted,onClick:()=>{a.push("/profile/".concat(s))},icon:(0,b.jsx)(eu.BKo,{size:16}),children:r("settings.promoterOffers.modals.promoterActions.viewProfile")})}),(0,b.jsx)("div",{className:"flex flex-col gap-2 mt-6",children:(0,b.jsx)(V.ZP,{type:V.L$.Inverted,onClick:i,icon:n?(0,b.jsx)(eA.KP$,{size:20}):(0,b.jsx)(z.hPq,{size:20}),children:l})})]})})},offers_PromoterCard=e=>{let{contract:t,eventId:s}=e,{t:i}=(0,C.$G)(["events"]),{refetch:n}=(0,D.Wf)(s,{enabled:!1}),{refetch:r}=(0,D.BX)(t.offer.id,{enabled:!1}),{promoter:a,offer:l,analytics:o,attributionCode:d,attributionUrl:c}=t,{name:u,photoUrl:m}=a,{name:x}=l,{views:p,sales:v,revenue:g,earnings:f}=o,[h,j]=(0,w.useState)(!1),y=!t.isActive,N=(0,D.cS)(),handlePausePromoter=e=>{null==e||e.stopPropagation(),N.mutate({contractId:t.id,isActive:!t.isActive},{onSuccess:()=>{j(!1),n(),r()},onError:e=>{(0,T.x2)({title:i("settings.promoterOffers.promoterCard.errorPausingPromoter"),message:(null==e?void 0:e.message)||i("settings.promoterOffers.promoterCard.anErrorOccurred")})}})},handleCopyAttributionCode=e=>{e.stopPropagation(),navigator.clipboard.writeText(d),(0,T.CF)({message:i("settings.promoterOffers.promoterCard.copiedToClipboard"),type:"success"})};
1return(0,b.jsxs)("div",{className:"border-1 border-[#EBEBEB] mt-4 rounded-lg ".concat(y?"bg-[#F6F6F6]":""),children:[(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex flex-row items-center",children:[(0,b.jsx)(e9.qE,{src:m,size:e9.EF.Md,className:"mr-2"}),(0,b.jsx)("div",{className:"font-bold text-base",children:u})]}),(0,b.jsx)(tw.evw,{className:"text-[#787878]",size:20,onClick:e=>{e.stopPropagation(),j(!0)}})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-4 pb-2",children:[(0,b.jsx)("div",{className:"text-sm font-normal",children:"\uD83E\uDD1D"}),(0,b.jsx)("div",{className:"text-sm font-normal text-[#202020]",children:x})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pb-4",children:[(0,b.jsx)("div",{className:"text-sm font-normal",children:"\uD83D\uDDE3️"}),(0,b.jsxs)("div",{className:"flex flex-row items-center",children:[(0,b.jsx)("div",{className:"text-sm font-normal text-[#202020]",children:i("settings.promoterOffers.promoterCard.promoterCode")}),(0,b.jsx)("div",{className:"text-sm font-bold ".concat(y?"text-[#575757]":"text-[#3853C4]"," ml-1"),onClick:y?void 0:handleCopyAttributionCode,children:d}),(0,b.jsx)(z.vlz,{className:"".concat(y?"text-[#575757]":"text-[#3853C4]"," ml-1"),size:16,onClick:y?void 0:handleCopyAttributionCode})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-[1fr_96px] h-[44px] mb-4",children:[(0,b.jsx)("div",{className:"flex items-center font-normal text-[#202020] italic border ".concat(y?"border-[#DCDCDC]":"border-[#EFF2FF]"," rounded-tl-[100px] rounded-bl-[100px] h-[44px] overflow-hidden min-w-0"),children:(0,b.jsx)("div",{className:"ml-2 text-sm truncate w-full",children:c})}),(0,b.jsx)("div",{className:"h-[44px]",children:(0,b.jsxs)("div",{className:"flex items-center justify-center ".concat(y?"bg-[#DCDCDC]":"bg-[#3853C4]"," h-[44px] border-r-1 ").concat(y?"border-[#DCDCDC]":"border-[#3853C4]"," rounded-tr-[100px] rounded-br-[100px]"),children:[(0,b.jsx)("div",{className:"text-sm font-bold ".concat(y?"text-[#575757]":"text-white"),onClick:y?void 0:e=>{e.stopPropagation(),navigator.clipboard.writeText(c),(0,T.CF)({message:i("settings.promoterOffers.promoterCard.copiedToClipboard"),type:"success"})},children:i("settings.promoterOffers.promoterCard.copy")}),(0,b.jsx)(z.vlz,{className:"".concat(y?"text-[#575757]":"text-white"," ml-2"),size:16})]})})]}),(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 border ".concat(y?"":"border-[#
1EFF2FF]"," rounded-2xl p-2 ").concat(y?"bg-[#EFF2FF]":""),onClick:e=>handlePausePromoter(e),children:[(0,b.jsx)("div",{className:"text-sm font-bold text-[#3853C4]",children:y?i("settings.promoterOffers.promoterCard.resumePromoterLink"):i("settings.promoterOffers.promoterCard.pausePromoterLink")}),y?(0,b.jsx)(eA.KP$,{className:"text-[#3853C4]"}):(0,b.jsx)(e_.IWN,{className:"text-[#3853C4]"})]})]}),(0,b.jsx)("div",{className:"h-px ".concat(y?"bg-[#DCDCDC]":"bg-[#EBEBEB]"," w-full")}),(0,b.jsxs)("div",{className:"flex flex-row items-center justify-between p-4",children:[(0,b.jsx)(offers_OfferStat,{title:i("settings.promoterOffers.promoterCard.views"),description:p.toString()}),(0,b.jsx)(offers_OfferStat,{title:i("settings.promoterOffers.promoterCard.sales"),description:v.toString()}),(0,b.jsx)(offers_OfferStat,{title:i("settings.promoterOffers.promoterCard.revenue"),description:(0,e2.O)(g)}),(0,b.jsx)(offers_OfferStat,{title:i("settings.promoterOffers.promoterCard.earnings"),description:(0,e2.O)(f)})]}),h&&(0,b.jsx)(modals_PromoterActionModal,{onClose:()=>j(!1),promoterId:a.id,handlePausePromoter:handlePausePromoter,isPaused:y})]})},modals_EditPromoterStatusModal=e=>{let{eventId:t,offerId:s,isActive:i,onClose:n,onSuccess:r,onError:a}=e,{t:l}=(0,C.$G)(["events"]),o=(0,D.ce)(),{refetch:d}=(0,D.Wf)(t,{enabled:!1}),{refetch:c}=(0,D.BX)(s,{enabled:!1}),u=i?l("settings.promoterOffers.modals.editPromoterStatus.pausePromoterTitle"):l("settings.promoterOffers.modals.editPromoterStatus.resumePromoterTitle"),m=i?l("settings.promoterOffers.modals.editPromoterStatus.resumeDescription"):l("settings.promoterOffers.modals.editPromoterStatus.pauseDescription"),x=i?l("settings.promoterOffers.modals.editPromoterStatus.pausePromoter"):l("settings.promoterOffers.modals.editPromoterStatus.resumePromoter");return(0,b.jsx)(G.Z,{visible:!0,autoHeight:!0,onClose:n,type:G.w.SMALL,title:u,icon:(0,b.jsx)(e_.SVk,{size:20,color:"#8B661E"}),children:(0,b.jsxs)("div",{className:"flex flex-col mx-4",children:[(0,b.jsx)("div",{className:"flex flex-col gap-2 mt-6 text-sm font-normal text-[#575757]",children:m}),(0,b.jsxs)("div",{className:"flex flex-row items-center justify-center gap-2 mt-6",children:[(0,b.jsx)(V.ZP,{type:V.L$.Inverted,onClick:n,children:l("settings.promoterOffers.modals.editPromoterStatus.cancel")}),(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:()=>{o.mutate({offerId:s,isActive:!i},{onSuccess:()=>{r(),d(),c()},onError:e=>{null==a||a(e),(0,T.x2)({title:l("settings.promoterOffers.modals.editPromoterStatus.errorUpdatingStatus"),message:(null==e?void 0:e.message)||l("settings.promoterOffers.promoterCard.anErrorOccurred")})}})},children:x})]})]})})},offer_details_OfferDetailsSkeleton=()=>(0,b.jsx)(t0.Z,{children:(0,b.jsxs)("div",{className:"animate-pulse pt-[90px] md:pt-[180px] -mt-[90px] pb-20 md:w-[630px] md:mx-auto",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/6 mb-8"}),(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/6"}),(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-3/6 "})]}),(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full mt-8",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/6"}),(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-3/6 "})]}),(0,b.jsx)("div",{className:"h-12 bg-gray-200 rounded w-5/6 mt-8"}),(0,b.jsxs)("div",{className:"flex flex-row",children:[(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full mt-8",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-4/6"}),(0,b.jsx)("div",{className:"h-6 bg-gray-200 rounded w-2/6 "})]}),(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full mt-8",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-4/6"}),(0,b.jsx)("div",{className:"h-6 bg-gray-200 rounded w-2/6 "})]})]}),(0,b.jsxs)("div",{className:"flex flex-row",children:[(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full mt-8",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-4/6"}),(0,b.jsx)("div",{className:"h-6 bg-gray-200 rounded w-2/6 "})]}),(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full mt-8",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-4/6"}),(0,b.jsx)("div",{className:"h-6 bg-gray-200 rounded w-2/6 "})]})]})]})}),modals_OfferActionModal=e=>{var t;let{offer:s,onClose:i,handleDeletePromoterOffer:n,handleOfferDetails:r}=e,{t:a}=(0,C.$G)(["events"]),l=!s.isActive,o=(null!==(t=null==s?void 0:s.activePromoters)&&void 0!==t?t:0)>0,[d,c]=(0,w.useState)(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Z,{visible:!0,autoHeight:!0,onClose:i,t
1ype:G.w.SMALL,title:a("settings.promoterOffers.modals.offerActions.title"),icon:(0,b.jsx)(e_.mZq,{size:20}),renderFooter:()=>(0,b.jsx)("div",{className:"justify-center self-center items-center my-1 ".concat(o?"text-gray-500 cursor-not-allowed opacity-70":"text-[#A4332A] cursor-pointer"),onClick:o?void 0:n,children:(0,b.jsxs)("div",{className:"flex items-center justify-center text-base font-bold",children:[(0,b.jsx)(eu.Xm5,{size:14,className:"mr-2"}),a("settings.promoterOffers.modals.offerActions.deleteOffer")]})}),children:(0,b.jsxs)("div",{className:"mx-4",children:[(0,b.jsx)("div",{className:"flex flex-col gap-2 mt-6",children:(0,b.jsx)(V.ZP,{type:V.L$.Inverted,onClick:r,icon:(0,b.jsx)("img",{src:"/img/events/create/offer-blue.svg",height:16,width:16}),children:a("settings.promoterOffers.modals.offerActions.offerDetails")})}),(0,b.jsx)("div",{className:"flex flex-col gap-2 mt-6",children:(0,b.jsx)(V.ZP,{type:V.L$.Inverted,onClick:()=>{c(!0)},icon:l?(0,b.jsx)(eu.Gzj,{size:20}):(0,b.jsx)(z.hPq,{size:20}),children:l?a("settings.promoterOffers.modals.offerActions.resumeOffer"):a("settings.promoterOffers.modals.offerActions.pauseOffer")})})]})}),d&&(0,b.jsx)(modals_EditPromoterStatusModal,{onClose:()=>c(e=>!e),eventId:s.eventId,offerId:s.id,isActive:s.isActive,onSuccess:()=>{c(!1),i()}})]})},modals_DeletePromoterOfferModal=e=>{let{onClose:t,handleDeletePromoterOffer:s}=e,{t:i}=(0,C.$G)(["events"]);return(0,b.jsx)(G.Z,{visible:!0,autoHeight:!0,onClose:t,type:G.w.SMALL,title:i("settings.promoterOffers.modals.deleteOffer.title"),icon:(0,b.jsx)(e_.SVk,{size:20,color:"#8B661E"}),children:(0,b.jsxs)("div",{className:"flex flex-col mx-4",children:[(0,b.jsx)("div",{className:"flex flex-col gap-2 mt-6 text-sm font-normal text-[#575757]",children:i("settings.promoterOffers.modals.deleteOffer.message")}),(0,b.jsxs)("div",{className:"flex flex-row items-center justify-center gap-2 mt-6",children:[(0,b.jsx)(V.ZP,{type:V.L$.Inverted,onClick:t,children:i("settings.promoterOffers.modals.deleteOffer.cancel")}),(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:s,children:i("settings.promoterOffers.modals.deleteOffer.delete")})]})]})})},offers_OfferCard=e=>{var t,s,i,n,r,a;let{offer:l,handleDeletePromoterOffer:o,handleOfferClick:d,setOffersStep:c,setOfferId:u}=e,{t:m}=(0,C.$G)(["events"]),[p,v]=(0,w.useState)(!1),[g,f]=(0,w.useState)(!l.isActive),[h,j]=(0,w.useState)(!1),[y,N]=(0,w.useState)(!1);(0,w.useEffect)(()=>{f(!l.isActive)},[l.isActive]);let handlePausePromoterClick=e=>{e.stopPropagation(),v(!0)},handleDeletePromoterOfferClick=e=>{e.stopPropagation(),N(!1),j(!1)};return(0,b.jsxs)("div",{className:"border-1 border-[#EBEBEB] rounded-lg ".concat(g?"bg-[#F6F6F6]":""),children:[(0,b.jsxs)("div",{className:"p-4",onClick:()=>d(l.id),children:[(0,b.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,b.jsx)("div",{className:"font-bold text-base ".concat(g?"text-[#575757]":""),children:l.name}),(0,b.jsx)(tw.evw,{className:"text-[#787878]",size:20,onClick:e=>{e.stopPropagation(),j(!0)}})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"text-sm font-normal py-4",children:"\uD83D\uDDE3️"}),(0,b.jsxs)("div",{className:"text-sm font-normal py-4 ".concat(g?"text-[#575757]":"text-[#202020]"),children:[l.activePromoters," ",m("settings.promoterOffers.offerCard.activePromoters")]})]}),g?(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 border border-[#EFF2FF] rounded-2xl p-2 bg-[#EFF2FF]",onClick:handlePausePromoterClick,children:[(0,b.jsx)("div",{className:"text-sm font-bold text-[#3853C4]",children:m("settings.promoterOffers.offerCard.resumeOffer")}),(0,b.jsx)(eu.Gzj,{className:"text-[#3853C4]",size:14})]}):(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 border border-[#EFF2FF] rounded-2xl p-2",onClick:handlePausePromoterClick,children:[(0,b.jsx)("div",{className:"text-sm font-bold text-[#3853C4]",children:m("settings.promoterOffers.offerCard.pauseOffer")}),(0,b.jsx)(e_.IWN,{className:"text-[#3853C4]",size:14})]})]}),(0,b.jsx)("div",{className:"h-[1px] bg-[#EBEBEB] w-full"}),(0,b.jsxs)("div",{className:"flex flex-row items-center p-4",children:[(0,b.jsx)(offers_OfferStat,{title:m("settings.promoterOffers.offerCard.views"),description:(null===(s=l.analytics)||void 0===s?void 0:null===(t=s.views)||void 0===t?void 0:t.toString())||"0"}),(0,b.jsx)(offers_OfferStat,{title:m("settings.promoterOffers.offerCard.eligibleSales"),description:(null===(n=l.analytics)||void 0===n?void 0:null===(i=n.sales)||void 0===i?void 0:i.toString())||"0"}),(0,b.jsx)(offers_OfferStat,{title:m("settings.promoterOffers.offerCard.revenue"),description:(0,e2.O)(null===(r=l.anal
1ytics)||void 0===r?void 0:r.revenue)}),(0,b.jsx)(offers_OfferStat,{title:m("settings.promoterOffers.offerCard.earnings"),description:(0,e2.O)(null===(a=l.analytics)||void 0===a?void 0:a.earnings)})]}),p&&(0,b.jsx)(modals_EditPromoterStatusModal,{onClose:()=>v(e=>!e),eventId:l.eventId,offerId:l.id,isActive:l.isActive,onSuccess:()=>{v(!1)}}),h&&(0,b.jsx)(modals_OfferActionModal,{offer:l,onClose:()=>j(!1),handleDeletePromoterOffer:()=>N(!0),handleOfferDetails:()=>{u(l.id),c(x.OFFER_DETAILS)}}),y&&(0,b.jsx)(modals_DeletePromoterOfferModal,{onClose:()=>N(!1),handleDeletePromoterOffer:()=>o(l.id,()=>handleDeletePromoterOfferClick)})]})},offer_list_OfferListSkeleton=()=>(0,b.jsx)(t0.Z,{children:(0,b.jsx)("div",{className:"animate-pulse pt-[90px] md:pt-[180px] -mt-[90px] pb-20 md:w-[630px] md:mx-auto",children:(0,b.jsxs)("div",{className:"flex flex-col space-y-2 w-full",children:[(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/6 mb-4"}),(0,b.jsx)("div",{className:"h-60 bg-gray-200 rounded w-5/6 rounded-xl"}),(0,b.jsx)("div",{className:"h-60 bg-gray-200 rounded w-5/6 rounded-xl"}),(0,b.jsx)("div",{className:"h-8 bg-gray-200 rounded w-1/6 mb-4 mt-2"}),(0,b.jsx)("div",{className:"h-60 bg-gray-200 rounded w-5/6 rounded-xl"})]})})}),offer_list_OfferListEmptyState=e=>{let{handleCreateOffer:t}=e,{t:s}=(0,C.$G)(["events"]);return(0,b.jsx)("div",{className:"pt-[36x] md:pt-[90px] -mt-[36px] pb-20 md:w-[630px] md:mx-auto md:px-0 px-4",children:(0,b.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,b.jsxs)("div",{className:"bg-white p-4 rounded-lg shadow-md w-full px-20 py-10",children:[(0,b.jsx)("div",{className:"flex items-center justify-center",children:(0,b.jsx)("img",{src:"/img/events/create/offer.svg",height:32,width:32})}),(0,b.jsx)("div",{className:"font-bold text-base text-[#575757] text-center mt-2",children:s("settings.promoterOffers.page.emptyState.title")}),(0,b.jsx)("p",{className:"text-sm text-[#575757] text-center mt-2",children:s("settings.promoterOffers.page.emptyState.description")}),(0,b.jsx)("div",{className:"mt-4",children:(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:t,children:s("settings.promoterOffers.page.emptyState.createOffer")})})]})})})};let t2={[x.CREATE_OFFER]:Offers_CreateOfferPage,[x.OFFERS_LIST]:e=>{var t,s;let{eventId:i,setOffersStep:n,setOfferId:r}=e,{t:a}=(0,C.$G)(["events"]),{data:l,refetch:o,isLoading:d,isFetching:c}=(0,D.Wf)(i,{enabled:!!i}),u=null==l?void 0:l.offers,m=null==u?void 0:u.flatMap(e=>e.contracts),handleOfferClick=e=>{r(e),n(x.OFFER_DETAILS)},p=(0,D.Mc)(),handleDeletePromoterOffer=(e,t)=>{p.mutate({offerId:e},{onSuccess:()=>{o(),t()},onError:e=>{(0,T.x2)({title:a("settings.promoterOffers.page.errors.deleteOffer"),message:(null==e?void 0:e.message)||a("settings.promoterOffers.page.errors.general")})}})},handleCreateOffer=()=>{r(null),n(x.CREATE_OFFER)};return d||c?(0,b.jsx)(offer_list_OfferListSkeleton,{}):l&&(null==l?void 0:null===(t=l.offers)||void 0===t?void 0:t.length)===0?(0,b.jsx)(offer_list_OfferListEmptyState,{handleCreateOffer:handleCreateOffer}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ee.Z,{children:(0,b.jsxs)("div",{className:"pt-[36x] md:pt-[90px] -mt-[36px] pb-20 md:w-[630px] md:mx-auto md:px-0 px-4",children:[(0,b.jsxs)("div",{className:"my-4",children:[(0,b.jsx)("div",{className:"font-bold text-base text-[#202020]",children:a("settings.promoterOffers.page.availableOffers")}),null==l?void 0:null===(s=l.offers)||void 0===s?void 0:s.map(e=>(0,b.jsx)("div",{className:"mt-4",children:(0,b.jsx)(offers_OfferCard,{offer:e,handleDeletePromoterOffer:handleDeletePromoterOffer,handleOfferClick:handleOfferClick,setOffersStep:n,setOfferId:r})},e.id))]}),(null==m?void 0:m.length)>0&&(0,b.jsxs)("div",{className:"my-4",children:[(0,b.jsxs)("div",{className:"font-bold text-base text-[#202020]",children:[a("settings.promoterOffers.page.promoters")," (",null==m?void 0:m.length,")"]}),(0,b.jsx)("div",{className:"mt-4",children:null==m?void 0:m.map(e=>(0,b.jsx)(offers_PromoterCard,{contract:e,eventId:i},e.id))})]})]})}),(0,b.jsx)("div",{className:"w-full bg-white fixed bottom-0 left-0 p-4 z-10 border-t pb-12 md:pb-4",children:(0,b.jsx)("div",{className:"w-full md:w-[343px] mx-auto",children:(0,b.jsx)("div",{className:"flex gap-4",children:(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:handleCreateOffer,children:(0,b.jsx)("div",{className:"flex items-center justify-center",children:a("settings.promoterOffers.page.createOfferButton")})})})})})]})},[x.EDIT_OFFER]:Offers_CreateOfferPage,[x.OFFER_DETAILS]:e=>{let{offerId:t,setOffersStep:s}=e,{t:i}=(0,C.$G)(["events"]),{data:n,isLoading:r}=(0,D.BX)(t,{enabled:!!t}),a=null==n?void 0:n.contracts,[l,o]=(0,w.useState)(!1);return r||!n?(0,b.jsx)(offer_details_OfferDetailsSkeleton,{}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ee.Z,{children:(0,b.jsxs)("div",{className:"pt-[36x] md:pt-[90px] -mt-[36px] pb-20 md:w-[630px] md:mx-auto md:px-0 px-4",children:[(0,b.jsx)(offer_details_OfferDetailsHeader,{data:n}),(0,b.jsxs)("div",{className:"flex mt-4 items-center justify-center gap-2 border border-[#
1EFF2FF] rounded-2xl p-2 ".concat((null==n?void 0:n.isActive)?"":"bg-[#EFF2FF]"),onClick:()=>o(!0),children:[(0,b.jsx)("div",{className:"text-sm font-bold text-[#3853C4]",children:i((null==n?void 0:n.isActive)?"settings.promoterOffers.page.pauseOffer":"settings.promoterOffers.page.resumeOffer")}),(null==n?void 0:n.isActive)?(0,b.jsx)(e_.IWN,{className:"text-[#3853C4]"}):(0,b.jsx)(eA.KP$,{className:"text-[#3853C4]"})]}),(0,b.jsx)(offer_details_OfferDetailsStats,{data:n}),(null==a?void 0:a.length)>0&&(0,b.jsxs)("div",{className:"mt-10",children:[(0,b.jsxs)("div",{className:"text-base font-bold text-[#202020] mb-4",children:[i("settings.promoterOffers.page.promoters")," (",null==a?void 0:a.length,")"]}),(0,b.jsx)("div",{className:"mt-4",children:null==a?void 0:a.map(e=>(0,b.jsx)(offers_PromoterCard,{contract:e,eventId:null==n?void 0:n.eventId},e.id))})]})]})}),(0,b.jsx)("div",{className:"w-full bg-white fixed bottom-0 left-0 p-4 z-10 border-t pb-12 md:pb-4",onClick:()=>{s(x.EDIT_OFFER)},children:(0,b.jsx)("div",{className:"w-full md:w-[343px] mx-auto",children:(0,b.jsx)("div",{className:"flex gap-4",children:(0,b.jsx)(V.ZP,{type:V.L$.Primary,onClick:()=>null,children:(0,b.jsx)("div",{className:"flex items-center justify-center",children:i("settings.promoterOffers.page.editOfferButton")})})})})}),l&&(0,b.jsx)(modals_EditPromoterStatusModal,{onClose:()=>o(e=>!e),eventId:null==n?void 0:n.eventId,offerId:null==n?void 0:n.id,isActive:null==n?void 0:n.isActive,onSuccess:()=>{o(!1)}})]})}},getOffersStepTitle=(e,t)=>{switch(e){case x.CREATE_OFFER:return t("settings.promoterOffers.page.stepTitles.newOffer");case x.OFFERS_LIST:return t("settings.promoterOffers.page.stepTitles.offers");case x.EDIT_OFFER:return t("settings.promoterOffers.page.stepTitles.editOffer");case x.OFFER_DETAILS:return t("settings.promoterOffers.page.stepTitles.offerDetails");default:return t("settings.promoterOffers.page.stepTitles.offers")}};var Offers=()=>{let{t:e}=(0,C.$G)(["events"]),{eventId:t,offersStep:s,setOffersStep:i,handleOfferBackNavigation:n,isDraft:r,isEditing:a,isLoading:l,lastUpdated:o,handleBack:d,navigateToEventSettings:c}=useEventEditorContext(),[u,m]=(0,w.useState)(void 0),x=t2[s];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:r,isEditing:a,title:getOffersStepTitle(s,e),isLoading:l,lastUpdated:o,onBack:d,onMenuClick:c}),(0,b.jsx)(x,{offerId:u,eventId:t,onClose:n,step:s,setOffersStep:i,setOfferId:m})]})},t5=s(64487),t4=s(23331),t3=s(68552);s(16747);let t6={collapseOnDrag:!0,showCreatorThemeSettings:!1,showJSONEditorTab:!1,showThemeTab:!1};t_.ei2.removeProperty("survey","logo"),t_.ei2.removeProperty("survey","logoFit"),t_.ei2.removeProperty("survey","logoWidth"),t_.ei2.removeProperty("survey","logoHeight"),(0,t_.eGC)("ZTFjNDNmODQtMWNjZi00NGM1LWIzMGUtNTAyYTYwZWU5MTA2OzE9MjAyNi0wOS0xOA");let t7={themeName:"customTheme",cssVariables:{"--sjs-layer-1-background-500":"#FFFFFFFF","--sjs-layer-1-background-400":"#f0f3ff","--sjs-layer-1-foreground-100":"#222","--sjs-layer-1-foreground-50":"#222","--sjs-layer-3-background-500":"#fff","--sjs-layer-3-foreground-100":"#222","--sjs-layer-3-foreground-50":"#6a7282","--sjs-layer-2-background-500":"#fff","--sjs-layer-2-background-400":"#DAE2F7FF","--sjs-border-25":"#e5e7eb","--sjs-border-10":"#e5e7eb","--sjs-primary-background-500":"#3853C4","--sjs-primary-background-10":"#f0f3ff","--sjs-primary-background-400":"#3853C4","--sjs-primary-foreground-100":"#fff","--sjs-primary-foreground-25":"#fff","--sjs-secondary-background-500":"#3853C4","--sjs-secondary-background-25":"#d6e3ff","--sjs-secondary-background-10":"#f0f3ff","--sjs-secondary-foreground-100":"#fff","--sjs-secondary-forecolor-25":"#fff","--sjs-semantic-red-background-500":"#c10007","--sjs-semantic-red-background-10":"#fef2f2","--sjs-semantic-red-foreground-100":"#FFFFFFFF","--sjs-semantic-green-background-500":"#19B394FF","--sjs-semantic-green-background-10":"#19B3941A","--sjs-semantic-green-foreground-100":"#FFFFFFFF","--sjs-semantic-blue-background-500":"#437FD9FF","--sjs-semantic-blue-background-10":"#437FD91A","--sjs-semantic-blue-foreground-100":"#FFFFFFFF","--sjs-semantic-yellow-background-500":"#FF9814FF","--sjs-semantic-yellow-background-10":"#FF98141A","--sjs-semantic-yellow-foreground-100":"#FFFFFFFF","--sjs-semantic-white-background-500":"#FFFFFFFF","--sjs-code-gray-700":"#B6B6B6FF","--sjs-code-blue-500":"#326FCAFF","--sjs-code-gray-300":"#505050FF","--sjs-code-green-500":"#08997CFF","--sjs-code-red-500":"#c10007","--sjs-code-purple-500":"#C22FA2FF","--sjs-code-yellow-500":"#F58D06FF","--sjs-code-gray-500":"#8A8A8AFF","--sjs-special-background":"#fafafa","--sjs-layer-1-foreground-75":"#3853C4","--sjs-layer-3-background-400":"#f0f3ff","--sjs-special-glow":"#27385933","--sjs-special-shadow":"#27385940","--sjs-layer-3-foreground-75":"#0930A0FF","--sjs-layer-2-foreground-100":"#273859FF","--sjs-layer-2-foreground-75":"#0930A0FF","--sjs-layer-2-foreground-50":"#26335880","--sjs-border-25-overlay":"#00000026","--sjs-secondary-background-400":"#C62076FF","--ctr-surface-button-corner-radius":"24px","--ctr-button-corner-radius-small":"24px"}};var create_event_PrePurchaseQuestions=function(){let{t:e}=(0,C.$G)(["events"]),{isDraft:t,isEditing:s,isLoading:i,lastUpdated:n,handleBack:r,navigateToEventSettings:a,eventId:l,event:o}=useEventEditorContext(),{mutateAsync:d,isLoading:c}=(0,t3.$N)(),{mutateAsync:u,isLoading:m}=(0,t3.me)(),{mutate:x,isLoading:p}=(0,t3.NI)(),{data:v,isLoading:g}=(0,t3.zb)({eventId:l},{enabled:!!(null==o?void 0:o.prePurchaseFormId)}),f=i||g||c||m||p,handleSaveSurvey=async()=>
1{if(Object.keys(h.JSON).length>0)try{let t={eventId:l,schema:h.JSON};(null==o?void 0:o.prePurchaseFormId)?await u(t):await d(t),(0,T.Vp)(e("events:settings.guestQuestion.saveSuccess")),r()}catch(e){(0,T.vU)(e.message||"Error saving survey"),t5.Tb(e,{tags:{component:"EventPrePurchaseQuestions",action:"saveSurvey"}})}},h=(0,w.useMemo)(()=>{let e=new t4.Kj(t6);e.initSurveyWithJSON(null==v?void 0:v.schema,!0),e.showSaveButton=!1,e.applyCreatorTheme(t7),e.applyTheme(tF.Q);let t=e.toolbar.actions.findIndex(e=>"svd-save"===e.id),s=e.footerToolbar.actions.findIndex(e=>"svd-save"===e.id);return -1!==t&&e.toolbar.actions.splice(t,1),-1!==s&&e.footerToolbar.actions.splice(s,1),e.toolbox.removeItem("file"),e.toolbox.removeItem("imagepicker"),e.toolbox.removeItem("image"),e.toolbox.removeItem("html"),e.toolbox.removeItem("surveylogo"),e},[null==v?void 0:v.schema]);return(0,w.useEffect)(()=>{h.saveSurveyFunc=handleSaveSurvey},[h,l]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(eE.Z,{isDraft:t,isEditing:s,title:e("events:settings.guestQuestion.title"),isLoading:f,lastUpdated:n,onBack:r,onMenuClick:a,className:"z-1001"}),(0,b.jsxs)("div",{className:"w-full pt-[36x] md:pt-[84px] -mt-[36px] pb-20 h-[calc(100vh-101px)] md:h-[calc(100vh-70px)] lg:h-[calc(100vh-42px)]",children:[(0,b.jsx)(t4._$,{creator:h}),f&&(0,b.jsx)("div",{className:"absolute top-0 left-0 right-0 bottom-0 z-99 bg-white/80",children:(0,b.jsx)(tP.Z,{isLoading:!0})})]}),(0,b.jsx)("div",{className:"w-full bg-white fixed bottom-0 left-0 p-4 z-1000 border-t pb-12 md:pb-4",children:(0,b.jsxs)("div",{className:"w-full md:w-[800px] mx-auto flex gap-4 justify-center items-center",children:[(0,b.jsx)(V.ZP,{type:V.L$.Inverted,onClick:()=>{h.saveSurvey()},disabled:f,newRadius:!0,autoWidth:!(null==o?void 0:o.prePurchaseFormId),loading:f,icon:(0,b.jsx)(z.tfk,{size:20}),className:"w-full md:w-auto",children:(0,b.jsx)("div",{className:"flex items-center justify-center",children:e("events:settings.guestQuestion.".concat((null==o?void 0:o.prePurchaseFormId)?"updateButton":"createButton"))})}),(null==o?void 0:o.prePurchaseFormId)&&(0,b.jsx)(V.ZP,{type:V.L$.Danger,onClick:()=>{eV.Z.confirm({title:e("events:settings.guestQuestion.deleteQuestionsTitle"),icon:(0,b.jsx)(e$.default,{}),content:e("events:settings.guestQuestion.deleteQuestionsConfirmation"),centered:!0,okText:e("events:settings.guestQuestion.deleteQuestionsYes"),okType:"danger",cancelText:e("events:settings.guestQuestion.deleteQuestionsNo"),onOk:()=>{try{x(l,{onSuccess:()=>{r(),(0,T.Vp)(e("events:settings.guestQuestion.deleteQuestionsSuccess"))}})}catch(e){(0,T.vU)(e.message||"Error deleting pre purchase form"),t5.Tb(e,{tags:{component:"EventPrePurchaseQuestions",action:"deleteSurvey"}})}}})},icon:(0,b.jsx)(e_.hME,{size:20}),mobileRounded:!0,children:(0,b.jsx)("span",{className:"hidden md:block",children:e("events:settings.guestQuestion.deleteButton")})})]})})]})},t9=s(49882);let t8=j.Ry({photo:j.Ry({url:j.Z_().required("Required field")}),title:j.Z_().required("Required field"),address:j.Z_().required("Required field"),startDate:j.Z_().required("Required field"),description:j.Z_().required("Required field")}),ScreenComponent=e=>{let{screen:t}=e;switch(t){case p.BASIC_FORM:return(0,b.jsx)(create_event_BasicForm,{});case p.EVENT_SETTINGS:return(0,b.jsx)(create_event_EventSettings,{});case p.RECURRING_SETTINGS:return(0,b.jsx)(create_event_RecurringSettings,{});case p.PRICING_TIERS:return(0,b.jsx)(settings_PricingTiers,{});case p.REQUEST_TO_PUBLISH_FORM:return(0,b.jsx)(create_event_RequestToPublishForm,{});case p.TRACKING_LINKS:return(0,b.jsx)(create_event_TrackingLinksPage,{});case p.DISCOUNT_CODES:return(0,b.jsx)(DiscountCodePage,{});case p.OFFERS:return(0,b.jsx)(Offers,{});case p.PRE_PURCHASE_QUESTIONS:return(0,b.jsx)(create_event_PrePurchaseQuestions,{});default:return(0,b.jsx)(create_event_BasicForm,{})}};var CreateEvent_screen=e=>{var t;let{eventId:s,orgId:i,startDate:n}=e,{t:r}=(0,C.$G)(["events"]),a=(0,N.useRouter)(),{setHideIntercom:l}=(0,t9.o)();(0,w.useEffect)(()=>(l(!0),()=>{l(!1)}),[l]);let[o,d]=(0,w.useState)(p.BASIC_FORM),[c,u]=(0,w.useState)(!1),[m,v]=(0,w.useState)(!1),[g,f]=(0,w.useState)(x.CREATE_OFFER),togglePublishModal=()=>{u(e=>!e)},h=(0,w.useMemo)(()=>
1{if(!n)return;let e=S()(n);if(e.isValid())return 0===e.hour()&&0===e.minute()&&0===e.second()?e.clone().add(1,"hours").startOf("hour").toISOString():e.toISOString()},[n]),j=hooks_useEventCreation({eventId:s,orgId:i,startDate:h}),onSubmit=async()=>{j.shouldRequestToPublish?j.requestToPublishFormId||j.requestToPublishWorkflowId?d(p.REQUEST_TO_PUBLISH_FORM):await requestPublication():togglePublishModal()},requestPublication=async e=>{await j.requestPublication(e),v(!0)},requestPublicationWorkflow=async e=>{await j.requestPublicationWorkflow(e),v(!0)};return j.shouldShowEventLoading&&j.isLoadingEvent?(0,b.jsx)(tS.Z,{}):!j.event||(null==j?void 0:null===(t=j.event)||void 0===t?void 0:t.isOrganizer)?(0,b.jsx)(y.J9,{initialValues:j.initialValues,onSubmit:onSubmit,enableReinitialize:!0,validationSchema:t8,children:e=>{let{values:t,dirty:s}=e;(0,w.useEffect)(()=>{s&&j.update(t)},[t,s]);let publishEvent=async()=>{await j.publish(t),a.push("/events/".concat(j.eventId)),(0,T.CF)({icon:"\uD83D\uDE4C",message:r("events:createEvent.publishedSuccess")})};return(0,b.jsxs)(y.l0,{children:[(0,b.jsx)(EventEditorProvider,{associationId:j.associationId,eventId:j.eventId,event:j.event,isDraft:t.isDraft,isEditing:!!t._id,isLoading:j.isLoading,lastUpdated:j.lastUpdated,eventSeriesId:j.initialValues.seriesId,eventShareToken:j.initialValues.shareToken,shouldRequestToPublish:j.shouldRequestToPublish,requestToPublishFormId:j.requestToPublishFormId,requestToPublishWorkflowId:j.requestToPublishWorkflowId,startDate:h,offersStep:g,setOffersStep:f,createDraft:j.createDraft,requestPublication:requestPublication,requestPublicationWorkflow:requestPublicationWorkflow,refetchEvent:j.refetchEvent,currentScreen:o,setCurrentScreen:d,children:(0,b.jsx)(ScreenComponent,{screen:o})}),c&&(0,b.jsx)(create_event_PublishModal,{onClose:togglePublishModal,onPublish:publishEvent,isLoading:j.isLoading}),m&&(0,b.jsx)(create_event_PublicationRequestedModal,{eventCoverImgUrl:t.photo.url})]})}}):(0,b.jsx)(tI.Z,{to:"/404"})}},46718:function(e,t,s){"use strict";s.d(t,{Q:function(){return i}});let i={themeName:"default",colorPalette:"light",isPanelless:!0,backgroundImage:"",backgroundOpacity:1,backgroundImageAttachment:"scroll",backgroundImageFit:"cover",cssVariables:{"--sjs-editorpanel-backcolor":"rgba(255, 255, 255, 1)","--sjs-editorpanel-cornerRadius":"8px","--sjs-corner-radius":"16px","--sjs-base-unit":"8px","--sjs-font-pagetitle-family":"Inter, sans-serif","--sjs-font-pagedescription-family":"Inter, sans-serif","--sjs-shadow-small":"0px 1px 2px 0px rgba(0, 0, 0, 0.15)","--sjs-font-questiontitle-family":"Inter, sans-serif","--sjs-font-questiondescription-family":"Inter, sans-serif","--sjs-shadow-inner":"inset 0px 0px 0px 2px rgba(229, 231, 235, 1)","--sjs-border-default":"rgba(0, 0, 0, 0.16)","--sjs-border-light":"rgba(0, 0, 0, 0.09)","--sjs-general-backcolor":"rgba(255, 255, 255, 1)","--sjs-general-backcolor-dark":"rgba(248, 248, 248, 1)","--sjs-general-backcolor-dim-light":"rgba(249, 249, 249, 1)","--sjs-general-backcolor-dim-dark":"rgba(243, 243, 243, 1)","--sjs-general-forecolor":"rgba(0, 0, 0, 0.91)","--sjs-general-forecolor-light":"rgba(0, 0, 0, 0.45)","--sjs-general-dim-forecolor":"rgba(0, 0, 0, 0.91)","--sjs-general-dim-forecolor-light":"rgba(0, 0, 0, 0.45)","--sjs-secondary-backcolor":"rgba(255, 152, 20, 1)","--sjs-secondary-backcolor-light":"rgba(255, 152, 20, 0.1)","--sjs-secondary-backcolor-semi-light":"rgba(255, 152, 20, 0.25)","--sjs-secondary-forecolor":"rgba(255, 255, 255, 1)","--sjs-secondary-forecolor-light":"rgba(255, 255, 255, 0.25)","--sjs-shadow-small-reset":"0px 0px 0px 0px rgba(0, 0, 0, 0.15)","--sjs-shadow-medium":"0px 2px 6px 0px rgba(0, 0, 0, 0.1)","--sjs-shadow-large":"0px 8px 16px 0px rgba(0, 0, 0, 0.1)","--sjs-shadow-inner-reset":"inset 0px 0px 0px 0px rgba(229, 231, 235, 1)","--sjs-border-inside":"rgba(0, 0, 0, 0.16)","--sjs-special-red-forecolor":"rgba(255, 255, 255, 1)","--sjs-special-green":"rgba(25, 179, 148, 1)","--sjs-special-green-light":"rgba(25, 179, 148, 0.1)","--sjs-special-green-forecolor":"rgba(255, 255, 255, 1)","--sjs-special-blue":"rgba(67, 127, 217, 1)","--sjs-special-blue-light":"rgba(67, 127, 217, 0.1)","--sjs-special-blue-forecolor":"rgba(255, 255, 255, 1)","--sjs-special-yellow":"rgba(255, 152, 20, 1)","--sjs-special-yellow-light":"rgba(255, 152, 20, 0.1)","--sjs-special-yellow-forecolor":"rgba(255, 255, 255, 1)","--sjs-article-font-xx-large-textDecoration":"none","--sjs-article-font-xx-large-fontWeight":"700","--sjs-article-font-xx-large-fontStyle":"normal","--sjs-article-font-xx-large-fontStretch":"normal","--sjs-article-font-xx-large-letterSpacing":"0","--sjs-article-font-xx-large-lineHeight":"64px","--sjs-article-font-xx-large-paragraphIndent":"0px","--sjs-article-font-xx-large-textCase":"none","--sjs-article-font-x-large-textDecoration":"none","--sjs-article-font-x-large-fontWeight":"700","--sjs-article-font-x-large-fontStyle":"normal","--sjs-article-font-x-large-fontStretch":"normal","--sjs-article-font-x-large-letterSpacing":"0","--sjs-article-font-x-large-lineHeight":"56px","--sjs-article-font-x-large-paragraphIndent":"0px","--sjs-article-font-x-large-textCase":"none","--sjs-article-font-large-textDecoration":"none","--sjs-article-font-large-fontWeight":"700","--sjs-article-font-large-fontStyle":"normal","--sjs-article-font-large-fontStretch":"normal","--sjs-article-font-large-letterSpacing":"0","--sjs-article-font-large-lineHeight":"40px","--sjs-article-font-large-paragraphIndent":"0px","--sjs-article-font-large-textCase":"none","--sjs-article-font-medium-textDecoration":"none","--sjs-article-font-medium-fontWeight":"700","--sjs-article-font-medium-fontStyle":"normal","--sjs-article-font-medium-fontStretch":"normal","--sjs-article-font-medium-letterSpacing":"0","--sjs-article-font-medium-lineHeight":"32px","--sjs-article-font-medium-paragraphIndent":"0px","--sjs-article-font-medium-textCase":"none","--sjs-article-font-default-textDecoration":"none","--sjs-article-font-default-fontWeight":"400","--sjs-article-font-default-fontStyle":"normal","--sjs-article-font-default-fontStretch":"normal","--sjs-article-font-default-letterSpacing":"0","--sjs-article-font-default-lineHeight":"28px","--sjs-article-font-default-paragraphIndent":"0px","--sjs-article-font-default-textCase":"none","--sjs-general-backcolor-dim"
1:"rgba(255, 255, 255, 1)","--sjs-primary-backcolor":"rgba(101, 134, 255, 1)","--sjs-primary-backcolor-dark":"rgba(95, 126, 240, 1)","--sjs-primary-backcolor-light":"rgba(101, 134, 255, 0.1)","--sjs-primary-forecolor":"rgba(255, 255, 255, 1)","--sjs-primary-forecolor-light":"rgba(255, 255, 255, 0.25)","--sjs-special-red":"rgba(229, 10, 62, 1)","--sjs-special-red-light":"rgba(229, 10, 62, 0.1)"},headerView:"basic"}},85906:function(e){e.exports={"avatar-group--stack":"styles_avatar-group--stack__Ag7YZ"}},97927:function(e){e.exports={datepicker:"DateTime_datepicker__PA0dQ",disabled:"DateTime_disabled___Nsa6"}},6259:function(e){e.exports={Wrapper:"LocationPicker_Wrapper__SO8Pl",Error:"LocationPicker_Error__CQXBB",InputIcon:"LocationPicker_InputIcon__oWgvT",AutoCompleteWrapper:"LocationPicker_AutoCompleteWrapper__tCURw",Suggestions:"LocationPicker_Suggestions__YOLBS",Active:"LocationPicker_Active__kjy94",SuggestionItem:"LocationPicker_SuggestionItem__zFFe3"}},16156:function(e){e.exports={gradient:"styles_gradient__SbQ5W",videoUploaderGradient:"styles_videoUploaderGradient__cLInZ"}},77773:function(e){e.exports={shadow:"AnalyticsActions_shadow__2AvnS"}},18567:function(e){e.exports={wrapper:"FormStyles_wrapper__AiTO0",formWrapper:"FormStyles_formWrapper__jtvhA",group:"FormStyles_group__MVDkN",footer:"FormStyles_footer__Fy2Qi",tooltip:"FormStyles_tooltip__v_RLb",additionalOptionsText:"FormStyles_additionalOptionsText__xTjg0",additionalOptionsDropdown:"FormStyles_additionalOptionsDropdown__HB_YJ",numberToDuplicateInput:"FormStyles_numberToDuplicateInput__tBDY_"}}}]);
2//# sourceMappingURL=5361-3cae8e7ee873a8c2.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.