← Back
Editing: blockEditor.js
(()=>{"use strict";var e,t={921:(e,t,a)=>{a.d(t,{ACTION_EVENT_LAYOUT_UPDATED:()=>h,ACTION_GET_SEAT_TYPES_BY_LAYOUT_ID:()=>c,ACTION_REMOVE_EVENT_LAYOUT:()=>C,ajaxNonce:()=>i,ajaxUrl:()=>n});const s=window?.tec?.tickets?.seating?.ajaxData,{ajaxUrl:n,ajaxNonce:i,ACTION_GET_SEAT_TYPES_BY_LAYOUT_ID:c,ACTION_INVALIDATE_MAPS_LAYOUTS_CACHE:r,ACTION_INVALIDATE_LAYOUTS_CACHE:o,ACTION_DELETE_MAP:l,ACTION_DELETE_LAYOUT:d,ACTION_ADD_NEW_LAYOUT:p,ACTION_DUPLICATE_LAYOUT:T,ACTION_POST_RESERVATIONS:u,ACTION_CLEAR_RESERVATIONS:y,ACTION_FETCH_ATTENDEES:_,ACTION_DELETE_RESERVATIONS:g,ACTION_SEAT_TYPES_UPDATED:E,ACTION_SEAT_TYPE_DELETED:k,ACTION_RESERVATIONS_UPDATED_FROM_SEAT_TYPES:I,ACTION_RESERVATION_CREATED:m,ACTION_RESERVATION_UPDATED:S,ACTION_EVENT_LAYOUT_UPDATED:h,ACTION_REMOVE_EVENT_LAYOUT:C}=s},1609:e=>{e.exports=window.React},3076:(e,t,a)=>{var s={};a.r(s),a.d(s,{IconButton:()=>gt,adminUrl:()=>It,blocks:()=>Kt,common:()=>kt,config:()=>Et,dateSettings:()=>ht,defaultTimes:()=>Pt,editor:()=>bt,editorConstants:()=>Ct,editorDefaults:()=>xt,get:()=>rt,google:()=>ot,iacVars:()=>Rt,list:()=>ft,mapsAPI:()=>At,post:()=>Ut,postObjects:()=>$t,priceSettings:()=>vt,pro:()=>Ot,rest:()=>mt,restNonce:()=>St,settings:()=>Mt,tec:()=>Dt,tecDateSettings:()=>wt,tickets:()=>jt,ticketsPlus:()=>zt,timezone:()=>Lt,timezoneHtml:()=>Nt,wpApi:()=>lt,wpApiRequest:()=>dt,wpComponents:()=>pt,wpData:()=>Tt,wpDataSelectCoreEditor:()=>_t,wpEditor:()=>ut,wpHooks:()=>yt});var n={};a.r(n),a.d(n,{W:()=>Jt});var i={};a.r(i),a.d(i,{G8:()=>Ua,jH:()=>$a,Eg:()=>Fa,U0:()=>ja,Bb:()=>Na,SG:()=>Ra,k0:()=>La,QA:()=>Pa,T8:()=>Ka,Mp:()=>za,Jz:()=>xa});var c={};a.r(c),a.d(c,{_getTotalAvailable:()=>Ii,_getTotalCapacity:()=>gi,_getTotalSold:()=>ki,_getTotalTempCapacity:()=>Ei,allTicketsFuture:()=>Nn,allTicketsPast:()=>wn,canCreateTickets:()=>xi,currentPostIsEvent:()=>zi,getBlock:()=>Ja,getCurrentPostTypeLabel:()=>ji,getDefaultTicketProvider:()=>Ni,getIndependentAndSharedTicketsAvailable:()=>vi,getIndependentAndSharedTicketsCapacity:()=>bi,getIndependentAndSharedTicketsSold:()=>Ai,getIndependentAndSharedTicketsTempCapacity:()=>Mi,getIndependentTickets:()=>ks,getIndependentTicketsAvailable:()=>Ci,getIndependentTicketsCapacity:()=>mi,getIndependentTicketsSold:()=>hi,getIndependentTicketsTempCapacity:()=>Si,getNumericPrice:()=>Ri,getSalePrice:()=>gn,getSalePriceChecked:()=>yn,getSharedTickets:()=>Is,getSharedTicketsAvailable:()=>Di,getSharedTicketsCount:()=>ms,getSharedTicketsSold:()=>fi,getState:()=>Xa,getTempSalePrice:()=>ai,getTempSalePriceChecked:()=>ti,getTicket:()=>Ms,getTicketAttendeeInfoFields:()=>Pn,getTicketAvailable:()=>vs,getTicketCapacity:()=>Tn,getTicketCapacityInt:()=>un,getTicketCapacityType:()=>pn,getTicketClientId:()=>bs,getTicketCurrencyDecimalPoint:()=>Ls,getTicketCurrencyNumberOfDecimals:()=>Os,getTicketCurrencyPosition:()=>Ps,getTicketCurrencySymbol:()=>Ns,getTicketCurrencyThousandsSep:()=>xs,getTicketDescription:()=>Vs,getTicketDetails:()=>Hs,getTicketEndDate:()=>tn,getTicketEndDateInput:()=>an,getTicketEndDateMoment:()=>sn,getTicketEndTime:()=>rn,getTicketEndTimeInput:()=>dn,getTicketEndTimeNoSeconds:()=>on,getTicketHasAttendeeInfoFields:()=>zs,getTicketHasBeenCreated:()=>Us,getTicketHasChanges:()=>Ks,getTicketHasDurationError:()=>Fs,getTicketIACSetting:()=>Xs,getTicketId:()=>ws,getTicketIsLoading:()=>Rs,getTicketIsModalOpen:()=>$s,getTicketIsSelected:()=>Bs,getTicketOnSale:()=>Ws,getTicketPrice:()=>Gs,getTicketProvider:()=>js,getTicketProviders:()=>wi,getTicketSaleEndDate:()=>mn,getTicketSaleEndDateInput:()=>Sn,getTicketSaleEndDateMoment:()=>hn,getTicketSaleStartDate:()=>En,getTicketSaleStartDateInput:()=>kn,getTicketSaleStartDateMoment:()=>In,getTicketSku:()=>Zs,getTicketSold:()=>As,getTicketStartDate:()=>Js,getTicketStartDateInput:()=>Qs,getTicketStartDateMoment:()=>en,getTicketStartTime:()=>nn,getTicketStartTimeInput:()=>ln,getTicketStartTimeNoSeconds:()=>cn,getTicketTempCapacity:()=>Jn,getTicketTempCapacityInt:()=>Qn,getTicketTempCapacityType:()=>Xn,getTicketTempCapacityTypeOption:()=>ei,getTicketTempDescription:()=>xn,getTicketTempDetails:()=>Ln,getTicketTempEndDate:()=>Fn,getTicketTempEndDateInput:()=>Bn,getTicketTempEndDateMoment:()=>Yn,getTicketTempEndTime:()=>Vn,getTicketTempEndTimeInput:()=>Zn,getTicketTempEndTimeNoSeconds:()=>Gn,getTicketTempIACSetting:()=>Rn,getTicketTempPrice:()=>jn,getTicketTempSaleEndDate:()=>ci,getTicketTempSaleEndDateInput:()=>ri,getTicketTempSaleEndDateMoment:()=>oi,getTicketTempSaleStartDate:()=>si,getTicketTempSaleStartDateInput:()=>ni,getTicketTempSaleStartDateMoment:()=>ii,getTicketTempSku:()=>zn,getTicketTempStartDate:()=>$n,getTicketTempStartDateInput:()=>Un,getTicketTempStartDateMoment:()=>Kn,getTicketTempStartTime:()=>Hn,getTicketTempStartTimeInput:()=>Wn,getTicketTempStartTimeNoSeconds:()=>qn,getTicketTempTitle:()=>On,getTicketTitle:()=>qs,getTickets:()=>ps,getTicketsAllClientIds:()=>Ts,getTicketsArray:()=>ys,getTicketsByClientId:()=>us,getTicketsCount:()=>_s,getTicketsHeaderImage:()=>rs,getTicketsHeaderImageAlt:()=>ds,getTicketsHeaderImageId:()=>os,getTicketsHeaderImageSrc:()=>ls,getTicketsIdsInBlocks:()=>Cs,getTicketsIsSelected:()=>Qa,getTicketsIsSettingsLoading:()=>ts,getTicketsIsSettingsOpen:()=>es,getTicketsProvider:()=>as,getTicketsSharedCapacity:()=>ss,getTicketsSharedCapacityInt:()=>ns,getTicketsTempSharedCapacity:()=>is,getTicketsTempSharedCapacityInt:()=>cs,getUneditableTickets:()=>fs,getUneditableTicketsAreLoading:()=>Ds,getUnlimitedTickets:()=>Ss,hasATicketSelected:()=>hs,hasCreatedTickets:()=>Es,hasMultipleTicketProviders:()=>Li,hasTicketOnSale:()=>vn,hasTicketProviders:()=>Oi,hasTickets:()=>gs,hasValidTicketProvider:()=>Pi,isIndependentTicket:()=>Dn,isSharedTicket:()=>fn,isTempCapacityValid:()=>Ti,isTempSharedCapacityValid:()=>ui,isTempTitleValid:()=>pi,isTicketDisabled:()=>Ys,isTicketFuture:()=>Mn,isTicketOnSale:()=>An,isTicketPast:()=>bn,isTicketSalePriceValid:()=>di,isTicketValid:()=>_i,isUnlimitedTicket:()=>Cn,isZeroPriceValid:()=>yi,showSalePrice:()=>li});var r={};a.r(r),a.d(r,{closeSettings:()=>xc,createNewTicket:()=>go,deleteTicket:()=>ko,deleteTicketsHeaderImage:()=>Fc,fetchTicket:()=>_o,fetchTicketsHeaderImage:()=>Uc,handleTicketEndDate:()=>lo,handleTicketEndTime:()=>yo,handleTicketStartDate:()=>oo,handleTicketStartTime:()=>uo,openSettings:()=>Oc,processTicketSaleEndDate:()=>To,processTicketSaleStartDate:()=>po,registerTicketBlock:()=>Kr,removeTicketBlock:()=>Fr,removeTicketBlocks:()=>Br,resetTicketsBlock:()=>vc,setSalePrice:()=>Tr,setSalePriceChecked:()=>pr,setTempSalePrice:()=>mr,setTempSalePriceChecked:()=>Ir,setTicketAttendeeInfoFields:()=>Xr,setTicketAvailable:()=>Hr,setTicketCapacity:()=>cr,setTicketCapacityType:()=>ir,setTicketCurrencyPosition:()=>Gr,setTicketCurrencySymbol:()=>Vr,setTicketDescription:()=>Yc,setTicketDetails:()=>co,setTicketEndDate:()=>Jc,setTicketEndDateInput:()=>Qc,setTicketEndDateMoment:()=>er,setTicketEndTime:()=>ar,setTicketEndTimeInput:()=>nr,setTicketHasAttendeeInfoFields:()=>Zr,setTicketHasBeenCreated:()=>eo,setTicketHasChanges:()=>to,setTicketHasDurationError:()=>ao,setTicketIACSetting:()=>Gc,setTicketId:()=>qr,setTicketInitialState:()=>Io,setTicketIsLoading:()=>Jr,setTicketIsModalOpen:()=>Qr,setTicketIsSelected:()=>so,setTicketOnSale:()=>qc,setTicketPrice:()=>Hc,setTicketProvider:()=>Wr,setTicketSaleEndDate:()=>gr,setTicketSaleEndDateInput:()=>Er,setTicketSaleEndDateMoment:()=>kr,setTicketSaleStartDate:()=>ur,setTicketSaleStartDateInput:()=>yr,setTicketSaleStartDateMoment:()=>_r,setTicketSku:()=>Vc,setTicketSold:()=>Yr,setTicketStartDate:()=>Wc,setTicketStartDateInput:()=>Zc,setTicketStartDateMoment:()=>Xc,setTicketStartTime:()=>tr,setTicketStartTimeInput:()=>sr,setTicketTempCapacity:()=>Ur,setTicketTempCapacityType:()=>$r,setTicketTempDescription:()=>lr,setTicketTempDetails:()=>ro,setTicketTempEndDate:()=>Pr,setTicketTempEndDateInput:()=>Lr,setTicketTempEndDateMoment:()=>Or,setTicketTempEndTime:()=>jr,setTicketTempEndTimeInput:()=>Rr,setTicketTempIACSetting:()=>Ar,setTicketTempPrice:()=>dr,setTicketTempSaleEndDate:()=>fr,setTicketTempSaleEndDateInput:()=>Dr,setTicketTempSaleEndDateMoment:()=>br,setTicketTempSaleStartDate:()=>Sr,setTicketTempSaleStartDateInput:()=>hr,setTicketTempSaleStartDateMoment:()=>Cr,setTicketTempSku:()=>Mr,setTicketTempStartDate:()=>vr,setTicketTempStartDateInput:()=>wr,setTicketTempStartDateMoment:()=>Nr,setTicketTempStartTime:()=>xr,setTicketTempStartTimeInput:()=>zr,setTicketTempTitle:()=>or,setTicketTitle:()=>Bc,setTicketType:()=>rr,setTicketsHeaderImage:()=>wc,setTicketsInitialState:()=>Ac,setTicketsIsSelected:()=>Nc,setTicketsIsSettingsLoading:()=>Lc,setTicketsIsSettingsOpen:()=>Pc,setTicketsProvider:()=>jc,setTicketsSharedCapacity:()=>zc,setTicketsTempSharedCapacity:()=>Rc,setUneditableTickets:()=>no,setUneditableTicketsLoading:()=>io,updateTicket:()=>Eo,updateTicketsHeaderImage:()=>Kc,updateUneditableTickets:()=>$c});const o=window.wp.data;var l=a(4644),d=a(179),p=a.n(d);const T="@@MT/TICKETS",u=`${T}/SET_TICKETS_INITIAL_STATE`,y=`${T}/RESET_TICKETS_BLOCK`,_=`${T}/SET_TICKETS_HEADER_IMAGE`,g=`${T}/SET_TICKETS_IS_SELECTED`,E=`${T}/SET_TICKETS_IS_SETTINGS_OPEN`,k=`${T}/SET_TICKETS_IS_SETTINGS_LOADING`,I=`${T}/SET_TICKETS_PROVIDER`,m=`${T}/SET_TICKETS_SHARED_CAPACITY`,S=`${T}/SET_TICKETS_TEMP_SHARED_CAPACITY`,h=`${T}/FETCH_TICKETS_HEADER_IMAGE`,C=`${T}/UPDATE_TICKETS_HEADER_IMAGE`,f=`${T}/DELETE_TICKETS_HEADER_IMAGE`,D=`${T}/REGISTER_TICKET_BLOCK`,b=`${T}/REMOVE_TICKET_BLOCK`,M=`${T}/REMOVE_TICKET_BLOCKS`,A=`${T}/SET_TICKET_TITLE`,v=`${T}/SET_TICKET_DESCRIPTION`,w=`${T}/SET_TICKET_PRICE`,N=`${T}/SET_TICKET_ON_SALE`,P=`${T}/SET_TICKET_SKU`,L=`${T}/SET_TICKET_IAC_SETTING`,O=`${T}/SET_TICKET_START_DATE`,x=`${T}/SET_TICKET_START_DATE_INPUT`,j=`${T}/SET_TICKET_START_DATE_MOMENT`,z=`${T}/SET_TICKET_END_DATE`,R=`${T}/SET_TICKET_END_DATE_INPUT`,$=`${T}/SET_TICKET_END_DATE_MOMENT`,U=`${T}/SET_TICKET_START_TIME`,K=`${T}/SET_TICKET_END_TIME`,F=`${T}/SET_TICKET_START_TIME_INPUT`,B=`${T}/SET_TICKET_END_TIME_INPUT`,Y=`${T}/SET_TICKET_CAPACITY_TYPE`,H=`${T}/SET_TICKET_CAPACITY`,q=`${T}/SET_TICKET_SALE_PRICE_CHECK`,V=`${T}/SET_TICKET_SALE_PRICE`,G=`${T}/SET_TICKET_SALE_START_DATE`,W=`${T}/SET_TICKET_SALE_START_DATE_INPUT`,Z=`${T}/SET_TICKET_SALE_START_DATE_MOMENT`,X=`${T}/SET_TICKET_SALE_END_DATE`,J=`${T}/SET_TICKET_SALE_END_DATE_INPUT`,Q=`${T}/SET_TICKET_SALE_END_DATE_MOMENT`,ee=`${T}/SET_TICKET_TEMP_TITLE`,te=`${T}/SET_TICKET_TEMP_DESCRIPTION`,ae=`${T}/SET_TICKET_TEMP_PRICE`,se=`${T}/SET_TICKET_TEMP_SKU`,ne=`${T}/SET_TICKET_TEMP_IAC_SETTING`,ie=`${T}/SET_TICKET_TEMP_START_DATE`,ce=`${T}/SET_TICKET_TEMP_START_DATE_INPUT`,re=`${T}/SET_TICKET_TEMP_START_DATE_MOMENT`,oe=`${T}/SET_TICKET_TEMP_END_DATE`,le=`${T}/SET_TICKET_TEMP_END_DATE_INPUT`,de=`${T}/SET_TICKET_TEMP_END_DATE_MOMENT`,pe=`${T}/SET_TICKET_TEMP_START_TIME`,Te=`${T}/SET_TICKET_TEMP_END_TIME`,ue=`${T}/SET_TICKET_TEMP_START_TIME_INPUT`,ye=`${T}/SET_TICKET_TEMP_END_TIME_INPUT`,_e=`${T}/SET_TICKET_TEMP_CAPACITY_TYPE`,ge=`${T}/SET_TICKET_TEMP_CAPACITY`,Ee=`${T}/SET_TICKET_TEMP_SALE_PRICE_CHECK`,ke=`${T}/SET_TICKET_TEMP_SALE_PRICE`,Ie=`${T}/SET_TICKET_TEMP_SALE_START_DATE`,me=`${T}/SET_TICKET_TEMP_SALE_START_DATE_INPUT`,Se=`${T}/SET_TICKET_TEMP_SALE_START_DATE_MOMENT`,he=`${T}/SET_TICKET_TEMP_SALE_END_DATE`,Ce=`${T}/SET_TICKET_TEMP_SALE_END_DATE_INPUT`,fe=`${T}/SET_TICKET_TEMP_SALE_END_DATE_MOMENT`,De=`${T}/SET_TICKET_SOLD`,be=`${T}/SET_TICKET_AVAILABLE`,Me=`${T}/SET_TICKET_ID`,Ae=`${T}/SET_TICKET_CURRENCY_SYMBOL`,ve=`${T}/SET_TICKET_CURRENCY_POSITION`,we=`${T}/SET_TICKET_PROVIDER`,Ne=`${T}/SET_TICKET_HAS_ATTENDEE_INFO_FIELDS`,Pe=`${T}/SET_TICKET_ATTENDEE_INFO_FIELDS`,Le=`${T}/SET_TICKET_IS_LOADING`,Oe=`${T}/SET_TICKET_IS_MODAL_OPEN`,xe=`${T}/SET_TICKET_HAS_BEEN_CREATED`,je=`${T}/SET_TICKET_HAS_CHANGES`,ze=`${T}/SET_TICKET_HAS_DURATION_ERROR`,Re=`${T}/SET_TICKET_IS_SELECTED`,$e=`${T}/SET_TICKET_TYPE`,Ue=`${T}/SET_TICKET_TYPE_DESCRIPTION`,Ke=`${T}/SET_TICKET_TYPE_ICON_URL`,Fe=`${T}/SET_TICKET_TYPE_NAME`,Be=`${T}/SET_UNEDITABLE_TICKETS`,Ye=`${T}/SET_UNEDITABLE_TICKETS_LOADING`,He=`${T}/UPDATE_UNEDITABLE_TICKETS`,qe=`${T}/SET_TICKET_DETAILS`,Ve=`${T}/SET_TICKET_TEMP_DETAILS`,Ge=`${T}/HANDLE_TICKET_START_DATE`,We=`${T}/HANDLE_TICKET_END_DATE`,Ze=`${T}/HANDLE_TICKET_START_TIME`,Xe=`${T}/HANDLE_TICKET_END_TIME`,Je=`${T}/HANDLE_TICKET_SALE_START_DATE`,Qe=`${T}/HANDLE_TICKET_SALE_END_DATE`,et=`${T}/FETCH_TICKET`,tt=`${T}/CREATE_NEW_TICKET`,at=`${T}/UPDATE_TICKET`,st=`${T}/DELETE_TICKET`,nt=`${T}/SET_TICKET_INITIAL_STATE`,it=window.lodash,ct=window.wp.i18n,rt=(e,t)=>window[e]||t,ot=()=>rt("google"),lt=wp.api,dt=wp.apiRequest,pt=wp.components,Tt=wp.data,ut=wp.blockEditor||wp.editor,yt=wp.hooks,_t=()=>Tt.select("core/block-editor")||Tt.select("core/editor"),gt=pt.Button||pt.IconButton,Et=()=>rt("tribe_editor_config",{}),kt=()=>Et().common||{},It=()=>kt().adminUrl||"",mt=()=>kt().rest||{},St=()=>mt().nonce||{},ht=()=>kt().dateSettings||{},Ct=()=>kt().constants||{},ft=()=>({countries:kt().countries||{},us_states:kt().usStates||{}}),Dt=()=>Et().events||{},bt=()=>Dt().editor||{},Mt=()=>Dt().settings||{},At=()=>Dt().googleMap||{},vt=()=>Dt().priceSettings||{},wt=()=>Dt().dateSettings||{},Nt=()=>Dt().timezoneHTML||"",Pt=()=>Dt().defaultTimes||{},Lt=()=>Dt().timeZone||{},Ot=()=>Et().eventsPRO||{},xt=()=>Ot().defaults||{},jt=()=>Et().tickets||{},zt=()=>Et().ticketsPlus||{},Rt=()=>zt().iacVars||{},$t=()=>Et().post_objects||{},Ut=()=>Et().post||{},Kt=()=>Et().blocks||{},Ft={time:"g:i a",time24Hr:"H:i",date:"F j, Y",datetime:"F j, Y g:i a",dateNoYear:"F j",...ht()&&ht().formats?ht().formats:{}},Bt=(ht()&&ht().formats&&ht().formats,{date:"Y-m-d",datetime:"Y-m-d H:i:s",time:"H:i:s"}),Yt=(new Date,window.moment);var Ht=a.n(Yt);a(5345);const qt=e=>((e="",t={})=>{const a=Object.keys(t).map(it.escapeRegExp);return e.split(RegExp(`(${a.join("|")})`)).map((e=>(0,it.isUndefined)(t[e])?e:t[e])).join("")})(e,{d:"DD",D:"ddd",j:"D",l:"dddd",N:"E",S:"o",w:"e",z:"DDD",W:"W",F:"MMMM",m:"MM",M:"MMM",n:"M",t:"",L:"",o:"YYYY",Y:"YYYY",y:"YY",a:"a",A:"A",B:"",g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"SSS",e:"zz",I:"",O:"",P:"",T:"",Z:"",c:"",r:"",U:"X"}),Vt=(e,t=Ft.date)=>e.format(qt(t)),Gt=(e,t=Ft.time)=>e.format(qt(t)),Wt=(e,t=Bt.date)=>e.format(qt(t)),Zt=(e,t=Bt.time)=>e.format(qt(t));var Xt=a(7691);a.n(Xt)()(.25,.1,.25,1);a(6066);const Jt=async e=>{const{url:t="",nonce:a={},namespaces:s={}}=mt(),n={path:"",headers:{},initParams:{},namespace:s.core||"wp/v2",...e},i=`${t}${n.namespace}/${n.path}`,c={"X-WP-Nonce":a.wp_rest||"",...n.headers};try{const e=await fetch(i,{...n.initParams,credentials:"include",headers:c});let t={};return e.ok&&(t=await e.json()),{response:e,data:t}}catch(e){throw e}};var Qt=a(2224);const ea="@@MT/COMMON",ta=`${ea}/ADD_FORM`,aa=`${ea}/SET_FORM_FIELDS`,sa=`${ea}/CREATE_FORM_DRAFT`,na=`${ea}/EDIT_FORM_ENTRY`,ia=`${ea}/SUBMIT_FORM`,ca=`${ea}/CLEAR_FORM`,ra=`${ea}/SET_SAVING_FORM`,oa=`${ea}/ADD_VOLATILE_ID`,la=`${ea}/REMOVE_VOLATILE_ID`,da={edit:!1,create:!1,submit:!1,saving:!1,fields:{},type:"tribe_events"},pa=(e=da,t)=>{switch(t.type){case ta:return{...e,type:t.payload.type};case ca:return{...e,...da,type:e.type};case sa:return{...e,submit:!1,edit:!1,create:!0,fields:t.payload.fields};case ra:return{...e,saving:t.payload.saving};case na:return{...e,create:!1,submit:!1,edit:!0,fields:t.payload.fields};case ia:return{...e,submit:!0};default:return e}},Ta=(0,Qt.HY)({byId:(e={},t)=>{switch(t.type){case ta:case ca:case aa:case sa:case na:case ia:case ra:return{...e,[t.payload.id]:pa(e[t.payload.id],t)};default:return e}},volatile:(e=[],t)=>{switch(t.type){case oa:return[...e,t.payload.id];case la:return e.filter((e=>e!==t.payload.id));default:return e}}}),ua=`${ea}/WP_REQUEST`;a(4834);const ya=()=>e=>async t=>{if(t.type!==ua)return e(t);const{meta:a={}}=t,{path:s="",params:n={}}=a;e(t);const{url:i="",nonce:c={}}=mt(),r=c.wp_rest||"",o=`${i}${(mt.namespaces||{}).core||"wp/v2"}`,l={start:it.noop,success:it.noop,error:it.noop,none:it.noop,...(0,it.get)(a,"actions",{})};if(""===s)return void l.none(s);const d=`${o}/${s}`;l.start(d,n);const p={Accept:"application/json","Content-Type":"application/json",...(0,it.get)(n,"headers",{}),"X-WP-Nonce":r};try{const e=await fetch(d,{...n,credentials:"include",headers:p}),{status:t}=e;if(!(0,it.inRange)(t,200,300))throw e;const a=await e.json();return l.success({body:a,headers:e.headers}),[e,a]}catch(e){return l.error(e),e}};var _a=a(2618);const ga=(e,t)=>e.forms.byId[t.name],Ea=((0,_a.Mz)([ga],(e=>e?e.type:da.type)),(0,_a.Mz)([ga],(e=>e?e.edit:da.edit)),(0,_a.Mz)([ga],(e=>e?e.create:da.create)),(0,_a.Mz)([ga],(e=>e?e.submit:da.submit)),(0,_a.Mz)([ga],(e=>e?e.fields:da.fields)),(0,_a.Mz)([ga],(e=>e?e.saving:da.saving)),Ta),ka=`${ea}/ADD_PLUGIN`,Ia=`${ea}/REMOVE_PLUGIN`,ma=e=>e.plugins;(0,it.curry)(((e,t)=>(0,it.includes)(ma(e),t)));var Sa=a(3842),ha=a.n(Sa);const Ca=ha().shape({label:ha().string.isRequired,value:ha().any.isRequired}),fa=(ha().arrayOf(Ca),(e=[],t)=>{switch(t.type){case ka:return(0,it.uniq)([...e,t.payload.name]);case Ia:return[...e].filter((e=>e!==t.payload.name));default:return e}});var Da=a(2983);const ba=(0,Da._)({plugins:fa,forms:Ea}),Ma=e=>{const t=(t,a,s,n)=>{const i=a[s];return null==i?t?null===i?new Error(`The prop \`${s}\` is marked as required in \`${n}\`, but its value is \`null\`.`):new Error(`The prop \`${s}\` is marked as required in \`${n}\`, but its value is \`undefined\`.`):null:e(a,s,n)},a=t.bind(null,!1);return a.isRequired=t.bind(null,!0),a},Aa=/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/,va={timeFormat:Ma(((e,t,a)=>{const s=e[t];return"string"!=typeof s?new Error(`Invalid prop \`${t}\` of type \`${typeof s}\` supplied to \`${a}\`, expected \`string\`.`):Aa.test(s)?null:new Error(`Invalid prop \`${t}\` format supplied to \`${a}\`, expected \`hh:mm\`.`)})),nullType:Ma(((e,t,a)=>{if(null!==e[t])return new Error(`Invalid prop: \`${t}\` supplied to \`${a}\`, expect null.`)}))};var wa=a(7132);const Na="Tribe__Tickets__RSVP",Pa="TEC\\Tickets\\Commerce\\Module",La="Tribe__Tickets__Commerce__PayPal__Main",Oa="Tribe__Tickets_Plus__Commerce__EDD__Main",xa="Tribe__Tickets_Plus__Commerce__WooCommerce__Main",ja={[La]:"tribe-commerce",[Oa]:"edd",[xa]:"woo"},za="unlimited",Ra="shared",$a="independent",Ua="capped",Ka={[za]:za,[Ra]:Ua,[$a]:"own"},Fa=(window,window,window?.tribe_editor_config?.tickets?.commerce?.isFreeTicketAllowed),Ba=[{label:(0,ct.__)("Share capacity with other tickets","event-tickets"),value:Ka[Ra]},{label:(0,ct.__)("Set capacity for this ticket only","event-tickets"),value:Ka[$a]},{label:(0,ct.__)("Unlimited","event-tickets"),value:Ka[za]}],{Mp:Ya,jH:Ha,SG:qa,T8:Va,Eg:Ga}=i,{tickets:Wa,post:Za}=s,Xa=e=>e,Ja=e=>e.tickets.blocks.ticket,Qa=(0,wa.Mz)([Ja],(e=>e.isSelected)),es=(0,wa.Mz)([Ja],(e=>e.isSettingsOpen)),ts=(0,wa.Mz)([Ja],(e=>e.isSettingsLoading)),as=(0,wa.Mz)([Ja],(e=>e.provider)),ss=(0,wa.Mz)([Ja],(e=>e.sharedCapacity)),ns=(0,wa.Mz)([ss],(e=>parseInt(e,10)||0)),is=(0,wa.Mz)([Ja],(e=>e.tempSharedCapacity)),cs=(0,wa.Mz)([is],(e=>parseInt(e,10)||0)),rs=(0,wa.Mz)([Ja],(e=>e.headerImage)),os=(0,wa.Mz)([rs],(e=>e.id)),ls=(0,wa.Mz)([rs],(e=>e.src)),ds=(0,wa.Mz)([rs],(e=>e.alt)),ps=(0,wa.Mz)([Ja],(e=>e.tickets)),Ts=(0,wa.Mz)([ps],(e=>[...new Set(e.allClientIds)])),us=(0,wa.Mz)([ps],(e=>e.byClientId)),ys=(0,wa.Mz)([Ts,us],((e,t)=>e.map((e=>t[e])))),_s=(0,wa.Mz)([Ts],(e=>e.length)),gs=(0,wa.Mz)([_s],(e=>e>0)),Es=(0,wa.Mz)([ys],(e=>e.reduce(((e,t)=>e||t.hasBeenCreated),!1))),ks=(0,wa.Mz)([ys],(e=>e.filter((e=>e.details.capacityType===Va[Ha])))),Is=(0,wa.Mz)([ys],(e=>e.filter((e=>e.details.capacityType===Va[qa])))),ms=(0,wa.Mz)([Is],(e=>e.length)),Ss=(0,wa.Mz)([ys],(e=>e.filter((e=>e.details.capacityType===Va[Ya])))),hs=(0,wa.Mz)([ys],(e=>e.reduce(((e,t)=>e||t.isSelected),!1))),Cs=(0,wa.Mz)([ys],(e=>e.reduce(((e,t)=>(0!==t.ticketId&&e.push(t.ticketId),e)),[]))),fs=(0,wa.Mz)([Ja],(function(e){return e.uneditableTickets||[]})),Ds=(0,wa.Mz)([Ja],(function(e){return e.uneditableTicketsLoading||!1})),bs=(e,t)=>t.clientId,Ms=(0,wa.Mz)([us,bs],((e,t)=>e[t]||{})),As=(0,wa.Mz)([Ms],(e=>e.sold)),vs=(0,wa.Mz)([Ms],(e=>e.available)),ws=(0,wa.Mz)([Ms],(e=>e.ticketId)),Ns=(0,wa.Mz)([Ms],(e=>e.currencySymbol)),Ps=(0,wa.Mz)([Ms],(e=>e.currencyPosition)),Ls=(0,wa.Mz)([Ms],(e=>e.currencyDecimalPoint)),Os=(0,wa.Mz)([Ms],(e=>e.currencyNumberOfDecimals)),xs=(0,wa.Mz)([Ms],(e=>e.currencyThousandsSep)),js=(0,wa.Mz)([Ms],(e=>e.provider)),zs=(0,wa.Mz)([Ms],(e=>e.hasAttendeeInfoFields)),Rs=(0,wa.Mz)([Ms],(e=>e.isLoading)),$s=(0,wa.Mz)([Ms],(e=>e.isModalOpen)),Us=(0,wa.Mz)([Ms],(e=>e.hasBeenCreated)),Ks=(0,wa.Mz)([Ms],(e=>e.hasChanges)),Fs=(0,wa.Mz)([Ms],(e=>e.hasDurationError)),Bs=(0,wa.Mz)([Ms],(e=>e.isSelected)),Ys=(0,wa.Mz)([hs,Bs,Rs,es],((e,t,a,s)=>e&&!t||a||s)),Hs=(0,wa.Mz)([Ms],(e=>e.details||{})),qs=(0,wa.Mz)([Hs],(e=>e.title)),Vs=(0,wa.Mz)([Hs],(e=>e.description)),Gs=(0,wa.Mz)([Hs],(e=>e.price)),Ws=(0,wa.Mz)([Hs],(e=>e.on_sale)),Zs=(0,wa.Mz)([Hs],(e=>e.sku)),Xs=(0,wa.Mz)([Hs],(e=>e.iac)),Js=(0,wa.Mz)([Hs],(e=>e.startDate)),Qs=(0,wa.Mz)([Hs],(e=>e.startDateInput)),en=(0,wa.Mz)([Hs],(e=>e.startDateMoment)),tn=(0,wa.Mz)([Hs],(e=>e.endDate)),an=(0,wa.Mz)([Hs],(e=>e.endDateInput)),sn=(0,wa.Mz)([Hs],(e=>e.endDateMoment)),nn=(0,wa.Mz)([Hs],(e=>e.startTime||"")),cn=(0,wa.Mz)([nn],(e=>e.slice(0,-3))),rn=(0,wa.Mz)([Hs],(e=>e.endTime||"")),on=(0,wa.Mz)([rn],(e=>e.slice(0,-3))),ln=(0,wa.Mz)([Hs],(e=>e.startTimeInput)),dn=(0,wa.Mz)([Hs],(e=>e.endTimeInput)),pn=(0,wa.Mz)([Hs],(e=>e.capacityType)),Tn=(0,wa.Mz)([Hs],(e=>e.capacity)),un=(0,wa.Mz)([Tn],(e=>parseInt(e,10)||0)),yn=(0,wa.Mz)([Hs],(e=>e.salePriceChecked)),gn=(0,wa.Mz)([Hs],(e=>e.salePrice)),En=(0,wa.Mz)([Hs],(e=>e.saleStartDate)),kn=(0,wa.Mz)([Hs],(e=>e.saleStartDateInput)),In=(0,wa.Mz)([Hs],(e=>e.saleStartDateMoment)),mn=(0,wa.Mz)([Hs],(e=>e.saleEndDate)),Sn=(0,wa.Mz)([Hs],(e=>e.saleEndDateInput)),hn=(0,wa.Mz)([Hs],(e=>e.saleEndDateMoment)),Cn=(0,wa.Mz)([Hs],(e=>e.capacityType===Va[Ya])),fn=(0,wa.Mz)([Hs],(e=>e.capacityType===Va[qa])),Dn=(0,wa.Mz)([Hs],(e=>e.capacityType===Va[Ha])),bn=(0,wa.Mz)([sn],(e=>Ht()().isAfter(e))),Mn=(0,wa.Mz)([en],(e=>Ht()().isBefore(e))),An=(0,wa.Mz)([Us,bn,Mn],((e,t,a)=>e&&!t&&!a)),vn=(0,wa.Mz)([Ts,Xa],((e,t)=>e.reduce(((e,a)=>e||An(t,{clientId:a})),!1))),wn=(0,wa.Mz)([Ts,Xa],((e,t)=>e.reduce(((e,a)=>{const s={clientId:a};return Us(t,s)?e&&bn(t,s):e}),!0))),Nn=(0,wa.Mz)([Ts,Xa],((e,t)=>e.reduce(((e,a)=>{const s={clientId:a};return Us(t,s)?e&&Mn(t,s):e}),!0))),Pn=(0,wa.Mz)([Hs],(e=>e.attendeeInfoFields||[])),Ln=(0,wa.Mz)([Ms],(e=>e.tempDetails||{})),On=(0,wa.Mz)([Ln],(e=>e.title)),xn=(0,wa.Mz)([Ln],(e=>e.description)),jn=(0,wa.Mz)([Ln],(e=>e.price)),zn=(0,wa.Mz)([Ln],(e=>e.sku)),Rn=(0,wa.Mz)([Ln],(e=>e.iac)),$n=(0,wa.Mz)([Ln],(e=>e.startDate)),Un=(0,wa.Mz)([Ln],(e=>e.startDateInput)),Kn=(0,wa.Mz)([Ln],(e=>e.startDateMoment)),Fn=(0,wa.Mz)([Ln],(e=>e.endDate)),Bn=(0,wa.Mz)([Ln],(e=>e.endDateInput)),Yn=(0,wa.Mz)([Ln],(e=>e.endDateMoment)),Hn=(0,wa.Mz)([Ln],(e=>e.startTime||"")),qn=(0,wa.Mz)([Hn],(e=>e.slice(0,-3))),Vn=(0,wa.Mz)([Ln],(e=>e.endTime||"")),Gn=(0,wa.Mz)([Vn],(e=>e.slice(0,-3))),Wn=(0,wa.Mz)([Ln],(e=>e.startTimeInput)),Zn=(0,wa.Mz)([Ln],(e=>e.endTimeInput)),Xn=(0,wa.Mz)([Ln],(e=>e.capacityType)),Jn=(0,wa.Mz)([Ln],(e=>e.capacity)),Qn=(0,wa.Mz)([Jn],(e=>parseInt(e,10)||0)),ei=(0,wa.Mz)([Xn],(e=>(0,it.find)(Ba,{value:e})||{})),ti=(0,wa.Mz)([Ln],(e=>e.salePriceChecked)),ai=(0,wa.Mz)([Ln],(e=>e.salePrice)),si=(0,wa.Mz)([Ln],(e=>e.saleStartDate)),ni=(0,wa.Mz)([Ln],(e=>e.saleStartDateInput)),ii=(0,wa.Mz)([Ln],(e=>e.saleStartDateMoment)),ci=(0,wa.Mz)([Ln],(e=>e.saleEndDate)),ri=(0,wa.Mz)([Ln],(e=>e.saleEndDateInput)),oi=(0,wa.Mz)([Ln],(e=>e.saleEndDateMoment)),li=(0,wa.Mz)([as],(e=>e===Pa||e===xa)),di=(0,wa.Mz)([ai,jn,Ls,Os,xs],((e,t,a,s,n)=>""===e||""===t||(!(a&&s&&n)||Ri(e,a,s,n)<Ri(t,a,s,n)))),pi=(0,wa.Mz)([On],(e=>""!==(0,it.trim)(e))),Ti=(0,wa.Mz)([Jn],(e=>""!==(0,it.trim)(e)&&!isNaN(e)&&e>0)),ui=(0,wa.Mz)([is],(e=>""!==(0,it.trim)(e)&&!isNaN(e)&&e>0)),yi=(0,wa.Mz)([jn,as],((e,t)=>0<parseInt(e,10)||La!==t&&(Pa!==t||Ga))),_i=(0,wa.Mz)([Xn,pi,Ti,ui,yi],((e,t,a,s,n)=>e===Va[Ya]?t&&n:e===Va[qa]?t&&s&&n:t&&a&&n)),gi=e=>e.reduce(((e,t)=>e+(parseInt(t.details.capacity,10)||0)),0),Ei=e=>e.reduce(((e,t)=>e+(parseInt(t.tempDetails.capacity,10)||0)),0),ki=e=>e.reduce(((e,t)=>e+(parseInt(t.sold,10)||0)),0),Ii=e=>e.reduce(((e,t)=>e+(parseInt(t.available,10)||0)),0),mi=(0,wa.Mz)(ks,gi),Si=(0,wa.Mz)(ks,Ei),hi=(0,wa.Mz)(ks,ki),Ci=(0,wa.Mz)(ks,Ii),fi=(0,wa.Mz)(Is,ki),Di=(0,wa.Mz)([ns,fi],((e,t)=>Math.max(e-t,0))),bi=(0,wa.Mz)([mi,ns],((e,t)=>e+t)),Mi=(0,wa.Mz)([Si,cs],((e,t)=>e+t)),Ai=(0,wa.Mz)([hi,fi],((e,t)=>e+t)),vi=(0,wa.Mz)([Ci,Di],((e,t)=>e+t)),wi=()=>Wa().providers||[],Ni=()=>Wa().default_provider||"",Pi=()=>{const e=Ni();return""!==e&&e!==Na},Li=(0,wa.Mz)([wi],(e=>e.length>1)),Oi=(0,wa.Mz)([wi],(e=>e.length>0)),xi=(0,wa.Mz)([Oi,Pi],((e,t)=>e&&t)),ji=(e="singular_name")=>{const t=Za();return t?.labels?.[e]||"Post"},zi=()=>{const e=Za();return"tribe_events"===e?.type},Ri=(e,t,a,s)=>{"string"!=typeof e&&(e=String(e));let n=e.replace(new RegExp("\\"+s,"g"),"");return n=n.replace(t,"."),n=parseFloat(n).toFixed(a),n=parseInt(n.replace(".","")),n},$i=window.wp.hooks,{settings:Ui,priceSettings:Ki,tickets:Fi}=s,Bi=wt().datepickerFormat,Yi=Ht()(),Hi=jt().end_sale_buffer_duration?jt().end_sale_buffer_duration:2,qi=jt().end_sale_buffer_years?jt().end_sale_buffer_years:1,Vi=Yi.clone().add(Hi,"hours").add(qi,"years"),Gi=Bi?Yi.format(qt(Bi)):Vt(Yi),Wi=Bi?Vi.format(qt(Bi)):Vt(Vi),Zi={attendeeInfoFields:[],title:"",description:"",price:"",on_sale:!1,sku:"",iac:Rt().iacDefault?Rt().iacDefault:"none",startDate:Wt(Yi),startDateInput:Gi,startDateMoment:Yi,endDate:Wt(Vi),endDateInput:Wi,endDateMoment:Vi,startTime:Zt(Yi),endTime:Zt(Vi),startTimeInput:Gt(Yi),endTimeInput:Gt(Vi),capacityType:Ka[za],capacity:"",type:"default",salePriceChecked:!1,salePrice:"",saleStartDate:"",saleStartDateInput:"",saleStartDateMoment:"",saleEndDate:"",saleEndDateInput:"",saleEndDateMoment:""},Xi=(e=Zi,t)=>{switch(t.type){case A:return{...e,title:t.payload.title};case v:return{...e,description:t.payload.description};case w:return{...e,price:t.payload.price};case N:return{...e,on_sale:t.payload.onSale};case P:return{...e,sku:t.payload.sku};case L:return{...e,iac:t.payload.iac};case O:return{...e,startDate:t.payload.startDate};case x:return{...e,startDateInput:t.payload.startDateInput};case j:return{...e,startDateMoment:t.payload.startDateMoment};case z:return{...e,endDate:t.payload.endDate};case R:return{...e,endDateInput:t.payload.endDateInput};case $:return{...e,endDateMoment:t.payload.endDateMoment};case U:return{...e,startTime:t.payload.startTime};case K:return{...e,endTime:t.payload.endTime};case F:return{...e,startTimeInput:t.payload.startTimeInput};case B:return{...e,endTimeInput:t.payload.endTimeInput};case Y:return{...e,capacityType:t.payload.capacityType};case H:return{...e,capacity:t.payload.capacity};case Pe:return{...e,attendeeInfoFields:t.payload.attendeeInfoFields};case $e:return{...e,type:t.payload.type};case q:return{...e,salePriceChecked:t.payload.checked};case V:return{...e,salePrice:t.payload.salePrice};case G:return{...e,saleStartDate:t.payload.startDate};case W:return{...e,saleStartDateInput:t.payload.startDateInput};case Z:return{...e,saleStartDateMoment:t.payload.startDateMoment};case X:return{...e,saleEndDate:t.payload.endDate};case J:return{...e,saleEndDateInput:t.payload.endDateInput};case Q:return{...e,saleEndDateMoment:t.payload.endDateMoment};default:return e}},Ji=wt().datepickerFormat,Qi=Ht()(),ec=jt().end_sale_buffer_duration?jt().end_sale_buffer_duration:2,tc=jt().end_sale_buffer_years?jt().end_sale_buffer_years:1,ac=Qi.clone().add(ec,"hours").add(tc,"years"),sc=Ji?Qi.format(qt(Ji)):Vt(Qi),nc=Ji?ac.format(qt(Ji)):Vt(ac),ic={title:"",description:"",price:"",sku:"",iac:Rt().iacDefault?Rt().iacDefault:"none",startDate:Wt(Qi),startDateInput:sc,startDateMoment:Qi,endDate:Wt(ac),endDateInput:nc,endDateMoment:ac,startTime:Zt(Qi),endTime:Zt(ac),startTimeInput:Gt(Qi),endTimeInput:Gt(ac),capacityType:Ka[za],capacity:"",salePriceChecked:!1,salePrice:"",saleStartDate:"",saleStartDateInput:"",saleStartDateMoment:"",saleEndDate:"",saleEndDateInput:"",saleEndDateMoment:""},cc=(e=ic,t)=>{switch(t.type){case ee:return{...e,title:t.payload.title};case te:return{...e,description:t.payload.description};case ae:return{...e,price:t.payload.price};case se:return{...e,sku:t.payload.sku};case ne:return{...e,iac:t.payload.iac};case ie:return{...e,startDate:t.payload.startDate};case ce:return{...e,startDateInput:t.payload.startDateInput};case re:return{...e,startDateMoment:t.payload.startDateMoment};case oe:return{...e,endDate:t.payload.endDate};case le:return{...e,endDateInput:t.payload.endDateInput};case de:return{...e,endDateMoment:t.payload.endDateMoment};case pe:return{...e,startTime:t.payload.startTime};case Te:return{...e,endTime:t.payload.endTime};case ue:return{...e,startTimeInput:t.payload.startTimeInput};case ye:return{...e,endTimeInput:t.payload.endTimeInput};case _e:return{...e,capacityType:t.payload.capacityType};case ge:return{...e,capacity:t.payload.capacity};case Ee:return{...e,salePriceChecked:t.payload.checked};case ke:return{...e,salePrice:t.payload.salePrice};case Ie:return{...e,saleStartDate:t.payload.startDate};case me:return{...e,saleStartDateInput:t.payload.startDateInput};case Se:return{...e,saleStartDateMoment:t.payload.startDateMoment};case he:return{...e,saleEndDate:t.payload.endDate};case Ce:return{...e,saleEndDateInput:t.payload.endDateInput};case fe:return{...e,saleEndDateMoment:t.payload.endDateMoment};default:return e}},rc={details:Zi,tempDetails:ic,sold:0,available:0,ticketId:0,currencyDecimalPoint:(e=>{if(""===e)return".";const t=wi(),[a]=t.filter((t=>t.class===e));return a?a.currency_decimal_point:"."})(Ni()),currencyNumberOfDecimals:(e=>{if(""===e)return 2;const t=wi(),[a]=t.filter((t=>t.class===e));return a?a.currency_number_of_decimals:2})(Ni()),currencyPosition:(()=>{const e=(t=Ui()&&Ui().reverseCurrencyPosition,-1!==["true","yes","1"].indexOf(t)?"suffix":"prefix");var t;return Ki()&&Ki().defaultCurrencyPosition?Ki().defaultCurrencyPosition:e})(),currencySymbol:(e=>{const t=Fi();if(""===e)return t.default_currency;const a=wi(),[s]=a.filter((t=>t.class===e));return s?s.currency:t.default_currency})(Ni()),currencyThousandsSep:(e=>{if(""===e)return",";const t=wi(),[a]=t.filter((t=>t.class===e));return a?a.currency_thousands_sep:","})(Ni()),provider:"",hasAttendeeInfoFields:!1,isLoading:!1,isModalOpen:!1,hasBeenCreated:!1,hasChanges:!1,hasDurationError:!1,isSelected:!1},oc=(e=rc,t)=>{switch(t.type){case Pe:case A:case v:case w:case N:case P:case L:case O:case x:case j:case z:case R:case $:case U:case K:case F:case B:case Y:case H:case $e:case Ue:case Ke:case Fe:case q:case V:case G:case W:case Z:case X:case J:case Q:return{...e,details:Xi(e.details,t)};case ee:case te:case ae:case se:case ne:case ie:case ce:case re:case oe:case le:case de:case pe:case Te:case ue:case ye:case _e:case ge:case Ee:case ke:case Ie:case me:case Se:case he:case Ce:case fe:return{...e,tempDetails:cc(e.tempDetails,t)};case De:return{...e,sold:t.payload.sold};case be:return{...e,available:t.payload.available};case Me:return{...e,ticketId:t.payload.ticketId};case Ae:return{...e,currencySymbol:t.payload.currencySymbol};case ve:return{...e,currencyPosition:t.payload.currencyPosition};case we:return{...e,provider:t.payload.provider};case Ne:return{...e,hasAttendeeInfoFields:t.payload.hasAttendeeInfoFields};case Le:return{...e,isLoading:t.payload.isLoading};case Oe:return{...e,isModalOpen:t.payload.isModalOpen};case xe:return{...e,hasBeenCreated:t.payload.hasBeenCreated};case je:return{...e,hasChanges:t.payload.hasChanges};case ze:return{...e,hasDurationError:t.payload.hasDurationError};case Re:return{...e,isSelected:t.payload.isSelected};default:return e}};(0,l.HY)({byClientId:(e={},t)=>{switch(t.type){case A:case v:case w:case N:case P:case L:case O:case x:case j:case z:case R:case $:case U:case K:case F:case B:case Y:case H:case ee:case te:case ae:case se:case ne:case ie:case ce:case re:case oe:case le:case de:case pe:case Te:case ue:case ye:case _e:case ge:case De:case be:case Me:case Ae:case ve:case we:case Ne:case Pe:case Le:case Oe:case xe:case je:case ze:case Re:case $e:case Ue:case Ke:case Fe:case D:case q:case Ee:case V:case ke:case G:case W:case Z:case X:case J:case Q:case Ie:case me:case Se:case he:case Ce:case fe:return{...e,[t.payload.clientId]:oc(e[t.payload.clientId],t)};case b:return p()(e,[t.payload.clientId]);case M:return{};default:return e}},allClientIds:(e=[],t)=>{switch(t.type){case D:return[...e,t.payload.clientId];case b:return e.filter((e=>t.payload.clientId!==e));case M:return[];default:return e}}})(void 0,{}),a(9796),window.wp.blocks;const lc=window.wp.htmlEntities,dc=e=>e.tickets.move,pc=(0,wa.Mz)(dc,(e=>e.ui)),Tc=(0,wa.Mz)(dc,(e=>e.postTypes)),uc=(0,wa.Mz)(dc,(e=>e.posts)),yc=(0,wa.Mz)(dc,(e=>e.modal)),_c=((0,wa.Mz)(pc,(e=>e.showModal)),(0,wa.Mz)(Tc,(e=>e.isFetching)),(0,wa.Mz)(uc,(e=>e.isFetching)),(0,wa.Mz)(Tc,(e=>e.posts))),gc=(0,wa.Mz)(uc,(e=>e.posts)),Ec=(0,wa.Mz)(_c,(e=>Object.keys(e).map((t=>({value:t,label:e[t]}))))),kc=(0,wa.Mz)(gc,(e=>Object.keys(e).map((t=>({value:String(e[t]),label:(0,lc.decodeEntities)(t)||(0,ct.__)("(no title)","event-tickets")}))))),Ic=(0,wa.Mz)(yc,(e=>e.post_type)),mc=((0,wa.Mz)(yc,(e=>e.search_terms)),(0,wa.Mz)(yc,(e=>e.target_post_id)));(0,wa.Mz)(yc,(e=>e.ticketId)),(0,wa.Mz)(yc,(e=>e.clientId)),(0,wa.Mz)(yc,(e=>e.isSubmitting)),(0,wa.Mz)(yc,(e=>e.errorMessage)),(0,wa.Mz)([Ec,Ic],((e,t)=>(0,it.find)(e,["value",t]))),(0,wa.Mz)([kc,mc],((e,t)=>!(!t||!(0,it.find)(e,["value",t])))),a(8354);const{Mp:Sc,SG:hc,T8:Cc,U0:fc}=i,{restNonce:Dc,tecDateSettings:bc}=s,{W:Mc}=n;new Set,window.tribe=window.tribe||{},window.tribe.tickets=window.tribe.tickets||{},window.tribe.tickets.data=window.tribe.tickets.data||{},window.tribe.tickets.data.blocks=window.tribe.tickets.data.blocks||{},window.tribe.tickets.data.blocks={...window.tribe.tickets.data.blocks,actions:r,selectors:c};const Ac=e=>({type:u,payload:e}),vc=()=>({type:y}),wc=e=>({type:_,payload:e}),Nc=e=>({type:g,payload:{isSelected:e}}),Pc=e=>({type:E,payload:{isSettingsOpen:e}}),Lc=e=>({type:k,payload:{isSettingsLoading:e}}),Oc=()=>Pc(!0),xc=()=>Pc(!1),jc=e=>({type:I,payload:{provider:e}}),zc=e=>({type:m,payload:{sharedCapacity:e}}),Rc=e=>({type:S,payload:{tempSharedCapacity:e}}),$c=()=>({type:He}),Uc=e=>({type:h,payload:{id:e}}),Kc=e=>({type:C,payload:{image:e}}),Fc=()=>({type:f}),Bc=(e,t)=>({type:A,payload:{clientId:e,title:t}}),Yc=(e,t)=>({type:v,payload:{clientId:e,description:t}}),Hc=(e,t)=>({type:w,payload:{clientId:e,price:t}}),qc=(e,t)=>({type:N,payload:{clientId:e,onSale:t}}),Vc=(e,t)=>({type:P,payload:{clientId:e,sku:t}}),Gc=(e,t)=>({type:L,payload:{clientId:e,iac:t}}),Wc=(e,t)=>({type:O,payload:{clientId:e,startDate:t}}),Zc=(e,t)=>({type:x,payload:{clientId:e,startDateInput:t}}),Xc=(e,t)=>({type:j,payload:{clientId:e,startDateMoment:t}}),Jc=(e,t)=>({type:z,payload:{clientId:e,endDate:t}}),Qc=(e,t)=>({type:R,payload:{clientId:e,endDateInput:t}}),er=(e,t)=>({type:$,payload:{clientId:e,endDateMoment:t}}),tr=(e,t)=>({type:U,payload:{clientId:e,startTime:t}}),ar=(e,t)=>({type:K,payload:{clientId:e,endTime:t}}),sr=(e,t)=>({type:F,payload:{clientId:e,startTimeInput:t}}),nr=(e,t)=>({type:B,payload:{clientId:e,endTimeInput:t}}),ir=(e,t)=>({type:Y,payload:{clientId:e,capacityType:t}}),cr=(e,t)=>({type:H,payload:{clientId:e,capacity:t}}),rr=(e,t)=>({type:$e,payload:{clientId:e,type:t}}),or=(e,t)=>({type:ee,payload:{clientId:e,title:t}}),lr=(e,t)=>({type:te,payload:{clientId:e,description:t}}),dr=(e,t)=>({type:ae,payload:{clientId:e,price:t}}),pr=(e,t)=>({type:q,payload:{clientId:e,checked:t}}),Tr=(e,t)=>({type:V,payload:{clientId:e,salePrice:t}}),ur=(e,t)=>({type:G,payload:{clientId:e,startDate:t}}),yr=(e,t)=>({type:W,payload:{clientId:e,startDateInput:t}}),_r=(e,t)=>({type:Z,payload:{clientId:e,startDateMoment:t}}),gr=(e,t)=>({type:X,payload:{clientId:e,endDate:t}}),Er=(e,t)=>({type:J,payload:{clientId:e,endDateInput:t}}),kr=(e,t)=>({type:Q,payload:{clientId:e,endDateMoment:t}}),Ir=(e,t)=>({type:Ee,payload:{clientId:e,checked:t}}),mr=(e,t)=>({type:ke,payload:{clientId:e,salePrice:t}}),Sr=(e,t)=>({type:Ie,payload:{clientId:e,startDate:t}}),hr=(e,t)=>({type:me,payload:{clientId:e,startDateInput:t}}),Cr=(e,t)=>({type:Se,payload:{clientId:e,startDateMoment:t}}),fr=(e,t)=>({type:he,payload:{clientId:e,endDate:t}}),Dr=(e,t)=>({type:Ce,payload:{clientId:e,endDateInput:t}}),br=(e,t)=>({type:fe,payload:{clientId:e,endDateMoment:t}}),Mr=(e,t)=>({type:se,payload:{clientId:e,sku:t}}),Ar=(e,t)=>({type:ne,payload:{clientId:e,iac:t}}),vr=(e,t)=>({type:ie,payload:{clientId:e,startDate:t}}),wr=(e,t)=>({type:ce,payload:{clientId:e,startDateInput:t}}),Nr=(e,t)=>({type:re,payload:{clientId:e,startDateMoment:t}}),Pr=(e,t)=>({type:oe,payload:{clientId:e,endDate:t}}),Lr=(e,t)=>({type:le,payload:{clientId:e,endDateInput:t}}),Or=(e,t)=>({type:de,payload:{clientId:e,endDateMoment:t}}),xr=(e,t)=>({type:pe,payload:{clientId:e,startTime:t}}),jr=(e,t)=>({type:Te,payload:{clientId:e,endTime:t}}),zr=(e,t)=>({type:ue,payload:{clientId:e,startTimeInput:t}}),Rr=(e,t)=>({type:ye,payload:{clientId:e,endTimeInput:t}}),$r=(e,t)=>({type:_e,payload:{clientId:e,capacityType:t}}),Ur=(e,t)=>({type:ge,payload:{clientId:e,capacity:t}}),Kr=e=>({type:D,payload:{clientId:e}}),Fr=e=>({type:b,payload:{clientId:e}}),Br=()=>({type:M}),Yr=(e,t)=>({type:De,payload:{clientId:e,sold:t}}),Hr=(e,t)=>({type:be,payload:{clientId:e,available:t}}),qr=(e,t)=>({type:Me,payload:{clientId:e,ticketId:t}}),Vr=(e,t)=>({type:Ae,payload:{clientId:e,currencySymbol:t}}),Gr=(e,t)=>({type:ve,payload:{clientId:e,currencyPosition:t}}),Wr=(e,t)=>({type:we,payload:{clientId:e,provider:t}}),Zr=(e,t)=>({type:Ne,payload:{clientId:e,hasAttendeeInfoFields:t}}),Xr=(e,t)=>({type:Pe,payload:{clientId:e,attendeeInfoFields:t}}),Jr=(e,t)=>({type:Le,payload:{clientId:e,isLoading:t}}),Qr=(e,t)=>({type:Oe,payload:{clientId:e,isModalOpen:t}}),eo=(e,t)=>({type:xe,payload:{clientId:e,hasBeenCreated:t}}),to=(e,t)=>({type:je,payload:{clientId:e,hasChanges:t}}),ao=(e,t)=>({type:ze,payload:{clientId:e,hasDurationError:t}}),so=(e,t)=>({type:Re,payload:{clientId:e,isSelected:t}}),no=e=>({type:Be,payload:{uneditableTickets:e}}),io=e=>({type:Ye,loading:e}),co=(e,t)=>({type:qe,payload:{clientId:e,details:t}}),ro=(e,t)=>({type:Ve,payload:{clientId:e,tempDetails:t}}),oo=(e,t,a)=>({type:Ge,payload:{clientId:e,date:t,dayPickerInput:a}}),lo=(e,t,a)=>({type:We,payload:{clientId:e,date:t,dayPickerInput:a}}),po=(e,t,a)=>({type:Je,payload:{clientId:e,date:t,dayPickerInput:a}}),To=(e,t,a)=>({type:Qe,payload:{clientId:e,date:t,dayPickerInput:a}}),uo=(e,t)=>({type:Ze,payload:{clientId:e,seconds:t}}),yo=(e,t)=>({type:Xe,payload:{clientId:e,seconds:t}}),_o=(e,t)=>({type:et,payload:{clientId:e,ticketId:t}}),go=e=>({type:tt,payload:{clientId:e}}),Eo=e=>({type:at,payload:{clientId:e}}),ko=(e,t)=>({type:st,payload:{clientId:e,askForDeletion:t}}),Io=e=>({type:nt,payload:e});function mo(e){window.__tribe_common_store__.dispatch(e)}function So(e,...t){return e(window.__tribe_common_store__.getState(),...t)}function ho(e,t){const a=String(t);mo(cr(e,a)),mo(Ur(e,a)),mo(ir(e,Ua)),mo($r(e,Ua)),Co(e)}function Co(e){mo(to(e,!0))}function fo(e){return So(ws,{clientId:e})}var Do=a(921);const bo={FETCH_SEAT_TYPES_FOR_LAYOUT:e=>async function(e){const t=new URL(Do.ajaxUrl);t.searchParams.set("action",Do.ACTION_GET_SEAT_TYPES_BY_LAYOUT_ID),t.searchParams.set("layout",e),t.searchParams.set("_ajax_nonce",Do.ajaxNonce);const a=await fetch(t.toString(),{method:"GET",headers:{Accept:"application/json"}});if(200!==a.status)throw new Error(`Failed to fetch seat types for layout ID ${e}. Status: ${a.status}`);const s=await a.json();return s?.data||[]}(e.layoutId)};function Mo(){const e=function(){try{return So(as)}catch(e){return""}}();return(0,$i.applyFilters)("tec.tickets.seating.allowedProviders",["TEC\\Tickets\\Commerce\\Module"]).includes(e)}const Ao={isUsingAssignedSeating:e=>e.isUsingAssignedSeating&&Mo(),getLayouts:e=>e.layouts,getLayoutSeats:(e,t)=>e.layouts.find((e=>e.id===t))?.seats||0,getLayoutsInOptionFormat:e=>e.layouts.map((e=>({label:e.name,value:e.id}))),getSeatTypesForLayout(e,t,a=!1){const s=e.seatTypesByLayoutId?.[t]||null;return s?a?s:Object.values(s).map((function(e){return{label:`${e.name} (${e.seats})`,value:e.id}})):[]},getCurrentLayoutId:e=>e.isUsingAssignedSeating&&e?.currentLayoutId||null,getSeatTypeSeats:(e,t)=>e.isUsingAssignedSeating?e?.seatTypesByLayoutId?.[e.currentLayoutId]?.[t]?.seats||0:null,getTicketSeatType(e,t){if(!e.isUsingAssignedSeating)return null;const a=fo(t);return e?.seatTypesByPostId?.[a]||e?.seatTypesByClientId?.[t]||null},isLayoutLocked:e=>e?.isLayoutLocked||!1,getAllSeatTypes:e=>e?.seatTypes||[],getEventCapacity:e=>e?.eventCapacity||0,getSeatTypesByPostID:e=>e.isUsingAssignedSeating?e?.seatTypesByPostId||[]:null,getSeatTypesByClientID:e=>e.isUsingAssignedSeating?e?.seatTypesByClientId||[]:null,isServiceStatusOk:e=>!0===e?.serviceStatus?.ok,getServiceStatus:e=>e?.serviceStatus?.status,getServiceConnectUrl:e=>e?.serviceStatus?.connectUrl},vo={setUsingAssignedSeating:e=>({type:"SET_USING_ASSIGNED_SEATING",isUsingAssignedSeating:e}),setLayout:e=>({type:"SET_LAYOUT",layoutId:e}),setEventCapacity:e=>({type:"SET_EVENT_CAPACITY",eventCapacity:e}),setSeatTypesForLayout:(e,t)=>({type:"SET_SEAT_TYPES_FOR_LAYOUT",layoutId:e,seatTypes:t}),setTicketSeatType:(e,t)=>({type:"SET_TICKET_SEAT_TYPE",clientId:e,seatTypeId:t}),setTicketSeatTypeByPostId:e=>({type:"SET_TICKET_SEAT_TYPE_BY_POST_ID",clientId:e}),fetchSeatTypesForLayout:e=>({type:"FETCH_SEAT_TYPES_FOR_LAYOUT",layoutId:e}),setIsLayoutLocked:e=>({type:"LOCK_LAYOUT",isLayoutLocked:e})},wo=window?.tec?.tickets?.seating?.blockEditorData,No="tec-tickets-seating",Po={...wo,seatTypesByLayoutId:{},seatTypesByClientId:{},ticketPostIdByClientId:{}},Lo=(0,o.createReduxStore)(No,{reducer(e=Po,t){switch(t.type){case"SET_USING_ASSIGNED_SEATING":return(0,$i.doAction)("tec.tickets.seating.setUsingAssignedSeating",t.isUsingAssignedSeating),{...e,isUsingAssignedSeating:t.isUsingAssignedSeating};case"SET_LAYOUT":return{...e,currentLayoutId:t.layoutId};case"SET_EVENT_CAPACITY":return{...e,eventCapacity:t.eventCapacity};case"SET_SEAT_TYPES_FOR_LAYOUT":const a=t.seatTypes.reduce(((e,t)=>({...e,[t.id]:t})),{});return{...e,seatTypesByLayoutId:{...e.seatTypesByLayoutId,[t.layoutId]:a}};case"SET_TICKET_SEAT_TYPE":const s=fo(t.clientId);if(null===t.seatTypeId){const{seatTypesByClientId:a,seatTypesByPostId:n}=e;return delete a[t.clientId],delete n[s],delete n[t.clientId],{...e,seatTypesByClientId:a,seatTypesByPostId:n}}return{...e,seatTypesByClientId:{...e.seatTypesByClientId,[t.clientId]:t.seatTypeId},seatTypesByPostId:{...e.seatTypesByPostId,[s||t.clientId]:t.seatTypeId}};case"SET_TICKET_SEAT_TYPE_BY_POST_ID":const n=fo(t.clientId),{seatTypesByPostId:i,seatTypesByClientId:c}=e,r=c[t.clientId]||i[n];return delete i[t.clientId],{...e,seatTypesByPostId:{...i,[n]:r}};case"LOCK_LAYOUT":return{...e,isLayoutLocked:t.isLayoutLocked}}return e},actions:vo,selectors:Ao,controls:bo,resolvers:{*getSeatTypesForLayout(e){if(!e)return null;const t=yield vo.fetchSeatTypesForLayout(e);return vo.setSeatTypesForLayout(e,t)}}});(0,o.register)(Lo);const Oo=window.wp.element,xo=window.wp.coreData,jo=window.wp.components;var zo=a(5556),Ro=a.n(zo);const $o=window.tec.tickets.seating.meta.META_KEY_ENABLED,Uo=window.tec.tickets.seating.meta.META_KEY_LAYOUT_ID;window.tec.tickets.seating.meta.META_KEY_SEAT_TYPE;var Ko=a(1609),Fo=a.n(Ko),Bo=a(2090),Yo=a.n(Bo);const Ho=window.ReactJSXRuntime;class qo extends Ko.PureComponent{static defaultProps={onClick:it.noop,type:"button"};static propTypes={className:ha().oneOfType([ha().string,ha().arrayOf(ha().string),ha().object]),isDisabled:ha().bool,children:ha().node,onClick:ha().func,type:ha().string};render(){const{children:e,className:t,isDisabled:a,onClick:s,type:n,...i}=this.props;return(0,Ho.jsx)("button",{className:Yo()("tribe-editor__button",t),disabled:a,type:n,onClick:s,...i,children:e})}}const Vo=qo;Ko.PureComponent,ha().string.isRequired,ha().node,ha().object,ha().string,ha().node,ha().object,ha().string,ha().func,ha().func,ha().func;ha().string,ha().object,ha().arrayOf(ha().shape({accordionId:ha().string.isRequired,content:ha().node,contentClassName:ha().string,header:ha().node,headerClassName:ha().string,onClick:ha().func,onClose:ha().func,onOpen:ha().func}).isRequired).isRequired;ha().string,ha().number,ha().string;const Go=({alt:e,className:t,src:a,...s})=>(0,Ho.jsx)("img",{src:a,alt:e,className:Yo()("tribe-editor__image",t),...s});Go.propTypes={alt:ha().string.isRequired,className:ha().string,src:ha().string.isRequired};const{MediaUpload:Wo}=ut;ha().bool,ha().string,ha().string,ha().string,ha().shape({alt:ha().string.isRequired,id:ha().number.isRequired,src:ha().string.isRequired}).isRequired,ha().func.isRequired,ha().func.isRequired,ha().bool,ha().string;const Zo=({className:e,forId:t,isLabel:a=!1,label:s,children:n})=>{const i=a?(0,Ho.jsx)("label",{className:"tribe-editor__labeled-item__label",htmlFor:t,children:s}):(0,Ho.jsx)("span",{className:"tribe-editor__labeled-item__label",children:s});return(0,Ho.jsxs)("div",{className:Yo()("tribe-editor__labeled-item",e),children:[i,n]})};Zo.propTypes={className:ha().string,isLabel:ha().bool,forId:ha().string,label:ha().node,children:ha().node};const Xo=({children:e,className:t,href:a,target:s,...n})=>(0,Ho.jsx)("a",{className:Yo()("tribe-editor__link",t),href:a,target:s,...(()=>{const e={...n};return"_blank"===s&&(e.rel="noopener noreferrer"),e})(),children:e});Xo.propTypes={children:ha().node,className:ha().string,href:ha().string.isRequired,target:ha().string};const Jo=Xo;ha().string,ha().node,ha().bool,ha().string.isRequired,ha().string,ha().string;Ko.PureComponent,ha().string,ha().bool,ha().bool,ha().string,ha().string,ha().node,ha().string,ha().string,ha().func,ha().func,ha().func;ha().string,ha().bool,ha().node,ha().bool,ha().string,ha().string,ha().node,ha().string,ha().string,ha().func,ha().func,ha().func;a(3520);var Qo=a(7656),el=a(5020),tl=a(4862);const al=(0,a(4748).Ay)(),sl=(()=>{if(window.__tribe_common_store__)return window.__tribe_common_store__;const e=[tl.P,al,ya],t=(0,el.tY)({name:"tribe/common"}),a=(0,Qt.y$)(ba({}),t((0,Qt.Tw)(...e)));return(0,Da.H)(ba,a),a.run=al.run,window.__tribe_common_store__=a,a})(),{InnerBlocks:nl}=ut;class il extends Ko.PureComponent{static propTypes={allowedBlocks:ha().arrayOf(ha().string),layouts:ha().oneOfType([ha().object,ha().arrayOf(ha().object)]),plugins:ha().arrayOf(ha().string).isRequired,pluginTemplates:ha().objectOf(ha().arrayOf(ha().array)),templateInsertUpdatesSelection:ha().bool.isRequired,templateLock:ha().oneOf(["all","insert",!1])};static defaultProps={templateInsertUpdatesSelection:!1};get registeredBlockNames(){const e=(0,o.select)("core/blocks").getBlockTypes();return(0,it.map)(e,(e=>e.name))}get template(){const e=this.registeredBlockNames;return this.props.plugins.reduce(((t,a)=>{const s=this.props.pluginTemplates[a];if(s){const a=this.filterPluginTemplates(e,s);return[...t,...a]}return t}),[])}filterPluginTemplates(e,t){return(0,it.reduce)(t,((t,[a,s,n])=>{if((0,it.includes)(e,a)){const i=(0,it.isArray)(n)?[a,s,this.filterPluginTemplates(e,n)]:[a,s];return[...t,i]}return t}),[])}render(){return(0,Ho.jsx)("div",{className:"tribe-common__plugin-block-hook",children:(0,Ho.jsx)(nl,{allowedBlocks:this.props.allowedBlocks,layouts:this.props.layouts,template:this.template,templateInsertUpdatesSelection:this.props.templateInsertUpdatesSelection,templateLock:this.props.templateLock})})}}(0,Qt.Zz)(((e={})=>t=>a=>{const s={...e,store:sl};return(0,Ho.jsx)(t,{...a,...s})})(),(0,Qo.Ng)((e=>({plugins:ma(e)}))))(il);Ko.PureComponent,ha().node.isRequired;Ko.PureComponent,ha().shape({label:ha().string,value:ha().any}),ha().func.isRequired,ha().string,ha().bool.isRequired,ha().any,ha().string,it.noop;const cl=({className:e,type:t,...a})=>(0,Ho.jsx)("input",{className:Yo()("tribe-editor__input",e),type:t,...a});cl.propTypes={className:ha().string,type:ha().string.isRequired};const rl=cl;ha().bool,ha().string,ha().bool,va.timeFormat.isRequired,ha().func,ha().func,ha().func,ha().func,ha().bool,va.timeFormat.isRequired,ha().number,ha().string,Ko.PureComponent,ha().bool,ha().node,ha().string,ha().oneOf(["top left","top center","top right","bottom left","bottom center","bottom right"]),ha().string,window.wp.date,a(2962),a(9244),a(1905),new Set;var ol=a(3962),ll=a(2278),dl=a(8376),pl=a(7653);const Tl=({children:e,cacheKey:t,className:a})=>{const[s,n]=(0,Ko.useState)(null),i=(0,Ko.useCallback)((e=>{e&&n(e.ownerDocument)}),[]),c=(0,Ko.useMemo)((()=>s?(0,pl.A)({key:t,container:s.head}):null),[s,t]);return(0,Ho.jsx)("div",{ref:i,className:a,children:c?(0,Ho.jsx)(dl.C,{value:c,children:e}):e})};ha().string;ha().node.isRequired;ha().node.isRequired,ha().oneOf([1,2,3,4,5,6]).isRequired;const ul={medium:"medium",small:"small"};ha().node.isRequired,ha().oneOf(Object.keys(ul));ha().string,ha().func;ha().string,ha().number,ha().number,ha().func,ha().number;ha().bool.isRequired,ha().string,ha().bool,ha().string,ha().string,ha().string,ha().func,ha().string;const yl=({checked:e,className:t,onChange:a,...s})=>(0,Ho.jsx)(rl,{checked:e,className:Yo()("tribe-editor__input--radio",t),onChange:a,type:"radio",...s});yl.propTypes={checked:ha().bool,className:ha().string,onChange:ha().func};const _l=({checked:e,className:t,onChange:a,...s})=>(0,Ho.jsx)(rl,{checked:e,className:Yo()("tribe-editor__input--checkbox",t),onChange:a,type:"checkbox",...s});_l.propTypes={checked:ha().bool,className:ha().string,onChange:ha().func};ha().bool.isRequired,ha().string,ha().bool,ha().string,ha().node,ha().string,ha().func,ha().string;const gl=e=>ol.c.DropdownIndicator&&(0,Ho.jsx)(ol.c.DropdownIndicator,{...e,children:(0,Ho.jsx)(jo.Dashicon,{className:"tribe-editor__select__dropdown-indicator",icon:"arrow-down"})}),El=()=>null,kl=({className:e,...t})=>(0,Ho.jsx)(Tl,{cacheKey:"tribe-editor-select",className:"tribe-editor__select-wrapper",children:(0,Ho.jsx)(ll.Ay,{className:Yo()("tribe-editor__select",e),classNamePrefix:"tribe-editor__select",components:{DropdownIndicator:gl,IndicatorSeparator:El},...t})});kl.propTypes={className:ha().string};const Il=kl;ha().string;var ml=a(9932);const Sl=e=>(0,ml.getLocalizedString)(e,"capacity-form"),hl=Sl("seat-types-loading-msg");function Cl(e){return 0!==e.layouts.length?null:(0,Ho.jsxs)("div",{className:"tec-tickets-seating-layouts-empty-info",children:[(0,Ho.jsxs)("span",{className:"alert",children:[Sl("no-layouts-available")," "]}),(0,Ho.jsx)("span",{children:Sl("no-layouts-available-info")}),(0,Ho.jsx)("a",{href:(0,ml.getLink)("layouts"),target:"_blank",className:"button-link button-link--nested",rel:"noreferrer",children:Sl("no-layouts-available-link-label")})]})}function fl(e){return e.layoutLocked&&e?.currentLayout?(0,Ho.jsxs)("div",{className:"tec-tickets-seating-layouts-locked-info",children:[Sl("seat-layout-label"),": ",(0,Ho.jsx)("b",{children:e.currentLayout.label})]}):null}function Dl(e){return 0===e.layouts.length?null:(0,Ho.jsxs)("div",{className:"tec-tickets-seating-layouts-info",children:[(0,Ho.jsx)("span",{className:"tec-tickets-seating-layouts-info-text",children:Sl("event-layouts-capacity-info")}),(0,Ho.jsx)("a",{href:(0,ml.getLink)("layouts"),target:"_blank",className:"button-link button-link--nested",rel:"noreferrer",children:Sl("view-layouts-link-label")})]})}const bl=({layoutLocked:e,layouts:t,onLayoutChange:a,currentLayout:s,seatTypes:n,onSeatTypeChange:i,currentSeatType:c})=>(0,Ho.jsxs)(Ko.Fragment,{children:[(0,Ho.jsx)(Cl,{layouts:t}),(0,Ho.jsx)(fl,{layoutLocked:e,currentLayout:s}),(0,Ho.jsx)("div",{style:{display:e||!t.length?"none":"block"},children:(0,Ho.jsx)(Il,{id:"tec-tickets-seating-layouts-select",placeholder:Sl("event-layouts-select-placeholder"),options:t,onChange:a,value:s,isDisabled:e})}),s&&(0,Ho.jsx)(Il,{id:"tec-tickets-seating-layouts-select",placeholder:Sl("seat-types-select-placeholder"),options:n,onChange:i,value:c,noOptionsMessage:()=>hl}),(0,Ho.jsx)(Dl,{layouts:t})]});bl.propTypes={layoutLocked:Ro().bool,layouts:Ro().arrayOf(Ro().shape({label:Ro().string.isRequired,value:Ro().string.isRequired})).isRequired,onLayoutChange:Ro().func.isRequired,currentLayout:Ro().shape({label:Ro().string.isRequired,value:Ro().string.isRequired}),seatTypes:Ro().arrayOf(Ro().shape({label:Ro().string.isRequired,value:Ro().string.isRequired})).isRequired,onSeatTypeChange:Ro().func.isRequired,currentSeatType:Ro().shape({label:Ro().string.isRequired,value:Ro().string.isRequired})};const Ml=bl,Al=({status:e,serviceConnectUrl:t})=>{const a=((e,t)=>{const a={fontSize:"var(--tec-font-size-2)",lineHeight:"var(--tec-line-height-2)",marginLeft:"var(--tec-spacer-1)"},s={color:"var(--tec-color-link-accent)"};switch(e){case"down":return(0,Ho.jsx)("span",{style:a,children:(0,ct.__)("The Seating Builder service is down and assigned seating is not available. We are working to restore functionality.","event-tickets")});case"not-connected":return(0,Ho.jsxs)("span",{style:a,children:[(0,ct.__)("Your site is not connected to the Seating Builder service.","event-tickets")," ",(0,Ho.jsx)("a",{style:s,href:t,target:"_blank",rel:"noreferrer noopener",children:(0,ct._x)("You need to connect your site to use assigned seating.","Connect to the Seating Builder link label","event-tickets")})]});case"expired-license":return(0,Ho.jsxs)("span",{style:a,children:[(0,ct.__)("Your license for Seating has expired.","event-tickets")," ",(0,Ho.jsx)("a",{style:s,href:"https://evnt.is/1bdu",target:"_blank",rel:"noreferrer noopener",children:(0,ct._x)("Renew your license to continue using Seating for Event Tickets.","link label for renewing the license","event-tickets")})]});case"invalid-license":return(0,Ho.jsxs)("span",{style:a,children:[(0,ct.__)("Your license for Seating is invalid.","event-tickets")," ",(0,Ho.jsx)("a",{style:s,href:"https://evnt.is/1bdu",target:"_blank",rel:"noreferrer noopener",children:(0,ct._x)("Check your license key settings","link label for checking the license","event-tickets")})," ",(0,ct.__)("or","event-tickets")," ",(0,Ho.jsx)("a",{style:s,href:"https://evnt.is/1be1",target:"_blank",rel:"noreferrer noopener",children:(0,ct._x)("log into your account.","link label for account login","event-tickets")})]});default:return""}})(e,t);return(0,Ho.jsxs)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"nowrap"},children:[(0,Ho.jsx)(jo.Icon,{icon:"warning",size:24,style:{color:"var(--tec-color-icon-error)"}}),a]})};Al.propTypes={status:Ro().oneOf(["down","not-connected","invalid-license"])};const vl=Al;var wl=a(6942),Nl=a.n(wl);const Pl={right:"right",left:"left"},Ll=({asLink:e=!1,children:t,className:a,disabled:s,href:n="#",icon:i,onClick:c,position:r=Pl.left,target:o,...l})=>{const d=Nl()("tribe-editor__action-button",`tribe-editor__action-button--icon-${r}`,a),p=()=>{const t={...l};return e&&!s?t.onMouseDown=()=>{window.open(n,o)}:(t.disabled=s,t.onMouseDown=c),t};return e&&!s?(0,Ho.jsxs)(Jo,{className:d,href:"#",...p(),children:[i,(0,Ho.jsx)("span",{className:"tribe-editor__action-button__label",children:t})]}):(0,Ho.jsxs)(Vo,{className:d,...p(),children:[i,(0,Ho.jsx)("span",{className:"tribe-editor__action-button__label",children:t})]})};Ll.propTypes={asLink:Ro().bool,children:Ro().node,className:Ro().string,disabled:Ro().bool,href:Ro().string,icon:Ro().node.isRequired,onClick:Ro().func,position:Ro().oneOf(Object.keys(Pl)),target:Ro().string};const Ol=Ll;Ro().arrayOf(Ro().node),Ro().string,Ro().string,Ro().string,Ro().bool,Ro().bool,Ro().func,Ro().func,Ro().bool,Ro().bool,Ko.PureComponent,Ro().string.isRequired,Ro().string.isRequired,Ro().bool.isRequired,Ro().bool.isRequired,Ro().string.isRequired,Ro().string.isRequired,Ro().string.isRequired,Ro().func.isRequired,Ro().func.isRequired,Ro().func.isRequired,Ro().bool.isRequired;const xl=(e,t)=>t?(0,Ho.jsxs)("div",{className:"tickets-heading__wrapper tickets-row-line",children:[(0,Ho.jsx)("div",{className:"tickets-heading tickets-heading__title",children:e}),(0,Ho.jsx)("div",{className:"tickets-heading__description",children:t})]}):(0,Ho.jsx)("div",{className:"tickets-heading tickets-row-line",children:e}),jl=({className:e,children:t,header:a,description:s})=>(0,Ho.jsxs)("div",{className:Nl()("tribe-editor__card",e),children:[a&&xl(a,s),t]});jl.propTypes={className:Ro().string,children:Ro().node,header:Ro().string,description:Ro().string};Ro().node,Ro().node;const zl={rsvp:"rsvp",ticket:"ticket"};Ro().string,Ro().node,Ro().node,Ro().oneOf(Object.keys(zl)).isRequired,a(6133),a(4807),Ko.Component,it.noop,it.noop,Ro().string,Ro().instanceOf(Date),Ro().string,Ro().bool,Ro().string,Ro().string,Ro().string,Ro().bool,Ro().func,Ro().func,Ro().func,Ro().func,Ro().func,Ro().func,Ro().func,Ro().func,Ro().func,Ro().func,Ro().string,Ro().string,Ro().bool,Ro().instanceOf(Date),Ro().string,Ro().bool,Ro().string,Ro().string,Ro().string,Ro().bool;Ro().string,Ro().node,Ro().oneOf(["top left","top center","top right","bottom left","bottom center","bottom right"]),Ro().string;Ro().string,Ro().string,Ro().bool,Ro().node,Ro().bool,Ro().node,Ro().oneOf(["top left","top center","top right","bottom left","bottom center","bottom right"]),Ro().string,Ro().number;Ro().oneOfType([Ro().string,Ro().arrayOf(Ro().string),Ro().object]),Ro().number.isRequired,Ro().bool,Ro().string,Ro().string,Ro().any,Ro().any;Ro().string,Ro().string,Ro().node,Ro().oneOf(Object.keys({rsvp:"rsvp",ticket:"ticket"})).isRequired,Ro().string;var Rl;function $l(){return $l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)({}).hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},$l.apply(null,arguments)}const Ul=e=>Ko.createElement("svg",$l({width:12,height:13,viewBox:"0 0 12 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Rl||(Rl=Ko.createElement("g",{id:"Pro/Plus icon"},Ko.createElement("path",{id:"Fill 1",d:"M12 6.50021C12 9.81383 9.31383 12.5 5.99979 12.5C2.68617 12.5 0 9.81383 0 6.50021C0 3.18659 2.68617 0.5 5.99979 0.5C9.31383 0.5 12 3.18659 12 6.50021Z",fill:"#FFCF48"}),Ko.createElement("path",{id:"Fill 3",d:"M5.71991 6.54681L3.62183 6.48691L8.38136 2.10938L6.29836 6.02155L8.39644 6.08145L3.93095 10.823L5.71991 6.54681Z",fill:"#161B7D"}))));var Kl;function Fl(){return Fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)({}).hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},Fl.apply(null,arguments)}const Bl=e=>Ko.createElement("svg",Fl({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Kl||(Kl=Ko.createElement("g",{id:"icon-bulb"},Ko.createElement("path",{id:"Vector",d:"M16.4998 9C16.4998 11.4508 14.8927 11.3989 14.2958 14.7746C14.227 15.2143 13.8592 15.5376 13.4004 15.5376H10.5994C10.1402 15.5376 9.77284 15.2141 9.70401 14.7746C9.1071 11.3989 7.5 11.4506 7.5 9C7.5 6.52576 9.54331 4.5 12 4.5C14.4567 4.5 16.4998 6.52576 16.4998 9ZM13.9977 16.6241C13.9977 16.8553 13.8137 17.0402 13.5844 17.0402H10.4159C10.1863 17.0402 10.0026 16.855 10.0026 16.6241C10.0026 16.3932 10.1863 16.2079 10.4159 16.2079H13.5841C13.8138 16.2079 13.9977 16.3928 13.9977 16.6241ZM13.5844 18.1038C13.5844 18.335 13.4005 18.5196 13.1712 18.5196H10.7486C10.5189 18.5196 10.3353 18.3347 10.3353 18.1038C10.3353 17.8723 10.5189 17.6879 10.7486 17.6879L13.1709 17.6879C13.4005 17.6879 13.5844 17.8723 13.5844 18.1038ZM11 19H13L12.5 19.5H11.5L11 19Z",fill:"#334AFF"}))));var Yl,Hl;function ql(){return ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)({}).hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},ql.apply(null,arguments)}const Vl=e=>Ko.createElement("svg",ql({width:21,height:21,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),Yl||(Yl=Ko.createElement("g",{clipPath:"url(#seat_svg__clip0_4728_78585)"},Ko.createElement("path",{d:"M17.8334 11.0809C17.694 10.1888 17.0249 9.7427 16.5789 9.43604C16.486 9.371 16.3652 9.28736 16.3094 9.2409C16.012 8.27445 15.8912 7.12216 15.7797 6.10925C15.6868 5.25432 15.5939 4.44585 15.4173 3.82324C14.7482 1.50006 13.0198 1.50006 12.1834 1.50006H10.455H8.71724C7.89019 1.50006 6.16174 1.50006 5.49267 3.82324C5.30681 4.44585 5.22318 5.25432 5.13025 6.11854C5.01874 7.13145 4.88864 8.27445 4.60057 9.25019C4.53552 9.29665 4.41471 9.38029 4.32179 9.44534C3.87574 9.7427 3.20666 10.198 3.06727 11.0901C2.78849 12.8744 2.84424 13.878 3.281 14.5377C3.73634 15.2347 4.5634 15.6993 5.34399 15.6993H5.68782L5.21389 18.6916C5.14884 19.0726 5.40903 19.4257 5.79004 19.4908C5.82721 19.5001 5.86438 19.5001 5.90155 19.5001C6.23609 19.5001 6.53345 19.2584 6.58921 18.9146L7.1189 15.6993H10.455H13.7911L14.3208 18.9146C14.3765 19.2584 14.6739 19.5001 15.0084 19.5001C15.0456 19.5001 15.0828 19.5001 15.1199 19.4908C15.5009 19.4257 15.7611 19.0726 15.6961 18.6916L15.2036 15.6993H15.5474C16.328 15.6993 17.155 15.2347 17.6104 14.5377C18.0564 13.8687 18.1122 12.8651 17.8334 11.0809ZM16.4488 13.7665C16.2165 14.1103 15.8169 14.3054 15.5474 14.3054H10.455H5.36257C5.09308 14.3054 4.6842 14.1196 4.46118 13.7665C4.24744 13.4412 4.24744 12.6142 4.45188 11.2946C4.49835 11.0251 4.73067 10.8485 5.11167 10.5883C5.41833 10.3839 5.78074 10.1423 5.91084 9.72412C6.26396 8.60899 6.39406 7.36377 6.51487 6.26723C6.5985 5.46805 6.68214 4.71534 6.83082 4.21354C7.18394 2.9869 7.77868 2.89397 8.71724 2.89397H10.455H12.1927C13.1313 2.89397 13.726 2.9869 14.0884 4.21354C14.2371 4.71534 14.3208 5.46805 14.4044 6.26723C14.5252 7.36377 14.6646 8.61829 15.0084 9.72412C15.1385 10.1423 15.4916 10.3839 15.8076 10.5976C16.1886 10.8578 16.4209 11.0251 16.4674 11.3039C16.6625 12.6142 16.6625 13.4412 16.4488 13.7665Z",fill:"#727272"}),Ko.createElement("path",{d:"M13.6424 11.2388H10.455H7.25829C6.87729 11.2388 6.56133 11.5548 6.56133 11.9358C6.56133 12.3168 6.87729 12.6327 7.25829 12.6327H10.455H13.6517C14.0327 12.6327 14.3486 12.3168 14.3486 11.9358C14.3486 11.5548 14.0327 11.2388 13.6424 11.2388Z",fill:"#727272"}))),Hl||(Hl=Ko.createElement("defs",null,Ko.createElement("clipPath",{id:"clip0_4728_78585"},Ko.createElement("rect",{width:15.1007,height:18,fill:"white",transform:"translate(2.9 1.50006)"})))));Ro().string,Ro().bool,Ro().node,Ro().node,Ro().func,Ro().node;Ro().node,Ro().string,Ro().string.isRequired;const Gl=({description:e})=>(0,Ho.jsxs)("div",{className:"tribe-editor__notice",children:[(0,Ho.jsx)(Bl,{}),e]});Gl.propTypes={description:Ro().node};const Wl=Gl,Zl=()=>(0,Ho.jsx)(Ko.Fragment,{children:(0,Ho.jsx)(Wl,{description:(0,ct.__)("Assigned seating is not yet supported for events that are in series.","event-tickets")})}),Xl=e=>(0,ml.getLocalizedString)(e,"capacity-form");function Jl(e,t){return t&&e?t.find((t=>t.value===e)):null}function Ql(e,t){return t&&e?t.find((t=>t.value===e)):null}const ed=React.memo(Ml),td=React.memo(vl);function ad({renderDefaultForm:e,clientId:t}){const{setUsingAssignedSeating:a,setLayout:s,setEventCapacity:n,setTicketSeatType:i}=(0,o.useDispatch)(Lo),c=(0,o.useSelect)((e=>e(No).getLayoutSeats),[]),r=(0,o.useSelect)((e=>e(No).getSeatTypeSeats),[]),l=(0,o.useSelect)((e=>e(No).isUsingAssignedSeating()),[]),d=(0,o.useSelect)((e=>e(No).getLayoutsInOptionFormat()),[]),p=(0,o.useSelect)((e=>e(No).getCurrentLayoutId()),[]),T=(0,o.useSelect)((e=>e(No).getTicketSeatType(t)),[t]),u=(0,o.useSelect)((e=>e(No).getSeatTypesForLayout(p)),[p]),y=(0,o.useSelect)((e=>e(No).isLayoutLocked()),[]),_=(0,o.useSelect)((e=>e(No).isServiceStatusOk()),[]),g=(0,o.useSelect)((e=>e(No).getServiceStatus()),[]),E=(0,o.useSelect)((e=>e(No).getServiceConnectUrl()),[]),k=(0,o.useSelect)((e=>e("core/editor").getCurrentPostType()),[]),I=(0,o.useSelect)((e=>e("core/editor").getCurrentPostId()),[]),[m,S]=(0,xo.useEntityProp)("postType",k,"meta",I),h=(0,Oo.useCallback)((e=>{if(!0===e){const e={...m,[$o]:"1"};return void S(e)}if(!1===e){const e={...m,[$o]:"0",[Uo]:""};return void S(e)}const t={...m,[$o]:"1",[Uo]:e};S(t)}),[m,S]),C=(0,Oo.useCallback)((e=>{y||(a("seat"===e),h("seat"===e))}),[y,a,h]),f=(0,Oo.useCallback)((e=>{const a=c(e.value);h(e.value),s(e.value),n(a),i(t,null),ho(t,0),function(e,t){const a=String(t);mo(zc(a)),mo(Rc(a)),Co(e)}(t,a)}),[c,n,s,h,t]),D=(0,Oo.useCallback)((e=>{const a=r(e.value);i(t,e.value),ho(t,a)}),[r,i,t]);return(0,Ho.jsxs)("div",{className:"tec-tickets-seating__capacity-form",children:[y?(0,Ho.jsx)("div",{className:"tec-tickets-seating__capacity-locked-info",children:Xl(l?"seat-option-label":"general-admission-label")}):(0,Ho.jsx)(jo.RadioControl,{className:"tec-tickets-seating__capacity-radio",onChange:C,options:[{label:Xl("general-admission-label"),value:"regular"},{label:Xl("seat-option-label"),value:"seat"}],selected:l?"seat":"regular"}),l?window?.TECFtEditorData?.event?.isInSeries?(0,Ho.jsx)(Zl,{}):_?(0,Ho.jsx)(ed,{layoutLocked:y,layouts:d,onLayoutChange:f,currentLayout:Jl(p,d),seatTypes:u,onSeatTypeChange:D,currentSeatType:Ql(T,u)}):(0,Ho.jsx)(td,{status:g,serviceConnectUrl:E}):e()]})}ad.propTypes={renderDefaultForm:Ro().func.isRequired,ticketPostId:Ro().number};const sd=()=>(0,ml.getLink)("layout-edit")?(0,Ho.jsx)(Ol,{asLink:!0,href:(0,ml.getLink)("layout-edit"),icon:(0,Ho.jsx)(Vl,{}),target:"_blank",children:(0,ml.getLocalizedString)("seats-action-label","dashboard")}):null,nd=({name:e})=>(0,Ho.jsx)("span",{className:"tec-tickets-block__container_header-seat-type",children:e}),id=Fo().memo((({postId:e})=>{const[t,a]=(0,Ko.useState)(!1),[s,n]=(0,Ko.useState)(!1),[i,c]=(0,Ko.useState)(!1),r=It()+`edit.php?post_type=tribe_events&page=tickets-attendees&event_id=${e}`,o={textDecoration:"underline"},l=()=>{n(!1),a(!1),c(!1)},d=async()=>{c(!0),await async function(){const t=new URL(Do.ajaxUrl);return t.searchParams.set("_ajax_nonce",Do.ajaxNonce),t.searchParams.set("postId",e),t.searchParams.set("action",Do.ACTION_REMOVE_EVENT_LAYOUT),200===(await fetch(t.toString(),{method:"POST"})).status}()&&(c(!1),n(!1),window.location.reload())};function p(){return i?(0,Ho.jsx)(jo.Spinner,{}):(0,Ho.jsxs)(Ko.Fragment,{children:[(0,Ho.jsxs)("div",{className:"tec-tickets-seating__settings-intro",children:[(0,Ho.jsx)(jo.Dashicon,{icon:"warning"}),(0,Ho.jsx)("span",{className:"icon-text",children:(0,ct.__)("Caution","event-tickets")}),(0,Ho.jsxs)("p",{className:"warning-text",children:[(0,ct.__)("All attendees will lose their seat assignments. All seated tickets will switch to 1 capacity.","event-tickets")," ",(0,Ho.jsx)("span",{style:o,children:(0,ct.__)("This action cannot be undone.","event-tickets")})]})]}),(0,Ho.jsx)(jo.CheckboxControl,{className:"tec-tickets-seating__settings--checkbox",label:"I Understand",checked:t,onChange:a,name:"tec-tickets-seating__settings--switched-layout"}),(0,Ho.jsxs)("p",{children:[(0,ct.__)("You may want to","event-tickets")," ",(0,Ho.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:(0,ct.__)("export attendee","event-tickets")})," ",(0,ct.__)("data first as a record of current seat assignments.","event-tickets")]}),(0,Ho.jsxs)("div",{className:"tec-tickets-seating__settings--actions",children:[(0,Ho.jsx)(jo.Button,{onClick:d,disabled:!t,isPrimary:t,children:(0,ct.__)("Remove Seat Layout","event-tickets")}),(0,Ho.jsx)(jo.Button,{onClick:l,isSecondary:!0,children:(0,ct.__)("Cancel","event-tickets")})]})]})}return(0,Ho.jsxs)(Ko.Fragment,{children:[(0,Ho.jsx)("a",{href:"#",className:"tec-tickets-seating__settings_layout--remove",onClick:()=>n(!0),children:(0,ct.__)("Remove Seat Layout","event-tickets")}),s&&(0,Ho.jsx)(jo.Modal,{className:"tec-tickets-seating__settings--layout-modal",title:(0,ct.__)("Confirm Seat Layout removal","event-tickets"),isDismissible:!0,onRequestClose:l,size:"medium",children:(0,Ho.jsx)(p,{})})]})})),cd=({layouts:e,currentLayout:t})=>{const a=(0,o.useSelect)((e=>e("core/editor").getCurrentPostId()),[]),[s,n]=(0,Ko.useState)((i=t,(c=e)&&i?c.find((e=>e.value===i)):null));var i,c;const[r,l]=(0,Ko.useState)(!1),[d,p]=(0,Ko.useState)(null),[T,u]=(0,Ko.useState)(!1),[y,_]=(0,Ko.useState)(!1),g=It()+`edit.php?post_type=tribe_events&page=tickets-attendees&event_id=${a}`,E=e=>{e!==s&&(l(!0),p(e))},k=()=>{l(!1),u(!1),_(!1)};function I(){if(null===t||0===t.length||0===e.length)return(0,Ho.jsx)("span",{className:"tec-tickets-seating__settings_layout--description",children:(0,ct.__)("The event is not using assigned seating.","event-tickets")})}const m=Fo().memo((function(){return null===t||0===t.length||0===e.length?null:(0,Ho.jsxs)(Ko.Fragment,{children:[(0,Ho.jsxs)("div",{className:"tec-tickets-seating__settings_layout--select-container",children:[(0,Ho.jsx)(Il,{id:"tec-tickets-seating__settings_layout-select",className:"tec-tickets-seating__settings_layout--select",value:s,options:e,onChange:E}),(0,Ho.jsx)(id,{postId:a})]}),(0,Ho.jsx)("span",{className:"tec-tickets-seating__settings_layout--description",children:(0,ct.__)("Changing the event’s layout will impact all existing tickets. Attendees will lose their seat assignments.","event-tickets")})]})}));return(0,Ho.jsxs)("div",{className:"tec-tickets-seating__settings_layout--wrapper",children:[(0,Ho.jsx)("span",{className:"tec-tickets-seating__settings_layout--title",children:(0,ct.__)("Seat Layout","event-tickets")}),(0,Ho.jsx)(I,{}),(0,Ho.jsx)(m,{}),r&&(0,Ho.jsxs)(jo.Modal,{className:"tec-tickets-seating__settings--layout-modal",title:"Confirm Seat Layout Change",isDismissible:!0,onRequestClose:k,size:"medium",children:[!y&&(0,Ho.jsxs)(Ko.Fragment,{children:[(0,Ho.jsxs)("div",{className:"tec-tickets-seating__settings-intro",children:[(0,Ho.jsx)(jo.Dashicon,{icon:"warning"}),(0,Ho.jsx)("span",{className:"icon-text",children:(0,ct.__)("Caution","event-tickets")}),(0,Ho.jsxs)("p",{className:"warning-text",children:[(0,ct.__)("All attendees will lose their seat assignments. All existing tickets will be assigned to a default seat type.","event-tickets")," ",(0,Ho.jsx)("span",{style:{textDecoration:"underline"},children:(0,ct.__)("This action cannot be undone.","event-tickets")})]})]}),(0,Ho.jsx)(jo.CheckboxControl,{className:"tec-tickets-seating__settings--checkbox",label:"I Understand",checked:T,onChange:u,name:"tec-tickets-seating__settings--switched-layout"}),(0,Ho.jsxs)("p",{children:[(0,ct.__)("You may want to","event-tickets")," ",(0,Ho.jsx)("a",{href:g,target:"_blank",rel:"noopener noreferrer",children:(0,ct.__)("export attendee","event-tickets")})," ",(0,ct.__)("data first as a record of current seat assignments.","event-tickets")]}),(0,Ho.jsxs)("div",{className:"tec-tickets-seating__settings--actions",children:[(0,Ho.jsx)(jo.Button,{onClick:async()=>{n(d),_(!0),await async function(){const e=new URL(Do.ajaxUrl);return e.searchParams.set("_ajax_nonce",Do.ajaxNonce),e.searchParams.set("newLayout",d.value),e.searchParams.set("postId",a),e.searchParams.set("action",Do.ACTION_EVENT_LAYOUT_UPDATED),200===(await fetch(e.toString(),{method:"POST"})).status}()&&(_(!1),l(!1),window.location.reload())},disabled:!T,isPrimary:T,children:(0,ct.__)("Change Seat Layout","event-tickets")}),(0,Ho.jsx)(jo.Button,{onClick:k,isSecondary:!0,children:(0,ct.__)("Cancel","event-tickets")})]})]}),y&&(0,Ho.jsx)(jo.Spinner,{})]})]})},rd=()=>(0,Ho.jsxs)("div",{className:"tec-tickets-seating__settings_layout--wrapper",children:[(0,Ho.jsxs)("div",{className:"tec-tickets-seating__settings_layout_upsell--header",children:[(0,Ho.jsx)("span",{className:"tec-tickets-seating__settings_layout--title",children:(0,ct._x)("Seat Layout","Seat layout upsell title","event-tickets")}),(0,Ho.jsx)(Ul,{})]}),(0,Ho.jsxs)("span",{className:"tec-tickets-seating__settings_layout--description",children:[(0,ct._x)("Allow purchasers to select seats with","Seat layout upsell description start","event-tickets")," ",(0,Ho.jsx)("a",{style:{color:"var(--tec-color-link-accent)"},href:"https://evnt.is/add-seating",target:"_blank",rel:"noreferrer noopener",children:(0,ct._x)("Seating","Seat layout upsell link label","event-tickets")})," ",(0,ct._x)("for Event Tickets.","Seat layout upsell description end","event-tickets")]})]}),od=()=>(0,Ho.jsxs)("div",{className:"tec-tickets-seating__settings_layout--wrapper",children:[(0,Ho.jsx)("div",{className:"tec-tickets-seating__settings_layout_upsell--header",children:(0,Ho.jsx)("span",{className:"tec-tickets-seating__settings_layout--title",children:(0,ct._x)("Seat Layout","Seat layout upsell title","event-tickets")})}),(0,Ho.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[(0,Ho.jsx)(jo.Icon,{icon:"warning",size:16,style:{color:"#FCB900",marginRight:"6px"}}),(0,Ho.jsx)("span",{style:{color:"var(--tec-color-icon-primary-alt)",fontWeight:"var(--tec-font-weight-regular)",fontSize:"var(--tec-font-size-2)",lineHeight:"var(--tec-line-height-1)"},children:(0,ct._x)("The Seating Builder service is down. We are working to restore the functionality.","Seating service outage message","event-tickets")})]})]}),ld=e=>(0,o.dispatch)(No).setTicketSeatTypeByPostId(e);(0,$i.addFilter)("tec.tickets.blocks.Ticket.Capacity.renderForm","tec.tickets.seating",(function(e,t){if(!function(e){if(!Mo())return!1;if("no-license"===(0,o.select)(No).getServiceStatus())return!1;const{clientId:t}=e;if(!(0,o.select)(No).isUsingAssignedSeating(t))return!1;const a=(0,o.select)(No).isLayoutLocked(t),s=(0,o.select)(No).getCurrentLayoutId();return!(a&&!s)&&(0,$i.applyFilters)("tec.tickets.blocks.Ticket.renderSeatingForm",!0,e)}(t))return e;const{clientId:a}=t;return()=>(0,Ho.jsx)(ad,{renderDefaultForm:e,clientId:a})})),(0,$i.addFilter)("tec.tickets.blocks.setBodyDetails","tec.tickets.seating",((e,t)=>{(0,o.dispatch)(No).setIsLayoutLocked(!0);const a=(0,o.select)(No).getCurrentLayoutId();if(!a)return e;const s=(0,o.select)(No).getTicketSeatType(t),n=(0,o.select)(No).getEventCapacity();return e.append("ticket[seating][enabled]",s?"1":"0"),e.append("ticket[seating][seatType]",s||""),e.append("ticket[seating][layoutId]",a),e.append("ticket[event_capacity]",n),e})),(0,$i.addFilter)("tec.tickets.blocks.Tickets.TicketsDashboardAction.actions","tec.tickets.seating",(function(e,{clientId:t}){const a=(0,o.select)(No).isUsingAssignedSeating(t),s=(0,o.select)(No).isLayoutLocked();return a&&s&&e.push((0,Ho.jsx)(sd,{})),e})),(0,$i.addFilter)("tec.tickets.blocks.Ticket.actionItems","tec.tickets.seating",(function(e,t){return(0,o.select)(No).isUsingAssignedSeating(t)?e.filter((e=>"move"!==e.key)):e})),(0,$i.addFilter)("tec.tickets.blocks.Ticket.header.detailItems","tec.tickets.seating",((e,t)=>{if(!(0,o.select)(No).isUsingAssignedSeating(t))return e;const a=(0,o.select)(No).getTicketSeatType(t);let s=(0,o.select)(No).getSeatTypesForLayout((0,o.select)(No).getCurrentLayoutId(),!0);(!s||Array.isArray(s)&&!s.length)&&(s=(0,o.select)(No).getAllSeatTypes());const n=Object.values(s).find((e=>e.id===a))?.name;return n&&e.push((0,Ho.jsx)(nd,{name:n})),e})),(0,$i.addFilter)("tec.tickets.blocks.Tickets.CapacityTable.mappedProps","tec.tickets.flexibleTickets",(function(e){const t=(0,o.select)(No),a=t.isUsingAssignedSeating(),s=t.isLayoutLocked();if(!a||!s)return e;const n=t.getCurrentLayoutId();if(!n)return e;const i=t.getSeatTypesForLayout(n,!0),c=Object.values(t.getSeatTypesByPostID()).filter(((e,t,a)=>a.indexOf(e)===t));if(!Object.keys(i).length||!c.length)return e;e.rowsAfter=e.rowsAfter||[];const r=c.map((e=>i[e].name)),l=c.reduce(((e,t)=>e+parseInt(i[t].seats)),0);return e.rowsAfter.push({label:(0,ml.getLocalizedString)("seats-row-label","capacity-table"),items:r?`(${r})`:"",right:String(l)}),e.totalCapacity=e.totalCapacity-e.sharedCapacity+l,e.sharedCapacity="",e.sharedTicketItems="",e})),(0,$i.addFilter)("tec.tickets.blocks.Tickets.Availability.mappedProps","tec.tickets.seating",(e=>{const t=(0,o.select)(No),a=t.isUsingAssignedSeating(),s=t.isLayoutLocked();if(!a||!s)return e;const n=t.getCurrentLayoutId();if(!n)return e;const i=t.getSeatTypesForLayout(n,!0),c=Object.values(t.getSeatTypesByClientID()),r=Object.values(t.getSeatTypesByPostID()),l=(r.length>c.length?r:c).filter(((e,t,a)=>a.indexOf(e)===t)).reduce(((e,t)=>e+parseInt(i[t]?i[t].seats:0)),0),d=Object.values(i).reduce(((e,{seats:t})=>e+parseInt(t)),0),p=Math.abs(parseInt(e?.total||0)-parseInt(e?.available||0));return{total:d,available:Math.abs(l-p)}})),(0,$i.addFilter)("tribe.editor.ticket.isAsc","tec.tickets.seating",((e,t)=>e||!!(0,o.select)(No).getTicketSeatType(t))),(0,$i.addFilter)("tec.tickets.blocks.Tickets.Settings.Fields","tec.tickets.seating",(e=>{const t=(0,o.select)(No);switch(t.getServiceStatus()){case"not-connected":case"expired-license":case"invalid-license":case"no-license":e.push((0,Ho.jsx)(rd,{}));break;case"down":e.push((0,Ho.jsx)(od,{}));break;default:const a=t.getCurrentLayoutId(),s=t.getLayoutsInOptionFormat();e.push((0,Ho.jsx)(cd,{layouts:s,currentLayout:a}))}return e})),(0,$i.addAction)("tec.tickets.blocks.ticketUpdated","tec.tickets.seating",ld),(0,$i.addAction)("tec.tickets.blocks.ticketCreated","tec.tickets.seating",ld),(0,$i.addFilter)("tec.tickets.blocks.confirmButton.isDisabled","tec.tickets.seating",((e,t,a)=>{if(e)return e;const s=(0,o.select)(No);return s.isUsingAssignedSeating(a.clientId)&&s.isLayoutLocked()&&s.getCurrentLayoutId()?!s.getTicketSeatType(a.clientId):e})),(0,$i.addFilter)("tec.tickets.blocks.Tickets.TicketsDashboardAction.mappedProps","tec.tickets.seating",(e=>{const t=(0,o.select)(No);return t.isServiceStatusOk()?e:t.isUsingAssignedSeating()&&t.getCurrentLayoutId()?(e.isConfirmDisabled=!0,e):e})),(0,$i.addFilter)("tec.tickets.blocks.Ticket.actionItems","tec.tickets.seating",(e=>{const t=(0,o.select)(No);return t.isServiceStatusOk()?e:t.isUsingAssignedSeating()&&t.getCurrentLayoutId()?[]:e})),(0,$i.addFilter)("tec.tickets.blocks.Ticket.isSelected","tec.tickets.seating",(e=>{const t=(0,o.select)(No);return(t.isServiceStatusOk()||!t.isUsingAssignedSeating()||!t.getCurrentLayoutId())&&e})),(0,$i.addFilter)("tec.tickets.blocks.Tickets.CapacityTable.sharedCapacityInput","tec.tickets.seating",(function(e){return(0,o.select)(No).isUsingAssignedSeating()?So(ns)||0:e}))},5795:e=>{e.exports=window.ReactDOM},9932:(e,t,a)=>{function s(e){return window?.tec?.tickets?.seating?.utilsData?.links?.[e]||""}function n(e,t){return t?window?.tec?.tickets?.seating?.utilsData?.localizedStrings?.[t]?.[e]||"":window?.tec?.tickets?.seating?.utilsData?.localizedStrings?.[e]||""}a.d(t,{getLink:()=>s,getLocalizedString:()=>n})}},a={};function s(e){var n=a[e];if(void 0!==n)return n.exports;var i=a[e]={id:e,loaded:!1,exports:{}};return t[e].call(i.exports,i,i.exports,s),i.loaded=!0,i.exports}s.m=t,e=[],s.O=(t,a,n,i)=>{if(!a){var c=1/0;for(d=0;d<e.length;d++){for(var[a,n,i]=e[d],r=!0,o=0;o<a.length;o++)(!1&i||c>=i)&&Object.keys(s.O).every((e=>s.O[e](a[o])))?a.splice(o--,1):(r=!1,i<c&&(c=i));if(r){e.splice(d--,1);var l=n();void 0!==l&&(t=l)}}return t}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[a,n,i]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.j=1825,(()=>{var e={1490:0,1825:0,4193:0,6728:0,8493:0};s.O.j=t=>0===e[t];var t=(t,a)=>{var n,i,[c,r,o]=a,l=0;if(c.some((t=>0!==e[t]))){for(n in r)s.o(r,n)&&(s.m[n]=r[n]);if(o)var d=o(s)}for(t&&t(a);l<c.length;l++)i=c[l],s.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return s.O(d)},a=globalThis.webpackChunkevent_tickets=globalThis.webpackChunkevent_tickets||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var n=s.O(void 0,[5798,4121,6728,8493],(()=>s(3076)));n=s.O(n),window.tec=window.tec||{},window.tec.tickets=window.tec.tickets||{},window.tec.tickets.seating=window.tec.tickets.seating||{},window.tec.tickets.seating.blockEditor=n})();
Save File
Cancel