/*! For license information please see app-4ae9c440c058bfc43499.cjs.LICENSE.txt */ (self.webpackChunkroot=self.webpackChunkroot||[]).push([[524],{0:(e,t,n)=>{"use strict";e.exports=n.p+"img/asoLogo-eb0c34a967f39c0e7e3a.jpg"},384:(e,t,n)=>{"use strict";e.exports=n.p+"img/avatarGroup-faca1e69e2c224b7eebe.png"},477:()=>{},1037:(e,t,n)=>{"use strict";e.exports=n.p+"svg/dnsBlank-d9b5a36b6d641e2b1cd9.svg"},1205:(e,t,n)=>{"use strict";e.exports=n.p+"img/formPositionUnranked-8efe2960cfc090ba51df.png"},1416:(e,t,n)=>{"use strict";e.exports=n.p+"img/googlePlan-b18cf281f99a8608e7a9.png"},1446:(e,t,n)=>{"use strict";e.exports=n.p+"img/googleMaps-093b110e04f11e43e677.png"},1931:(e,t,n)=>{"use strict";e.exports=n.p+"img/google-3994b2066e10d4d349a4.png"},2281:(e,t,n)=>{"use strict";e.exports=n.p+"img/login2x-a7058a62cb4dc68d53e5.png"},2599:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankHandGlobe-724d35d1342815318f84.svg"},2630:(e,t,n)=>{"use strict";e.exports=n.p+"svg/alert-c575e88c07bbcb08605f.svg"},2647:(e,t,n)=>{"use strict";e.exports=n.p+"img/login-ba738216a561ebc04664.png"},2830:()=>{!function(e){const t=e.nl=e.nl||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 van %1","Align center":"Midden uitlijnen","Align left":"Links uitlijnen","Align right":"Rechts uitlijnen",Aquamarine:"Aquamarijn",Black:"Zwart","Block quote":"Blok citaat",Blue:"Blauw",Bold:"Vet","Break text":"","Bulleted List":"Ongenummerde lijst",Cancel:"Annuleren","Centered image":"Gecentreerde afbeelding","Change image text alternative":"Verander alt-tekst van de afbeelding","Choose heading":"Kies kop","Dim grey":"Gedimd grijs","Document colors":"Document kleur",Downloadable:"Downloadbaar","Dropdown toolbar":"Drop-down werkbalk","Edit block":"Blok aanpassen","Edit link":"Bewerk link","Editor toolbar":"Editor welkbalk","Font Background Color":"Tekst achtergrondkleur","Font Color":"Tekstkleur","Full size image":"Afbeelding op volledige grootte",Green:"Groen",Grey:"Grijs",Heading:"Koppen","Heading 1":"Kop 1","Heading 2":"Kop 2","Heading 3":"Kop 3","Heading 4":"Kop 4","Heading 5":"Kop 5","Heading 6":"Kop 6","Image resize list":"","Image toolbar":"Afbeeldingswerkbalk","image widget":"afbeeldingswidget","In line":"","Insert image":"Afbeelding toevoegen","Insert paragraph after block":"Voeg paragraaf toe na blok","Insert paragraph before block":"Voeg paragraaf toe voor blok",Italic:"Cursief",Justify:"Volledig uitlijnen","Left aligned image":"Links uitgelijnde afbeelding","Light blue":"Lichtblauw","Light green":"Lichtgroen","Light grey":"Lichtgrijs",Link:"Link","Link URL":"Link URL",Next:"Volgende","Numbered List":"Genummerde lijst","Open in a new tab":"Open een nieuw tabblad","Open link in new tab":"Open link in nieuw tabblad",Orange:"Oranje",Original:"Origineel",Paragraph:"Paragraaf",Previous:"Vorige",Purple:"Paars",Red:"Rood",Redo:"Opnieuw","Remove color":"Verwijder kleur","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Rich Text Editor":"Tekstbewerker","Rich Text Editor, %0":"Tekstbewerker, %0","Right aligned image":"Rechts uitgelijnde afbeelding",Save:"Opslaan","Select all":"Selecteer alles","Show more items":"Meer items weergeven","Side image":"Afbeelding naast tekst","Text alignment":"Tekst uitlijning","Text alignment toolbar":"Tekst uitlijning werkbalk","Text alternative":"Alt-tekst","This link has no URL":"Deze link heeft geen URL",Turquoise:"Turquoise",Underline:"Onderlijnen",Undo:"Ongedaan maken",Unlink:"Verwijder link","Upload failed":"Uploaden afbeelding mislukt","Upload in progress":"Bezig met uploaden",White:"Wit","Widget toolbar":"Widget werkbalk","Wrap text":"",Yellow:"Geel"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},3574:(e,t,n)=>{"use strict";e.exports=n.p+"svg/done2-fe55d02679b93e21cc5f.svg"},3646:(e,t,n)=>{"use strict";var i=n(4848),s=(n(8630),n(9191));function o(e){try{return Buffer.from(e).toString("base64")}catch{try{return btoa(e)}catch{return""}}}function r(e){try{return Buffer.from(e,"base64").toString()}catch{try{return atob(e)}catch{return""}}}var a,l,d=n(2664);function c(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function u(e){return(e||"").trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function h(e,t={}){const n=t.replacer??l.Dash,i=c(e).trim().toLowerCase().replace(/['"]+/gi,"");let s;return s=n===l.Dash?i.replace(/[^a-z0-9\\-]+/gu,"-").replace(/-+$/,"").replace(/^-+/,""):n===l.Underscore?i.replace(/[^a-z0-9_]+/gu,"_").replace(/_+$/,"").replace(/^_+/,""):i.replace(/[^a-z0-9]+/gu,"").trim(),t?.replaceStartingNumber?s.replace(/^(\d)/,"_$1"):s}function m(e){return Array.isArray(e)&&"production"!==a.Production&&console.warn("Array passed to `isNonEmptyString()`, did you mean to use `isNonEmptyArray()` instead?"),"string"==typeof e&&e.trim().length>0}function g(e){return!m(e)}!function(e){e.Development="development",e.Production="production",e.Test="test"}(a||(a={})),function(e){e[e.Dash=0]="Dash",e[e.Empty=1]="Empty",e[e.Underscore=2]="Underscore"}(l||(l={}));const p=["hm","hrh","him","hih","hh","hsh","hgdh","kg","lg","kt","lt","sm","sar","sai","sas","sagd"],f=e=>m(e)?e[0].toUpperCase()+e.slice(1):"";function x(e){return(e??"").trim().toLowerCase().replace(/\s+/g," ").split(" ").map(e=>p.includes(e.toLowerCase())?e.toUpperCase():f(e.trim())).join(" ").split("-").map(e=>p.includes(e.toLowerCase())?e.toUpperCase():f(e.trim())).join("-")}function _(e,t){const n=(e,t,n,i,s)=>en?n+1:e+1:i===s?t:t+1;if(e===t)return 0;if(e.length>t.length){const n=e;e=t,t=n}let i=e.length,s=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(s-1);)i--,s--;let o=0;for(;o{if("object"==typeof window&&void 0!==window[e])return window[e];if(void 0!==b?.[e])return b[e];throw new Error(`Missing env. var. ${e}`)},C=e=>"object"==typeof window&&void 0!==window[e]?window[e]:void 0!==b?.[e]?b[e]:void 0,y=e=>{const t=j(e);return"boolean"==typeof t?t:"true"===t},k=j("HEAVENT_APPLICATION_DOMAIN"),A=C("HEAVENT_RESOURCES_DOMAIN")??k,w=C("HEAVENT_ASSETS_DOMAIN")??A,S=C("HEAVENT_APP_SUBDOMAIN")??"app",E=C("HEAVENT_API_SUBDOMAIN")??"api",T=C("HEAVENT_PUBLIC_SUBDOMAIN")??"event",z=C("HEAVENT_INVOICES_SUBDOMAIN")??"invoices",O=C("HEAVENT_ASSETS_SUBDOMAIN")??"assets",R=C("HEAVENT_UPLOADS_SUBDOMAIN")??"uploads",$=C("HEAVENT_APPLICATION_BASENAME")??"",D=C("HEAVENT_RESOURCES_BASENAME")??"",P={ADMINS:j("HEAVENT_ADMINS"),EMAIL_FROM:j("HEAVENT_EMAIL_FROM"),EMAIL_FROM_NAME:j("HEAVENT_EMAIL_FROM_NAME"),HEAVENT_APPLICATION_DOMAIN:k,HEAVENT_RESOURCES_DOMAIN:A,HEAVENT_ASSETS_DOMAIN:w,HEAVENT_APPLICATION_BASENAME:$,HEAVENT_APP_URL:new I(C("HEAVENT_APP_DOMAIN")??k,void 0,S,C("HEAVENT_APP_BASENAME")??$),HEAVENT_API_URL:new I(C("HEAVENT_API_DOMAIN")??k,void 0,E,C("HEAVENT_API_BASENAME")??$),HEAVENT_PUBLIC_URL:new I(C("HEAVENT_PUBLIC_DOMAIN")??k,void 0,T,C("HEAVENT_PUBLIC_BASENAME")??$),HEAVENT_ASSETS_URL:new I(w,void 0,O,C("HEAVENT_ASSETS_BASENAME")??D),HEAVENT_INVOICES_URL:new I(C("HEAVENT_INVOICES_DOMAIN")??A,void 0,z,C("HEAVENT_INVOICES_BASENAME")??D),HEAVENT_UPLOADS_URL:new I(C("HEAVENT_UPLOADS_DOMAIN")??A,void 0,R,C("HEAVENT_UPLOADS_BASENAME")??D),USE_HUBSPOT:j("HEAVENT_USE_HUBSPOT"),COGNITO_USER_POOL_ID:j("HEAVENT_COGNITO_USER_POOL_ID"),COGNITO_USER_POOL_CLIENT_ID:j("HEAVENT_COGNITO_USER_POOL_CLIENT_ID"),COGNITO_DOMAIN_URL:j("HEAVENT_COGNITO_DOMAIN_URL"),COGNITO_CLIENT_CALLBACK_URL:j("HEAVENT_COGNITO_CLIENT_CALLBACK_URL")[0],USE_MIXPANEL:y("HEAVENT_USE_MIXPANEL"),MIXPANEL_TOKEN:y("HEAVENT_MIXPANEL_TOKEN"),HEAVENT_AWS_UPLOADS_BUCKET:j("HEAVENT_AWS_UPLOADS_BUCKET"),LOG_TOKEN:j("HEAVENT_LOG_TOKEN"),WEEZEVENT_DOMAIN:j("HEAVENT_WEEZEVENT_DOMAIN")},F="x-heavent-commit-sha",M="x-heavent-request-uuid",N="x-user-token";var L=n(6540),B=n(5002);function V(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}const U="heavent-user-session-key",W="heavent-user-email",G="UserNotFoundException";let H=null;const q=()=>(null===H&&(H=new B.NE({UserPoolId:P.COGNITO_USER_POOL_ID,ClientId:P.COGNITO_USER_POOL_CLIENT_ID})),H);function Y(){return new Promise((e,t)=>{const n=q().getCurrentUser();null!==n?n.getSession((i,s)=>{i||!1===s?.isValid()?t(new Error("Could not get current user")):e({user:n,token:s.getIdToken().getJwtToken()})}):t(new Error("Could not get current user"))})}async function K(){try{const e=localStorage.getItem("heavent-test-token");return m(e)?e:(await Y()).token}catch{return}}function Z(e,t){const n=e.trim().toLowerCase();return new Promise((e,i)=>{const s=[new B.HB({Name:"email",Value:n})];q().signUp(n,t,s,[],(t,n)=>{t?i(t):e(n.user)})})}function X(){Y().then(({user:e})=>{e.signOut(),location.reload()}).catch(()=>{alert("Something wrong happened ")})}function J(e,t,n){return new Promise((i,s)=>{const o=new B.TU({Username:e,Pool:q()}),r=new B.By({Username:e}),a={onSuccess(e){t(e.getIdToken().getJwtToken())},onFailure(e){e.code===G?s(G):n(e)},customChallenge(){localStorage.setItem(W,e),localStorage.setItem(U,o.Session),i({user:o,callbacks:a})}};o.setAuthenticationFlowType("CUSTOM_AUTH"),o.initiateAuth(r,a)})}function Q(e,t){return new Promise((n,i)=>{new B.TU({Username:e,Pool:q()}).authenticateUser(new B.By({Username:e,Password:t}),{onSuccess(e){n(e.getIdToken().getJwtToken())},onFailure(e){i(e)}})})}function ee(e){return new Promise((t,n)=>{new B.TU({Username:e,Pool:q()}).forgotPassword({onSuccess(){t(!0)},async onFailure(i){if(i.code===G)try{await Z(e,V()),await ee(e),t(!0)}catch(e){n(e)}else n(i)}})})}function te(e,t,n){return new Promise((i,s)=>{new B.TU({Username:e,Pool:q()}).confirmPassword(t,n,{async onSuccess(){i(await Q(e,n))},onFailure(e){s(e)}})})}var ne,ie,se,oe,re,ae,le,de,ce,ue,he,me,ge,pe,fe,xe,_e,Ie,ve,be,je,Ce,ye,ke,Ae,we,Se,Ee,Te,ze,Oe,Re,$e,De,Pe,Fe,Me,Ne,Le,Be,Ve,Ue,We,Ge,He,qe,Ye,Ke,Ze,Xe,Je,Qe,et,tt,nt,it,st,ot,rt,at,lt,dt,ct,ut,ht,mt,gt,pt,ft,xt,_t,It,vt,bt,jt,Ct,yt,kt,At,wt,St,Et,Tt,zt,Ot,Rt,$t,Dt,Pt,Ft,Mt,Nt,Lt,Bt,Vt,Ut,Wt,Gt,Ht=n(961),qt=n(1519);!function(e){e.Delegation="Delegation",e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position",e.PositionCategory="PositionCategory"}(ne||(ne={})),function(e){e.Calendar="Calendar",e.List="List",e.Radio="Radio"}(ie||(ie={})),function(e){e.Acronym="Acronym",e.Address="Address",e.AutoAccredit="AutoAccredit",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Index="Index",e.Latitude="Latitude",e.Longitude="Longitude",e.Name="Name",e.Tag="Tag",e.WeezeventIsSynchronized="WeezeventIsSynchronized"}(se||(se={})),function(e){e.Accredited="Accredited",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(oe||(oe={})),function(e){e.Accreditation="Accreditation",e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Date="Date",e.Id="Id",e.Name="Name"}(re||(re={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Index="Index",e.Name="Name"}(ae||(ae={})),function(e){e.Accredited="Accredited",e.AutoAccredited="AutoAccredited",e.NotApplicable="NotApplicable",e.Refused="Refused",e.WaitingAccreditation="WaitingAccreditation"}(le||(le={})),function(e){e.Assigned="Assigned",e.Everyone="Everyone",e.Members="Members",e.Refused="Refused",e.Segments="Segments"}(de||(de={})),function(e){e.InsertedAt="InsertedAt",e.Name="Name",e.State="State",e.Type="Type"}(ce||(ce={})),function(e){e.Done="Done",e.Draft="Draft",e.InProgress="InProgress",e.Scheduled="Scheduled",e.Template="Template"}(ue||(ue={})),function(e){e.Email="Email",e.Sms="Sms"}(he||(he={})),function(e){e.Waiting="Waiting",e.CheckedIn="CheckedIn",e.CheckedOut="CheckedOut"}(me||(me={})),function(e){e.CheckIn="CheckIn",e.CheckInOut="CheckInOut",e.CheckOut="CheckOut",e.Reset="Reset"}(ge||(ge={})),function(e){e.And="And",e.Or="Or"}(pe||(pe={})),function(e){e.Animajeconvention="Animajeconvention",e.Asoassignment="Asoassignment",e.Cerclelivraison="Cerclelivraison",e.Cercleopcom="Cercleopcom",e.Cerclepressandpartenaire="Cerclepressandpartenaire",e.Cerclestaff="Cerclestaff",e.Delta="Delta",e.Dfcoa4="Dfcoa4",e.Dfcosmall="Dfcosmall",e.Eurockeennes="Eurockeennes",e.Fcg="Fcg",e.Garorockplanning="Garorockplanning",e.Goldencoast="Goldencoast",e.Hbcldc="Hbcldc",e.Hbclnh="Hbclnh",e.Lnh="Lnh",e.Moorea="Moorea",e.Nuitssecretes="Nuitssecretes",e.Openbrest="Openbrest",e.P2nassignment="P2nassignment",e.P2nassignmentmontagedemontage="P2nassignmentmontagedemontage",e.P2nbadge="P2nbadge",e.Paris20km="Paris20km",e.Paris20kmassignment="Paris20kmassignment",e.Paris20kmcontremarque="Paris20kmcontremarque",e.Pastourelle="Pastourelle",e.Pastourelleexposant="Pastourelleexposant",e.Pec="Pec",e.Playground="Playground",e.Roiarthur="Roiarthur",e.Rose="Rose",e.Roseparking="Roseparking",e.Salamandre="Salamandre",e.T24assignment="T24assignment",e.Triathlonlarochellebadge="Triathlonlarochellebadge",e.Utopialesa4="Utopialesa4",e.Utopialesimprimeur="Utopialesimprimeur",e.Vandbcontremarque="Vandbcontremarque",e.Vannes="Vannes",e.Vannesassignment="Vannesassignment",e.Vendanges="Vendanges",e.Vendeeglobebadge="Vendeeglobebadge",e.Vendeeglobecontremarque="Vendeeglobecontremarque"}(fe||(fe={})),function(e){e.All="All",e.Public="Public",e.Private="Private"}(xe||(xe={})),function(e){e.Category="Category",e.Label="Label",e.Name="Name",e.Privacy="Privacy"}(_e||(_e={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Label="Label",e.Name="Name",e.Status="Status",e.Type="Type"}(Ie||(Ie={})),function(e){e.Accreditation="Accreditation",e.Delegation="Delegation",e.Event="Event",e.Position="Position",e.UserInfo="UserInfo"}(ve||(ve={})),function(e){e.Campaigns="Campaigns",e.CanLeadersAddMembers="CanLeadersAddMembers",e.CanLeadersDeleteMembers="CanLeadersDeleteMembers",e.CanLeadersEditColumns="CanLeadersEditColumns",e.CanLeadersEditCustomFields="CanLeadersEditCustomFields",e.CanLeadersEditMembers="CanLeadersEditMembers",e.CanLeadersImportMembers="CanLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="CanLeadersSeeHiddenAccreditationsSlots",e.Category="Category",e.Columns="Columns",e.DeadlineDate="DeadlineDate",e.Description="Description",e.Documents="Documents",e.Form="Form",e.IsLocked="IsLocked",e.MaxResources="MaxResources",e.Name="Name",e.ShowFormLinkInDelegationSpace="ShowFormLinkInDelegationSpace",e.ShowInDelegationSpace="ShowInDelegationSpace",e.Tag="Tag"}(be||(be={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(je||(je={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Ce||(Ce={})),function(e){e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(ye||(ye={})),function(e){e.Expired="Expired",e.Full="Full",e.Locked="Locked",e.Ongoing="Ongoing"}(ke||(ke={})),function(e){e.Failed="FAILED",e.Pending="PENDING",e.Success="SUCCESS"}(Ae||(Ae={})),function(e){e.OnePerPage="OnePerPage",e.GroupedA4="GroupedA4"}(we||(we={})),function(e){e.Name="Name"}(Se||(Se={})),function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.CustomBadge="CustomBadge",e.Planning="Planning",e.Position="Position",e.PositionPlanning="PositionPlanning",e.PositionsVolunteersPlanning="PositionsVolunteersPlanning",e.UserCustomDocument="UserCustomDocument",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList",e.UsersPictures="UsersPictures",e.VolunteersListing="VolunteersListing"}(Ee||(Ee={})),function(e){e.Bounced="Bounced",e.Delivered="Delivered",e.Opened="Opened",e.Queued="Queued",e.Sent="Sent",e.Waiting="Waiting"}(Te||(Te={})),function(e){e.DoesNotExist="DoesNotExist",e.NotVerified="NotVerified",e.Verified="Verified"}(ze||(ze={})),function(e){e.Accreditations="Accreditations",e.AccreditationsRefused="AccreditationsRefused",e.Assignments="Assignments",e.Campaign="Campaign",e.Code="Code",e.DelegationCategoryLeaderAssign="DelegationCategoryLeaderAssign",e.DelegationFormInvite="DelegationFormInvite",e.DelegationLeaderAssign="DelegationLeaderAssign",e.DelegationsImport="DelegationsImport",e.Documents="Documents",e.EventInvite="EventInvite",e.EventsImport="EventsImport",e.Export="Export",e.FilesImport="FilesImport",e.FormInvite="FormInvite",e.FormSubmit="FormSubmit",e.MembersImport="MembersImport",e.NewMember="NewMember",e.NotifyLeaders="NotifyLeaders",e.OrganizationInvite="OrganizationInvite",e.PositionCategoryLeaderAssign="PositionCategoryLeaderAssign",e.PositionLeaderAssign="PositionLeaderAssign",e.PositionsImport="PositionsImport",e.Refused="Refused",e.VolunteerRegistration="VolunteerRegistration"}(Oe||(Oe={})),function(e){e.EndAt="EndAt",e.Name="Name",e.StartAt="StartAt",e.Tag="Tag"}(Re||(Re={})),function(e){e.Done="Done",e.Waiting="Waiting"}($e||($e={})),function(e){e.CreatedAt="CreatedAt",e.EndAt="EndAt",e.Id="Id",e.Name="Name",e.StartAt="StartAt"}(De||(De={})),(Gt=Pe||(Pe={})).Archived="Archived",Gt.Done="Done",Gt.Ongoing="Ongoing",Gt.Upcoming="Upcoming",function(e){e.Excel="Excel",e.Csv="CSV"}(Fe||(Fe={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Me||(Me={})),function(e){e.Accreditation="Accreditation",e.Api="Api",e.Beta="Beta",e.Community="Community",e.CustomDocument="CustomDocument",e.Delegation="Delegation",e.Documents="Documents",e.Eid="Eid",e.KmlImport="KmlImport",e.Languages="Languages",e.Multiform="Multiform",e.Skidata="Skidata",e.Sms="Sms",e.Weezevent="Weezevent",e.Zapier="Zapier"}(Ne||(Ne={})),function(e){e.City="city",e.Country="country",e.Custom="custom",e.DateOfBirth="dateOfBirth",e.Eid="eid",e.FirstName="firstName",e.Language="language",e.LastName="lastName",e.Nationality="nationality",e.Phone="phone",e.Picture="picture",e.Population="population",e.PostalCode="postalCode",e.Sex="sex",e.Street="street"}(Le||(Le={})),function(e){e.Freeform="Freeform",e.Iban="Iban",e.Avs="Avs",e.Eid="Eid"}(Be||(Be={})),(Wt=Ve||(Ve={})).Address="Address",Wt.Checkbox="Checkbox",Wt.Country="Country",Wt.Date="Date",Wt.Datetime="Datetime",Wt.File="File",Wt.Language="Language",Wt.Nationality="Nationality",Wt.Number="Number",Wt.Phone="Phone",Wt.Select="Select",Wt.Sex="Sex",Wt.Text="Text",Wt.Textarea="Textarea",Wt.Time="Time",Wt.Validation="Validation",function(e){e.Done="Done",e.Waiting="Waiting"}(Ue||(Ue={})),function(e){e.Address="Address",e.Campaign="Campaign",e.Checkbox="Checkbox",e.Country="Country",e.Date="Date",e.DateTimeRange="DateTimeRange",e.Datetime="Datetime",e.File="File",e.Language="Language",e.Nationality="Nationality",e.Number="Number",e.Phone="Phone",e.Select="Select",e.Sex="Sex",e.Text="Text",e.Textarea="Textarea",e.Time="Time",e.Validation="Validation"}(We||(We={})),function(e){e.Field="Field",e.Section="Section",e.Text="Text"}(Ge||(Ge={})),function(e){e.Ranked="Ranked",e.Unranked="Unranked"}(He||(He={})),function(e){e.Admin="Admin",e.DelegationsSpace="DelegationsSpace",e.Form="Form"}(qe||(qe={})),function(e){e.CloseWhenEventDone="CloseWhenEventDone",e.Closed="Closed",e.ClosedAt="ClosedAt",e.Open="Open"}(Ye||(Ye={})),function(e){e.Backpack="Backpack",e.BadgeCheck="BadgeCheck",e.BagShopping="BagShopping",e.Bed="Bed",e.BriefcaseMedical="BriefcaseMedical",e.BurgerSoda="BurgerSoda",e.CakeCandles="CakeCandles",e.Camera="Camera",e.Car="Car",e.CircleParking="CircleParking",e.CircleQuestion="CircleQuestion",e.Droplet="Droplet",e.ForkKnife="ForkKnife",e.HatCowboy="HatCowboy",e.House="House",e.LocationDot="LocationDot",e.MartiniGlass="MartiniGlass",e.Megaphone="Megaphone",e.PersonBiking="PersonBiking",e.PersonHiking="PersonHiking",e.ScrewdriverWrench="ScrewdriverWrench",e.Shirt="Shirt",e.SignsPost="SignsPost",e.Star="Star",e.Ticket="Ticket",e.UserPolice="UserPolice"}(Ke||(Ke={})),function(e){e.Create="Create",e.Upsert="Upsert",e.Update="Update"}(Ze||(Ze={})),function(e){e.Overdue="Overdue",e.Paid="Paid",e.Refunded="Refunded",e.Waiting="Waiting"}(Xe||(Xe={})),function(e){e.Mandarin="Mandarin",e.Spanish="Spanish",e.English="English",e.Hindi="Hindi",e.Bengali="Bengali",e.Portuguese="Portuguese",e.Russian="Russian",e.Japanese="Japanese",e.Punjabi="Punjabi",e.Turkish="Turkish",e.Korean="Korean",e.French="French",e.German="German",e.Vietnamese="Vietnamese",e.Tamil="Tamil",e.Urdu="Urdu",e.Javanese="Javanese",e.Italian="Italian",e.Persian="Persian",e.Polish="Polish",e.Ukrainian="Ukrainian",e.Romanian="Romanian",e.Dutch="Dutch"}(Je||(Je={})),function(e){e.App="App",e.DelegationsSpace="DelegationsSpace",e.MembersSpace="MembersSpace",e.VolunteerAssignments="VolunteerAssignments",e.VolunteerRegister="VolunteerRegister"}(Qe||(Qe={})),function(e){e.Google="Google",e.GoogleSatellite="GoogleSatellite",e.IgnPlan="IgnPlan"}(et||(et={})),function(e){e.Add="Add",e.Delete="Delete",e.Replace="Replace"}(tt||(tt={})),function(e){e.Categories="Categories",e.Positions="Positions"}(nt||(nt={})),function(e){e.Both="Both",e.Event="Event",e.Organization="Organization"}(it||(it={})),function(e){e.Id="Id",e.InsertedAt="InsertedAt",e.PeriodEndAt="PeriodEndAt",e.WeezeventOrganizationId="WeezeventOrganizationId"}(st||(st={})),function(e){e.A4Portrait="A4Portrait",e.A4Landscape="A4Landscape",e.A5Portrait="A5Portrait",e.A6Portrait="A6Portrait"}(ot||(ot={})),function(e){e.Acronym="Acronym",e.Address="Address",e.Category="Category",e.Color="Color",e.Description="Description",e.Icon="Icon",e.Latitude="Latitude",e.Longitude="Longitude",e.Name="Name",e.Tag="Tag",e.Traces="Traces"}(rt||(rt={})),function(e){e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name"}(at||(at={})),function(e){e.Done="Done",e.Waiting="Waiting"}(lt||(lt={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Position="Position",e.Range="Range"}(dt||(dt={})),function(e){e.Acronym="Acronym",e.Category="Category",e.CreatedAt="CreatedAt",e.Id="Id",e.Name="Name",e.Slot="Slot"}(ct||(ct={})),function(e){e.Empty="Empty",e.Partial="Partial",e.Full="Full"}(ut||(ut={})),function(e){e.Between="between",e.Contains="contains",e.EndsWith="endsWith",e.EngulfedBy="engulfedBy",e.Engulfs="engulfs",e.GreaterThan="greaterThan",e.GreaterThanEqual="greaterThanEqual",e.Is="is",e.IsAfter="isAfter",e.IsBefore="isBefore",e.IsEmpty="isEmpty",e.IsNot="isNot",e.IsNotEmpty="isNotEmpty",e.IsNotValid="isNotValid",e.IsValid="isValid",e.LessThan="lessThan",e.LessThanEqual="lessThanEqual",e.NotContains="notContains",e.NotEngulfedBy="notEngulfedBy",e.NotEngulfs="notEngulfs",e.NotOverlaps="notOverlaps",e.Overlaps="overlaps",e.StartsWith="startsWith",e.ThisDayMonth="thisDayMonth",e.Today="today"}(ht||(ht={})),function(e){e.Accreditation="Accreditation",e.None="None"}(mt||(mt={})),function(e){e.AllDays="AllDays",e.DaysWithSlots="DaysWithSlots"}(gt||(gt={})),function(e){e.Category="Category",e.Position="Position",e.Slot="Slot",e.None="None"}(pt||(pt={})),function(e){e.FilterWithSlots="FilterWithSlots",e.None="None"}(ft||(ft={})),(Ut=xt||(xt={})).Calendar="Calendar",Ut.Custom="Custom",Ut.Display="Display",Ut.DisplayDays="DisplayDays",Ut.Hide="Hide",function(e){e.DelegationCategory="DelegationCategory",e.Event="Event",e.Organization="Organization",e.Position="Position"}(_t||(_t={})),function(e){e.Custom="Custom",e.DelegationCategoryLeader="DelegationCategoryLeader",e.EventAdmin="EventAdmin",e.EventReader="EventReader",e.OrganizationAdmin="OrganizationAdmin",e.OrganizationReader="OrganizationReader",e.PositionEditor="PositionEditor",e.PositionReader="PositionReader"}(It||(It={})),function(e){e.Accreditations="Accreditations",e.Campaigns="Campaigns",e.CustomFields="CustomFields",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.Volunteers="Volunteers"}(vt||(vt={})),function(e){e.Female="Female",e.Male="Male",e.Nonbinary="Nonbinary",e.Notsay="Notsay",e.Other="Other"}(bt||(bt={})),function(e){e.Asc="Asc",e.Desc="Desc"}(jt||(jt={})),function(e){e.DelegationSpace="DelegationSpace",e.EventsShowcase="EventsShowcase",e.MembersSpace="MembersSpace"}(Ct||(Ct={})),function(e){e.De="De",e.En="En",e.Es="Es",e.Fr="Fr",e.Keys="Keys",e.Nl="Nl"}(yt||(yt={})),function(e){e.Accreditations="Accreditations",e.Delegations="Delegations",e.Events="Events",e.Positions="Positions",e.UsersInfos="UsersInfos"}(kt||(kt={})),function(e){e.WithReplies="WithReplies",e.WithUnreadReplies="WithUnreadReplies",e.WithoutReplies="WithoutReplies"}(At||(At={})),function(e){e.Delivered="Delivered",e.InvalidNumber="InvalidNumber",e.Other="Other",e.Refused="Refused",e.Sent="Sent",e.Undelivered="Undelivered",e.Waiting="Waiting"}(wt||(wt={})),function(e){e.None="None",e.Backward="Backward",e.Forward="Forward"}(St||(St={})),function(e){e.Accreditation="Accreditation",e.CustomField="CustomField",e.CustomSlot="CustomSlot",e.Delegation="Delegation",e.Document="Document",e.Email="Email",e.Event="Event",e.Form="Form",e.Other="Other",e.Position="Position"}(Et||(Et={})),function(e){e.NotTranslated="NotTranslated",e.Translated="Translated",e.TranslatedAndNotTranslated="TranslatedAndNotTranslated"}(Tt||(Tt={})),function(e){e.String="String",e.StringArray="StringArray",e.RichText="RichText"}(zt||(zt={})),function(e){e.Admin="Admin",e.Leader="Leader"}(Ot||(Ot={})),function(e){e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.Name="Name",e.UpdatedAt="UpdatedAt"}(Rt||(Rt={})),function(e){e.Assigned="Assigned",e.NotApplicable="NotApplicable",e.PreAssigned="PreAssigned",e.Refused="Refused",e.WaitingAssignment="WaitingAssignment"}($t||($t={})),function(e){e.Done="Done",e.Waiting="Waiting"}(Dt||(Dt={})),function(e){e.AccreditationState="AccreditationState",e.Delegation="Delegation",e.FirstName="FirstName",e.Id="Id",e.InsertedAt="InsertedAt",e.LastName="LastName",e.LocalId="LocalId",e.Name="Name",e.State="State",e.TeamCode="TeamCode",e.UpdatedAt="UpdatedAt"}(Pt||(Pt={})),function(e){e.AddAccreditations="AddAccreditations",e.AddEvent="AddEvent",e.CreateDelegation="CreateDelegation",e.DeleteAccreditations="DeleteAccreditations",e.SendCampaign="SendCampaign",e.SetCustomField="SetCustomField",e.DuplicateMember="DuplicateMember"}(Ft||(Ft={})),function(e){e.EveryMinute="EveryMinute",e.Every2Minutes="Every2Minutes",e.Every5Minutes="Every5Minutes",e.Every10Minutes="Every10Minutes"}(Mt||(Mt={})),function(e){e.DelegationsLeaders="DelegationsLeaders",e.PositionsLeaders="PositionsLeaders",e.UsersInfosIds="UsersInfosIds",e.View="View"}(Nt||(Nt={})),function(e){e.CreatedAt="CreatedAt",e.ExecutedAt="ExecutedAt",e.Id="Id",e.Name="Name",e.VolunteersSegment="VolunteersSegment"}(Lt||(Lt={})),function(e){e.Active="Active",e.Error="Error",e.Paused="Paused"}(Bt||(Bt={})),function(e){e.Assigned="Assigned",e.FormSubmit="FormSubmit",e.VolunteersSegment="VolunteersSegment"}(Vt||(Vt={})),Object.keys(ne);const Yt=Object.keys(ie),Kt=Object.keys(se),Zt=(Object.keys(oe),Object.keys(re),Object.keys(ae),Object.keys(le)),Xt=(Object.keys(de),Object.keys(ce),Object.keys(ue)),Jt=Object.keys(he),Qt=Object.keys(me),en=(Object.keys(ge),Object.keys(pe),Object.keys(fe)),tn=(Object.keys(xe),Object.keys(_e)),nn=(Object.keys(Ie),Object.keys(ve)),sn=Object.keys(be),on=(Object.keys(je),Object.keys(Ce),Object.keys(ye),Object.keys(ke)),rn=(Object.keys(Ae),Object.keys(we)),an=(Object.keys(Se),Object.keys(Ee),Object.keys(Te)),ln=(Object.keys(ze),Object.keys(Oe)),dn=(Object.keys(Re),Object.keys($e),Object.keys(De),Object.keys(Pe)),cn=(Object.keys(Fe),Object.keys(Me),Object.keys(Ne)),un=(Object.keys(Le),Object.keys(Be)),hn=Object.keys(Ve),mn=(Object.keys(Ue),Object.keys(We),Object.keys(Ge),Object.keys(He)),gn=(Object.keys(qe),Object.keys(Ye)),pn=Object.keys(Ke),fn=Object.keys(Ze),xn=Object.keys(Xe),_n=Object.keys(Je),In=(Object.keys(Qe),Object.keys(et)),vn=Object.keys(tt),bn=Object.keys(nt),jn=(Object.keys(it),Object.keys(st),Object.keys(ot),Object.keys(rt)),Cn=(Object.keys(at),Object.keys(lt),Object.keys(dt),Object.keys(ct),Object.keys(ut)),yn=(Object.keys(ht),Object.keys(mt)),kn=Object.keys(gt),An=Object.keys(pt),wn=Object.keys(ft),Sn=Object.keys(xt),En=Object.keys(_t),Tn=(Object.keys(It),Object.keys(vt),Object.keys(bt)),zn=(Object.keys(jt),Object.keys(Ct),Object.keys(yt),Object.keys(kt),Object.keys(At)),On=Object.keys(wt),Rn=(Object.keys(St),Object.keys(Et)),$n=Object.keys(Tt),Dn=(Object.keys(zt),Object.keys(Ot),Object.keys(Rt),Object.keys($t)),Pn=(Object.keys(Dt),Object.keys(Pt),Object.keys(Ft)),Fn=(Object.keys(Mt),Object.keys(Nt)),Mn=(Object.keys(Lt),Object.keys(Bt)),Nn=Object.keys(Vt),Ln=["insertedAt","updatedAt","checkInAt","date","sentAt","scheduledAt","deletedAt","lockedAt","bouncedAt","complaintAt","deliveredAt","rejectedAt","openedAt","clickedAt","queuedAt","closedAt","periodEndAt","checkOutAt","validatedAt","receptionDate","termsAcceptedAt","lastSeenAt","registrationDate","weezeventPairedAt","executedAt"],Bn=["date","calendarInviteStartDate","calendarInviteEndDate","startDate","endDate","deadlineDate","minAccreditationSlotDate","startAt","endAt","paidAt"],Vn=["range","ranges"],Un=["assignedDuration","duration"];let Wn=class{language;translations;constructor(e,t){this.language=e,this.translations=t}translate(e,...t){if("production"!==a.Test||process.env.JEST_WORKER_ID){let n=this.translations[e]||e;const i=this.translations[`${e}_plural`];return i&&"number"==typeof t[0]&&t[0]>1&&(n=i),Array.isArray(t)&&t.length>0&&(n=t.reduce((e,t,n)=>e.replaceAll(`{${n+1}}`,t),n)),n}return`${e} - ${JSON.stringify(t)}`}*interpolateWithComponents(e,...t){let n=0;for(const[s,o]of e.split(/{\d+}/).entries())n>0&&(yield(0,i.jsx)(L.Fragment,{children:t[s-1]},n)),n++,yield o}formatListValues(e,t="disjunction"){return new Intl.ListFormat(this.language.toLowerCase(),{style:"long",type:t}).format(e)}};Wn=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[String,Object])],Wn);const Gn=(0,L.createContext)({}),Hn=Gn.Consumer;function qn(e){return(0,L.useContext)(Gn).container.get(e)}function Yn(){const e=(0,L.useContext)(Gn).container.get(Wn);return e.translate.bind(e)}function Kn(){const e=(0,L.useContext)(Gn).container.get(Wn);return e.interpolateWithComponents.bind(e)}function Zn(e,t,n=[]){const i="production"!==a.Test?e:e.loc.source.body;return(0,L.useContext)(Gn).useQuery(i,t,n)}function Xn(e,t={}){return(0,L.useContext)(Gn).useMutation(e,t)}function Jn(){return(0,L.useContext)(Gn).useParams()}function Qn(){return(0,L.useContext)(Gn).useHistory()}function ei(){return(0,L.useContext)(Gn).useLocation()}function ti(){return(0,L.useContext)(Gn).useLocalStorage()}const ni=e=>{const t=Jn(),n=Qn();return(0,L.useEffect)(()=>{m(e.path)&&(e.replace?n.replace(e.path,e.state):n.push(e.path,e.state)),e.push&&n.push(e.push(t),e.state),e.onLoad&&e.onLoad()},[]),(0,i.jsx)("div",{})},ii=(0,L.createContext)({user:null});function si(){return(0,L.useContext)(ii)}const oi=e=>{const t=Jn(),{user:n}=si();return n&&e.shouldHaveUser||!n&&!e.shouldHaveUser?(0,i.jsx)(i.Fragment,{children:e.children}):(0,i.jsx)(ni,{path:e.getRedirectPath(t),replace:!0})};function ri(...e){console.log(...e)}const ai=e=>e.join("/"),li=P.HEAVENT_APPLICATION_BASENAME,di={FIELDS:{PLURAL:"fields",SINGLE:"field"}},ci={AUTH:"auth",EDIT:"edit",CREATE:"create",EXPORT:"export",EXPORT_BASIC:"export/basic",EXPORT_API:"export/api",IMPORT:"import",INVITE:"invite"},ui={INFORMATION:"information",DASHBOARD:"dashboard",REGISTRATION:"registration",DOCUMENTS:"documents",PROFILE:"profile",REPORTING:"reporting",FORMS:"forms",FORM:"form",MEMBER:"member",MEMBERS:"members",PREVIEW:"preview"},hi=e=>ai([e,ci.AUTH]),mi=e=>ai([e,ci.CREATE]),gi=e=>ai([e,ci.EDIT]),pi={PLURAL:"/organizations",SINGLE:"/organization"},fi="delegations",xi={_BASE:"parameters",COMMON:{DESIGN:"design",INTEGRATION:"integration",EMAIL_TEMPLATES:"emails",SETTINGS:"settings"},EVENTS_SHOWCASE:{_BASE:"events-showcase"},MEMBERS_SPACE:{_BASE:"members-space"},DELEGATION_SPACE:{_BASE:"delegation-space"}},_i="blocked",Ii="expired",vi={ORGANIZATIONS:pi.PLURAL,ORGANIZATION:e=>ai([pi.SINGLE,e])},bi={ORGANIZATIONS:vi.ORGANIZATIONS,ORGANIZATION:({organizationId:e})=>vi.ORGANIZATION(e),ORGANIZATION_SETTINGS:e=>ai([bi.ORGANIZATION(e),xi._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE:e=>ai([bi.ORGANIZATION_SETTINGS(e),xi.EVENTS_SHOWCASE._BASE]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN:e=>ai([bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),xi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION:e=>ai([bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),xi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS:e=>ai([bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE(e),xi.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_MEMBERS_SPACE:e=>ai([bi.ORGANIZATION_SETTINGS(e),xi.MEMBERS_SPACE._BASE]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN:e=>ai([bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),xi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION:e=>ai([bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),xi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES:e=>ai([bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),xi.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS:e=>ai([bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE(e),xi.COMMON.SETTINGS]),ORGANIZATION_SETTINGS_DELEGATION_SPACE:e=>ai([bi.ORGANIZATION_SETTINGS(e),xi.DELEGATION_SPACE._BASE]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN:e=>ai([bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),xi.COMMON.DESIGN]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION:e=>ai([bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),xi.COMMON.INTEGRATION]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES:e=>ai([bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),xi.COMMON.EMAIL_TEMPLATES]),ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS:e=>ai([bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE(e),xi.COMMON.SETTINGS]),ORGANIZATION_DELEGATIONS:e=>ai([bi.ORGANIZATION(e),fi]),IS_BLOCKED:e=>ai([e,_i]),IS_EXPIRED:e=>ai([e,Ii]),ORGANIZATION_FORM:e=>Ni.FORM(e)},ji="dashboard",Ci="users",yi={COMMUNITY:e=>ai([bi.ORGANIZATION(e),"community"]),COMMUNITY_DASHBOARD:e=>ai([yi.COMMUNITY(e),ji]),COMMUNITY_USERS:e=>ai([yi.COMMUNITY(e),Ci])},ki={PLURAL:"forms",SINGLE:"form"},Ai="elements",wi="emails",Si="integration",Ei="parameters",Ti="preview",zi="general",Oi="design",Ri="availabilities",$i="missions",Di="accreditations",Pi="broadcast",Fi="state",Mi={FORMS:ki.PLURAL,FORM:e=>ai([ki.SINGLE,e])},Ni={FORMS:({eventId:e,...t})=>ai([e?Ui.EVENT({...t,eventId:e}):yi.COMMUNITY(t),Mi.FORMS]),FORM:({formId:e,...t})=>ai(["eventId"in t&&t.eventId?Ui.EVENT(t):yi.COMMUNITY(t),Mi.FORM(e)]),CREATE:e=>mi(Ni.FORMS(e)),FORM_ELEMENTS:e=>ai([Ni.FORM(e),Ai]),FORM_INTEGRATION:e=>ai([Ni.FORM(e),Si]),FORM_EMAILS:e=>ai([Ni.FORM(e),wi]),FORM_PREVIEW:e=>ai([Ni.FORM(e),Ti]),FORM_PARAMETERS:e=>ai([Ni.FORM(e),Ei]),FORM_PARAMETERS_GENERAL:e=>ai([Ni.FORM_PARAMETERS(e),zi]),FORM_PARAMETERS_DESIGN:e=>ai([Ni.FORM_PARAMETERS(e),Oi]),FORM_PARAMETERS_AVAILABILITIES:e=>ai([Ni.FORM_PARAMETERS(e),Ri]),FORM_PARAMETERS_MISSIONS:e=>ai([Ni.FORM_PARAMETERS(e),$i]),FORM_PARAMETERS_ACCREDITATIONS:e=>ai([Ni.FORM_PARAMETERS(e),Di]),FORM_PARAMETERS_BROADCAST:e=>ai([Ni.FORM_PARAMETERS(e),Pi]),FORM_PARAMETERS_STATE:e=>ai([Ni.FORM_PARAMETERS(e),Fi])},Li={PLURAL:"events",SINGLE:"event"},Bi={PLURAL:"teams",SINGLE:"team"},Vi={EVENTS:Li.PLURAL,EVENT:e=>ai([Li.SINGLE,e]),TEAM:e=>ai([Bi.SINGLE,e])},Ui={EVENTS_IMPORT:e=>ai([bi.ORGANIZATION(e),Vi.EVENTS,ci.IMPORT]),EVENTS:e=>ai([bi.ORGANIZATION(e),Vi.EVENTS]),EVENT:({eventId:e,...t})=>ai([bi.ORGANIZATION(t),Vi.EVENT(e)]),EVENT_FORM:e=>ai([Ni.FORM(e)]),EVENT_TEAM_FORM:({teamCode:e,...t})=>ai([Ui.EVENT_FORM(t),Vi.TEAM(e)])},Wi={PLURAL:"accreditation-categories",SINGLE:"accreditation-category"},Gi={PLURAL:"accreditations",SINGLE:"accreditation"},Hi={PLURAL:"slots",SINGLE:"slot"},qi="dashboard",Yi="member",Ki="members",Zi={ACCREDITATION_CATEGORIES:Wi.PLURAL,ACCREDITATION_CATEGORY:e=>ai([Wi.SINGLE,e]),ACCREDITATIONS:Gi.PLURAL,ACCREDITATION:e=>ai([Gi.SINGLE,e]),ACCREDITATION_SLOTS:Hi.PLURAL,ACCREDITATION_SLOT:e=>ai([Hi.SINGLE,e])},Xi={ACCREDITATION_CATEGORY:({accreditationCategoryId:e,...t})=>ai([Ui.EVENT(t),Zi.ACCREDITATION_CATEGORY(e)]),ACCREDITATION_CATEGORY_DASHBOARD:e=>ai([Xi.ACCREDITATION_CATEGORY(e),qi]),ACCREDITATION_CATEGORY_MEMBERS:e=>ai([Xi.ACCREDITATION_CATEGORY(e),Ki])},Ji={ACCREDITATIONS:e=>ai([Ui.EVENT(e),Zi.ACCREDITATIONS]),ACCREDITATION:({accreditationId:e,...t})=>ai([Ui.EVENT(t),Zi.ACCREDITATION(e)]),ACCREDITATION_DASHBOARD:e=>ai([Ji.ACCREDITATION(e),qi]),ACCREDITATION_MEMBERS:e=>ai([Ji.ACCREDITATION(e),Ki]),ACCREDITATION_MEMBER:({userInfoId:e,...t})=>ai([Ji.ACCREDITATION_MEMBERS(t),Yi,e]),ACCREDITATION_MEMBER_INFORMATION:e=>ai([Ji.ACCREDITATION_MEMBER(e),ui.INFORMATION])},Qi={ACCREDITATION_SLOT:({accreditationSlotId:e,...t})=>ai([es.ACCREDITATION(t),Zi.ACCREDITATION_SLOT(e)]),ACCREDITATION_SLOT_DASHBOARD:e=>ai([Qi.ACCREDITATION_SLOT(e),qi]),ACCREDITATION_SLOT_MEMBERS:e=>ai([Qi.ACCREDITATION_SLOT(e),Ki])},es={...Xi,...Ji,...Qi},ts={PLURAL:"delegations-categories",SINGLE:"delegation-category"},ns={PLURAL:"delegations",SINGLE:"delegation"},is="accreditations",ss="availabilities",os="positions",rs={DELEGATIONS_CATEGORIES:ts.PLURAL,DELEGATION_CATEGORY:e=>ai([ts.SINGLE,e]),DELEGATIONS:ns.PLURAL,DELEGATION:e=>ai([ns.SINGLE,e])},as={DELEGATION_CATEGORY:({delegationCategoryId:e,...t})=>ai(["eventId"in t&&t.eventId?Ui.EVENT(t):yi.COMMUNITY(t),rs.DELEGATION_CATEGORY(e)]),DELEGATION_CATEGORY_DASHBOARD:e=>ai([as.DELEGATION_CATEGORY(e),ui.DASHBOARD]),DELEGATION_CATEGORY_MEMBERS:e=>ai([as.DELEGATION_CATEGORY(e),ui.MEMBERS])},ls={DELEGATIONS:e=>ai(["eventId"in e&&e.eventId?Ui.EVENT(e):yi.COMMUNITY(e),rs.DELEGATIONS]),DELEGATION:({delegationId:e,...t})=>ai(["eventId"in t&&t.eventId?Ui.EVENT(t):yi.COMMUNITY(t),rs.DELEGATION(e)]),DELEGATION_DASHBOARD:e=>ai([ls.DELEGATION(e),ui.DASHBOARD]),DELEGATION_MEMBERS:e=>ai([ls.DELEGATION(e),ui.MEMBERS]),DELEGATION_ACCREDITATIONS:e=>ai([ls.DELEGATION(e),is]),DELEGATION_REPORTING:e=>ai([ls.DELEGATION(e),ui.REPORTING]),DELEGATION_DOCUMENTS:e=>ai([ls.DELEGATION(e),ui.DOCUMENTS]),DELEGATION_MEMBERS_IMPORT:e=>ai([ls.DELEGATION(e),ci.IMPORT]),DELEGATION_MEMBER:({userInfoId:e,...t})=>ai([ls.DELEGATION_MEMBERS(t),ui.MEMBER,e]),DELEGATION_MEMBER_INFORMATION:e=>ai([ls.DELEGATION_MEMBER(e),ui.INFORMATION]),DELEGATION_MEMBER_ACCREDITATIONS:e=>ai([ls.DELEGATION_MEMBER(e),is]),DELEGATION_MEMBER_AVAILABILITIES:e=>ai([ls.DELEGATION_MEMBER(e),ss]),DELEGATION_MEMBER_POSITIONS:e=>ai([ls.DELEGATION_MEMBER(e),os]),MEMBERS_INVITE:e=>ai([ls.DELEGATION(e),ui.MEMBERS,ci.INVITE]),MEMBER_CREATE:({formId:e,...t})=>mi(ai([ls.DELEGATION(t),ui.MEMBER,ui.FORM,e])),MEMBER_EDIT:({formId:e,...t})=>gi(ai([ls.DELEGATION_MEMBER(t),ui.FORM,e])),DELEGATION_PROFILE:e=>ai([ls.DELEGATION(e),ui.PROFILE]),FIELDS_EDIT:e=>gi(ai([ls.DELEGATION(e),di.FIELDS.PLURAL])),DELEGATION_FORM:({delegationId:e,...t})=>ai([Ni.FORM(t),rs.DELEGATION(e)])},ds={...as,...ls},cs={ITEMS:{POSITIONS_CATEGORIES:{PLURAL:"position-categories",SINGLE:"position-category"},POSITIONS:{PLURAL:"positions",SINGLE:"position"},POSITION_SLOTS:{PLURAL:"slots",SINGLE:"slot"}},ACTIONS:{IMPORT:{CSV:`${ci.IMPORT}/csv`}},SECTIONS:{PREASSIGNED_MEMBERS:"preassigned-members"}},us={POSITION_CATEGORIES:cs.ITEMS.POSITIONS_CATEGORIES.PLURAL,POSITION_CATEGORY:e=>ai([cs.ITEMS.POSITIONS_CATEGORIES.SINGLE,e]),POSITIONS:cs.ITEMS.POSITIONS.PLURAL,POSITION:e=>ai([cs.ITEMS.POSITIONS.SINGLE,e]),POSITION_SLOTS:cs.ITEMS.POSITION_SLOTS.PLURAL,POSITION_SLOT:e=>ai([cs.ITEMS.POSITION_SLOTS.SINGLE,e])},hs={POSITION_CATEGORY:({positionCategoryId:e,...t})=>ai([Ui.EVENT(t),us.POSITION_CATEGORY(e)]),POSITION_CATEGORY_DASHBOARD:e=>ai([hs.POSITION_CATEGORY(e),ui.DASHBOARD]),POSITION_CATEGORY_MEMBERS:e=>ai([hs.POSITION_CATEGORY(e),ui.MEMBERS]),POSITION_CATEGORY_PREASSIGNED_MEMBERS:e=>ai([hs.POSITION_CATEGORY(e),cs.SECTIONS.PREASSIGNED_MEMBERS])},ms={POSITIONS:e=>ai([Ui.EVENT(e),us.POSITIONS]),POSITION:({positionId:e,positionCategoryId:t,...n})=>ai(t?[hs.POSITION_CATEGORY({positionCategoryId:t,...n}),us.POSITION(e)]:[Ui.EVENT(n),us.POSITION(e)]),POSITION_DASHBOARD:e=>ai([ms.POSITION(e),ui.DASHBOARD]),POSITION_MEMBERS:e=>ai([ms.POSITION(e),ui.MEMBERS]),POSITION_PREASSIGNED_MEMBERS:e=>ai([ms.POSITION(e),cs.SECTIONS.PREASSIGNED_MEMBERS]),POSITION_MEMBER:({userInfoId:e,...t})=>ai([ms.POSITION_MEMBERS(t),ui.MEMBER,e]),POSITION_MEMBER_INFORMATION:e=>ai([ms.POSITION_MEMBER(e),ui.INFORMATION]),POSITION_IMPORT_CSV:e=>ai([Ui.EVENT(e),cs.ACTIONS.IMPORT.CSV])},gs={POSITION_SLOTS:e=>ai([ms.POSITION(e),us.POSITION_SLOTS]),POSITION_SLOT:({positionSlotId:e,...t})=>ai([ms.POSITION(t),us.POSITION_SLOT(e)])},ps={...hs,...ms,...gs},fs="/auth",xs=`${fs}/sign-in`,_s=`${fs}/sign-up`,Is="/backoffice",vs=e=>`${bi.ORGANIZATION({organizationId:e})}/parameters`,bs=(e,t,n,i)=>`${ps.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/check-members`,js=(e,t,n,i)=>`${ps.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/members`,Cs=(e,t,n,i,s)=>`${ps.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/assign-volunteers/${s}`,ys=(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/volunteers`,ks=(e,t)=>`${ys(e,t)}/search`,As=(e,t,n)=>`${ks(e,t)}/volunteer/${n}`,ws=(e,t,n)=>`${ys(e,t)}/${n}`,Ss=(e,t,n,i)=>`${ws(e,t,n)}/volunteer/${i}`,Es=(e,t,n,i)=>`${ws(e,t,n)}/volunteer-panel/${i}`,Ts=(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/emails`,zs=(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/documents`,Os=(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/options`,Rs=(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/dashboard`,$s={HOME:`/${li}`,UNSUBSCRIBE_EMAIL:"/unsubscribe-email",USER_UPDATE_BY_TICKET_ID:(e,t)=>`/organization/${e}/update-by-ticket-id/field/${t}`,USER_FIELD_UPDATE:(e,t,n,i)=>`/organization/${e}/user/${t}/field/${n}/update/${i}`,USER_CHECK_IN:(e,t)=>`/organization/${e}/user/${t}/check-in`,USER_CHECK_OUT:(e,t)=>`/organization/${e}/user/${t}/check-out`,AUTH:fs,AUTH_FORGOT_PASSWORD:`${fs}/forgot-password`,AUTH_SIGN_IN:xs,AUTH_SIGN_UP:_s,AUTH_SIGN_IN_EMAIL:`${xs}/email`,AUTH_SIGN_IN_CODE:`${xs}/code`,AUTH_SIGN_UP_CREDENTIALS:`${_s}/credentials`,AUTH_SIGN_UP_CODE:`${_s}/code`,COGNITO_CALLBACK:"/cognito-callback",MAGIC_LINK:(e,t)=>`/magic-link/${e}/${t}`,ACCEPT_TERMS_AND_CONDITIONS:e=>`${bi.ORGANIZATION({organizationId:e})}/accept-terms-and-conditions`,BACKOFFICE:Is,BACKOFFICE_ORGANIZATIONS:`${Is}/organizations`,EDIT_BACKOFFICE_ORGANIZATION:e=>`${Is}/organization/${e}/edit`,BACKOFFICE_INVOICES:`${Is}/invoices`,ORGANIZATION_PARAMETERS:vs,ORGANIZATION_PARAMETERS_PROFILE:e=>`${vs(e)}/profile`,ORGANIZATION_PARAMETERS_INFOS:e=>`${vs(e)}/general`,ORGANIZATION_PARAMETERS_TEAM:e=>`${vs(e)}/team`,ORGANIZATION_PARAMETERS_ROLES:e=>`${vs(e)}/roles`,CREATE_ORGANIZATION_PARAMETERS_ROLE:e=>`${vs(e)}/roles/create`,EDIT_ORGANIZATION_PARAMETERS_ROLE:(e,t)=>`${vs(e)}/roles/role/${t}/edit`,ORGANIZATION_PARAMETERS_EMAILS:e=>`${vs(e)}/emails`,CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${vs(e)}/emails/senders/create`,EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS:(e,t)=>`${vs(e)}/emails/senders/${t}/edit`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS:e=>`${vs(e)}/emails/senders`,ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW:(e,t)=>`${vs(e)}/emails/senders/${t}/preview`,ORGANIZATION_PARAMETERS_EMAILS_DNS:e=>`${vs(e)}/emails/dns`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE:e=>`${vs(e)}/delegations-space`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_DESIGN:e=>`${vs(e)}/delegations-space/design`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_INTEGRATION:e=>`${vs(e)}/delegations-space/integration`,ORGANIZATION_PARAMETERS_DELEGATIONS_SPACE_EMAILS:e=>`${vs(e)}/delegations-space/emails`,ORGANIZATION_PARAMETERS_CATEGORIES:e=>`${vs(e)}/categories`,ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS:e=>`${vs(e)}/categories/custom-fields`,ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS:e=>`${vs(e)}/categories/positions`,ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS:e=>`${vs(e)}/categories/accreditations`,ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS:e=>`${vs(e)}/categories/delegations`,ORGANIZATION_PARAMETERS_TAGS:e=>`${vs(e)}/tags`,ORGANIZATION_PARAMETERS_TRANSLATIONS:e=>`${vs(e)}/translations`,ORGANIZATION_PARAMETERS_INVOICES:e=>`${vs(e)}/invoices`,ORGANIZATION_PARAMETERS_ACTIVITY:e=>`${vs(e)}/activity`,ORGANIZATION_PARAMETERS_SKIDATA:e=>`${vs(e)}/skidata`,ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH:e=>`${vs(e)}/organization-switch`,ORGANIZATION_PARAMETERS_DELETE_ACCOUNT:e=>`${vs(e)}/delete-account`,CUSTOM_FIELDS:e=>`${bi.ORGANIZATION({organizationId:e})}/custom-fields`,CUSTOM_FIELDS_SEGMENT:(e,t)=>`${bi.ORGANIZATION({organizationId:e})}/custom-fields/${t}`,CUSTOM_FIELD_USAGE:(e,t,n)=>`${bi.ORGANIZATION({organizationId:e})}/custom-fields/${t}/usage/${n}`,CREATE_CUSTOM_FIELD:(e,t)=>`${bi.ORGANIZATION({organizationId:e})}/custom-fields/${t}/create`,EDIT_CUSTOM_FIELD:(e,t,n)=>`${bi.ORGANIZATION({organizationId:e})}/custom-fields/${t}/edit/${n}`,COMMUNITY_USERS_SEGMENT:(e,t)=>`${bi.ORGANIZATION({organizationId:e})}/community/users/${t}`,COMMUNITY_USERS_USER:(e,t,n)=>`${bi.ORGANIZATION({organizationId:e})}/community/users/${t}/user/${n}`,COMMUNITY_USERS_USER_INFORMATIONS:(e,t,n)=>`${bi.ORGANIZATION({organizationId:e})}/community/users/${t}/user/${n}/${ui.INFORMATION}`,COMMUNITY_USERS_DUPLICATES:e=>`${bi.ORGANIZATION({organizationId:e})}/community/users-duplicates`,COMMUNITY_EDIT_USER:(e,t)=>`${bi.ORGANIZATION({organizationId:e})}/community/user/${t}/edit`,COMMUNITY_EDIT_USER_FORM:(e,t,n)=>`${bi.ORGANIZATION({organizationId:e})}/community/user/${t}/edit/form/${n}`,COMMUNITY_VOLUNTEERS_IMPORT:e=>`${bi.ORGANIZATION({organizationId:e})}/community/import`,COMMUNITY_FILES_IMPORT:e=>`${bi.ORGANIZATION({organizationId:e})}/community/documents-import`,COMMUNITY_DELEGATIONS:e=>`${bi.ORGANIZATION({organizationId:e})}/community/delegations`,COMMUNITY_DELEGATIONS_SEGMENT:(e,t)=>`${bi.ORGANIZATION({organizationId:e})}/community/delegations/${t}`,COMMUNITY_DELEGATION:(e,t)=>`${bi.ORGANIZATION({organizationId:e})}/community/delegation/${t}`,COMMUNITY_CREATE_DELEGATION(e,t){let n=`${bi.ORGANIZATION({organizationId:e})}/community/create-delegation`;return t&&(n=`${n}/${t}`),n},COMMUNITY_EDIT_DELEGATION:(e,t)=>`${bi.ORGANIZATION({organizationId:e})}/community/delegation/${t}/edit`,COMMUNITY_EDIT_USER_DELEGATION:(e,t,n)=>`${bi.ORGANIZATION({organizationId:e})}/community/delegation/${t}user/${n}/edit`,COMMUNITY_EDIT_USER_DELEGATION_FORM:(e,t,n,i)=>`${bi.ORGANIZATION({organizationId:e})}/community/delegation/${t}/user/${n}/edit/form/${i}`,CREATE_EVENT_WITH_ORGANIZATION(e){let t="/create-event";return e&&(t=`${t}/${e}`),t},CREATE_EVENT:e=>`${bi.ORGANIZATION({organizationId:e})}/create-event`,EVENTS_SEGMENT:(e,t)=>`${bi.ORGANIZATION({organizationId:e})}/events/${t}`,EVENT_DELEGATIONS_IMPORT:(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/delegations-import`,EVENT_VOLUNTEERS_IMPORT:(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/members-import`,EVENT_FILES_IMPORT:(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/documents-import`,EDIT_EVENT:(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/edit`,DASHBOARD:Rs,DASHBOARD_EVENT_SWITCH:(e,t)=>`${Rs(e,t)}/event-switch`,POSITION_MEMBERS_USER:(e,t,n,i,s)=>`${ps.POSITION_MEMBERS({organizationId:e,eventId:t,positionCategoryId:n,positionId:i})}/${s}`,POSITION_MEMBERS_USER_INFORMATIONS:(e,t,n,i,s)=>`${ps.POSITION_MEMBERS({organizationId:e,eventId:t,positionCategoryId:n,positionId:i})}/${s}/${ui.INFORMATION}`,EXPORT_POSITIONS_MAP:(e,t)=>`/export/event/${e}/positions/${t}/map`,POSITIONS_SEARCH:(e,t)=>`${ps.POSITIONS({organizationId:e,eventId:t})}/search`,POSITIONS_SEGMENT:(e,t,n)=>`${ps.POSITIONS({organizationId:e,eventId:t})}/${n}`,CREATE_POSITION(e,t,n){let i=`${Ui.EVENT({organizationId:e,eventId:t})}/create-position`;return n&&(i=`${i}/${n}`),i},POSITION_MAP:(e,t)=>`/position/${e}-${t}/map`,POSITION_SETTINGS:(e,t,n)=>`${ps.POSITION({organizationId:e,eventId:t,positionId:n})}/settings`,EDIT_POSITION:(e,t,n)=>`${ps.POSITION({organizationId:e,eventId:t,positionId:n})}/edit`,POSITION_SLOT_ASSIGN_VOLUNTEERS:(e,t,n,i)=>`${ps.POSITION_SLOT({organizationId:e,eventId:t,positionId:n,positionSlotId:i})}/assign-volunteers`,POSITION_SLOT_ASSIGN_VOLUNTEERS_USER:Cs,POSITION_SLOT_ASSIGN_VOLUNTEERS_USER_INFORMATIONS:(e,t,n,i,s)=>`${Cs(e,t,n,i,s)}/${ui.INFORMATION}`,POSITION_SLOT_MEMBERS:js,POSITION_SLOT_MEMBERS_USER:(e,t,n,i,s)=>`${js(e,t,n,i)}/${s}`,POSITION_SLOT_MEMBERS_USER_INFORMATIONS:(e,t,n,i,s)=>`${js(e,t,n,i)}/${s}/${ui.INFORMATION}`,POSITION_SLOT_MEMBERS_CHECK_OPTIONS:(e,t,n,i)=>`${js(e,t,n,i)}/check-options`,POSITION_SLOT_CHECK_MEMBERS_CHECK_IN:(e,t,n,i)=>`${bs(e,t,n,i)}/check-in`,POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT:(e,t,n,i)=>`${bs(e,t,n,i)}/check-out`,POSITION_SLOT_CHECK_MEMBERS_RESET:(e,t,n,i)=>`${bs(e,t,n,i)}/reset`,VOLUNTEERS:ys,VOLUNTEERS_SEARCH:ks,VOLUNTEERS_SEARCH_USER:As,VOLUNTEERS_SEARCH_USER_INFORMATIONS:(e,t,n)=>`${As(e,t,n)}/${ui.INFORMATION}`,VOLUNTEERS_SEGMENT:(e,t,n)=>`${ys(e,t)}/${n}`,VOLUNTEERS_LIST_USER:Ss,VOLUNTEERS_LIST_USER_INFORMATIONS:(e,t,n,i)=>`${Ss(e,t,n,i)}/${ui.INFORMATION}`,VOLUNTEERS_LIST_USER_PANEL:Es,VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS:(e,t,n,i)=>`${Es(e,t,n,i)}/accreditations`,VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES:(e,t,n,i)=>`${Es(e,t,n,i)}/availabilities`,VOLUNTEERS_LIST_USER_PANEL_POSITIONS:(e,t,n,i)=>`${Es(e,t,n,i)}/positions`,VOLUNTEERS_LIST_USER_PANEL_TEAM:(e,t,n,i,s)=>`${Es(e,t,n,i)}/team/${s}`,EDIT_USER:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/user/${n}/edit`,EDIT_USER_FORM:(e,t,n,i)=>`${Ui.EVENT({organizationId:e,eventId:t})}/user/${n}/edit/form/${i}`,EDIT_USER_MISSIONS:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-missions`,EDIT_USER_MISSIONS_FORM:(e,t,n,i)=>`${Ui.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-missions/form/${i}`,EDIT_USER_SLOTS:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-slots`,EDIT_USER_SLOTS_FORM:(e,t,n,i)=>`${Ui.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-slots/form/${i}`,EDIT_USER_ACCREDITATIONS:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-accreditations`,EDIT_USER_ACCREDITATIONS_FORM:(e,t,n,i)=>`${Ui.EVENT({organizationId:e,eventId:t})}/user/${n}/edit-accreditations/form/${i}`,ASSIGNMENTS:(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/assignments`,ASSIGNMENT:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/assignment/${n}`,EDIT_ASSIGNMENT:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/edit-assignment/${n}`,TEAM_ASSIGNMENT:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/team-assignment/${n}`,PRE_ASSIGNMENT:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/pre-assignment/${n}`,ACCREDITATIONS_ASSIGNMENTS:(e,t)=>`${Ui.EVENT({organizationId:e,eventId:t})}/accreditations-assignments`,ACCREDIT:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/accredit/${n}`,EDIT_ACCREDIT:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/edit-accredit/${n}`,EVENT_EMAILS:Ts,EVENT_EMAILS_PARAMETERS:(e,t)=>`${Ts(e,t)}/parameters`,EDIT_CUSTOM_DOCUMENT:(e,t,n)=>`${Ui.EVENT({organizationId:e,eventId:t})}/custom-document/${n}/edit`,DOCUMENTS:zs,DOCUMENTS_USER_PLANNING:(e,t,n)=>`${zs(e,t)}/user-planning/${n}`,DOCUMENTS_USER_PLANNING_LIST:(e,t,n)=>`${zs(e,t)}/user-planning-list/${n}`,DOCUMENTS_USER_PLANNING_DAYS:(e,t,n)=>`${zs(e,t)}/user-planning-days/${n}`,DOCUMENTS_ASSIGNMENTS:(e,t,n)=>`${zs(e,t)}/assignments/${n}`,DOCUMENTS_VOLUNTEERS_LISTING:(e,t,n)=>`${zs(e,t)}/volunteers-listing/${n}`,DOCUMENTS_BADGE:(e,t,n,i)=>`${zs(e,t)}/user/${n}/badge/${i}`,DOCUMENTS_CERTIFICATE:(e,t,n)=>`${zs(e,t)}/user/${n}/certificate`,DOCUMENTS_HOURS:(e,t,n)=>`${zs(e,t)}/user/${n}/hours`,DOCUMENTS_POSITION_PLANNING:(e,t,n)=>`${zs(e,t)}/position-planning/${n}`,DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING:(e,t,n)=>`${zs(e,t)}/positions-volunteers-planning/${n}`,DOCUMENTS_POSITION:(e,t,n)=>`${zs(e,t)}/position/${n}`,DOCUMENTS_PLANNING:(e,t,n)=>`${zs(e,t)}/planning/${n}`,DOCUMENTS_USER_CUSTOM_DOCUMENT:(e,t,n,i)=>`${zs(e,t)}/user/${n}/custom-document/${i}`,DOCUMENTS_USERS_PICTURES:(e,t,n)=>`${zs(e,t)}/users-pictures/${n}`,OPTIONS:Os,OPTIONS_API:(e,t)=>`${Os(e,t)}/api`,OPTIONS_WEEZEVENT_V2:(e,t)=>`${Os(e,t)}/weezevent-v2`,ACCREDITATIONS_SEGMENT:(e,t,n)=>`${es.ACCREDITATIONS({organizationId:e,eventId:t})}/${n}`,CREATE_ACCREDITATION(e,t,n){let i=`${Ui.EVENT({organizationId:e,eventId:t})}/create-accreditation`;return n&&(i=`${i}/${n}`),i},EDIT_ACCREDITATION:(e,t,n)=>`${es.ACCREDITATION({organizationId:e,eventId:t,accreditationId:n})}/edit`,ACCREDITATION_MAP:(e,t)=>`/accreditation/${e}-${t}/map`,DELEGATIONS_SEGMENT:(e,t,n)=>`${ds.DELEGATIONS({organizationId:e,eventId:t})}/${n}`,CREATE_DELEGATION(e,t,n){let i=`${Ui.EVENT({organizationId:e,eventId:t})}/create-delegation`;return n&&(i=`${i}/${n}`),i},EDIT_DELEGATION:(e,t,n)=>`${ds.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/edit`,EDIT_USER_DELEGATION:(e,t,n,i)=>`${ds.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/user/${i}/edit`,EDIT_USER_DELEGATION_FORM:(e,t,n,i,s)=>`${ds.DELEGATION({organizationId:e,eventId:t,delegationId:n})}/user/${i}/edit/form/${s}`},Ds=(e,t)=>`/volunteers/${e}-${t}`,Ps=(e,t)=>`${Ds(e,t)}/assignments`,Fs=(e,t)=>`${Ds(e,t)}/register`,Ms=Ps;var Ns=n(1343);const Ls={AccreditationChartFragment:{code:"fragment AccreditationChart on Accreditation {\n id\n name\n hasSlots\n willAutoAccredit\n\n slots(includeHidden: true) {\n date\n name\n assignedResources\n delegationsTotalResources\n maxResources\n scannedResources\n wishedResources\n }\n}\n",fragments:[]},AccreditationEmailFragment:{code:"fragment AccreditationEmail on AccreditationsUsersInfo {\n accreditationCategory {\n name\n }\n\n accreditation {\n id\n eventId\n name\n description\n address\n latitude\n longitude\n }\n\n accreditationSlot {\n name\n date\n }\n}\n",fragments:[]},AccreditationImportFragment:{code:"fragment AccreditationImport on Accreditation {\n id\n name\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n}\n",fragments:[]},AccreditationSlotMatrixFragment:{code:"fragment AccreditationSlotMatrix on AccreditationsSlot {\n id\n name\n date\n\n accreditation {\n id\n acronym\n color\n name\n index\n }\n\n accreditationCategory {\n name\n }\n}\n",fragments:[]},AccreditationSlotVolunteerRegistrationFragment:{code:"fragment AccreditationSlotVolunteerRegistration on AccreditationsSlot {\n id\n accreditationId\n name\n date\n isBlocked\n\n accreditation {\n id\n accreditationCategoryId\n acronym\n name\n color\n icon\n hiddenSlotId\n hasSlots\n index\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AccreditationsAccreditationFragment:{code:"fragment AccreditationsAccreditation on Accreditation {\n id\n name\n address\n latitude\n longitude\n acronym\n icon\n color\n fillingRate\n maxResources\n assignedResources\n willAutoAccredit\n weezeventIsSynchronized\n fields\n index\n insertedAt\n\n accreditationCategory {\n id\n name\n }\n\n accreditationsCustomFields @include(if: $includeConditions) {\n ...AccreditationsAccreditationCustomField\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n",fragments:["AccreditationsAccreditationCustomFieldFragment"]},AccreditationsAccreditationCustomFieldFragment:{code:"fragment AccreditationsAccreditationCustomField on AccreditationsCustomField {\n conditionValue\n\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n}\n",fragments:[]},AccreditationsAccreditationSlotFragment:{code:"fragment AccreditationsAccreditationSlot on AccreditationsSlot {\n id\n name\n date\n maxResources\n assignedResources\n fillingRate\n isHidden\n insertedAt\n weezeventChecklistId\n\n accreditation {\n id\n name\n address\n latitude\n longitude\n acronym\n icon\n color\n fields\n\n accreditationsCustomFields @include(if: $includeConditions) {\n ...AccreditationsAccreditationCustomField\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:["AccreditationsAccreditationCustomFieldFragment"]},AccreditationsSlotFragment:{code:"fragment AccreditationsSlot on AccreditationsSlot {\n id\n accreditationCategoryId\n accreditationId\n eventId\n name\n date\n assignedResources\n wishedResources\n maxResources\n isBlocked\n\n accreditation {\n id\n accreditationCategoryId\n eventId\n acronym\n name\n color\n icon\n hasSlots\n accreditationDisplay\n hiddenSlotId\n index\n }\n\n accreditationCategory {\n id\n name\n }\n}\n",fragments:[]},AssigmentEmailFragment:{code:"fragment AssigmentEmail on PositionsSlotsUsersInfo {\n id\n\n position {\n id\n eventId\n name\n description\n acronym\n color\n address\n latitude\n longitude\n zoom\n range\n layer\n fields\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n id\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n\n tags {\n name\n }\n }\n\n positionSlot {\n id\n name\n range\n }\n}\n",fragments:["LeaderAssignmentFragment"]},AttachCustomFieldFragment:{code:"fragment AttachCustomField on CustomField {\n ...CustomFieldWithCondition\n\n category {\n id\n name\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},CampaignEditFragment:{code:"fragment CampaignEdit on Campaign {\n name\n state\n campaignType\n sender\n text\n subject\n html\n replyTo\n sendToEveryone\n states\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n tagsIds\n accreditationsCategoriesIds\n accreditationsIds\n accreditationsSlotsIds\n usersInfosIds\n segmentsIds\n scheduledAt\n emailSenderId\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n\n documents {\n acl\n key\n name\n size\n }\n}\n",fragments:[]},CampaignEmailRendererFragment:{code:"fragment CampaignEmailRenderer on Campaign {\n subject\n text\n html\n replyTo\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n\n documents {\n name\n key\n }\n}\n",fragments:[]},CampaignListFragment:{code:"fragment CampaignList on Campaign {\n id\n name\n campaignType\n state\n numberOfRecipients\n cost\n sentAt\n scheduledAt\n\n createdBy {\n nameOrEmail\n }\n}\n",fragments:[]},CampaignUserInfoFragment:{code:'fragment CampaignUserInfo on UsersInfo {\n id\n name\n email\n picture {\n url\n }\n phone: fieldValue(slug: "phone")\n}\n',fragments:[]},CommentFragment:{code:"fragment Comment on Comment {\n id\n content\n insertedAt\n\n event {\n name\n }\n\n writtenBy {\n id\n email\n\n userInfo(organizationId: $organizationId) {\n ...UserInfoNameAndPicture\n nameOrEmail\n }\n }\n}\n",fragments:["UserInfoNameAndPictureFragment"]},ConditionCustomFieldFragment:{code:"fragment ConditionCustomField on CustomField {\n id\n name\n slug\n fieldType\n\n values {\n id\n value\n }\n}\n",fragments:[]},ConditionsCustomFieldsFragment:{code:"fragment ConditionsCustomFields on Organization {\n conditionsCustomFields: customFields(\n variety: UserInfo\n privacy: All\n fieldTypes: [Checkbox, Select]\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...ConditionCustomField\n }\n }\n}\n",fragments:["ConditionCustomFieldFragment"]},CreateAccreditationEventFragment:{code:"fragment CreateAccreditationEvent on Event {\n startAt\n endAt\n layer\n isWeezeventConnected\n\n accreditationsCategories {\n id\n name\n }\n}\n",fragments:[]},CreateCampaignEmailSenderFragment:{code:"fragment CreateCampaignEmailSender on EmailsSender {\n id\n name\n isValidToSendEmail\n}\n",fragments:[]},CreateCustomFieldInfosFragment:{code:"fragment CreateCustomFieldInfos on Organization {\n customFields(\n variety: UserInfo\n privacy: All\n fieldTypes: [Checkbox, Country, Language, Nationality, Select]\n ) {\n nodes {\n id\n name\n label\n fieldProperty\n fieldType\n\n values {\n id\n value\n }\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},CreateDelegationEventFragment:{code:"fragment CreateDelegationEvent on Event {\n startAt\n endAt\n\n campaigns(states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n customDocuments {\n slug\n name\n }\n\n forms {\n nodes {\n ...CreateDelegationForm\n }\n }\n\n ...EventAccreditations\n}\n",fragments:["CreateDelegationFormFragment","EventAccreditationsFragment"]},CreateDelegationFormFragment:{code:"fragment CreateDelegationForm on Form {\n id\n name\n}\n",fragments:[]},CreatePositionEventFragment:{code:"fragment CreatePositionEvent on Event {\n startAt\n endAt\n layer\n latitude\n longitude\n\n positionsCategories(scoped: true) {\n id\n name\n }\n\n traces {\n ...Trace\n }\n}\n",fragments:["TraceFragment"]},CreatePositionTagsFragment:{code:"fragment CreatePositionTags on Organization {\n tags {\n nodes {\n id\n name\n }\n }\n}\n",fragments:[]},CreateUpdateEventInfosFragment:{code:"fragment CreateUpdateEventInfos on Organization {\n name\n weezeventOrganizationId\n\n eventCustomFields: customFields(variety: Event) {\n nodes {\n ...AttachCustomField\n }\n }\n\n emailsSenders {\n id\n name\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n}\n",fragments:["AttachCustomFieldFragment"]},CreateUpdateMemberFormFragment:{code:"fragment CreateUpdateMemberForm on Form {\n id\n name\n description\n daysDisplay\n positionTitle\n positionSubtitle\n slotTitle\n slotSubtitle\n accreditationTitle\n accreditationSubtitle\n informationTitle\n registerButtonText\n\n ...FormMissionsOptions\n ...FormAccreditationsOptions\n\n elements {\n ...FormElementDisplay\n }\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n}\n",fragments:["FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormElementDisplayFragment","FormRegisterCustomSlotPeriodFragment"]},CreatedByFragment:{code:"fragment CreatedBy on UsersInfo {\n ...UserInfoContactInformation\n}\n",fragments:["UserInfoContactInformationFragment"]},CustomBadgeVolunteerRegistrationFragment:{code:'fragment CustomBadgeVolunteerRegistration on VolunteersRegistration {\n localId\n state\n isLeader\n utid\n ticketId\n weezevent\n\n userInfo {\n id\n email\n name\n fields(expand: true)\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n formsUsersInfos(eventId: $eventId, level: Event) {\n formId\n\n slots {\n range\n }\n }\n }\n\n delegation {\n name\n\n leaders {\n name\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n }\n\n accreditationsUsersInfos {\n accreditation {\n id\n name\n acronym\n color\n icon\n }\n\n accreditationSlot {\n id\n name\n date\n }\n\n accreditationCategory {\n id\n name\n }\n }\n\n positionsSlotsUsersInfos {\n ...AssigmentEmail\n }\n}\n',fragments:["UserInfoLinksFragment","AssigmentEmailFragment"]},CustomDocumentPopulationFragment:{code:"fragment CustomDocumentPopulation on CustomDocument {\n slug\n name\n populationsIds\n}\n",fragments:[]},CustomFieldFragment:{code:"fragment CustomField on CustomField {\n id\n slug\n name\n label\n variety\n fieldProperty\n fieldType\n isPrivate\n isEncrypted\n hasCondition\n conditionCustomFieldId\n dependencies\n numberOfTimesUsed\n canDelete\n isSelectV2\n insertedAt\n\n category {\n id\n name\n }\n\n conditionCustomField {\n name\n }\n\n createdBy {\n id\n ...CreatedBy\n }\n\n values {\n value\n }\n}\n",fragments:["CreatedByFragment"]},CustomFieldImportFragment:{code:"fragment CustomFieldImport on CustomField {\n id\n name\n slug\n customFieldCategoryId\n customFieldCategoryName\n fieldType\n fieldProperty\n canSelectMultiple\n\n values {\n id\n value\n }\n}\n",fragments:[]},CustomFieldWithConditionFragment:{code:"fragment CustomFieldWithCondition on CustomField {\n id\n name\n label\n description\n fieldType\n fieldSubtype\n fieldProperty\n isPrivate\n isEncrypted\n hasCondition\n conditionValue\n canSelectMultiple\n slug\n isSelectV2\n\n conditionCustomField {\n id\n name\n fieldType\n fieldProperty\n canSelectMultiple\n slug\n }\n\n document {\n url\n name\n }\n\n values {\n id\n value\n }\n}\n",fragments:[]},DelegationAccreditationSlotFragment:{code:"fragment DelegationAccreditationSlot on DelegationAccreditationSlot {\n accreditationCategoryId\n accreditationId\n accreditationSlotId\n isDefault\n isFull\n isVisible\n\n accreditationSlot {\n date\n isBlocked\n isFull\n }\n}\n",fragments:[]},DelegationAccreditationSlotStatsFragment:{code:"fragment DelegationAccreditationSlotStats on DelegationAccreditationSlot {\n accreditationSlotId\n accreditationId\n assignedResources\n maxResources\n scannedResources\n wishedResources\n}\n",fragments:[]},DelegationAccreditationsSlotsFragment:{code:"fragment DelegationAccreditationsSlots on Delegation {\n accreditationsSlots {\n accreditationId\n accreditationSlotId\n maxResources\n assignedResources\n isDefault\n isVisible\n\n accreditationSlot {\n id\n name\n date\n isHidden\n accreditation {\n id\n name\n }\n accreditationCategoryId\n }\n }\n}\n",fragments:[]},DelegationUserProfileFragment:{code:"fragment DelegationUserProfile on Delegation {\n id\n name\n event {\n id\n name\n }\n}\n",fragments:[]},DelegationsDelegationFragment:{code:"fragment DelegationsDelegation on Delegation {\n id\n organizationId\n eventId\n name\n state\n deadlineDate\n numberOfResources @include(if: $includeResources)\n maxResources\n fillingRate @include(if: $includeResources)\n showInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersEditMembers\n canLeadersDeleteMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n showFormLinkInDelegationSpace\n lockedAt\n usedCustomFieldsFilled @include(if: $includeUsedCustomFieldsFilled)\n insertedAt\n\n campaigns @include(if: $includeCampaigns) {\n id\n name\n }\n\n children @include(if: $includeChildren) {\n event {\n id\n name\n }\n }\n\n customDocuments @include(if: $includeDocuments) {\n slug\n name\n }\n\n delegationCategory {\n id\n name\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n form {\n id\n name\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n\n leaders @include(if: $includeLeaders) {\n id\n email\n name\n nameOrEmail\n }\n\n accreditationsSlots @include(if: $includeAccreditationsSlots) {\n ...DelegationAccreditationSlotStats\n }\n}\n",fragments:["DelegationAccreditationSlotStatsFragment"]},DocumentEmailPreviewFragment:{code:"fragment DocumentEmailPreview on Document {\n id\n acl\n key\n name\n size\n url\n}\n",fragments:[]},DocumentPositionPlanningFragment:{code:'fragment DocumentPositionPlanning on Event {\n position(id: $positionId) {\n name\n range\n\n slots {\n id\n range\n }\n }\n\n volunteersRegistrations(positionId: $positionId, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n\n userInfo {\n ...UserInfoContactInformation\n }\n\n slots {\n range\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n positionSlot {\n range\n }\n }\n }\n }\n}\n',fragments:["UserInfoContactInformationFragment"]},DocumentPositionSheetFragment:{code:"fragment DocumentPositionSheet on Query {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: Position) {\n id\n options\n }\n\n position(id: $positionId) {\n ...PositionPdfInfos\n\n slots {\n id\n name\n range\n }\n }\n\n volunteersRegistrations(states: [Assigned], positionId: $positionId) {\n nodes {\n ...VolunteerPdf\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","PositionPdfInfosFragment","VolunteerPdfFragment"]},DocumentPositionsPlanningFragment:{code:"fragment DocumentPositionsPlanning on Event {\n name\n\n positionsSlots(segmentId: $segmentId, date: $date) {\n nodes {\n id\n positionId\n name\n range\n\n position {\n id\n name\n color\n }\n }\n }\n\n segment(id: $segmentId) {\n name\n }\n}\n",fragments:[]},DocumentPositionsVolunteersPlanningFragment:{code:"fragment DocumentPositionsVolunteersPlanning on Event {\n name\n\n positionsSlots(segmentId: $segmentId) {\n nodes {\n id\n range\n\n position {\n id\n name\n acronym\n }\n }\n }\n\n segment(id: $segmentId) {\n name\n }\n\n volunteersRegistrations(states: [Assigned]) {\n nodes {\n id\n\n userInfo {\n ...UserInfoContactInformation\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},DocumentUserAssignmentsFragment:{code:"fragment DocumentUserAssignments on Query {\n organization(id: $organizationId) {\n id\n\n customFields(variety: Position, privacy: Public) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoDocument\n }\n }\n\n event(id: $eventId) {\n id\n name\n\n document(documentType: Assignments) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n localId\n ticketId\n weezevent\n\n preassignPositions {\n name\n }\n\n preassignPositionsCategories {\n name\n }\n\n positionsSlotsUsersInfos {\n ...AssigmentEmail\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","UserInfoDocumentFragment","AssigmentEmailFragment"]},DocumentUserBadgeFragment:{code:'fragment DocumentUserBadge on Event {\n document(documentType: Badge) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n ...UserInfoContactInformation\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userBadgeLink\n }\n }\n\n positionsSlotsUsersInfos {\n position {\n name\n }\n\n positionSlot {\n range\n }\n }\n }\n}\n',fragments:["UserInfoContactInformationFragment"]},DocumentUserCertificateFragment:{code:'fragment DocumentUserCertificate on Event {\n document(documentType: Certificate) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n name\n dateOfBirth: fieldValue(slug: "dateOfBirth")\n street: fieldValue(slug: "street")\n city: fieldValue(slug: "city")\n postalCode: fieldValue(slug: "postalCode")\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userCertificateLink\n }\n }\n\n positionsSlotsUsersInfos {\n position {\n name\n }\n\n positionSlot {\n range\n }\n }\n }\n}\n',fragments:[]},DocumentUserCustomBadgeFragment:{code:"fragment DocumentUserCustomBadge on Event {\n id\n name\n startAt\n weezevent\n\n tags {\n name\n }\n\n document(documentType: CustomBadge, customBadge: $customBadge) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...CustomBadgeVolunteerRegistration\n }\n}\n",fragments:["CustomBadgeVolunteerRegistrationFragment"]},DocumentUserCustomBadgesFragment:{code:"fragment DocumentUserCustomBadges on Event {\n id\n name\n startAt\n weezevent\n\n tags {\n name\n }\n\n document(documentType: CustomBadge, customBadge: $customBadge) {\n id\n options\n }\n\n volunteersRegistrations(segmentId: $segmentId) {\n nodes {\n ...CustomBadgeVolunteerRegistration\n }\n }\n}\n",fragments:["CustomBadgeVolunteerRegistrationFragment"]},DocumentUserPlanningFragment:{code:"fragment DocumentUserPlanning on Event {\n startAt\n endAt\n dayStartTime\n\n document(documentType: UserPlanning) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n localId\n ticketId\n weezevent\n\n userInfo {\n ...UserInfoDocument\n }\n\n positionsSlotsUsersInfos {\n ...PsuiUserPlanning\n }\n }\n}\n",fragments:["UserInfoDocumentFragment","PsuiUserPlanningFragment"]},DocumentUserPlanningDaysFragment:{code:'fragment DocumentUserPlanningDays on Event {\n document(documentType: UserPlanningDays) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userPlanningDaysLink\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n range\n }\n\n position {\n id\n organizationId\n name\n address\n }\n }\n }\n}\n',fragments:[]},DocumentUserPlanningListFragment:{code:'fragment DocumentUserPlanningList on Event {\n document(documentType: UserPlanningList) {\n id\n options\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n userInfo {\n nameOrEmail\n language: fieldValue(slug: "language")\n\n links(eventId: $eventId) {\n userPlanningListLink\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n name\n range\n }\n\n position {\n name\n }\n }\n }\n}\n',fragments:[]},DocumentUsersHoursFragment:{code:"fragment DocumentUsersHours on Event {\n timeZone\n\n document(documentType: UserHours) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n positionsSlotsUsersInfos {\n ...PsuiUserHours\n }\n\n userInfo {\n ...UserInfoDocument\n }\n }\n}\n",fragments:["PsuiUserHoursFragment","UserInfoDocumentFragment"]},DocumentUsersListingFragment:{code:"fragment DocumentUsersListing on Query {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: VolunteersListing) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n segment(id: $segmentId) {\n name\n\n links {\n usersListingLink\n }\n }\n\n volunteersRegistrations(segmentId: $segmentId) {\n nodes {\n ...VolunteerPdf\n }\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment","VolunteerPdfFragment"]},DocumentUsersPicturesFragment:{code:'fragment DocumentUsersPictures on Query {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n document(documentType: UsersPictures) {\n id\n options\n title\n informationsTitle\n informationsContent\n informations2Title\n informations2Content\n signature\n }\n\n segment(id: $segmentId) {\n name\n\n links {\n usersPicturesLink\n }\n }\n\n volunteersRegistrations(\n segmentId: $segmentId\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n userInfo {\n id\n ...UserInfoContactInformation\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n fields\n }\n }\n }\n }\n}\n',fragments:["CustomFieldWithConditionFragment","UserInfoContactInformationFragment"]},DocumentUsersPlanningFragment:{code:"fragment DocumentUsersPlanning on VolunteersRegistration {\n id\n state\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n\n positionsSlotsUsersInfos {\n positionCategory {\n name\n }\n\n positionSlot {\n id\n name\n range\n }\n\n position {\n id\n name\n color\n icon\n }\n }\n\n slots {\n range\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},EditVolunteerRegistrationSlotFragment:{code:"fragment EditVolunteerRegistrationSlot on ISlot {\n startDate\n startTime\n endDate\n endTime\n}\n",fragments:[]},EmailRecipientFragment:{code:"fragment EmailRecipient on Email {\n id\n state\n sentAt\n infos\n\n userInfo {\n ...CampaignUserInfo\n }\n}\n",fragments:["CampaignUserInfoFragment"]},EmailSenderEmailRendererFragment:{code:"fragment EmailSenderEmailRenderer on EmailsSender {\n fromName\n fromEmail\n replyTo\n signature\n\n header {\n key\n }\n\n picture {\n key\n }\n\n footer {\n key\n }\n}\n",fragments:[]},EmailTemplateEmailRendererFragment:{code:"fragment EmailTemplateEmailRenderer on EmailsTemplate {\n useDefault\n subject\n content\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n}\n",fragments:[]},EventAccreditationsFragment:{code:"fragment EventAccreditations on Event {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n accreditationCategoryId\n name\n color\n icon\n accreditationCategoryName\n accreditationDisplay\n hasSlots\n hiddenSlotId\n index\n\n slots(includeHidden: true) {\n id\n accreditationId\n name\n date\n }\n }\n }\n}\n",fragments:[]},EventEmailRendererFragment:{code:"fragment EventEmailRenderer on Event {\n id\n organizationId\n name\n languages\n timeZone\n startAt\n endAt\n\n customDocuments {\n slug\n }\n}\n",fragments:[]},EventPositionsExportFragment:{code:"fragment EventPositionsExport on Event {\n languages\n\n segmentsFolders(segmentType: Positions) {\n id\n name\n\n segments {\n id\n name\n }\n }\n}\n",fragments:[]},EventVolunteersExportFragment:{code:"fragment EventVolunteersExport on Event {\n languages\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n}\n",fragments:[]},EventsEventFragment:{code:"fragment EventsEvent on Event {\n id\n name\n state\n startAt\n endAt\n fields\n insertedAt\n numberOfMembers @include(if: $includeNumberOfMembers)\n numberOfMembersAccredited @include(if: $includeNumberOfMembers)\n numberOfMembersAssigned @include(if: $includeNumberOfMembers)\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n tags {\n id\n name\n }\n}\n",fragments:[]},ExistingVolunteerFragment:{code:"fragment ExistingVolunteer on UsersInfo {\n id\n ...UserInfoContactInformation\n nameOrEmail\n}\n",fragments:["UserInfoContactInformationFragment"]},FormAccreditationsOptionsFragment:{code:"fragment FormAccreditationsOptions on Form {\n accreditationDisplay\n accreditationFilter\n showFullAccreditation\n hiddenAccreditationsCategoriesIds\n hiddenAccreditationsIds\n hiddenAccreditationsSlotsIds\n displayedAccreditationsCategoriesIds\n displayedAccreditationsIds\n displayedAccreditationsSlotsIds\n showAccreditationDescription\n slotDisplay\n\n accreditationsFormCustomFields {\n accreditationsSlotsIds\n isMandatory\n\n customField {\n ...CustomFieldWithCondition\n }\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},FormCustomFieldFragment:{code:"fragment FormCustomField on CustomField {\n id\n name\n label\n fieldType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n }\n}\n",fragments:[]},FormCustomFieldsFragment:{code:"fragment FormCustomFields on Organization {\n formCustomFields: customFields(\n variety: UserInfo\n privacy: Public\n sort: { attribute: Name, direction: Asc }\n ) {\n nodes {\n ...FormCustomField\n }\n }\n}\n",fragments:["FormCustomFieldFragment"]},FormElementDisplayFragment:{code:"fragment FormElementDisplay on FormsElement {\n id\n elementType\n isMandatory\n section\n text\n hasCondition\n conditionValue\n\n conditionCustomField {\n ...CustomFieldWithCondition\n }\n\n customField {\n ...CustomFieldWithCondition\n }\n}\n",fragments:["CustomFieldWithConditionFragment"]},FormElementsElementFragment:{code:"fragment FormElementsElement on FormsElement {\n id\n elementType\n customFieldId\n section\n text\n isMandatory\n hasCondition\n conditionCustomFieldId\n conditionValue\n}\n",fragments:[]},FormEmailFragment:{code:"fragment FormEmail on FormsUsersInfo {\n teamCode\n\n form {\n id\n areTeamsAllowed\n }\n\n ...WishesEmail\n}\n",fragments:["WishesEmailFragment"]},FormListFragment:{code:"fragment FormList on Form {\n id\n name\n numberOfCustomFields\n}\n",fragments:[]},FormMemberRegistrationFragment:{code:"fragment FormMemberRegistration on Form {\n id\n name\n isEditableInMemberSpace\n\n elements {\n id\n ...FormElementDisplay\n }\n\n ...FormSlotsOptions\n ...FormMissionsOptions\n ...FormAccreditationsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n}\n",fragments:["FormElementDisplayFragment","FormSlotsOptionsFragment","FormMissionsOptionsFragment","FormAccreditationsOptionsFragment","FormRegisterCustomSlotPeriodFragment"]},FormMissionsOptionsFragment:{code:"fragment FormMissionsOptions on Form {\n positionDisplay\n positionFilter\n positionRanking\n positionLimit\n showFullPosition\n hiddenPositionsCategoriesIds\n hiddenPositionsIds\n hiddenPositionsSlotsIds\n hiddenPositionsTagsIds\n displayedPositionsCategoriesIds\n displayedPositionsIds\n displayedPositionsSlotsIds\n displayedPositionsTagsIds\n showPositionCategoryDescription\n showPositionDescription\n slotDisplay\n willAutoAssign\n}\n",fragments:[]},FormRegisterAccreditationFragment:{code:"fragment FormRegisterAccreditation on IAccreditation {\n id\n name\n description\n color\n icon\n hiddenSlotId\n hasSlots\n accreditationDisplay\n conditionsOperator\n index\n\n slots {\n ...FormRegisterAccreditationSlot\n }\n\n conditionsCustomFields: accreditationsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n\n formCustomFields {\n isMandatory\n\n customField {\n ...CustomFieldWithCondition\n }\n }\n}\n",fragments:["FormRegisterAccreditationSlotFragment","CustomFieldWithConditionFragment"]},FormRegisterAccreditationCategoryFragment:{code:"fragment FormRegisterAccreditationCategory on IAccreditationsCategory {\n id\n name\n\n accreditations {\n ...FormRegisterAccreditation\n }\n}\n",fragments:["FormRegisterAccreditationFragment"]},FormRegisterAccreditationSlotFragment:{code:"fragment FormRegisterAccreditationSlot on IAccreditationsSlot {\n id\n name\n date\n isBlocked\n isFull\n}\n",fragments:[]},FormRegisterCategoryFragment:{code:"fragment FormRegisterCategory on IPositionsCategory {\n id\n name\n description\n\n positions {\n ...FormRegisterPosition\n }\n}\n",fragments:["FormRegisterPositionFragment"]},FormRegisterCustomSlotFragment:{code:"fragment FormRegisterCustomSlot on CustomSlot {\n name\n startTime\n endTime\n}\n",fragments:[]},FormRegisterCustomSlotPeriodFragment:{code:"fragment FormRegisterCustomSlotPeriod on CustomSlotsPeriod {\n id\n name\n startDate\n endDate\n hideNameDates\n displayAsCalendar\n hasCondition\n conditionCustomFieldId\n conditionValue\n\n conditionCustomField {\n ...CustomFieldWithCondition\n }\n\n customSlots {\n ...FormRegisterCustomSlot\n }\n}\n",fragments:["CustomFieldWithConditionFragment","FormRegisterCustomSlotFragment"]},FormRegisterPositionFragment:{code:"fragment FormRegisterPosition on IPosition {\n id\n name\n description\n isVisible\n conditionsOperator\n tagsIds\n\n slots {\n ...FormRegisterSlot\n }\n\n conditionsCustomFields: positionsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n}\n",fragments:["FormRegisterSlotFragment"]},FormRegisterSlotFragment:{code:"fragment FormRegisterSlot on IPositionsSlot {\n id\n name\n range\n nameOrRange\n isFull\n}\n",fragments:[]},FormSlotsOptionsFragment:{code:"fragment FormSlotsOptions on Form {\n slotDisplay\n daysDisplay\n slotTitle\n slotSubtitle\n}\n",fragments:[]},FormUserInfoUserProfileFragment:{code:"fragment FormUserInfoUserProfile on FormsUsersInfo {\n organizationId\n eventId\n formId\n insertedAt\n teamCode\n\n teamMembers {\n ...UserInfoTeamMember\n }\n}\n",fragments:["UserInfoTeamMemberFragment"]},FormUserInfoWishedFragment:{code:"fragment FormUserInfoWished on UsersInfo {\n formUserInfo(formId: $formId) {\n insertedAt\n formId\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationsSlotsIds\n\n form {\n ...FormMemberRegistration\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n }\n }\n\n positionsSlots {\n nameOrRange\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n slots {\n startDate\n startTime\n endDate\n endTime\n }\n }\n}\n",fragments:["FormMemberRegistrationFragment"]},FormUserOverlayFragment:{code:"fragment FormUserOverlay on Form {\n id\n name\n\n elements {\n ...FormElementDisplay\n }\n}\n",fragments:["FormElementDisplayFragment"]},FormsUsersInfosWishedFragment:{code:"fragment FormsUsersInfosWished on UsersInfo {\n formsUsersInfos(eventId: $eventId, level: Both) {\n insertedAt\n formId\n eventId\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n accreditationsSlotsIds\n\n form {\n ...FormMemberRegistration\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n index\n }\n\n accreditationCategory {\n name\n }\n }\n\n positionsSlots {\n nameOrRange\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n slots {\n startDate\n startTime\n endDate\n endTime\n range\n }\n }\n}\n",fragments:["FormMemberRegistrationFragment"]},FullPageInfoFragment:{code:"fragment FullPageInfo on PageInfo {\n hasNextPage\n hasPreviousPage\n}\n",fragments:[]},LeaderAssignmentFragment:{code:'fragment LeaderAssignment on Leader {\n userInfo {\n id\n name\n email\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n}\n',fragments:[]},LeaderInfosFragment:{code:"fragment LeaderInfos on Leader {\n role {\n id\n name\n }\n\n userInfo {\n ...LeaderUserInfo\n }\n}\n",fragments:["LeaderUserInfoFragment"]},LeaderUserInfoFragment:{code:"fragment LeaderUserInfo on UsersInfo {\n id\n userId\n ...UserInfoContactInformation\n nameOrEmail\n}\n",fragments:["UserInfoContactInformationFragment"]},MassEditCustomFieldFragment:{code:"fragment MassEditCustomField on CustomField {\n id\n name\n label\n slug\n fieldType\n fieldProperty\n canSelectMultiple\n\n values {\n id\n value\n }\n}\n",fragments:[]},MemberAccreditationFragment:{code:"fragment MemberAccreditation on AccreditationsUsersInfo {\n accreditationSlot {\n name\n date\n }\n\n accreditation {\n name\n description\n acronym\n hasSlots\n }\n\n accreditationCategory {\n name\n }\n}\n",fragments:[]},MemberAssignmentFragment:{code:"fragment MemberAssignment on PositionsSlotsUsersInfo {\n position {\n name\n description\n address\n latitude\n longitude\n zoom\n layer\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n\n traces {\n ...Trace\n }\n }\n\n positionSlot {\n range\n }\n}\n",fragments:["LeaderAssignmentFragment","TraceFragment"]},MemberRegistrationUserInfoFragment:{code:"fragment MemberRegistrationUserInfo on UsersInfo {\n id\n userId\n ...UserInfoContactInformation\n nameOrEmail\n fields\n}\n",fragments:["UserInfoContactInformationFragment"]},OrganizationAdminInfosFragment:{code:"fragment OrganizationAdminInfos on Organization {\n name\n adminName\n adminEmail\n street\n postalCode\n city\n country\n timeZone\n emailSenderId\n dateFormat\n datetimeFormat\n timeFormat\n\n emailsSenders {\n id\n name\n }\n}\n",fragments:[]},OrganizationBackofficeFragment:{code:"fragment OrganizationBackoffice on Organization {\n customBadges\n features\n id\n insertedAt\n isBlocked\n name\n numberOfEvents\n periodEndAt\n weezeventOrganizationId\n useOldBilling\n membersLimit\n pricePerMember\n billingComment\n\n membersStats {\n numberOfMembers\n }\n\n membersStats2024: membersStats(year: 2024) {\n numberOfMembers\n }\n\n users {\n id\n email\n }\n}\n",fragments:[]},OrganizationCertificateDefaultFragment:{code:"fragment OrganizationCertificateDefault on Organization {\n name\n adminName\n street\n city\n postalCode\n country\n}\n",fragments:[]},OrganizationCustomFieldsFragment:{code:"fragment OrganizationCustomFields on Organization {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n}\n",fragments:["SegmentCustomFieldFragment"]},OrganizationDelegationsSpaceFragment:{code:"fragment OrganizationDelegationsSpace on IOrganization {\n name\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n delegationsSpaceDesign: spaceDesign(spaceType: DelegationSpace) {\n colors\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:[]},OrganizationEmailRendererFragment:{code:"fragment OrganizationEmailRenderer on Organization {\n id\n name\n datetimeFormat\n timeZone\n}\n",fragments:[]},OrganizationEventsShowcaseFragment:{code:"fragment OrganizationEventsShowcase on OrganizationPublic {\n eventsShowcaseDesign: spaceDesign(spaceType: EventsShowcase) {\n colors\n logo {\n url\n }\n\n banner {\n url\n }\n }\n}\n",fragments:[]},OrganizationMembersSpaceFragment:{code:"fragment OrganizationMembersSpace on Organization {\n name\n\n membersSpaceDesign: spaceDesign(spaceType: MembersSpace) {\n colors\n logo {\n url\n }\n\n banner {\n url\n }\n }\n\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n membersSpaceExcludeAccreditations\n}\n",fragments:[]},PositionCategoryPositionFragment:{code:"fragment PositionCategoryPosition on Position {\n id\n assignedResources\n name\n range\n resources\n numberOfSlots\n}\n",fragments:[]},PositionPdfInfosFragment:{code:"fragment PositionPdfInfos on Position {\n id\n eventId\n name\n description\n range\n address\n latitude\n longitude\n zoom\n layer\n numberOfSlots\n assignedResources\n acronym\n\n leaders {\n ...LeaderAssignment\n }\n\n category {\n name\n\n leaders {\n ...LeaderAssignment\n }\n }\n}\n",fragments:["LeaderAssignmentFragment"]},PositionPlanningFragment:{code:"fragment PositionPlanning on Position {\n id\n name\n color\n icon\n\n category {\n name\n }\n\n slots {\n id\n name\n range\n fillingRate\n assignedResources\n resources\n }\n}\n",fragments:[]},PositionPositionSlotFragment:{code:"fragment PositionPositionSlot on PositionsSlot {\n id\n positionCategoryId\n positionId\n assignedResources\n name\n range\n nameOrRange\n resources\n startDate\n startTime\n endDate\n endTime\n}\n",fragments:[]},PositionPositionsCustomFieldsFragment:{code:"fragment PositionPositionsCustomFields on Position {\n conditionsOperator\n\n conditionsCustomFields: positionsCustomFields {\n conditionValue\n\n customField {\n slug\n fieldType\n canSelectMultiple\n }\n }\n}\n",fragments:[]},PositionPositionsMapFragment:{code:"fragment PositionPositionsMap on Position {\n acronym\n color\n icon\n latitude\n longitude\n}\n",fragments:[]},PositionsPositionFragment:{code:"fragment PositionsPosition on Position {\n id\n name\n range\n resources\n assignedResources\n address\n latitude\n longitude\n acronym\n color\n icon\n isVisible\n state\n fillingRate\n numberOfSlots\n fields\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n\n category {\n id\n name\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n nameOrEmail\n }\n }\n }\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n leaders @include(if: $includeLeaders) {\n userInfo {\n id\n nameOrEmail\n }\n }\n\n positionsCustomFields @include(if: $includeConditions) {\n ...PositionsPositionCustomField\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n",fragments:["PositionsPositionCustomFieldFragment"]},PositionsPositionCustomFieldFragment:{code:"fragment PositionsPositionCustomField on PositionsCustomField {\n conditionValue\n\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n}\n",fragments:[]},PositionsPositionSlotFragment:{code:"fragment PositionsPositionSlot on PositionsSlot {\n id\n name\n startDate\n startTime\n endDate\n endTime\n range\n assignedResources\n resources\n fillingRate\n state\n insertedAt\n\n checkedInRate @include(if: $includeCheckedInRate)\n\n position {\n id\n name\n fields\n acronym\n color\n icon\n address\n latitude\n longitude\n\n createdBy @include(if: $includeCreatedBy) {\n email\n name\n }\n\n positionsCustomFields @include(if: $includeConditions) {\n ...PositionsPositionCustomField\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n }\n\n positionCategory {\n id\n name\n }\n}\n",fragments:["PositionsPositionCustomFieldFragment"]},PsuiUserHoursFragment:{code:"fragment PsuiUserHours on PositionsSlotsUsersInfo {\n breakTime\n checkInAt\n checkOutAt\n timeDifferenceMinutes\n\n positionSlot {\n range\n }\n\n position {\n name\n }\n}\n",fragments:[]},PsuiUserPlanningFragment:{code:"fragment PsuiUserPlanning on PositionsSlotsUsersInfo {\n id\n\n positionSlot {\n name\n range\n }\n\n position {\n name\n color\n }\n}\n",fragments:[]},SegmentCampaignFragment:{code:"fragment SegmentCampaign on Campaign {\n id\n name\n campaignType\n}\n",fragments:[]},SegmentCustomFieldFragment:{code:"fragment SegmentCustomField on CustomField {\n id\n slug\n name\n label\n fieldType\n fieldProperty\n canSelectMultiple\n customFieldCategoryId\n customFieldCategoryName\n isSelectV2\n isEncrypted\n\n values {\n id\n value\n }\n}\n",fragments:[]},SegmentEventFragment:{code:"fragment SegmentEvent on Event {\n id\n name\n}\n",fragments:[]},SegmentFormFragment:{code:"fragment SegmentForm on Form {\n id\n name\n}\n",fragments:[]},SegmentsFoldersSegmentsFragment:{code:"fragment SegmentsFoldersSegments on SegmentsFolder {\n id\n name\n\n segments {\n id\n segmentFolderId\n name\n predicates\n columns\n columnsExport\n columnsSearch\n sort\n count\n rendering\n description\n isUsedInWorkflow\n infos\n }\n}\n",fragments:[]},SpaceDesignFragment:{code:"fragment SpaceDesign on Design {\n banner {\n acl\n name\n key\n }\n\n logo {\n acl\n name\n key\n }\n\n colors\n}\n",fragments:[]},TraceFragment:{code:"fragment Trace on Trace {\n id\n name\n color\n points\n direction\n}\n",fragments:[]},TranslationFragment:{code:"fragment Translation on Translation {\n id\n translationType\n module\n fr\n en\n es\n de\n nl\n isFrTranslated\n isEnTranslated\n isEsTranslated\n isDeTranslated\n isNlTranslated\n frString\n enString\n esString\n deString\n nlString\n}\n",fragments:[]},UpdateUserFormFragment:{code:"fragment UpdateUserForm on Form {\n id\n name\n areTeamsAllowed\n delegationsIds\n\n elements {\n ...FormElementDisplay\n }\n}\n",fragments:["FormElementDisplayFragment"]},UserAllPermissionsFragment:{code:"fragment UserAllPermissions on UsersInfo {\n usersOrganizations {\n id\n sendNotifications\n\n role {\n id\n name\n type\n }\n }\n\n usersEvents(eventId: $eventId) {\n id\n\n event {\n id\n name\n }\n\n role {\n id\n name\n type\n }\n }\n\n usersDelegations(eventId: $eventId) {\n id\n eventId\n userInfoId\n\n delegation {\n name\n }\n }\n\n usersDelegationsCategories(eventId: $eventId) {\n id\n eventId\n\n delegationCategory {\n name\n }\n\n role {\n id\n name\n }\n }\n\n usersPositionsCategories(eventId: $eventId) {\n id\n eventId\n\n positionCategory {\n name\n }\n\n role {\n id\n name\n }\n }\n\n usersPositions(eventId: $eventId) {\n id\n eventId\n\n position {\n name\n }\n\n role {\n id\n name\n }\n }\n}\n",fragments:[]},UserInfoCommunityFragment:{code:'fragment UserInfoCommunity on UsersInfo {\n id\n name\n email\n nameOrEmail\n fields\n insertedAt\n phone: fieldValue(slug: "phone")\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n picture {\n url\n }\n\n events @include(if: $includeEvents) {\n id\n name\n }\n\n delegations(level: Organization) @include(if: $includeDelegations) {\n id\n name\n\n delegationCategory {\n id\n name\n }\n }\n\n formsUsersInfos(level: Organization) @include(if: $includeForms) {\n id\n insertedAt\n\n form {\n id\n name\n }\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n}\n',fragments:["UserAllPermissionsFragment"]},UserInfoContactInformationFragment:{code:"fragment UserInfoContactInformation on UsersInfo {\n ...UserInfoNameAndPicture\n email\n phone {\n internationalFormat\n }\n}\n",fragments:["UserInfoNameAndPictureFragment"]},UserInfoDocumentFragment:{code:'fragment UserInfoDocument on UsersInfo {\n id\n ...UserInfoContactInformation\n nameOrEmail\n language: fieldValue(slug: "language")\n fields(expand: true)\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n}\n',fragments:["UserInfoContactInformationFragment","UserInfoLinksFragment"]},UserInfoEmailRendererFragment:{code:"fragment UserInfoEmailRenderer on UsersInfo {\n id\n email\n fields\n registrationDate(eventId: $eventId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n user {\n id\n language\n }\n}\n",fragments:["UserInfoLinksFragment"]},UserInfoFormFragment:{code:"fragment UserInfoForm on UsersInfo {\n id\n email\n nameOrEmail\n fields\n registrationDate(eventId: $eventId)\n canAccess(formId: $formId)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n}\n",fragments:["UserInfoLinksFragment"]},UserInfoLinksFragment:{code:"fragment UserInfoLinks on UserInfoDocumentLink {\n userAssignmentsLink\n userBadgeLink\n userCertificateLink\n userCustomBadgeLinks\n userCustomDocumentLinks\n userHoursLink\n userPlanningLink\n userPlanningDaysLink\n userPlanningListLink\n}\n",fragments:[]},UserInfoNameAndPictureFragment:{code:"fragment UserInfoNameAndPicture on UsersInfo {\n name\n picture {\n url\n }\n}\n",fragments:[]},UserInfoOrganizationFragment:{code:"fragment UserInfoOrganization on UsersInfo {\n id\n userId\n name\n email\n nameOrEmail\n\n ...UserAllPermissions\n\n picture {\n url\n }\n}\n",fragments:["UserAllPermissionsFragment"]},UserInfoOverlayFragment:{code:'fragment UserInfoOverlay on UsersInfo {\n id\n name\n email\n nameOrEmail\n fields\n phone: fieldValue(slug: "phone")\n population: fieldValue(slug: "population")\n language: fieldValue(slug: "language")\n\n picture {\n url\n }\n}\n',fragments:[]},UserInfoTeamMemberFragment:{code:"fragment UserInfoTeamMember on UsersInfo {\n id\n ...UserInfoContactInformation\n}\n",fragments:["UserInfoContactInformationFragment"]},UserInfoTeamRightPanelFragment:{code:"fragment UserInfoTeamRightPanel on VolunteersRegistration {\n positionsCategories {\n positions {\n id\n name\n icon\n color\n\n slots {\n id\n name\n range\n }\n }\n }\n\n positions {\n id\n name\n icon\n color\n\n slots {\n id\n name\n range\n }\n }\n\n positionsSlots {\n id\n name\n range\n\n position {\n id\n name\n icon\n color\n }\n }\n\n positionsSlotsUsersInfos {\n positionSlot {\n id\n name\n range\n }\n\n position {\n id\n name\n icon\n color\n }\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},UserPanelAccreditationSlotUserInfoFragment:{code:"fragment UserPanelAccreditationSlotUserInfo on AccreditationsUsersInfo {\n id\n eventId\n isAutoAccredit\n isWorkflow\n checkInAt\n insertedAt\n checkInAt\n state\n\n accreditationCategory {\n name\n }\n\n accreditation {\n id\n name\n color\n icon\n index\n }\n\n accreditationSlot {\n id\n name\n date\n }\n\n createdBy {\n email\n name\n }\n}\n",fragments:[]},UserPermissionsFragment:{code:"fragment UserPermissions on User {\n roles(organizationId: $organizationId, eventId: $eventId) {\n id\n accessLevel\n type\n permissions\n }\n\n usersDelegationsCategories(eventId: $eventId) {\n delegationCategoryId\n roleId\n }\n\n usersEvents(eventId: $eventId) {\n eventId\n roleId\n }\n\n usersPositionsCategories(eventId: $eventId) {\n positionCategoryId\n roleId\n }\n\n usersPositions(eventId: $eventId) {\n positionId\n roleId\n }\n}\n",fragments:[]},UserPositionSlotUserInfoFragment:{code:"fragment UserPositionSlotUserInfo on PositionsSlotsUsersInfo {\n breakTime\n checkInAt\n checkOutAt\n eventId\n id\n insertedAt\n isAutoAssign\n organizationId\n positionCategoryId\n state\n timeDifferenceMinutes\n userInfoId\n\n createdBy {\n email\n name\n }\n\n position {\n id\n acronym\n color\n icon\n name\n }\n\n positionSlot {\n id\n name\n range\n }\n\n positionCategory {\n id\n name\n }\n}\n",fragments:[]},VolunteerInfosFragment:{code:'fragment VolunteerInfos on VolunteersRegistration {\n delegation {\n id\n name\n }\n\n userInfo {\n id\n name\n email\n phone: fieldValue(slug: "phone")\n picture {\n url\n }\n }\n}\n',fragments:[]},VolunteerPdfFragment:{code:"fragment VolunteerPdf on VolunteersRegistration {\n teams {\n teamCode\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n fields\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationFragment:{code:"fragment VolunteerRegistration on VolunteersRegistration {\n id\n localId\n ticketId\n state\n accreditationState\n insertedAt\n canDelete\n canRegistrationStateUpdate @include(if: $includeCanRegistrationStateUpdate)\n numberOfAccreditations @include(if: $includeNumberOfAccreditations)\n numberOfAssignments @include(if: $includeNumberOfAssignments)\n numberOfAssignmentsDays @include(if: $includeNumberOfAssignmentsDays)\n numberOfAvailableDays @include(if: $includeNumberOfAvailableDays)\n shortTag\n volunteerMinutes @include(if: $includeVolunteerMinutes)\n weezeventPairedAt @include(if: $includeWeezevent)\n weezeventPayUrl @include(if: $includeWeezeventUrls)\n weezeventTicketUrl @include(if: $includeWeezeventUrls)\n delegationLocalId @include(if: $includeDelegation)\n\n delegation @include(if: $includeDelegation) {\n id\n name\n\n delegationCategory {\n id\n name\n }\n }\n\n userInfo {\n id\n userId\n organizationId\n email\n name\n nameOrEmail\n fields\n isEditable @include(if: $includeIsEditable)\n insertedAt\n\n picture @include(if: $includePicture) {\n url\n }\n\n ...UserAllPermissions @include(if: $includeRoles)\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n\n comments @include(if: $includeComments) {\n content\n }\n\n emails(emailTypes: [Campaign], delegationId: $delegationId) @include(if: $includeEmails) {\n id\n state\n\n campaign {\n name\n }\n }\n\n formsUsersInfos(level: Event, eventId: $eventId) @include(if: $includeFormsUsersInfos) {\n id\n insertedAt\n\n form @include(if: $includeForms) {\n id\n name\n slotDisplay\n }\n\n slots @include(if: $includeAvailability) {\n id\n range\n }\n\n teamMembers @include(if: $includeTeam) {\n ...UserInfoTeamMember\n }\n }\n\n tags @include(if: $includeTags) {\n id\n name\n }\n }\n\n accreditationsUsersInfos(\n delegationId: $delegationId\n onlyVisible: $onlyVisibleAccreditationsSlots\n ) @include(if: $includeAccreditations) {\n checkInAt\n\n accreditationSlot {\n ...AccreditationSlotVolunteerRegistration\n }\n }\n\n matrixAuis: accreditationsUsersInfos(\n delegationId: $delegationId\n onlyVisible: $onlyVisibleAccreditationsSlots\n ) @include(if: $includeAccreditationsMatrix) {\n accreditationSlotId\n isAutoAccredit\n }\n\n accreditationsSlots(delegationId: $delegationId, onlyVisible: $onlyVisibleAccreditationsSlots)\n @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n matrixWishedSlots: accreditationsSlots @include(if: $includeAccreditationsMatrix) {\n id\n }\n\n duplicatedFrom @include(if: $includeDuplicatedFrom) {\n userInfo {\n id\n email\n name\n\n picture {\n url\n }\n }\n }\n\n positionsSlotsUsersInfos @include(if: $includePositions) {\n ...UserPositionSlotUserInfo\n }\n\n positionsCategories @include(if: $includeWishedPositions) {\n id\n name\n }\n\n positions @include(if: $includeWishedPositions) {\n id\n acronym\n color\n icon\n name\n }\n\n positionsSlots @include(if: $includeWishedPositions) {\n id\n name\n range\n\n position {\n acronym\n color\n icon\n name\n }\n }\n\n preassignPositionsCategories @include(if: $includePreassignedPositions) {\n id\n name\n }\n\n preassignPositions @include(if: $includePreassignedPositions) {\n id\n name\n }\n\n teams @include(if: $includeTeam) {\n teamCode\n }\n\n weezaccessChecklists @include(if: $includeWeezeventChecklists) {\n id\n name\n }\n}\n",fragments:["UserAllPermissionsFragment","UserInfoLinksFragment","UserInfoTeamMemberFragment","AccreditationSlotVolunteerRegistrationFragment","UserPositionSlotUserInfoFragment"]},VolunteerRegistrationDelegationAccreditationSlotFragment:{code:"fragment VolunteerRegistrationDelegationAccreditationSlot on VolunteersRegistration {\n id\n\n accreditationsSlots {\n id\n }\n\n accreditationsUsersInfos {\n accreditationSlotId\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationEmailRendererFragment:{code:'fragment VolunteerRegistrationEmailRenderer on VolunteersRegistration {\n localId\n ticketId\n weezevent\n\n delegation {\n name\n\n leaders {\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n }\n}\n',fragments:[]},VolunteerRegistrationWaitingAssignmentFragment:{code:"fragment VolunteerRegistrationWaitingAssignment on VolunteersRegistration {\n insertedAt\n\n userInfo {\n id\n ...UserInfoContactInformation\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},VolunteerRegistrationWeezeventFragment:{code:"fragment VolunteerRegistrationWeezevent on VolunteersRegistration {\n id\n state\n accreditationState\n ticketId\n weezevent\n\n accreditationsUsersInfos {\n accreditationSlotId\n accreditationCategoryId\n\n accreditation {\n id\n name\n fields\n }\n }\n\n positionsSlotsUsersInfos {\n positionCategory {\n id\n name\n }\n\n position {\n id\n name\n }\n }\n\n delegation {\n name\n\n delegationCategory {\n name\n }\n }\n\n userInfo {\n id\n ...UserInfoContactInformation\n fieldsExpanded: fields(expand: true)\n }\n}\n",fragments:["UserInfoContactInformationFragment"]},WishesEmailFragment:{code:"fragment WishesEmail on FormsUsersInfo {\n positionsCategories {\n name\n }\n\n positions {\n name\n }\n\n slots {\n range\n }\n\n accreditationsSlots {\n name\n date\n\n accreditation {\n name\n }\n }\n}\n",fragments:[]},WorkflowsWorkflowFragment:{code:"fragment WorkflowsWorkflow on Workflow {\n id\n name\n state\n trigger\n action\n executedAt\n insertedAt\n\n createdBy {\n email\n name\n }\n\n data {\n errorMessage\n }\n\n accreditationsSlots @include(if: $includeAccreditations) {\n ...AccreditationSlotVolunteerRegistration\n }\n\n campaign @include(if: $includeCampaign) {\n id\n name\n }\n\n customField @include(if: $includeCustomField) {\n id\n name\n }\n\n volunteersSegment {\n id\n name\n }\n}\n",fragments:["AccreditationSlotVolunteerRegistrationFragment"]},ZapierMemberFragment:{code:"fragment ZapierMember on UsersInfo {\n id\n fields(expand: true)\n email\n insertedAt\n updatedAt\n deletedAt\n}\n",fragments:[]}};function Bs(e){return e.flatMap(e=>[e.code].concat(Bs(e.fragments.map(e=>Ls[e]))))}function Vs(e){return(0,Ns.A)(Bs(e)).join(" ")}var Us=n(8097);const Ws="yyyy-MM-dd",Gs="yyyy-MM-dd'T'HH:mm",Hs="yyyy-MM-dd'T'HH:mm:ss";function qs(e){const[t,n]=JSON.parse(e);return Us.IX.fromDateTimes(Us.c9.fromISO(t,{zone:"UTC"}),Us.c9.fromISO(n,{zone:"UTC"}))}function Ys({startDate:e,startTime:t,endDate:n,endTime:i}){try{const[s,o]=t.split(":"),[r,a]=i.split(":");return Us.IX.fromDateTimes(e.set({hour:parseInt(s,10),minute:parseInt(o,10)}),n.set({hour:parseInt(r,10),minute:parseInt(a,10)}))}catch{return Us.IX.invalid("Invalid")}}function Ks(e){return Us.IX.isInterval(e)?e:Ys(e)}function Zs(e){return{startDate:e.start.set({hour:0,minute:0,second:0}),startTime:e.start.toFormat("HH:mm:ss"),endDate:e.end.set({hour:0,minute:0,second:0}),endTime:e.end.toFormat("HH:mm:ss")}}const Xs=(e,t)=>e.contains(t)||e.start.startOf("day").toMillis()===t.startOf("day").toMillis()||e.end.minus({minute:1}).startOf("day").toMillis()===t.startOf("day").toMillis(),Js={DateOnly:{Numeric:{year:"numeric",month:"2-digit",day:"2-digit"},MonthLong:{year:"numeric",month:"long",day:"numeric"},MonthShort:{year:"numeric",month:"short",day:"numeric"},WeekdayLongMonthLong:{year:"numeric",month:"long",day:"numeric",weekday:"long"},WeekdayShortMonthLong:{year:"numeric",month:"long",day:"numeric",weekday:"short"},WeekdayShortMonthShort:{year:"numeric",month:"short",day:"numeric",weekday:"short"},MonthLongYear:{year:"numeric",month:"long"}},TimeOnly:{hour:"2-digit",minute:"2-digit"},DateTime:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"},FullDateTime:{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"},ShortDateTime:{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}};function Qs(){return Us.c9.utc().toLocal().zoneName}function eo(e){if(!0===Array.isArray(e))return e.map(e=>null!=e&&"object"==typeof e?eo(e):e);if("boolean"==typeof e||"number"==typeof e||"string"==typeof e||null===e)return e;{const t={};return Object.keys(e).forEach(n=>{const i=e[n];Bn.includes(n)||Ln.includes(n)?t[n]=i&&Us.c9.fromISO(i,{zone:"UTC"}):Vn.includes(n)?Array.isArray(i)?t[n]=i.map(qs):t[n]=i&&qs(i):Un.includes(n)?t[n]=i&&Us.dw.fromISO(i):t[n]=null!=i&&"object"==typeof i?eo(i):i}),t}}function to(e){return null==e?[]:Array.isArray(e)?e:[e]}function no(e){return Array.isArray(e)&&e.length>0}function io(e){return!no(e)}function so(e,t,n){const i=new Set(e);return n?i.add(t):i.delete(t),Array.from(i)}function oo(e,t){const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),Array.from(n)}function ro(e,t,n){const i=[...e],[s]=i.splice(t,1);return i.splice(n,0,s),i}function ao(e,t){return e.filter((e,n)=>n!==t)}const lo="87790dade0461447f703ac51a8decccaedb4d369\n".trim();var co=n(7405);const uo="h-new-version";async function ho(e,t={}){let n=P.HEAVENT_API_URL.href;const i=new URL(location.href).searchParams,s=`${e} ${no(t.fragments)?Vs(t.fragments):""}`,o={"Content-Type":"application/json",[F]:lo,[M]:V()};i.has("lang")&&(n=`${n}?lang=${i.get("lang")}`),t.token&&(o[N]=t.token);const r=await fetch(n,{method:"post",headers:o,body:JSON.stringify({query:s,variables:t.variables||{}})});if(r.ok){t.reloadOnNewVersion&&"true"===r.headers.get("x-heavent-new-version")&&document.body.dispatchEvent(new CustomEvent(uo,{bubbles:!0}));const e=await r.json();if(e.errors){const t=e.errors[0]?.message??"";if("You need to be logged-in"===t)return localStorage.clear(),location.href="/crew",{};if(t.startsWith("You do not have access to this"))return location.href="/crew",{};throw e.errors}{const t=(0,co.A)(e.data),n={};return t.forEach(t=>{n[t]=eo(e.data[t])}),n}}throw new Error(r.statusText)}function mo(e,t,n){const i=Object.keys(t).sort().map(e=>{const n=t[e];return`"${e}":${JSON.stringify(n)}`}).join(",");return(0,L.useMemo)(()=>K().then(i=>ho(e,{variables:t,token:i||void 0,fragments:n})),[e,i])}const go="query CustomFieldsMassEditInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n }\n}\n",po="query DelegationsMassEditInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n campaigns(level: $level, eventId: $eventId, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n customFields(variety: Delegation, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n delegationsCategories(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n forms(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n\n event: eventMaybe(id: $eventId) {\n customDocuments {\n slug\n name\n }\n }\n }\n}\n",fo='query PositionsSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $ids: [PositionId!]!\n $name: String\n) {\n organization(id: $organizationId) {\n list: positions(\n eventId: $eventId\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n\n selected: positions(ids: $ids) @include(if: $hasSelected) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',xo="query Tags($organizationId: OrganizationId!, $eventId: EventId, $context: TagContext) {\n organization(id: $organizationId) {\n tags(eventId: $eventId, context: $context) {\n nodes {\n id\n name\n }\n }\n }\n}\n",_o="query Users(\n $organizationId: OrganizationId!\n $eventId: EventId\n $predicates: [Predicate!]!\n $name: String\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: UsersInfosSort\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $includeDelegations: Boolean!\n $includeEvents: Boolean!\n $includeForms: Boolean!\n $includeTags: Boolean!\n $includeRoles: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: usersInfos(\n predicates: $predicates\n name: $name\n columnsSearch: $columnsSearch\n delegationCategoryId: $delegationCategoryId\n delegationId: $delegationId\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...UserInfoCommunity\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",Io="query Volunteers(\n $eventId: EventId!\n $predicates: [Predicate!]!\n $limit: Int\n $offset: Int\n $sort: VolunteersRegistrationsSort\n $name: String\n $columnsSearch: [String!]\n $positionCategoryId: PositionsCategoryId\n $positionId: PositionId\n $preassignedPositionCategoryId: PositionsCategoryId\n $preassignedPositionId: PositionId\n $accreditationCategoryId: AccreditationsCategoryId\n $accreditationId: AccreditationId\n $accreditationSlotId: AccreditationsSlotId\n $delegationCategoryId: DelegationsCategoryId\n $delegationId: DelegationId\n $hasCoordinates: Boolean\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeDelegation: Boolean!\n $includeDuplicatedFrom: Boolean!\n $includeEmails: Boolean!\n $includeFormsUsersInfos: Boolean!\n $includeForms: Boolean!\n $includeIsEditable: Boolean!\n $includeNumberOfAccreditations: Boolean!\n $includeNumberOfAssignments: Boolean!\n $includeNumberOfAssignmentsDays: Boolean!\n $includeNumberOfAvailableDays: Boolean!\n $includePicture: Boolean!\n $includePositions: Boolean!\n $includeRoles: Boolean!\n $includeTags: Boolean!\n $includeTeam: Boolean!\n $includeTraces: Boolean!\n $includeVolunteerMinutes: Boolean!\n $includeWishedPositions: Boolean!\n $includePreassignedPositions: Boolean!\n $includeWeezeventChecklists: Boolean!\n $includeWeezevent: Boolean!\n $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n layer\n latitude\n longitude\n\n rows: volunteersRegistrations(\n predicates: $predicates\n name: $name\n columnsSearch: $columnsSearch\n positionCategoryId: $positionCategoryId\n positionId: $positionId\n preassignedPositionCategoryId: $preassignedPositionCategoryId\n preassignedPositionId: $preassignedPositionId\n accreditationCategoryId: $accreditationCategoryId\n accreditationId: $accreditationId\n accreditationSlotId: $accreditationSlotId\n delegationCategoryId: $delegationCategoryId\n delegationId: $delegationId\n hasCoordinates: $hasCoordinates\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...VolunteerRegistration\n }\n\n numberOfPages\n totalCount\n }\n\n traces @include(if: $includeTraces) {\n ...Trace\n }\n }\n}\n",vo="mutation UserCreate {\n userCreate {\n id\n email\n }\n}\n";function bo(e){return Zn('query AccreditAssignWaitingMembers(\n $eventId: EventId!\n $states: [VolunteerRegistrationState!]\n $accreditationStates: [AccreditationState!]\n $name: String\n $segmentId: SegmentId\n $delegationId: DelegationId\n $direction: SortDirection!\n $loadDelegations: Boolean!\n) {\n event(id: $eventId) {\n delegations @include(if: $loadDelegations) {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n\n volunteersRegistrations(\n states: $states\n accreditationStates: $accreditationStates\n name: $name\n segmentId: $segmentId\n delegationId: $delegationId\n sort: { attribute: "InsertedAt", direction: $direction }\n ) {\n nodes {\n ...VolunteerRegistrationWaitingAssignment\n }\n\n totalCount\n }\n }\n}\n',e,[Ls.VolunteerRegistrationWaitingAssignmentFragment])}function jo(e={}){return Xn("mutation VolunteersRegistrationsMassAccredit(\n $eventId: EventId!\n $massAccredit: MassAccreditInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccredit(\n eventId: $eventId\n massAccredit: $massAccredit\n )\n}\n",e)}function Co(e={}){return Xn("mutation CampaignCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaign: CampaignInput!\n) {\n campaignCreate(organizationId: $organizationId, eventId: $eventId, campaign: $campaign) {\n id\n }\n}\n",e)}function yo(e={}){return Xn("mutation CampaignUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaignId: CampaignId!\n $campaign: CampaignInput!\n) {\n campaignUpdate(\n organizationId: $organizationId\n eventId: $eventId\n campaignId: $campaignId\n campaign: $campaign\n ) {\n id\n }\n}\n",e)}function ko(e){return Zn("query CreateCampaignInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId\n) {\n organization(id: $organizationId) {\n adminEmail\n emailSenderId\n timeZone\n\n emailsSenders {\n ...CreateCampaignEmailSender\n }\n\n event: eventMaybe(id: $eventId) {\n timeZone\n\n customDocuments {\n slug\n name\n }\n\n emailSender {\n ... on EmailsSender {\n id\n }\n }\n }\n\n userInfo: userInfoMaybe(id: $userInfoId) {\n name\n }\n }\n}\n",e,[Ls.CreateCampaignEmailSenderFragment])}function Ao(e={}){return Xn("mutation EventLayerUpdate($eventId: EventId!, $layer: MapLayer!) {\n eventLayerUpdate(eventId: $eventId, layer: $layer) {\n id\n }\n}\n",e)}function wo(e={}){return Xn("mutation AccreditationsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: accreditationsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function So(e={}){return Xn("mutation CustomFieldsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n numberOfEdited: customFieldsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function Eo(e,t){return ho(go,{variables:e,token:t||void 0,fragments:[]})}function To(e={}){return Xn("mutation DelegationsMassEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massEdit: MassEditInput!\n) {\n numberOfEdited: delegationsMassEdit(\n organizationId: $organizationId\n eventId: $eventId\n massEdit: $massEdit\n )\n}\n",e)}function zo(e,t){return ho(po,{variables:e,token:t||void 0,fragments:[Ls.MassEditCustomFieldFragment]})}function Oo(e={}){return Xn("mutation EventsMassEdit($organizationId: OrganizationId!, $massEdit: MassEditInput!) {\n eventsMassEdit(organizationId: $organizationId, massEdit: $massEdit)\n}\n",e)}function Ro(e={}){return Xn("mutation PositionsMassEdit($eventId: EventId!, $massEdit: MassEditInput!) {\n numberOfEdited: positionsMassEdit(eventId: $eventId, massEdit: $massEdit)\n}\n",e)}function $o(e={}){return Xn("mutation UsersInfosMassEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $massEdit: MassEditInput!\n) {\n numberOfEdited: usersInfosMassEdit(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n massEdit: $massEdit\n )\n}\n",e)}function Do(e,t){return ho("query DelegationAccreditationSlotStats(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.DelegationAccreditationSlotStatsFragment]})}function Po(e={}){return Xn("mutation EventDocumentsExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId\n $documentsExport: DocumentsExportInput!\n) {\n eventDocumentsExport(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n documentsExport: $documentsExport\n )\n}\n",e)}function Fo(e={}){return Xn("mutation UsersInfosMassDelegationDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n $selecteds: MassActionSelectedsInput!\n $deleteFromEvent: Boolean\n) {\n usersInfosMassDelegationDelete(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n selecteds: $selecteds\n deleteFromEvent: $deleteFromEvent\n )\n}\n",e)}function Mo(e){return Zn("query OrganizationParametersInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...OrganizationAdminInfos\n }\n}\n",e,[Ls.OrganizationAdminInfosFragment])}function No(e={}){return Xn("mutation PositionsSlotsUsersInfosCheckIn($eventId: EventId!, $checkIn: PositionSlotCheckInInput!) {\n numberOfMembers: positionsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}function Lo(e){return Zn("query UserPositions(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n name\n startAt\n endAt\n dayStartTime\n hasFormWithPositionDisplay\n hasFormWithSlotDisplay\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n volunteerMinutes\n\n positionsSlotsUsersInfos {\n ...UserPositionSlotUserInfo\n }\n\n preassignPositions {\n id\n name\n range\n }\n\n preassignPositionsCategories {\n id\n name\n range\n }\n }\n }\n}\n",e,[Ls.FormsUsersInfosWishedFragment,Ls.UserPositionSlotUserInfoFragment])}function Bo(e,t){return ho(xo,{variables:e,token:t||void 0,fragments:[]})}function Vo(e={}){return Xn("mutation VolunteersRegistrationsMassDelete(\n $eventId: EventId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Uo(e,t){return ho("query User(\n $organizationId: OrganizationId!\n $eventId: EventId\n $id: UsersInfoId!\n $includeDelegations: Boolean!\n $includeEvents: Boolean!\n $includeForms: Boolean!\n $includeTags: Boolean!\n $includeRoles: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: userInfo(id: $id) {\n ...UserInfoCommunity\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.UserInfoCommunityFragment]})}function Wo(e,t){return ho(_o,{variables:e,token:t||void 0,fragments:[Ls.UserInfoCommunityFragment]})}function Go(e){return Zn("query Profile($organizationId: OrganizationId!) {\n user {\n email\n language\n\n userInfo(organizationId: $organizationId) {\n id\n fields\n }\n }\n}\n",e,[])}function Ho(e={}){return Xn("mutation UserProfileUpdate(\n $userId: UserId!\n $userInfoId: UsersInfoId!\n $userInfo: UsersInfoEmailInput!\n) {\n userProfileUpdate(userId: $userId, userInfoId: $userInfoId, userInfo: $userInfo) {\n email\n language\n }\n}\n",e)}function qo(e={}){return Xn("mutation EmailResend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n $emailType: EmailType!\n) {\n emailResend(\n organizationId: $organizationId\n eventId: $eventId\n userInfoId: $userInfoId\n emailType: $emailType\n ) {\n id\n }\n}\n",e)}function Yo(e){return Zn("query UserOverlaySlots(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n hasFormWithSlotDisplay\n }\n}\n",e,[Ls.FormsUsersInfosWishedFragment])}function Ko(e={}){return Xn("mutation VolunteersRegistrationsAccreditationsValidate(\n $eventId: EventId!\n $delegationId: DelegationId!\n $usersInfosIds: [UsersInfoId!]\n) {\n volunteersRegistrationsAccreditationsValidate(\n eventId: $eventId\n delegationId: $delegationId\n usersInfosIds: $usersInfosIds\n )\n}\n",e)}function Zo(e={}){return Xn("mutation VolunteersRegistrationsMassAccreditationStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassAccreditationStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassAccreditationStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function Xo(e={}){return Xn("mutation VolunteersRegistrationsMassAssign($eventId: EventId!, $massAssign: MassAssignInput!) {\n numberOfMembers: volunteersRegistrationsMassAssign(eventId: $eventId, massAssign: $massAssign)\n}\n",e)}function Jo(e={}){return Xn("mutation VolunteersRegistrationsMassDelegationAdd(\n $eventId: EventId!\n $delegationId: DelegationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassDelegationAdd(\n eventId: $eventId\n delegationId: $delegationId\n selecteds: $selecteds\n )\n}\n",e)}function Qo(e={}){return Xn("mutation VolunteersRegistrationsMassStateUpdate(\n $eventId: EventId!\n $massStateUpdate: MassStateUpdateInput!\n) {\n numberOfMembers: volunteersRegistrationsMassStateUpdate(\n eventId: $eventId\n massStateUpdate: $massStateUpdate\n )\n}\n",e)}function er(e){return Zn("query VolunteersSegments(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $privacy: CustomFieldPrivacy!\n $loadForms: Boolean!\n $loadSegments: Boolean!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n dayStartTime\n isWeezeventConnected\n\n forms @include(if: $loadForms) {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(segmentType: Volunteers) @include(if: $loadSegments) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",e,[Ls.SegmentCustomFieldFragment,Ls.SegmentsFoldersSegmentsFragment])}function tr(e,t){return ho("query UpdateCellDelegations($eventId: EventId!) {\n event(id: $eventId) {\n delegations {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function nr(e={}){return Xn("mutation VolunteerRegistrationUpdateField(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n $slug: String!\n $value: JSON!\n) {\n volunteerRegistrationUpdateField(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n slug: $slug\n value: $value\n ) {\n id\n }\n}\n",e)}function ir(e,t){return ho("query Volunteer(\n $eventId: EventId!\n $id: VolunteersRegistrationId!\n $delegationId: DelegationId\n $onlyVisibleAccreditationsSlots: Boolean\n $includeAccreditations: Boolean!\n $includeAccreditationsMatrix: Boolean!\n $includeAvailability: Boolean!\n $includeCanRegistrationStateUpdate: Boolean!\n $includeComments: Boolean!\n $includeDelegation: Boolean!\n $includeDuplicatedFrom: Boolean!\n $includeEmails: Boolean!\n $includeFormsUsersInfos: Boolean!\n $includeForms: Boolean!\n $includeIsEditable: Boolean!\n $includeNumberOfAccreditations: Boolean!\n $includeNumberOfAssignments: Boolean!\n $includeNumberOfAssignmentsDays: Boolean!\n $includeNumberOfAvailableDays: Boolean!\n $includePicture: Boolean!\n $includePositions: Boolean!\n $includeRoles: Boolean!\n $includeTags: Boolean!\n $includeTeam: Boolean!\n $includeVolunteerMinutes: Boolean!\n $includeWishedPositions: Boolean!\n $includePreassignedPositions: Boolean!\n $includeWeezeventChecklists: Boolean!\n $includeWeezevent: Boolean!\n $includeWeezeventUrls: Boolean!\n) {\n data: event(id: $eventId) {\n row: volunteerRegistration(id: $id) {\n ...VolunteerRegistration\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.VolunteerRegistrationFragment]})}function sr(e){return Zn(Io,e,[Ls.VolunteerRegistrationFragment,Ls.TraceFragment])}function or(e,t){return ho(Io,{variables:e,token:t||void 0,fragments:[Ls.VolunteerRegistrationFragment,Ls.TraceFragment]})}function rr(e={}){return Xn("mutation UsersInfosMassCampaignSend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $campaignId: CampaignId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassCampaignSend(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n campaignId: $campaignId\n selecteds: $selecteds\n )\n}\n",e)}function ar(e={}){return Xn("mutation VolunteersRegistrationsMassWishedAccreditationsUpdate(\n $eventId: EventId!\n $delegationId: DelegationId!\n $massAccredit: MassAccreditInput!\n) {\n volunteersRegistrationsMassWishedAccreditationsUpdate(\n eventId: $eventId\n delegationId: $delegationId\n massAccredit: $massAccredit\n )\n}\n",e)}const lr=()=>{const{code:e,source:t,organizationId:n,eventId:i}=Jn();return(0,L.useEffect)(()=>{const s=localStorage.getItem(W),o=localStorage.getItem(U);if(m(s)&&m(o)&&m(e)&&m(t)){localStorage.removeItem(W),localStorage.removeItem(U);const r=new B.TU({Username:s,Pool:q()});r.Session=o,r.setAuthenticationFlowType("CUSTOM_AUTH"),r.sendCustomChallengeAnswer(e,{async onSuccess(e){const s=e.getIdToken().getJwtToken();await ho(vo,{token:s}),n&&i&&t===Qe.VolunteerRegister?location.href=Fs(n,i):n&&i&&t===Qe.VolunteerAssignments?location.href=Ms(n,i):t===Qe.App?location.href=$s.HOME:location.href="/"},onFailure(e){ri("Could not sendCustomChallengeAnswer",e),location.href="/"}})}else location.href="/"},[]),null};var dr=n(5126);function cr(e){if(e){const[t,n,i]=e.split(" ");return{color:t,fontSize:n,fontWeight:i}}return{}}function ur(e){return"string"==typeof e?e:"number"==typeof e?e<=1?100*e+"%":`${e}px`:void 0}var hr=n(3345);const mr={mobile:"screen and (max-width: 743px)",tablet:"screen and (min-width: 744px)",desktop:"screen and (min-width: 1280px)"},gr="-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",{styled:pr,theme:fr,config:xr,getCssText:_r,createTheme:Ir,keyframes:vr,reset:br}=(0,hr.GC)({theme:{colors:{gray25:"#fcfcfd",gray50:"#f9fafb",gray100:"#f2f4f7",gray200:"#e4e7ec",gray300:"#d0d5dd",gray400:"#98a2b3",gray500:"#667085",gray600:"#475467",gray700:"#344054",gray800:"#1d2939",gray900:"#101828",grayDark50:"#f0f3f4",grayDark100:"#dfe4e7",grayDark500:"#667c8a",grayDark700:"#3d4a52",primary25:"#fcfaff",primary50:"#f8fbff",primary100:"#f0f8ff",primary200:"#eef7ff",primary300:"#dceeff",primary400:"#b3daff",primary500:"#359dfe",primary600:"#4ba7fe",primary700:"#0284fe",primary800:"#026dd6",primary900:"#01408f",error25:"#fffbfa",error50:"#fef3f2",error100:"#fee4e2",error200:"#fecdca",error300:"#fda29b",error400:"#f97066",error500:"#f04438",error600:"#d92d20",error700:"#b42318",error800:"#912018",error900:"#7a271a",warning25:"#fffcf5",warning50:"#fffaeb",warning100:"#fef0c7",warning200:"#fedf89",warning300:"#fec84b",warning400:"#fdb022",warning500:"#f79009",warning600:"#dc6803",warning700:"#b54708",warning800:"#93370d",warning900:"#7a2e0e",success25:"#f6fef9",success50:"#ecfdf3",success100:"#d1fadf",success200:"#a6f4c5",success300:"#6ce9a6",success400:"#32d583",success500:"#12b76a",success600:"#039855",success700:"#027a48",success800:"#05603a",success900:"#054f31",blue25:"#f5faff",blue50:"#edf4fd",blue100:"#dae9fb",blue200:"#b2ddff",blue300:"#84caff",blue400:"#53b1fd",blue500:"#4995ec",blue600:"#1570ef",blue700:"#1157a6",blue800:"#1849a9",blue900:"#194185",blueGray50:"#edeef8",blueGray100:"#daddf1",blueGray500:"#4352af",blueGray600:"#3e4784",blueGray700:"#29326b",blueGray900:"#272e3c",blueLight50:"#eff9fb",blueLight100:"#dff2f6",blueLight500:"#54bad1",blueLight600:"#0086C9",blueLight700:"#267a8d",purple25:"#fafaff",purple50:"#f4e7f8",purple100:"#ecd4f2",purple200:"#d9d6fe",purple300:"#bdb4fe",purple400:"#9b8afb",purple500:"#9033aa",purple600:"#6938ef",purple700:"#571f66",purple800:"#4a1fb8",purple900:"#3e1c96",purpleLight50:"#f9e7f8",purpleLight100:"#f2cef1",purpleLight500:"#9d2999",purpleLight700:"#5d185b",purpleDark50:"#f0ecf8",purpleDark100:"#ded5f0",purpleDark500:"#613eb1",purpleDark700:"#3a256a",pink25:"#fef6fb",pink50:"#fdf2fa",pink100:"#fce7f6",pink200:"#fcceee",pink300:"#faa7e0",pink400:"#f670c7",pink500:"#ee46bc",pink600:"#dd2590",pink700:"#c01574",pink800:"#9e165f",pink900:"#851651",orange50:"#fcefed",orange100:"#f9dbd7",orange500:"#e15241",orange700:"#962418",redLight50:"#fff1f3",redLight100:"#ffe4e8",redLight500:"#f63d68",redLight700:"#c01048",redDark50:"#fbeaef",redDark100:"#f7d9e2",redDark500:"#d63865",redDark700:"#871c3a",green50:"#eff6ee",green100:"#dfeedd",green500:"#67ad5c",green700:"#3c6935",greenDark50:"#eaf6f4",greenDark100:"#d5ece9",greenDark500:"#429488",greenDark700:"#275851",brown50:"#f3eeec",brown100:"#e5dbd7",brown500:"#74574a",brown700:"#44342c",white:"white"},space:{1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px",7:"32px",8:"40px",9:"48px",10:"64px",11:"80px",12:"96px",13:"128px"},fonts:{default:`'Open Sans', ${gr}`,grafik:`Graphik, ${gr}`,montserrat:`Montserrat, ${gr}`,madurai:`'Hind Madurai', ${gr}`,gravur:`'Gravur Condensed', ${gr}`,anton:`Anton, ${gr}`,brito:`'Brito Tri', ${gr}`,orbitron:`Orbitron, ${gr}`,dharma:`'Dharma Punk', ${gr}`,roboto:`Roboto, ${gr}`,poppins:`Poppins, ${gr}`,inter:`Inter, ${gr}`,paytone:`'Paytone One', ${gr}`,gothamBlack:`'Gotham Black', ${gr}`,gothamBold:`'Gotham Bold', ${gr}`,gothamBook:`'Gotham Book', ${gr}`,gothamMedium:`'Gotham Medium', ${gr}`,now:`'Now Medium', ${gr}`,franklinGothic:`'Franklin Gothic', ${gr}`,kobe:`Kobe, ${gr}`,nowMedium:`"Now Medium", ${gr}`,nowSemiBold:`"Now SemiBold", ${gr}`,badTyp:`BadTyp, ${gr}`,lemonMilk:`LemonMilk, ${gr}`,futura:`Futura, ${gr}`,urbanist:`Urbanist, ${gr}`,unbounded:`Unbounded, ${gr}`,magallanes:`Magallanes, ${gr}`,parisine:`ParisineBold, ${gr}`,bricolage:`Bricolage, ${gr}`,paris2024:`Paris2024, ${gr}`,dinCondensed:`DinCondensed, ${gr}`,gothamRoundedBook:`"Gotham Rounded Book", ${gr}`,gothamRoundedBold:`"Gotham Rounded Bold", ${gr}`,gothamRoundedMedium:`"Gotham Rounded Medium", ${gr}`,albert:`"Albert Sans", ${gr}`,bebasNeue:`BebasNeue, ${gr}`,encode:`"Encode Sans", ${gr}`,gilroy:`Gilroy, ${gr}`,tuskerGrotesk:`TuskerGrotesk, ${gr}`,rubik:`Rubik, ${gr}`,bnCartaNoirBold:`"BN Carta Noir Bold", ${gr}`,firaSans:`"Fira Sans", ${gr}`,arimo:`Arimo, ${gr}`,neueMontreal:`NeueMontreal, ${gr}`,helveticaBlackCondensed:`HelveticaBlackCondensed, ${gr}`,zuumeMedium:`"Zuume Medium", ${gr}`,zuumeBold:`"Zuume Bold", ${gr}`,formulaCondensedBold:`FormulaCondensedBold, ${gr}`,raleway:`Raleway, ${gr}`,avenir:`Avenir, ${gr}`,work:`"Work Sans", ${gr}`,movement:`Movement, ${gr}`,atrament:`Atrament, ${gr}`,sharpGrotesk:`SharpGrotesk, ${gr}`,utopiales:`Utopiales, ${gr}`,lato:`Lato, ${gr}`,helveticaNeue97BlackCondensed:`HelveticaNeue97BlackCondensed, ${gr}`,graphie:`Graphie, ${gr}`,archerBoldPro:`ArcherBoldPro, ${gr}`,acumin:`Acumin, ${gr}`,kabel:`Kabel, ${gr}`,moonstruck:`Moonstruck, ${gr}`,chillax:`Chillax, ${gr}`,neufileGrotesk:`NeufileGrotesk, ${gr}`,tungsten:`Tungsten, ${gr}`,benguiat:`benguiat, ${gr}`},fontSizes:{textXs:"12px",textSm:"14px",textMd:"16px",textLg:"18px",textXl:"20px",displayXs:"24px",displaySm:"30px",displayMd:"36px",displayLg:"48px",displayXl:"60px",display2Xl:"72px"},fontWeights:{regular:400,medium:500,semiBold:600,bold:700},radii:{1:"4px",2:"8px",3:"12px"},shadows:{xs:"0px 1px 2px rgba(16, 24, 40, 0.05)",sm:"0px 1px 3px rgba(16, 24, 40, 0.1), 0px 1px 2px rgba(16, 24, 40, 0.06)",md:"0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06)",mdReverse:"0px -4px 8px -2px rgba(16, 24, 40, 0.1), 0px -2px 4px -2px rgba(16, 24, 40, 0.06)",lg:"0px 12px 16px -4px rgba(16, 24, 40, 0.1), 0px 4px 6px -2px rgba(16, 24, 40, 0.05)",xl:"0px 20px 24px -4px rgba(16, 24, 40, 0.1), 0px 8px 8px -4px rgba(16, 24, 40, 0.04)","2xl":"0px 24px 48px -12px rgba(16, 24, 40, 0.25)","3xl":"0px 32px 64px -12px rgba(16, 24, 40, 0.2)"},sizes:{container:"1170px",containerTablet:"704px",modalSm:"480px",modalMd:"640px",modalLg:"720px",cellHeightSm:"48px",cellHeightMd:"64px",cellHeightXl:"120px",cellWidth:"120px"}},media:mr,utils:{bd:e=>{let t="$gray200",n="$2",i="$xs";if(m(e)){const s=function(e){if(e){const[t,n,i]=e.split(" ");return{borderColor:t,borderRadius:n,boxShadow:i}}return{}}(e);s.borderColor&&(t=`$${s.borderColor}`),s.borderRadius&&(n=`$${s.borderRadius}`),i=s.boxShadow?`$${s.boxShadow}`:void 0}return{borderColor:t,borderRadius:n,borderStyle:"solid",borderWidth:"1px",boxShadow:i}},clamp:e=>({display:"-webkit-box",overflow:"hidden","-webkit-line-clamp":e,"-webkit-box-orient":"vertical"}),ellipsis:()=>({overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"}),px:e=>({paddingLeft:e,paddingRight:e}),py:e=>({paddingBottom:e,paddingTop:e})}}),jr=Ir("weezcrew-theme",{}),Cr=pr("div",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},gray800:{color:"$gray800"},gray900:{color:"$gray900"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primary600:{color:"$primary600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},error25:{color:"$error25"},error50:{color:"$error50"},error100:{color:"$error100"},error200:{color:"$error200"},error300:{color:"$error300"},error400:{color:"$error400"},error500:{color:"$error500"},error600:{color:"$error600"},error700:{color:"$error700"},error800:{color:"$error800"},error900:{color:"$error900"},warning25:{color:"$warning25"},warning50:{color:"$warning50"},warning100:{color:"$warning100"},warning200:{color:"$warning200"},warning300:{color:"$warning300"},warning400:{color:"$warning400"},warning500:{color:"$warning500"},warning600:{color:"$warning600"},warning700:{color:"$warning700"},warning800:{color:"$warning800"},warning900:{color:"$warning900"},success25:{color:"$success25"},success50:{color:"$success50"},success100:{color:"$success100"},success200:{color:"$success200"},success300:{color:"$success300"},success400:{color:"$success400"},success500:{color:"$success500"},success600:{color:"$success600"},success700:{color:"$success700"},success800:{color:"$success800"},success900:{color:"$success900"},blue25:{color:"$blue25"},blue50:{color:"$blue50"},blue100:{color:"$blue100"},blue200:{color:"$blue200"},blue300:{color:"$blue300"},blue400:{color:"$blue400"},blue500:{color:"$blue500"},blue600:{color:"$blue600"},blue700:{color:"$blue700"},blue800:{color:"$blue800"},blue900:{color:"$blue900"},blueGray25:{color:"$blueGray25"},blueGray50:{color:"$blueGray50"},blueGray100:{color:"$blueGray100"},blueGray200:{color:"$blueGray200"},blueGray300:{color:"$blueGray300"},blueGray400:{color:"$blueGray400"},blueGray500:{color:"$blueGray500"},blueGray600:{color:"$blueGray600"},blueGray700:{color:"$blueGray700"},blueGray800:{color:"$blueGray800"},blueGray900:{color:"$blueGray900"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight600:{color:"$blueLight600"},blueLight900:{color:"$blueLight900"},purple25:{color:"$purple25"},purple50:{color:"$purple50"},purple100:{color:"$purple100"},purple200:{color:"$purple200"},purple300:{color:"$purple300"},purple400:{color:"$purple400"},purple500:{color:"$purple500"},purple600:{color:"$purple600"},purple700:{color:"$purple700"},purple800:{color:"$purple800"},purple900:{color:"$purple900"},pink25:{color:"$pink25"},pink50:{color:"$pink50"},pink100:{color:"$pink100"},pink200:{color:"$pink200"},pink300:{color:"$pink300"},pink400:{color:"$pink400"},pink500:{color:"$pink500"},pink600:{color:"$pink600"},pink700:{color:"$pink700"},pink800:{color:"$pink800"},pink900:{color:"$pink900"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},indigo100:{color:"$indigo100"},indigo600:{color:"$indigo600"},white:{color:"white"}},fontSize:{inherit:{fontSize:"inherit"},textXs:{fontSize:"$textXs"},textSm:{fontSize:"$textSm"},textMd:{fontSize:"$textMd"},textLg:{fontSize:"$textLg"},textXl:{fontSize:"$textXl"},displayXs:{fontSize:"$displayXs"},displaySm:{fontSize:"$displaySm"},displayMd:{fontSize:"$displayMd"},displayLg:{fontSize:"$displayLg"},displayXl:{fontSize:"$displayXl"},display2Xl:{fontSize:"$display2Xl"}},fontWeight:{inherit:{fontWeight:"inherit"},regular:{fontWeight:"$regular"},medium:{fontWeight:"$medium"},semiBold:{fontWeight:"$semiBold"},bold:{fontWeight:"$bold"}},textAlign:{start:{textAlign:"start"},end:{textAlign:"end"},center:{textAlign:"center"},justify:{textAlign:"justify"}},ellipsis:{true:{ellipsis:""}}},defaultVariants:{color:"inherit",fontSize:"inherit",fontWeight:"inherit",textAlign:"start"}}),yr=L.forwardRef((e,t)=>{const n={};return e.height&&(n.height=ur(e.height)),e.width&&(n.width=ur(e.width)),(0,i.jsx)(Cr,{...(0,dr.A)(e,"font"),...cr(e.font),ref:t,css:{...n,...e.css}})});yr.displayName="Box";var kr=n(4625),Ar=n(6347),wr=n(8542);function Sr(e){return"number"==typeof e&&!isNaN(e)}function Er(e,t=96){return Math.round(25.4*e/t)}function Tr(e){return e?{lat:e.latitude,lng:e.longitude}:null}const zr=Tr({latitude:43.6087733,longitude:3.87963579999996}),Or=13;function Rr(e,t,n){return{center:e??zr,zoom:t??Or,fullscreenControl:!1,mapTypeControl:!1,streetViewControl:!1,mapTypeId:Dr(n),styles:[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"poi.government",stylers:[{visibility:"on"}]},{featureType:"poi.park",stylers:[{visibility:"on"}]}]}}function $r(e){return Sr(e.latitude)&&Sr(e.longitude)?(0,wr.A)(e,["latitude","longitude"]):void 0}function Dr(e){return e===et.GoogleSatellite?"satellite":e===et.Google?"roadmap":e??et.Google}var Pr=n(6996),Fr=n(2096);function Mr(){return new google.maps.ImageMapType({getTileUrl:(e,t)=>((e,t)=>`https://data.geopf.fr/wmts?${["REQUEST=GetTile","SERVICE=WMTS","VERSION=1.0.0","STYLE=normal","TILEMATRIXSET=PM",`FORMAT=${encodeURIComponent("image/png")}`,"LAYER=GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2",`TILEMATRIX=${t}`,`TILEROW=${e.y}`,`TILECOL=${e.x}`].join("&")}`)(e,t),tileSize:new google.maps.Size(256,256),name:et.IgnPlan,maxZoom:18})}const Nr=(0,L.memo)(e=>{const t=(0,L.useCallback)(t=>{t&&(n.current&&(s.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{zoom:e.coordinatesFieldsProps?.zoomProps.input.value??e.initialZoom??Or,center:Tr(e.center)||zr,gestureHandling:"cooperative",mapTypeControl:!1,streetViewControl:!1,mapTypeId:Dr(e.layer),...e.mapOptions||{}}),n.current.mapTypes.set(et.IgnPlan,Mr()),n.current.addListener("zoom_changed",()=>{e.coordinatesFieldsProps&&e.coordinatesFieldsProps.zoomProps.input.onChange(n.current.getZoom())}),n.current.addListener("tilesloaded",()=>{e.onTilesloaded?.()}),r())},[]),n=(0,L.useRef)(null),s=(0,L.useRef)(null),o=(0,L.useRef)([]),r=()=>{o.current.forEach(e=>e.setMap(null)),no(e.traces)?o.current=e.traces.map(e=>{const t=e.points.map(([e,t])=>({lat:e,lng:t})),i=e.direction===St.None?[]:[{icon:{path:e.direction===St.Backward?google.maps.SymbolPath.BACKWARD_OPEN_ARROW:google.maps.SymbolPath.FORWARD_OPEN_ARROW,scale:4,strokeColor:e.color},offset:"0%",repeat:"200px"}],s=new google.maps.Polyline({path:t,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,icons:i});return s.setMap(n.current),s}):o.current=[]};return(0,L.useEffect)(()=>{(()=>{if(s.current&&s.current.setMap(null),e.point&&n.current){const t=Tr(e.point);n.current.setCenter(t),s.current=new google.maps.Marker({position:t,map:n.current,draggable:"object"==typeof e.coordinatesFieldsProps&&null!==e.coordinatesFieldsProps}),e.coordinatesFieldsProps&&s.current.addListener("dragend",t=>{e.coordinatesFieldsProps?.latitudeProps.input.onChange(t.latLng.lat()),e.coordinatesFieldsProps?.longitudeProps.input.onChange(t.latLng.lng())})}})()},[JSON.stringify(e.point)]),(0,L.useEffect)(()=>{n.current?.setMapTypeId(Dr(e.layer))},[e.layer]),(0,L.useEffect)(()=>{r()},[JSON.stringify(e.traces||[])]),(0,i.jsx)(yr,{ref:t,height:1,width:1,children:e.coordinatesFieldsProps?.zoomProps&&(0,i.jsx)(Fr.Yr,{name:e.coordinatesFieldsProps.zoomProps.input.name,children:e=>{n.current?.setZoom(e)}})})},Pr.A);Nr.displayName="Map";const Lr=()=>(0,Ht.createPortal)((0,i.jsx)(yr,{className:"h-map-loaded",css:{background:"transparent",height:"1px",left:"-100px",position:"absolute",top:"-100px",width:"1px"}}),document.body),Br="query BackofficeOrganization($organizationId: OrganizationId!) {\n data: backoffice {\n row: organization(id: $organizationId) {\n ...OrganizationBackoffice\n }\n }\n}\n";function Vr(e,t){return ho("query AccreditationsCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function Ur(e={}){return Xn("mutation AccreditationsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfAccreditations: accreditationsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function Wr(e={}){return Xn("mutation AccreditationSlotUpdate(\n $eventId: EventId!\n $accreditationSlotId: AccreditationsSlotId!\n $accreditationSlot: AccreditationsSlotInput!\n) {\n accreditationSlotUpdate(\n eventId: $eventId\n accreditationSlotId: $accreditationSlotId\n accrediationSlot: $accreditationSlot\n ) {\n id\n }\n}\n",e)}function Gr(e){return Zn('query SendEmailInfos($eventId: EventId!, $usersInfosIds: [UsersInfoId!]!, $name: String) {\n event(id: $eventId) {\n segments(segmentType: Volunteers) {\n id\n name\n }\n\n volunteersRegistrations(\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n\n userInfo {\n id\n nameOrEmail\n }\n }\n }\n\n selectedVolunteersRegistrations: volunteersRegistrations(\n userInfoIds: $usersInfosIds\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n\n userInfo {\n id\n nameOrEmail\n }\n }\n }\n }\n}\n',e,[])}function Hr(e,t){return ho(Br,{variables:e,token:t||void 0,fragments:[Ls.OrganizationBackofficeFragment]})}function qr(e,t){return ho("query BackofficeOrganizations(\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: OrganizationSort\n) {\n data: backoffice {\n rows: organizations(\n name: $name\n predicates: $predicates\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...OrganizationBackoffice\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.OrganizationBackofficeFragment]})}function Yr(e){return Zn("query CampaignPreview(\n $organizationId: OrganizationId!\n $campaignId: CampaignId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n campaign(id: $campaignId) {\n sendToEveryone\n preview(userInfoId: $userInfoId)\n subject: subjectPreview(userInfoId: $userInfoId)\n attachments\n sentAt\n states\n\n createdBy {\n name\n email\n picture {\n url\n }\n }\n\n documents {\n ...DocumentEmailPreview\n }\n\n emailSender {\n fromEmail\n fromName\n }\n\n usersInfos {\n id\n nameOrEmail\n }\n\n segments {\n id\n name\n }\n\n positionsCategories {\n id\n name\n }\n\n positions {\n id\n name\n }\n\n positionsSlots {\n id\n nameOrRange\n\n position {\n id\n name\n }\n }\n\n tags {\n id\n name\n }\n\n accreditationsCategories {\n id\n name\n }\n\n accreditations {\n id\n name\n }\n\n accreditationsSlots {\n id\n name\n\n accreditation {\n id\n name\n }\n }\n }\n }\n}\n",e,[Ls.DocumentEmailPreviewFragment])}function Kr(e){return Zn("query OrganizationImportInfos($organizationId: OrganizationId!, $variety: CustomFieldVariety) {\n organization(id: $organizationId) {\n customFields(\n variety: $variety\n fieldTypes: [\n Address\n Checkbox\n Country\n Date\n Datetime\n Language\n Nationality\n Number\n Phone\n Select\n Sex\n Text\n Textarea\n Time\n Validation\n ]\n ) {\n nodes {\n ...CustomFieldImport\n }\n }\n }\n}\n",e,[Ls.CustomFieldImportFragment])}function Zr(e={}){return Xn("mutation UsersInfosMerge(\n $organizationId: OrganizationId!\n $mainUserInfoId: UsersInfoId!\n $toMergeUsersInfosIds: [UsersInfoId!]!\n) {\n usersInfosMerge(\n organizationId: $organizationId\n mainUserInfoId: $mainUserInfoId\n toMergeUsersInfosIds: $toMergeUsersInfosIds\n ) {\n id\n }\n}\n",e)}function Xr(e={}){return Xn("mutation CustomFieldsMassDelete(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfCustomFields: customFieldsMassDelete(\n organizationId: $organizationId\n selecteds: $selecteds\n )\n}\n",e)}function Jr(e={}){return Xn("mutation DelegationCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegation: DelegationInput!\n) {\n delegationCreate(organizationId: $organizationId, eventId: $eventId, delegation: $delegation) {\n id\n }\n}\n",e)}function Qr(e={}){return Xn("mutation DelegationUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n $delegation: DelegationInput!\n) {\n delegationUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n delegation: $delegation\n ) {\n id\n }\n}\n",e)}function ea(e={}){return Xn("mutation DelegationDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId!\n) {\n delegationDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n ) {\n id\n }\n}\n",e)}function ta(e){return Zn("query Delegations(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $name: String\n $predicates: [Predicate!]\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: DelegationsSort\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDocuments: Boolean!\n $includeLeaders: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $includeUsedCustomFieldsFilled: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: delegations(\n level: $level\n eventId: $eventId\n name: $name\n predicates: $predicates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...DelegationsDelegation\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",e,[Ls.DelegationsDelegationFragment])}function na(e={}){return Xn("mutation DelegationsMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfDelegations: delegationsMassDelete(\n organizationId: $organizationId\n eventId: $eventId\n selecteds: $selecteds\n )\n}\n",e)}function ia(e){return Zn("query AllEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",e,[])}function sa(e){return Zn("query Events(\n $organizationId: OrganizationId!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: EventsSort\n $includeCreatedBy: Boolean!\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: events(\n name: $name\n predicates: $predicates\n offset: $offset\n limit: $limit\n sort: $sort\n ) {\n nodes {\n ...EventsEvent\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",e,[Ls.EventsEventFragment])}function oa(e={}){return Xn("mutation FormDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $newEventId: EventId\n) {\n formDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n newEventId: $newEventId\n ) {\n id\n }\n}\n",e)}function ra(e){return Zn("query Forms($organizationId: OrganizationId!, $level: OrganizationEventLevel!, $eventId: EventId) {\n organization(id: $organizationId) {\n forms(level: $level, eventId: $eventId) {\n nodes {\n ...FormList\n }\n }\n }\n}\n",e,[Ls.FormListFragment])}function aa(e){return Zn("query Form($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n }\n }\n}\n",e,[])}function la(e={}){return Xn("mutation PositionsMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n numberOfPositions: positionsMassLeadersEdit(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}function da(e){return Zn("query Organizations {\n organizations {\n id\n name\n }\n\n user {\n roles {\n organizationId\n type\n }\n }\n}\n",e,[])}function ca(e){return Zn("query OrganizationSpaceDesign(\n $organizationId: OrganizationId!\n $includeIntro: Boolean!\n $spaceType: SpaceType!\n) {\n organization(id: $organizationId) {\n spaceDesign(spaceType: $spaceType) {\n ...SpaceDesign\n }\n\n eventsShowcaseSettings @include(if: $includeIntro) {\n title\n description\n }\n }\n}\n",e,[Ls.SpaceDesignFragment])}function ua(e={}){return Xn("mutation OrganizationSpaceDesignUpdate(\n $organizationId: OrganizationId!\n $spaceDesign: DesignInput!\n $settings: EventsShowcaseSettingsDesignInput\n $spaceType: SpaceType!\n) {\n organizationSpaceDesignUpdate(\n organizationId: $organizationId\n spaceDesign: $spaceDesign\n settings: $settings\n spaceType: $spaceType\n ) {\n id\n }\n}\n",e)}function ha(e={}){return Xn("mutation UserDelete {\n userDelete {\n id\n }\n}\n",e)}function ma(e={}){return Xn("mutation UserAccessDelete($organizationId: OrganizationId!, $scope: AccessScope!, $id: Int!) {\n userAccessDelete(organizationId: $organizationId, scope: $scope, id: $id)\n}\n",e)}function ga(e={}){return Xn("mutation UserAccessUpdate(\n $organizationId: OrganizationId!\n $scope: AccessScope!\n $id: Int!\n $roleId: RoleId!\n $sendNotifications: Boolean\n) {\n userAccessUpdate(\n organizationId: $organizationId\n scope: $scope\n id: $id\n roleId: $roleId\n sendNotifications: $sendNotifications\n )\n}\n",e)}function pa(e,t){return ho("query PositionsCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}function fa(e={}){return Xn("mutation PositionsMassDelete($eventId: EventId!, $selecteds: MassActionSelectedsInput!) {\n numberOfPositions: positionsMassDelete(eventId: $eventId, selecteds: $selecteds)\n}\n",e)}function xa(e){return Zn("query Positions(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $hasCoordinates: Boolean\n $limit: Int\n $offset: Int\n $sort: PositionsSort\n $columnsSearch: [String!]\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeLeaders: Boolean!\n $includeTags: Boolean!\n $includeTraces: Boolean!\n) {\n data: event(id: $eventId) {\n layer\n latitude\n longitude\n\n rows: positions(\n name: $name\n predicates: $predicates\n hasCoordinates: $hasCoordinates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PositionsPosition\n }\n\n numberOfPages\n totalCount\n }\n\n traces @include(if: $includeTraces) {\n ...Trace\n }\n }\n}\n",e,[Ls.PositionsPositionFragment,Ls.TraceFragment])}function _a(e,t){return ho('query PositionsMobile(\n $eventId: EventId!\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $name: String\n) {\n event(id: $eventId) {\n positions(\n predicates: $predicates\n limit: $limit\n offset: $offset\n sort: { attribute: "Category", direction: Asc }\n name: $name\n ) {\n nodes {\n id\n name\n range\n resources\n assignedResources\n isVisible\n\n category {\n id\n name\n\n leaders {\n ...LeaderInfos\n }\n }\n\n slots {\n id\n }\n }\n\n pageInfo {\n ...FullPageInfo\n }\n\n totalCount\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[Ls.LeaderInfosFragment,Ls.FullPageInfoFragment]})}function Ia(e,t){return ho('query PositionSlotMembersMobile(\n $eventId: EventId!\n $positionSlotId: PositionsSlotId!\n $predicates: [Predicate!]!\n $limit: Int\n $offset: Int\n) {\n event(id: $eventId) {\n positionSlot(id: $positionSlotId) {\n name\n positionCategoryId\n range\n }\n\n volunteersRegistrations(\n positionSlotId: $positionSlotId\n predicates: $predicates\n limit: $limit\n offset: $offset\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n\n positionSlotUserInfo(positionSlotId: $positionSlotId) {\n id\n state\n }\n\n userInfo {\n id\n name\n email\n picture {\n url\n }\n }\n }\n\n pageInfo {\n ...FullPageInfo\n }\n\n totalCount\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[Ls.FullPageInfoFragment]})}function va(e,t){return ho("query PositionSlotsMobile($eventId: EventId!, $positionId: PositionId!, $limit: Int, $offset: Int) {\n event(id: $eventId) {\n positionsSlots(positionsIds: [$positionId], limit: $limit, offset: $offset) {\n nodes {\n ...PositionPositionSlot\n }\n\n pageInfo {\n ...FullPageInfo\n }\n\n totalCount\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.PositionPositionSlotFragment,Ls.FullPageInfoFragment]})}function ba(e){return Zn("query PositionDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n customFields(variety: Position) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n position(id: $positionId) {\n id\n positionCategoryId\n positionCategoryName\n name\n description\n privateNote\n color\n icon\n resources\n assignedResources\n preassignedResources\n address\n latitude\n longitude\n zoom\n layer\n isVisible\n range\n fields\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n\n traces {\n ...Trace\n }\n\n customFields: positionsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n leaders {\n ...LeaderInfos\n }\n\n tags {\n id\n name\n }\n }\n }\n}\n",e,[Ls.CustomFieldWithConditionFragment,Ls.TraceFragment,Ls.LeaderInfosFragment])}function ja(e={}){return Xn("mutation PositionSlotUpdate(\n $eventId: EventId!\n $positionId: PositionId!\n $positionSlotId: PositionsSlotId!\n $positionSlot: PositionsSlotInput!\n) {\n positionSlotUpdate(\n eventId: $eventId\n positionId: $positionId\n positionSlotId: $positionSlotId\n positionSlot: $positionSlot\n ) {\n id\n }\n}\n",e)}function Ca(e){return Zn("query UserFieldUpdate($organizationId: OrganizationId!, $slug: CustomFieldSlug!) {\n organization: organizationPublic(id: $organizationId) {\n customField: customFieldBySlug(slug: $slug) {\n name\n description\n }\n }\n}\n",e,[])}function ya(e,t){return ho("query CreateUserDelegationForm(\n $organizationId: OrganizationId!\n $delegationId: DelegationId\n $eventId: EventId\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n country\n\n delegation: delegationMaybe(id: $delegationId) {\n id\n\n accreditationsSlots(onlyVisible: true) {\n ...DelegationAccreditationSlot\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n dayStartTime\n ranges(formId: $formId, delegationId: $delegationId)\n country\n\n accreditationsCategories {\n ...FormRegisterAccreditationCategory\n }\n\n positionsCategories {\n ...FormRegisterCategory\n }\n }\n\n form(id: $formId) {\n ...CreateUpdateMemberForm\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.DelegationAccreditationSlotFragment,Ls.FormRegisterAccreditationCategoryFragment,Ls.FormRegisterCategoryFragment,Ls.CreateUpdateMemberFormFragment]})}function ka(e={}){return Xn("mutation CommentCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n $comment: CommentInput!\n) {\n commentCreate(\n organizationId: $organizationId\n eventId: $eventId\n userInfoId: $userInfoId\n comment: $comment\n ) {\n id\n }\n}\n",e)}function Aa(e){return Zn("query Comments($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n comments {\n ...Comment\n }\n }\n }\n}\n",e,[Ls.CommentFragment])}function wa(e){return Zn("query OrganizationUsersInfos(\n $organizationId: OrganizationId!\n $excludedEventId: EventId\n $excludedDelegationId: DelegationId\n $name: String\n) {\n organization(id: $organizationId) {\n usersInfos(\n excludedEventId: $excludedEventId\n excludedDelegationId: $excludedDelegationId\n name: $name\n limit: 25\n ) {\n nodes {\n ...ExistingVolunteer\n }\n }\n }\n}\n",e,[Ls.ExistingVolunteerFragment])}function Sa(e={}){return Xn("mutation VolunteersRegistrationsAdminAdd(\n $eventId: EventId!\n $usersInfosIds: [UsersInfoId!]!\n $sendVolunteerRegistrationEmail: Boolean!\n) {\n volunteersRegistrationsAdminAdd(\n eventId: $eventId\n usersInfosIds: $usersInfosIds\n sendVolunteerRegistrationEmail: $sendVolunteerRegistrationEmail\n ) {\n id\n }\n}\n",e)}function Ea(e={}){return Xn("mutation VolunteersRegistrationsMassPreAssign(\n $eventId: EventId!\n $massPreAssign: MassPreAssignInput!\n) {\n numberOfMembers: volunteersRegistrationsMassPreAssign(\n eventId: $eventId\n massPreAssign: $massPreAssign\n )\n}\n",e)}function Ta(e={}){return Xn("mutation UsersInfosMassDelegationAdd(\n $organizationId: OrganizationId!\n $delegationId: DelegationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassDelegationAdd(\n organizationId: $organizationId\n delegationId: $delegationId\n selecteds: $selecteds\n )\n}\n",e)}function za(e,t){return ho("query VolunteersMobile(\n $eventId: EventId!\n $predicates: [Predicate!]!\n $limit: Int\n $offset: Int\n $name: String\n) {\n event(id: $eventId) {\n volunteersRegistrations(\n predicates: $predicates\n limit: $limit\n offset: $offset\n name: $name\n ) {\n nodes {\n id\n state\n\n userInfo {\n id\n name\n email\n picture {\n url\n }\n }\n }\n\n pageInfo {\n ...FullPageInfo\n }\n\n totalCount\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.FullPageInfoFragment]})}function Oa(e){return Zn("query WorkflowCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",e,[Ls.MassEditCustomFieldFragment])}function Ra(e,t){return ho("query Workflows(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: WorkflowsSort\n $includeAccreditations: Boolean!\n $includeCampaign: Boolean!\n $includeCustomField: Boolean!\n) {\n data: organization(id: $organizationId) {\n rows: workflows(\n level: $level\n eventId: $eventId\n name: $name\n predicates: $predicates\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...WorkflowsWorkflow\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.WorkflowsWorkflowFragment]})}function $a(e,t){return ho("query WorkflowsWorkflow(\n $organizationId: OrganizationId!\n $id: WorkflowId!\n $includeAccreditations: Boolean!\n $includeCampaign: Boolean!\n $includeCustomField: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: workflow(id: $id) {\n ...WorkflowsWorkflow\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.WorkflowsWorkflowFragment]})}const Da=()=>{const{eventId:e,accreditationId:t}=Jn(),{data:n,loader:s}=Zn("query AccreditationMap($eventId: EventId!, $accreditationId: AccreditationId!) {\n eventPublic(id: $eventId) {\n accreditation(id: $accreditationId) {\n layer\n latitude\n longitude\n zoom\n }\n }\n}\n",{eventId:e,accreditationId:t},[]),[o,r]=(0,L.useState)(!1);if(s)return s;{const e=n.eventPublic.accreditation;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Nr,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:$r(e),onTilesloaded:()=>{r(!0)}})}),o&&(0,i.jsx)(Lr,{})]})}};var Pa;function Fa(e){return(0,wr.A)(e,["direction","align","justify","wrap","gap","css","height","width"])}!function(e){e.Nav="nav",e.Header="header",e.Footer="footer",e.Main="main",e.Section="section"}(Pa||(Pa={}));const Ma=pr("div",{display:"flex",variants:{direction:{row:{flexDirection:"row"},column:{flexDirection:"column"},rowReverse:{flexDirection:"row-reverse"},columnReverse:{flexDirection:"column-reverse"}},align:{start:{alignItems:"flex-start"},center:{alignItems:"center"},end:{alignItems:"flex-end"},stretch:{alignItems:"stretch"},baseline:{alignItems:"baseline"}},justify:{start:{justifyContent:"flex-start"},center:{justifyContent:"center"},end:{justifyContent:"flex-end"},between:{justifyContent:"space-between"},evenly:{justifyContent:"space-evenly"}},wrap:{noWrap:{flexWrap:"nowrap"},wrap:{flexWrap:"wrap"},wrapReverse:{flexWrap:"wrap-reverse"}},gap:{1:{gap:"$1"},2:{gap:"$2"},3:{gap:"$3"},4:{gap:"$4"},5:{gap:"$5"},6:{gap:"$6"},7:{gap:"$7"},8:{gap:"$8"},9:{gap:"$9"},10:{gap:"$10"},11:{gap:"$11"},12:{gap:"$12"},13:{gap:"$13"}}},defaultVariants:{direction:"row",align:"stretch",justify:"start",wrap:"noWrap"}}),Na=L.forwardRef(({onClick:e,...t},n)=>{const s={};return t.height&&(s.height=ur(t.height)),t.width&&(s.width=ur(t.width)),(0,i.jsx)(Ma,{...t,ref:n,css:{...s,...t.css},onClick:e})});Na.displayName="Flex";var La=n(7356);let Ba=class{validate(e){return async t=>{try{return await e.validate(t,{abortEarly:!1,strict:!0}),{}}catch(e){return this.errorToObject(e)}}}validateSync(e,t){try{return e.validateSync(t,{abortEarly:!1,strict:!0}),{}}catch(e){return this.errorToObject(e)}}isValidSync(e,t){return 0===Object.keys(this.validateSync(e,t)).length}validateForForm(e){return async t=>{try{return await e.validate(t,{abortEarly:!1,strict:!0}),{}}catch(e){return e.inner.reduce((e,t)=>(0,La.Oe)(e,t.path,t.message),{})}}}errorToObject(e){return e.inner.reduce((e,t)=>({...e,[t.path]:t.message}),{})}};Ba=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)()],Ba);var Va=n(924),Ua=n(952),Wa=n(5664);function Ga(){const[e]=(0,L.useState)(()=>(0,Wa.A)("forminput-")),[t]=(0,L.useState)(()=>(0,Wa.A)("forminputlabel-")),[n]=(0,L.useState)(()=>(0,Wa.A)("forminputdesc-")),[i]=(0,L.useState)(()=>(0,Wa.A)("forminputerror-"));return{inputId:e,labelId:t,descId:n,errorId:i}}const Ha=(0,L.createContext)({}),qa=pr("div",{variants:{height:{default:{height:"100%"},1:{minHeight:"$space$1"},2:{minHeight:"$space$2"},3:{minHeight:"$space$3"},4:{minHeight:"$space$4"},5:{minHeight:"$space$5"},6:{minHeight:"$space$6"},7:{minHeight:"$space$7"},8:{minHeight:"$space$8"},9:{minHeight:"$space$9"},10:{minHeight:"$space$10"},11:{minHeight:"$space$11"},12:{minHeight:"$space$12"},13:{minHeight:"$space$13"}},width:{default:{width:"100%"},1:{minWidth:"$space$1"},2:{minWidth:"$space$2"},3:{minWidth:"$space$3"},4:{minWidth:"$space$4"},5:{minWidth:"$space$5"},6:{minWidth:"$space$6"},7:{minWidth:"$space$7"},8:{minWidth:"$space$8"},9:{minWidth:"$space$9"},10:{minWidth:"$space$10"},11:{minWidth:"$space$11"},12:{minWidth:"$space$12"},13:{minWidth:"$space$13"}}},defaultVariants:{height:"default",width:"default"}});var Ya=n(9241),Ka=n(2695),Za=n(2326);const Xa=["access","ticket","pay"],Ja=({children:e,height:t,replace:n,style:s,to:o,width:r,...a})=>{const l=new URL(o.toString(),location.origin),d={};t&&(d.height=ur(t)),r&&(d.width=ur(r));const c={alignItems:"inherit",color:"inherit",cursor:"pointer",display:"inherit",flexDirection:"inherit",flexWrap:"inherit",gap:"inherit",justifyContent:"inherit",textDecoration:"none",...d,...s};return l.origin!==location.origin||Xa.includes(l.pathname.split("/")[1])?(0,i.jsx)("a",{href:l.href,rel:"noreferrer",style:c,target:"_blank",...a,children:e}):(0,i.jsx)(kr.N_,{replace:n,style:c,to:{pathname:m(P.HEAVENT_APPLICATION_BASENAME)?l.pathname.replace(new RegExp(`^/${P.HEAVENT_APPLICATION_BASENAME}`,"gm"),""):l.pathname,hash:l.hash,search:l.search},...a,children:e})};function Qa(e){return(0,Za.A)(e)}Ja.displayName="LinkWrapper";const el=e=>{const t=e.iconStyle??"regular",n={};e.primaryColor&&(n["--fa-primary-color"]=e.primaryColor),e.secondaryColor&&(n["--fa-secondary-color"]=e.secondaryColor,n["--fa-secondary-opacity"]="1");const s=()=>(0,i.jsx)("i",{"aria-hidden":e["aria-hidden"]??!0,className:`fa-${t} fa-${e.icon} ${e.className||""}`,role:e.role,style:{...n,cursor:e.title?"help":"inherit"},title:e.title,onClick:e.to?void 0:e.onClick});return e.to?(0,i.jsx)(Ja,{target:e.target,to:e.to,onClick:e.onClick,children:s()}):s()};function tl(e,t){"production"!==a.Production&&console.warn(`Component ${e} is deprecated, use ${t} instead.`)}const nl=pr("div",{alignItems:"center",display:"grid",gap:"6px 8px",gridTemplateColumns:"min-content auto"}),il=pr(Na,{alignItems:"center",borderRadius:"$2",fontWeight:"$medium",gap:"$3",padding:"$3 $4","& i":{fontSize:"$textMd"},variants:{color:{primary:{background:"$primary50",border:"1px solid $primary400",color:"$primary700",[`${nl}`]:{color:"$primary500"}},gray:{background:"$gray50",border:"1px solid $gray400",color:"$gray700",[`${nl}`]:{color:"$gray500"}},error:{background:"$error50",border:"1px solid $error400",color:"$error700",[`${nl}`]:{color:"$error500"}},warning:{background:"$warning50",border:"1px solid $warning400",color:"$warning700",[`${nl}`]:{color:"$warning500"}},success:{background:"$success50",border:"1px solid $success400",color:"$success700",[`${nl}`]:{color:"$success500"}}}},defaultVariants:{color:"primary"}}),sl=e=>(tl("common-front/src/designSystem/components/alerts/__deprecated/alert.tsx","common-front/src/designSystem/components/alerts/alert.tsx"),(0,i.jsxs)(il,{"aria-live":e["aria-live"]??"polite",color:e.color,role:"alert",width:e.width,children:[e.leftIcon&&(0,i.jsx)(Na,{align:"center",children:(0,i.jsx)(el,{icon:e.leftIcon})}),(0,i.jsx)(yr,{css:{flex:"1"},children:e.children}),e.rightIcon&&(0,i.jsx)(Na,{align:"center",css:{cursor:e.rightIconClick?"pointer":"default"},onClick:()=>{e.rightIconClick?.()},children:(0,i.jsx)(el,{icon:e.rightIcon})})]})),ol={Root:sl,Titled:nl,Title:({children:e,icon:t})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(el,{icon:t,iconStyle:"solid"}),(0,i.jsx)(yr,{color:"gray800",children:e})]}),Text:({children:e})=>(0,i.jsx)(yr,{color:"gray800",css:{gridColumn:"2 / 3"},fontWeight:"regular",children:e})};function rl(e){throw new Error("Didn't expect to get here")}const al=e=>{const t={iconStyle:"solid"};switch(e.iconStyle){case"error":return(0,i.jsx)(el,{icon:"circle-exclamation",...t});case"warning":return(0,i.jsx)(el,{icon:"triangle-exclamation",...t});default:rl(e.iconStyle)}},ll=pr(Na,{borderRadius:"$1",alignItems:"flex-start",gap:"$2",flex:"1 0 0",padding:"$4","& i":{fontSize:"$textMd"},variants:{alertStyle:{error:{background:"$error50",border:"1px solid $error500",color:"$gray800","& i":{color:"$error500"}},warning:{background:"$warning50",border:"1px solid $warning500",color:"$gray800","& i":{color:"$warning500"}}}},defaultVariants:{alertStyle:"error"}}),dl=pr("p",{fontStyle:"normal",padding:"unset",margin:"unset",lineHeight:"1.42857143","& > *:not(ul)":{display:"inline"},variants:{textStyle:{inherit:{color:"inherit",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit"},heading:{color:"$gray900",fontSize:"$textLg",fontWeight:"$medium",lineHeight:"1.55556",textTransform:"capitalize"},smallcapsheading:{color:"$gray500",fontSize:"10px",lineHeigh:"24px",textTransform:"uppercase"},subheading:{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium",lineHeight:"1.5",textTransform:"capitalize"},subtitle:{color:"$gray500",fontSize:"$textSm",fontWeight:"$regular",lineHeight:"1.42857"},bodyText:{color:"$gray800",fontSize:"$textSm"},abbreviation:{color:"$gray500",fontVariant:"small-caps",fontSize:"$textSm"}}},defaultVariants:{textStyle:"bodyText"}}),cl=L.forwardRef(({children:e,...t},n)=>(0,i.jsx)(dl,{ref:n,...t,children:e}));cl.displayName="Text";const ul=({min:e=2,max:t=6,textStyle:n="heading",children:s,...o})=>{t{const i=e?.parentElement;if(!i||n===t)return n;for(const e of Array(i.children))if(e[0]instanceof HTMLHeadingElement)return d(i,++n);return d(i,n)},[t]);return L.useEffect(()=>l(`h${d(r.current?.parentElement,e)}`),[e,t]),(0,i.jsx)(cl,{ref:r,as:a,...o,textStyle:n,children:s})},hl=e=>(0,i.jsxs)(ll,{alertStyle:e.alertStyle,"aria-live":e["aria-live"]??"polite",role:"alert",width:e.width,children:[(0,i.jsx)(Na,{align:"start",children:(0,i.jsx)(yr,{height:"20px",width:"20px",children:(0,i.jsx)(al,{iconStyle:e.alertStyle})})}),(0,i.jsx)(Na,{align:"start",css:{gap:"2px"},direction:"column",children:e.children})]}),ml=({children:e})=>(0,i.jsx)(ul,{css:{color:"$gray900",fontWeight:"$medium",fontSize:"$textSm",lineHeight:"1.42857"},children:e}),gl=({children:e})=>(0,i.jsx)(i.Fragment,{children:e}),pl=e=>(0,i.jsxs)(hl,{alertStyle:"error","aria-live":"assertive",id:e.id,children:[(0,i.jsx)(ml,{children:e.title}),(0,i.jsx)(gl,{children:e.children})]}),fl=(0,L.createContext)({});function xl(){return(0,L.useContext)(fl)}function _l(){return{history:Qn(),params:Jn(),translate:Yn()}}function Il(e){return e?(0,Ns.A)(Object.values(e).map(e=>"string"==typeof e?e:Array.isArray(e)?(0,Ya.A)(e).map(e=>Il(e)).flat():Il(e)).flat()):[]}const vl=e=>{const{translate:t}=_l(),n=Ga(),{formRenderProps:{errors:s,submitErrors:o},showErrors:r}=(0,L.useContext)(Ha),{designSystem:a}=xl(),l=Il((0,Ka.A)({},s,o));return r&&no(l)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(({children:s})=>"new2025"===a?(0,i.jsx)(pl,{id:e.errorId??n.errorId,title:t("form_has_errors_14074"),children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:s})}):(0,i.jsx)(sl,{"aria-live":"assertive",color:"error",id:e.errorId,leftIcon:"circle-exclamation",children:(0,i.jsx)(yr,{width:1,children:(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-6)"},children:s})})}),{children:l.map((e,t)=>(0,i.jsx)("li",{children:e},t))}),!0!==e.hideSpacer&&(0,i.jsx)(qa,{height:"6"})]}):null};function bl(e,t){Object.values(t.fields).forEach(e=>{e.data={...e.data,forceDisplayError:!0}})}const jl=e=>{const t=L.useRef(null),n=Ga(),{setShowErrors:s}=L.useContext(Ha),o=n=>(n?.preventDefault?.(),e.formRenderProps.invalid?(s(!0),e.formRenderProps.form.mutators.forceErrors(),setTimeout(()=>{e.customErrorRef&&e.customErrorRef.current?(e.customErrorRef.current.scrollIntoView(),e.customErrorRef.current.scrollTop=0):!e.hideDefaultErrors&&t.current&&(t.current.scrollIntoView(),t.current.scrollTop=0)},100),!e.formRenderProps.hasValidationErrors&&e.formRenderProps.hasSubmitErrors?e.formRenderProps.handleSubmit():void 0):e.formRenderProps.handleSubmit());return(0,i.jsxs)(Na,{ref:t,as:"form",onSubmit:o,...Fa(e),children:[!e.hideDefaultErrors&&!e.customErrorRef&&(0,i.jsx)(vl,{errorId:n.errorId}),(0,i.jsx)("input",{style:{display:"none"},type:"submit",value:"Submit"}),e.render({...e.formRenderProps,handleSubmit:o})]})},Cl=e=>{const t=qn(Ba),[n,s]=L.useState(!1);return(0,i.jsx)(Ua.lV,{initialValues:e.initialValues,initialValuesEqual:e.initialValuesEqual??Pr.A,mutators:{...e.mutators,...Va.A,forceErrors:bl},render:t=>(0,i.jsx)(Ha.Provider,{value:{formRenderProps:t,showErrors:n,setShowErrors:s},children:(0,i.jsx)(jl,{...(0,wr.A)(e,["direction","align","justify","wrap","gap","css","height","width"]),customErrorRef:e.customErrorRef,formRenderProps:t,hideDefaultErrors:e.hideDefaultErrors,render:e.render})}),validate:n=>e.schema?t.validateForForm(e.schema)(n):"function"==typeof e.validate?e.validate(n):{},onSubmit:async(t,n,i)=>{const o=await e.onSubmit(t,n,i);return Object.keys(o||{}).length>0&&s(!0),o}})},yl=e=>(0,L.createElement)("svg",{width:e.width,height:e.height,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",className:"lds-rolling","data-testid":"loader",style:{background:"none"}},(0,L.createElement)("circle",{cx:"50",cy:"50",fill:"none",stroke:e.color,strokeWidth:e.strokeWidth,r:"16",strokeDasharray:"75.39822368615503 27.132741228718345",transform:"rotate(120 50 50)"},(0,L.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 50 50;360 50 50",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))),kl=(0,L.memo)(function(){return(0,i.jsx)(Na,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(yl,{color:"#162131",height:"200px",strokeWidth:"2",width:"200px"})})}),Al={alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",gap:"$2",padding:"$1 $4",userSelect:"none","& .loader":{borderRadius:"$1"},variants:{color:{primary:{background:"$primary700",border:"1px solid $primary700",color:"white","&:hover":{background:"$primary800",border:"1px solid $primary800"},"& .loader":{background:"$primary700",border:"1px solid $primary700"},"& .loader:hover":{background:"$primary800",border:"1px solid $primary800"}},gray:{background:"$gray100",border:"1px solid $gray100",color:"$gray800","&:hover":{background:"$gray100",border:"1px solid $gray100"},"& .loader":{background:"$gray100",border:"1px solid $gray100"},"& .loader:hover":{background:"$gray100",border:"1px solid $gray100"}},white:{background:"white",border:"1px solid $gray300",color:"$gray700","&:hover":{background:"$gray50",color:"$gray800"},"& .loader":{background:"white",border:"1px solid $gray300"},"& .loader:hover":{background:"$gray50",color:"$gray800"}},error:{background:"$error600",border:"1px solid $error600",color:"white","&:hover":{background:"$error700",border:"1px solid $error600"},"& .loader":{background:"$error600",border:"1px solid $error600"},"& .loader:hover":{background:"$error700",border:"1px solid $error600"}},invisible:{background:"none",border:"none",color:"$primary700",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$primary900"},"& .h-button-content:has( + .loader)":{color:"transparent"}},"invisible-gray":{background:"none",border:"none",color:"$gray700",fontSize:"$textSm",fontWeight:"$medium",padding:"$1 $2","&:hover":{color:"$gray900"},"& .h-button-content:has( + .loader)":{color:"transparent"}}},disabled:{true:{cursor:"not-allowed"}},size:{sm:{height:"32px",fontSize:"$textSm"},md:{height:"40px",fontSize:"$textSm"},lg:{height:"44px",fontSize:"$textMd"},xl:{height:"48px",fontSize:"$textMd"},"2xl":{height:"60px",fontSize:"$textLg"}},iconOnly:{true:{justifyContent:"center",px:"0"}}},compoundVariants:[{color:"primary",disabled:!0,css:{color:"$gray400",background:"$gray100",border:"1px solid $gray100","&:hover":{background:"$gray100",border:"1px solid $gray100"},"& .loader":{background:"$gray100",border:"1px solid $gray100"},"& .loader:hover":{background:"$gray100",border:"1px solid $gray100"}}},{color:"gray",disabled:!0,css:{background:"$primary25",border:"1px solid $primary25",color:"$primary300","&:hover":{background:"$primary25",border:"1px solid $primary25"},"& .loader":{background:"$primary25",border:"1px solid $primary25"},"& .loader:hover":{background:"$primary25",border:"1px solid $primary25"}}},{color:"transparent",disabled:!0,css:{color:"$gray400",background:"$primary100",border:"1px solid $primary100","&:hover":{color:"$gray400",background:"$primary100",border:"1px solid $primary100"},"& .loader":{background:"$primary100",border:"1px solid $primary100"},"& .loader:hover":{background:"$primary100",border:"1px solid $primary100"}}},{color:"invisible",disabled:!0,css:{color:"$gray400","&:hover":{color:"$gray400"}}},{color:"invisible-gray",disabled:!0,css:{color:"$gray400","&:hover":{color:"$gray400"}}},{color:"error",disabled:!0,css:{background:"$error200",border:"1px solid $error200","&:hover":{background:"$error200",border:"1px solid $error200"},"& .loader":{background:"$error200",border:"1px solid $error200"},"& .loader:hover":{background:"$error200",border:"1px solid $error200"}}},{size:"sm",iconOnly:!0,css:{width:"32px"}},{size:"md",iconOnly:!0,css:{width:"40px"}},{size:"lg",iconOnly:!0,css:{width:"44px"}},{size:"xl",iconOnly:!0,css:{width:"48px"}},{size:"2xl",iconOnly:!0,css:{width:"56px"}}],defaultVariants:{color:"primary",size:"md"}},wl=pr("button",Al),Sl=pr("div",Al),El=L.forwardRef(({children:e,className:t,color:n,css:s,disabled:o,featureFlags:r,isLoading:a,leftIcon:l,onClick:d,to:c,rightIcon:u,size:h,textAlign:m=(r?.isV4?"center":void 0),title:g,...p},f)=>{const x=!!l&&!e&&!u||!l&&!e&&!!u,_={className:`button ${t||""}`,color:n,css:{width:r?.isV4?"100%":void 0,...s,position:"relative"},disabled:o,iconOnly:x,size:h,title:g},I={children:e,color:n,leftIcon:l,isLoading:a,rightIcon:u,textAlign:m};return c&&!o?(0,i.jsx)(Ja,{style:r?.isV4?{flex:"1"}:void 0,title:g,to:c,onClick:e=>{o||a||d&&d(e)},...p,children:(0,i.jsx)(Sl,{..._,ref:f,children:(0,i.jsx)(Tl,{...I})})}):(0,i.jsx)(wl,{..._,ref:f,type:"button",onClick:e=>{o||a||d&&d(e)},...p,children:(0,i.jsx)(Tl,{...I})})});El.displayName="Button",El.toString=()=>".button";const Tl=({children:e,color:t,isLoading:n,leftIcon:s,rightIcon:o,textAlign:r})=>(0,i.jsxs)(i.Fragment,{children:[s&&(0,i.jsx)(Na,{children:(0,i.jsx)(el,{icon:s})}),e&&(0,i.jsx)(yr,{className:"h-button-content",css:{flex:"1"},textAlign:r,children:e}),o&&(0,i.jsx)(Na,{children:(0,i.jsx)(el,{icon:o})}),n&&(0,i.jsx)(Na,{align:"center",className:"loader",css:{height:"calc(100% + 2px)",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",zIndex:10},justify:"center",children:(0,i.jsx)(yl,{color:t&&"primary"!==t&&"error"!==t?fr.colors.gray800.value:"white",height:"40px",strokeWidth:"3",width:"40px"})})]});var zl=n(9008);function Ol(e){return e.data?.forceDisplayError&&e.invalid||e.touched&&!e.pristine&&e.invalid||!1}const Rl=(e,t=!0)=>{t&&e?.preventDefault(),e?.nativeEvent?.stopImmediatePropagation(),e?.stopPropagation()},$l=({children:e,id:t})=>e?(0,i.jsx)(yr,{color:"gray500",fontSize:"textXs",id:t,children:e}):null,Dl=e=>e.children?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"error"===e.state?"error500":"gray500",fontSize:"textXs",id:e.id,role:"error"===e.state?"alert":void 0,children:e.children})]}):null,Pl=({id:e,children:t,htmlFor:n,isClickable:s=!0})=>t?(0,i.jsx)("label",{htmlFor:n,id:e,style:{display:"block",cursor:"inherit",fontWeight:"$medium",marginBlockEnd:0},onClick:e=>{s||e.preventDefault()},children:(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",children:t})}):null,Fl=pr("div",{alignItems:"center",borderRadius:"$1",display:"flex",gap:"$space$2",padding:"0 $space$3",position:"relative",width:"100%","& input::placeholder":{color:"$gray500"},"&:focus-within":{border:"2px solid $primary700"},variants:{state:{active:{backgroundColor:"white",border:"1px solid $gray300",color:"$gray900"},disabled:{background:"$gray50",border:"1px solid $gray300",color:"$gray500"},error:{backgroundColor:"white",border:"1px solid $error500"},search:{backgroundColor:"$gray100",border:"1px solid $gray300",color:"$gray500"}},cursor:{default:{cursor:"default"},text:{cursor:"text"},pointer:{cursor:"pointer"}},height:{fixed:{height:"40px"},fluid:{minHeight:"40px"}}},defaultVariants:{state:"active",height:"fixed"}}),Ml=L.forwardRef(({height:e,cursor:t,css:n,icon:s,children:o,state:r,onClick:a,rightIcon:l,rightText:d,onRightIconClick:c,...u},h)=>(0,i.jsxs)(Fl,{ref:h,className:"h-styled-input-container",css:n,cursor:t,height:e,role:"listbox",state:r,onClick:e=>{a?.(e)},...u,children:[s&&(0,i.jsx)(Na,{css:{color:"$gray500"},role:"presentation",children:(0,i.jsx)(el,{icon:s})}),o,"error"===r&&(0,i.jsx)(Na,{className:"styled-input-container-circle-exclamation",css:{color:"$error500"},children:(0,i.jsx)(el,{icon:"circle-exclamation"})}),l&&(0,i.jsx)(Na,{css:{color:"$gray500",cursor:"function"==typeof c?"pointer":"inherit"},role:"presentation",onClick:e=>{c?.(e)},children:(0,i.jsx)(el,{icon:l})}),m(d)&&(0,i.jsx)(yr,{css:{userSelect:"none"},font:"gray500 textSm regular",children:d})]}));Ml.displayName="StyledInputContainer";const Nl=L.forwardRef(({autoComplete:e,isEmail:t,shouldParseAsInt:n,css:s,label:o,description:r,hint:a,onRightIconClick:l,state:d,type:c,onChange:u,rightIcon:h,rightText:g,icon:p,treatIntNaNAsNull:f,...x},_)=>{const I=L.useRef(),v=L.useRef(),b=_??v,{inputId:j,descId:C,errorId:y}=Ga();return(0,i.jsxs)(Na,{ref:I,css:s,direction:"column",width:1,children:[(0,i.jsx)(Pl,{htmlFor:j,children:o}),(0,i.jsx)($l,{id:C,children:r}),(o||r)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Ml,{cursor:"text",icon:p,rightIcon:h,rightText:g,state:d,onClick:()=>b.current?.focus(),onRightIconClick:e=>{Rl(e),l?.(e)},children:(0,i.jsx)(yr,{color:"inherit",css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"search"===d?"$gray400":"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"search"===d?"$gray400":"$gray500",opacity:1}},children:(0,i.jsx)("input",{ref:b,"aria-describedby":r?C:void 0,"aria-errormessage":"error"===d?y:void 0,"aria-invalid":"error"===d,autoComplete:e??"off",disabled:"disabled"===d,id:j,type:c??(t?"email":n?"number":"text"),onChange:e=>{if(t&&m(e.target.value))u(e.target.value.toLowerCase());else if(!0===n){const t=parseInt(e.target.value,10);isNaN(t)?u(f?null:0):u(t)}else u(e.target.value)},...x})})}),(0,i.jsx)(Dl,{id:y,state:d,children:a})]})});Nl.displayName="TextInput";const Ll=({autoComplete:e,hint:t,shouldParseAsInt:n,name:s,state:o,...r})=>{const a=(0,L.useCallback)(e=>{switch(e){case Le.City:return"address-level1";case Le.DateOfBirth:return"bday";case Le.FirstName:return"given-name";case Le.LastName:return"family-name";case Le.PostalCode:return"postal-code";case Le.Street:return"street-address";case Le.Country:case Le.Language:case Le.Nationality:case Le.Phone:case Le.Picture:case Le.Sex:default:return}},[]),l=(0,L.useMemo)(()=>s.startsWith("formRegister.userInfo.fields.")?a(s.split(".").pop())??e:e,[s,e,a]),d=(0,L.useCallback)(e=>{const s=Ol(e.meta);return(0,i.jsx)(Nl,{autoComplete:l,hint:s?e.meta.error||e.meta.submitError:t,shouldParseAsInt:n||!1,state:s?"error":o,value:e.input.value,onBlur:e.input.onBlur,onChange:t=>{e.input.onChange(t)},onFocus:e.input.onFocus,...r})},[t,n,o,l,r]);return(0,i.jsx)(Ua.D0,{name:s,parse:zl.A,render:d})},Bl={AUTH_EMAIL:"heavent-auth-email",BACKOFFICE_INVOICES_COLUMNS:"heavent-backoffice-invoices-columns",BACKOFFICE_COLUMNS:"heavent-backoffice-columns",BACKOFFICE_LIMIT:"heavent-backoffice-limit",BACKOFFICE_PREDICATES:"heavent-backoffice-predicates",BACKOFFICE_SEARCH:"heavent-backoffice-search",BACKOFFICE_SORT:"heavent-backoffice-sort",CURRENT_EVENT_ID:"heavent-current-event-id",CURRENT_EVENT_NAME:"heavent-current-event-name",CURRENT_ORGANIZATION_ID:"heavent-current-organization-id",DELEGATIONS_SPACE_TAB:"heavent-delegations-space-tab",EVENT_ID:"heavent-event-id",HIDE_HUBSPOT:"hide-hubspot",ORGANIZATION_ID:"heavent-organization-id",EVENTS_IMPORT_FORMATS:"heavent-events-import-formats",EVENTS_IMPORT_MAPPINGS:"heavent-events-import-mappings",EVENTS_IMPORT_MODE:"heavent-events-import-mode",EVENTS_IMPORT_PRESETS:e=>`heavent-events-import-presets-${e}`,POSITIONS_IMPORT_FORMATS:"heavent-positions-import-formats",POSITIONS_IMPORT_MAPPINGS:"heavent-positions-import-mappings",POSITIONS_IMPORT_MODE:"heavent-positions-import-mode",POSITIONS_IMPORT_PRESETS:e=>`heavent-positions-import-presets-${e}`,VOLUNTEERS_IMPORT_FORMATS:"heavent-volunteers-import-formats",VOLUNTEERS_IMPORT_MAPPINGS:"heavent-volunteers-import-mappings",VOLUNTEERS_IMPORT_MODE:"heavent-volunteers-import-mode",VOLUNTEERS_IMPORT_PRESETS:e=>`heavent-volunteers-import-presets-${e}`,DELEGATIONS_IMPORT_FORMATS:"heavent-delegations-import-formats",DELEGATIONS_IMPORT_MAPPINGS:"heavent-delegations-import-mappings",DELEGATIONS_IMPORT_PRESETS:e=>`heavent-delegations-import-presets-${e}`,DELEGATIONS_IMPORT_MODE:"heavent-delegations-import-mode",DELEGATION_MEMBERS_IMPORT_FORMATS:"heavent-delegation-members-import-formats",DELEGATION_MEMBERS_IMPORT_MAPPINGS:"heavent-delegation-members-import-mappings",DELEGATION_MEMBERS_IMPORT_PRESETS:e=>`heavent-delegation-members-import-presets-${e}`,DELEGATION_MEMBERS_IMPORT_MODE:"heavent-delegation-members-import-mode"};let Vl=class{translationService;constructor(e){this.translationService=e}t(e,...t){return this.translationService.translate(e,...t)}};Vl=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Vl);let Ul=class extends Vl{translationService;constructor(e){super(e),this.translationService=e}oneOfMessage(e,t){return this.t("_1_doit_tre_70659",e,this.translationService.formatListValues(t.map(e=>this.t(e))))}};Ul=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Ul);function Wl(e){return"string"==typeof e&&e.length>=16}function Gl(e){return"string"==typeof e&&null!==e.match(/\d/)}function Hl(e){return"string"==typeof e&&null!==e.match(/[A-Z]/)&&null!==e.match(/[a-z]/)}function ql(e){return"string"==typeof e&&null!==e.match(/[^A-Za-z0-9]/)}let Yl=class extends Ul{constructor(e){super(e)}signInSchema(){return d.Ik().shape({email:this.email()})}signInPasswordSchema(){return d.Ik().shape({email:this.email(),password:this.password()})}codeSchema(){return d.Ik().shape({code:this.code()})}emailSchema(){return d.Ik().shape({email:this.email()})}emailConfirmSchema(){return d.Ik().shape({email:this.email(),emailConfirm:this.emailConfirm()})}emailCodeSchema(){return d.Ik().shape({email:this.email(),code:this.code()})}email(){return d.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856"))}emailConfirm(){return d.Yj().required(this.t("la_confirmation_53449")).email(this.t("la_confirmation_53449")).test("same-as-email",this.t("l_e_mail_et_la_57164"),function(){return this.parent.email===this.parent.emailConfirm})}code(){return d.Yj().required(this.t("le_code_est_req_77618")).length(6,this.t("le_code_doit_co_37160"))}password(){return d.Yj().required(this.t("le_mot_de_passe_14773"))}passwordRules(){return d.Yj().required(this.t("le_mot_de_passe_24842")).test("valid-password",this.t("le_mot_de_passe_24842"),function(){return Wl(this.parent.password)&&Gl(this.parent.password)&&Hl(this.parent.password)&&ql(this.parent.password)})}};Yl=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Yl);let Kl=class extends Yl{constructor(e){super(e)}step1Schema(){return d.Ik().shape({email:this.email()})}step2Schema(){return d.Ik().shape({email:this.email(),code:this.code()})}};Kl=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Kl);var Zl,Xl,Jl,Ql=n(2302);function ed(){return ed=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsxs)(Na,{align:"center",css:{background:"#232935",overflowX:"hidden",overflowY:"auto"},direction:"column",height:1,width:1,children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{css:{marginBottom:"40px","@desktop":{marginBottom:"80px"},"& svg":{height:"100%"}},height:32,children:(0,i.jsx)(td,{})}),(0,i.jsxs)(Na,{css:{width:"100%","@mobile":{px:"$4"},"@desktop":{width:"540px"}},direction:"column",children:[(0,i.jsx)(Na,{css:{background:"white",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$7"},width:1,children:e.children}),(0,i.jsx)(Na,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",padding:"$7"},direction:"column",gap:"2",width:1,children:e.link})]}),(0,i.jsx)(qa,{height:"7"})]}),sd=e=>(0,i.jsx)(Na,{align:"center",direction:{"@initial":"column","@desktop":"row"},gap:"1",justify:"center",width:1,children:e.children}),od=e=>{const t=Yn(),n=Qn(),s=ti(),o=qn(Ba),r=qn(Kl),{mutate:a}=function(e={}){return Xn("mutation LoginCodeEmailCreate($loginCodeEmail: LoginCodesEmailInput!) {\n loginCodeEmailCreate(loginCodeEmail: $loginCodeEmail) {\n insertedAt\n }\n}\n",e)}(),[l,d]=(0,L.useState)(null),[c,u]=(0,L.useState)(0),[h,m]=(0,L.useState)(0),[g,p]=(0,L.useState)(!1),[f,x]=(0,L.useState)(Date.now());return(0,i.jsx)(id,{link:(0,i.jsxs)(sd,{children:[(0,i.jsx)(yr,{color:"gray500",children:t("vous_n_avez_pas_69078")}),(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{n.push($s.AUTH_SIGN_IN_EMAIL)},children:t("r_essayer_21582")})]}),children:(0,i.jsx)(Cl,{direction:"column",initialValues:{email:s.getItem(Bl.AUTH_EMAIL)||"",code:""},render:({handleSubmit:n,submitting:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("se_connecter_av_59438")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("saisissez_votre_01613")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Ll,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451"),state:c>0||g?"disabled":"active"}),c>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{autoComplete:"one-time-code",label:t("code_20843"),name:"code",placeholder:t("code_20843"),state:g?"disabled":void 0,type:"number"})]}),(0,i.jsx)(qa,{height:"6"}),g?(0,i.jsx)(El,{textAlign:"center",onClick:e.onFailure,children:t("recommencer_14712")}):(0,i.jsx)(El,{isLoading:s,textAlign:"center",onClick:n,children:t(0===c?"recevoir_le_cod_88633":"se_connecter_63820")})]}),validate:e=>0===c?o.validateForForm(r.step1Schema())(e):o.validateForForm(r.step2Schema())(e),width:1,onSubmit:async n=>{if(0!==c){const{user:i,callbacks:s}=l;return function({code:e,user:t,callbacks:n}){return new Promise((i,s)=>{t.sendCustomChallengeAnswer(e,{...n,onSuccess:(...e)=>{n.onSuccess(...e),i(e)},onFailure:e=>{n.onFailure(e),s({type:"FAILED",error:e})},customChallenge:(...e)=>{n.customChallenge&&n.customChallenge(...e),s({type:"RETRY"})}})}).then(([e])=>e.getIdToken().getJwtToken())}({code:n.code,user:i,callbacks:s}).then(e.onSuccess,e=>{if("RETRY"===e.type)return m(h+1),{code:t("le_code_n_est_p_95065",3-(h+1))};{let i;return function(e,t,n){!async function(e){await fetch(`${P.HEAVENT_API_URL}/log/report`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}({message:"Could not auth",errorMessage:e,email:t,location:location.href,diff:Math.round((Date.now()-n)/1e3),userAgent:navigator.userAgent})}(e.message,n.email,f),p(!0),i=Us.dw.fromMillis(Date.now()-f).as("minutes")>3?t("le_code_a_expir_45975"):t("le_code_n_est_p_12317"),{FORM_ERROR:i}}})}{await a({loginCodeEmail:{email:n.email,source:Qe.App}}),x(Date.now());const e=await async function(e,t,n){try{return await J(e,t,n)}catch(i){if(i!==G)throw i;try{return await Z(e,V()),await J(e,t,n)}catch{throw new Error("Auth failure")}}}(n.email,Ql.A,Ql.A);d(e),u(1)}}})})},rd=L.forwardRef(({css:e,hint:t,description:n,icon:s,state:o,onChange:r,label:a,onForgotPasswordClick:l,...d},c)=>{const u=Yn(),h=L.useRef(),[m,g]=L.useState("password"),{inputId:p,descId:f,errorId:x}=Ga();return(0,i.jsxs)(Na,{ref:h,css:e,direction:"column",width:1,onClick:e=>{e.preventDefault(),h.current?.querySelector("input")?.focus()},children:[(0,i.jsxs)(Na,{gap:"3",width:1,children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Pl,{htmlFor:p,children:a})}),"function"==typeof l&&(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{l?.()},children:u("mot_de_passe_ou_17690")})]}),(0,i.jsx)($l,{id:f,children:n}),(a||n)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Ml,{cursor:"text",icon:s,rightIcon:"password"===m?"eye":"eye-slash",state:o,onRightIconClick:e=>{Rl(e),g("password"===m?"text":"password")},children:(0,i.jsx)(yr,{color:"inherit",css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},children:(0,i.jsx)("input",{ref:c,"aria-describedby":n?f:void 0,"aria-errormessage":"error"===o?x:void 0,"aria-invalid":"error"===o,disabled:"disabled"===o,id:p,type:m,onChange:e=>{r(e.target.value)},...d})})}),(0,i.jsx)(Dl,{id:x,state:o,children:t})]})});rd.displayName="PasswordInput";const ad=({name:e,autoComplete:t,hint:n,state:s,...o})=>(0,i.jsx)(Ua.D0,{name:e,render:r=>{const a=Ol(r.meta);return(0,i.jsx)(rd,{autoComplete:t??"current-password",hint:a?r.meta.error:n,name:e,state:a?"error":s,value:r.input.value,onBlur:r.input.onBlur,onChange:e=>{r.input.onChange(e)},onFocus:r.input.onFocus,...o})}});let ld=class extends Yl{constructor(e){super(e)}step1Schema(){return d.Ik().shape({email:this.email()})}step2Schema(){return d.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};ld=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],ld);const dd=pr("div",{display:"grid",variants:{align:{start:{alignItems:"start"},center:{alignItems:"center"},end:{alignItems:"end"}},gap:{1:{gap:"$1"},2:{gap:"$2"},3:{gap:"$3"},4:{gap:"$4"},5:{gap:"$5"},6:{gap:"$6"},7:{gap:"$7"},8:{gap:"$8"},9:{gap:"$9"},10:{gap:"$10"},11:{gap:"$11"},12:{gap:"$12"},13:{gap:"$13"}},columnGap:{1:{columnGap:"$1"},2:{columnGap:"$2"},3:{columnGap:"$3"},4:{columnGap:"$4"},5:{columnGap:"$5"},6:{columnGap:"$6"},7:{columnGap:"$7"},8:{columnGap:"$8"},9:{columnGap:"$9"},10:{columnGap:"$10"},11:{columnGap:"$11"},12:{columnGap:"$12"},13:{columnGap:"$13"}},rowGap:{1:{rowGap:"$1"},2:{rowGap:"$2"},3:{rowGap:"$3"},4:{rowGap:"$4"},5:{rowGap:"$5"},6:{rowGap:"$6"},7:{rowGap:"$7"},8:{rowGap:"$8"},9:{rowGap:"$9"},10:{rowGap:"$10"},11:{rowGap:"$11"},12:{rowGap:"$12"},13:{rowGap:"$13"}}}}),cd=L.forwardRef((e,t)=>{const n={gridTemplate:e.gridtemplate,gridTemplateColumns:e.gridtemplatecolumns,gridTemplateRows:e.gridtemplaterows};return e.height&&(n.height=ur(e.height)),e.width&&(n.width=ur(e.width)),(0,i.jsx)(dd,{role:"grid",...e,ref:t,css:{...n,...e.css}})});cd.displayName="Grid";const ud=e=>(0,i.jsxs)(Na,{align:"center",gap:{"@initial":"2","@desktop":"1"},children:[(0,i.jsx)(Na,{align:"center",css:{background:e.isValid?"$success100":"white",border:e.isValid?"none":"1px solid $gray300",borderRadius:"16px",color:"$success500",fontSize:"11px",height:"16px",width:"16px"},justify:"center",children:e.isValid&&(0,i.jsx)(el,{icon:"check"})}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:e.children})]}),hd=e=>{const t=Yn();return(0,i.jsxs)(cd,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$md",gap:"$3 $1",gridTemplateColumns:"1fr",gridTemplateRows:"1fr 1fr 1fr 1fr",padding:"$4","@desktop":{gridTemplateColumns:"1fr 1fr",gridTemplateRows:"1fr 1fr"}},children:[(0,i.jsx)(ud,{isValid:Wl(e.password),children:t("16_caract_res_m_52434")}),(0,i.jsx)(ud,{isValid:Gl(e.password),children:t("au_moins_un_chi_73862")}),(0,i.jsx)(ud,{isValid:Hl(e.password),children:t("au_moins_une_ma_58302")}),(0,i.jsx)(ud,{isValid:ql(e.password),children:t("au_moins_un_car_54396")})]})},md=e=>{const t=Yn(),n=Qn(),s=ti(),o=qn(Ba),r=qn(ld),[a,l]=(0,L.useState)(0);return(0,i.jsx)(id,{link:(0,i.jsxs)(sd,{children:[(0,i.jsx)(yr,{color:"gray500",children:t("vous_n_avez_pas_69078")}),(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{n.push($s.AUTH_SIGN_IN_EMAIL)},children:t("r_essayer_21582")})]}),children:(0,i.jsx)(Cl,{direction:"column",initialValues:{email:s.getItem(Bl.AUTH_EMAIL)||"",code:"",password:""},render:({handleSubmit:e,submitting:n,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("mot_de_passe_ou_17690")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("saisissez_votre_47959")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Ll,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451"),state:a>0?"disabled":"active"}),a>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{autoComplete:"one-time-code",label:t("code_re_u_par_e_75150"),name:"code",placeholder:t("code_20843")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(ad,{autoComplete:"new-password",label:t("nouveau_mot_de_46347"),name:"password",placeholder:t("entrez_votre_mo_51874")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(hd,{password:s.password})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(El,{isLoading:n,textAlign:"center",onClick:e,children:t(0===a?"recevoir_le_cod_88633":"r_initialiser_l_12900")})]}),validate:e=>0===a?o.validateForForm(r.step1Schema())(e):o.validateForForm(r.step2Schema())(e),width:1,onSubmit:async t=>{0===a?(await ee(t.email),l(1)):e.onSuccess(await te(t.email,t.code,t.password))}})})},gd={Aso:{Aso:n(8301),HomeBackground:n(8144),Logo:n(0)},Blanks:{Accreditation:n(7008),Member:n(5594)},Maps:{GooglePlan:n(1416),GoogleSatellite:n(6954),IgnPlan:n(4025)},AvatarGroup:n(384),Background404:n(4236),FormPositionRanked:n(4628),FormPositionUnranked:n(1205),Google:n(1931),GoogleMaps:n(1446),Ign:n(9882),Login:n(2647),Login2x:n(2281),LogoWeezeventSquare:n(6041),UserProfile:n(8264),WeezConstruction:n(6400)},pd={Alert:n(2630),Check:n(3780),DnsBlank:n(1037),DnsWrongDomain:n(8184),Done:n(8652),Done2:n(3574),FileCSV:n(9625),RecrewteerMarker:n(8798),Sad:n(5376),WeezeventBlankHandGlobe:n(2599),WeezeventBlankMessages:n(6687),WeezeventBlankPerson:n(7648),WeezeventBlankSwissArmyKnife:n(4362)};var fd=n(7480);const xd=[yt.De,yt.En,yt.Es,yt.Fr,yt.Nl];function _d(e){if(m(e)){const t=(0,fd.A)(e.trim().substring(0,2));return xd.includes(t)?t:null}return null}function Id(e,t){return t.has("lang")?_d(t.get("lang"))||yt.En:e||_d(navigator.language)||yt.En}const vd=P.EMAIL_FROM_NAME,bd=P.EMAIL_FROM;function jd(e){return e===yt.Fr?"https://weezevent.com/fr/cgus/":e===yt.Nl?"https://weezevent.com/nl/gebruiksvoorwaarden-diensten/":e===yt.Es?"https://weezevent.com/es/cgus/":"https://weezevent.com/en-gb/terms-of-use/"}const Cd=e=>{const{translate:t,history:n}=_l(),s=qn(Yl),o=qn(Ba),r=ti(),a=jd(Id(null,new URL(location.href).searchParams));return(0,i.jsx)(id,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(sd,{children:[(0,i.jsx)(yr,{color:"gray500",children:t("pas_encore_sur_13386")}),(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{n.push($s.AUTH_SIGN_UP_CREDENTIALS)},children:t("ouvrez_un_compt_91337")})]}),(0,i.jsx)(sd,{children:(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{window.open(a,"_blank")},children:t("conditions_g_n_34786")})})]}),children:(0,i.jsx)(Cl,{direction:"column",initialValues:{email:"",password:""},render:({handleSubmit:e,submitting:s,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:t("ravi_de_vous_re_24368")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("identifiez_vous_57743")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Ll,{autoComplete:"email",isEmail:!0,label:t("adresse_e_mail_60930"),name:"email",placeholder:t("entrez_votre_ad_42451")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(ad,{label:t("mot_de_passe_41738"),name:"password",placeholder:t("entrez_votre_mo_51874"),onForgotPasswordClick:()=>{r.setItem(Bl.AUTH_EMAIL,o.email),n.push($s.AUTH_FORGOT_PASSWORD)}}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(El,{isLoading:s,textAlign:"center",onClick:e,children:t("se_connecter_63820")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{align:"center",gap:"4",children:[(0,i.jsx)(yr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(yr,{color:"gray500",fontSize:"textXs",children:t("ou_67404")}),(0,i.jsx)(yr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{r.setItem(Bl.AUTH_EMAIL,o.email),n.push($s.AUTH_SIGN_IN_CODE)},children:[(0,i.jsx)(yr,{color:"gray500",fontSize:"textMd",children:(0,i.jsx)(el,{icon:"envelope"})}),(0,i.jsx)(yr,{color:"gray700",children:t("se_connecter_av_59438")})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=nd("Google")},children:[(0,i.jsx)(yr,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:gd.Google})}),(0,i.jsx)(yr,{color:"gray700",children:t("se_connecter_av_86208")})]})]}),validate:e=>o.validateForForm(s.signInPasswordSchema())(e),width:1,onSubmit:async n=>{try{return e.onSuccess(await Q(n.email,n.password)),{}}catch(e){if("NotAuthorizedException"===e.code&&"Incorrect username or password."===e.message||"UserNotFoundException"===e.code&&"User does not exist."===e.message)return{email:t("adresse_e_mail_73393")};throw e}}})})};let yd=class extends Yl{constructor(e){super(e)}step1Schema(){return d.Ik().shape({email:this.email(),password:this.passwordRules()})}step2Schema(){return d.Ik().shape({email:this.email(),code:this.code(),password:this.passwordRules()})}};yd=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],yd);const kd=e=>{const{history:t,translate:n}=_l(),s=qn(Ba),o=qn(yd),[r,a]=(0,L.useState)(0),l=jd(Id(null,new URL(location.href).searchParams));return(0,i.jsx)(id,{link:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(sd,{children:[(0,i.jsx)(yr,{color:"gray500",children:n("vous_avez_d_j_26391")}),(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{t.push($s.AUTH_SIGN_IN_EMAIL)},children:n("connectez_vous_14760")})]}),(0,i.jsx)(sd,{children:(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},onClick:()=>{window.open(l,"_blank")},children:n("conditions_g_n_34786")})})]}),children:(0,i.jsx)(Ua.lV,{initialValues:{email:"",code:"",password:""},render:({handleSubmit:e,submitting:t,values:s})=>(0,i.jsxs)("form",{style:{width:"100%"},onSubmit:e,children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",textAlign:"center",children:n("cr_er_un_compte_71423")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:n("utilisez_recrew_64841")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Ll,{autoComplete:"email",isEmail:!0,label:n("adresse_e_mail_60930"),name:"email",placeholder:n("entrez_votre_ad_42451"),state:r>0?"disabled":"active"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(ad,{label:n("nouveau_mot_de_46347"),name:"password",placeholder:n("entrez_votre_mo_51874"),state:r>0?"disabled":"active"}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(hd,{password:s.password}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{autoComplete:"one-time-code",label:n("code_re_u_par_e_75150"),name:"code",placeholder:n("code_20843"),type:"number"})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(El,{isLoading:t,textAlign:"center",onClick:e,children:n(0===r?"recevoir_le_cod_04513":"cr_er_mon_compt_84515")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{align:"center",gap:"4",children:[(0,i.jsx)(yr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}}),(0,i.jsx)(yr,{color:"gray500",fontSize:"textXs",children:n("ou_67404")}),(0,i.jsx)(yr,{css:{borderTop:"1px solid $gray200",flex:"1",height:"1"}})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid $gray300",borderRadius:"$2",cursor:"pointer",height:"40px"},gap:"3",justify:"center",onClick:()=>{window.location.href=nd("Google")},children:[(0,i.jsx)(yr,{children:(0,i.jsx)("img",{alt:"Google logo",height:"24px",src:gd.Google})}),(0,i.jsx)(yr,{color:"gray700",children:n("s_inscrire_avec_54027")})]})]}),validate:e=>0===r?s.validateForForm(o.step1Schema())(e):s.validateForForm(o.step2Schema())(e),onSubmit:async t=>{0===r?(await ee(t.email),a(1)):e.onSuccess(await te(t.email,t.code,t.password))}})})},Ad=async e=>{await ho(vo,{token:e}),window.location.href=$s.HOME},wd=e=>{e&&ri("Auth failure",e),window.location.href=$s.AUTH_SIGN_IN},Sd=()=>(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:$s.AUTH_FORGOT_PASSWORD,children:(0,i.jsx)(md,{onSuccess:Ad})}),(0,i.jsx)(Ar.qh,{exact:!0,path:$s.AUTH_SIGN_IN_EMAIL,children:(0,i.jsx)(Cd,{onSuccess:Ad})}),(0,i.jsx)(Ar.qh,{exact:!0,path:$s.AUTH_SIGN_IN_CODE,children:(0,i.jsx)(od,{onFailure:wd,onSuccess:Ad})}),(0,i.jsx)(Ar.qh,{exact:!0,path:$s.AUTH_SIGN_UP_CREDENTIALS,children:(0,i.jsx)(kd,{onSuccess:Ad})}),(0,i.jsx)(Ar.qh,{exact:!0,path:$s.AUTH_SIGN_UP_CODE,children:(0,i.jsx)(ni,{path:$s.AUTH_SIGN_IN_EMAIL})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.AUTH_SIGN_IN_EMAIL})})]}),Ed=e=>(L.useEffect(()=>{!e.loader&&e.onLoad&&e.onLoad()},[e.loader]),e.loader?e.loader:(0,i.jsx)(i.Fragment,{children:e.children||(0,i.jsx)("div",{})})),Td=()=>{const[,e]=location.search.substr(1).split("="),{data:t,loader:n}=Zn("query Tokens($code: String!) {\n userTokens(code: $code) {\n accessToken\n idToken\n refreshToken\n email\n }\n}\n",{code:e},[]);return(0,i.jsx)(Ed,{loader:n,onLoad:()=>{!function(e){const t=new B.p4({IdToken:new B.Yw({IdToken:e.idToken}),RefreshToken:new B.c9({RefreshToken:e.refreshToken}),AccessToken:new B.pD({AccessToken:e.accessToken})}),n=e.email.trim().toLowerCase();new B.TU({Username:n,Pool:q()}).setSignInUserSession(t)}(t.userTokens),window.location.href=$s.HOME}})},zd="www.partagetapassion.com",Od="registering.aso.fr",Rd="billets.strangerthings-laderniereaventure.com",$d=new Map([[1792,"evenements.handicap-international.fr"],[858,zd],[1773,"communaute.rncb.fr"],[3306,"mariage.ravey.fr"],[3136,Od],[3469,Rd]]);function Dd(e){(0,L.useEffect)(()=>{const t=document.title;return document.title=(n=location.host,`${m(i=e)?`${i} | `:""}${function(e){return e===zd?"Partage Ta Passion":e===Rd?"L'Upside Down s'empare de Paris":e===Od?"A.S.O.":vd}(n)}`),()=>{document.title=t};var n,i},[e])}function Pd(e,t){const n=L.useCallback(e,t||[]);L.useEffect(()=>(document.addEventListener("click",n,!1),()=>{document.removeEventListener("click",n,!1)}),t||[])}function Fd(e){const t=(0,L.useCallback)(t=>{"Esc"!==t.key&&"Escape"!==t.key||e()},[]);(0,L.useEffect)(()=>(document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}),[])}const Md="h-dropdown-open";function Nd(e,t){e.dispatchEvent(new CustomEvent(Md,{bubbles:!0,detail:{uuid:t??""}}))}const Ld=L.createContext({}),Bd=e=>{const t=L.useRef(V()),[n,s]=L.useState(e.isOpen??!1),[o,r]=L.useState(null),[a,l]=L.useState(null),d=L.useCallback(n=>{e.disabled||(s(n),e.onStateChange&&e.onStateChange(n),!0===n&&o&&Nd(o,t.current))},[e.disabled,o,s,e.onStateChange]),c=L.useCallback(n=>{n.detail.uuid!==t.current&&!0!==e.doNotCloseOnOtherOpen&&d(!1)},[d]);return L.useEffect(()=>{e.isOpen!==n&&s(e.isOpen??!1)},[e.isOpen]),L.useEffect(()=>(document.addEventListener(Md,c),()=>{document.removeEventListener(Md,c)}),[c]),Fd(()=>{d(!1)}),Pd(()=>{d(!1)}),(0,i.jsx)(Ld.Provider,{value:{isOpen:n,referenceElement:o,popperElement:a,setIsOpen:d,setReferenceElement:r,setPopperElement:l},children:e.children})};function Vd(){return L.useContext(Ld)}const Ud=pr("div",{alignItems:"center",display:"flex",fontSize:"$textSm",fontWeight:"$regular",minHeight:"40px",px:"$4",py:"$2",userSelect:"none",width:"100%",ellipsis:"",variants:{color:{default:{cursor:"pointer",color:"$gray700","&:hover":{background:"$primary50",color:"$primary700"}},disabled:{color:"$gray400",cursor:"not-allowed"},heading:{color:"$gray500",fontSize:"$textXs",fontWeight:"$semiBold",cursor:"default"},red:{cursor:"pointer",color:"$error700","&:hover":{background:"$error50"}}}},defaultVariants:{color:"default"}}),Wd=({children:e,color:t,css:n,download:s,to:o,onClick:r,target:a,role:l})=>"disabled"!==t&&o?(0,i.jsx)(Ja,{download:s,target:a,to:o,onClick:e=>r?.(e),children:(0,i.jsx)(Ud,{color:t||"default",css:n,children:e})}):(0,i.jsx)(Ud,{color:t||"default",css:n,role:l??"menuitem",tabIndex:o?void 0:"presentation"!==l?0:void 0,onClick:e=>r?.(e),children:e}),Gd=({css:e,children:t,color:n,download:s,icon:o,isDisabled:r=!1,onClick:a,to:l,target:d})=>(0,i.jsx)(Wd,{color:n,css:{cursor:r?"not-allowed":"pointer",opacity:r?"0.6":"inherit",...e},download:s,target:d,to:l,onClick:e=>{r||(Nd(e.target),a?.(e))},children:(0,i.jsxs)(Na,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(Na,{align:"center",height:1,justify:"start",width:16,children:(0,i.jsx)(el,{icon:o})}),(0,i.jsx)(yr,{css:{flex:"1",ellipsis:""},children:t})]})});var Hd=n(832);const qd=e=>{const{isOpen:t,referenceElement:n,popperElement:s,setPopperElement:o}=Vd(),{styles:r,attributes:a,update:l}=(0,Hd.E)(n,s,{placement:e.placement,modifiers:[{name:"offset",options:{offset:[0,e.offset??8]}}]}),d="match"===e.width?`${n?.getBoundingClientRect().width??240}px`:"number"==typeof e.width?`${e.width}px`:"fit-content";L.useEffect(()=>{l?.()},[l,t,n]),L.useEffect(()=>{if(n){const e=new ResizeObserver(()=>{l?.()});return e.observe(n),()=>{e.disconnect()}}return Ql.A},[l,n]);const c=(0,i.jsx)(Na,{ref:o,"aria-hidden":!t,"aria-orientation":e["aria-orientation"],css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$lg",display:t?"flex":"none",maxHeight:e.maxHeight?`${e.maxHeight}px`:void 0,overflowX:"hidden",overflowY:"auto",py:"$2",width:d,zIndex:"400",...e.css,...r.popper,"&:empty":{opacity:0}},direction:"column",id:e.id,role:"menu",onClick:e=>Rl(e,!1),...a.popper,tabIndex:-1,children:e.children});return t?e.renderOnPortal?(0,Ht.createPortal)(c,document.body):c:null},Yd=e=>{const{isOpen:t,setIsOpen:n,setReferenceElement:s}=Vd(),o=e.children,r=e=>{Rl(e),n(!t),o.props.onClick?.(e)},a=L.cloneElement(L.Children.only(o),{ref(e){s(e)},onClick(e){e.preventDefault(),r(e)},onKeyPress(e){r(e)},tabIndex:0});return(0,i.jsx)(i.Fragment,{children:a})};var Kd=n(5315);function Zd(e){try{if("#"!==e[0]||7!==e.length)return"black";{const t=parseInt(e.substring(1,3),16);return.299*t+.587*parseInt(e.substring(3,5),16)+.114*parseInt(e.substring(5),16)>150?"black":"white"}}catch{return"black"}}function Xd(e,t){const n="#"===e[0]?1:0;return`rgba(${parseInt(e.substring(0+n,2+n),16)}, ${parseInt(e.substring(2+n,4+n),16)}, ${parseInt(e.substring(4+n),16)}, ${t>1?t/100:t})`}const Jd=[0,50,100,200,300,400,500,600,700,800,900,950,1e3],Qd=Object.fromEntries(Object.keys(fr.colors).filter(e=>e.includes("700")).flatMap(e=>{const t=e.substring(0,e.length-3),n={50:fr.colors[`${t}50`].value,100:fr.colors[`${t}100`].value,500:fr.colors[`${t}500`].value,700:fr.colors[`${t}700`].value};return[[t,n],[n[700],n]]}));function ec(e,t=700){const n=Qd[e.toLowerCase()];if(n)return n;{const n=(0,Kd.KI)(e),i=((e,t=700)=>Jd.map(n=>{if(0===n)return{stop:n,tweak:100};if(1e3===n)return{stop:n,tweak:0};if(n===t)return{stop:n,tweak:e};{const i=Math.abs((n-t)/100),s=n[e,n.copy({l:t/100}).formatHex()]))}}function tc(e){return m(e)&&e.startsWith("#")&&7===e.length}const nc=pr("div",{alignItems:"center",borderRadius:"$1",display:"flex",fontWeight:"$medium",gap:"$1",px:"$2",userSelect:"none",height:"fit-content","&:has(.h-badge-count)":{paddingRight:"$1"},"& > .h-badge-count":{borderRadius:"3px",height:"calc(100% - 8px)",marginLeft:"$1",px:"6px"},variants:{size:{sm:{height:"22px",fontSize:"12px","& > .h-badge-count":{fontSize:"10px"}},md:{height:"24px",fontSize:"12px","& > .h-badge-count":{fontSize:"10px"}},lg:{height:"28px",fontSize:"14px","& > .h-badge-count":{fontSize:"12px"}}},cursor:{default:{cursor:"default"},pointer:{cursor:"pointer"},text:{cursor:"text"}},ellipsis:{true:{maxWidth:"80%","& .h-badge-content":{ellipsis:!0,flex:"1"}}}},defaultVariants:{size:"sm",cursor:"default"}}),ic=L.forwardRef((e,t)=>{const n=L.useMemo(()=>{const t=e.color||"gray",n=ec(t);return"gray"===t?{background:"$gray100",color:"$gray700","& > .h-badge-left-icon":{color:"$gray500"},"& > .h-badge-count":{background:"$gray200"}}:"white"===t?{background:"white",border:"1px solid $gray300","& > .h-badge-count":{background:"$gray100"}}:"white-with-green-icon"===t?{background:"white",border:"1px solid $gray300","& > .h-badge-left-icon":{color:"$success500"}}:{background:n[50],color:n[700],"& > .h-badge-left-icon":{color:n[500]},"& > .h-badge-count":{background:n[100]}}},[e.color]);return(0,i.jsxs)(nc,{ref:t,color:e.color,css:{maxWidth:"100%",...n,...e.css},cursor:e.cursor,ellipsis:e.ellipsis,size:e.size,onClick:e.onClick,children:[e.leftIcon&&(0,i.jsx)(Na,{className:"h-badge-left-icon",css:{cursor:e.onLeftIconClick?"pointer":"inherit"},onClick:t=>{e.onLeftIconClick?.(t)},children:(0,i.jsx)(el,{icon:e.leftIcon,iconStyle:e.leftIconStyle})}),e.children&&(0,i.jsx)(yr,{className:"h-badge-content",css:{flex:"1",overflow:"hidden"},title:e.title,onClick:t=>{e.onContentClick?.(t)},children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:"string"==typeof e.children?e.children:"",children:e.children})}),e.rightIcon&&(0,i.jsx)(Na,{css:{cursor:e.onRightIconClick?"pointer":"inherit"},onClick:t=>{e.onRightIconClick?.(t)},children:(0,i.jsx)(el,{icon:e.rightIcon})}),("number"==typeof e.count||m(e.count))&&(0,i.jsx)(Na,{align:"center",className:"h-badge-count",children:e.count})]})});ic.displayName="Badge";const sc=vr({"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}),oc=L.memo(function(e){const t="circular"===e.variant?e.size:e.height,n="circular"===e.variant?e.size:e.width;return(0,i.jsx)(yr,{css:{animation:`${sc} 1.5s ease-in-out 0.5s infinite`,background:"$gray200",borderRadius:"circular"===e.variant?"50%":e.borderRadius,color:"transparent",...e.css},height:t,width:n,children:e.children})});var rc=n(9116),ac=n(6618),lc=n(2499),dc=n(7456),cc=n(4757);const uc=({children:e,index:t,...n})=>(0,i.jsxs)(i.Fragment,{children:[0!==t&&(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{"aria-label":e?.toString(),font:"gray600 textXs semiBold",role:"group",width:1,...n,children:e}),(0,i.jsx)(qa,{height:"2"})]}),hc=pr("div",{alignItems:"center",border:"1px solid $gray300",cursor:"pointer",display:"flex",fontSize:"10px",fontWeight:"$semiBold",justifyContent:"center","& > i":{fontSize:"10px",fontWeight:"$semiBold"},variants:{size:{sm:{borderRadius:"4px",height:"16px",width:"16px"},md:{borderRadius:"6px",height:"20px",width:"20px"}},state:{unchecked:{background:"white","&:hover":{border:"1px solid $primary600"}},checked:{background:"$primary600",border:"none",color:"white"},indeterminate:{background:"$primary600",border:"none",color:"white",padding:"$1","& > div":{borderTop:"2px solid white",width:"100%"}}},disabled:{true:{}}},compoundVariants:[{state:"unchecked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","&:hover":{borderColor:"$gray200"}}},{state:"checked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200",color:"$gray300"}},{state:"indeterminate",disabled:!0,css:{background:"$gray100",borderColor:"$gray200",color:"$gray300","& > div":{borderTopColor:"$gray300"}}}],defaultVariants:{size:"sm",state:"unchecked"}}),mc=({shouldPreventDefault:e=!0,...t})=>{const n=n=>{e&&Rl(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked",n):t.onClick("checked",n))};return(0,i.jsxs)(hc,{"aria-describedby":t.descId,"aria-labelledby":t.labelId,disabled:t.disabled,id:t.inputId,role:"checkbox",size:t.size,state:t.state,tabIndex:t.tabIndex??0,onClick:e=>n(e),onKeyDown:e=>{"Space"===e.code&&n(e)},children:["checked"===t.state&&(0,i.jsx)("i",{className:"far fa-check"}),"indeterminate"===t.state&&(0,i.jsx)("div",{})]})},gc=({shouldPreventDefault:e=!0,...t})=>{const{descId:n,inputId:s,labelId:o}=Ga(),r=void 0!==t.subtext&&null!==t.subtext,a=n=>{e&&n.preventDefault(),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked",n):t.onClick("checked",n))};return(0,i.jsxs)(Na,{css:{cursor:t.disabled?"not-allowed":"pointer",userSelect:"none",...t.css},tabIndex:0,onClick:a,onKeyDown:e=>{"Space"===e.code&&a(e)},children:[(0,i.jsx)(Na,{css:{alignItems:"center",height:"md"===t.size?"23px":"20px"},children:(0,i.jsx)(mc,{descId:n,disabled:t.disabled,inputId:s,labelId:o,shouldPreventDefault:!1,size:t.size,state:t.state,tabIndex:-1,onClick:Ql.A})}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsxs)(Na,{css:{flexDirection:"column",fontSize:"md"===t.size?"$3":"$2"},children:[(0,i.jsx)(Pl,{htmlFor:s,id:o,children:(0,i.jsx)(yr,{css:{color:t.disabled&&!r?"$gray300":"$gray800"},fontWeight:"medium",children:t.children})}),r&&(0,i.jsx)(yr,{color:"gray500",id:n,children:t.subtext})]})]})},pc=pr("div",{background:"white",alignItems:"center",cursor:"pointer",display:"flex",justifyContent:"center",variants:{size:{sm:{borderRadius:"16px",height:"16px",width:"16px"},md:{borderRadius:"20px",height:"20px",width:"20px"}},state:{unchecked:{border:"1px solid $gray300","&:hover":{border:"1px solid $primary600"}},checked:{border:"1px solid $primary600"}},disabled:{true:{cursor:"not-allowed"}}},compoundVariants:[{size:"sm",state:"checked",css:{"& > div":{background:"$primary600",borderRadius:"6px",height:"6px",width:"6px"}}},{size:"md",state:"checked",css:{"& > div":{background:"$primary600",borderRadius:"8px",height:"8px",width:"8px"}}},{state:"unchecked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","&:hover":{borderColor:"$gray200"}}},{state:"checked",disabled:!0,css:{background:"$gray100",borderColor:"$gray200","& > div":{background:"$gray300 !important"}}}],defaultVariants:{size:"sm",state:"unchecked"}}),fc=({shouldPreventDefault:e=!0,...t})=>{const n=n=>{e&&Rl(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked"):t.onClick("checked"))};return(0,i.jsx)(pc,{"aria-describedby":t.descId,"aria-labelledby":t.labelId,disabled:t.disabled,id:t.inputId,role:"radio",size:t.size,state:t.state,tabIndex:t.tabIndex??0,onClick:n,onKeyDown:e=>{"Space"===e.key&&n(e)},children:"checked"===t.state&&(0,i.jsx)("div",{})})},xc=({shouldPreventDefault:e=!0,...t})=>{const{inputId:n,descId:s,labelId:o}=Ga(),r="string"==typeof t.subtext&&t.subtext.length>0,a=n=>{e&&Rl(n),!0!==t.disabled&&("unchecked"!==t.state&&t.state?t.onClick("unchecked"):t.onClick("checked"))};return(0,i.jsxs)(Na,{css:{...t.css,cursor:t.disabled?"not-allowed":"pointer",userSelect:"none"},tabIndex:0,onClick:e=>{a(e)},onKeyDown:e=>{"Space"===e.key&&a(e)},children:[(0,i.jsx)(Na,{css:{alignItems:"center",height:"md"===t.size?"23px":"20px"},children:(0,i.jsx)(fc,{descId:s,disabled:t.disabled,inputId:n,labelId:o,shouldPreventDefault:!1,size:t.size,state:t.state,tabIndex:-1,onClick:Ql.A})}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsxs)(Na,{css:{flexDirection:"column",fontSize:"md"===t.size?"$3":"$2","& div":{cursor:"pointer !important"}},children:[(0,i.jsx)(Pl,{htmlFor:n,id:o,children:(0,i.jsx)(yr,{css:{color:t.disabled&&!r?"$gray300":"$gray800"},fontWeight:"medium",children:t.children})}),t.subtext&&(0,i.jsx)(yr,{color:"gray500",id:s,children:t.subtext})]})]})},_c=({children:e,css:t,disabled:n,isCheckbox:s,isRadio:o,isSelected:r,onClick:a,subtext:l,value:d,...c})=>{const u=L.useCallback(()=>{n||a?.()},[n,a]),h=L.useCallback(e=>{"Enter"===e.key&&u?.()},[u]);return(0,i.jsxs)(Na,{align:"center","aria-checked":s?r:void 0,"aria-label":e,"aria-selected":r,css:{cursor:n?"default":"pointer",minHeight:"40px",padding:"$2 $3",userSelect:"none","&:hover":{background:"$gray100",borderRadius:"$1"},...t},gap:"3",role:"option",tabIndex:0,width:1,onClick:u,onKeyDown:h,...c,children:[s&&(0,i.jsx)(mc,{disabled:n,shouldPreventDefault:!1,state:r?"checked":"unchecked",onClick:Ql.A}),o&&(0,i.jsx)(fc,{shouldPreventDefault:!1,state:r?"checked":"unchecked",onClick:Ql.A}),(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray800",css:{ellipsis:!0},title:e,width:1,children:e}),m(l)&&(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0},title:l,width:1,children:l})]}),!s&&!o&&r&&(0,i.jsx)(yr,{color:"primary700",children:(0,i.jsx)(el,{icon:"check"})})]})};function Ic(e){return L.Children.toArray(e).map(t=>{if("optgroup"===t.type)return[{id:(0,Wa.A)(),type:"group",text:t.props.label}].concat(Ic(t.props.children));if("option"===t.type)return{id:(0,Wa.A)(),type:"option",text:t.props.children,value:t.props.value,disabled:t.props.disabled,selected:t.props.selected,radio:t.props["data-radio"],style:t.props.style,subtext:t.props["data-subtext"]};if(t.type===Symbol.for("react.fragment"))return Ic(t.props.children);throw ri("Unexpected child type",t,e),new Error("Unexpected child type")}).flat()}function vc(e){return Object.fromEntries(e.filter(e=>"option"===e.type).map(e=>[e.value,e.text]))}const bc=({children:e,createText:t,css:n,description:s,hint:o,icon:r,isCreateVisible:a,isSearchLoading:l,isSearchVisible:d,isSelectAllVisible:c,label:u,menuWidth:h,multiple:p,onChange:f,onClick:x,onCreateClick:_,placeholder:I,renderOnPortal:v,renderValue:b,searchElement:j,searchPlaceholder:C,state:y,triggerElem:k,values:A})=>{const w=Yn(),S=L.useCallback(e=>e?.focus({preventScroll:!0}),[]),[E,T]=L.useState(!1),[z,O]=L.useState(""),{inputId:R,descId:$}=Ga(),D=L.useMemo(()=>Ic(e),[e]),P=L.useMemo(()=>D.flatMap(e=>"option"===e.type?[e.value]:[]),[D]),F=L.useMemo(()=>{const e=(z||"").trim().toLowerCase();return D.filter(t=>""===e||"group"===t.type||t.text.toLowerCase().includes(e)).filter((e,t,n)=>{const i=n[t+1];return"option"===e.type||"option"===i?.type})},[D,z]),M=L.useMemo(()=>(0,rc.A)((0,ac.A)(F.filter(e=>"option"===e.type&&m(e.radio)),e=>e.radio),e=>e.map(e=>e.value)),[F]),N=L.useMemo(()=>vc(D),[D]),B=L.useMemo(()=>(0,Pr.A)((0,lc.A)(A),(0,lc.A)(P)),[A,P]),V=L.useCallback(()=>{f(B?[]:P)},[f,P,B]),U=L.useMemo(()=>b?b(A[0],N[A[0]]):N[A[0]],[b,A,N]);return L.useEffect(()=>{E||O("")},[E]),(0,i.jsxs)(Na,{css:n,direction:"column",width:1,children:[u&&(0,i.jsx)(Pl,{htmlFor:R,children:u}),s&&(0,i.jsx)($l,{id:$,children:s}),(u||s)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Bd,{disabled:"disabled"===y,isOpen:E,onStateChange:e=>T(e),children:[(0,i.jsx)(Yd,{children:k||(0,i.jsx)(Ml,{"aria-describedby":$,"aria-label":(u??I)+(N[A[0]]?` (currently: ${N[A[0]]})`:""),"aria-multiselectable":p,"aria-owns":F.map(e=>e.id).join(" "),"aria-placeholder":I,css:{maxHeight:"200px",overflowY:"auto",padding:"$2 $3",userSelect:"none"},cursor:"disabled"===y?"default":"pointer",height:"fluid",icon:r,id:R,rightIcon:E?"chevron-up":"chevron-down",state:y,children:no(A)?p?(0,i.jsx)(Na,{css:{flex:"1",overflowY:"auto"},gap:"2",height:1,role:"presentation",wrap:"wrap",children:A.map((e,t)=>(0,i.jsx)(ic,{ellipsis:!0,rightIcon:"xmark",onRightIconClick:t=>{Rl(t),f((0,dc.A)(A,e))},children:N[e]},t))}):(0,i.jsx)(yr,{color:"gray800",css:{flex:"1",overflow:"hidden"},role:"presentation",children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:U,children:U})}):(0,i.jsx)(yr,{color:"gray500",css:{flex:"1"},role:"presentation",children:I})})}),(0,i.jsx)(qd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:v,width:h??"match",children:(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsxs)(Na,{css:{padding:"$3"},direction:"column",width:1,children:[d&&(0,i.jsxs)(i.Fragment,{children:[j||(0,i.jsx)(Nl,{ref:S,icon:"magnifying-glass",placeholder:C||w("rechercher_50038"),state:"search",value:z,onChange:O}),(0,i.jsx)(qa,{height:"3"})]}),(0,i.jsx)(yr,{css:{maxHeight:"250px",overflowY:"auto"},children:l?(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(oc,{borderRadius:"$1",height:40}),(0,i.jsx)(oc,{borderRadius:"$1",height:40}),(0,i.jsx)(oc,{borderRadius:"$1",height:40})]}):F.map((e,t)=>{if("group"===e.type)return(0,i.jsx)(uc,{id:e.id,index:t,children:e.text},e.id);{const n=e.value,s=e.selected??A.includes(n),o=e.radio,r=!0===p&&g(o),a=!0===p&&m(o);return(0,i.jsx)(_c,{css:e.style,disabled:e.disabled,id:e.id,isCheckbox:r,isRadio:a,isSelected:s,subtext:e.subtext,value:e.value,onClick:()=>{if(x)x(n,s);else if(p&&r)f(s?(0,dc.A)(A,n):A.concat(n));else if(p&&a){const e=(0,cc.A)(A,M[o]).concat(s?[]:[n]);f(e)}else f(s?[]:[n]),T(!1)},children:e.text},t)}})})]}),a&&(0,i.jsxs)(Na,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary700",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:()=>{_?.(),T(!1)},children:["+ ",t||w("cr_er_82895")]}),c&&(0,i.jsx)(Na,{css:{background:"$gray50",boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",color:"$primary700",cursor:"pointer",padding:"$3 $4",userSelect:"none"},width:1,onClick:V,children:w(B?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})})]}),(0,i.jsx)(Dl,{state:y,children:o})]})},jc=e=>(0,i.jsx)(Na,{align:"center",className:"table-header-row",css:{background:"$gray50",border:"1px solid $gray200",fontSize:"$textXs",fontWeight:"$medium",height:"44px",width:"100%",...e.css},role:"row",children:e.children}),Cc=L.createContext({}),yc=e=>{const[t,n]=L.useState(null);return(0,i.jsx)(Cc.Provider,{value:{clickedRowIndex:t,setClickedRowIndex:n},children:e.children})},kc=({children:e,css:t,hideBorder:n,...s})=>(0,i.jsx)(yc,{children:(0,i.jsx)(Na,{className:!0===n?"table-no-border":"table",css:{width:"100%","&.table > div:first-child":{borderTopLeftRadius:"$1",borderTopRightRadius:"$1"},"&.table > div:last-child":{borderBottomLeftRadius:"$1",borderBottomRightRadius:"$1"},"&.table-no-border .table-header-row":{borderLeft:"none",borderRight:"none",borderTop:"none"},"&.table-no-border .table-row":{borderLeft:"none",borderRight:"none"},"&.table-no-border .table-row:last-child":{borderBottom:"none"},...t},direction:"column",...s,children:e})});function Ac(e){const t=window.matchMedia(e),[n,i]=(0,L.useState)(t.matches);return(0,L.useEffect)(()=>{const e=()=>i(t.matches);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},[n,e]),n}function wc(){return Ac(mr.mobile)}function Sc(e,t){return{flex:t?"1 1 0":e?"0 0 0":"1",minWidth:t?`${t}px`:e?`${e}px`:void 0}}const Ec=L.forwardRef((e,t)=>(0,i.jsx)(Na,{ref:t,align:"center",className:"table-cell",css:{...Sc(e.width,e.minWidth),color:"$gray800",overflow:"hidden",px:"$3",...e.css},height:1,role:"gridcell",onClick:t=>{e.onClick&&e.onClick(t)},...(0,wr.A)(e,["direction","align","justify","wrap","gap"]),children:e.children}));Ec.displayName="Cell";const Tc=25,zc=[25,50,100];var Oc=n(7773);const Rc=e=>(0,i.jsx)(El,{color:"white",css:{background:e.active?"$gray100":"white",border:0,borderInlineStart:"1px solid $gray300",color:e.disabled?"$gray400":"$gray700",cursor:e.cursor,fontWeight:"$medium",inlineSize:"40px",blockSize:"32px",alignItems:"center",justifyContent:"center",borderRadius:"unset"},disabled:e.disabled,textAlign:"center",onClick:()=>{e.onClick()},children:e.children}),$c=e=>{const t=Yn(),n=wc(),s=e.limit??Tc,o=Kn(),r=e.offset/s,a=(0,Oc.A)(Math.max(0,r-2),Math.min(e.numberOfPages,r+3)),l=0===r,d=r===e.numberOfPages-1,c=Math.min(e.totalCount,(r+1)*s);return(0,i.jsxs)(Ec,{css:{gap:"$6","@tablet":{justifyContent:"space-between"}},children:[(0,i.jsx)(yr,{css:{order:1,display:n?"none":void 0},width:150,children:!n&&e.showLimits&&(0,i.jsx)(Na,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:zc.map((t,n)=>(0,i.jsx)(Rc,{active:s===t,cursor:"pointer",disabled:!1,onClick:()=>{e.setLimit?.(t)},children:t},n))})}),!n&&(e.totalCount>s?(0,i.jsxs)(Na,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:3,"& > button:first-child":{borderLeft:"none"}},children:[(0,i.jsx)(Rc,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset-s),children:(0,i.jsx)(el,{icon:"arrow-left"})}),e.numberOfPages<=7?(0,Oc.A)(0,e.numberOfPages).map(t=>(0,i.jsx)(Rc,{active:r===t,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(t*s),children:t+1},t)):(0,i.jsxs)(i.Fragment,{children:[!a.includes(0)&&(0,i.jsx)(Rc,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(0),children:"1"}),!a.includes(1)&&(0,i.jsx)(Rc,{active:!1,cursor:"default",disabled:!1,onClick:Ql.A,children:(0,i.jsx)(el,{icon:"ellipsis"})}),a.map(t=>(0,i.jsx)(Rc,{active:r===t,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset(t*s),children:t+1},t)),!a.includes(e.numberOfPages-2)&&(0,i.jsx)(Rc,{active:!1,cursor:"default",disabled:!1,onClick:Ql.A,children:(0,i.jsx)(el,{icon:"ellipsis"})}),!a.includes(e.numberOfPages-1)&&(0,i.jsx)(Rc,{active:!1,cursor:"pointer",disabled:!1,onClick:()=>e.setOffset((e.numberOfPages-1)*s),children:e.numberOfPages})]}),(0,i.jsx)(Rc,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset+s),children:(0,i.jsx)(el,{icon:"arrow-right"})})]}):(0,i.jsx)(yr,{css:{order:3}})),n&&(0,i.jsx)(Na,{css:{border:"1px solid $gray300",borderRadius:"$1",overflow:"hidden",order:1,width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:(0,i.jsx)(Rc,{active:!1,cursor:l?"default":"pointer",disabled:l,onClick:()=>e.setOffset(e.offset-s),children:(0,i.jsx)(el,{icon:"arrow-left"})})}),(0,i.jsx)(yr,{css:{order:2,flex:"1","@tablet":{order:3,flex:"unset"}},textAlign:n?"center":"end",width:150,children:n?[...o(t("page_1_of_2_92409"),(0,i.jsx)("b",{children:r+1}),(0,i.jsx)("b",{children:e.numberOfPages}))]:t("_1_2_sur_3_79592",r*s+1,c,e.totalCount)}),n&&(0,i.jsx)(Na,{css:{border:"1px solid $gray300",order:3,borderRadius:"$1",overflow:"hidden",width:"fit-content","& > button:first-child":{borderLeft:"none"}},children:(0,i.jsx)(Rc,{active:!1,cursor:d?"default":"pointer",disabled:d,onClick:()=>e.setOffset(e.offset+s),children:(0,i.jsx)(el,{icon:"arrow-right"})})})]})},Dc=e=>{const{setClickedRowIndex:t}=L.useContext(Cc);return(0,i.jsx)(Na,{align:"center",className:"table-row",css:{background:"white",borderBottom:"1px solid $gray200",borderLeft:"1px solid $gray200",borderRight:"1px solid $gray200",height:"64px",width:"100%",...e.css,"&:hover .dot-dot-dot":{display:"block"},"&:hover .h-controls":{display:"flex"}},role:"row",onClick:()=>{e.onClick?.()},onMouseLeave:n=>{t?.(null),e.onMouseLeave?.(n)},children:e.children})},Pc=e=>(0,i.jsx)(Dc,{css:{borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",height:"56px",...e.css},children:e.children}),Fc=({css:e,filters:t,headerCells:n,limit:s,numberOfPages:o,offset:r,rows:a,setLimit:l,setOffset:d,showLimits:c=!1,showPagination:u=!0,title:h,totalCount:m})=>{const g=(c||u)&&"number"==typeof o&&"number"==typeof r&&"function"==typeof d&&(m??0)>0;return(0,i.jsxs)(yr,{css:{...e},children:[(0,i.jsxs)(Na,{align:"center",css:{background:"white",border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$3 $6"},gap:"3",children:[h&&(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},fontSize:"textLg",fontWeight:"medium",children:h}),t]}),(0,i.jsxs)(kc,{role:"grid",children:[(0,i.jsx)(jc,{css:{borderRadius:"0 !important",borderTop:"1px solid $gray200"},children:n}),a,g&&(0,i.jsx)(Pc,{children:(0,i.jsx)($c,{limit:s,numberOfPages:o,offset:r,setLimit:l,setOffset:d,showLimits:c,totalCount:m??0})})]})]})};function Mc(){const e=Yn();return t=>(0,lc.A)(t.map(t=>({value:t,translation:e(t)})),({translation:e})=>u(e)).map(({value:e,translation:t},n)=>(0,i.jsx)("option",{value:e,children:t},n))}var Nc=n(4741);function Lc(e,t=500){return(0,L.useCallback)((0,Nc.A)(e,t),[])}function Bc(e,t=500){const[n,i]=(0,L.useState)(e),[s,o]=(0,L.useState)(e),r=Lc(e=>{o(e)},t);return[n,s,e=>{i(e),r(e)}]}const Vc=e=>(0,i.jsx)(Na,{align:"center",className:"table-header-cell",css:{...Sc(e.width,e.minWidth),color:"$gray500",overflow:"hidden",px:"$3",...e.css},height:1,role:"columnheader",tabIndex:0,onClick:()=>{e.onClick?.()},...(0,wr.A)(e,["aria-label","direction","align","justify","wrap","gap"]),children:e.children}),Uc=e=>(0,i.jsx)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",borderLeft:e.bx?"1px solid $gray200":void 0,borderRight:e.bx?"1px solid $gray200":void 0,padding:"$3",...e.css},height:72,width:1,children:(0,i.jsx)(oc,{borderRadius:"$1",height:1,width:1})});function Wc(e){return e.endsWith("@weezevent.com")||e.endsWith("@weeztix.com")||e.endsWith("@kaboodle.com")}function Gc(e){return["benjamin.vuitton@weezevent.com","florent.odier@weezevent.com","matthieu.ravey@weezevent.com"].includes(e)}const Hc=e=>(0,i.jsxs)(Bd,{isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(Yd,{children:e.triggerElem||(0,i.jsx)(Na,{align:"center",css:{cursor:"pointer"},height:20,justify:"center",width:20,children:(0,i.jsx)(el,{icon:"ellipsis-vertical"})})}),(0,i.jsx)(qd,{placement:"bottom-end",children:e.children})]}),qc=({css:e,children:t,hideIcon:n,to:s,...o})=>{const r=new URL(s.toString(),P.HEAVENT_APP_URL),a=n?void 0:["http:","https:"].includes(r.protocol)&&r.origin!==location.origin?"arrow-up-right-from-square":o.download?"arrow-down-to-bracket":void 0;return(0,i.jsx)(Na,{align:"center",as:"span",css:{cursor:"pointer",fontWeight:"$medium","&:hover":{textDecoration:"underline"},...e},gap:"2",children:(0,i.jsxs)(Ja,{to:r,...o,children:[t,a&&(0,i.jsx)(yr,{as:"span",css:{marginInlineStart:"$1"},children:(0,i.jsx)(el,{icon:a})})]})})};qc.displayName="LinkText";const Yc=({children:e,css:t,gap:n,justify:s,width:o})=>(0,i.jsx)(Ec,{width:o??100,children:(0,i.jsx)(Na,{align:"center",className:"h-controls",css:{cursor:"pointer",display:"none",...t},gap:n??"6",height:1,justify:s,width:1,onClick:Rl,children:e})});let Kc=class{translationService;constructor(e){this.translationService=e}now(){return Us.c9.utc()}invalid(){return Us.c9.invalid("Invalid")}toLocaleString(e,t){return e.toLocaleString(t,{locale:this.translationService.language.toString().toLowerCase()})}};function Zc(e){return e.infos?.billingAddress?.company||""}function Xc(e){return e.infos?.vatExonerated?e.amountCents:1.2*e.amountCents}function Jc(e){switch(e){case Xe.Refunded:return{color:"warning",leftIcon:"rotate-left"};case Xe.Paid:return{color:"success",leftIcon:"check"};case Xe.Overdue:return{color:"error",leftIcon:"alarm-clock"};case Xe.Waiting:return{color:"error",leftIcon:"xmark"};default:return rl()}}var Qc;Kc=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Kc),function(e){e.Amount="amount",e.AmountTTC="amountTTC",e.CustomerName="customerName",e.Date="date",e.Organization="organization",e.PaidAt="paidAt",e.State="state",e.TransactionId="transactionId"}(Qc||(Qc={}));const eu=e=>{const t=Yn(),n=qn(Kc),{user:s}=si(),o=new Intl.NumberFormat(s?.language.toLowerCase()||"fr",{style:"currency",currency:e.invoice.currency}),r=(a=e.invoice).isRefunded?Xe.Refunded:a.paidAt?Xe.Paid:a.insertedAte.markAsPaid?.(),children:t("marqu_e_comme_p_72620")}),!e.invoice.isRefunded&&(0,i.jsx)(Gd,{icon:"rotate-left",onClick:()=>e.markAsRefunded?.(),children:t("marqu_e_comme_r_27551")})]})})]})},tu=pr("dialog",{background:"white",border:"none",display:"flex",flexDirection:"column",variants:{mobile:{true:{height:"100%",paddingBottom:"$6",paddingTop:"$8",width:"100%"},false:{borderRadius:"12px",maxHeight:"calc(100% - 80px)",py:"$7"}},size:{sm:{},md:{},lg:{}}},compoundVariants:[{mobile:!1,size:"sm",css:{width:"$modalSm"}},{mobile:!1,size:"md",css:{width:"$modalMd"}},{mobile:!1,size:"lg",css:{width:"$modalLg"}}],defaultVariants:{mobile:!1}}),nu=pr("div",{display:"flex",flexDirection:"column",overflow:"auto",width:"100%",variants:{mobile:{true:{flex:"1",px:"$4"},false:{px:"$8"}}}}),iu=pr("div",{display:"flex",gap:"$3",variants:{mobile:{true:{boxShadow:"0px -1px 3px rgba(16, 24, 40, 0.1), 0px -1px 2px rgba(16, 24, 40, 0.06)",flexDirection:"column",padding:"$6 $4 0 $4","& .h-button-content":{textAlign:"center"}},false:{flexDirection:"row",justifyContent:"flex-end",px:"$8"}}}}),su=({buttons:e,children:t,onClose:n,role:s,size:o})=>{const r=wc();return Fd(n),tl("common-front/src/components/modals/__deprecated/modal/modal.tsx","common-front/src/components/modals/base/modal.tsx"),(0,Ht.createPortal)((0,i.jsx)(Na,{align:"center",css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"300"},"data-testid":"modal-backdrop",justify:"center",role:"presentation",onMouseDown:n,children:(0,i.jsxs)(tu,{mobile:r,open:!0,role:s,size:o,onClick:e=>Rl(e,!1),onMouseDown:e=>Rl(e,!1),children:[(0,i.jsx)(nu,{mobile:r,children:t}),e&&(0,i.jsx)(iu,{mobile:r,children:e})]})}),document.body)};var ou=n(6666);const ru=e=>{const t=Yn(),{mutate:n,isLoading:s}=function(e={}){return Xn("mutation BackofficeInvoiceMarkAsPaid($invoiceId: InvoiceId!, $transactionId: String!) {\n backofficeInvoiceMarkAsPaid(invoiceId: $invoiceId, transactionId: $transactionId)\n}\n",e)}(),{data:o}=Zn("query QontoTransactions {\n backoffice {\n qontoTransactions {\n id\n label\n amount\n }\n }\n}\n",{},[]),[r,a]=(0,L.useState)(null);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yr,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(el,{icon:"file-invoice"})}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("marqu_e_une_fac_47139")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("s_lectionner_un_46296"),values:r?[r]:[],onChange:e=>{a((0,ou.A)(e)||null)},children:(o.backoffice?.qontoTransactions??[]).map(e=>(0,i.jsxs)("option",{value:e.id,children:[e.label," (",e.amount,"€)"]},e.id))}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{disabled:!r,isLoading:s,onClick:async()=>{await n({invoiceId:e.invoiceId,transactionId:r}),e.reload()},children:t("marqu_e_comme_p_72620")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},au=e=>{const{mutate:t}=function(e={}){return Xn("mutation BackofficeInvoiceMarkAsRefunded($invoiceId: InvoiceId!) {\n backofficeInvoiceMarkAsRefunded(invoiceId: $invoiceId)\n}\n",e)}(),[n,s]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eu,{invoice:e.invoice,isBackoffice:!0,markAsPaid:()=>s(!0),markAsRefunded:async()=>{await t({invoiceId:e.invoice.id}),e.reload()},showColumn:e.showColumn}),n&&(0,i.jsx)(ru,{invoiceId:e.invoice.id,reload:e.reload,onClose:()=>{s(!1)}})]})},lu=()=>{const{history:e,translate:t}=_l(),n=ti(),s=Mc(),{user:o}=si(),[r,a,l]=Bc(""),[d,c]=(0,L.useState)([]),[u,h]=(0,L.useState)(0),{data:g,isLoading:p,reload:f}=Zn("query BackofficeInvoices($name: String, $states: [InvoiceState!], $offset: Int) {\n backoffice {\n invoices(name: $name, states: $states, limit: 25, offset: $offset) {\n nodes {\n id\n invoiceNumber\n amountCents\n smsAmountCents\n currency\n paidAt\n url\n organizationsNames\n dealId\n isRefunded\n insertedAt\n infos\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{name:m(a)?a:void 0,states:no(d)?d:void 0,offset:u},[]);const[x,_]=(0,L.useState)(()=>{const e=n.getItem(Bl.BACKOFFICE_INVOICES_COLUMNS);return e?JSON.parse(e):[]}),I=(0,L.useCallback)(e=>{_(e),n.setItem(Bl.BACKOFFICE_INVOICES_COLUMNS,JSON.stringify(e))},[_]),v=(0,L.useCallback)(async e=>{try{const t=new URLSearchParams;e?t.set("date",e):no(d)&&t.set("states",d.join(","));const n=await fetch(`${P.HEAVENT_API_URL}/invoice/all?${t}`,{method:"post",headers:{[N]:await K()||""}}),{link:i}=await n.json();window.open(i,"_blank")}catch{window.alert(t("impossible_d_ex_55872"))}},[d]),b=e=>x.includes(e);return(0,i.jsx)(yr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("factures_03552")}),(0,i.jsx)(yr,{children:(0,i.jsxs)(bc,{isSelectAllVisible:!0,multiple:!0,placeholder:"Colonnes visibles",values:x,onChange:I,children:[(0,i.jsx)("option",{value:"organization",children:t("organisation_71863")}),(0,i.jsx)("option",{value:"customerName",children:t("nom_du_client_28343")}),(0,i.jsx)("option",{value:"date",children:t("Date")}),(0,i.jsx)("option",{value:"paidAt",children:t("pay_e_le_92377")}),(0,i.jsx)("option",{value:"amount",children:t("montant_55595")}),(0,i.jsx)("option",{value:"amountTTC",children:t("montant_ttc_86677")}),(0,i.jsx)("option",{value:"state",children:t("status_06428")}),(0,i.jsx)("option",{value:"transactionId",children:t("id_de_la_transa_98869")})]})}),(0,i.jsx)(El,{onClick:()=>{e.push($s.HOME)},children:"Home"}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"eye",onClick:()=>{e.push($s.BACKOFFICE_ORGANIZATIONS)},children:t("voir_les_organi_78756")}),(0,i.jsx)(Gd,{icon:"file-export",onClick:()=>v(null),children:"Exporter les factures sélectionnées"}),(0,i.jsx)(Gd,{icon:"file-export",onClick:()=>v("this-month"),children:t("exporter_les_fa_11017")}),(0,i.jsx)(Gd,{icon:"file-export",onClick:()=>v("last-month"),children:t("exporter_les_fa_01571")}),(0,i.jsx)(Gd,{icon:"file-export",onClick:()=>v("all"),children:t("exporter_toutes_46318")})]})]})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Fc,{filters:(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("id_ou_nom_25064"),value:r,onChange:e=>{l(e),h(0)}})}),(0,i.jsx)(yr,{width:200,children:(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,values:d,onChange:c,children:s(xn)})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:t("num_ro_de_factu_68150")}),b(Qc.Organization)&&(0,i.jsx)(Vc,{children:t("organisation_71863")}),b(Qc.CustomerName)&&(0,i.jsx)(Vc,{children:t("nom_du_client_28343")}),b(Qc.Date)&&(0,i.jsx)(Vc,{children:t("Date")}),b(Qc.PaidAt)&&(0,i.jsx)(Vc,{children:t("pay_e_le_92377")}),b(Qc.Amount)&&(0,i.jsx)(Vc,{children:t("montant_55595")}),b(Qc.AmountTTC)&&(0,i.jsx)(Vc,{children:t("montant_ttc_86677")}),b(Qc.State)&&(0,i.jsx)(Vc,{children:t("status_06428")}),b(Qc.TransactionId)&&(0,i.jsx)(Vc,{children:t("id_de_la_transa_98869")}),Gc(o?.email||"")&&(0,i.jsx)(Vc,{width:100})]}),numberOfPages:g.backoffice?.invoices.numberOfPages??0,offset:u,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:g.backoffice.invoices.nodes.map(e=>(0,i.jsx)(au,{invoice:e,reload:f,showColumn:b},e.id))}),setOffset:h,title:t("liste_des_factu_86735"),totalCount:g.backoffice?.invoices.totalCount??0})]})})};let du=class{countries;countriesCodes;phoneCodes;constructor(e){const t=e.translate.bind(e);this.countries=(0,lc.A)([{phoneCode:"+93",code:"AF",name:t("afghanistan_59344"),nationality:t("afghan_10143"),emoji:"🇦🇫",language:["ps","ps-AR"],smsPrice:.27},{phoneCode:"+35818",code:"AX",name:t("_land_islands_92853"),nationality:t("_land_island_62794"),emoji:"🇦🇽"},{phoneCode:"+355",code:"AL",name:t("albania_07621"),nationality:t("albanian_82021"),emoji:"🇦🇱",language:["sq","sq-AL"],smsPrice:.12},{phoneCode:"+213",code:"DZ",name:t("algeria_37723"),nationality:t("algerian_97855"),emoji:"🇩🇿",language:"ar-DZ",smsPrice:.285},{phoneCode:"+1684",code:"AS",name:t("american_samoa_95023"),nationality:t("american_samoan_76272"),emoji:"🇦🇸"},{phoneCode:"+376",code:"AD",name:t("andorra_45150"),nationality:t("andorran_97838"),emoji:"🇦🇩",smsPrice:.52},{phoneCode:"+244",code:"AO",name:t("angola_15815"),nationality:t("angolan_91942"),emoji:"🇦🇴",smsPrice:.17},{phoneCode:"+1264",code:"AI",name:t("anguilla_53408"),nationality:t("anguillan_92612"),emoji:"🇦🇮"},{phoneCode:"+1268",code:"AG",name:t("antigua_and_bar_05164"),nationality:t("antiguan_or_bar_26833"),emoji:"🇦🇬"},{phoneCode:"+54",code:"AR",name:t("argentina_92219"),nationality:t("argentine_14780"),emoji:"🇦🇷",language:"es-AR",smsPrice:.11},{phoneCode:"+374",code:"AM",name:t("armenia_90330"),nationality:t("armenian_87788"),language:["hy","hy-AM"],emoji:"🇦🇲"},{phoneCode:"+297",code:"AW",name:t("aruba_62942"),nationality:t("aruban_18515"),emoji:"🇦🇼",smsPrice:.33},{phoneCode:"+61",code:"AU",name:t("australia_84647"),nationality:t("australian_83553"),emoji:"🇦🇺",language:"en-AU",smsPrice:.093},{phoneCode:"+43",code:"AT",name:t("austria_67457"),nationality:t("austrian_39761"),emoji:"🇦🇹",language:"de-AT",smsPrice:.066},{phoneCode:"+994",code:"AZ",name:t("azerbaijan_14476"),nationality:t("azerbaijani_az_92428"),emoji:"🇦🇿",language:"az-AZ",smsPrice:.39},{phoneCode:"+1242",code:"BS",name:t("bahamas_33701"),nationality:t("bahamian_86817"),emoji:"🇧🇸"},{phoneCode:"+973",code:"BH",name:t("bahrain_43417"),nationality:t("bahraini_76209"),emoji:"🇧🇭",language:"ar-BH",smsPrice:.12},{phoneCode:"+880",code:"BD",name:t("bangladesh_48531"),nationality:t("bangladeshi_66399"),emoji:"🇧🇩",smsPrice:.425},{phoneCode:"+1246",code:"BB",name:t("barbados_57235"),nationality:t("barbadian_02319"),emoji:"🇧🇧"},{phoneCode:"+375",code:"BY",name:t("belarus_97102"),nationality:t("belarusian_60742"),emoji:"🇧🇾",language:["be","be-BY"],smsPrice:.31},{phoneCode:"+32",code:"BE",name:t("belgium_21048"),nationality:t("belgian_00407"),emoji:"🇧🇪",language:["fr-BE","nl-BE"],smsPrice:.094},{phoneCode:"+501",code:"BZ",name:t("belize_94460"),nationality:t("belizean_90827"),emoji:"🇧🇿",language:"en-BZ",smsPrice:0},{phoneCode:"+229",code:"BJ",name:t("benin_88614"),nationality:t("beninese_benin_55987"),emoji:"🇧🇯",smsPrice:.04},{phoneCode:"+1441",code:"BM",name:t("bermuda_84448"),nationality:t("bermudian_berm_58878"),emoji:"🇧🇲"},{phoneCode:"+975",code:"BT",name:t("bhutan_12608"),nationality:t("bhutanese_34101"),emoji:"🇧🇹",smsPrice:.39},{phoneCode:"+591",code:"BO",name:t("bolivia_plurin_43912"),nationality:t("bolivian_98429"),emoji:"🇧🇴",language:["es-BO","qu-BO"],smsPrice:.38},{phoneCode:"+5997",code:"BQ",name:t("bonaire_sint_e_69605"),nationality:t("bonaire_07340"),emoji:"🇧🇶"},{phoneCode:"+387",code:"BA",name:t("bosnia_and_herz_91990"),nationality:t("bosnian_or_herz_88694"),emoji:"🇧🇦",language:["bs-BA","hr-BA","sr-BA"],smsPrice:.46},{phoneCode:"+267",code:"BW",name:t("botswana_49258"),nationality:t("motswana_botsw_32461"),emoji:"🇧🇼",smsPrice:.13},{phoneCode:"+55",code:"BR",name:t("brazil_03275"),nationality:t("brazilian_74116"),emoji:"🇧🇷",language:"pt-BR",smsPrice:.051},{phoneCode:"+246",code:"IO",name:t("british_indian_92949"),nationality:t("british_43680"),emoji:"🇮🇴"},{phoneCode:"+673",code:"BN",name:t("brunei_darussal_84695"),nationality:t("bruneian_06218"),emoji:"🇧🇳",language:"ms-BN",smsPrice:.05},{phoneCode:"+359",code:"BG",name:t("bulgaria_97045"),nationality:t("bulgarian_79288"),emoji:"🇧🇬",language:["bg","bg-BG"],smsPrice:.16},{phoneCode:"+226",code:"BF",name:t("burkina_faso_55299"),nationality:t("burkinab_02690"),emoji:"🇧🇫",smsPrice:.032},{phoneCode:"+257",code:"BI",name:t("burundi_85561"),nationality:t("burundian_35605"),emoji:"🇧🇮",smsPrice:.05},{phoneCode:"+238",code:"CV",name:t("cabo_verde_28261"),nationality:t("cabo_verdean_88842"),emoji:"🇨🇻",smsPrice:.2},{phoneCode:"+855",code:"KH",name:t("cambodia_77971"),nationality:t("cambodian_19577"),emoji:"🇰🇭",smsPrice:.52},{phoneCode:"+237",code:"CM",name:t("cameroon_44200"),nationality:t("cameroonian_12953"),emoji:"🇨🇲",smsPrice:.024},{phoneCode:"+1",code:"CA",name:t("canada_52584"),nationality:t("canadian_90836"),emoji:"🇨🇦",language:["en-CA","fr-CA"],smsPrice:.03},{phoneCode:"+1345",code:"KY",name:t("cayman_islands_80923"),nationality:t("caymanian_07521"),emoji:"🇰🇾"},{phoneCode:"+236",code:"CF",name:t("central_african_74182"),nationality:t("central_african_89873"),emoji:"🇨🇫",smsPrice:.053},{phoneCode:"+235",code:"TD",name:t("chad_58721"),nationality:t("chadian_55061"),emoji:"🇹🇩",smsPrice:.035},{phoneCode:"+56",code:"CL",name:t("chile_06923"),nationality:t("chilean_69498"),emoji:"🇨🇱",language:"es-CL",smsPrice:.13},{phoneCode:"+86",code:"CN",name:t("china_40708"),nationality:t("chinese_12117"),emoji:"🇨🇳",language:["zh","zh-CN"],smsPrice:.055},{phoneCode:"+6189164",code:"CX",name:t("christmas_islan_46649"),nationality:t("christmas_islan_46649"),emoji:"🇨🇽"},{phoneCode:"+6189162",code:"CC",name:t("cocos_keeling_98180"),nationality:t("cocos_island_82627"),emoji:"🇨🇨"},{phoneCode:"+57",code:"CO",name:t("colombia_37632"),nationality:t("colombian_28222"),emoji:"🇨🇴",language:"es-CO",smsPrice:.033},{phoneCode:"+269",code:"KM",name:t("comoros_35439"),nationality:t("comoran_comori_49754"),emoji:"🇰🇲",smsPrice:.42},{phoneCode:"+242",code:"CG",name:t("congo_republic_97304"),nationality:t("congolese_04965"),emoji:"🇨🇬",smsPrice:.045},{phoneCode:"+243",code:"CD",name:t("congo_democrat_80102"),nationality:t("congolese_04965"),emoji:"🇨🇩",smsPrice:.2},{phoneCode:"+682",code:"CK",name:t("cook_islands_51542"),nationality:t("cook_island_99158"),emoji:"🇨🇰",smsPrice:.12},{phoneCode:"+506",code:"CR",name:t("costa_rica_57058"),nationality:t("costa_rican_17127"),emoji:"🇨🇷",language:"es-CR",smsPrice:.061},{phoneCode:"+225",code:"CI",name:t("c_te_d_ivoire_55380"),nationality:t("ivorian_01729"),emoji:"🇨🇮",smsPrice:.055},{phoneCode:"+385",code:"HR",name:t("croatia_52101"),nationality:t("croatian_62900"),emoji:"🇭🇷",language:["hr","hr-HR"],smsPrice:.13},{phoneCode:"+53",code:"CU",name:t("cuba_11922"),nationality:t("cuban_00956"),emoji:"🇨🇺",smsPrice:.08},{phoneCode:"+5999",code:"CW",name:t("cura_ao_46587"),nationality:t("cura_aoan_65055"),emoji:"🇨🇼"},{phoneCode:"+357",code:"CY",name:t("cyprus_86967"),nationality:t("cypriot_85282"),emoji:"🇨🇾",smsPrice:.083},{phoneCode:"+420",code:"CZ",name:t("czech_republic_57570"),nationality:t("czech_42120"),emoji:"🇨🇿",language:["cs","cs-CZ"],smsPrice:.08},{phoneCode:"+45",code:"DK",name:t("denmark_28356"),nationality:t("danish_44544"),emoji:"🇩🇰",language:["da","da-DK"],smsPrice:.06},{phoneCode:"+253",code:"DJ",name:t("djibouti_38156"),nationality:t("djiboutian_72034"),emoji:"🇩🇯",smsPrice:.12},{phoneCode:"+1767",code:"DM",name:t("dominica_13395"),nationality:t("dominican_54004"),emoji:"🇩🇲"},{phoneCode:["+1809","+1829","+1849"],code:"DO",name:t("dominican_repub_08891"),nationality:t("dominican_54004"),emoji:"🇩🇴",language:"es-DO"},{phoneCode:"+593",code:"EC",name:t("ecuador_25933"),nationality:t("ecuadorian_50591"),emoji:"🇪🇨",language:["es-EC","qu-EC"],smsPrice:.48},{phoneCode:"+20",code:"EG",name:t("egypt_61058"),nationality:t("egyptian_75798"),emoji:"🇪🇬",language:"ar-EG",smsPrice:.45},{phoneCode:"+503",code:"SV",name:t("el_salvador_37036"),nationality:t("salvadoran_02475"),emoji:"🇸🇻",language:"es-SV",smsPrice:.34},{phoneCode:"+240",code:"GQ",name:t("equatorial_guin_39570"),nationality:t("equatorial_guin_44537"),emoji:"🇬🇶",smsPrice:.21},{phoneCode:"+291",code:"ER",name:t("eritrea_67366"),nationality:t("eritrean_20355"),emoji:"🇪🇷",smsPrice:.045},{phoneCode:"+372",code:"EE",name:t("estonia_58256"),nationality:t("estonian_46354"),emoji:"🇪🇪",language:["et","et-EE"],smsPrice:.08},{phoneCode:"+251",code:"ET",name:t("ethiopia_72971"),nationality:t("ethiopian_03019"),emoji:"🇪🇹",smsPrice:.08},{phoneCode:"+500",code:"FK",name:t("falkland_island_59316"),nationality:t("falkland_island_15848"),emoji:"🇫🇰"},{phoneCode:"+298",code:"FO",name:t("faroe_islands_71549"),nationality:t("faroese_32806"),emoji:"🇫🇴",language:["fo","fo-FO"],smsPrice:.046},{phoneCode:"+679",code:"FJ",name:t("fiji_36369"),nationality:t("fijian_39649"),emoji:"🇫🇯",smsPrice:.21},{phoneCode:"+358",code:"FI",name:t("finland_07531"),nationality:t("finnish_24918"),emoji:"🇫🇮",language:["fi","fi-FI","se-FI","sv-FI"],smsPrice:.083},{phoneCode:"+33",code:"FR",name:t("france_26614"),nationality:t("french_86034"),emoji:"🇫🇷",language:["fr","fr-FR"],smsPrice:.045},{phoneCode:"+594",code:"GF",name:t("french_guiana_80598"),nationality:t("french_guianese_02041"),emoji:"🇬🇫",smsPrice:.17},{phoneCode:"+689",code:"PF",name:t("french_polynesi_50842"),nationality:t("french_polynesi_47751"),emoji:"🇵🇫",smsPrice:.18},{phoneCode:"+241",code:"GA",name:t("gabon_58286"),nationality:t("gabonese_62984"),emoji:"🇬🇦",smsPrice:.045},{phoneCode:"+220",code:"GM",name:t("gambia_93575"),nationality:t("gambian_30767"),emoji:"🇬🇲",smsPrice:.19},{phoneCode:"+995",code:"GE",name:t("georgia_93003"),nationality:t("georgian_79366"),emoji:"🇬🇪",language:["ka","ka-GE"]},{phoneCode:"+49",code:"DE",name:t("germany_31193"),nationality:t("german_36386"),emoji:"🇩🇪",language:["de","de-DE"],smsPrice:.089},{phoneCode:"+233",code:"GH",name:t("ghana_32464"),nationality:t("ghanaian_99745"),emoji:"🇬🇭",smsPrice:.033},{phoneCode:"+350",code:"GI",name:t("gibraltar_24360"),nationality:t("gibraltar_24360"),emoji:"🇬🇮",smsPrice:.076},{phoneCode:"+30",code:"GR",name:t("greece_28837"),nationality:t("greek_hellenic_39006"),emoji:"🇬🇷",language:["el","el-GR"],smsPrice:.061},{phoneCode:"+299",code:"GL",name:t("greenland_80916"),nationality:t("greenlandic_67508"),emoji:"🇬🇱",smsPrice:.036},{phoneCode:"+1473",code:"GD",name:t("grenada_04221"),nationality:t("grenadian_25686"),emoji:"🇬🇩"},{phoneCode:"+590",code:"GP",name:t("guadeloupe_95839"),nationality:t("guadeloupe_95839"),emoji:"🇬🇵"},{phoneCode:"+1671",code:"GU",name:t("guam_76384"),nationality:t("guamanian_guam_01132"),emoji:"🇬🇺"},{phoneCode:"+502",code:"GT",name:t("guatemala_49597"),nationality:t("guatemalan_60946"),emoji:"🇬🇹",language:"es-GT",smsPrice:.3},{phoneCode:["+441481","+447781","+447839","+447911"],code:"GG",name:t("guernsey_87507"),nationality:t("channel_island_53762"),emoji:"🇬🇬"},{phoneCode:"+224",code:"GN",name:t("guinea_20770"),nationality:t("guinean_42564"),emoji:"🇬🇳",smsPrice:.056},{phoneCode:"+245",code:"GW",name:t("guinea_bissau_80728"),nationality:t("bissau_guinean_66742"),emoji:"🇬🇼",smsPrice:.09},{phoneCode:"+592",code:"GY",name:t("guyana_92443"),nationality:t("guyanese_56902"),emoji:"🇬🇾",smsPrice:.3},{phoneCode:"+509",code:"HT",name:t("haiti_99471"),nationality:t("haitian_50142"),emoji:"🇭🇹",smsPrice:.3},{phoneCode:"+379",code:"VA",name:t("vatican_city_st_63732"),nationality:t("vatican_36370"),emoji:"🇻🇦"},{phoneCode:"+504",code:"HN",name:t("honduras_79402"),nationality:t("honduran_35392"),emoji:"🇭🇳",language:"es-HN",smsPrice:.267},{phoneCode:"+852",code:"HK",name:t("hong_kong_96239"),nationality:t("hong_kong_hong_64846"),emoji:"🇭🇰",language:"zh-HK",smsPrice:.079},{phoneCode:"+36",code:"HU",name:t("hungary_57981"),nationality:t("hungarian_magy_62212"),emoji:"🇭🇺",language:["hu","hu-HU"],smsPrice:.106},{phoneCode:"+354",code:"IS",name:t("iceland_79438"),nationality:t("icelandic_17689"),emoji:"🇮🇸",language:["is","is-IS"],smsPrice:.085},{phoneCode:"+91",code:"IN",name:t("india_39466"),nationality:t("indian_25592"),emoji:"🇮🇳",language:["gu","gu-IN","hi","hi-IN","kn","kn-IN","kok","kok-IN","mr","mr-IN","pa","pa-IN","sa","sa-IN","ta","ta-IN","te","te-IN"],smsPrice:.078},{phoneCode:"+62",code:"ID",name:t("indonesia_65003"),nationality:t("indonesian_29723"),emoji:"🇮🇩",language:["id","id-ID"],smsPrice:.464},{phoneCode:"+98",code:"IR",name:t("iran_76293"),nationality:t("iranian_persia_76791"),emoji:"🇮🇷",language:["fa","fa-IR"],smsPrice:.38},{phoneCode:"+964",code:"IQ",name:t("iraq_82027"),nationality:t("iraqi_31025"),emoji:"🇮🇶",language:"ar-IQ",smsPrice:.33},{phoneCode:"+353",code:"IE",name:t("ireland_62034"),nationality:t("irish_35774"),emoji:"🇮🇪",language:"en-IE",smsPrice:.065},{phoneCode:["+441624","+447524","+447624","+447924"],code:"IM",name:t("isle_of_man_64982"),nationality:t("manx_86314"),emoji:"🇮🇲"},{phoneCode:"+972",code:"IL",name:t("israel_20033"),nationality:t("israeli_69936"),emoji:"🇮🇱",language:["he","he-IL"],smsPrice:.3},{phoneCode:"+39",code:"IT",name:t("italy_14828"),nationality:t("italian_56623"),emoji:"🇮🇹",language:["it","it-IT"],smsPrice:.038},{phoneCode:"+1876",code:"JM",name:t("jamaica_55090"),nationality:t("jamaican_58881"),emoji:"🇯🇲",language:"en-JM"},{phoneCode:"+81",code:"JP",name:t("japan_61810"),nationality:t("japanese_82636"),emoji:"🇯🇵",language:["ja","ja-JP"],smsPrice:.08},{phoneCode:"+441534",code:"JE",name:t("jersey_78898"),nationality:t("channel_island_53762"),emoji:"🇯🇪"},{phoneCode:"+962",code:"JO",name:t("jordan_36280"),nationality:t("jordanian_41310"),emoji:"🇯🇴",language:"ar-JO",smsPrice:.39},{phoneCode:["+76","+77"],code:"KZ",name:t("kazakhstan_30541"),nationality:t("kazakhstani_ka_27277"),emoji:"🇰🇿",language:["kk","kk-KZ"]},{phoneCode:"+254",code:"KE",name:t("kenya_67944"),nationality:t("kenyan_92311"),emoji:"🇰🇪",language:["sw","sw-KE"],smsPrice:.3},{phoneCode:"+686",code:"KI",name:t("kiribati_25369"),nationality:t("i_kiribati_66745"),emoji:"🇰🇮",smsPrice:.036},{phoneCode:"+850",code:"KP",name:t("korea_democrat_48584"),nationality:t("north_korean_16553"),emoji:"🇰🇵",smsPrice:.045},{phoneCode:"+82",code:"KR",name:t("korea_republic_72269"),nationality:t("south_korean_89943"),emoji:"🇰🇷",language:["ko","ko-KR"],smsPrice:.029},{phoneCode:"+965",code:"KW",name:t("kuwait_22026"),nationality:t("kuwaiti_76148"),emoji:"🇰🇼",language:"ar-KW",smsPrice:.327},{phoneCode:"+996",code:"KG",name:t("kyrgyzstan_84406"),nationality:t("kyrgyzstani_ky_19120"),emoji:"🇰🇬",language:["ky","ky-KG"],smsPrice:.34},{phoneCode:"+856",code:"LA",name:t("lao_people_s_de_31069"),nationality:t("lao_laotian_28318"),emoji:"🇱🇦",smsPrice:.273},{phoneCode:"+371",code:"LV",name:t("latvia_73526"),nationality:t("latvian_53651"),emoji:"🇱🇻",language:["lv","lv-LV"],smsPrice:.057},{phoneCode:"+961",code:"LB",name:t("lebanon_49493"),nationality:t("lebanese_43182"),emoji:"🇱🇧",language:"ar-LB",smsPrice:.32},{phoneCode:"+266",code:"LS",name:t("lesotho_91086"),nationality:t("basotho_52532"),emoji:"🇱🇸",smsPrice:.35},{phoneCode:"+231",code:"LR",name:t("liberia_12077"),nationality:t("liberian_64388"),emoji:"🇱🇷",smsPrice:.3},{phoneCode:"+218",code:"LY",name:t("libya_26741"),nationality:t("libyan_35337"),emoji:"🇱🇾",language:"ar-LY",smsPrice:.38},{phoneCode:"+424",code:"LI",name:t("liechtenstein_56974"),nationality:t("liechtenstein_56974"),emoji:"🇱🇮",language:"de-LI"},{phoneCode:"+370",code:"LT",name:t("lithuania_95793"),nationality:t("lithuanian_94145"),emoji:"🇱🇹",language:["lt","lt-LT"],smsPrice:.06},{phoneCode:"+352",code:"LU",name:t("luxembourg_15613"),nationality:t("luxembourg_lux_47318"),emoji:"🇱🇺",language:["de-LU","fr-LU"],smsPrice:.1},{phoneCode:"+853",code:"MO",name:t("macao_74812"),nationality:t("macanese_chine_74224"),emoji:"🇲🇴",language:"zh-MO",smsPrice:.038},{phoneCode:"+389",code:"MK",name:t("macedonia_the_19021"),nationality:t("macedonian_20446"),emoji:"🇲🇰",language:["mk","mk-MK"],smsPrice:.095},{phoneCode:"+261",code:"MG",name:t("madagascar_57052"),nationality:t("malagasy_02353"),emoji:"🇲🇬",smsPrice:.029},{phoneCode:"+265",code:"MW",name:t("malawi_27143"),nationality:t("malawian_10093"),emoji:"🇲🇼",smsPrice:.3},{phoneCode:"+60",code:"MY",name:t("malaysia_54920"),nationality:t("malaysian_81474"),emoji:"🇲🇾",language:["ms","ms-MY"],smsPrice:.29},{phoneCode:"+960",code:"MV",name:t("maldives_67432"),nationality:t("maldivian_67878"),emoji:"🇲🇻",language:["dv","dv-MV"],smsPrice:.34},{phoneCode:"+223",code:"ML",name:t("mali_95091"),nationality:t("malian_malines_66005"),emoji:"🇲🇱",smsPrice:.055},{phoneCode:"+356",code:"MT",name:t("malta_73993"),nationality:t("maltese_52729"),emoji:"🇲🇹",language:["mt","mt-MT"],smsPrice:.08},{phoneCode:"+692",code:"MH",name:t("marshall_island_92726"),nationality:t("marshallese_30337"),emoji:"🇲🇭",smsPrice:.045},{phoneCode:"+586",code:"MQ",name:t("martinique_79541"),nationality:t("martiniquais_m_01923"),emoji:"🇲🇶"},{phoneCode:"+222",code:"MR",name:t("mauritania_77906"),nationality:t("mauritanian_68205"),emoji:"🇲🇷",smsPrice:.055},{phoneCode:"+230",code:"MU",name:t("mauritius_10801"),nationality:t("mauritian_09142"),emoji:"🇲🇺",smsPrice:.184},{phoneCode:["+262269","+262639"],code:"YT",name:t("mayotte_91167"),nationality:t("mahoran_45424"),emoji:"🇾🇹"},{phoneCode:"+52",code:"MX",name:t("mexico_21962"),nationality:t("mexican_80494"),emoji:"🇲🇽",language:"es-MX",smsPrice:.92},{phoneCode:"+691",code:"FM",name:t("micronesia_fed_39555"),nationality:t("micronesian_97912"),emoji:"🇫🇲",smsPrice:.045},{phoneCode:"+373",code:"MD",name:t("moldova_republ_08796"),nationality:t("moldovan_76486"),emoji:"🇲🇩"},{phoneCode:"+377",code:"MC",name:t("monaco_72117"),nationality:t("mon_gasque_mon_17281"),emoji:"🇲🇨",language:"fr-MC",smsPrice:.1},{phoneCode:"+976",code:"MN",name:t("mongolia_36757"),nationality:t("mongolian_33711"),emoji:"🇲🇳",language:["mn","mn-MN"],smsPrice:.33},{phoneCode:"+382",code:"ME",name:t("montenegro_78236"),nationality:t("montenegrin_68334"),emoji:"🇲🇪",smsPrice:.15},{phoneCode:"+1664",code:"MS",name:t("montserrat_38432"),nationality:t("montserratian_13585"),emoji:"🇲🇸"},{phoneCode:"+212",code:"MA",name:t("morocco_52420"),nationality:t("moroccan_14305"),emoji:"🇲🇦",language:"ar-MA"},{phoneCode:"+258",code:"MZ",name:t("mozambique_60988"),nationality:t("mozambican_68300"),emoji:"🇲🇿",smsPrice:.32},{phoneCode:"+95",code:"MM",name:t("myanmar_78678"),nationality:t("burmese_66869"),emoji:"🇲🇲",smsPrice:1.1},{phoneCode:"+264",code:"NA",name:t("namibia_19026"),nationality:t("namibian_01490"),emoji:"🇳🇦",smsPrice:.048},{phoneCode:"+674",code:"NR",name:t("nauru_16303"),nationality:t("nauruan_52578"),emoji:"🇳🇷",smsPrice:.21},{phoneCode:"+977",code:"NP",name:t("nepal_49088"),nationality:t("nepali_nepales_64761"),emoji:"🇳🇵",smsPrice:.35},{phoneCode:"+31",code:"NL",name:t("netherlands_38005"),nationality:t("dutch_netherla_42451"),emoji:"🇳🇱",language:["nl","nl-NL"],smsPrice:.095},{phoneCode:"+687",code:"NC",name:t("new_caledonia_14574"),nationality:t("new_caledonian_12113"),emoji:"🇳🇨",smsPrice:.1},{phoneCode:"+64",code:"NZ",name:t("new_zealand_61929"),nationality:t("new_zealander_71823"),emoji:"🇳🇿",language:["en-NZ","mi","mi-NZ"],smsPrice:.14},{phoneCode:"+505",code:"NI",name:t("nicaragua_14531"),nationality:t("nicaraguan_06649"),emoji:"🇳🇮",language:"es-NI",smsPrice:.17},{phoneCode:"+227",code:"NE",name:t("niger_59137"),nationality:t("nigerien_06144"),emoji:"🇳🇪",smsPrice:.067},{phoneCode:"+234",code:"NG",name:t("nigeria_77810"),nationality:t("nigerian_43407"),emoji:"🇳🇬",smsPrice:.47},{phoneCode:"+683",code:"NU",name:t("niue_97570"),nationality:t("niuean_70518"),emoji:"🇳🇺",smsPrice:.045},{phoneCode:"+6723",code:"NF",name:t("norfolk_island_62377"),nationality:t("norfolk_island_62377"),emoji:"🇳🇫"},{phoneCode:"+1670",code:"MP",name:t("northern_marian_94262"),nationality:t("northern_marian_82360"),emoji:"🇲🇵"},{phoneCode:"+47",code:"NO",name:t("norway_14236"),nationality:t("norwegian_50751"),emoji:"🇳🇴",language:["nb","nb-NO","nn-NO","se-NO"],smsPrice:.064},{phoneCode:"+968",code:"OM",name:t("oman_20900"),nationality:t("omani_15042"),emoji:"🇴🇲",language:"ar-OM",smsPrice:.21},{phoneCode:"+92",code:"PK",name:t("pakistan_59697"),nationality:t("pakistani_12622"),emoji:"🇵🇰",language:["ur","ur-PK"],smsPrice:.5},{phoneCode:"+680",code:"PW",name:t("palau_46088"),nationality:t("palauan_73033"),emoji:"🇵🇼",smsPrice:.1},{phoneCode:"+970",code:"PS",name:t("palestine_stat_33253"),nationality:t("palestinian_06829"),emoji:"🇵🇸",smsPrice:.35},{phoneCode:"+507",code:"PA",name:t("panama_16821"),nationality:t("panamanian_07882"),emoji:"🇵🇦",language:"es-PA",smsPrice:.17},{phoneCode:"+675",code:"PG",name:t("papua_new_guine_56959"),nationality:t("papua_new_guine_50302"),emoji:"🇵🇬",smsPrice:.2},{phoneCode:"+595",code:"PY",name:t("paraguay_66859"),nationality:t("paraguayan_50310"),emoji:"🇵🇾",language:"es-PY",smsPrice:.124},{phoneCode:"+51",code:"PE",name:t("peru_23048"),nationality:t("peruvian_85045"),emoji:"🇵🇪",language:["es-PE","qu-PE"],smsPrice:.31},{phoneCode:"+63",code:"PH",name:t("philippines_65361"),nationality:t("philippine_fil_40400"),emoji:"🇵🇭",language:["en-PH","tl","tl-PH"],smsPrice:.243},{phoneCode:"+64",code:"PN",name:t("pitcairn_59104"),nationality:t("pitcairn_island_58961"),emoji:"🇵🇳"},{phoneCode:"+48",code:"PL",name:t("poland_13527"),nationality:t("polish_26779"),emoji:"🇵🇱",language:["pl","pl-PL"],smsPrice:.036},{phoneCode:"+351",code:"PT",name:t("portugal_19698"),nationality:t("portuguese_08463"),emoji:"🇵🇹",language:["pt","pt-PT"],smsPrice:.025},{phoneCode:["+1787","+1939"],code:"PR",name:t("puerto_rico_88176"),nationality:t("puerto_rican_10401"),emoji:"🇵🇷",language:"es-PR"},{phoneCode:"+974",code:"QA",name:t("qatar_70548"),nationality:t("qatari_58016"),emoji:"🇶🇦",language:"ar-QA",smsPrice:.3},{phoneCode:"+262",code:"RE",name:t("r_union_34094"),nationality:t("r_unionese_r_u_86871"),emoji:"🇷🇪",smsPrice:.055},{phoneCode:"+40",code:"RO",name:t("romania_41618"),nationality:t("romanian_49647"),emoji:"🇷🇴",language:["ro","ro-RO"],smsPrice:.09},{phoneCode:"+7",code:"RU",name:t("russian_federat_68392"),nationality:t("russian_12506"),emoji:"🇷🇺",language:["ru","ru-RU","tt","tt-RU"],smsPrice:2.63},{phoneCode:"+250",code:"RW",name:t("rwanda_84901"),nationality:t("rwandan_47719"),emoji:"🇷🇼",smsPrice:.1},{phoneCode:"+590",code:"BL",name:t("saint_barth_lem_80830"),nationality:t("barth_lemois_35003"),emoji:"🇧🇱",smsPrice:.09},{phoneCode:"+290",code:"SH",name:t("saint_helena_a_39384"),nationality:t("saint_helenian_19012"),emoji:"🇸🇭",smsPrice:.1},{phoneCode:"+1869",code:"KN",name:t("saint_kitts_and_74455"),nationality:t("kittitian_or_ne_99867"),emoji:"🇰🇳"},{phoneCode:"+1758",code:"LC",name:t("saint_lucia_60679"),nationality:t("saint_lucian_97267"),emoji:"🇱🇨"},{phoneCode:"+590",code:"MF",name:t("saint_martin_f_87295"),nationality:t("saint_martinois_75974"),emoji:"🇸🇽"},{phoneCode:"+508",code:"PM",name:t("saint_pierre_an_55649"),nationality:t("saint_pierrais_60177"),emoji:"🇵🇲",smsPrice:.13},{phoneCode:"+1784",code:"VC",name:t("saint_vincent_a_23833"),nationality:t("saint_vincentia_81882"),emoji:"🇻🇨"},{phoneCode:"+685",code:"WS",name:t("samoa_25648"),nationality:t("samoan_97653"),emoji:"🇼🇸",smsPrice:.21},{phoneCode:"+378",code:"SM",name:t("san_marino_47437"),nationality:t("sammarinese_71553"),emoji:"🇸🇲",smsPrice:.045},{phoneCode:"+239",code:"ST",name:t("sao_tome_and_pr_10491"),nationality:t("s_o_tom_an_21489"),emoji:"🇸🇹",smsPrice:.045},{phoneCode:"+966",code:"SA",name:t("saudi_arabia_06433"),nationality:t("saudi_saudi_ar_22967"),emoji:"🇸🇦",language:"ar-SA",smsPrice:.215},{phoneCode:"+221",code:"SN",name:t("senegal_38099"),nationality:t("senegalese_64680"),emoji:"🇸🇳",smsPrice:.034},{phoneCode:"+381",code:"RS",name:t("serbia_45061"),nationality:t("serbian_68735"),emoji:"🇷🇸",smsPrice:.46},{phoneCode:"+248",code:"SC",name:t("seychelles_67712"),nationality:t("seychellois_69858"),emoji:"🇸🇨",smsPrice:.3},{phoneCode:"+232",code:"SL",name:t("sierra_leone_02995"),nationality:t("sierra_leonean_86179"),emoji:"🇸🇱",smsPrice:.4},{phoneCode:"+65",code:"SG",name:t("singapore_37928"),nationality:t("singaporean_41916"),emoji:"🇸🇬",language:"zh-SG",smsPrice:.064},{phoneCode:"+1721",code:"SX",name:t("sint_maarten_d_57391"),nationality:t("sint_maarten_82241"),emoji:"🇸🇽"},{phoneCode:"+421",code:"SK",name:t("slovakia_10924"),nationality:t("slovak_69840"),emoji:"🇸🇰",language:["sk","sk-SK"],smsPrice:.068},{phoneCode:"+386",code:"SI",name:t("slovenia_75447"),nationality:t("slovenian_slov_38562"),emoji:"🇸🇮",language:["sl","sl-SI"],smsPrice:.18},{phoneCode:"+677",code:"SB",name:t("solomon_islands_05259"),nationality:t("solomon_island_59052"),emoji:"🇸🇧",smsPrice:.155},{phoneCode:"+252",code:"SO",name:t("somalia_56358"),nationality:t("somali_somalia_97997"),emoji:"🇸🇴",smsPrice:.35},{phoneCode:"+27",code:"ZA",name:t("south_africa_61184"),nationality:t("south_african_82152"),emoji:"🇿🇦",language:["af-ZA","en-ZA","ns","ns-ZA","tn","tn-ZA","xh","xh-ZA","zu","zu-ZA"],smsPrice:.13},{phoneCode:"+500",code:"GS",name:t("south_georgia_a_39555"),nationality:t("south_georgia_o_65055"),emoji:"🇬🇸",smsPrice:.12},{phoneCode:"+211",code:"SS",name:t("south_sudan_88232"),nationality:t("south_sudanese_69140"),emoji:"🇸🇸"},{phoneCode:"+34",code:"ES",name:t("spain_40048"),nationality:t("spanish_74199"),emoji:"🇪🇸",language:["ca","ca-ES","es","es-ES","eu-ES","gl-ES"],smsPrice:.044},{phoneCode:"+94",code:"LK",name:t("sri_lanka_51563"),nationality:t("sri_lankan_09436"),emoji:"🇱🇰",smsPrice:.4},{phoneCode:"+249",code:"SD",name:t("sudan_18427"),nationality:t("sudanese_42330"),emoji:"🇸🇩",smsPrice:.322},{phoneCode:"+597",code:"SR",name:t("suriname_78561"),nationality:t("surinamese_38193"),emoji:"🇸🇷",smsPrice:.3},{phoneCode:"+4779",code:"SJ",name:t("svalbard_and_ja_38511"),nationality:t("svalbard_26353"),emoji:"🇸🇯"},{phoneCode:"+268",code:"SZ",name:t("swaziland_91614"),nationality:t("swazi_88825"),emoji:"🇸🇿",smsPrice:.3},{phoneCode:"+46",code:"SE",name:t("sweden_85663"),nationality:t("swedish_90836"),emoji:"🇸🇪",language:["se-SE","sv","sv-SE"],smsPrice:.098},{phoneCode:"+41",code:"CH",name:t("switzerland_07889"),nationality:t("swiss_23240"),emoji:"🇨🇭",language:["de-CH","fr-CH","it-CH"],smsPrice:.098},{phoneCode:"+963",code:"SY",name:t("syrian_arab_rep_72539"),nationality:t("syrian_06992"),emoji:"🇸🇾",language:["ar-SY","syr","syr-SY"],smsPrice:.37},{phoneCode:"+886",code:"TW",name:t("taiwan_provinc_87264"),nationality:t("chinese_taiwan_24003"),emoji:"🇹🇼",language:"zh-TW",smsPrice:.105},{phoneCode:"+992",code:"TJ",name:t("tajikistan_97104"),nationality:t("tajikistani_21375"),emoji:"🇹🇯",smsPrice:.38},{phoneCode:"+255",code:"TZ",name:t("tanzania_unite_52757"),nationality:t("tanzanian_71935"),emoji:"🇹🇿",smsPrice:.38},{phoneCode:"+66",code:"TH",name:t("thailand_97396"),nationality:t("thai_51972"),emoji:"🇹🇭",language:["th","th-TH"],smsPrice:.066},{phoneCode:"+670",code:"TL",name:t("timor_leste_95604"),nationality:t("timorese_87542"),emoji:"🇹🇱",smsPrice:.22},{phoneCode:"+228",code:"TG",name:t("togo_60267"),nationality:t("togolese_55079"),emoji:"🇹🇬",smsPrice:.03},{phoneCode:"+690",code:"TK",name:t("tokelau_79536"),nationality:t("tokelauan_89444"),emoji:"🇹🇰",smsPrice:.045},{phoneCode:"+676",code:"TO",name:t("tonga_96982"),nationality:t("tongan_52630"),emoji:"🇹🇴",smsPrice:.2},{phoneCode:"+1868",code:"TT",name:t("trinidad_and_to_31939"),nationality:t("trinidadian_or_65515"),emoji:"🇹🇹",language:"en-TT"},{phoneCode:"+216",code:"TN",name:t("tunisia_36732"),nationality:t("tunisian_19451"),emoji:"🇹🇳",language:"ar-TN",smsPrice:.35},{phoneCode:"+90",code:"TR",name:t("turkey_65699"),nationality:t("turkish_85889"),emoji:"🇹🇷",language:["tr","tr-TR"],smsPrice:.033},{phoneCode:"+993",code:"TM",name:t("turkmenistan_86069"),nationality:t("turkmen_63945"),emoji:"🇹🇲"},{phoneCode:"+1649",code:"TC",name:t("turks_and_caico_34033"),nationality:t("turks_and_caico_41685"),emoji:"🇹🇨"},{phoneCode:"+688",code:"TV",name:t("tuvalu_52410"),nationality:t("tuvaluan_49403"),emoji:"🇹🇻",smsPrice:.12},{phoneCode:"+256",code:"UG",name:t("uganda_42928"),nationality:t("ugandan_07085"),emoji:"🇺🇬",smsPrice:.3},{phoneCode:"+380",code:"UA",name:t("ukraine_86632"),nationality:t("ukrainian_77624"),emoji:"🇺🇦",language:["uk","uk-UA"],smsPrice:.26},{phoneCode:"+971",code:"AE",name:t("united_arab_emi_58689"),nationality:t("emirati_emiria_12413"),emoji:"🇦🇪",language:"ar-AE",smsPrice:.12},{phoneCode:"+44",code:"GB",name:t("united_kingdom_16783"),nationality:t("british_43680"),emoji:"🇬🇧",language:["cy","cy-GB","en","en-GB"],smsPrice:.078},{phoneCode:"+1",code:"US",name:t("united_states_o_43878"),nationality:t("american_36800"),emoji:"🇺🇸",language:"en-US",smsPrice:.03},{phoneCode:"+598",code:"UY",name:t("uruguay_21979"),nationality:t("uruguayan_28212"),emoji:"🇺🇾",language:"es-UY",smsPrice:.1},{phoneCode:"+998",code:"UZ",name:t("uzbekistan_27729"),nationality:t("uzbekistani_uz_10593"),emoji:"🇺🇿",language:["uz","uz-UZ"],smsPrice:.39},{phoneCode:"+678",code:"VU",name:t("vanuatu_82756"),nationality:t("ni_vanuatu_van_02924"),emoji:"🇻🇺",smsPrice:.21},{phoneCode:"+58",code:"VE",name:t("venezuela_boli_00470"),nationality:t("venezuelan_52634"),emoji:"🇻🇪",language:"es-VE",smsPrice:.31},{phoneCode:"+84",code:"VN",name:t("vietnam_82968"),nationality:t("vietnamese_55360"),emoji:"🇻🇳",language:["vi","vi-VN"],smsPrice:.27},{phoneCode:"+1284",code:"VG",name:t("virgin_islands_14222"),nationality:t("british_43680"),emoji:"🇻🇬"},{phoneCode:"+1340",code:"VI",name:t("virgin_islands_12516"),nationality:t("american_36800"),emoji:"🇻🇮"},{phoneCode:"+681",code:"WF",name:t("wallis_and_futu_93206"),nationality:t("wallisian_or_fu_60327"),emoji:"🇼🇫",smsPrice:.09},{phoneCode:"+212",code:"EH",name:t("western_sahara_02173"),nationality:t("sahrawi_sahraw_96671"),emoji:"🇪🇭",smsPrice:.053},{phoneCode:"+967",code:"YE",name:t("yemen_76340"),nationality:t("yemeni_26632"),emoji:"🇾🇪",language:"ar-YE",smsPrice:.23},{phoneCode:"+260",code:"ZM",name:t("zambia_50513"),nationality:t("zambian_85114"),emoji:"🇿🇲",smsPrice:.324},{phoneCode:"+263",code:"ZW",name:t("zimbabwe_70209"),nationality:t("zimbabwean_42291"),emoji:"🇿🇼",language:"en-ZW",smsPrice:.35}],({name:e})=>c(e)),this.countriesCodes=this.countries.map(({code:e})=>e),this.phoneCodes=this.countries.flatMap(({phoneCode:e})=>to(e))}countryCodeExists(e){return!!e&&void 0!==this.countries.find(t=>t.code===e)}getCountriesIdName(e){const t=this.getDefaultCountryValues(e).user.country;return(0,lc.A)(this.countries.map(({code:e,name:t})=>({id:e,name:t})),({id:e})=>e===t?1:2)}getNationalitiesIdName(e){const t=this.getDefaultCountryValues(e).user.nationality;return(0,lc.A)(this.countries.map(({code:e,nationality:t})=>({id:e,name:t})),({id:e})=>e===t?1:2)}getNationality(e){return this.countries.find(t=>t.code===e)?.nationality}getName(e){return this.countries.find(t=>t.code===e)?.name}getDefaultCountryValues(e){let t=this.countries.find(({code:t})=>t===e);if(!t){try{t=this.countries.find(e=>to(e.language||[]).map(e=>e.toLowerCase()).includes(navigator.language.toLowerCase()))}catch{}t||(t=this.countries.find(({code:e})=>"FR"===e))}const n=to(t.language||[]);return{user:{language:n.some(e=>e.toLowerCase().startsWith("fr"))?yt.Fr:n.some(e=>e.toLowerCase().startsWith("es"))?yt.Es:n.some(e=>e.toLowerCase().startsWith("de"))?yt.De:n.some(e=>e.toLowerCase().startsWith("nl"))?yt.Nl:yt.En,country:t.code,nationality:t.code},phone:{country:t.code,code:to(t.phoneCode)[0]}}}getSmsPriceByPhone(e){return this.countries.find(t=>to(t.phoneCode).some(t=>e.startsWith(t)))?.smsPrice}};du=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],du);const cu=[Ve.Date,Ve.Number,Ve.Text,Ve.Textarea],uu=[Ve.Phone,Ve.Select,Ve.Text,Ve.Textarea];function hu(e,t,n){const i=[],s=[];for(const o of t)if(!m(n)||o.name.trim().toLowerCase().includes(n.trim().toLowerCase())||m(o.label)&&o.label.trim().toLowerCase().includes(n.trim().toLowerCase())){const t=e.find(({slug:e})=>e===o.slug);t?i.push({filter:o,predicate:t}):s.push({filter:o,predicate:t})}return[i,s]}function mu(e,t){return no(e.values)?e.values.map(({id:e,name:n})=>(0,i.jsx)("option",{value:e,children:t(n)},e)):no(e.valuesGroups)?e.valuesGroups.map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n)):[]}let gu=class extends Vl{countriesService;dateTimeService;constructor(e,t,n){super(n),this.countriesService=e,this.dateTimeService=t}filterPredicateToText(e){const{filter:t,predicate:n}=e;if(!n)return"";{const i=Us.c9.isDateTime(n.value)?n.value:Us.c9.fromISO(n.value,{zone:"utc"}),s=!i.isValid||t.fieldType!==We.DateTimeRange&&t.fieldType!==We.Datetime?i.isValid&&t.fieldType===We.Date?this.dateTimeService.toLocaleString(i,Js.DateOnly.MonthLong):n.value:this.dateTimeService.toLocaleString(i,Js.DateTime),o=Us.c9.isDateTime(n.value2)?n.value2:Us.c9.fromISO(n.value2,{zone:"utc"}),r=!o.isValid||t.fieldType!==We.DateTimeRange&&t.fieldType!==We.Datetime?o.isValid&&t.fieldType===We.Date?this.dateTimeService.toLocaleString(o,Js.DateOnly.MonthLong):n.value2:this.dateTimeService.toLocaleString(o,Js.DateTime);switch(n.operator){case ht.Contains:return"condition"===t.slug?this.conditionFilterToString(e):"wishedPositions"===t.slug?this.t("mission_souhait_38008",r,this.valueToString(t,s)):"wishedPositionsCategories"===t.slug?this.t("cat_gorie_souha_24744",r,this.valueToString(t,s)):"isDelegationLeader"===t.slug?this.t("est_responsable_13012",this.valueToString(t,s)):this.t("_1_contient_2_40552",t.name,s);case ht.NotContains:return this.t("_1_ne_contient_14612",t.name,s);case ht.Is:if("isLeader"===t.slug)return this.t("est_responsable_19679");if("isPositionLeader"===t.slug)return this.t("est_responsable_27270");if("isPositionCategoryLeader"===t.slug)return this.t("est_responsable_72923");if("isDelegationLeader"===t.slug)return this.t("est_responsable_87662");if("privacy"===t.slug)return this.t("visibilit_est_12738");if("campaign"===t.slug)return this.campaignFilterToString(e);if("campaignReply"===t.slug)return this.campaignReplyFilterToString(e);if("condition"===t.slug)return this.t("champ_dont_un_a_44854");if("numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug)return this.t("_1_pour_la_jou_73174",t.name,this.dateTimeService.toLocaleString(i,Js.DateOnly.MonthLong),r);if(t.fieldType===We.Date)return this.t("_1_est_gal_43375",t.name,this.valueDateToString(n.valueDate));if(t.fieldType===We.DateTimeRange){const e=i?.isValid?this.dateTimeService.toLocaleString(i,Js.DateOnly.MonthLong):n.value;return this.t("_1_est_gal_43375",t.name,e)}return this.t("_1_est_gal_43375",t.name,this.valueToString(t,s));case ht.IsNot:return"isLeader"===t.slug?this.t("n_est_pas_respo_55625"):"isPositionLeader"===t.slug?this.t("n_est_pas_respo_35508"):"isPositionCategoryLeader"===t.slug?this.t("n_est_pas_respo_07811"):"isDelegationLeader"===t.slug?this.t("n_est_pas_respo_91275"):"privacy"===t.slug?this.t("visibilit_est_55411"):"condition"===t.slug?this.t("champ_d_pendant_33676"):"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_61197",t.name,this.dateTimeService.toLocaleString(i,Js.DateOnly.MonthLong),r):t.fieldType===We.Date?this.t("_1_n_est_pas_38478",t.name,this.valueDateToString(n.valueDate)):this.t("_1_n_est_pas_38478",t.name,this.valueToString(t,s));case ht.IsEmpty:return this.t("_1_est_vide_08225",t.name);case ht.IsNotEmpty:return this.t("_1_n_est_pas_v_31530",t.name);case ht.IsValid:return this.t("_1_est_valide_45209",t.name);case ht.IsNotValid:return this.t("_1_n_est_pas_v_05077",t.name);case ht.GreaterThan:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_91055",t.name,this.dateTimeService.toLocaleString(i,Js.DateOnly.MonthLong),r):this.t("_1_est_plus_gr_93527",t.name,n.value);case ht.GreaterThanEqual:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_41388",t.name,this.dateTimeService.toLocaleString(i,Js.DateOnly.MonthLong),r):this.t("_1_est_gal_ou_95771",t.name,n.value);case ht.LessThan:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_99548",t.name,this.dateTimeService.toLocaleString(i,Js.DateOnly.MonthLong),r):this.t("_1_est_plus_pe_18306",t.name,n.value);case ht.LessThanEqual:return"numberOfAssignmentsPerDay"===t.slug||"volunteersMinutesDays"===t.slug?this.t("_1_pour_la_jou_37455",t.name,this.dateTimeService.toLocaleString(i,Js.DateOnly.MonthLong),r):this.t("_1_est_gal_ou_39305",t.name,n.value);case ht.Overlaps:return this.t("_1_chevauche_45834",t.name,s,r);case ht.NotOverlaps:return this.t("_1_ne_chevauch_01846",t.name,s,r);case ht.Engulfs:return this.t("_1_engloutis_32228",t.name,s,r);case ht.NotEngulfs:return this.t("_1_n_engloutis_52951",t.name,s,r);case ht.EngulfedBy:return this.t("_1_est_englout_36064",t.name,s,r);case ht.NotEngulfedBy:return this.t("_1_n_est_pas_e_89161",t.name,s,r);case ht.IsBefore:return"formsInsertedAt"===t.slug?this.t("_1_est_avant_l_83271",t.name,r):this.t("_1_est_avant_l_83271",t.name,s);case ht.IsAfter:return"formsInsertedAt"===t.slug?this.t("_1_est_apr_s_l_63712",t.name,r):this.t("_1_est_apr_s_l_63712",t.name,s);case ht.Between:return this.t("_1_est_entre_39871",t.name,s,r);case ht.StartsWith:return this.t("_1_commence_pa_47720",t.name,s);case ht.EndsWith:return this.t("_1_finit_par_65840",t.name,s);case ht.ThisDayMonth:return this.t("_1_est_aujourd_09227",t.name);case ht.Today:return this.t("_1_est_aujourd_42954",t.name);default:return rl(n.operator)}}}getValues(e){return e.fieldType===Ve.Sex?Tn.map(e=>({id:e,name:this.t(e)})):e.fieldType===Ve.Language?e.fieldProperty===Le.Language?xd.map(e=>({id:e,name:this.t(e)})):_n.map(e=>({id:e,name:this.t(e)})):e.fieldType===Ve.Nationality?this.countriesService.getNationalitiesIdName():e.fieldType===Ve.Country?this.countriesService.getCountriesIdName():e.fieldType===Ve.Select&&no(e.values)?e.values.map(({id:e,value:t})=>({id:e,name:t})):[]}valueToString(e,t){const n=function(e){return no(e.values)?e.values:no(e.valuesGroups)?e.valuesGroups.flatMap(e=>e.values):[]}(e);return no(n)?to(t).map(e=>this.t(n.find(({id:t})=>t===e)?.name??e)).join(` ${this.t("ou_67404")} `):this.t(t)}valueDateToString(e){const t=[];return"number"==typeof e?.day&&-1!==e.day&&t.push(e.day),"number"==typeof e?.month&&-1!==e.month&&t.push(this.dateTimeService.toLocaleString(Us.c9.now().set({month:e.month}),{month:"long"})),"number"==typeof e?.year&&-1!==e.year&&t.push(e.year),t.join(" ")}conditionFilterToString(e){if(e.predicate){const t=e.predicate.value.map(t=>e.filter.values?.find(e=>e.id===t)?.name??"");return 1===t.length?this.t("d_pend_du_champ_43516",t[0]):this.t("d_pend_des_cham_85348",t.join(", "))}return""}campaignFilterToString(e){if(e.predicate){const t=e.predicate.value.map(t=>e.filter.campaigns?.find(e=>e.id===t)?.name??"").join(", "),n=e.predicate.value2.map(e=>this.t(e)).join(", ");return this.t("a_re_u_un_messa_76546",t,n)}return""}campaignReplyFilterToString(e){if(e.predicate){const t=e.predicate.value.map(t=>e.filter.campaigns?.find(e=>e.id===t)?.name??"").join(", ");return this.t("la_r_ponse_des_14160",t,e.predicate.value2)}return""}customFieldsToFilters(e){return e.filter(({fieldType:e})=>[We.Address,We.Checkbox,We.Country,We.Date,We.Datetime,We.File,We.Language,We.Nationality,We.Number,We.Phone,We.Select,We.Sex,We.Text,We.Textarea,We.Validation].includes(e)).map(e=>({...e,category:this.t("champs_de_formu_64126"),fieldType:e.fieldType,values:this.getValues(e),color:"warning",isEncrypted:e.isEncrypted}))}customFieldsToPossibleColumns(e){return e.map(e=>({slug:e.slug,name:e.name,label:e.label,customField:e,isSearchable:uu.includes(e.fieldType),isSortable:!!cu.includes(e.fieldType)||e.fieldType===Ve.Select&&e.isSelectV2&&!e.canSelectMultiple,sortAttribute:e.slug,width:"picture"===e.slug?80:void 0,minWidth:"picture"===e.slug?void 0:180}))}};gu=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],gu);var pu=n(1932),fu=n(6360);const xu=({children:e,css:t,onClose:n,returnToFallback:s,size:o})=>{const r=Qn(),a=()=>{n?n():r.goBack(s??$s.HOME)};return Fd(a),tl("common-front/src/designSystem/components/rightPanels/__deprecated/rightPanel.tsx","common-front/src/designSystem/components/rightPanels/base/rightPanel.tsx"),(0,Ht.createPortal)((0,i.jsx)(Na,{css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"100",...t},"data-testid":"right-panel-backdrop",onClick:a,children:(0,i.jsxs)(Na,{css:{background:"white",height:"100%",position:"absolute",right:"0",top:"0",width:"sm"===o?"480px":"650px"},"data-testid":"right-panel-body",direction:"column",onClick:e=>Rl(e,!1),children:[(0,i.jsx)(yr,{color:"gray500",css:{cursor:"pointer",fontSize:"$textMd",position:"absolute",right:"$space$6",top:"$space$6"},onClick:a,children:(0,i.jsx)("i",{className:"far fa-xmark"})}),e]})}),document.body)},_u=L.forwardRef((e,t)=>(0,i.jsx)(Na,{ref:t,css:{flex:"1",overflowY:"auto",px:"$6",...e.css},direction:"column",children:e.children}));_u.displayName="RightPanelBody";const Iu=e=>(0,i.jsx)(yr,{color:"gray800",css:{borderTop:"1px solid $gray200",px:"$6",py:"$4"},children:e.children}),vu=pr("div",{alignItems:"center",borderRadius:"12px",cursor:"pointer",display:"flex",position:"relative","& > div":{background:"white",boxShadow:"$sm",position:"absolute",transition:"left 200ms ease-in"},variants:{disabled:{true:{cursor:"auto"}},size:{sm:{height:"16px",width:"30px","& > div":{borderRadius:"12px",height:"12px",width:"12px"}},md:{height:"24px",width:"44px","& > div":{borderRadius:"20px",height:"20px",width:"20px"}}},state:{unchecked:{background:"$gray200","& > div":{left:"2px"}},checked:{background:"$primary600"}}},compoundVariants:[{size:"sm",state:"checked",css:{"& > div":{left:"calc(100% - 2px - 12px)"}}},{size:"md",state:"checked",css:{"& > div":{left:"calc(100% - 2px - 20px)"}}},{disabled:!0,state:"checked",css:{background:"$gray100"}}],defaultVariants:{size:"sm"}}),bu=e=>(0,i.jsx)(vu,{"aria-checked":e.value,"aria-describedby":e.descId,"aria-label":e.label,"aria-labelledby":e.labelId,disabled:e.disabled,id:e.inputId,role:"checkbox",size:e.size,state:e.value?"checked":"unchecked",tabIndex:e.tabIndex??0,onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:t=>{e.disabled||"Space"!==t.code||(t.preventDefault(),e.onChange(!e.value))},children:(0,i.jsx)("div",{})}),ju=e=>{const{inputId:t,descId:n,labelId:s}=Ga(),o=m(e.subtext);return(0,i.jsxs)(Na,{align:"center",css:{cursor:e.disabled?"auto":"pointer",userSelect:"none",...e.css},tabIndex:0,onClick:()=>{e.disabled||e.onChange(!e.value)},onKeyDown:t=>{e.disabled||"Space"!==t.code||(t.preventDefault(),e.onChange(!e.value))},children:[(0,i.jsx)(bu,{descId:n,disabled:e.disabled,inputId:t,labelId:s,size:e.size,tabIndex:-1,value:e.value,onChange:Ql.A}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsxs)(Na,{css:{flex:"1",fontSize:"md"===e.size?"$3":"$2"},direction:"column",children:[(0,i.jsx)(Pl,{htmlFor:t,id:s,children:(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:e.children})}),o&&(0,i.jsx)(yr,{color:"gray500",id:n,children:e.subtext})]})]})},Cu=e=>{const t=Yn(),[n,s]=(0,L.useState)(""),[o,r]=(0,L.useState)((0,lc.A)(e.columns.map(t=>({...t,isSelected:e.initialSelectedColumns.includes(t.slug)})),[({slug:t})=>{const n=e.initialSelectedColumns.indexOf(t);return-1===n?e.columns.length:n},({name:e})=>e]));return(0,i.jsxs)(xu,{css:e.css,size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(_u,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textXl",children:e.title}),(0,i.jsx)(yr,{color:"gray500",children:e.subtitle}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:n,onChange:s}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_champ_00325")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(fu.JY,{onDragEnd:({reason:e,source:t,destination:n})=>{"DROP"===e&&n&&t.index!==n.index&&r(ro(o,t.index,n.index))},children:(0,i.jsx)(fu.gL,{droppableId:"1",children:e=>(0,i.jsxs)(Na,{direction:"column",gap:"2",...e.droppableProps,ref:e.innerRef,children:[o.map((e,t)=>(e=>{if(m(n)){const t=n.trim().toLowerCase();return e.name.trim().toLowerCase().includes(t)||m(e.label)&&e.label.trim().toLowerCase().includes(t)}return!0})(e)?(0,i.jsx)(fu.sx,{draggableId:e.slug,index:t,children:n=>(0,i.jsxs)(Na,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(yr,{color:"gray300",css:{cursor:"grab"},...n.dragHandleProps,children:(0,i.jsx)(el,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray800",css:{ellipsis:!0},title:e.name,width:1,children:e.name}),m(e.label)&&(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0},title:e.label,width:1,children:e.label})]}),(0,i.jsx)(bu,{value:e.isSelected,onChange:()=>{var n,i;n=e,i=t,r((0,pu.jM)(e=>{e[i].isSelected=!n.isSelected}))}})]})},e.slug):null),e.placeholder]})})}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(Iu,{children:(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{onClick:()=>{e.onSave(o.filter(e=>e.isSelected).map(e=>e.slug)),e.onClose()},children:e.saveButtonText}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]})};function yu(e){const[t,n]=(0,L.useState)(e),[i,s]=(0,L.useState)(!1),o=(0,L.useMemo)(()=>{const e=Object.values(t).filter(e=>!0!==e.disabled),n=e.filter(e=>"checked"===e.state),i=n.map(e=>e.id),s=(0,Ns.A)(e.map(({state:e})=>e)),o=2===s.length?"indeterminate":"checked"===s[0]?"checked":"unchecked";return{numberOfSelected:n.length,selectAllState:o,selecteds:n,selectedsIds:i}},[t]),r=(0,L.useCallback)((e,t)=>{n(n=>({...n,[e]:{...n[e],state:t}})),"unchecked"===t&&s(!1)},[t,n,s]),a=(0,L.useCallback)(e=>{n(Object.fromEntries(Object.entries(t).filter(([e,t])=>!0!==t.disabled).map(([t,n])=>[t,{...n,state:e}]))),"unchecked"===e&&s(!1)},[t,n,s]);return{getSelectedsInput:(0,L.useCallback)((e,t)=>i?e?{ids:null,predicates:e,segmentId:null}:{ids:null,predicates:null,segmentId:t}:{ids:o.selectedsIds,predicates:null,segmentId:null},[i,o]),isAllSelected:i,numberOfSelected:o.numberOfSelected,selectAllState:o.selectAllState,selecteds:o.selecteds,selectedsIds:o.selectedsIds,setIsAllSelected:s,setStates:n,states:t,toggleRow:r,toggleSelectAll:a}}function ku(e){return{numberOfPages:(0,L.useMemo)(()=>e?.numberOfPages??1,[e]),totalCount:(0,L.useMemo)(()=>e?.totalCount??0,[e])}}var Au=n(903);const wu=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.value??[]),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value2??[]),a=e.filterPredicate.filter.campaigns??[],l=(0,Ns.A)(a.filter(({id:e})=>n.includes(e)).map(({campaignType:e})=>e)),d=(0,Ns.A)(["NotSent",...l.includes(he.Email)?an.filter(e=>e!==Te.Queued):[],...l.includes(he.Sms)?On:[]]),c=no(n)&&no(o);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_28439"),values:n,onChange:s,children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),n.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_62901"),values:o,onChange:r,children:d.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!c,onClick:()=>{e.onAdd({operator:ht.Is,value:n,value2:o,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Su=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.value??[]),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Contains),[a,l]=(0,L.useState)(e.filterPredicate.predicate?.value2??[]),d=e.filterPredicate.filter.campaigns??[],c=no(n)&&(o===ht.Contains&&m(a)||o===ht.IsEmpty||o===ht.IsNotEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_28439"),values:n,onChange:s,children:d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),n.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"contains"===o?"checked":"unchecked",onClick:()=>{r(ht.Contains)},children:t("contient_34012")}),"contains"===o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isEmpty"===o?"checked":"unchecked",onClick:()=>{r(ht.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNotEmpty"===o?"checked":"unchecked",onClick:()=>{r(ht.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!c,onClick:()=>{e.onAdd({operator:o,value:n,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Eu=pr("select",{backgroundColor:"$white",height:"100%",left:0,opacity:0,position:"absolute",top:0,width:"100%"}),Tu=pr("div",{ellipsis:""}),zu=({autoComplete:e,children:t,css:n,label:s,description:o,shouldParseAsInt:r,shouldParseAsBoolean:a,onChange:l,hint:d,icon:c,state:u,value:h="",...m})=>{const g=L.useMemo(()=>vc(Ic(t)),[t]),{inputId:p,descId:f,errorId:x}=Ga();return(0,i.jsxs)(Na,{css:n,direction:"column",width:1,children:[(0,i.jsx)(Pl,{htmlFor:p,children:s}),(0,i.jsx)($l,{id:f,children:o}),(s||o)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Ml,{cursor:"default",icon:c,state:u,children:[(0,i.jsx)(Na,{align:"center",css:{flex:"1",overflow:"hidden"},height:1,width:1,children:(0,i.jsx)(Tu,{children:g[h.toString()]})}),(0,i.jsx)(Na,{css:{color:"$gray500"},children:(0,i.jsx)(el,{icon:"chevron-down"})}),(0,i.jsx)(Eu,{"aria-describedby":o?f:void 0,"aria-errormessage":"error"===u?x:void 0,"aria-invalid":"error"===u,autoComplete:e??"off",css:{cursor:"disabled"===u?"not-allowed":"pointer"},disabled:"disabled"===u,id:p,value:h.toString(),onChange:e=>{l(r?parseInt(e.target.value,10):a?"true"===e.target.value:e.target.value)},...m,children:t})]}),(0,i.jsx)(Dl,{id:x,state:u,children:d})]})},Ou=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??!0);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsxs)(zu,{shouldParseAsBoolean:!0,value:o,onChange:r,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsxs)(zu,{shouldParseAsBoolean:!0,value:o,onChange:r,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]}),(0,i.jsx)(qa,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:()=>{e.onAdd({operator:n,value:o,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Ru=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is),o=e.filterPredicate.filter.values??[],[r,a]=(0,L.useState)(no(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="is"===n||"isNot"===n||no(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("champ_dont_un_a_44854")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("champ_d_pendant_33676")}),o.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(ht.Contains)},children:t("d_pends_du_cham_39787")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),(0,i.jsx)(qa,{height:"1"})]})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})};function $u(e){return m(e)?Us.c9.fromISO(e):e}const Du=({value:e,css:t,label:n,description:s,hint:o,icon:r,min:a,onChange:l,max:d,state:c,rightIcon:u,onRightIconClick:h,zone:g,...p})=>{const f=e?$u(e):null,x=f?.isValid?f.toFormat(Ws):"",{inputId:_,descId:I,errorId:v}=Ga();return(0,i.jsxs)(Na,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Pl,{htmlFor:_,children:n}),(0,i.jsx)($l,{id:I,children:s}),(n||s)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Ml,{cursor:"default",icon:r,rightIcon:u,state:c,onRightIconClick:h,children:(0,i.jsx)(yr,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray500",fontSize:"$textSm",height:"100%",lineHeight:"20px",outline:"none",width:"100%"}},children:(0,i.jsx)("input",{"aria-describedby":s?I:void 0,"aria-errormessage":"error"===c?v:void 0,"aria-invalid":"error"===c,disabled:"disabled"===c,id:_,max:d?.toFormat(Ws),min:a?.toFormat(Ws),type:"date",value:x,onChange:e=>{m(e.target.value)?l(Us.c9.fromFormat(e.target.value,Ws,{zone:g||"UTC"})):l(Us.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Dl,{id:v,state:c,children:o})]})};var Pu=n(3551);const Fu=e=>{const t=Yn(),n=qn(Kc),s=(0,L.useMemo)(()=>Us.c9.now().startOf("year"),[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsxs)(zu,{shouldParseAsInt:!0,value:e.value.day,onChange:t=>{e.setValue({...e.value,day:t})},children:[(0,i.jsx)("option",{value:"-1",children:t("jour_74089")}),(0,Oc.A)(1,32).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsxs)(zu,{shouldParseAsInt:!0,value:e.value.month,onChange:t=>{e.setValue({...e.value,month:t})},children:[(0,i.jsx)("option",{value:"-1",children:t("mois_10165")}),(0,Oc.A)(1,13).map(e=>{const t=n.toLocaleString(s.set({month:e}),{month:"long"});return(0,i.jsx)("option",{value:e,children:t},e)})]})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsxs)(zu,{shouldParseAsInt:!0,value:e.value.year,onChange:t=>{e.setValue({...e.value,year:t})},children:[(0,i.jsx)("option",{value:"-1",children:t("ann_e_38546")}),(0,Pu.A)(1900,s.year+2).map(e=>(0,i.jsx)("option",{value:e,children:e},e))]})]}),(0,i.jsx)(qa,{height:"1"})]})},Mu=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,L.useState)(e.filterPredicate.predicate?.value2??""),[d,c]=(0,L.useState)(e.filterPredicate.predicate?.valueDate??{day:-1,month:-1,year:-1}),u=["is","isNot"].includes(n)?"number"==typeof d.day&&-1!==d.day||"number"==typeof d.month&&-1!==d.month||"number"==typeof d.year&&-1!==d.year:["isBefore","isAfter"].includes(n)?Us.c9.isDateTime(o)&&o.isValid:"between"!==n||Us.c9.isDateTime(o)&&o.isValid&&Us.c9.isDateTime(a)&&a.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsx)(Fu,{setValue:c,value:d}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsx)(Fu,{setValue:c,value:d}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isBefore"===n?"checked":"unchecked",onClick:()=>{s(ht.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Du,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isAfter"===n?"checked":"unchecked",onClick:()=>{s(ht.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Du,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"between"===n?"checked":"unchecked",onClick:()=>{s(ht.Between)},children:t("est_entre_born_59665")}),"between"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Du,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsx)(Du,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"today"===n?"checked":"unchecked",onClick:()=>{s(ht.Today)},children:t("est_aujourd_hui_82571")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"thisDayMonth"===n?"checked":"unchecked",onClick:()=>{s(ht.ThisDayMonth)},children:t("est_aujourd_hui_70881")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!u,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,valueDate:d,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Nu=({value:e,css:t,label:n,description:s,hint:o,icon:r,min:a,onChange:l,max:d,rightIcon:c,onRightIconClick:u,state:h,zone:g,...p})=>{const f=e?m(e)?Us.c9.fromISO(e,{zone:"utc"}):e:null,x=f?.isValid?f.toFormat(Gs):"",{inputId:_,descId:I,errorId:v}=Ga();return(0,i.jsxs)(Na,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Pl,{htmlFor:_,children:n}),(0,i.jsx)($l,{id:I,children:s}),(n||s)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Ml,{cursor:"default",icon:r,rightIcon:c,state:h,onRightIconClick:u,children:(0,i.jsx)(yr,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},children:(0,i.jsx)("input",{"aria-describedby":s?I:void 0,"aria-errormessage":"error"===h?v:void 0,"aria-invalid":"error"===h,disabled:"disabled"===h,id:_,max:d?.toFormat(Gs),min:a?.toFormat(Gs),type:"datetime-local",value:x,onChange:e=>{m(e.target.value)?l(Us.c9.fromFormat(e.target.value,Gs,{zone:g||"UTC"})):l(Us.c9.invalid("Invalid"))},...p})})}),(0,i.jsx)(Dl,{id:v,state:h,children:o})]})},Lu=e=>{const t=Yn(),n=(0,L.useMemo)(()=>e.filterPredicate.filter.useLocalZone?Qs():void 0,[e.filterPredicate]),[s,o]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is),[r,a]=(0,L.useState)(Us.c9.fromISO(e.filterPredicate.predicate?.value??"")),[l,d]=(0,L.useState)(Us.c9.fromISO(e.filterPredicate.predicate?.value2??"")),c=["isBefore","isAfter"].includes(s)?Us.c9.isDateTime(r)&&r.isValid:"between"!==s||Us.c9.isDateTime(r)&&r.isValid&&Us.c9.isDateTime(l)&&l.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"isBefore"===s?"checked":"unchecked",onClick:()=>{o(ht.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isAfter"===s?"checked":"unchecked",onClick:()=>{o(ht.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"between"===s?"checked":"unchecked",onClick:()=>{o(ht.Between)},children:t("est_entre_born_59665")}),"between"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{value:r,zone:n,onChange:a})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{value:l,zone:n,onChange:d})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"today"===s?"checked":"unchecked",onClick:()=>{o(ht.Today)},children:t("est_aujourd_hui_82571")}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isEmpty"===s?"checked":"unchecked",onClick:()=>{o(ht.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNotEmpty"===s?"checked":"unchecked",onClick:()=>{o(ht.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!c,onClick:()=>{e.onAdd({operator:s,value:r,value2:l,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Bu=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Contains),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,L.useState)(e.filterPredicate.predicate?.value2??""),d=!!(Us.c9.isDateTime(o)&&o.isValid&&["contains","notContains","is"].includes(n))||Us.c9.isDateTime(a)&&a.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(ht.Contains)},children:t("contient_34012")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("contient_date_89885")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Du,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"notContains"===n?"checked":"unchecked",onClick:()=>{s(ht.NotContains)},children:t("ne_contient_pas_85399")}),"notContains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"overlaps"===n?"checked":"unchecked",onClick:()=>{s(ht.Overlaps)},children:t("chevauche_49445")}),"overlaps"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"notOverlaps"===n?"checked":"unchecked",onClick:()=>{s(ht.NotOverlaps)},children:t("ne_chevauche_pa_17307")}),"notOverlaps"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"engulfs"===n?"checked":"unchecked",onClick:()=>{s(ht.Engulfs)},children:t("engloutis_42346")}),"engulfs"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"notEngulfs"===n?"checked":"unchecked",onClick:()=>{s(ht.NotEngulfs)},children:t("n_engloutis_pas_42363")}),"notEngulfs"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"engulfedBy"===n?"checked":"unchecked",onClick:()=>{s(ht.EngulfedBy)},children:t("est_englouti_pa_47852")}),"engulfedBy"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"notEngulfedBy"===n?"checked":"unchecked",onClick:()=>{s(ht.NotEngulfedBy)},children:t("n_est_pas_englo_08733")}),"notEngulfedBy"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("d_but_41840"),value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nu,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,placeholder:t("fin_60104"),value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!d,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Vu=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.IsEmpty);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNotEmpty)},children:t("n_est_pas_vide_45804")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Uu=e=>{const t=Yn(),n=(0,L.useMemo)(()=>(e.filterPredicate.filter.values||[]).map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)),[e.filterPredicate.filter]),[s,o]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is),[r,a]=(0,L.useState)(e.filterPredicate.predicate?.value??[]),[l,d]=(0,L.useState)(e.filterPredicate.predicate?.value2??""),[c,u]=(0,L.useState)(e.filterPredicate.predicate?.valueDate??{day:-1,month:-1,year:-1}),h=no(r)&&["is","isNot"].includes(s)?"number"==typeof c.day&&-1!==c.day||"number"==typeof c.month&&-1!==c.month||"number"==typeof c.year&&-1!==c.year:!!["isBefore","isAfter"].includes(s)&&Us.c9.isDateTime(l)&&l.isValid;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_un_13356"),values:r,onChange:a,children:n}),r.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"is"===s?"checked":"unchecked",onClick:()=>{o(ht.Is)},children:t("est_25967")}),"is"===s&&(0,i.jsx)(Fu,{setValue:u,value:c}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===s?"checked":"unchecked",onClick:()=>{o(ht.IsNot)},children:t("n_est_pas_97826")}),"isNot"===s&&(0,i.jsx)(Fu,{setValue:u,value:c}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isBefore"===s?"checked":"unchecked",onClick:()=>{o(ht.IsBefore)},children:t("est_avant_le_16689")}),"isBefore"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Du,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:l,onChange:d})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isAfter"===s?"checked":"unchecked",onClick:()=>{o(ht.IsAfter)},children:t("est_apr_s_le_79703")}),"isAfter"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Du,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:l,onChange:d})]}),(0,i.jsx)(qa,{height:"1"})]})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!h,onClick:()=>{e.onAdd({operator:s,value:r,value2:l,valueDate:c,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Wu=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("est_administrat_15766")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("n_est_pas_admin_58612")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Gu=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is),o=(0,L.useMemo)(()=>mu(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,L.useState)(no(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="contains"!==n||no(r),d=(0,L.useMemo)(()=>Array.isArray(r)?r.length:0,[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("est_responsable_47377")}),(0,i.jsx)(qa,{height:"3"}),"isDelegationLeader"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(ht.Contains)},children:t("est_responsable_00281")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Na,{css:{paddingLeft:"$6"},children:(0,i.jsx)(bc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"})]}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("n_est_pas_respo_55625")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Hu=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("est_inscrit_en_86193")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("n_est_pas_inscr_25311")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},qu=pr("div",{variants:{direction:{horizontal:{width:"100%"},vertical:{height:"100%"}},color:{gray100:{},gray200:{}}},compoundVariants:[{direction:"horizontal",color:"gray100",css:{borderTop:"1px solid $gray100"}},{direction:"vertical",color:"gray100",css:{borderRight:"1px solid $gray100"}},{direction:"horizontal",color:"gray200",css:{borderTop:"1px solid $gray200"}},{direction:"vertical",color:"gray200",css:{borderRight:"1px solid $gray200"}}],defaultVariants:{color:"gray200"}}),Yu=e=>(0,i.jsx)(qu,{"aria-orientation":e.direction,color:e.color,css:e.css,direction:e.direction,role:"separator"}),Ku=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:e.height}),(0,i.jsx)(qu,{color:e.color,direction:"horizontal",role:"separator"}),(0,i.jsx)(qa,{height:e.height})]}),Zu=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,L.useState)(e.filterPredicate.predicate?.value2??""),[d,c]=(0,L.useState)($u(e.filterPredicate.predicate?.value3??"")),[u,h]=(0,L.useState)($u(e.filterPredicate.predicate?.value4??"")),[m,g]=(0,L.useState)(Us.c9.isDateTime(d)&&d.isValid&&Us.c9.isDateTime(u)&&u.isValid?"checked":"unchecked"),p=("checked"!==m||Us.c9.isDateTime(d)&&d.isValid&&Us.c9.isDateTime(u)&&u.isValid)&&["is","isNot","greaterThan","greaterThanEqual","lessThan","lessThanEqual"].includes(n)?"number"==typeof o:"between"!==n||"number"==typeof o&&"number"==typeof a;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"greaterThan"===n?"checked":"unchecked",onClick:()=>{s(ht.GreaterThan)},children:t("plus_grand_que_28412")}),"greaterThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"greaterThanEqual"===n?"checked":"unchecked",onClick:()=>{s(ht.GreaterThanEqual)},children:t("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"lessThan"===n?"checked":"unchecked",onClick:()=>{s(ht.LessThan)},children:t("plus_petit_que_35846")}),"lessThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"lessThanEqual"===n?"checked":"unchecked",onClick:()=>{s(ht.LessThanEqual)},children:t("_gal_ou_plus_pe_38400")}),"lessThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{shouldParseAsInt:!0,value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"between"===n?"checked":"unchecked",onClick:()=>{s(ht.Between)},children:t("est_entre_born_59665")}),"between"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{shouldParseAsInt:!0,value:o,onChange:r}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsx)(Nl,{shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),"numberOfAssignmentsDays"===e.filterPredicate.filter.slug&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"3"}),(0,i.jsx)(gc,{state:m,onClick:g,children:t("filtrer_sur_une_06420")}),"checked"===m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(Du,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:d,onChange:c}),(0,i.jsx)(Du,{max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:u,onChange:h})]})]})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!p,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,value3:d,value4:u,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Xu=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??""),[a,l]=(0,L.useState)(e.filterPredicate.predicate?.value2??""),d=!!(Us.c9.isDateTime(o)&&o?.isValid&&["is","isNot","greaterThan","greaterThanEqual","lessThan","lessThanEqual"].includes(n))&&"number"==typeof a;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Du,{label:t("jour_d_affectat_27334"),max:e.filterPredicate.filter.endAt,min:e.filterPredicate.filter.startAt,value:o,onChange:r}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Pl,{children:e.filterPredicate.filter.name}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"greaterThan"===n?"checked":"unchecked",onClick:()=>{s(ht.GreaterThan)},children:t("plus_grand_que_28412")}),"greaterThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"greaterThanEqual"===n?"checked":"unchecked",onClick:()=>{s(ht.GreaterThanEqual)},children:t("_gal_ou_plus_gr_76897")}),"greaterThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"lessThan"===n?"checked":"unchecked",onClick:()=>{s(ht.LessThan)},children:t("plus_petit_que_35846")}),"lessThan"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"lessThanEqual"===n?"checked":"unchecked",onClick:()=>{s(ht.LessThanEqual)},children:t("_gal_ou_plus_pe_38400")}),"lessThanEqual"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{min:0,shouldParseAsInt:!0,value:a,onChange:l})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!d,onClick:()=>{e.onAdd({operator:n,value:o,value2:a,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Ju=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("Public")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("Private")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:()=>{e.onAdd({operator:n,value:"",slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},Qu=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is),o=(0,L.useMemo)(()=>mu(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,L.useState)(no(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),l="is"!==n&&"isNot"!==n||no(r),d=(0,L.useMemo)(()=>Array.isArray(r)?r.length:0,[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Na,{css:{paddingLeft:"$6"},children:(0,i.jsx)(bc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Na,{css:{paddingLeft:"$6"},children:(0,i.jsx)(bc,{hint:t("_1_s_lectionn_51286",d),isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})}),(0,i.jsx)(qa,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!l,onClick:()=>{e.onAdd({operator:n,value:r,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},eh=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??(e.filterPredicate.filter.isEncrypted?ht.IsEmpty:ht.Contains)),[o,r]=(0,L.useState)(e.filterPredicate.predicate?.value??""),a="contains"!==n&&"notContains"!==n||m(o);return(0,i.jsxs)(i.Fragment,{children:[!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsx)(xc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(ht.Contains)},children:t("contient_34012")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"notContains"===n?"checked":"unchecked",onClick:()=>{s(ht.NotContains)},children:t("ne_contient_pas_85399")})]}),"notContains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"startsWith"===n?"checked":"unchecked",onClick:()=>{s(ht.StartsWith)},children:t("commence_par_11056")})]}),"startsWith"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),!0!==e.filterPredicate.filter.isEncrypted&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"endsWith"===n?"checked":"unchecked",onClick:()=>{s(ht.EndsWith)},children:t("finit_par_79657")})]}),"endsWith"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{value:o,onChange:r})]}),(0,i.jsx)(qa,{height:"1"})]}),!0!==e.filterPredicate.filter.hideEmpty&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNotEmpty)},children:t("n_est_pas_vide_45804")})]}),e.showIsValid&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isValid"===n?"checked":"unchecked",onClick:()=>{s(ht.IsValid)},children:t("est_valide_72630")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNotValid"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNotValid)},children:t("n_est_pas_valid_75405")})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!a,onClick:()=>{e.onAdd({operator:n,value:o,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})},th=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.filterPredicate.predicate?.operator??ht.Is),o=(0,L.useMemo)(()=>mu(e.filterPredicate.filter,t),[e.filterPredicate.filter]),[r,a]=(0,L.useState)(no(e.filterPredicate.predicate?.value)?e.filterPredicate.predicate.value:[]),[l,d]=(0,L.useState)(e.filterPredicate.predicate?.value2??1),c=no(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:"is"===n?"checked":"unchecked",onClick:()=>{s(ht.Is)},children:t("est_25967")}),"is"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNot"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNot)},children:t("n_est_pas_97826")}),"isNot"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"contains"===n?"checked":"unchecked",onClick:()=>{s(ht.Contains)},children:t("est_le_choix_07450")}),"contains"===n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Nl,{shouldParseAsInt:!0,value:l,onChange:d})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,placeholder:t("s_lectionner_de_52380"),values:r,onChange:a,children:o})]}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsEmpty)},children:t("est_vide_96759")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"isNotEmpty"===n?"checked":"unchecked",onClick:()=>{s(ht.IsNotEmpty)},children:t("n_est_pas_vide_45804")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{disabled:!c,onClick:()=>{e.onAdd({operator:n,value:r,value2:l,slug:e.filterPredicate.filter.slug})},children:t("ajouter_le_filt_54222")})})]})};var nh=n(9669),ih=n(8389),sh=n(8047);const oh=({children:e,dateTime:t,...n})=>{const s=m(t)?t:t.toISO();return(0,i.jsx)(cl,{as:"time",dateTime:s,textStyle:"inherit",...n,children:e})};function rh(e,t){const n=t.formats?.localeFormat||Js.DateOnly.MonthLong,i=Js.TimeOnly,s=t.language?{locale:t.language.toString().toLowerCase()}:{};t.formats?.displayWeekday&&(n.weekday="long");const o=e.start,r=e.end;return{startDateString:m(t.formats?.dateFormat)?o.toFormat(t.formats.dateFormat):o.toLocaleString(n,s),startTimeString:m(t.formats?.timeFormat)?o.toFormat(t.formats.timeFormat):o.toLocaleString(i,s),endDateString:m(t.formats?.dateFormat)?r.toFormat(t.formats.dateFormat):r.toLocaleString(n,s),endTimeString:m(t.formats?.timeFormat)?r.toFormat(t.formats.timeFormat):r.toLocaleString(i,s)}}function ah(e){return Math.ceil(e.end.endOf("day").diff(e.start.startOf("day"),"days").days)}function lh(e){return e.flatMap(e=>{const t=e.range,n=ah(t);return n>1?(0,Oc.A)(0,n).map(n=>{const i=t.start.plus({days:n}),s=i.startOf("day").equals(t.start.startOf("day"))?t.start:i.startOf("day"),o=i.endOf("day").equals(t.end.endOf("day"))?t.end:i.endOf("day");return{...e,range:Us.IX.fromDateTimes(s,o)}}):[e]})}function dh(e,t,n,i){const s=Math.ceil(n.endOf("day").diff(t.startOf("day"),"days").days),o=(0,Oc.A)(0,s).map(e=>t.startOf("day").set({hour:i}).plus({day:e})),[r,a]=(0,nh.A)(e,e=>e.range.start.hour===i&&0===e.range.start.minute);return a.flatMap(e=>e.range.splitAt(...o).map(t=>({...e,range:t}))).concat(r)}function ch(e){const t=e.filter(e=>e.isValid);if(no(t)){const e=(0,lc.A)(t,e=>e.start.toMillis()),n=[e[0]];for(let t=1;te.start),i=n.reduce((e,t)=>Math.min(e,t.hour),t.minHour??8),s=i%2==0?i:i-1,o=e.map(e=>e.end),r=o.reduce((e,t)=>Math.max(e,t.hour),t.maxHour??20),a=r%2==0?r:r+1,l=(a-s)/2,d=(0,ih.A)(n,e=>e.toMillis()).startOf("day"),c=(0,sh.A)(o,e=>e.toMillis()).endOf("day"),u=Math.ceil(c.diff(d,"days").days);return{starts:n,ends:o,startHour:s,endHour:a,numberOfSlots:l,startDate:d,endDate:c,numberOfDays:u}}let hh=class{translationService;constructor(e){this.translationService=e}toDisplayString(e,t={}){return function(e,t={}){const{startDateString:n,startTimeString:i,endDateString:s,endTimeString:o}=rh(e,t);return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?t.hideTime?`${n}–${s}`:t.hideDate?`${i}–${o}`:`${n} ${i}–${s} ${o}`:t.hideTime?`${n}`:t.hideDate?`${i}–${o}`:`${n} ${i}–${o}`}(e,{...t,language:this.translationService.language})}toComponents(e,t={}){return function(e,t={}){const{startDateString:n,startTimeString:s,endDateString:o,endTimeString:r}=rh(e,t);return e.start.year!==e.end.year||e.start.month!==e.end.month||e.start.day!==e.end.day?t.hideTime?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oh,{dateTime:e.start,children:n}),"–",(0,i.jsx)(oh,{dateTime:e.end,children:o})]}):t.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oh,{dateTime:e.start,children:s}),"–",(0,i.jsx)(oh,{dateTime:e.end,children:s})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(oh,{dateTime:e.start,children:[n," ",s]}),"–",(0,i.jsxs)(oh,{dateTime:e.end,children:[o," ",r]})]}):t.hideTime?(0,i.jsx)(oh,{dateTime:e.start,children:n}):t.hideDate?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oh,{dateTime:e.start,children:s}),"–",(0,i.jsx)(oh,{dateTime:e.end,children:r})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(oh,{dateTime:e.start,children:[n," ",s]}),"–",(0,i.jsx)(oh,{dateTime:e.end,children:r})]})}(e,{...t,language:this.translationService.language})}toLocaleString(e,t,n){return e.toLocaleString(n,t)}};hh=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],hh);var mh=n(7231),gh=n(6452),ph=n(5582);const fh=/^\d{2}:\d{2}$/,xh=/^\d{2}:\d{2}:\d{2}$/;function _h(e){return m(e)&&(null!==e.match(fh)||null!==e.match(xh))}function Ih(e){if(_h(e)){const[t,n]=e.split(":");return[parseInt(t,10),parseInt(n,10)]}return null}function vh(e,t,n,i={}){const s=m(t.name)?t.name:"",o=e.toDisplayString(t.range,i.interval?.options),r=(0,Ya.A)([i.position?.includeName?n:"",s,i.slot?.includeRange||g(s)?o:"",i.position?.includeNameAtEnd?n:""]).join(" - ");return m(r)?r:n}function bh(e,t){return t.some(({id:t,range:n})=>e.id!==t&&n.overlaps(e.range))}function jh(e,t){const n=e.toISODate();return t.filter(e=>e.range.start.toISODate()===n)}function Ch(e,t,n){return!n.hiddenPositionsSlotsIds.includes(e.id)&&(0===n.displayedPositionsSlotsIds.length||n.displayedPositionsSlotsIds.includes(e.id))&&(n.showFullPosition||!e.isFull)&&(n.slotDisplay===xt.Hide||n.positionFilter===ft.None||ch(t.map(Ks)).some(t=>t.engulfs(e.range)))}function yh(e,t,n,i,s,o){const r=[],a=[],l=[],d=e=>Ah(e.position,o),c=(e,t)=>t.some(t=>t.engulfs(e.range)),u=no(s),h=no(i)||no(n)||no(t),m=u&&h?"both":u?"ranges":h?"positions":"none";e.forEach(e=>{const o=i.includes(e.id)||n.includes(e.position.id)||t.includes(e.positionCategory.id);"both"===m&&c(e,s)&&d(e)&&o||"ranges"===m&&c(e,s)&&d(e)||"positions"===m&&d(e)&&o?r.push(e):d(e)&&(0===s.length||c(e,s))?a.push(e):l.push(e)});const g=e=>e.range.start.toMillis();return{wishedPositionsSlots:(0,lc.A)(r,g),possiblePositionsSlots:(0,lc.A)(a,g),otherPositionsSlots:(0,lc.A)(l,g)}}function kh(e,t){const n=t[e.customField.slug];return"boolean"==typeof n&&e.customField.fieldType===Ve.Checkbox?n===e.conditionValue:e.customField.fieldType===Ve.Select&&e.customField.canSelectMultiple&&no(n)?(0,mh.A)(e.conditionValue,n??[]).length>0:e.customField.fieldType===Ve.Select&&"number"==typeof n&&e.conditionValue.includes(n)}function Ah(e,t){if(!no(e?.conditionsCustomFields))return!0;switch(e.conditionsOperator){case pe.Or:return e.conditionsCustomFields.some(e=>kh(e,t));case pe.And:return e.conditionsCustomFields.every(e=>kh(e,t));default:return rl(e.conditionsOperator)}}function wh(e,t,n,i){return!i.hiddenPositionsIds.includes(e.id)&&(0===i.displayedPositionsIds.length||i.displayedPositionsIds.includes(e.id))&&(0===i.hiddenPositionsTagsIds.length||io((0,mh.A)(i.hiddenPositionsTagsIds,e.tagsIds)))&&(0===i.displayedPositionsTagsIds.length||no((0,mh.A)(i.displayedPositionsTagsIds,e.tagsIds)))&&Ah(e,t)&&e.slots.some(e=>Ch(e,n,i))}function Sh(e){return m(e.address)}function Eh(e){return Sr(e.latitude)&&Sr(e.longitude)}function Th(e){return Sh(e)||Eh(e)}function zh(e){return(0,lc.A)(Object.values((0,ac.A)(e,e=>e.position.name)).map(e=>{const t=e[0].positionCategory,n=e[0].position,i=e.map(e=>e.positionSlot.range.start.toMillis());return{id:n.id,category:t.name,text:m(n.acronym)?n.acronym:n.name,minDate:(0,gh.A)(i),color:n.color,count:e.length,icon:n.icon}}),({category:e,text:t,minDate:n})=>[e.toLowerCase(),t.toLowerCase(),n])}function Oh(e,t,n,i={}){const s=m(t.name)?t.name:"",o=t.date?m(i?.date?.format)?t.date.toFormat(i?.date?.format??""):e.toLocaleString(t.date,i?.date?.localeFormat||Js.DateOnly.Numeric):"",r=(0,Ya.A)([i?.accreditation?.includeName?n:"",s,o,i?.accreditation?.includeNameAtEnd?n:""]).join(" - ");return m(r)?r:m(i?.defaultName)?i?.defaultName:n}function Rh(e,t,n,i){return!e.isBlocked&&n.accreditationDisplay!==mt.None&&!n.hiddenAccreditationsSlotsIds.includes(e.id)&&(0===n.displayedAccreditationsSlotsIds.length||n.displayedAccreditationsSlotsIds.includes(e.id))&&(n.showFullAccreditation||!e.isFull)&&(n.slotDisplay===xt.Hide||n.accreditationFilter===ft.None||!e.date||ch(t.map(Ks)).some(t=>Xs(t,e.date)))||i.some(i=>i.accreditationSlotId===e.id&&!i.accreditationSlot.isBlocked&&(n.showFullAccreditation||!i.isFull&&!i.accreditationSlot.isFull)&&(n.slotDisplay===xt.Hide||n.accreditationFilter===ft.None||!i.accreditationSlot?.date||ch(t.map(Ks)).some(e=>Xs(e,i.accreditationSlot.date))))}function $h(e){const t=e.filter(e=>e.date?.isValid),n=(0,ih.A)(t.map(e=>e.date),e=>e.toMillis()),i=(0,sh.A)(t.map(e=>e.date),e=>e.toMillis()),s=Math.ceil(i.endOf("month").diff(n.startOf("month"),"months").months),o=Math.ceil(i.diff(n,"days").days);return{minDate:n,maxDate:i,numberOfMonths:s,totalDaysDiff:o}}function Dh(e,t,n,i){const s=(0,cc.A)(e,t.flatMap(e=>e.date?.isValid&&n.equals(e.date.startOf("month"))?[e.id]:[]));return t.flatMap(e=>i.some(t=>e.date?.isValid&&t.startOf("day").equals(e.date.startOf("day")))?[e.id]:[]).concat(s)}function Ph(e){return(0,lc.A)(e,e=>[e.date?.toMillis()??1,e.name.toLowerCase()])}var Fh,Mh,Nh,Lh,Bh;function Vh(e){switch(e){case Mh.AccreditationsMatrix:case Bh.AccreditationsMatrix:return"table-cells";case Lh.Calendar:case Bh.Calendar:return"calendar";case Nh.Card:return"rectangle-list";case Fh.List:case Mh.List:case Nh.List:case Lh.List:case Bh.List:return"table";case Lh.Map:case Bh.Map:return"map-location";case Fh.SlotsList:case Lh.SlotsList:return"table";default:return rl()}}function Uh(e,t){switch(t){case Mh.AccreditationsMatrix:case Bh.AccreditationsMatrix:return e("matrice_des_acc_84939");case Lh.Calendar:case Bh.Calendar:return e("vue_planning_91663");case Nh.Card:return e("vue_grille_37962");case Fh.List:case Mh.List:case Nh.List:case Lh.List:case Bh.List:return e("vue_liste_56882");case Lh.Map:case Bh.Map:return e("vue_carte_79064");case Fh.SlotsList:case Lh.SlotsList:return e("vue_liste_cr_n_47406");default:return rl()}}!function(e){e.List="List",e.SlotsList="SlotsList"}(Fh||(Fh={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.List="List"}(Mh||(Mh={})),function(e){e.Card="Card",e.List="List"}(Nh||(Nh={})),function(e){e.Calendar="Calendar",e.List="List",e.Map="Map",e.SlotsList="SlotsList"}(Lh||(Lh={})),function(e){e.AccreditationsMatrix="AccreditationsMatrix",e.Calendar="Calendar",e.List="List",e.Map="Map"}(Bh||(Bh={}));var Wh;function Gh(e,t,n){return t===Bh.AccreditationsMatrix?{includeAccreditations:!1,includeAccreditationsMatrix:!0,includeAvailability:!1,includeComments:!1,includeDelegation:!1,includeDuplicatedFrom:!1,includeEmails:!1,includeForms:!1,includeFormsUsersInfos:!1,includeNumberOfAccreditations:!1,includeNumberOfAssignments:!1,includeNumberOfAssignmentsDays:!1,includeNumberOfAvailableDays:!1,includePicture:!0,includePositions:!1,includePreassignedPositions:!1,includeRoles:!1,includeTags:!1,includeTeam:!1,includeTraces:!1,includeVolunteerMinutes:!1,includeWeezevent:!1,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:t===Bh.Map?{includeAccreditations:!1,includeAccreditationsMatrix:!1,includeAvailability:!1,includeComments:!1,includeDelegation:!1,includeDuplicatedFrom:!1,includeEmails:!1,includeForms:!1,includeFormsUsersInfos:!1,includeNumberOfAccreditations:!1,includeNumberOfAssignments:!1,includeNumberOfAssignmentsDays:!1,includeNumberOfAvailableDays:!1,includePicture:!1,includePositions:!1,includePreassignedPositions:!1,includeRoles:!1,includeTags:!1,includeTeam:!1,includeTraces:!0,includeVolunteerMinutes:!1,includeWeezevent:!1,includeWeezeventChecklists:!1,includeWeezeventUrls:!1,includeWishedPositions:!1}:{includeAccreditations:e.includes(Wh.Accreditations)||e.includes(Wh.AccreditationsCategories)||e.includes(Wh.AccreditationsSlots)||e.includes(Wh.WishedAccreditationSlots)||e.includes(Wh.ScannedAccreditations),includeAccreditationsMatrix:!1,includeAvailability:e.includes(Wh.Availability),includeComments:e.includes(Wh.Comments),includeDelegation:e.includes(Wh.Delegations)||e.includes(Wh.DelegationCategory)||e.includes(Wh.DelegationLocalId),includeDuplicatedFrom:e.includes(Wh.DuplicatedFrom),includeEmails:e.includes(Wh.CampaignsStates),includeFormsUsersInfos:e.includes(Wh.CompletedForms)||e.includes(Wh.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at"))||e.includes(Wh.Availability)||e.includes(Wh.TeamCode)||e.includes(Wh.TeamMembers),includeForms:e.includes(Wh.CompletedForms)||e.includes(Wh.FormsInsertedAt)||e.some(e=>e.startsWith("form_inserted_at"))||e.includes(Wh.Availability),includeNumberOfAccreditations:e.includes(Wh.NumberOfAccreditations),includeNumberOfAssignments:e.includes(Wh.NumberOfAssignments),includeNumberOfAssignmentsDays:e.includes(Wh.NumberOfAssignmentsDays),includeNumberOfAvailableDays:e.includes(Wh.NumberOfAvailableDays),includePicture:e.includes(Wh.Name)||e.includes("picture"),includePositions:e.includes(Wh.Positions)||e.includes(Wh.PositionsCategories)||e.includes(Wh.WishedPositions)||e.includes(Wh.CheckedInPositions),includeRoles:e.includes(Wh.Roles),includeTags:e.includes(Wh.Tags),includeTeam:e.includes(Wh.TeamCode)||e.includes(Wh.TeamMembers),includeTraces:!1,includeVolunteerMinutes:e.includes(Wh.VolunteerMinutes),includeWishedPositions:e.includes(Wh.WishedPositions),includePreassignedPositions:e.includes(Wh.PreassignedPositionsCategories)||e.includes(Wh.PreassignedPositions),includeWeezeventChecklists:e.includes(Wh.WeezaccessChecklists),includeWeezevent:e.includes(Wh.WeezeventBarcodeId)||e.includes(Wh.WeezeventPairedAt),includeWeezeventUrls:!0===n?.includeWeezeventUrls&&(e.includes(Wh.WeezeventBarcodeId)||e.includes(Wh.WeezeventShortTag))}}!function(e){e.AccreditationState="accreditation_state",e.Accreditations="accreditations",e.AccreditationsCategories="accreditations_categories",e.AccreditationsSlots="accreditations_slots",e.Availability="availability",e.CampaignsStates="campaigns_states",e.CheckedInPositions="checed_in_positions",e.Comments="comments",e.CompletedForms="forms",e.DelegationCategory="delegation_category",e.DelegationLocalId="delegation_local_id",e.Delegations="delegations",e.DuplicatedFrom="duplicatedFrom",e.Email="email",e.FormsInsertedAt="forms_inserted_at",e.Id="id",e.InsertedAt="inserted_at",e.LocalId="local_id",e.Name="name",e.NumberOfAccreditations="number_of_accreditations",e.NumberOfAssignments="number_of_assignments",e.NumberOfAssignmentsDays="number_of_assignments_days",e.NumberOfAvailableDays="number_of_available_days",e.Positions="positions",e.PositionsCategories="positions_categories",e.PreassignedPositions="preassigned_positions",e.PreassignedPositionsCategories="preassigned_positions_categories",e.Roles="roles",e.ScannedAccreditations="scanned_accreditations",e.Tags="tags",e.TeamCode="teamCode",e.TeamMembers="teamMembers",e.VolunteerMinutes="volunteer_minutes",e.VolunteerRegistrationState="volunteer_registration_state",e.WeezaccessChecklists="weezevent_checklists",e.WeezeventBarcodeId="weezevent_barcode_id",e.WeezeventPairedAt="weezevent_paired_at",e.WeezeventShortTag="weezevent_short_tag",e.WishedAccreditationSlots="wished_accreditation_slots",e.WishedPositions="wished_positions"}(Wh||(Wh={}));let Hh=class extends gu{constructor(e,t,n){super(e,t,n)}getVolunteersFilters(e,t,n,i,s,{hasAccreditations:o,hasCampaigns:r,hasDelegations:a,hasForms:l,hasPositions:d,isWeezeventConnected:c}){return[...this.getBaseFilters(i),...this.getAvailabilitiesFilters(t,s),...d?this.getPositionsFilters(e,t,s):[],...o?this.getAccreditationsFilters(e,t,s):[],...a?this.getDelegationsFilters(e,t):[],...this.getSegmentsFilters(e,t,n,s),...l?this.getFormsFilters(t):[],...l?this.getTeamsFilters():[],...c?this.getWeezeventFilters(t):[],...this.getEmailsFilters(t,r),...this.getCommentsFilter(e,t),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:We.Select,needLoading:!0,organizationId:e,eventId:t,tagContext:kt.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:We.Number,hideEmpty:!0},{slug:"possibleDuplicates",name:this.t("potentiel_doubl_87672"),category:this.t("autres_99130"),fieldType:We.Checkbox,hideEmpty:!0},{slug:"isLeader",name:this.t("est_responsable_19679"),category:this.t("autres_99130"),fieldType:We.Checkbox},{slug:"isPositionLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:We.Checkbox},{slug:"isPositionCategoryLeader",name:this.t("est_responsable_91796"),category:this.t("autres_99130"),fieldType:We.Checkbox}]}getPositionMembersFilters(e,t,n,i){return[...this.getBaseFilters(n),...this.getAvailabilitiesFilters(t,i),...this.getPositionsFilters(e,t,i)]}getAccreditationMembersFilters(e,t,n,i,{hasDelegations:s}){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...s?this.getDelegationsFilters(e,t):[]]}getDelegationCategoryMembersFilters(e,t,n,i,s){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...s?this.getWeezeventFilters(t):[]]}getDelegationMembersFilters(e,t,n,i,s,o){return[...this.getBaseFilters(n),...this.getAccreditationsFilters(e,t,i),...s.positionDisplay===pt.None?[]:this.getPositionMembersFilters(e,t,n,i),...o?this.getWeezeventFilters(t):[]]}getVolunteersPossibleColumns(e,t,{hasAccreditations:n,hasCampaigns:i,hasDelegations:s,hasForms:o,hasPositions:r,isWeezeventConnected:a}){return[...this.getBaseColumns(e),...o?this.getFormsColumns(t):[],...r?this.getPositionsColumns():[],...a?this.getWeezeventColumns():[],...n?this.getAccreditationsColumns():[],...this.getAvailabilitiesColumns(),...s?this.getDelegationsColumns():[],...i?[{slug:Wh.CampaignsStates,name:this.t("statut_des_camp_25280"),minWidth:320}]:[],{slug:Wh.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:Wh.Comments,name:this.t("commentaires_96492"),isSearchable:!0,minWidth:320},{slug:Wh.Roles,name:this.t("r_les_61679"),minWidth:320}]}getPositionMembersPossibleColumns(e){return[...this.getBaseColumns(e),...this.getPositionsColumns()]}getAccreditationMembersPossibleColumns(e){return[...this.getBaseColumns(e),...this.getAccreditationsColumns(),...this.getDelegationsColumns()]}getDelegationCategoryMembersPossibleColumns(e,t){return[...this.getBaseColumns(e),...this.getAccreditationsColumns(),...t?this.getWeezeventColumns():[],{slug:Wh.CampaignsStates,name:this.t("statut_des_camp_25280")},{slug:Wh.Delegations,name:this.t("Delegation"),isSearchable:!0}]}getDelegationMembersPossibleColumns(e,{isWeezeventConnected:t,positionDisplay:n,slotDisplay:i}){return[...this.getBaseColumns(e),...this.getAccreditationsColumns(),...n===pt.None?[]:this.getPositionsColumns(),...i===xt.Hide?[]:this.getAvailabilitiesColumns(),...t?this.getWeezeventColumns():[],{slug:Wh.CampaignsStates,name:this.t("statut_des_camp_25280")}]}getBaseColumns(e){return[{slug:Wh.Email,name:this.t("e_mail_du_membr_69509"),isSearchable:!0,minWidth:180},{slug:Wh.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Pt.Id,width:100},{slug:Wh.LocalId,name:this.t("id_sur_l_v_nem_01171"),isSearchable:!0,isSortable:!0,sortAttribute:Pt.LocalId,width:100},{slug:Wh.Name,name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:Pt.Name,minWidth:240},{slug:Wh.InsertedAt,name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:Pt.InsertedAt,width:240},{slug:Wh.DuplicatedFrom,name:this.t("dupliqu_de_28582"),minWidth:240},...this.customFieldsToPossibleColumns(e)]}getAvailabilitiesColumns(){return[{slug:Wh.Availability,name:this.t("disponibilit_s_49923"),minWidth:320}]}getFormsColumns(e){return[{slug:Wh.CompletedForms,name:this.t("formulaires_rem_62495"),minWidth:320},{slug:Wh.FormsInsertedAt,name:this.t("dates_de_rempli_65075"),minWidth:320},...(0,lc.A)(e,e=>e.name).map(e=>({slug:`form_inserted_at_${e.id}`,name:this.t("date_de_remplis_00881",e.name),isSortable:!0,sortAttribute:`form_inserted_at_${e.id}`,minWidth:240})),{slug:Wh.TeamCode,name:this.t("code_quipe_14296"),isSearchable:!0,isSortable:!0,sortAttribute:Pt.TeamCode,minWidth:180},{slug:Wh.TeamMembers,name:this.t("membres_de_l_q_00891"),minWidth:240}]}getPositionsColumns(){return[{slug:Wh.NumberOfAssignments,name:this.t("nombre_d_affect_31455"),width:240},{slug:Wh.NumberOfAssignmentsDays,name:this.t("nombre_de_jours_86280"),width:240},{slug:Wh.NumberOfAvailableDays,name:this.t("nombre_de_jours_07962"),width:240},{slug:Wh.Positions,name:this.t("missions_affect_97811"),minWidth:320},{slug:Wh.PositionsCategories,name:this.t("cat_gories_de_m_93035"),minWidth:320},{slug:Wh.VolunteerMinutes,name:this.t("nombre_de_minut_50497"),width:240},{slug:Wh.VolunteerRegistrationState,name:this.t("status_d_affect_75769"),isSortable:!0,sortAttribute:Pt.State,width:240},{slug:Wh.WishedPositions,name:this.t("missions_souhai_23225"),minWidth:320},{slug:Wh.PreassignedPositions,name:this.t("missions_pr_af_02950"),minWidth:320},{slug:Wh.PreassignedPositionsCategories,name:this.t("cat_gories_pr_83825"),minWidth:320},{slug:Wh.CheckedInPositions,name:this.t("missions_point_05292"),minWidth:320}]}getAccreditationsColumns(){return(0,Ya.A)([{slug:Wh.Accreditations,name:this.t("accr_ditations_33155"),minWidth:320},{slug:Wh.AccreditationsCategories,name:this.t("cat_gories_d_ac_37678"),minWidth:320},{slug:Wh.AccreditationState,name:this.t("statut_d_accr_d_75527"),isSortable:!0,sortAttribute:Pt.AccreditationState,width:240},{slug:Wh.NumberOfAccreditations,name:this.t("nombre_d_accr_d_02452"),width:240},{slug:Wh.WishedAccreditationSlots,name:this.t("accr_ditations_74375"),minWidth:320},{slug:Wh.ScannedAccreditations,name:this.t("accr_ditations_52153"),minWidth:320}])}getWeezeventColumns(){return[{slug:Wh.WeezeventBarcodeId,name:this.t("TicketId"),isSearchable:!0,minWidth:240},{slug:Wh.WeezeventShortTag,name:this.t("puce_50504"),isSearchable:!0,minWidth:180},{slug:Wh.WeezeventPairedAt,name:this.t("appair_le_70213"),minWidth:180},{slug:Wh.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),minWidth:320}]}getDelegationsColumns(){return[{slug:Wh.Delegations,name:this.t("Delegation"),isSearchable:!0,isSortable:!0,sortAttribute:Pt.Delegation,minWidth:240},{slug:Wh.DelegationCategory,name:this.t("cat_gorie_de_d_18027"),minWidth:240},{slug:Wh.DelegationLocalId,name:this.t("id_sur_la_d_l_g_86268"),isSearchable:!0,width:100}]}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:We.Text,hideEmpty:!0},{slug:"insertedAt",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:We.Date,hideEmpty:!0},{slug:Wh.LocalId,name:this.t("id_sur_l_v_nem_01171"),category:this.t("champs_de_formu_64126"),fieldType:We.Number,hideEmpty:!0},{slug:Wh.DuplicatedFrom,name:this.t("est_dupliqu_62764"),category:this.t("champs_de_formu_64126"),fieldType:We.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(e)]}getAvailabilitiesFilters(e,t){return[{slug:"numberOfAvailableDays",name:this.t("nombre_de_jours_07962"),category:this.t("disponibilit_s_49923"),fieldType:We.Number,hideEmpty:!0},{slug:"wishedSlots",name:this.t("disponibilit_s_49923"),category:this.t("disponibilit_s_49923"),fieldType:We.DateTimeRange,startAt:t.startAt,endAt:t.endAt},{slug:"wishedSlotsCustom",name:this.t("disponibilit_s_26280"),category:this.t("disponibilit_s_49923"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:e},{slug:"numberOfWishedSlots",name:this.t("nombre_de_dispo_26405"),category:this.t("disponibilit_s_49923"),fieldType:We.Number,hideEmpty:!0}]}getPositionsFilters(e,t,n){return[{slug:"volunteerRegistrationState",name:this.t("statut_d_affect_57444"),category:this.t("missions_63972"),fieldType:We.Select,values:Dn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"position",name:this.t("missions_affect_97811"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"hasOtherEventPosition",name:this.t("has_shift_on_ot_92375"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:"positionSlotId",name:this.t("cr_neau_affect_50400_plural"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"positionSlot",name:this.t("date_d_affectat_98566"),category:this.t("missions_63972"),fieldType:We.DateTimeRange,startAt:n.startAt,endAt:n.endAt},{slug:"positionCategory",name:this.t("cat_gories_de_m_93035"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0},{slug:"numberOfAssignmentsPerDay",name:this.t("nombre_d_affect_22087"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"numberOfAssignmentsDays",name:this.t("nombre_de_jours_86280"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"preassignedPosition",name:this.t("missions_pr_af_02950"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"preassignedPositionCategory",name:this.t("cat_gories_pr_83825"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"wishedPositionsCategories",name:this.t("cat_gories_souh_80851"),category:this.t("missions_63972"),fieldType:We.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositionsCategories",name:this.t("nombre_de_cat_g_05961"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0},{slug:"wishedPositions",name:this.t("missions_souhai_23225"),category:this.t("missions_63972"),fieldType:We.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositions",name:this.t("nombre_de_missi_52579"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0},{slug:"wishedPositionsSlots",name:this.t("cr_neaux_souhai_90108"),category:this.t("missions_63972"),fieldType:We.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedPositionsSlots",name:this.t("nombre_de_cr_ne_28370"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0},{slug:"volunteersMinutes",name:this.t("nombre_de_minut_50497"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0},{slug:"volunteersMinutesDays",name:this.t("nombre_de_minut_89574"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0,startAt:n.startAt,endAt:n.endAt},{slug:"checkInAt",name:this.t("point_le_93167"),category:this.t("missions_63972"),fieldType:We.Datetime},{slug:"checkOutAt",name:this.t("d_point_le_29289"),category:this.t("missions_63972"),fieldType:We.Datetime},{slug:"checkInState",name:this.t("statut_de_point_44328"),category:this.t("missions_63972"),fieldType:We.Select,values:Qt.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"checkInAtPositionSlot",name:this.t("cr_neaux_point_71408"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"checkOutAtPositionSlot",name:this.t("cr_neaux_d_poin_45477"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"overlappingAssignments",name:this.t("affectations_se_49339"),category:this.t("missions_63972"),fieldType:We.Checkbox,hideEmpty:!0}]}getAccreditationsFilters(e,t,n){return(0,Ya.A)([{slug:"accreditationState",name:this.t("statut_d_accr_d_75527"),category:this.t("accr_ditations_39450"),fieldType:We.Select,values:Zt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"numberOfAccreditations",name:this.t("nombre_d_accr_d_02452"),category:this.t("accr_ditations_39450"),fieldType:We.Number,hideEmpty:!0},{slug:"accreditation",name:this.t("accr_ditations_39450"),category:this.t("accr_ditations_39450"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"hasOtherEventAccreditation",name:this.t("has_accreditati_31831"),category:this.t("accr_ditations_39450"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:"accreditationCategory",name:this.t("cat_gories_d_ac_37678"),category:this.t("accr_ditations_39450"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"wishedAccreditationsSlots",name:this.t("accr_ditations_74375"),category:this.t("accr_ditations_39450"),fieldType:We.Select,needLoading:!0,eventId:t},{slug:"numberOfWishedAccreditationsSlots",name:this.t("nombre_d_accr_d_92021"),category:this.t("accr_ditations_39450"),fieldType:We.Number,hideEmpty:!0},{slug:"accreditationSlotId",name:this.t("cr_neaux_accr_d_70934"),category:this.t("accr_ditations_39450"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditationSlot",name:this.t("date_d_accr_dit_26214"),category:this.t("accr_ditations_39450"),fieldType:We.Date,startAt:n.startAt,endAt:n.endAt},{slug:"scannedAccreditationsSlots",name:this.t("accr_ditations_52153"),category:this.t("accr_ditations_39450"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t}])}getDelegationsFilters(e,t){return[{slug:"delegation",name:this.t("inscrit_via_la_86398"),category:this.t("d_l_gations_78318"),fieldType:We.Select,needLoading:!0,eventId:t},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:We.Select,needLoading:!0,organizationId:e,eventId:t},{slug:"isDelegationCategoryLeader",name:this.t("est_responsable_36610"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,needLoading:!0,eventId:t}]}getSegmentsFilters(e,t,n,i){return[{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("vues_personnali_80652"),fieldType:We.Select,values:i.segmentsFolders.flatMap(e=>e.segments).filter(e=>e.id!==n),hideEmpty:!0},{slug:"usersSegments",name:this.t("fait_partie_de_44893"),category:this.t("vues_personnali_80652"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"positionsSegments",name:this.t("affecter_une_10657"),category:this.t("vues_personnali_80652"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"accreditationsSegments",name:this.t("affecter_une_91431"),category:this.t("vues_personnali_80652"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t},{slug:"delegationsSegments",name:this.t("affecter_une_45240"),category:this.t("vues_personnali_80652"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:t}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:We.Select,needLoading:!0,eventId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:We.Date,hideEmpty:!0,needLoading:!0,eventId:e}]}getTeamsFilters(){return[{slug:"isTeam",name:this.t("est_inscrit_en_86193"),category:this.t("_quipes_18817"),fieldType:We.Checkbox,hideEmpty:!0},{slug:"teamCode",name:this.t("code_quipe_14296"),category:this.t("_quipes_18817"),fieldType:We.Text},{slug:"numberOfTeamMembers",name:this.t("nombre_de_membr_82302"),category:this.t("_quipes_18817"),fieldType:We.Number},{slug:"isTeamLeader",name:this.t("est_chef_d_qui_73792"),category:this.t("_quipes_18817"),fieldType:We.Checkbox,hideEmpty:!0}]}getWeezeventFilters(e){return[{slug:Wh.WeezeventBarcodeId,name:this.t("TicketId"),category:"Weezevent",fieldType:We.Text,hideEmpty:!0},{slug:Wh.WeezeventShortTag,name:this.t("puce_50504"),category:"Weezevent",fieldType:We.Text},{slug:Wh.WeezeventPairedAt,name:this.t("appair_le_70213"),category:"Weezevent",fieldType:We.Datetime,useLocalZone:!0},{slug:Wh.WeezaccessChecklists,name:this.t("listes_de_contr_55120"),category:"Weezevent",fieldType:We.Select,needLoading:!0,eventId:e}]}getEmailsFilters(e,t){return(0,Ya.A)([t?{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:We.Campaign,needLoading:!0,eventId:e}:null,{slug:"assignmentEmailSentAt",name:this.t("date_d_envoi_de_01614"),category:this.t("e_mails_09850"),fieldType:We.Date},{slug:"assignmentEmailState",name:this.t("statut_de_de_l_36346"),category:this.t("e_mails_09850"),fieldType:We.Select,values:an.filter(e=>e!==Te.Queued).map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"accreditationEmailState",name:this.t("statut_de_l_e_m_97776"),category:this.t("e_mails_09850"),fieldType:We.Select,values:an.filter(e=>e!==Te.Queued).map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"emailBlacklist",name:this.t("ne_souhaite_plu_08853"),category:this.t("e_mails_09850"),fieldType:We.Checkbox,hideEmpty:!0},t?{slug:"campaignReply",name:this.t("r_ponse_une_c_32448"),category:this.t("e_mails_09850"),fieldType:We.Text,needLoading:!0,eventId:e}:null])}getCommentsFilter(e,t){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:We.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:We.Date,hideEmpty:!0},{slug:"commentWrittenBy",name:this.t("commentaire_cr_96610"),category:this.t("commentaires_96492"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t}]}};function qh(e,t,n,i,s){const o=t.diff(e,"days").days;return(0,Oc.A)(0,o+1).map(t=>e.plus({days:t}).set({hour:s})).filter(e=>i===gt.AllDays||n.some(t=>t.contains(e)||t.start.startOf("day").equals(e)||t.end.startOf("day").equals(e)))}function Yh(e,t,n,i,s){const o=t.diff(e,"days").days;return(0,Oc.A)(0,o+1).flatMap(t=>{const i=e.plus({days:t});return n.map(e=>{const[t,n]=e.startTime.split(":").map(e=>parseInt(e,10)),[s,o]=e.endTime.split(":").map(e=>parseInt(e,10)),r=i.set({hour:t,minute:n});let a=i.set({hour:s,minute:o});return(ss===gt.AllDays||i.some(t=>t.overlaps(e.interval)))}function Kh(e,t){return m(e)?`${e} (${t.toFormat("HH:mm")})`:t.toFormat("HH:mm")}function Zh(e,t,n){const i=e.filter(e=>!t.equals(Ys(e)));return i.length===e.length&&n?[...e,Zs(t)]:i.length===e.length||n?e:i}Hh=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],Hh);const Xh=(e,t)=>(0,lc.A)(Object.values((0,ac.A)(t,e=>e.position.name)).map(t=>({name:t[0].position.name,values:(0,lc.A)(t.map(t=>({id:t.id,name:vh(e,t,t.position.name,{position:{includeNameAtEnd:!0}}),startTime:t.range.start.toMillis()})),({startTime:e})=>e)})),({name:e})=>e),Jh=(e,t)=>(0,lc.A)(Object.values((0,ac.A)(t,e=>e.accreditation.name)).map(t=>({name:t[0].accreditation.name,values:(0,lc.A)(t.map(t=>({id:t.id,name:Oh(e,t,t.accreditation.name,{accreditation:{includeNameAtEnd:!0}})})),e=>e.name)})),({name:e})=>e),Qh=async(e,t,n)=>{const i=await K();if("createdBy"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return ho("query Admins($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n usersInfos(eventId: $eventId, roleTypes: [OrganizationAdmin, EventAdmin]) {\n nodes {\n userId\n email\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=e.usersInfos.nodes.map(({userId:e,email:t,name:n})=>({id:e,name:`${m(n)?n:"-"} - ${t}`})),n.needLoading=!1}else if("leaders"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return ho('query DelegationsSegmentsLeaders($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n usersInfos(\n eventId: $eventId\n isDelegationLeader: true\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n }\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=e.usersInfos.nodes,n.needLoading=!1}else if("delegationCategory"===n.slug&&n.organizationId){const{organization:e}=await function(e,t){return ho("query VolunteersSegmentsDelegationsCategories(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n delegationsCategories(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,level:n.eventId?it.Event:it.Organization,eventId:n.eventId},i);n.values=(0,lc.A)(e.delegationsCategories.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("tag"===n.slug&&n.organizationId){const{organization:e}=await Bo({organizationId:n.organizationId,eventId:n.eventId,context:n.tagContext},i);n.values=(0,lc.A)(e.tags.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if(n.eventId){if(["preassignedPosition","position","wishedPositions"].includes(n.slug)){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsPositions($eventId: EventId!) {\n event(id: $eventId) {\n positions {\n nodes {\n id\n name\n positionCategoryName\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,lc.A)(Object.entries((0,ac.A)(e.positions.nodes,e=>e.positionCategoryName)).map(([e,t])=>({name:t[0].positionCategoryName,values:(0,lc.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("hasOtherEventPosition"===n.slug&&n.organizationId){const{organization:{positions:e}}=await function(e,t){return ho("query VolunteersSegmentsOtherPositions($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n positions(excludedEventId: $eventId) {\n nodes {\n id\n name\n positionCategoryName\n event {\n id\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.valuesGroups=(0,lc.A)(Object.entries((0,ac.A)(e.nodes,e=>e.positionCategoryName)).map(([e,t])=>({name:`${t[0].event.name}: ${t[0].positionCategoryName}`,values:(0,lc.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if(["positionSlotId","wishedPositionsSlots","checkInAtPositionSlot","checkOutAtPositionSlot"].includes(n.slug)){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positionsSlots {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=Xh(t,e.positionsSlots.nodes),n.needLoading=!1}else if(["positionCategory","preassignedPositionCategory","wishedPositionsCategories"].includes(n.slug)){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsPositionsCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,lc.A)(e.positionsCategories,e=>e.name.toLowerCase()),n.needLoading=!1}else if("wishedSlotsCustom"===n.slug){const{event:t}=await function(e,t){return ho("query VolunteeersSegmentsCustomSlotsPeriods($eventId: EventId!) {\n event(id: $eventId) {\n startAt\n endAt\n ranges\n\n customSlotsPeriods {\n name\n startDate\n endDate\n\n customSlots {\n name\n startTime\n endTime\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=((e,t)=>{const n=t.customSlotsPeriods.flatMap(e=>Yh(e.startDate??t.startAt,e.endDate??t.endAt,e.customSlots,t.ranges,gt.AllDays));return(0,lc.A)(Object.values((0,ac.A)(n,({interval:e})=>e.start.startOf("day").toMillis())),e=>e[0].interval.start.startOf("day").toMillis()).map(t=>{const n=t[0].interval;return{name:e.toLocaleString(n.start.startOf("day"),Js.DateOnly.WeekdayLongMonthLong),values:t.map(({name:e,interval:t})=>({id:t.toISO(),name:Kh(e,t)}))}})})(e,t),n.needLoading=!1}else if("accreditation"===n.slug){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsAccreditations($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n id\n name\n accreditationCategoryName\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,lc.A)(Object.entries((0,ac.A)(e.accreditations.nodes,e=>e.accreditationCategoryName)).map(([e,t])=>({name:t[0].accreditationCategoryName,values:(0,lc.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("hasOtherEventAccreditation"===n.slug&&n.organizationId){const{organization:{accreditations:e}}=await function(e,t){return ho("query VolunteersSegmentsOtherAccreditations($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n accreditations(excludedEventId: $eventId) {\n nodes {\n id\n name\n accreditationCategoryName\n event {\n id\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.valuesGroups=(0,lc.A)(Object.entries((0,ac.A)(e.nodes,e=>e.accreditationCategoryName)).map(([e,t])=>({name:`${t[0].event.name}: ${t[0].accreditationCategoryName}`,values:(0,lc.A)(t,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("accreditationCategory"===n.slug){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsAccreditationsCategories($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,lc.A)(e.accreditationsCategories,e=>e.name.toLowerCase()),n.needLoading=!1}else if("positionsSegments"===n.slug){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsPositionsSegments($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Positions) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,lc.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,lc.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("accreditationsSegments"===n.slug){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsAccreditationsSegments($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Accreditations) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,lc.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,lc.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("delegationsSegments"===n.slug||"isDelegationLeader"===n.slug){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsDelegationsSegments($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Delegations) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=(0,lc.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,lc.A)(e.segments,e=>e.index)})),n.needLoading=!1}else if("forms"===n.slug||"form"===n.slug||"formsInsertedAt"===n.slug){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsForms($eventId: EventId!) {\n event(id: $eventId) {\n forms {\n nodes {\n ...SegmentForm\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.SegmentFormFragment]})}({eventId:n.eventId},i);n.values=(0,lc.A)(e.forms.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("campaign"===n.slug||"campaignReply"===n.slug){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsCampaigns($eventId: EventId!) {\n event(id: $eventId) {\n campaigns(states: [Done, Scheduled, Template]) {\n nodes {\n ...SegmentCampaign\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.SegmentCampaignFragment]})}({eventId:n.eventId},i);n.campaigns=(0,lc.A)(e.campaigns.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("delegation"===n.slug){const{event:e}=await function(e,t){return ho("query VolunteersSegmentsDelegations($eventId: EventId!) {\n event(id: $eventId) {\n delegations {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,lc.A)(e.delegations.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if(["accreditationSlotId","scannedAccreditationsSlots","wishedAccreditationsSlots"].includes(n.slug)){const{event:t}=await function(e,t){return ho("query VolunteersSegmentsAccreditationsSlots($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true) {\n nodes {\n id\n name\n date\n\n accreditation {\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.valuesGroups=Jh(e,t.accreditationsSlots.nodes),n.needLoading=!1}else if(n.slug===Wh.WeezaccessChecklists){const{event:e}=await function(e,t){return ho("query VolunteersWeezaccessChecklists($eventId: EventId!) {\n event(id: $eventId) {\n weezaccessChecklists {\n id\n name\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({eventId:n.eventId},i);n.values=(0,lc.A)(e.weezaccessChecklists,e=>e.name.toLowerCase()),n.needLoading=!1}else if("commentWrittenBy"===n.slug){const{organization:e}=await function(e,t){return ho("query VolunteersSegmentsLoaders($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n admins: usersInfos(roleTypes: [OrganizationAdmin, EventAdmin]) {\n nodes {\n id\n nameOrEmail\n }\n }\n\n usersInfos(eventId: $eventId, hasRole: true) {\n nodes {\n id\n nameOrEmail\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId,eventId:n.eventId},i);n.values=(0,lc.A)((0,ph.A)(e.admins.nodes.concat(e.usersInfos.nodes),e=>e.id),e=>e.nameOrEmail.toLowerCase()).map(({id:e,nameOrEmail:t})=>({id:e,name:t})),n.needLoading=!1}}else if(n.organizationId)if("event"===n.slug){const{organization:e}=await function(e,t){return ho("query UsersSegmentsEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n ...SegmentEvent\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.SegmentEventFragment]})}({organizationId:n.organizationId},i);n.values=(0,lc.A)(e.events.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("forms"===n.slug||"formsInsertedAt"===n.slug){const{organization:e}=await function(e,t){return ho("query UsersSegmentsForms($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n forms(level: Organization) {\n nodes {\n ...SegmentForm\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.SegmentFormFragment]})}({organizationId:n.organizationId},i);n.values=(0,lc.A)(e.forms.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("campaign"===n.slug){const{organization:e}=await function(e,t){return ho("query UsersSegmentsCampaigns($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n campaigns(level: Organization, states: [Done, Scheduled, Template]) {\n nodes {\n ...SegmentCampaign\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.SegmentCampaignFragment]})}({organizationId:n.organizationId},i);n.campaigns=(0,lc.A)(e.campaigns.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("positionCustomField"===n.slug||"accreditationCustomField"===n.slug){const{organization:e}=await function(e,t){return ho("query ConditionsCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All, fieldTypes: [Checkbox, Select]) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.values=(0,lc.A)(e.customFields.nodes,e=>e.name.toLowerCase()),n.needLoading=!1}else if("delegation"===n.slug){const{organization:e}=await function(e,t){return ho("query UsersSegmentsDelegations($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n name\n\n delegations(level: Both) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.valuesGroups=(0,lc.A)(Object.entries((0,ac.A)(e.delegations.nodes,e=>e.event?.id||-1)).map(([t,n])=>({name:n[0].event?.name??e.name,values:(0,lc.A)(n,e=>e.name.toLowerCase())})),({name:e})=>e.toLowerCase()),n.needLoading=!1}else if("usersSegments"===n.slug){const{organization:e}=await function(e,t){return ho("query VolunteersSegmentsUsersSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n segmentsFolders(level: Organization, segmentType: Volunteers) {\n id\n name\n index\n\n segments {\n id\n name\n index\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n.organizationId},i);n.valuesGroups=(0,lc.A)(e.segmentsFolders,e=>e.index).map(e=>({name:e.name,values:(0,lc.A)(e.segments,e=>e.index)})),n.needLoading=!1}};function em(e){const t=qn(Kc),n=qn(hh),[i,s]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{const i=e.filter(({filter:e})=>e.needLoading);no(i)&&(s(!0),Promise.all(i.map(({filter:e})=>Qh(t,n,e))).then(()=>{s(!1)}))},[e]),i}const tm=e=>{const t=Yn(),n=e.filterPredicate.filter.slug,s=e.filterPredicate.filter.fieldType,o=function(e){const t=qn(Kc),n=qn(hh),[i,s]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{e.needLoading&&(s(!0),Qh(t,n,e).then(()=>{s(!1)}))},[e.needLoading]),i}(e.filterPredicate.filter);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{color:"$gray500",cursor:"pointer",fontSize:"$textXs",fontWeight:"$semiBold"},gap:"3",onClick:e.onBack,children:[(0,i.jsx)("i",{className:"fa-regular fa-arrow-left"}),t("retour_la_lis_63860")]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:e.filterPredicate.filter.name}),(0,i.jsx)(qa,{height:"3"}),o?(0,i.jsx)(kl,{}):"condition"===n?(0,i.jsx)(Ru,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isLeader"===n||"isPositionLeader"===n||"isPositionCategoryLeader"===n||"isDelegationLeader"===n?(0,i.jsx)(Gu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isAdmin"===n?(0,i.jsx)(Wu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"privacy"===n?(0,i.jsx)(Ju,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"isTeam"===n?(0,i.jsx)(Hu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"wishedPositions"===n||"wishedPositionsCategories"===n?(0,i.jsx)(th,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"formsInsertedAt"===n?(0,i.jsx)(Uu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"numberOfAssignmentsPerDay"===n||"volunteersMinutesDays"===n?(0,i.jsx)(Xu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):"campaignReply"===n?(0,i.jsx)(Su,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):[We.Address,We.Text,We.Textarea].includes(s)?(0,i.jsx)(eh,{filterPredicate:e.filterPredicate,showIsValid:!1,onAdd:e.onAdd}):[We.Country,We.Language,We.Nationality,We.Select,We.Sex].includes(s)?(0,i.jsx)(Qu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):[We.Checkbox,We.Validation].includes(s)?(0,i.jsx)(Ou,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===We.Phone?(0,i.jsx)(eh,{filterPredicate:e.filterPredicate,showIsValid:!0,onAdd:e.onAdd}):s===We.Number?(0,i.jsx)(Zu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===We.DateTimeRange?(0,i.jsx)(Bu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===We.Date?(0,i.jsx)(Mu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===We.Datetime?(0,i.jsx)(Lu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===We.File?(0,i.jsx)(Vu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):s===We.Campaign?(0,i.jsx)(wu,{filterPredicate:e.filterPredicate,onAdd:e.onAdd}):(0,i.jsx)("div",{children:"TODO"})]})};function nm(e){switch(e){case We.Address:return"map-location";case We.Text:case We.Textarea:return"text";case We.Checkbox:return"square-check";case We.Validation:return"check";case We.Select:return"list-ul";case We.Date:return"calendar";case We.Datetime:return"calendar-day";case We.Time:return"clock";case We.File:return"file";case We.Phone:return"phone";case We.Language:return"language";case We.Number:return"00";case We.Sex:return"venus-mars";case We.Nationality:case We.Country:return"flag";case We.DateTimeRange:return"calendar-range";case We.Campaign:return"paper-plane";default:return rl()}}const im=e=>{const t=(0,L.useMemo)(()=>(0,Ns.A)(e.filtersPredicates.map(({filter:e})=>e.category)),[e.filtersPredicates]),n=(0,L.useMemo)(()=>(0,ac.A)(e.filtersPredicates,({filter:e})=>e.category),[e.filtersPredicates]);return(0,i.jsx)(Na,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",px:"$4"},direction:"column",children:t.map((t,s)=>{const o=n[t];return(0,i.jsxs)(L.Fragment,{children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[0!==s&&(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(yr,{css:{paddingBottom:"$2",paddingTop:"$3"},font:"gray500 textXs semiBold",children:t})]}),o.map(t=>{const{filter:n}=t;return(0,i.jsxs)(Na,{align:"center",css:{py:"$2"},gap:"3",children:[(0,i.jsx)(Na,{align:"center",css:{borderRadius:"$1",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(el,{icon:nm(n.fieldType)})}),(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray900",css:{ellipsis:!0},fontWeight:"medium",title:n.name,width:1,children:n.name}),m(n.label)&&(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0},title:n.label,width:1,children:n.label})]}),e.isEdit?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(El,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{e.onEdit(t)}}),(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(n.slug)}})]}):(0,i.jsx)(El,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(t)}})]},n.slug)})]},s)})})},sm=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.selectedFilterPredicate),[o,r]=(0,L.useState)((0,Au.A)(e.predicates)),a=(0,L.useCallback)(e=>{r((0,pu.jM)(t=>{const n=t.findIndex(t=>t.slug===e.slug);-1===n?t.push(e):t[n]=e})),s(null)},[r,s]),l=(0,L.useCallback)(e=>{r((0,pu.jM)(t=>{const n=t.findIndex(t=>t.slug===e);t.splice(n,1)}))},[r]),[d,c]=(0,L.useState)(""),[u,h]=hu(o,e.possibleFilters,d);return(0,i.jsxs)(xu,{size:"sm",onClose:e.onClose,children:[(0,i.jsxs)(_u,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textXl",children:t("filtres_64574")}),m(e.subtitle)&&(0,i.jsx)(yr,{color:"gray500",children:e.subtitle}),(0,i.jsx)(qa,{height:"6"}),n?(0,i.jsx)(tm,{filterPredicate:n,onAdd:a,onBack:()=>{s(null)}}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nl,{placeholder:t("rechercher_un_f_22061"),value:d,onChange:c}),(0,i.jsx)(qa,{height:"6"}),o.length>0&&u.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_filtr_29511")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(im,{filtersPredicates:u,isEdit:!0,onDelete:l,onEdit:e=>{s(e)}}),(0,i.jsx)(qa,{height:"8"})]}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_filtr_37728")}),h.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(im,{filtersPredicates:h,isEdit:!1,onAdd:e=>{s(e)}})]})]}),(0,i.jsx)(qa,{height:"6"})]}),null===n&&(0,i.jsx)(Iu,{children:(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{onClick:()=>{e.onFilter(o),e.onClose()},children:e.buttonText||t("filtrer_78031")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]})},om=L.createContext({});function rm(){return L.useContext(om)}const am=()=>{const e=Yn(),t=qn(gu),{filtersPredicates:n,clearNameCursors:s,setPredicates:o,setIsFilterOpen:r,setSelectedFilterPredicate:a,predicates:l}=rm(),d=(0,L.useCallback)(()=>{s(),o([])},[s,o]),c=(0,L.useCallback)(e=>{a(e),r(!0)},[r,a]),u=(0,L.useCallback)(e=>{s(),o((0,dc.A)(l,e.predicate))},[l,s,o]);return em(n),no(n)?(0,i.jsxs)(Na,{align:"center",gap:"3",width:1,wrap:"wrap",children:[n.map((e,n)=>e.filter.needLoading?(0,i.jsx)(ic,{leftIcon:"loader"},n):(0,i.jsx)(ic,{cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>{c(e)},onRightIconClick:()=>{u(e)},children:t.filterPredicateToText(e)},n)),(0,i.jsx)(yr,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:d,children:e("r_initialiser_l_66835")})]}):null};function lm(){return(0,L.useMemo)(()=>navigator.platform.toLowerCase().startsWith("mac"),[])}function dm(e,t){const n=lm(),i=(0,L.useCallback)(i=>{i.key===e&&(n&&i.metaKey||!n&&i.ctrlKey)&&t(i)},[e,t]);(0,L.useEffect)(()=>(document.addEventListener("keydown",i,!1),()=>{document.removeEventListener("keydown",i,!1)}),[e,t,i])}const cm=e=>{const{translate:t}=_l(),{columnsSearch:n,setColumnsSearch:s}=rm(),[o,r]=(0,L.useState)(""),a=(0,L.useMemo)(()=>m(o)?e.searchableColumns.filter(e=>e.name.toLowerCase().trim().includes(o.toLowerCase().trim())):e.searchableColumns,[e.searchableColumns,o]);return(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(qd,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(Na,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("rechercher_sur_85243")}),(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("filtrer_78031"),state:"search",value:o,onChange:r}),(0,i.jsx)(Na,{direction:"column",gap:"3",children:a.map(({slug:e,name:t})=>(0,i.jsx)(gc,{state:n.includes(e)?"checked":"unchecked",onClick:t=>{s(so(n,e,"checked"===t))},children:t},e))})]})})]})},um=()=>{const e=Yn(),{isEditMode:t,massActions:n,name:s,possibleColumns:o,possibleRenderings:r,reload:a,renderActions:l,rendering:d,setAreColumnsOpen:c,setIsEditMode:u,setIsFilterOpen:h,setName:m,setNameDebounced:g,setRendering:p,showEditColumns:f,showEditMode:x,showFilters:_,showMassActions:I,showSearchColumns:v,totalCount:b}=rm(),j=I&&n.numberOfSelected>0,C=(0,L.useMemo)(()=>(0,lc.A)(o.filter(e=>e.isSearchable),e=>e.name),[o]),y=(0,L.useMemo)(()=>v?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[v]);return dm("e",(0,L.useCallback)(()=>{x&&u(!t)},[t,x,u])),(0,i.jsxs)(Na,{align:"center",gap:"4",children:[(0,i.jsxs)(Na,{width:320,children:[(0,i.jsx)(Nl,{css:y,icon:"magnifying-glass",placeholder:e("rechercher_50038"),value:s,onChange:e=>{m(e),g(e)}}),v&&(0,i.jsx)(cm,{searchableColumns:C})]}),j?(0,i.jsx)(Na,{css:{flex:"1"},gap:"4",children:"function"==typeof l?l(n,b,a):null}):(0,i.jsxs)(Na,{css:{flex:"1"},gap:"4",children:[_&&(0,i.jsx)(El,{color:"gray",leftIcon:"bars-filter",onClick:()=>{h(!0)},children:e("filtres_64574")}),(0,i.jsx)(yr,{css:{flex:"1"}}),no(r)&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:Vh(d),children:Uh(e,d)})}),(0,i.jsx)(qd,{placement:"bottom-end",children:r.map(t=>(0,i.jsx)(Gd,{icon:Vh(t),onClick:()=>p(t),children:Uh(e,t)},t))})]}),f&&(0,i.jsx)(El,{color:"white",leftIcon:"gear",onClick:()=>{c(!0)},children:e("_diter_les_colo_39630")}),x&&(0,i.jsx)(ju,{value:t,onChange:u,children:e("mode_dition_93778")})]})]})},hm=()=>(0,i.jsxs)(Na,{css:{border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$1",borderTopRightRadius:"$1",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(um,{}),(0,i.jsx)(am,{})]}),mm=e=>{const{translate:t}=_l(),[n,s]=L.useState(e.predicates),[o,r]=L.useState(e.columns),[a,l]=L.useState(e.columnsSearch),[d,c]=L.useState(e.rendering),[u,h]=L.useState(e.name||""),[g,p]=L.useState(e.name||""),[f,x]=L.useState(e.limit),[_,I]=L.useState(e.sort),[v,b]=L.useState(0),j=Lc(e=>{p(e),C()}),C=L.useCallback(()=>{b(0)},[b]),y=L.useCallback(t=>{e.setName?.(t),h(t)},[e.setName,h]),k=L.useCallback(()=>{y(""),p(""),C()},[y,p,C]),A=L.useCallback(t=>{e.setPredicates?.(t),s(t)},[e.setPredicates,s]),w=L.useCallback(t=>{e.setColumns?.(t),r(t)},[e.setColumns,r]),S=L.useCallback(t=>{e.setColumnsSearch?.(t),l(t)},[e.setColumnsSearch,l]),E=L.useCallback(t=>{e.setRendering?.(t),c(t)},[e.setRendering,c]),T=L.useCallback(t=>{e.setLimit?.(t),x(t)},[e.setLimit,x]),z=L.useCallback(t=>{e.setSort?.(t),I(t),b(0)},[e.setSort,I,b]),O=L.useMemo(()=>JSON.stringify(e.predicates),[e.predicates]),R=L.useMemo(()=>JSON.stringify(e.columns),[e.columns]),$=L.useMemo(()=>JSON.stringify(e.columnsSearch),[e.columnsSearch]),D=L.useMemo(()=>JSON.stringify(e.rendering),[e.rendering]),P=L.useMemo(()=>JSON.stringify(e.sort),[e.sort]),F=L.useMemo(()=>JSON.stringify(n)!==O||JSON.stringify(o)!==R||JSON.stringify(a)!==$||JSON.stringify(d)!==D||JSON.stringify(_)!==P,[O,n,R,o,$,a,D,d,P,_]),M=L.useMemo(()=>e.columnsToIncludes?.(o,d)??{},[o,d,e.columnsToIncludes]),[N,B]=L.useState(null),[V,U]=L.useState(!1),W=L.useCallback(async()=>{U(!0);const t=await e.loadDataList({...M,...e.loadDataListParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,name:m(g)?g:null,columnsSearch:no(a)?a:null,predicates:n,limit:f,offset:v,sort:_},await K());B(t.data),U(!1)},[a,M,f,g,v,n,U,B,_,e.organizationId,e.eventId,e.loadDataList,e.loadDataListParams]),[G,H]=L.useState([]),{numberOfPages:q,totalCount:Y}=ku(N?.rows),[Z,X]=L.useState({}),J=L.useCallback(async t=>{X(e=>({...e,[t]:!0}));const n=(await e.loadRow({...M,...e.loadRowParams||{},organizationId:e.organizationId||void 0,eventId:e.eventId||void 0,id:t},await K())).data.row;H(e=>e.map(e=>e.id===t?n:e)),X(e=>({...e,[t]:!1}))},[M,X,e.organizationId,e.eventId,e.loadRow,e.loadRowParams]),Q=L.useCallback(t=>e.getMassActionId?.(t)??t.id,[e.getMassActionId]),ee=yu({}),[te]=L.useMemo(()=>hu(n,e.filters),[n,e.filters]),[ne,ie]=L.useState(!1),[se,oe]=L.useState(!1),[re,ae]=L.useState(!1),[le,de]=L.useState(null);return L.useEffect(()=>{W()},[a,M,f,g,v,n,_,e.organizationId,e.eventId,e.loadDataList]),L.useEffect(()=>{H(N?.rows?.nodes??[])},[N]),L.useEffect(()=>{ee.setStates(Object.fromEntries(G.map(e=>[`r${Q(e)}`,{id:Q(e),state:"unchecked"}])))},[G,ee.setStates]),(0,i.jsxs)(om.Provider,{value:{areColumnsOpen:re,clearNameCursors:k,columns:o,columnsSearch:a,data:G,filtersPredicates:te,getMassActionId:Q,idToLoading:Z,isEditMode:ne,isFilterOpen:se,isLoading:V,isSaveVisible:F,limit:f,loadDataResult:N,massActions:ee,name:u,nameDebounced:g,numberOfPages:q,offset:v,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:n,reload:W,reloadRow:J,renderActions:e.renderActions,rendering:d,selectedFilterPredicate:le,setAreColumnsOpen:ae,setColumns:w,setColumnsSearch:S,setIsEditMode:ie,setIsFilterOpen:oe,setLimit:T,setName:y,setNameDebounced:j,setOffset:b,setPredicates:A,setRendering:E,setSelectedFilterPredicate:de,setSort:z,showEditColumns:e.showEditColumns,showEditMode:e.showEditMode,showFilters:e.showFilters,showMassActions:e.showMassActions,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,showSearchColumns:e.showSearchColumns,sort:_,totalCount:Y},children:[(0,i.jsxs)(Na,{css:{background:"white"},direction:"column",height:1,width:1,children:[(0,i.jsx)(hm,{}),e.children]}),se&&(0,i.jsx)(sm,{possibleFilters:e.filters,predicates:n,selectedFilterPredicate:le,onClose:()=>{oe(!1)},onFilter:e=>{k(),A(e)}}),re&&(0,i.jsx)(Cu,{columns:e.possibleColumns,initialSelectedColumns:o,saveButtonText:t("_diter_les_colo_39630"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_03763"),title:t("_dition_des_col_70300"),onClose:()=>{ae(!1)},onSave:w})]})},gm={deserialize(e){const t=parseInt(e||"",10);return isNaN(t)?null:t},serialize:e=>e.toString(10)},pm={deserialize(e){try{return JSON.parse(e||"")}catch{return null}},serialize:e=>JSON.stringify(e)},fm={deserialize:e=>m(e)&&Us.c9.fromISO(e)?.isValid?Us.c9.fromISO(e):null,serialize:e=>e.toISO()};function xm(e,t,n={}){const i=ti(),[s,o]=L.useState("function"==typeof n.deserialize?n.deserialize(i.getItem(e))||t:i.getItem(e)??t);return[s,L.useCallback(t=>{o(t),i.setItem(e,"function"==typeof n.serialize?n.serialize(t):t)},[e,o,i])]}const _m=e=>{return(0,i.jsxs)(Vc,{css:{cursor:"pointer",userSelect:"none",...e.css||{}},minWidth:e.minWidth,width:e.width,onClick:()=>{var t,n;e.setSort((t=e.sort,n=e.attribute,null===t||t.attribute!==n?{attribute:n,direction:jt.Asc}:t.direction===jt.Asc?{attribute:n,direction:jt.Desc}:null))},children:[e.children,(0,i.jsx)(qa,{width:"2"}),(0,i.jsx)(el,{icon:(t=e.sort,n=e.attribute,null===t||t.attribute!==n?"arrow-down-arrow-up":t.direction===jt.Asc?"arrow-up":"arrow-down")})]});var t,n},Im=e=>{const t=!!e.paginationRow;return(0,i.jsx)(yc,{children:(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsxs)(cd,{css:{borderLeft:"1px solid $gray200",borderRight:"1px solid $gray200",height:"100%",overflow:"auto hidden",width:"100%","& > div:first-child":{borderStartStartRadius:e.featureFlags?.isV4?"$radii$2":void 0,borderStartEndRadius:e.featureFlags?.isV4?"$radii$2":void 0},"& > div:last-child":{borderEndEndRadius:t?void 0:"$radii$2",borderEndStartRadius:t?void 0:"$radii$2"},"& .table-header-row, & .table-row":{borderLeft:"none",borderRight:"none"},...e.css},gridtemplaterows:"44px 1fr",children:[e.headerRow,(0,i.jsx)(yr,{css:{overflow:"auto"},children:e.children})]}),e.paginationRow]})})},vm=L.createContext({}),bm=e=>{const[t,n]=L.useState(!1),[s,o]=L.useState(null),[r,a]=L.useState(null),l=(0,Wa.A)("tooltip-");return(0,i.jsx)(vm.Provider,{value:{isVisible:t,referenceElement:s,popperElement:r,tooltipId:l,setIsVisible:n,setReferenceElement:o,setPopperElement:a},children:e.children})};function jm(){return L.useContext(vm)}const Cm=e=>{const{isVisible:t,popperElement:n,referenceElement:s,setPopperElement:o,tooltipId:r}=jm(),{styles:a,attributes:l,update:d}=(0,Hd.E)(s,n,{placement:e.placement,modifiers:[{name:"offset",options:{offset:[0,4]}}]});L.useEffect(()=>{d?.()},[t,s]);const c=(0,i.jsx)(Na,{ref:o,align:"center",css:{background:"$gray900",borderRadius:"$1",color:"white",display:t?"flex":"none",px:"$3",py:"6px",zIndex:1e3,...a.popper},id:r,justify:"center",role:"tooltip",...l.popper,children:e.children});return e.renderOnPortal?(0,Ht.createPortal)(c,document.body):c},ym=e=>{const{setIsVisible:t,setReferenceElement:n,tooltipId:s}=jm(),o=L.cloneElement(L.Children.only(e.children),{ref(e){n(e)},"aria-labelledby":s,"aria-describedby":s,onMouseEnter(){t(!0)},onMouseLeave(){t(!1)},onFocus(){t(!0)},onBlur(){t(!1)}});return(0,i.jsx)(i.Fragment,{children:o})},km=e=>{const{translate:t}=_l(),{showRowEdit:n,getMassActionId:s,massActions:o,reload:r,reloadRow:a,showMassActions:l,showRowDropdown:d}=rm(),c=o.states[`r${s(e.row)}`]?.state??"unchecked",u=L.useCallback(()=>{a(e.row.id)},[e.row.id,a]),h=d||n;return(0,i.jsxs)(Dc,{css:{background:"checked"===c?"$primary100":"white","&:hover":{background:"checked"===c?"$primary100":"$gray100"}},onMouseLeave:e=>{Nd(e.target)},children:[l&&(0,i.jsx)(Ec,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:c,onClick:t=>{o.toggleRow(`r${s(e.row)}`,t)}})}),e.selectedColumns.map(t=>(0,i.jsx)(L.Fragment,{children:e.renderCell(t,e.row,u)},t.slug)),h&&(0,i.jsxs)(Yc,{justify:"center",children:[n&&e.getEditPath&&(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",to:e.getEditPath(e.row)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]}),d&&e.renderRowDropdown?.(e.row,r)]}),e.renderRowPanels?.(e.row,u)]})},Am=e=>{const{columns:t,data:n,idToLoading:s,isLoading:o,limit:r,massActions:a,numberOfPages:l,offset:d,possibleColumns:c,setLimit:u,setOffset:h,setSort:m,showMassActions:g,showRowDropdown:p,showRowEdit:f,sort:x,totalCount:_}=rm(),I=L.useMemo(()=>t.flatMap(e=>(0,Ya.A)([c.find(t=>t.slug===e)])),[t,c]);return(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":o,headerRow:(0,i.jsxs)(jc,{children:[g&&(0,i.jsx)(Vc,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:a.selectAllState,onClick:a.toggleSelectAll})}),I.map(e=>e.isSortable?(0,i.jsx)(_m,{attribute:e.sortAttribute,minWidth:e.minWidth,setSort:m,sort:x,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Vc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(p||f)&&(0,i.jsx)(Vc,{width:100})]}),paginationRow:(0,i.jsx)(Pc,{children:(0,i.jsx)($c,{limit:r,numberOfPages:l,offset:d,setLimit:u,setOffset:h,showLimits:!0,totalCount:_})}),children:o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):n.map(t=>s[t.id]?(0,i.jsx)(Uc,{},t.id):(0,i.jsx)(km,{getEditPath:e.getEditPath,renderCell:e.renderCell,renderRowDropdown:e.renderRowDropdown,renderRowPanels:e.renderRowPanels,row:t,selectedColumns:I},t.id))})})};var wm;!function(e){e.Features="features",e.Id="id",e.InsertedAt="insertedAt",e.MembersLimit="membersLimit",e.Name="name",e.NumberOfEvents="numberOfEvents",e.NumberOfMembers="numberOfMembers",e.PeriodEndAt="periodEndAt",e.PricePerMember="pricePerMember",e.WeezeventOrganizationId="weezeventOrganizationId"}(wm||(wm={}));let Sm=class extends gu{constructor(e,t,n){super(e,t,n)}getFilters(){return[{slug:"features",name:this.t("fonctionnalit_s_47714"),category:this.t("organisation_71863"),fieldType:We.Select,values:cn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_admin_98471"),category:this.t("organisation_71863"),fieldType:We.Checkbox,hideEmpty:!0},{slug:"isActive",name:this.t("est_active_05309"),category:this.t("organisation_71863"),fieldType:We.Checkbox,hideEmpty:!0},{slug:"useOldBilling",name:this.t("utilise_l_ancie_27299"),category:this.t("organisation_71863"),fieldType:We.Checkbox},{slug:"isOverLimit",name:this.t("d_passe_la_limi_27046"),category:this.t("organisation_71863"),fieldType:We.Checkbox,hideEmpty:!0},{slug:wm.MembersLimit,name:this.t("nombre_de_membr_16400"),category:this.t("organisation_71863"),fieldType:We.Number},{slug:wm.PricePerMember,name:this.t("prix_par_membre_20633"),category:this.t("organisation_71863"),fieldType:We.Number}]}getPossibleColumns(){return[{slug:wm.Id,name:this.t("id_51738"),isSortable:!0,sortAttribute:st.Id,width:100},{slug:wm.Name,name:this.t("nom_de_l_organi_49583"),minWidth:240},{slug:wm.InsertedAt,name:this.t("date_de_cr_atio_00749"),isSortable:!0,sortAttribute:st.InsertedAt,width:200},{slug:wm.PeriodEndAt,name:this.t("date_de_fin_de_17750"),isSortable:!0,sortAttribute:st.PeriodEndAt,width:200},{slug:wm.Features,name:this.t("fonctionnalit_s_47714"),minWidth:320},{slug:wm.NumberOfEvents,name:this.t("nombre_d_v_nem_14214"),minWidth:180},{slug:wm.NumberOfMembers,name:this.t("nombre_de_membr_49522"),minWidth:180},{slug:wm.MembersLimit,name:this.t("nombre_de_membr_16400"),minWidth:180},{slug:wm.PricePerMember,name:this.t("prix_par_membre_20633"),minWidth:180},{slug:wm.WeezeventOrganizationId,name:this.t("id_de_l_organis_67465"),isSortable:!0,sortAttribute:st.WeezeventOrganizationId,width:100}]}};function Em(e){switch(e){case Ne.Accreditation:return"badge-check";case Ne.Api:return"code-branch";case Ne.Beta:return"flask";case Ne.Community:return"people-group";case Ne.CustomDocument:return"file";case Ne.Delegation:return"users";case Ne.Documents:return"file";case Ne.Eid:return"id-card";case Ne.KmlImport:return"cloud-arrow-up";case Ne.Languages:return"language";case Ne.Multiform:return"file-lines";case Ne.Skidata:return"person-skiing";case Ne.Sms:return"message";case Ne.Weezevent:return"ticket";case Ne.Zapier:return"bolt";default:return rl()}}Sm=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],Sm);const Tm=e=>{const t=qn(Kc);return e.column.slug===wm.Id?(0,i.jsx)(Ec,{width:e.column.width,children:e.row.id}):e.column.slug===wm.WeezeventOrganizationId?(0,i.jsx)(Ec,{width:e.column.width,children:e.row.weezeventOrganizationId?(0,i.jsxs)(qc,{to:`/ticket/O${e.row.weezeventOrganizationId}`,children:["O",e.row.weezeventOrganizationId]}):""}):e.column.slug===wm.Name?(0,i.jsx)(Ec,{css:{"& a":{color:"$primary700 !important"}},children:(0,i.jsx)(Ja,{to:bi.ORGANIZATION({organizationId:e.row.id}),children:e.row.name})}):e.column.slug===wm.InsertedAt?(0,i.jsx)(Ec,{width:e.column.width,children:t.toLocaleString(e.row.insertedAt,Js.DateOnly.MonthLong)}):e.column.slug===wm.PeriodEndAt?(0,i.jsx)(Ec,{width:e.column.width,children:t.toLocaleString(e.row.periodEndAt,Js.DateOnly.MonthLong)}):e.column.slug===wm.Features?(0,i.jsx)(Ec,{children:(0,i.jsx)(Na,{align:"center",css:{overflow:"auto",py:"$2"},gap:"2",height:1,width:1,wrap:"wrap",children:e.row.features.map(e=>(0,i.jsx)(ic,{leftIcon:Em(e),children:e},e))})}):e.column.slug===wm.NumberOfEvents?(0,i.jsx)(Ec,{children:e.row.numberOfEvents}):e.column.slug===wm.NumberOfMembers?(0,i.jsx)(Ec,{children:e.row.membersStats.numberOfMembers}):e.column.slug===wm.MembersLimit?(0,i.jsx)(Ec,{children:e.row.membersLimit}):e.column.slug===wm.PricePerMember?(0,i.jsx)(Ec,{children:e.row.pricePerMember}):(0,i.jsx)(Ec,{})},zm=e=>{const t=Yn(),{user:n}=si(),{mutate:s,isLoading:o}=function(e={}){return Xn("mutation BackofficeOrganizationUserAdd($organizationId: OrganizationId!) {\n backofficeOrganizationUserAdd(organizationId: $organizationId)\n}\n",e)}(),{mutate:r,isLoading:a}=function(e={}){return Xn("mutation BackofficeOrganizationUserRemove($organizationId: OrganizationId!) {\n backofficeOrganizationUserRemove(organizationId: $organizationId)\n}\n",e)}(),l=e.organization.users.map(({id:e})=>e);return(0,i.jsxs)(Hc,{children:[l.includes(n.id)?(0,i.jsx)(Gd,{color:a?"disabled":"default",icon:"minus",onClick:async()=>{await r({organizationId:e.organization.id}),e.reload()},children:t("s_enlever_comme_18919")}):(0,i.jsx)(Gd,{color:o?"disabled":"default",icon:"plus",onClick:async()=>{await s({organizationId:e.organization.id}),window.open(`${P.HEAVENT_APP_URL}${bi.ORGANIZATION({organizationId:e.organization.id})}`,"_blank"),e.reload()},children:t("s_ajouter_comme_70404")}),(0,i.jsx)(Gd,{icon:"pen",to:$s.EDIT_BACKOFFICE_ORGANIZATION(e.organization.id),children:t("_diter_62574")})]})},Om=()=>{const{history:e,translate:t}=_l(),n=qn(Sm),[s,o]=xm(Bl.BACKOFFICE_SEARCH,"",{deserialize(e){const t=new URL(location.href).searchParams.get("q");return m(t)?t:e}}),[r,a]=xm(Bl.BACKOFFICE_COLUMNS,[wm.Id,wm.Name,wm.InsertedAt,wm.PeriodEndAt],pm),[l,d]=xm(Bl.BACKOFFICE_LIMIT,Tc,gm),[c,u]=xm(Bl.BACKOFFICE_PREDICATES,[],pm),[h,g]=xm(Bl.BACKOFFICE_SORT,null,pm);return(0,i.jsx)(yr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",gap:"7",width:1,children:[(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("organisations_26509")}),(0,i.jsx)(El,{color:"white",leftIcon:"plus",to:mi(bi.ORGANIZATIONS),children:t("cr_er_une_organ_06669")}),(0,i.jsx)(El,{leftIcon:"house",onClick:()=>{e.push($s.HOME)},children:"WeezCrew"}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(qd,{placement:"bottom-end",children:(0,i.jsx)(Gd,{icon:"eye",onClick:()=>{e.push($s.BACKOFFICE_INVOICES)},children:t("voir_les_factur_82290")})})]})]}),(0,i.jsx)(mm,{columns:r,columnsSearch:[],eventId:null,filters:n.getFilters(),limit:l,loadDataList:qr,loadRow:Hr,name:s,organizationId:null,possibleColumns:n.getPossibleColumns(),predicates:c,rendering:Bh.List,setColumns:a,setLimit:d,setName:o,setPredicates:u,setSort:g,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showRowDropdown:!0,showRowEdit:!0,showSearchColumns:!1,sort:h,children:(0,i.jsx)(Am,{getEditPath:e=>$s.EDIT_BACKOFFICE_ORGANIZATION(e.id),renderCell:(e,t)=>(0,i.jsx)(Tm,{column:e,row:t}),renderRowDropdown:(e,t)=>(0,i.jsx)(zm,{organization:e,reload:t})})})]})})},Rm=pr("div",{margin:"auto",width:"$containerTablet","@desktop":{width:"$container"}}),$m=L.forwardRef((e,t)=>(0,i.jsx)(yr,{ref:t,css:{background:"$gray50",overflowX:"hidden",overflowY:"auto",py:"$10",...e.css},height:1,width:1,children:(0,i.jsx)(Rm,{children:e.children})}));$m.displayName="CenteredContainer";const Dm=pr("div",{display:"flex",flexDirection:"column",height:"100%",width:"100%",zIndex:"10","& .fsp-header":{px:"$7"},"& .fsp-category":{fontSize:"11px",fontWeight:"$semiBold",textTransform:"uppercase"},"& .fsp-title":{fontSize:"$textMd",fontWeight:"$semiBold"},variants:{color:{white:{"& .fsp-header":{background:"white",borderBottom:"1px solid $gray200"},"& .fsp-category":{color:"$gray600"},"& .fsp-title":{color:"$gray900"}},dark:{"& .fsp-header":{background:"$gray900"},"& .fsp-category":{color:"white"},"& .fsp-title":{color:"white"}}}},defaultVariants:{color:"white"}}),Pm=e=>{const t=Qn();return(0,i.jsxs)(Dm,{color:e.color,children:[(0,i.jsxs)(Na,{align:"center",className:"fsp-header",gap:"4",height:65,width:1,children:[(0,i.jsx)(yr,{css:{flexShrink:3},width:300}),(0,i.jsxs)(Na,{align:"center",css:{flex:"1"},direction:"column",children:[e.category&&(0,i.jsx)(yr,{className:"fsp-category",children:e.category}),(0,i.jsx)(yr,{className:"fsp-title",css:{maxWidth:"100%"},ellipsis:!0,children:e.heading})]}),(0,i.jsxs)(Na,{gap:"4",justify:"end",width:300,children:[e.button,(0,i.jsx)(El,{color:"dark"===e.color?"gray":"white",css:{flexShrink:0},leftIcon:"xmark",onClick:()=>{"function"==typeof e.onClose?e.onClose():t.goBack(e.fallbackClosePath||$s.HOME)}})]})]}),(0,i.jsx)(yr,{css:{height:"calc(100% - 65px)"},width:1,children:e.children})]})},Fm=e=>(0,i.jsx)(Na,{css:{background:"white",borderRadius:"$2",boxShadow:"$sm",padding:"$6 $7",...e.css},direction:"column",children:e.children}),Mm=L.memo(function(e){const t=Yn(),{descId:n,labelId:s}=Ga(),[o,r]=L.useState(e.initialIsOpen),a=L.useCallback(t=>{r(t),e.onToggle?.(t)},[e.onToggle,r]),l=e.descId??n,d=e.labelId??s;return(0,i.jsxs)(Na,{as:"fieldset",css:{background:"white",borderRadius:"$2",boxShadow:"$sm",border:"inherit",margin:"inherit",padding:"$6 $7",...e.css},direction:"column",children:[(0,i.jsxs)(Na,{align:"center","aria-describedby":l,"aria-labelledby":d,as:"legend",css:{float:"left",width:"100%",border:"none",padding:"none",...o&&!e.centerTitleAndSubtitle?{borderBottom:"1px solid $gray200",paddingBottom:"$5"}:{}},gap:"4",children:[(0,i.jsxs)(Na,{css:e.centerTitleAndSubtitle?{flex:"1",alignItems:"center",marginBottom:"var(--space32)"}:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textMd",fontWeight:"semiBold",id:d,children:e.heading}),m(e.subtitle)&&(0,i.jsx)(yr,{color:"gray500",dangerouslySetInnerHTML:{__html:e.subtitle},id:l})]}),!e.hideToggle&&(0,i.jsx)(yr,{children:(0,i.jsx)(bu,{label:t("toggle_section_92160"),size:"md",value:o,onChange:a})})]}),o&&(0,i.jsxs)(i.Fragment,{children:[!e.centerTitleAndSubtitle&&(0,i.jsx)(qa,{height:"5"}),e.children]})]})}),Nm=({name:e,children:t,...n})=>(0,i.jsx)(Ua.D0,{name:e,render:e=>{const s=!0===e.input.checked?"checked":"unchecked";return(0,i.jsx)(gc,{...n,state:s,onClick:()=>{e.input.onChange(!e.input.checked)},children:t})},type:"checkbox"}),Lm=(0,L.memo)(function({name:e,hint:t,state:n,...s}){return(0,i.jsx)(Ua.D0,{name:e,render:({input:o,meta:r})=>{const a=r.data?.forceDisplayError&&r.invalid||r.touched&&r.invalid;return(0,i.jsx)(Du,{hint:a?r.error:t,name:e,state:a?"error":n,value:o.value,onBlur:o.onBlur,onChange:o.onChange,onFocus:o.onFocus,...s})}})}),Bm=({value:e,onChange:t,...n})=>{const[s,o]=(0,L.useState)(e?.toString()??""),[r,a]=(0,L.useState)(e);return r!==e&&(o(e?.toString()??""),a(e)),(0,i.jsx)(Nl,{value:s,onChange:e=>{const n=parseFloat(e);o(e),a(isNaN(n)?null:n),t(isNaN(n)?null:n)},...n})},Vm=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ua.D0,{name:e,render:o=>{const r=Ol(o.meta);return(0,i.jsx)(Bm,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),Um=({name:e,hint:t,state:n,multiple:s,...o})=>(0,i.jsx)(Ua.D0,{name:e,render:r=>{const a=Ol(r.meta);return(0,i.jsx)(bc,{hint:a?r.meta.error:t,multiple:s,name:e,state:a?"error":n,values:s?Array.isArray(r.input.value)?r.input.value:[]:"number"==typeof r.input.value||m(r.input.value)?[r.input.value]:[],onChange:e=>{s?r.input.onChange(e):no(e)?r.input.onChange(e[0]):r.input.onChange(null)},...o})}}),Wm=({css:e,label:t,description:n,state:s,icon:o,hint:r,rightIcon:a,rightText:l,onChange:d,value:c,...u})=>{const{inputId:h,descId:m,errorId:g}=Ga();return(0,i.jsxs)(Na,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Pl,{htmlFor:h,children:t}),(0,i.jsx)($l,{id:m,children:n}),(t||n)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Ml,{cursor:"text",height:"fluid",icon:o,rightIcon:a,rightText:l,state:s,children:(0,i.jsxs)(cd,{css:{flex:"1",minHeight:"100px",py:"$3","& .replicated-text":{whiteSpace:"pre-wrap",visibility:"hidden"},"& textarea":{outline:"none",overflow:"hidden",resize:"none"},"& .replicated-text, & textarea":{background:"transparent",border:"none",gridArea:"1 / 1 / 2 / 2",width:"100%"},"& textarea::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder":{color:"$gray500",opacity:1}},children:[(0,i.jsx)("textarea",{"aria-describedby":n?m:void 0,"aria-errormessage":"error"===s?g:void 0,"aria-invalid":"error"===s,disabled:"disabled"===s,id:h,value:c,onChange:e=>{d(e.target.value)},...u}),(0,i.jsxs)(yr,{className:"replicated-text",children:[c," "]})]})}),(0,i.jsx)(Dl,{id:g,state:s,children:r})]})},Gm=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ua.D0,{name:e,render:o=>{const r=Ol(o.meta);return(0,i.jsx)(Wm,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),Hm=e=>(0,i.jsx)(Ua.D0,{name:e.name,render:t=>(0,i.jsx)(ju,{disabled:e.disabled,size:e.size,subtext:e.subtext,value:t.input.value,onChange:t.input.onChange,children:e.children})}),qm=d.gl(e=>e&&Us.c9.fromISO(e).isValid);let Ym=class extends Ul{constructor(e){super(e)}organizationInputDefault(e){return{name:e.name,features:e.features,customBadges:e.customBadges,periodEndAt:e.periodEndAt,usersIds:e.users.map(({id:e})=>e),isBlocked:e.isBlocked,weezeventOrganizationId:e.weezeventOrganizationId,useOldBilling:e.useOldBilling,membersLimit:e.membersLimit,pricePerMember:e.pricePerMember,billingComment:e.billingComment}}organizationInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_org_60618")),periodEndAt:qm.required(this.t("la_date_de_fin_04076")).typeError(this.t("la_date_de_fin_04076")),features:d.YO().of(d.Yj().oneOf(cn,this.t("les_fonctionnal_36778"))),usersIds:d.YO().of(d.ai()),isBlocked:d.zM().required()})}updateOrganizationSchema(){return d.Ik().shape({organization:this.organizationInputSchema()})}};Ym=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Ym);const Km=pr("span",{variants:{color:{inherit:{color:"inherit"},cyan:{color:"$cyan"},gray25:{color:"$gray25"},gray50:{color:"$gray50"},gray100:{color:"$gray100"},gray200:{color:"$gray200"},gray300:{color:"$gray300"},gray400:{color:"$gray400"},gray500:{color:"$gray500"},gray600:{color:"$gray600"},gray700:{color:"$gray700"},gray800:{color:"$gray800"},gray900:{color:"$gray900"},primary25:{color:"$primary25"},primary50:{color:"$primary50"},primary100:{color:"$primary100"},primary200:{color:"$primary200"},primary300:{color:"$primary300"},primary400:{color:"$primary400"},primary500:{color:"$primary500"},primary600:{color:"$primary600"},primary700:{color:"$primary700"},primary800:{color:"$primary800"},primary900:{color:"$primary900"},error25:{color:"$error25"},error50:{color:"$error50"},error100:{color:"$error100"},error200:{color:"$error200"},error300:{color:"$error300"},error400:{color:"$error400"},error500:{color:"$error500"},error600:{color:"$error600"},error700:{color:"$error700"},error800:{color:"$error800"},error900:{color:"$error900"},warning25:{color:"$warning25"},warning50:{color:"$warning50"},warning100:{color:"$warning100"},warning200:{color:"$warning200"},warning300:{color:"$warning300"},warning400:{color:"$warning400"},warning500:{color:"$warning500"},warning600:{color:"$warning600"},warning700:{color:"$warning700"},warning800:{color:"$warning800"},warning900:{color:"$warning900"},success25:{color:"$success25"},success50:{color:"$success50"},success100:{color:"$success100"},success200:{color:"$success200"},success300:{color:"$success300"},success400:{color:"$success400"},success500:{color:"$success500"},success600:{color:"$success600"},success700:{color:"$success700"},success800:{color:"$success800"},success900:{color:"$success900"},blue25:{color:"$blue25"},blue50:{color:"$blue50"},blue100:{color:"$blue100"},blue200:{color:"$blue200"},blue300:{color:"$blue300"},blue400:{color:"$blue400"},blue500:{color:"$blue500"},blue600:{color:"$blue600"},blue700:{color:"$blue700"},blue800:{color:"$blue800"},blue900:{color:"$blue900"},blueGray25:{color:"$blueGray25"},blueGray50:{color:"$blueGray50"},blueGray100:{color:"$blueGray100"},blueGray200:{color:"$blueGray200"},blueGray300:{color:"$blueGray300"},blueGray400:{color:"$blueGray400"},blueGray500:{color:"$blueGray500"},blueGray600:{color:"$blueGray600"},blueGray700:{color:"$blueGray700"},blueGray800:{color:"$blueGray800"},blueGray900:{color:"$blueGray900"},blueLight100:{color:"$blueLight100"},blueLight400:{color:"$blueLight400"},blueLight600:{color:"$blueLight600"},blueLight900:{color:"$blueLight900"},purple25:{color:"$purple25"},purple50:{color:"$purple50"},purple100:{color:"$purple100"},purple200:{color:"$purple200"},purple300:{color:"$purple300"},purple400:{color:"$purple400"},purple500:{color:"$purple500"},purple600:{color:"$purple600"},purple700:{color:"$purple700"},purple800:{color:"$purple800"},purple900:{color:"$purple900"},pink25:{color:"$pink25"},pink50:{color:"$pink50"},pink100:{color:"$pink100"},pink200:{color:"$pink200"},pink300:{color:"$pink300"},pink400:{color:"$pink400"},pink500:{color:"$pink500"},pink600:{color:"$pink600"},pink700:{color:"$pink700"},pink800:{color:"$pink800"},pink900:{color:"$pink900"},orange100:{color:"$orange100"},orange400:{color:"$orange400"},orange600:{color:"$orange600"},orange700:{color:"$orange700"},indigo100:{color:"$indigo100"},indigo600:{color:"$indigo600"},white:{color:"white"}},fontSize:{inherit:{fontSize:"inherit"},textXs:{fontSize:"$textXs"},textSm:{fontSize:"$textSm"},textMd:{fontSize:"$textMd"},textLg:{fontSize:"$textLg"},textXl:{fontSize:"$textXl"},displayXs:{fontSize:"$displayXs"},displaySm:{fontSize:"$displaySm"},displayMd:{fontSize:"$displayMd"},displayLg:{fontSize:"$displayLg"},displayXl:{fontSize:"$displayXl"},display2Xl:{fontSize:"$display2Xl"}},fontWeight:{inherit:{fontWeight:"inherit"},regular:{fontWeight:"$regular"},medium:{fontWeight:"$medium"},semiBold:{fontWeight:"$semiBold"},bold:{fontWeight:"$bold"}}},defaultVariants:{color:"inherit",fontSize:"inherit",fontWeight:"inherit"}}),Zm=L.forwardRef((e,t)=>(0,i.jsx)(Km,{...(0,dr.A)(e,"font"),...cr(e.font),ref:t,css:e.css}));Zm.displayName="Span";const Xm=1123,Jm=794,Qm=561,eg=397,tg=397,ng=280,ig=325,sg=204,og={A4:{height:"297mm",width:"210mm"},A5:{height:"210mm",width:"148mm"},A6:{height:"148mm",width:"105mm"}},rg=(e,t)=>{t?.startsWith("/")||(console.warn(`Path '${t}' missing leading slash`),t="/"+t);const n=new I(P.HEAVENT_PUBLIC_URL);return $d.has(e)&&(n.host=$d.get(e)),n.pathname+=t,n.href},ag=({organizationId:e,eventId:t,delegationId:n,formId:i,teamCode:s,query:o})=>{const r=new I(P.HEAVENT_PUBLIC_URL);return $d.has(e)&&(r.host=$d.get(e)),r.pathname+=`${(()=>{if(n)return"number"==typeof t?ds.DELEGATION_FORM({organizationId:e,delegationId:n,eventId:t,formId:i}):ds.DELEGATION_FORM({organizationId:e,delegationId:n,formId:i});{const n="number"==typeof t?Ui.EVENT_FORM({organizationId:e,eventId:t,formId:i}):bi.ORGANIZATION_FORM({organizationId:e,formId:i});return m(s)?`${n}/team/${s}`:n}})()}`,o?.preview&&r.searchParams.set("preview",o?.preview?.toString()),o?.previewState&&r.searchParams.set("state",o?.previewState?.toString()),r.href};var lg;!function(e){e.QR="qr",e.Code39="code39"}(lg||(lg={}));const dg=(e,t)=>{const n=new I(P.HEAVENT_API_URL);return n.pathname+=`/barcode/${t?.barcodeType??lg.QR}`,n.searchParams.set("text",e),n.searchParams.set("color",t?.color??"000000"),t?.height&&n.searchParams.set("height",t?.height?.toString()),t?.width&&n.searchParams.set("width",t?.width?.toString()),n.href},cg=({organizationId:e,eventId:t,lang:n,pathComponent:i,key:s})=>{const o=new I(P.HEAVENT_API_URL);return o.pathname+=t?`/export/organization/${e}/event/${t}/${i}`:`/export/organization/${e}/${i}`,o.searchParams.set("key",s),m(n)&&o.searchParams.set("lang",n),o.href};function ug(e,t,n={}){const i=new I(P.HEAVENT_API_URL);i.pathname+=`/documents/${e}.${t}`;const s=new URLSearchParams(Object.entries(n).filter(([e,t])=>m(t)));for(const[e,t]of s)i.searchParams.set(e,t);return i.href}function hg(e,t){return new I(`https://admin.${P.WEEZEVENT_DOMAIN}`,void 0,void 0,`access/O${e}/checkpoints/edit/${t}`).href}const mg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=(0,lc.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/animaje/convention-page1.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsxs)(yr,{css:{fontSize:"24px",fontWeight:"700",left:"72px",position:"absolute",textTransform:"uppercase",top:"334px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsx)(yr,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"364px"},children:n.fields?.phone?.internationalFormat||""}),(0,i.jsx)(yr,{css:{left:"650px",position:"absolute",top:"322px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Na,{css:{left:"72px",position:"absolute",top:"558px"},direction:"column",gap:"1",children:s.map((e,t)=>(0,i.jsxs)(yr,{css:{fontSize:"12px",fontWeight:"500"},children:[(0,i.jsxs)(Zm,{css:{fontWeight:"700",textTransform:"capitalize"},children:[e.positionSlot.range.start.toFormat("cccc dd MMMM 'de' HH'h'mm",{locale:"fr"})," ","à ",e.positionSlot.range.end.toFormat("HH'h'mm")]})," ",": ",e.position.name]},t))})]}),(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/animaje/convention-page2.jpg) no-repeat`,backgroundSize:"cover",color:"#040f29",fontFamily:"$neufileGrotesk",pageBreakBefore:"always",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsxs)(yr,{css:{fontSize:"24px",fontWeight:"700",left:"72px",position:"absolute",textTransform:"uppercase",top:"222px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsx)(yr,{css:{fontSize:"14px",fontWeight:"500",left:"72px",position:"absolute",textTransform:"uppercase",top:"252px"},children:n.fields?.phone?.internationalFormat||""}),(0,i.jsx)(yr,{css:{left:"650px",position:"absolute",top:"210px"},height:72,width:72,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsxs)(yr,{css:{fontSize:"12px",fontWeight:"700",left:"178px",position:"absolute",top:"455px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsxs)(yr,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"537px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]}),(0,i.jsxs)(yr,{css:{fontSize:"12px",fontWeight:"700",left:"72px",position:"absolute",top:"617px"},children:[n.fields?.firstName?.value||""," ",n.fields?.lastName?.value||""]})]})]})};function gg(e,t,n){return e.filter(e=>{if(t?.isValid&&n?.isValid){const i=Us.IX.fromDateTimes(t.startOf("day"),n.endOf("day"));return e.positionSlot.range.overlaps(i)}return!t?.isValid||e.positionSlot.range.start.startOf("day").equals(t.startOf("day"))})}function pg(e,t){const n=Object.fromEntries(Object.values((0,ac.A)(t,e=>e.positionSlot.range.start.startOf("day").toMillis())).map(e=>[`positions.${e[0].positionSlot.range.start.toFormat("yyyyMMdd")}`,(0,lc.A)((0,Ns.A)(e.map(e=>e.position.name))).join("
")]));return{assignmentsDays:(0,ph.A)((t||[]).map(({positionSlot:e})=>e.range.start),e=>e.startOf("day").toMillis()).map(t=>e.toLocaleString(t,Js.DateOnly.WeekdayLongMonthLong)).join(", "),positionsCategories:(0,lc.A)((0,Ns.A)((t||[]).map(e=>e.position.category.name))).join(", "),positions:(0,lc.A)((0,Ns.A)((t||[]).map(e=>e.position.name))).join(", "),...n}}function fg(e){return{[`${e} p.h-small`]:{fontSize:"12px"},[`${e} h2`]:{fontSize:"20px",fontWeight:"$semiBold"},[`${e} h3`]:{fontSize:"18px",fontWeight:"$semiBold"},[`${e} h4`]:{fontSize:"16px",fontWeight:"$semiBold"},[`${e} a`]:{color:"$primary700"},[`${e} blockquote`]:{borderLeft:"3px solid $gray200",fontStyle:"italic",marginLeft:0,marginRight:0,px:"$4","& p":{margin:0,paddingBottom:"$2",paddingTop:"$2"}}}}const xg=e=>(0,i.jsx)(yr,{className:"h-rich-text",css:{...fg("&"),"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0},"& figure":{margin:"auto","& img":{width:"100%"}},...e.css},dangerouslySetInnerHTML:{__html:e.text},width:1,onClick:e=>{const t=e.target;if(t){const n=t.closest("a");n&&(e.preventDefault(),window.open(n.getAttribute("href"),"_blank"))}}});function _g(e,t){return`https://www.google.com/maps/place/${e},${t}`}const Ig=4427,vg=4848,bg=e=>e===Ig?{color:"#ff5501"}:e===vg?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},jg=e=>e===Ig?{color:"white"}:e===vg?{color:"#005a41"}:-1===e?{color:"#1e4850"}:{},Cg=e=>{const t=e.psuis[0].position,n=(0,lc.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),s=t.leaders[0];return(0,i.jsxs)(Na,{css:{background:`url(${o=e.eventId,o===Ig?`${P.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/semi.jpg`:o===vg?`${P.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/marathon.jpg`:-1===o?`${P.HEAVENT_ASSETS_URL}/badges/aso/2025_v4/10k.jpg`:""}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{fontSize:"24px",left:"298px",position:"absolute",top:"101px",...jg(e.eventId)},textAlign:"center",width:409,children:e.userInfo.name}),(0,i.jsx)(yr,{css:{fontSize:"12px",left:"46px",position:"absolute",top:"374px"},children:m(e.options.habits)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{css:{...jg(e.eventId),"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(xg,{text:e.options.habits})})})}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{color:"#005a41",left:"46px",position:"absolute",top:"581px",...jg(e.eventId)},textAlign:"center",width:150,children:s.userInfo.name}),(0,i.jsx)(yr,{css:{left:"46px",position:"absolute",top:"602px",...jg(e.eventId)},textAlign:"center",width:150,children:s.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Na,{css:{left:"228px",position:"absolute",padding:"32px",top:"167px"},direction:"column",width:550,children:[(0,i.jsx)(yr,{css:{fontSize:"28px",fontWeight:"700",...bg(e.eventId)},textAlign:"center",children:t.name}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{css:{fontWeight:"700",textTransform:"uppercase",...bg(e.eventId)},children:"Date et heure de la mission"}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Na,{css:{fontSize:"12px"},direction:"column",gap:"1",children:n.map((e,t)=>{const n=e.range.start;return(0,i.jsxs)(yr,{children:[n.toFormat("cccc dd MMMM yyyy",{locale:"fr"})," à"," ",n.toFormat("H'h'mm",{locale:"fr"})]},t)})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{css:{fontWeight:"700",textTransform:"uppercase",...bg(e.eventId)},children:"Détail de la mission"}),(0,i.jsx)(qa,{height:"1"}),m(t.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{css:{color:"black",fontSize:"12px","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(xg,{text:t.description})})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{css:{fontWeight:"700",textTransform:"uppercase",...bg(e.eventId)},children:"Lieu de rendez-vous"}),(0,i.jsx)(qa,{height:"1"}),Sh(t)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{fontSize:"12px"},children:t.address}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsxs)(Na,{gap:"3",width:1,children:[(0,i.jsx)(yr,{height:180,width:1,children:(0,i.jsx)("a",{href:_g(t.latitude,t.longitude),style:{background:`url(${P.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),m(t.fields?.cf45815?.url)&&(0,i.jsx)(yr,{css:{background:`url(${t.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]}),m(t.fields.cf44423)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{css:{fontWeight:"700",textTransform:"uppercase",...bg(e.eventId)},children:"Ton kit bénévole"}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{css:{fontSize:"12px"},dangerouslySetInnerHTML:{__html:t.fields.cf44423.replace(/\n/g,"
")}})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{css:{fontWeight:"700",textTransform:"uppercase",...bg(e.eventId)},children:"Un imprévu ?"}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{css:{fontSize:"12px"},children:"Pour des raisons pratiques, il ne sera pas possible de procéder à des changements d’affectation sur le terrain. Merci de bien vouloir nous informer en cas d’indisponibilité le plus rapidement possible, afin de ne pas pénaliser le bon déroulement de l’épreuve"})]})]});var o},yg=[120785,134101],kg=e=>{const t=gg(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>!yg.includes(e.id)),n=(0,lc.A)(Object.entries((0,ac.A)(t,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:n.map(([t,n],s)=>(0,i.jsx)(Cg,{eventId:e.event.id,options:e.options,psuis:n,userInfo:e.event.volunteerRegistration.userInfo},s))})};function Ag(e={}){const t=x(e.firstName||"").trim();return`${x(e.lastName||"").trim().toUpperCase()} ${t}`.trim()}function wg(e,t,n=null){return e?.[t]?.value||n}const Sg=(e,t)=>e.split(t).map(e=>e.trim().length>0?e.trim()[0]:"").join("").substring(0,3);function Eg(e,t){if(m(e))return Sg(e," ");if(m(t)){const[e]=t.split("@");return Sg(e,".")}return""}const Tg=[fr.colors.success600.value,fr.colors.blueGray600.value,fr.colors.blueLight600.value,fr.colors.purple600.value,fr.colors.pink600.value,fr.colors.warning600.value];function zg(e){const t=e.charCodeAt(0);return Tg[t%Tg.length]}const Og=({children:e})=>(0,i.jsx)(Na,{align:"center",css:{background:"#14243f",borderRadius:"5px 5px 0px 0px",color:"white",flex:"1",fontWeight:"600",padding:"10px"},justify:"center",children:e}),Rg=({children:e})=>(0,i.jsx)(Na,{align:"center",css:{background:"white",border:"1px solid $gray200",color:"#142440",flex:"1",fontWeight:"600",padding:"10px"},justify:"center",children:e}),$g=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.positionsSlotsUsersInfos.flatMap(e=>e.position.leaders)?.[0],o=(0,lc.A)(t.positionsSlotsUsersInfos.filter(e=>23066===e.position.category.id),e=>e.positionSlot.range.start.toMillis()),r=(0,lc.A)(t.positionsSlotsUsersInfos.filter(e=>23113===e.position.category.id),e=>e.positionSlot.range.start.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_livraison_masque.png) no-repeat`,backgroundSize:"cover",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{fontSize:"20px",fontWeight:"700",left:"32px",position:"absolute",textTransform:"uppercase",top:"193px"},children:wg(n.fields,"cf42835","salut")}),(0,i.jsxs)(yr,{css:{color:"#000dbd",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"225px"},children:[n.name," - ",n.fields?.phone?.internationalFormat]}),(0,i.jsxs)(yr,{css:{color:"#000dbd",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"251px"},children:[s?.userInfo.name," - ",s?.userInfo.phone?.internationalFormat]}),(0,i.jsx)(yr,{css:{position:"absolute",right:"32px",top:"188px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsxs)(Na,{css:{position:"absolute",px:"32px",top:"411px"},direction:"column",width:1,children:[(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(Na,{gap:"1",width:1,children:[(0,i.jsx)(Og,{children:"DATE"}),(0,i.jsx)(Og,{children:"HORAIRE"}),(0,i.jsx)(Og,{children:"TYPE"}),(0,i.jsx)(Og,{children:"N° IMMAT"})]}),o.map((e,t)=>(0,i.jsxs)(Na,{gap:"1",width:1,children:[(0,i.jsx)(Rg,{children:e.positionSlot.range.start.toFormat("dd/MM/yyyy")}),(0,i.jsx)(Rg,{children:e.positionSlot.range.start.toFormat("HH:mm")}),(0,i.jsx)(Rg,{children:wg(n.fields,"cf42931","")}),(0,i.jsx)(Rg,{children:wg(n.fields,"cf42974","")})]},t))]}),no(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(yr,{css:{fontSize:"22px",fontWeight:"700"},children:"Reprise"}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsxs)(Na,{gap:"1",width:1,children:[(0,i.jsx)(Og,{children:"DATE"}),(0,i.jsx)(Og,{children:"HORAIRE"}),(0,i.jsx)(Og,{children:"TYPE"}),(0,i.jsx)(Og,{children:"N° IMMAT"})]}),r.map((e,t)=>(0,i.jsxs)(Na,{gap:"1",width:1,children:[(0,i.jsx)(Rg,{children:e.positionSlot.range.start.toFormat("dd/MM/yyyy")}),(0,i.jsx)(Rg,{children:e.positionSlot.range.start.toFormat("HH:mm")}),(0,i.jsx)(Rg,{children:wg(n.fields,"cf42931","")}),(0,i.jsx)(Rg,{children:wg(n.fields,"cf42974","")})]},t))]})]})]})]}),(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_livraison_masque_1.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Xm,width:Jm})]})},Dg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.delegation,o=(0,lc.A)((0,ph.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/op_com_1.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{fontFamily:"$kabel",fontSize:"20px",fontWeight:"700",left:"46px",position:"absolute",textTransform:"uppercase",top:"306px",width:"582px"},children:n.name}),(0,i.jsxs)(yr,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"46px",position:"absolute",top:"338px",width:"582px"},children:["Nom du responsable : ",s?.leaders?.[0]?.name," ",s?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(yr,{css:{left:"658px",position:"absolute",top:"288px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Na,{css:{gap:"6px",left:"46px",position:"absolute",top:"641px"},children:o.map((e,t)=>(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(yr,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(yr,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/op_com_2.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Xm,width:Jm}),(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/op_com_3.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Xm,width:Jm})]})},Pg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.delegation,o=(0,lc.A)((0,ph.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_1.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{fontFamily:"$kabel",fontSize:"20px",fontWeight:"700",left:"46px",position:"absolute",textTransform:"uppercase",top:"306px",width:"582px"},children:n.name}),(0,i.jsxs)(yr,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"46px",position:"absolute",top:"338px",width:"582px"},children:["Nom du responsable : ",s?.leaders?.[0]?.name," ",s?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(yr,{css:{left:"658px",position:"absolute",top:"288px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Na,{css:{gap:"6px",left:"46px",position:"absolute",top:"641px"},children:o.map((e,t)=>(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(yr,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(yr,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_2.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Xm,width:Jm}),(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fdr_press_et_partenaire_3.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Xm,width:Jm})]})},Fg=e=>"Staff"===e?`${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff.png`:`${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Visiteur.png`,Mg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=wg(n.fields,"population",""),o=t.delegation,r=(0,lc.A)((0,ph.A)(n.formsUsersInfos.flatMap(e=>e.slots.map(e=>e.range.start.startOf("day"))),e=>e.toMillis()),e=>e.toMillis()),a=(0,lc.A)((0,ph.A)(t.accreditationsUsersInfos.flatMap(e=>2826===e.accreditationCategory.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot.date]:[]),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${Fg(s)}) no-repeat`,backgroundSize:"cover",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{fontSize:"20px",fontWeight:"700",left:"32px",position:"absolute",textTransform:"uppercase",top:"206px"},children:n.name}),(0,i.jsxs)(yr,{css:{color:"#1e3159",fontSize:"17px",fontWeight:"600",left:"32px",position:"absolute",top:"238px"},children:["Nom du responsable : ",o?.leaders?.[0]?.name," ",o?.leaders?.[0]?.phone?.internationalFormat]}),(0,i.jsx)(yr,{css:{position:"absolute",right:"32px",top:"188px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Na,{css:{gap:"6px",left:"32px",position:"absolute",top:"Staff"===s?"461px":"452px"},children:r.map((e,t)=>(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(yr,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(yr,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))}),no(a)&&(0,i.jsx)(yr,{css:{fontSize:"22px",fontWeight:"800",left:"32px",position:"absolute",textTransform:"uppercase",top:"Staff"===s?"530px":"521px"},children:"Catering"}),(0,i.jsx)(Na,{css:{gap:"6px",left:"32px",position:"absolute",top:"Staff"===s?"562px":"553px"},children:a.map((e,t)=>(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid black",borderRadius:"$1",fontFamily:"$montserrat",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(yr,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(yr,{css:{fontSize:"10px",fontWeight:"500"},children:e.toFormat("MMM",{locale:"fr"})})]},t))})]}),"Staff"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff-01.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Xm,width:Jm}),(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Staff-02.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Xm,width:Jm})]}),"Visiteur"===s&&(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/cercle/fiche_missions_Visiteur_2.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Xm,width:Jm})]})},Ng=e=>e.includes("Régisseur")||e.includes("Team Delta")||e.includes("Warrior Chauffeur")?`${P.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_tech_verso.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_qr_verso.jpg`,Lg=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=qn(Kc),o=(0,L.useMemo)(()=>{const t=e.event.volunteerRegistration.positionsSlotsUsersInfos;return(0,lc.A)(Object.entries((0,ac.A)(t,e=>e.positionSlot.range.start.startOf("day").toMillis())),([e])=>e).map(([e,t])=>[s.toLocaleString(t[0].positionSlot.range.start,Js.DateOnly.WeekdayLongMonthLong),t])},[e.event]),r=n.fields?.cf1666?.value;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${a=r,a.includes("Régisseur")||a.includes("Team Delta")||a.includes("Warrior Chauffeur")?`${P.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_tech_recto.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/delta/2024/delta_qg_recto.jpg`}) no-repeat`,backgroundSize:"contain",color:"black",pageBreakBefore:"always",position:"relative"},direction:"column",height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{borderRadius:"100px",left:"60px",overflow:"hidden",position:"absolute",top:"286px"},height:100,width:100,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(yr,{css:{fontSize:"24px",fontWeight:"700",left:"177px",position:"absolute",top:"289px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"24px",fontWeight:"700",left:"177px",position:"absolute",top:"322px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"18px",left:"177px",position:"absolute",top:"359px"},children:r}),(0,i.jsxs)(Na,{align:"center",css:{position:"absolute",right:"71px",top:"282px"},direction:"column",gap:"2",children:[(0,i.jsx)(yr,{height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(yr,{css:{fontSize:"10px"},children:t.ticketId})]})]}),(0,i.jsx)(Na,{css:{background:`url(${Ng(r)}) no-repeat`,backgroundSize:"contain",color:"black",pageBreakBefore:"always",position:"relative"},direction:"column",height:Xm,width:Jm,children:(0,i.jsx)(Na,{css:{left:"76px",position:"absolute",top:"328px"},direction:"column",gap:"6",children:o.map(([e,t],n)=>(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{css:{fontSize:"18px",fontWeight:"700",textTransform:"uppercase"},children:e}),(0,i.jsx)(Na,{direction:"column",children:t.map((e,t)=>(0,i.jsxs)(yr,{css:{fontSize:"16px"},children:[e.position.name," /"," ",e.positionSlot.range.toFormat("HH:mm",{separator:"-"})]},t))})]},n))})})]});var a},Bg=({css:e,children:t})=>(0,i.jsx)(Na,{css:{alignItems:"center",border:"1px solid",flexDirection:"column",fontSize:"24px",fontWeight:700,height:"42px",justifyContent:"center",lineHeight:"24px",padding:"2px 0px",position:"absolute",width:"110px",...e},children:t}),Vg=({css:e,children:t})=>(0,i.jsx)(yr,{css:{fontSize:"14px",fontWeight:600,lineHeight:"14px",...e},children:t}),Ug=["P0","P1","P1 Aire Régie","P2","P3","P4","ZONE 1 - PELOUSE","ZONE 2 - VESTIAIRES","ZONE 3 - TRIBUNES","ZONE 4 - MEDIAS","ZONE 5 - AIRE REGIE TV","ZONE 6 - HOSPITALITES","ZONE 7 - SERVICES","ZONE 8 - BORD TERRAIN","ZONE 9 - PRESIDENTIELLE","H-30","PC"],Wg=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=`${n.fields?.firstName?.value||""} ${(n.fields?.lastName?.value||"").toUpperCase()}`,o=t.accreditationsUsersInfos.reduce((e,t)=>Ug.includes(t.accreditation.name)?{...e,[t.accreditation.name]:t.accreditation.color}:e,{}),r=t.ticketId;return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/dfco/accred-a4.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$default",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{left:"423px",position:"absolute",top:"145px"},height:91,width:91,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(yr,{css:{left:"530px",fontWeight:600,lineHeight:"normal",position:"absolute",top:"151px"},children:s}),(0,i.jsx)(yr,{css:{left:"530px",fontWeight:700,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"176px"},children:n.fields.cf36682?.value||""}),o.P0&&(0,i.jsx)(Bg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(yr,{children:"P0"})}),o.P1&&(0,i.jsx)(Bg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(yr,{children:"P1"})}),o["P1 Aire Régie"]&&(0,i.jsx)(Bg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(yr,{children:"P1 A-R"})}),o.P2&&(0,i.jsx)(Bg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(yr,{children:"P2"})}),o.P3&&(0,i.jsx)(Bg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(yr,{children:"P3"})}),o.P4&&(0,i.jsx)(Bg,{css:{left:"421px",top:"280px"},children:(0,i.jsx)(yr,{children:"P4"})}),o["H-30"]&&(0,i.jsx)(yr,{css:{backgroundColor:o["H-30"],color:"#FFF",fontWeight:600,left:"698px",lineHeight:"14px",padding:"2px 4px",position:"absolute",textAlign:"center",top:"307px"},children:"H-30"}),o.PC&&(0,i.jsx)(yr,{css:{backgroundColor:o.PC,color:"#FFF",fontWeight:600,left:"746px",lineHeight:"14px",padding:"2px 4px",position:"absolute",textAlign:"center",top:"307px"},children:"PC"}),o["ZONE 1 - PELOUSE"]&&(0,i.jsxs)(Bg,{css:{backgroundColor:o["ZONE 1 - PELOUSE"],left:"421px",top:"337px"},children:[(0,i.jsx)(yr,{children:"1"}),(0,i.jsx)(Vg,{children:"PELOUSE"})]}),o["ZONE 2 - VESTIAIRES"]&&(0,i.jsxs)(Bg,{css:{backgroundColor:o["ZONE 2 - VESTIAIRES"],left:"541px",top:"337px"},children:[(0,i.jsx)(yr,{children:"2"}),(0,i.jsx)(Vg,{children:"VESTIAIRE"})]}),o["ZONE 3 - TRIBUNES"]&&(0,i.jsxs)(Bg,{css:{backgroundColor:o["ZONE 3 - TRIBUNES"],left:"661px",top:"337px"},children:[(0,i.jsx)(yr,{children:"3"}),(0,i.jsx)(Vg,{children:"TRIBUNES"})]}),o["ZONE 4 - MEDIAS"]&&(0,i.jsxs)(Bg,{css:{backgroundColor:o["ZONE 4 - MEDIAS"],left:"421px",top:"387px"},children:[(0,i.jsx)(yr,{children:"4"}),(0,i.jsx)(Vg,{children:"MEDIAS"})]}),o["ZONE 5 - AIRE REGIE TV"]&&(0,i.jsxs)(Bg,{css:{backgroundColor:o["ZONE 5 - AIRE REGIE TV"],left:"541px",top:"387px"},children:[(0,i.jsx)(yr,{children:"5"}),(0,i.jsx)(Vg,{children:"AIRE REGIE TV"})]}),o["ZONE 6 - HOSPITALITES"]&&(0,i.jsxs)(Bg,{css:{backgroundColor:o["ZONE 6 - HOSPITALITES"],left:"661px",top:"387px"},children:[(0,i.jsx)(yr,{children:"6"}),(0,i.jsx)(Vg,{children:"HOSPITALITÉS"})]}),o["ZONE 7 - SERVICES"]&&(0,i.jsxs)(Bg,{css:{backgroundColor:o["ZONE 7 - SERVICES"],left:"421px",top:"437px"},children:[(0,i.jsx)(yr,{children:"7"}),(0,i.jsx)(Vg,{children:"SERVICES"})]}),o["ZONE 8 - BORD TERRAIN"]&&(0,i.jsxs)(Bg,{css:{backgroundColor:o["ZONE 8 - BORD TERRAIN"],left:"541px",top:"437px"},children:[(0,i.jsx)(yr,{children:"8"}),(0,i.jsx)(Vg,{children:"BORD TERRAIN"})]}),o["ZONE 9 - PRESIDENTIELLE"]&&(0,i.jsxs)(Bg,{css:{backgroundColor:o["ZONE 9 - PRESIDENTIELLE"],left:"661px",top:"437px"},children:[(0,i.jsx)(yr,{children:"9"}),(0,i.jsx)(Vg,{children:"PRESIDENTIELLE"})]}),(0,i.jsxs)(Na,{css:{alignItems:"center",flexDirection:"column",gap:"4px",left:"478px",position:"absolute",top:"489px",width:"234px"},children:[(0,i.jsx)(yr,{height:28,width:1,children:(0,i.jsx)("img",{height:"100%",src:dg(r,{barcodeType:lg.Code39,height:28,width:234}),width:"100%"})}),(0,i.jsx)(yr,{css:{fontSize:"10px"},children:r})]})]})},Gg=({css:e,children:t})=>(0,i.jsx)(Na,{css:{alignItems:"center",border:"1px solid",flexDirection:"column",fontSize:"14px",fontWeight:700,height:"18px",justifyContent:"center",lineHeight:"14px",padding:"2px 0px",position:"absolute",width:"22px",...e},children:t}),Hg=["ZONE 1 - PELOUSE","ZONE 2 - VESTIAIRES","ZONE 3 - TRIBUNES","ZONE 4 - MEDIAS","ZONE 5 - AIRE REGIE TV","ZONE 6 - HOSPITALITES","ZONE 7 - SERVICES","ZONE 8 - BORD TERRAIN","ZONE 9 - PRESIDENTIELLE"],qg=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.reduce((e,t)=>Hg.includes(t.accreditation.name)?{...e,[t.accreditation.name]:t.accreditation.color}:e,{}),o=t.ticketId;return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/dfco/accred-badge.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$default",position:"relative"},height:204,width:643,children:[(0,i.jsx)(yr,{css:{left:"400px",position:"absolute",top:"39px"},height:87,width:87,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(yr,{css:{left:"497px",fontSize:"10px",fontWeight:600,lineHeight:"normal",position:"absolute",top:"59px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{left:"497px",fontSize:"10px",fontWeight:600,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"73px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(yr,{css:{left:"497px",fontSize:"10px",fontWeight:700,lineHeight:"normal",position:"absolute",textTransform:"uppercase",top:"88px"},children:n.fields.cf36682?.value||""}),s["ZONE 1 - PELOUSE"]&&(0,i.jsx)(Gg,{css:{backgroundColor:s["ZONE 1 - PELOUSE"],left:"363px",top:"174px"},children:(0,i.jsx)(yr,{children:"1"})}),s["ZONE 2 - VESTIAIRES"]&&(0,i.jsx)(Gg,{css:{backgroundColor:s["ZONE 2 - VESTIAIRES"],left:"391px",top:"174px"},children:(0,i.jsx)(yr,{children:"2"})}),s["ZONE 3 - TRIBUNES"]&&(0,i.jsx)(Gg,{css:{backgroundColor:s["ZONE 3 - TRIBUNES"],left:"419px",top:"174px"},children:(0,i.jsx)(yr,{children:"3"})}),s["ZONE 4 - MEDIAS"]&&(0,i.jsx)(Gg,{css:{backgroundColor:s["ZONE 4 - MEDIAS"],left:"447px",top:"174px"},children:(0,i.jsx)(yr,{children:"4"})}),s["ZONE 5 - AIRE REGIE TV"]&&(0,i.jsx)(Gg,{css:{backgroundColor:s["ZONE 5 - AIRE REGIE TV"],left:"475px",top:"174px"},children:(0,i.jsx)(yr,{children:"5"})}),s["ZONE 6 - HOSPITALITES"]&&(0,i.jsx)(Gg,{css:{backgroundColor:s["ZONE 6 - HOSPITALITES"],left:"503px",top:"174px"},children:(0,i.jsx)(yr,{children:"6"})}),s["ZONE 7 - SERVICES"]&&(0,i.jsx)(Gg,{css:{backgroundColor:s["ZONE 7 - SERVICES"],left:"531px",top:"174px"},children:(0,i.jsx)(yr,{children:"7"})}),s["ZONE 8 - BORD TERRAIN"]&&(0,i.jsx)(Gg,{css:{backgroundColor:s["ZONE 8 - BORD TERRAIN"],left:"559px",top:"174px"},children:(0,i.jsx)(yr,{children:"8"})}),s["ZONE 9 - PRESIDENTIELLE"]&&(0,i.jsx)(Gg,{css:{backgroundColor:s["ZONE 9 - PRESIDENTIELLE"],left:"587px",top:"174px"},children:(0,i.jsx)(yr,{children:"9"})}),(0,i.jsxs)(Na,{css:{alignItems:"center",flexDirection:"column",gap:"4px",left:"93px",position:"absolute",top:"166px",width:"136px"},children:[(0,i.jsx)(yr,{height:20,width:1,children:(0,i.jsx)("img",{height:"100%",src:dg(o,{barcodeType:lg.Code39,height:20,width:166}),width:"100%"})}),(0,i.jsx)(yr,{css:{fontSize:"8px"},children:o})]})]})};var Yg=n(7957);function Kg(e){return(0,lc.A)(Object.entries((0,ac.A)(e,e=>`${e.position.name}-${e.positionSlot.range.start.startOf("day").toMillis()}`)).map(([e,t])=>{const n=(0,lc.A)(t,e=>e.positionSlot.range.start.toMillis());return{name:t[0].position.name,ranges:n.map(e=>e.positionSlot.range),slotsNames:(0,Ya.A)((0,Ns.A)(n.map(({positionSlot:e})=>e.name)))}}),({ranges:e})=>e[0].start.toMillis())}var Zg=n(791);const Xg=e=>{switch(e){case 16:return 7;case 24:return 10;case 32:return 14;case 40:return 16;case 48:return 18;case 56:return 20;case 64:return 24;case 88:return 30;case 96:return 36;case 110:return 40;case 160:return 48;case 310:return 120}},Jg=e=>{const[t,n]=(0,L.useState)(m(e.image)?e.image:void 0);if((0,L.useEffect)(()=>{m(e.image)&&n(e.image)},[e.image]),m(t))return(0,i.jsx)("div",{style:{border:e.border,borderRadius:e.size+"px",height:`${e.size}px`,overflow:"hidden",width:`${e.size}px`},children:(0,i.jsx)("img",{alt:"Avatar",src:t,style:{height:`${e.size}px`,width:`${e.size}px`,verticalAlign:"baseline"}})});{const t=Eg(e.name,e.email);return(0,i.jsx)("div",{style:{borderRadius:e.size+"px",height:e.size+"px",overflow:"hidden",width:e.size+"px"},children:(0,i.jsx)("div",{className:"h-avatar-initials",style:{alignItems:"center",background:zg(t),color:"white",display:"flex",fontSize:`${Xg(e.size)}px`,height:"100%",justifyContent:"center",textTransform:"uppercase",width:"100%"},children:t})})}},Qg=e=>{const t=e.event.volunteerRegistration.userInfo,n=(0,Ns.A)(e.assignments.map(({name:e})=>e)).length,s=e.assignments.flatMap(e=>e.ranges),o=(0,Ns.A)(s.map(e=>e.start.startOf("day").toMillis())).length,r=(0,Zg.A)(s.map(e=>e.length("hours")));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Na,{css:{paddingTop:"$6"},justify:"center",width:1,children:(0,i.jsx)("img",{height:"56px",src:`${P.HEAVENT_ASSETS_URL}/badges/eurockeennes/eurockeennesLogo.png`,width:"103px"})}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(Jg,{email:t.email,image:t.fields?.picture?.url,name:t.name,size:40}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textMd semiBold",children:t.name}),(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsxs)(yr,{color:"gray500",children:["Nb. de missions : ",n]}),(0,i.jsxs)(yr,{color:"gray500",children:["Nb. de jours : ",o]}),(0,i.jsxs)(yr,{color:"gray500",children:["Temps total affecté : ",r,"h"]})]})]})]})]})};let ep=class{translationService;constructor(e){this.translationService=e}minutesToHoursMinutesString(e){const t=Us.dw.fromObject({minutes:e},{locale:this.translationService.language.toString().toLowerCase()}).shiftTo("hours","minutes");return 0===t.minutes?t.shiftTo("hours").toHuman({unitDisplay:"narrow"}):0===t.hours?t.shiftTo("minutes").toHuman({unitDisplay:"narrow"}):t.toHuman({unitDisplay:"narrow"})}};ep=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],ep);const tp=e=>{const t=qn(Kc),n=qn(ep);return(0,i.jsxs)(Na,{css:{background:"white",pageBreakBefore:0!==e.index?"always":void 0,px:"$8"},direction:"column",width:1,children:[e.header,(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(yr,{font:"gray800 textMd semiBold",children:"Planning des missions Eurockéennes 2023"}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(kc,{children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:"Nom de la mission"}),(0,i.jsx)(Vc,{width:410,children:"Date"}),(0,i.jsx)(Vc,{width:120,children:"Total"})]}),e.assignments.map((e,s)=>{const o=no(e.slotsNames),r=(0,Zg.A)(e.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(Dc,{css:{height:o?"54px":"44px"},children:[(0,i.jsx)(Ec,{css:{color:"$gray900",fontWeight:"$medium"},children:e.name}),(0,i.jsxs)(Ec,{direction:"column",gap:"1",justify:"center",width:410,children:[o&&(0,i.jsx)(yr,{color:"gray900",width:1,children:e.slotsNames.join(", ")}),(0,i.jsxs)(yr,{width:1,children:[(0,fd.A)(t.toLocaleString(e.ranges[0].start,Js.DateOnly.WeekdayLongMonthLong))," ",e.ranges.map(e=>`${e.start.toFormat("HH:mm")}-${e.end.toFormat("HH:mm")}`).join(" | ")]})]}),(0,i.jsx)(Ec,{width:120,children:n.minutesToHoursMinutesString(r)})]},s)})]})]})},np=e=>{const t=(0,L.useMemo)(()=>Kg(e.event.volunteerRegistration.positionsSlotsUsersInfos),[e.event]),n=(0,L.useMemo)(()=>(0,i.jsx)(Qg,{assignments:t,event:e.event}),[t,e.event]);return(0,i.jsx)(i.Fragment,{children:(0,Yg.A)(t,17).map((e,t)=>(0,i.jsx)(tp,{assignments:e,header:n,index:t},t))})},ip=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteersRegistrations.nodes.map((t,n)=>(0,i.jsx)(Na,{css:{background:"white",pageBreakBefore:0!==n?"always":void 0},direction:"column",width:1,children:(0,i.jsx)(np,{event:{...e.event,volunteerRegistration:t}})},t.utid))}),sp=e=>(0,i.jsxs)(Na,{align:"center",width:1,children:[(0,i.jsx)(Na,{align:"center",css:{background:e.backgroundColor,color:"white",fontWeight:700},height:24,justify:"center",width:30,children:e.zoneNumber}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsx)(yr,{css:{fontSize:"13px",fontWeight:700},children:e.zoneText})]}),op=()=>(0,i.jsx)(yr,{height:24,width:1}),rp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=4444===e.event.id,o=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),r=o.includes("CAT 1"),a=o.includes("CAT 2"),l=o.includes("CAT 3"),d=o.includes("CAT 4"),c=o.includes("CAT 5"),u=o.includes("CAT 6"),h=s?`${P.HEAVENT_ASSETS_URL}/badges/fcg/2425/bg_badge_saison.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/fcg/2425/bg_badge_match.jpg`;return(0,i.jsxs)(Na,{css:{background:`url(${h}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:563,width:397,children:[(0,i.jsx)(yr,{css:{border:"2px solid #004994",left:"38px",position:"absolute",top:"38px"},height:80,width:80,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsxs)(Na,{css:{color:"#00384f",fontSize:"12px",fontWeight:"900",left:"128px",lineHeight:"18px",position:"absolute",textTransform:"uppercase",top:"52px"},direction:"column",children:[(0,i.jsx)(yr,{children:n.fields.cf10106?.value||""}),(0,i.jsx)(yr,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{children:n.fields?.lastName?.value||""})]}),(0,i.jsx)(yr,{css:{border:"2px solid #004994",left:"273px",padding:"$1",position:"absolute",top:"38px"},height:80,width:80,children:m(t.utid)&&(0,i.jsx)("img",{height:"100%",src:dg(t.utid,{color:"5d9dcb"}),width:"100%"})}),!s&&(0,i.jsx)(Na,{align:"center",css:{color:"#00384f",fontSize:"30px",fontWeight:"900",height:"54px",left:"129px",lineHeight:"24px",position:"absolute",textTransform:"uppercase",top:"183px",width:"230px"},justify:"center",wrap:"wrap",children:e.event.name}),(0,i.jsxs)(Na,{css:{gap:"7px",left:"38px",position:"absolute",top:"293px"},children:[(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[r?(0,i.jsx)(sp,{backgroundColor:"#8ec89a",zoneNumber:1,zoneText:"Terrain"}):(0,i.jsx)(op,{}),a?(0,i.jsx)(sp,{backgroundColor:"#ddca00",zoneNumber:2,zoneText:"Zone mixte"}):(0,i.jsx)(op,{}),l?(0,i.jsx)(sp,{backgroundColor:"#cd1719",zoneNumber:3,zoneText:"Espaces Media"}):(0,i.jsx)(op,{})]}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[d?(0,i.jsx)(sp,{backgroundColor:"#009fe3",zoneNumber:4,zoneText:"Tribunes"}):(0,i.jsx)(op,{}),c?(0,i.jsx)(sp,{backgroundColor:"#d89fc7",zoneNumber:5,zoneText:"Espaces et Salon VIP"}):(0,i.jsx)(op,{}),u?(0,i.jsx)(sp,{backgroundColor:"#010000",zoneNumber:6,zoneText:"PC Sécurité"}):(0,i.jsx)(op,{})]})]})]})},ap=e=>(0,i.jsx)(i.Fragment,{children:(0,Yg.A)(e.event.volunteersRegistrations.nodes,4).map((t,n)=>(0,i.jsx)(Na,{css:{pageBreakBefore:0!==n?"always":void 0},justify:"between",width:Jm,wrap:"wrap",children:t.map(t=>(0,i.jsx)(rp,{event:{...e.event,volunteerRegistration:t}},t.userInfo.id))},`page-${n}`))}),lp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=(0,lc.A)(Object.values((0,ac.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis())),e=>e[0].positionSlot.range.start.startOf("day")),o="MRP"===n.fields?.cf32955?.value,r=(0,lc.A)(t.accreditationsUsersInfos.flatMap(e=>2927===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),a=(0,lc.A)(t.accreditationsUsersInfos.flatMap(e=>2938===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),l=(0,lc.A)(t.accreditationsUsersInfos.flatMap(e=>2928===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),d=t.accreditationsUsersInfos.some(e=>2931===e.accreditation.id||2932===e.accreditation.id),c=(0,lc.A)(t.accreditationsUsersInfos.flatMap(e=>2929===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),u=(0,lc.A)(t.accreditationsUsersInfos.flatMap(e=>2930===e.accreditation.id&&e.accreditationSlot.date?.isValid?[e.accreditationSlot]:[]),e=>e.date.toMillis()??0).map(e=>e.name).join(", "),h=t.accreditationsUsersInfos.some(e=>2933===e.accreditation.id);return(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/garorock/planning.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$inter",position:"relative"},height:Xm,width:Jm,children:(0,i.jsxs)(Na,{css:{position:"absolute",px:"96px",top:"240px"},direction:"column",gap:"5",children:[o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Na,{direction:"column",gap:"4",children:s.map((e,t)=>{const n=e[0],s=(0,lc.A)(Object.values((0,ac.A)(e,e=>e.position.id)),e=>(0,ih.A)(e,e=>e.positionSlot.range.start.toMillis()).positionSlot.range.start.toMillis());return(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{color:"#faf5dc",fontSize:"16px",fontWeight:"700",textTransform:"capitalize"},children:n.positionSlot.range.start.toFormat("cccc dd MMMM",{locale:"fr"})}),s.map((e,t)=>{const n=e[0];return(0,i.jsxs)(yr,{css:{color:"#faf5dc",fontSize:"16px"},children:[n.position.name," :"," ",(s=e.map(({positionSlot:e})=>e.range),(0,lc.A)(s,e=>e.start.toMillis()).map(e=>`${e.start.toFormat("H:mm")}-${e.end.toFormat("H:mm")}`).join(" | "))]},t);var s})]},t)})}),(0,i.jsx)(Na,{justify:"center",width:602,children:(0,i.jsx)(yr,{height:4,width:332,children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/garorock/dot.png`,width:"100%"})})})]}),(0,i.jsxs)(Na,{css:{color:"#faf5dc",fontSize:"16px"},direction:"column",gap:"5",children:[m(r)&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{children:"Un petit déjeuner au catering bénévole est prévu pour toi le(s) :"}),(0,i.jsx)(yr,{fontWeight:"medium",children:r})]}),m(a)&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{children:"Un petit déjeuner au Garotri est prévu pour toi le(s) :"}),(0,i.jsx)(yr,{fontWeight:"medium",children:a})]}),m(l)&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{children:"Un panier repas est prévu pour toi le(s) :"}),(0,i.jsx)(yr,{fontWeight:"medium",children:l})]}),d&&(0,i.jsx)(yr,{children:"Une somme d’argent te sera crédité sur ta carte pour tes jours de présence"}),m(c)&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{children:"Un repas au catering technique est prévu pour toi le(s) :"}),(0,i.jsx)(yr,{fontWeight:"medium",children:c})]}),m(u)&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{children:"Un repas au Garo snack d’une valeur de 6€ est prévu pour toi le(s) :"}),(0,i.jsx)(yr,{fontWeight:"medium",children:u})]}),h&&(0,i.jsx)(yr,{children:"Des tickets repas te seront fournis pour les utiliser sur tous les stands du festival"})]})]})})},dp=e=>"All Access Pass"===e||"All Access Pass + A"===e?`${P.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_back.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/goldenCoast/classique_back.jpg`,cp=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields?.cf37556?.value??"",s="All Access Pass"===n||"All Access Pass + A"===n?"#faed4f":"#294999";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${o=n,"All Access Pass"===o?`${P.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_front.jpg`:"All Access Pass + A"===o?`${P.HEAVENT_ASSETS_URL}/badges/goldenCoast/pass_plus_front.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/goldenCoast/classique_front.jpg`}) no-repeat`,backgroundSize:"212px 317px",fontFamily:"$neueMontreal",position:"relative"},height:317,width:212,children:[(0,i.jsx)(yr,{css:{borderRadius:"4px",left:"55px",overflow:"hidden",position:"absolute",top:"105px"},height:102,width:102,children:m(t.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:t.fields.picture.url,width:"100%"})}),(0,i.jsx)(yr,{css:{color:s,fontSize:"24px",fontWeight:"700",position:"absolute",textTransform:"uppercase",top:"218px"},textAlign:"center",width:1,children:t.fields?.lastName?.value||""}),(0,i.jsx)(yr,{css:{color:s,fontSize:"24px",fontWeight:"700",position:"absolute",top:"248px"},textAlign:"center",width:1,children:t.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{color:s,fontWeight:"700",position:"absolute",top:"286px"},textAlign:"center",width:1,children:t.fields.cf33258?.value})]}),(0,i.jsx)(Na,{css:{background:`url(${dp(n)}) no-repeat`,backgroundSize:"212px 317px",pageBreakBefore:"always"},height:317,width:212})]});var o},up=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],hp={TERRAIN:"Mode_Isolation_1.png",VESTIAIRES:"Mode_Isolation_2.png","ESPACE PRESSE":"Mode_Isolation_3.png","SALON NEODIF":"Mode_Isolation_4.png","SALON GEOFIT":"Mode_Isolation_5.png","SALON PRESTIGE":"Mode_Isolation_6.png"},mp=({css:e,name:t})=>(0,i.jsx)(yr,{css:{background:`url(https://assets.recrewteer.com/badges/hbc/lnh/${hp[t]}) no-repeat`,backgroundSize:"cover",height:"30px",position:"absolute",width:"30px",...e}}),gp=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=n.fields?.cf38222?.value,o=t.accreditationsUsersInfos.reduce((e,t)=>up.includes(t.accreditation.name)?{...e,[t.accreditation.name]:!0}:e,{});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2025/bg_badge_recto.jpg) no-repeat",backgroundSize:"cover",color:"#FFF",fontFamily:"$formulaCondensedBold",position:"relative"},height:476,width:363,children:[(0,i.jsx)(yr,{css:{fontSize:"26px",fontWeight:700,left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",textDecoration:"uppercase",top:"221px"},children:`${n.fields?.firstName?.value||""} ${n.fields?.lastName?.value||""}`.trim().toUpperCase()}),(0,i.jsx)(yr,{css:{fontSize:"13px",fontWeight:"700",left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",top:"172px"},children:n.fields.cf38077?.value}),(0,i.jsx)(yr,{css:{fontSize:"26px",fontWeight:700,left:"34px",lineHeight:"normal",position:"absolute",textAlign:"center",textDecoration:"uppercase",top:"301px"},children:(s||"").toUpperCase()}),o.TERRAIN&&(0,i.jsx)(mp,{css:{left:"251px",top:"314px"},name:"TERRAIN"}),o.VESTIAIRES&&(0,i.jsx)(mp,{css:{left:"299px",top:"314px"},name:"VESTIAIRES"}),o["ESPACE PRESSE"]&&(0,i.jsx)(mp,{css:{left:"251px",top:"363px"},name:"ESPACE PRESSE"}),o["SALON NEODIF"]&&(0,i.jsx)(mp,{css:{left:"299px",top:"363px"},name:"SALON NEODIF"}),o["SALON GEOFIT"]&&(0,i.jsx)(mp,{css:{left:"251px",top:"412px"},name:"SALON GEOFIT"}),o["SALON PRESTIGE"]&&(0,i.jsx)(mp,{css:{left:"299px",top:"412px"},name:"SALON PRESTIGE"})]}),(0,i.jsx)(Na,{css:{background:"url(https://assets.recrewteer.com/badges/hbc/ldc/2025/bg_badge_verso.jpg) no-repeat",backgroundSize:"cover",position:"relative"},height:476,width:363})]})},pp=["TERRAIN","VESTIAIRES","ESPACE PRESSE","SALON NEODIF","SALON GEOFIT","SALON PRESTIGE"],fp={TERRAIN:"Mode_Isolation_1.png",VESTIAIRES:"Mode_Isolation_2.png","ESPACE PRESSE":"Mode_Isolation_3.png","SALON NEODIF":"Mode_Isolation_4.png","SALON GEOFIT":"Mode_Isolation_5.png","SALON PRESTIGE":"Mode_Isolation_6.png"},xp=({css:e,name:t})=>(0,i.jsx)(yr,{css:{background:`url(https://assets.recrewteer.com/badges/hbc/lnh/${fp[t]}) no-repeat`,backgroundSize:"cover",height:"47px",position:"absolute",top:"463px",width:"47px",...e}}),_p=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=n.fields?.cf38222?.value,o=t.accreditationsUsersInfos.reduce((e,t)=>pp.includes((t.accreditation?.name||"").toUpperCase())?{...e,[t.accreditation.name]:!0}:e,{});return(0,i.jsxs)(Na,{css:{fontFamily:"$zuumeMedium",position:"relative"},height:Qm,width:eg,children:[(0,i.jsx)(yr,{css:{left:"52px",position:"absolute",top:"205px"},height:111,width:111,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(yr,{css:{left:"69px",position:"absolute",top:"317px"},textAlign:"center",width:77,children:n.id}),(0,i.jsx)(yr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"205px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"229px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{fontFamily:"$zuumeBold",fontSize:"25px",fontWeight:"700",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",top:"261px"},children:n.fields.cf38077?.value}),(0,i.jsx)(yr,{css:{fontSize:"20px",left:"178px",lineHeight:"normal",position:"absolute",right:"52px",textAlign:"center",textDecoration:"uppercase",top:"298px"},children:s}),o.TERRAIN&&(0,i.jsx)(xp,{css:{left:"45px"},name:"TERRAIN"}),o.VESTIAIRES&&(0,i.jsx)(xp,{css:{left:"96px"},name:"VESTIAIRES"}),o["ESPACE PRESSE"]&&(0,i.jsx)(xp,{css:{left:"149px"},name:"ESPACE PRESSE"}),o["SALON NEODIF"]&&(0,i.jsx)(xp,{css:{left:"201px"},name:"SALON NEODIF"}),o["SALON GEOFIT"]&&(0,i.jsx)(xp,{css:{left:"253px"},name:"SALON GEOFIT"}),o["SALON PRESTIGE"]&&(0,i.jsx)(xp,{css:{left:"306px"},name:"SALON PRESTIGE"})]})},Ip=e=>{switch(e){case"ORGA":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/Orga_Recto_v2.jpg`;case"Bénévoles":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/Benevole_Recto.jpg`;case"MEDIA PRESSE":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/Media_presse_Recto.jpg`;case"MEDIA PHOTOGRAPHE":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/Media_Photo_Recto.jpg`;case"EQUIPES":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/Equipe_Recto.jpg`;case"VIP":return`${P.HEAVENT_ASSETS_URL}/badges/lnh/VIP_recto.jpg`;default:return""}},vp=e=>{switch(e){case"ORGA":return"#6f2c91";case"Bénévoles":return"#72BF44";case"MEDIA PRESSE":return"#294EA2";case"MEDIA PHOTOGRAPHE":return"#ED1C24";case"EQUIPES":return"#EBCB00";case"VIP":return"#F7941D";default:return""}},bp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=wg(n.fields,"population",""),o=t.positionsSlotsUsersInfos[0]?.position?.name||"",r=(0,Ns.A)((0,Ya.A)(t.accreditationsUsersInfos.map(e=>e.accreditation.acronym))),a="Bénévoles"===s?o:"ORGA"===s?n.fields.cf36081?.value:"EQUIPES"===s?n.fields?.cf36079?.value:"MEDIA PRESSE"===s||"MEDIA PHOTOGRAPHE"===s?n.fields?.cf36082?.value:"VIP"===s?n.fields?.cf36085?.value:"";return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Na,{css:{background:`url(${Ip(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$tuskerGrotesk",fontWeight:"500",position:"relative"},height:321,width:212,children:[(0,i.jsx)(yr,{css:{left:"125px",position:"absolute",top:"30px"},height:58,width:58,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(yr,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"127px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"156px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"11px",left:"39px",position:"absolute",textTransform:"uppercase",top:"186px"},children:a}),(0,i.jsx)(Na,{css:{gap:"2px",left:"31px",position:"absolute",top:"241px"},children:(0,Oc.A)(1,9).map(e=>(0,i.jsx)(Na,{align:"center",css:{background:"white",borderRadius:"17px",color:vp(s),fontFamily:"$gilroy",fontSize:"7px",fontWeight:"700",visibility:r.includes(e.toString(10))?"visible":"hidden"},height:17,justify:"center",width:17,children:e},e))})]})})},jp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=Object.values((0,ac.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis()));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/moorea/contremarque.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$unbounded",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsxs)(Na,{css:{color:"$gray800",fontSize:"22px",fontWeight:"700",left:"96px",position:"absolute",top:"239px"},direction:"column",children:[(0,i.jsx)(yr,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{children:n.fields?.lastName?.value||""})]}),(0,i.jsx)(yr,{css:{position:"absolute",right:"96px",top:"222px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsxs)(yr,{color:"gray800",css:{fontSize:"12px",left:"96px",position:"absolute",top:"548px"},children:["Chèr.e ",n.fields?.firstName?.value||"",","]})]}),(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/moorea/Planning.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$unbounded",pageBreakBefore:"always",position:"relative"},height:Xm,width:Jm,children:(0,i.jsx)(Na,{css:{left:"92px",position:"absolute",top:"372px"},direction:"column",gap:"6",children:s.map((e,t)=>{const n=e[0];return(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{css:{color:"#a26fd2",fontSize:"16px",fontWeight:"700",textTransform:"uppercase"},children:n.positionSlot.range.start.toFormat("cccc dd MMMM yyyy",{locale:"fr"})}),e.map(({position:e,positionSlot:{range:t}},n)=>(0,i.jsxs)(yr,{children:[e.name," / ",t.start.toFormat("HH:mm"),"-",t.end.toFormat("HH:mm")]},n))]},t)})})})]})},Cp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/nuitssecretes/background.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$poppins",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{fontSize:"28px",fontWeight:"700",position:"absolute",textAlign:"center",top:"545px"},width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"28px",fontWeight:"700",position:"absolute",textAlign:"center",top:"584px"},width:1,children:n.fields?.lastName?.value||""}),(0,i.jsxs)(Na,{align:"center",css:{position:"absolute",top:"654px"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(yr,{height:94,width:94,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:94,width:94}),width:"100%"})}),(0,i.jsx)(yr,{css:{fontSize:"10px"},children:t.ticketId})]})]})},yp=e=>{switch(e){case"PARTENAIRE":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/VIP@3x.jpg`;case"PARTENAIRE - Fast Pass":default:return"";case"VIP LOGES":case"VIP LOGES Fast Pass":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/vip_loges.png`;case"ADMINISTRATEUR":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ADMIN@3x.png`;case"MÉDIAS - JOURNALISTE":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/MEDIAS_JOURNALISTE@3x.png`;case"MÉDIAS - PHOTOGRAPHE":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/MEDIAS_PHOTOGRAPHE@3x.png`;case"BÉNÉVOLES":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/STAFF@3x.png`;case"CHAUFFEUR":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/CHAUFFEUR@3x.png`;case"RAMASSEUR DE BALLES":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ramasseurs.png`;case"JUGE DE LIGNE":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/juge_lignes.png`;case"OFFICIEL ATP":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/OFFICIEL@3x.png`;case"ORGANISATION":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/ORGANISATION@3x.png`;case"PRESTATAIRE":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/PRESTATAIRE@3x.png`;case"JOUEUR":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/PLAYER@3x.png`;case"COACH":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/COACH@3x.png`;case"GUEST":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/GUEST@3x.png`;case"SUPERVISEUR":return`${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/supervisor_atp.png`}},kp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf31279?.value??"",o="OFFICIEL ATP"===s||"ORGANISATION"===s||"ADMINISTRATEUR"===s||"PRESTATAIRE"===s||"MÉDIAS - PHOTOGRAPHE"===s||"MÉDIAS - JOURNALISTE"===s||"VIP LOGES"===s||"VIP LOGES Fast Pass"===s||"PARTENAIRE"===s?`${n.fields?.firstName?.value||""} ${n.fields?.lastName?.value||""}`:n.fields?.firstName?.value||"",r="OFFICIEL ATP"===s||"ORGANISATION"===s?n.fields?.cf36132?.value:"ADMINISTRATEUR"===s||"PRESTATAIRE"===s||"MÉDIAS - PHOTOGRAPHE"===s||"MÉDIAS - JOURNALISTE"===s||"VIP LOGES"===s||"VIP LOGES Fast Pass"===s||"PARTENAIRE"===s?n.fields?.cf31319?.value:(n.fields?.lastName?.value||"").toUpperCase();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${yp(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$sharpGrotesk",position:"relative"},height:331,width:208,children:[(0,i.jsx)(yr,{css:{borderRadius:"$1",left:"61px",overflow:"hidden",position:"absolute",top:"169px"},height:80,width:80,children:m(n.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(yr,{css:{color:"white",fontWeight:"600",position:"absolute",top:"285px"},textAlign:"center",width:1,children:o}),(0,i.jsx)(yr,{css:{color:"white",fontWeight:"600",position:"absolute",top:"301px"},textAlign:"center",width:1,children:r})]}),(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/openbrest/v2/VERSO@3x.png) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:331,width:208,children:(0,i.jsx)(yr,{css:{left:"59px",position:"absolute",top:"115px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:90,width:90}),width:"100%"})})})]})},Ap=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields.phone?.internationalFormat||"";return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/p2n/planning_masque.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},direction:"column",height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{left:"48px",position:"absolute",top:"47px"},children:(0,i.jsx)(Jg,{email:t.email,image:t.fields?.picture?.url,name:t.name,size:40})}),(0,i.jsxs)(Na,{css:{left:"104px",position:"absolute",top:"45px"},direction:"column",children:[(0,i.jsx)(yr,{css:{color:"$gray800",fontSize:"16px",fontWeight:"600"},children:t.name}),(0,i.jsx)(yr,{color:"gray800",children:n})]}),(0,i.jsx)(yr,{css:{color:"black",fontSize:"24px",fontWeight:"700",position:"absolute",top:"112px"},textAlign:"center",width:1,children:e.title}),(0,i.jsx)(Na,{css:{gap:"28px",flex:"1",left:"48px",position:"absolute",top:"172px",width:"calc(100% - 96px)"},direction:"column",children:e.children})]})},wp=Us.IX.fromDateTimes(Us.c9.fromObject({year:2025,month:6,day:6}).startOf("day"),Us.c9.fromObject({year:2025,month:6,day:8}).endOf("day"));var Sp;function Ep(){return Ep=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=qn(Kc),n=e.psui.position,s=n.category,o=e.psui.positionSlot,r=(0,lc.A)((0,ph.A)(n.leaders.concat(s.leaders),e=>e.userInfo.id),e=>e.userInfo.name).map(e=>e.userInfo.name).join(", ");return(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:t.toLocaleString(o.range.start,Js.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(Na,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(Tp,{})}),(0,i.jsxs)(yr,{color:"gray800",children:[(0,i.jsx)(Zm,{css:{fontWeight:"600"},children:n.name})," | De"," ",o.range.start.toFormat("H:mm")," à ",o.range.end.toFormat("H:mm")]})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{gap:"2",children:[(0,i.jsx)(Na,{align:"center",css:{"& svg":{fill:"black",height:"100%",width:"100%"}},height:16,justify:"center",width:16,children:(0,i.jsx)(Rp,{})}),(0,i.jsxs)(yr,{color:"gray800",children:[(0,i.jsx)(Zm,{css:{fontWeight:"600"},children:"Responsable : "}),r]})]}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{color:"black"},children:(0,i.jsx)(xg,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:n.description})})]})},Dp=e=>{const t=e.event.volunteerRegistration,[n,s]=(0,nh.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(wp));return(0,i.jsx)(i.Fragment,{children:no(n)&&(0,i.jsx)(Ap,{event:e.event,title:"Planning P2N 2025",children:(0,lc.A)(n,({positionSlot:e})=>e.range.start.toMillis()).map(e=>(0,i.jsx)($p,{psui:e},e.id))})})},Pp=e=>{const t=qn(Kc);return(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{css:{color:"black",fontWeight:"700",textTransform:"uppercase"},children:e.psuis[0].position.name}),(0,lc.A)(e.psuis,e=>e.positionSlot.range.start.toMillis()).map(e=>{const n=e.positionSlot;return(0,i.jsxs)(yr,{color:"gray800",css:{fontSize:"16px"},children:[(0,i.jsx)(Zm,{css:{fontWeight:"600",textTransform:"capitalize"},children:t.toLocaleString(n.range.start,{month:"long",day:"numeric",weekday:"long"})})," ","| De ",n.range.start.toFormat("H:mm")," à"," ",n.range.end.toFormat("H:mm")]},e.id)})]})},Fp=e=>{const t=e.event.volunteerRegistration,[n,s]=(0,nh.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.overlaps(wp)),o=(0,lc.A)(Object.entries((0,ac.A)(s,e=>e.position.name)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:no(s)&&(0,i.jsx)(Ap,{event:e.event,title:"Planning Montage/ Démontage P2N 2025",children:o.map(([e,t],n)=>(0,i.jsx)(Pp,{psuis:t},n))})})},Mp=e=>{switch(e){case"BACKSTAGE":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Backstage.png`;case"ALL ACCES":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Orga_All_access.png`;case"BÉNÉVOLE":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Benevole.png`;case"GENDARME":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Gendarme.png`;case"MÉDIA":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Media.png`;case"PARTENAIRE":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Partenaire.png`;case"POMPIER":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Pompier.png`;case"PRESTATAIRE":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Prestataire.png`;case"PRÉVENTION":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Prevention.png`;case"SÉCURITÉ":return`${P.HEAVENT_ASSETS_URL}/badges/p2n/badgev2/Securite.png`;default:return""}},Np=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=3613===e.event.id?2434:2081,o=(0,lc.A)(t.accreditationsUsersInfos.filter(({accreditation:e})=>e.id===s),e=>e.accreditationSlot.date?.toMillis()??0).map(({accreditationSlot:e})=>e.name).join(""),r=n.fields?.cf26723?.value??"";return(0,i.jsxs)(Na,{css:{background:`url(${Mp(r)}) no-repeat`,backgroundSize:"cover",fontFamily:"$now",position:"relative"},height:325,width:208,children:[(0,i.jsx)(yr,{css:{color:"black",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"111px",width:"100%"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{color:"black",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"139px",width:"100%"},children:n.fields?.lastName?.value||""}),(0,i.jsxs)(Na,{align:"center",css:{position:"absolute",top:"170px",width:"100%"},children:[(0,i.jsx)(yr,{css:{color:"black",flex:"1",fontFamily:"$nowMedium",fontSize:"16px",fontWeight:"600",textAlign:"center"},children:o}),(0,i.jsx)(Na,{css:{paddingRight:"5px"},width:169,children:(0,i.jsx)(yr,{height:26,width:1,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{barcodeType:lg.Code39,height:26,width:164}),width:"100%"})})})]}),["PRESTATAIRE","PRÉVENTION","SÉCURITÉ"].some(e=>e===r)&&(0,i.jsx)(Na,{align:"center",css:{position:"absolute",top:"249px",width:"100%"},children:(0,i.jsx)(yr,{css:{color:"white",flex:"1",fontFamily:"$kobe",fontSize:"12px",fontWeight:"900",lineHeight:"12.78px",margin:"0 53px",textAlign:"center"},children:e.event.volunteerRegistration.delegation?.name.toUpperCase()})})]})},Lp=e=>e.includes("BLEU_CLAIR")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_clair_verso.jpg`:e.includes("BLEU_FONCE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/bleu_fonce_verso.jpg`:e.includes("JAUNE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/jaune_verso.jpg`:e.includes("ORANGE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/orange_verso.jpg`:e.includes("VERT")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/vert_verso.jpg`:e.includes("VIOLET")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/versos/violet_verso.jpg`:"",Bp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),o=n.fields?.cf1019?.value;return(0,i.jsx)(Na,{css:{background:`url(${Lp(s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:(0,i.jsx)(Na,{align:"center",css:{color:"black",fontSize:"16px",fontWeight:"700",height:"39px",left:"29px",position:"absolute",top:"31px",width:"40px"},justify:"center",children:o})})},Vp=e=>e.includes("BLEU_CLAIR")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_clair/bleu_clair_recto.jpg`:e.includes("BLEU_FONCE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/bleu_fonce/bleu_fonce_recto.jpg`:e.includes("JAUNE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/jaune/jaune_recto.jpg`:e.includes("ORANGE")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/orange/orange_recto.jpg`:e.includes("VERT")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/vert/vert_recto.jpg`:e.includes("VIOLET")?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/badge/violet/violet_recto.jpg`:"",Up=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym),o=(0,Ns.A)(t.positionsSlotsUsersInfos.map(e=>e.position.name)),r=s.includes("JAUNE")||s.includes("BLEU_CLAIR")?"black":"white",a=n.fields?.cf20600?.value??"",l=n.fields?.cf21104?.value??"",d=n.fields?.cf21129?.value??[];return(0,i.jsxs)(Na,{css:{background:`url(${Vp(s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:476,width:368,children:[(0,i.jsx)(yr,{css:{position:"absolute",right:"40px",top:"43px"},height:65,width:65,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:65,width:65}),width:"100%"})}),(0,i.jsx)(yr,{css:{borderRadius:"107px",height:"107px",left:"131px",overflow:"hidden",position:"absolute",top:"127px",width:"107px"},children:n.fields?.picture&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture.url,width:"100%"})}),(0,i.jsx)(yr,{css:{color:r,fontSize:"18px",fontWeight:"700",position:"absolute",textAlign:"center",top:"242px",width:"100%"},children:n.name}),(0,i.jsx)(Na,{css:{color:r,fontSize:"12px",gap:"2px",position:"absolute",top:"271px",width:"100%"},direction:"column",children:t.state===$t.NotApplicable||"Intervenant"===a?(0,i.jsx)(yr,{textAlign:"center",width:1,children:l}):"Direction"===a?no(d)?d.map((e,t)=>(0,i.jsx)(yr,{textAlign:"center",width:1,children:e},t)):null:o.map((e,t)=>(0,i.jsx)(yr,{textAlign:"center",width:1,children:e},t))}),(0,i.jsx)(yr,{css:{color:r,fontSize:"32px",fontWeight:"700",position:"absolute",textAlign:"center",textTransform:"uppercase",top:"364px",width:"100%"},children:a})]})},Wp=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Up,{event:e.event}),(0,i.jsx)(Bp,{event:e.event})]}),Gp=e=>{const t=e.psuis[0].position,n=(0,lc.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),s=e.userInfo,o=t.leaders[0],r=t.leaders[1];return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/assignment_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",fontWeight:"500",pageBreakBefore:"always",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{borderRadius:"5px",left:"67px",overflow:"hidden",position:"absolute",top:"212px"},height:74,width:74,children:m(s.fields?.picture?.url)&&(0,i.jsx)("img",{height:"100%",src:s.fields.picture.url,width:"100%"})}),(0,i.jsx)(yr,{css:{color:"white",fontSize:"15px",fontWeight:"900",left:"27px",position:"absolute",textTransform:"uppercase",top:"295px"},textAlign:"center",width:155,children:s.fields?.firstName?.value||""}),o&&(0,i.jsxs)(Na,{align:"center",css:{color:"#00535e",gap:"2px",fontSize:"16px",fontWeight:"900",left:"12px",position:"absolute",top:"815px"},direction:"column",width:185,children:[(0,i.jsx)(yr,{children:o.userInfo.firstName}),(0,i.jsx)(yr,{children:o.userInfo.lastName}),(0,i.jsx)(yr,{children:o.userInfo.phone?.internationalFormat})]}),r&&(0,i.jsxs)(Na,{align:"center",css:{color:"#00535e",gap:"2px",fontSize:"16px",fontWeight:"900",left:"12px",position:"absolute",top:"932px"},direction:"column",width:185,children:[(0,i.jsx)(yr,{children:r.userInfo.firstName}),(0,i.jsx)(yr,{children:r.userInfo.lastName}),(0,i.jsx)(yr,{children:r.userInfo.phone?.internationalFormat})]}),(0,i.jsxs)(Na,{css:{left:"210px",padding:"24px 40px 0 40px",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(Na,{align:"center",css:{color:"#d7531e",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"},height:38,justify:"center",width:1,children:t.name}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(yr,{css:{fontSize:"16px",fontWeight:"900"},children:"Date de ta mission :"}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Na,{direction:"column",gap:"1",children:n.map((e,t)=>{const n=e.range.start,s=e.range.end,o=n.startOf("day").toMillis()===s.startOf("day").toMillis();return(0,i.jsxs)(yr,{css:{color:"#333333"},children:[n.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})," -"," ",o?s.toFormat("HH:mm"):s.toFormat("d MMMM yyyy HH:mm",{locale:"fr"})]},t)})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{css:{fontSize:"16px",fontWeight:"900"},children:"Détails de ta mission :"}),(0,i.jsx)(qa,{height:"2"}),m(t.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{css:{color:"black","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(xg,{text:t.description})})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{css:{fontSize:"16px",fontWeight:"900"},children:"Lieu de rendez-vous :"}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{children:t.address}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{height:180,width:1,children:(0,i.jsx)("a",{href:_g(t.latitude,t.longitude),style:{background:`url(${P.HEAVENT_API_URL}/image/event/${e.eventId}/position/${t.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),m(t.fields.cf38416)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(yr,{children:t.fields.cf38416})]})]})]})},Hp=e=>{const t=gg(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,null).filter(({position:e})=>e.tags.some(e=>"Fiche personnalisée"===e.name)),n=(0,lc.A)(Object.entries((0,ac.A)(t,({position:e})=>e.id)),([e])=>e);return(0,i.jsx)(i.Fragment,{children:n.map(([t,n],s)=>(0,i.jsx)(Gp,{eventId:e.event.id,psuis:n,userInfo:e.event.volunteerRegistration.userInfo},s))})},qp=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Na,{css:{background:`url(${s=e.event.id,4183===s?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/accreditation_vip.jpg`:3694===s?`${P.HEAVENT_ASSETS_URL}/badges/paris20km/2024/intervenant.jpg`:""}) no-repeat`,backgroundSize:"cover",fontFamily:"$avenir",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsxs)(Na,{css:{fontSize:"24px",fontWeight:"900",left:"80px",lineHeight:"28px",position:"absolute",top:"261px"},direction:"column",children:[(0,i.jsx)(yr,{children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{children:n.fields?.lastName?.value||""})]}),(0,i.jsxs)(yr,{css:{color:"#d8541d",fontSize:"20px",fontWeight:"800",left:"80px",position:"absolute",top:"325px"},children:[(0,i.jsxs)(Zm,{css:{color:"black",fontWeight:"400"},children:[4183===e.event.id?"VIP":"Intervenant"," |"]})," ",n.fields.cf21104?.value]}),(0,i.jsx)(yr,{css:{position:"absolute",right:"80px",top:"261px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:90,width:90}),width:"100%"})})]});var s},Yp=()=>(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_verso.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",pageBreakBefore:"always",position:"relative"},direction:"column",height:597,width:435,children:(0,i.jsx)(yr,{css:{height:"518px",left:"25px",position:"absolute",top:"15px",width:"385px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/contact.png`,width:"100%"})})});var Kp;function Zp(){return Zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsx)(Na,{css:{position:"absolute",px:"34px",top:"516px"},justify:"between",width:1,children:e.event.volunteerRegistration.accreditationsUsersInfos.map((e,t)=>{const n=vx(e.accreditation.icon),s=Zd(e.accreditation.color);return(0,i.jsxs)(Na,{align:"center",direction:"column",gap:"1",justify:"center",width:75,children:[(0,i.jsx)(Na,{align:"center",css:{background:e.accreditation.color,borderRadius:"$1","& svg":{fill:s,height:"50%",width:"50%"}},height:24,justify:"center",width:24,children:(0,i.jsx)(n,{})}),(0,i.jsx)(yr,{color:"gray800",css:{fontSize:"10px"},fontWeight:"medium",textAlign:"center",children:e.accreditation.name})]},t)})}),jx=e=>{const t=qn(Kc),n=qn(hh),s=e.event.volunteerRegistration.userInfo,o=(0,lc.A)(Object.values((0,ac.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toISO())),e=>e[0].positionSlot.range.start.startOf("day").toMillis()),r=(0,dr.A)(Js.DateOnly.WeekdayLongMonthLong,"year"),a=s.fields?.cf16442?.value??"";return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_orga-bene_recto.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",position:"relative"},direction:"column",height:597,width:434,children:[(0,i.jsx)(yr,{color:"gray500",css:{fontSize:"12px",fontWeight:"500",position:"absolute",top:"248px"},textAlign:"center",width:1,children:s.name}),(0,i.jsx)(yr,{css:{position:"absolute",textTransform:"uppercase",top:"268px"},font:"gray800 displayXs bold",textAlign:"center",width:1,children:a||"Bénévole"}),(0,i.jsx)(Na,{css:{position:"absolute",px:"60px",top:"312px"},direction:"column",gap:"2",children:o.map((e,s)=>(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",css:{fontSize:"10px",textTransform:"capitalize"},children:t.toLocaleString(e[0].positionSlot.range.start,r)}),e.map((e,t)=>(0,i.jsxs)(yr,{color:"gray800",css:{fontSize:"10px"},fontWeight:"semiBold",children:[e.position.name," :"," ",n.toLocaleString(e.positionSlot.range,{locale:"fr-FR"},{hour:"numeric",minute:"numeric"})]},t))]},s))}),(0,i.jsx)(bx,{event:e.event})]})},Cx=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jx,{event:e.event}),(0,i.jsx)(Yp,{})]}),yx=()=>(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_verso.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",pageBreakBefore:"always",position:"relative"},direction:"column",height:597,width:435,children:(0,i.jsx)(yr,{css:{height:"472px",left:"29px",position:"absolute",top:"45px",width:"376px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/programme.png`,width:"100%"})})}),kx=e=>{const t=e.event.volunteerRegistration.userInfo,n=t.fields?.cf16442?.value??"";return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/pastourelle2024/Badge_presta_recto.png) no-repeat`,backgroundSize:"cover",overflow:"hidden",position:"relative"},direction:"column",height:597,width:435,children:[(0,i.jsx)(yr,{css:{position:"absolute",textTransform:"uppercase",top:"430px"},font:"gray800 displayXs bold",textAlign:"center",width:1,children:n}),(0,i.jsx)(bx,{event:e.event})]})},Ax=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kx,{event:e.event}),(0,i.jsx)(yx,{})]}),wx=({date:e})=>(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid black",borderRadius:"$1",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(yr,{css:{fontSize:"16px",fontWeight:"700"},children:e.toFormat("d")}),(0,i.jsx)(yr,{css:{fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMM",{locale:"fr"})})]}),Sx=e=>e?`${P.HEAVENT_ASSETS_URL}/badges/pec/accorArena/bg_accor_v7.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/pec/adidasArena/bg_adidas_v1.jpg`,Ex=e=>(0,lc.A)((0,ph.A)(e.map(([e,t])=>t.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),Tx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=e.event.tags.some(e=>"🏟️ Accor Arena"===e.name),o=(0,Ya.A)(t.accreditationsUsersInfos.map(e=>e.accreditation.acronym)),r=(0,ac.A)(t.accreditationsUsersInfos.flatMap(e=>"Parking"!==e.accreditationCategory.name&&e.accreditationSlot.date?.isValid?[[e.accreditation.name,e.accreditationSlot.date]]:[]),([e])=>e),a=(0,lc.A)((0,ph.A)(t.accreditationsUsersInfos.flatMap(e=>"PARK 30"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),l=(0,lc.A)((0,ph.A)(t.accreditationsUsersInfos.flatMap(e=>"PARK 38"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),d=(0,lc.A)((0,ph.A)(t.accreditationsUsersInfos.flatMap(e=>"Liv. P30"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),c=(0,lc.A)((0,ph.A)(t.accreditationsUsersInfos.flatMap(e=>"Liv. P38"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),u=(0,lc.A)((0,ph.A)(t.accreditationsUsersInfos.flatMap(e=>"PKG"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),h=(0,lc.A)((0,ph.A)(t.accreditationsUsersInfos.flatMap(e=>"PL"===e.accreditation.acronym&&e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),g=no(a)||no(l)||no(d)||no(c)||no(u)||no(h),p=t.positionsSlotsUsersInfos[0],f=n.fields?.cf37410?.value??"",x=t.ticketId;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${Sx(s)}) no-repeat`,backgroundSize:"cover",fontFamily:s?"$montserrat":"$franklinGothic",position:"relative"},height:Xm,width:Jm,children:[m(e.options.header?.content)&&(0,i.jsx)(yr,{css:{borderTopLeftRadius:"10px",borderTopRightRadius:"10px",left:"44px",overflow:"hidden",position:"absolute",top:"40px"},height:217,width:706,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsx)(yr,{css:{left:"92px",position:"absolute",top:"285px"},children:(0,i.jsx)(Jg,{email:n.email,image:n.fields?.picture?.url,name:n.name,size:56})}),(0,i.jsx)(yr,{css:{color:"black",fontSize:"22px",fontWeight:"700",left:"172px",position:"absolute",top:"296px"},children:n.name}),(0,i.jsx)(yr,{css:{color:"#0000e3",fontSize:"18px",fontWeight:"700",left:"172px",position:"absolute",top:"324px"},children:t.delegation?.name??""}),(0,i.jsx)(yr,{css:{left:"614px",position:"absolute",top:"281px"},height:80,width:80,children:m(x)&&(0,i.jsx)("img",{height:"100%",src:dg(x,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(Na,{css:{gap:"10px",left:"92px",position:"absolute",top:s?"521px":"501px"},width:610,wrap:"wrap",children:Object.entries(r).map(([e,t])=>(0,i.jsxs)(Na,{direction:"column",gap:"1",width:300,children:[(0,i.jsx)(yr,{css:{fontWeight:"600"},children:e}),(0,i.jsx)(Na,{css:{gap:"6px"},width:300,wrap:"wrap",children:Ex(t).map(e=>(0,i.jsx)(wx,{date:e},e.toMillis()))})]},`group-${t[0]}`))}),g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:s?"643px":"623px"},direction:"column",children:[(0,i.jsx)(yr,{fontWeight:"semiBold",children:"Plaque d'immatriculation"}),(0,i.jsx)(yr,{children:n.fields.cf29549?.value})]}),(0,i.jsxs)(Na,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:s?"643px":"623px"},direction:"column",children:[(0,i.jsx)(yr,{fontWeight:"semiBold",children:"Type de véhicule"}),(0,i.jsx)(yr,{children:f})]}),(0,i.jsxs)(Na,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"699px",visibility:no(a)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{fontWeight:"semiBold",children:"Parking Porte 30"}),(0,i.jsx)(Na,{css:{gap:"6px"},width:300,wrap:"wrap",children:a.map(e=>(0,i.jsx)(wx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Na,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"699px",visibility:no(l)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{fontWeight:"semiBold",children:"Parking Porte 38"}),(0,i.jsx)(Na,{css:{gap:"6px"},width:300,wrap:"wrap",children:l.map(e=>(0,i.jsx)(wx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Na,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"699px",visibility:no(d)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{fontWeight:"semiBold",children:"Livraison Porte 30"}),(0,i.jsx)(Na,{css:{gap:"6px"},width:300,wrap:"wrap",children:d.map(e=>(0,i.jsx)(wx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Na,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"699px",visibility:no(c)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{fontWeight:"semiBold",children:"Livraison Porte 38"}),(0,i.jsx)(Na,{css:{gap:"6px"},width:300,wrap:"wrap",children:c.map(e=>(0,i.jsx)(wx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Na,{css:{lineHeight:"20px",left:"92px",position:"absolute",top:"679px",visibility:no(u)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{fontWeight:"semiBold",children:"Parking Privé"}),(0,i.jsx)(Na,{css:{gap:"6px"},width:300,wrap:"wrap",children:u.map(e=>(0,i.jsx)(wx,{date:e},e.toMillis()))})]}),(0,i.jsxs)(Na,{css:{lineHeight:"20px",left:"402px",position:"absolute",top:"679px",visibility:no(h)?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{fontWeight:"semiBold",children:"Aire de livraison :"}),(0,i.jsx)(Na,{css:{gap:"6px"},width:300,wrap:"wrap",children:h.map(e=>(0,i.jsx)(wx,{date:e},e.toMillis()))})]})]}):(0,i.jsx)(Na,{align:"center",css:{fontWeight:"600",left:"97px",position:"absolute",top:"643px"},height:104,justify:"center",width:600,children:"Aucun véhicule autorisé"}),(0,i.jsxs)(Na,{css:{gap:"10px",left:"92px",position:"absolute",top:s?"817px":"795px"},direction:"column",width:219,children:[o.includes("P38")&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{fontWeight:"600"},children:"Porte 38 (selon horaire)"}),(0,i.jsx)(yr,{children:"Accor Arena"}),(0,i.jsx)(yr,{children:"8 Bd de Bercy,"}),(0,i.jsx)(yr,{children:"75012 Paris"})]}),o.includes("P30")&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{fontWeight:"600"},children:"Porte 30"}),(0,i.jsx)(yr,{children:"Accor Arena"}),(0,i.jsx)(yr,{children:"222 Quai de Bercy,"}),(0,i.jsx)(yr,{children:"75012 Paris"})]}),o.includes("P4")&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{fontWeight:"600"},children:"Porte 4"}),(0,i.jsx)(yr,{children:"Accor Arena"}),(0,i.jsx)(yr,{children:"8 Bd de Bercy,"}),(0,i.jsx)(yr,{children:"75012 Paris"})]}),o.includes("P35/36")&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{fontWeight:"600"},children:"Porte 35/36"}),(0,i.jsx)(yr,{children:"Accor Arena"}),(0,i.jsx)(yr,{children:"Boulevard de Bercy,"}),(0,i.jsx)(yr,{children:"75012 Paris"})]}),o.includes("P28")&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{fontWeight:"600"},children:"Porte 35/36"}),(0,i.jsx)(yr,{children:"Accor Arena"}),(0,i.jsx)(yr,{children:"222 Quai de Bercy,"}),(0,i.jsx)(yr,{children:"75012 Paris"})]}),o.includes("PP+PM")&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{fontWeight:"600"},children:"Accès principal"}),(0,i.jsx)(yr,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(yr,{children:"75018 Paris"})]}),o.includes("PP+PE")&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{fontWeight:"600"},children:"Entrée prestataire et exploitation"}),(0,i.jsx)(yr,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(yr,{children:"75018 Paris"})]}),o.includes("ORG + EXP")&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{fontWeight:"600"},children:"Entrée organisation exploitation"}),(0,i.jsx)(yr,{children:"Avenue de la Porte de la Chapelle"}),(0,i.jsx)(yr,{children:"75018 Paris"})]})]})]}),p&&(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/pec/accorArena/Fiche_Affectation_Accor.jpg) no-repeat`,backgroundSize:"cover",fontFamily:s?"$montserrat":"$franklinGothic",pageBreakBefore:"always",position:"relative"},height:Xm,width:Jm,children:[m(e.options.header?.content)&&(0,i.jsx)(yr,{css:{borderTopLeftRadius:"10px",borderTopRightRadius:"10px",left:"44px",overflow:"hidden",position:"absolute",top:"44px"},height:217,width:706,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsxs)(Na,{css:{position:"absolute",px:"92px",top:"381px"},direction:"column",children:[(0,i.jsx)(yr,{css:{color:"black",fontSize:"14px",fontWeight:"700"},children:p.position.name}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray800",css:{fontWeight:"600",textTransform:"capitalize"},children:p.positionSlot.range.start.toLocaleString(Js.DateOnly.WeekdayLongMonthLong,{locale:"fr"})}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(yr,{css:{color:"black"},children:(0,i.jsx)(xg,{css:{"& > p:first-child":{marginTop:0},"& > p:last-child":{marginBottom:0}},text:p.position.description})})]})]})]})},zx=e=>3376===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_reims_v2.jpg`:3827===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_corrida.jpg`:3823===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_semi_boulogne.jpg`:3808===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_toulouse.jpg`:5233===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_unicef.jpg`:5158===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_marseille.jpg`:5644===e||5341===e?`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_montpellier.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/playground/fiche_gcsd_v3.jpg`,Ox=e=>3376===e?{color:"#c2ab62",fontFamily:"$movement",fontSize:"24px",fontWeight:"900",textTransform:"uppercase"}:3827===e?{color:"#ec1c24",fontFamily:"$graphie",fontSize:"24px",fontWeight:"800",textTransform:"uppercase"}:3823===e?{color:"#ff9900",fontFamily:"$archerBoldPro",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"}:3808===e?{color:"#f39fc5",fontFamily:"$helveticaNeue97BlackCondensed",fontSize:"24px",fontWeight:"900",textTransform:"uppercase"}:5233===e?{color:"#1eaae3",fontFamily:"$roboto",fontSize:"24px",fontWeight:"800",textTransform:"uppercase"}:5158===e?{color:"#b3cc1b",fontFamily:"$acumin",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"}:5644===e||5341===e?{color:"#662483",fontFamily:"$chillax",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"}:{color:"#bfbe00",fontFamily:"$atrament",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},Rx=e=>3827===e||5233===e?{top:"859px"}:5158===e?{top:"746px"}:5644===e||5341===e?{top:"744px"}:{top:"915px"},$x=e=>{const t=e.vr.userInfo,n=e.positionSlotUserInfo.position,s=e.positionSlotUserInfo.positionSlot,o=n.leaders[0],r=n.leaders[1],a=3376===(l=e.eventId)?{color:"#2b2378",fontFamily:"$movement",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"}:3827===l?{color:"#434343",fontFamily:"$graphie",fontSize:"16px",fontWeight:"800",textTransform:"uppercase"}:3823===l?{color:"#1d2b71",fontFamily:"$archerBoldPro",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:3808===l?{color:"#161b4a",fontFamily:"$helveticaNeue97BlackCondensed",fontSize:"18px",fontWeight:"900",textTransform:"uppercase"}:5233===l?{color:"#434343",fontFamily:"$roboto",fontSize:"18px",fontWeight:"800",textTransform:"uppercase"}:5158===l?{color:"#161b4a",fontFamily:"$acumin",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:5644===l||5341===l?{color:"#161b4a",fontFamily:"$chillax",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"}:{color:"black",fontFamily:"$atrament",fontSize:"18px",fontWeight:"700",textTransform:"uppercase"};var l;return(0,i.jsxs)(Na,{css:{background:`url(${zx(e.eventId)}) no-repeat`,backgroundSize:"cover",color:"#333333",position:"relative"},direction:"column",height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{color:5233===e.eventId?"white":"#333333",fontSize:"22px",fontWeight:"700",position:"absolute",right:"40px",textTransform:"uppercase",top:"136px"},children:t.name}),(0,i.jsxs)(Na,{css:{left:"210px",padding:"$7 $8 0 $8",position:"absolute",top:"170px"},direction:"column",width:584,children:[(0,i.jsx)(yr,{css:Ox(e.eventId),textAlign:"center",width:1,children:n.name}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{css:a,children:"Détails de la mission :"}),(0,i.jsx)(qa,{height:"2"}),m(n.description)&&(0,i.jsx)(yr,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(xg,{text:n.description})}),Th(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{css:a,children:"Lieu de mission :"}),Sh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{children:n.address})]}),Eh(n)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{height:180,width:1,children:(0,i.jsx)("a",{href:_g(n.latitude,n.longitude),style:{background:`url(${P.HEAVENT_API_URL}/image/event/${e.eventId}/position/${n.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{css:a,children:"À cette heure ci :"}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(Na,{css:{gap:"22px"},width:1,children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{css:{fontWeight:"700"},children:s.range.start.toFormat("dd MMMM yyyy",{locale:"fr"})}),(0,i.jsxs)(yr,{children:["De ",s.range.start.toFormat("H'h'mm")," à"," ",s.range.end.toFormat("H'h'mm")]})]}),o&&(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{css:{fontWeight:"700"},children:"Mon contact d'urgence"}),(0,i.jsxs)(yr,{children:[o.userInfo.firstName," :"," ",o.userInfo.phone?.internationalFormat]}),r&&(0,i.jsxs)(yr,{children:[r.userInfo.firstName," :"," ",r.userInfo.phone?.internationalFormat]})]})]}),(0,i.jsx)(qa,{height:"6"}),m(n.fields.cf38780)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:a,children:"Transports"}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{dangerouslySetInnerHTML:{__html:n.fields.cf38780.split("\n").join("
")}})]})]}),(0,i.jsx)(yr,{css:{left:"53px",position:"absolute",...Rx(e.eventId)},height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:dg(e.vr.ticketId,{height:104,width:104}),width:"100%"})})]})},Dx=e=>{const t=(0,L.useMemo)(()=>(0,lc.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event.volunteerRegistration.positionsSlotsUsersInfos]);return(0,i.jsx)(i.Fragment,{children:t.map(t=>(0,i.jsx)($x,{eventId:e.event.id,positionSlotUserInfo:t,vr:e.event.volunteerRegistration},t.positionSlot.id))})},Px=e=>{const t=e.event.volunteerRegistration,n=t.userInfo;return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/roiarthur/roiarthur.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{color:"#181d3a",fontSize:"18px",fontWeight:"700",left:"426px",position:"absolute",textAlign:"center",top:"89px"},width:320,children:n.name}),(0,i.jsxs)(yr,{css:{color:"#181d3a",fontSize:"12px",left:"426px",position:"absolute",textAlign:"center",top:"116px"},width:320,children:["Numéro code-barres : ",t.ticketId]}),(0,i.jsx)(yr,{css:{left:"530px",position:"absolute",top:"144px"},height:114,width:114,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:114,width:114}),width:"100%"})})]})},Fx=(e,t)=>t?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page1.jpg`:"Direction"===e||"All Access"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page1.jpg`:"Backstage"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page1.jpg`:"Stand & Food & Bar"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/stand/stand_page1.jpg`:"Agora"===e||"Agora F"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page1.jpg`:"",Mx=(e,t)=>t?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page2.jpg`:"Direction"===e||"All Access"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page2.jpg`:"Backstage"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page2.jpg`:"Agora"===e||"Agora F"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page2.jpg`:"",Nx=(e,t)=>t?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/benevole_page3.jpg`:"Direction"===e||"All Access"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/direction/direction_page3.jpg`:"Backstage"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/backstage/backstage_page3.jpg`:"Stand & Food & Bar"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/stand/stand_page3.jpg`:"Agora"===e||"Agora F"===e?`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/agora/agora_page3.jpg`:"",Lx=e=>(0,i.jsx)(yr,{css:{left:`${e.left}px`,position:"absolute",top:`${e.top}px`},children:(0,i.jsx)("img",{height:"19px",src:`${P.HEAVENT_ASSETS_URL}/badges/rose/v3/benevole/bracelet_asset.png`,width:"38px"})}),Bx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=3571===e.event.id,o=wg(n.fields,"population"),r=t.accreditationsUsersInfos.find(e=>1602===e.accreditationCategory.id)?.accreditation.name||"",a="Direction"===r||"All Access"===r||"Backstage"===r,l=(0,lc.A)((0,ph.A)(t.accreditationsUsersInfos.flatMap(e=>e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis()),d=(0,lc.A)((0,ph.A)(t.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),c=(s?d:l).filter(e=>[29,30,31,1].includes(e.day)),u=t.accreditationsUsersInfos.flatMap(e=>3229===e.accreditation.id?[e.accreditationSlot.name]:[]),h=t.accreditationsUsersInfos.flatMap(e=>3230===e.accreditation.id?[e.accreditationSlot.name]:[]),g=(0,Ya.A)([u.includes("29")?"Midi":null,h.includes("29")?"Soir":null]).join(" & "),p=(0,Ya.A)([u.includes("30")?"Midi":null,h.includes("30")?"Soir":null]).join(" & "),f=(0,Ya.A)([u.includes("31")?"Midi":null,h.includes("31")?"Soir":null]).join(" & "),x=(0,Ya.A)([u.includes("1")?"Midi":null,h.includes("1")?"Soir":null]).join(" & "),_=t.accreditationsUsersInfos.flatMap(e=>3436===e.accreditation.id?[e.accreditationSlot.name]:[]),I=t.accreditationsUsersInfos.flatMap(e=>3439===e.accreditation.id?[e.accreditationSlot.name]:[]),v=t.accreditationsUsersInfos.flatMap(e=>3437===e.accreditation.id?[e.accreditationSlot.name]:[]),b=t.accreditationsUsersInfos.flatMap(e=>3438===e.accreditation.id?[e.accreditationSlot.name]:[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${Fx(r,s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$neueMontreal",position:"relative"},height:Xm,width:Jm,children:[!s&&(0,i.jsx)(yr,{css:{color:"#ee78ac",fontFamily:"$helveticaBlackCondensed",fontSize:"22px",fontWeight:"900",left:"251px",position:"absolute",textTransform:"uppercase",top:"130px"},textAlign:"center",width:292,children:o}),!s&&(0,i.jsxs)(yr,{css:{color:"black",fontSize:"18px",fontWeight:"700",left:"299px",position:"absolute",top:"167px"},textAlign:"center",width:244,children:["Bracelet ",r]}),(0,i.jsxs)(yr,{css:{color:"black",fontSize:"24px",fontWeight:"700",lineHeight:"28px",left:"95px",position:"absolute",textTransform:"uppercase",top:"237px"},children:[n.fields?.firstName?.value||"",(0,i.jsx)("br",{}),n.fields?.lastName?.value||""]}),!s&&(0,i.jsx)(yr,{css:{color:"#ee78ac",fontSize:"18px",fontWeight:"700",left:"95px",position:"absolute",top:"295px"},children:t.delegation?.name}),(0,i.jsx)(yr,{css:{position:"absolute",right:"95px",top:"232px"},height:90,width:90,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:90,width:90}),width:"100%"})}),(0,i.jsx)(Na,{css:{gap:"6px",left:"95px",position:"absolute",top:"430px"},children:c.map((e,t)=>(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid black",borderRadius:"4px",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(yr,{css:{color:"black",fontFamily:"Helvetica",fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(yr,{css:{color:"black",fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMMM",{locale:"fr"})})]},t))}),_.includes("29")&&(0,i.jsx)(Lx,{left:289,top:803}),_.includes("30")&&(0,i.jsx)(Lx,{left:402,top:803}),_.includes("31")&&(0,i.jsx)(Lx,{left:515,top:803}),_.includes("1")&&(0,i.jsx)(Lx,{left:628,top:803}),I.includes("29")&&(0,i.jsx)(Lx,{left:289,top:839}),I.includes("30")&&(0,i.jsx)(Lx,{left:402,top:839}),I.includes("31")&&(0,i.jsx)(Lx,{left:515,top:839}),I.includes("1")&&(0,i.jsx)(Lx,{left:628,top:839}),v.includes("29")&&(0,i.jsx)(Lx,{left:289,top:875}),v.includes("30")&&(0,i.jsx)(Lx,{left:402,top:875}),v.includes("31")&&(0,i.jsx)(Lx,{left:515,top:875}),v.includes("1")&&(0,i.jsx)(Lx,{left:628,top:875}),b.includes("29")&&(0,i.jsx)(Lx,{left:289,top:911}),b.includes("30")&&(0,i.jsx)(Lx,{left:402,top:911}),b.includes("31")&&(0,i.jsx)(Lx,{left:515,top:911}),b.includes("1")&&(0,i.jsx)(Lx,{left:628,top:911})]}),"Stand & Food & Bar"!==r&&(0,i.jsx)(Na,{css:{background:`url(${Mx(r,s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$neueMontreal",pageBreakBefore:"always",position:"relative"},height:Xm,width:Jm,children:a&&(0,i.jsxs)(Na,{css:{fontWeight:"700",left:"95px",lineHeight:"20px",position:"absolute",top:"598px"},direction:"column",children:[m(g)&&(0,i.jsxs)(yr,{children:["29 août : ",g]}),m(p)&&(0,i.jsxs)(yr,{children:["30 août : ",p]}),m(f)&&(0,i.jsxs)(yr,{children:["31 août : ",f]}),m(x)&&(0,i.jsxs)(yr,{children:["1 septembre : ",x]})]})}),(0,i.jsx)(Na,{css:{background:`url(${Nx(r,s)}) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Xm,width:Jm}),!s&&"Agora"!==r&&(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/rose/v3/page4.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always"},height:Xm,width:Jm})]})},Vx=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.find(e=>1662===e.accreditationCategory.id),o=(0,lc.A)((0,ph.A)(t.accreditationsUsersInfos.flatMap(e=>e.accreditationSlot.date?[e.accreditationSlot.date.startOf("day")]:[]),e=>e.toMillis()),e=>e.toMillis());return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/rose/parking_vide.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(Na,{css:{position:"absolute",top:"232px"},justify:"center",width:1,children:(0,i.jsx)(yr,{css:{background:s?.accreditation.color,color:Zd(s?.accreditation.color||"#000000"),fontSize:"50px",fontWeight:"800",padding:"$1 $3",textTransform:"uppercase"},children:s?.accreditation.name||"parking"})}),(0,i.jsx)(yr,{css:{fontFamily:"$bnCartaNoirBold",fontSize:"36px",fontWeight:"700",left:"48px",position:"absolute",textTransform:"uppercase",top:"353px"},children:n.name}),(0,i.jsx)(yr,{css:{position:"absolute",right:"57px",top:"359px"},height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(Na,{css:{gap:"6px",left:"48px",position:"absolute",top:"436px"},children:o.map((e,t)=>(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid black",borderRadius:"4px",padding:"4px 6px"},direction:"column",justify:"center",children:[(0,i.jsx)(yr,{css:{color:"black",fontFamily:"Helvetica",fontSize:"16px",fontWeight:"700"},children:e.toFormat("dd")}),(0,i.jsx)(yr,{css:{color:"black",fontSize:"10px",fontWeight:"500",textTransform:"uppercase"},children:e.toFormat("MMMM",{locale:"fr"})})]},t))})]})},Ux=e=>{const t=e.event.volunteerRegistration.userInfo.formsUsersInfos.map(e=>e.formId);return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/salamandre/2024/verso_v2.jpg) no-repeat`,backgroundSize:"cover",overflow:"hidden",paddingBottom:"24px",paddingTop:"56px",px:"16px"},direction:"column",height:tg-5,width:ng,children:[(0,i.jsx)(yr,{css:{color:"#336998",fontSize:"10px",fontWeight:"700"},children:"Renseignements complémentaires"}),(0,i.jsx)(qa,{height:"3"}),t.includes(2163)?e.event.volunteerRegistration.positionsSlotsUsersInfos.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Responsable de la mission"}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:(0,Ns.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos.flatMap(e=>e.position.leaders.map(e=>`${e.userInfo.name} : ${e.userInfo.phone?.internationalFormat??"-"}`))).join(", ")}),(0,i.jsx)(qa,{height:"4"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Responsable des bénévoles"}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"Anika Andenmatten : 079 689 52 51"}),(0,i.jsx)(qa,{height:"4"})]}),(0,i.jsx)(yr,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Police"}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"117"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Pompiers"}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"118"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{css:{color:"#5a9e9f",fontSize:"8px",fontWeight:"600"},children:"Ambulance"}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{css:{color:"#336998",fontSize:"10px",fontWeight:"500"},children:"144"})]})};var Wx;function Gx(){return Gx=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,i.jsxs)(Na,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(Na,{align:"center",css:{background:"white",borderRadius:"34px",color:"#336998",height:"34px",width:"34px",svg:{fill:"#5a9e9f",height:"50%",width:"50%"}},justify:"center",children:"Camera"===e.icon?(0,i.jsx)(If,{}):(0,i.jsx)(Hx,{})}),(0,i.jsx)(yr,{css:{color:"#761c31",fontSize:"10px"},children:e.name})]}),Yx={MAsoir:1,MERC:2,MEmatin:3,MEmidi:4,MEsoir:5,JEUD:6,JEmatin:7,JEmidi:8,JEsoir:9,VEND:10,VEmatin:11,VEmidi:12,VEsoir:13,SAM:14,SAmatin:15,SAmidi:16,SAsoir:17,DIM:18,DImatin:19,DImidi:20,DIsoir:21},Kx=e=>{const t=e.event.volunteerRegistration.userInfo,n=(0,lc.A)(e.event.volunteerRegistration.accreditationsUsersInfos,e=>Yx[e.accreditation.acronym||""]||-1),s=e.event.volunteerRegistration.userInfo.formsUsersInfos.map(e=>e.formId),o=t.fields?.cf11135?.value??"",r=t.fields?.cf10429?.value??"";return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/salamandre/2024/recto.jpg) no-repeat`,backgroundSize:"cover",overflow:"hidden",padding:"12px 14px",position:"relative"},direction:"column",height:tg-5,width:ng,children:[(0,i.jsx)(yr,{color:"white",css:{fontFamily:"$gravur",fontSize:"22px",left:"0",position:"absolute",textAlign:"center",top:"117px",width:"100%"},children:t.name}),(0,i.jsx)(yr,{color:"white",css:{fontSize:"20px",fontWeight:"800",left:"0",position:"absolute",textAlign:"center",top:"139px",width:"100%"},children:s.includes(2164)?o:r}),(0,i.jsx)(cd,{css:{flex:"1",gap:"8px 40px",padding:"12px 36px",position:"absolute",top:"194px",left:0},gridtemplatecolumns:"repeat(3, 1fr)",gridtemplaterows:"repeat(3, 1fr)",height:187,width:1,children:n.map((e,t)=>(0,i.jsx)(qx,{icon:e.accreditation.icon,name:e.accreditation.acronym||""},t))})]})},Zx=e=>(0,i.jsxs)(Na,{height:tg,width:2*ng,children:[(0,i.jsx)(Kx,{event:e.event}),(0,i.jsx)(Ux,{event:e.event})]}),Xx=e=>(0,i.jsx)(Na,{height:Xm,width:Jm,children:(0,i.jsx)(Zx,{event:e.event})}),Jx=e=>(0,i.jsx)(i.Fragment,{children:(0,Yg.A)(e.event.volunteersRegistrations.nodes,8).map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Na,{css:{overflow:"hidden",pageBreakBefore:0!==n?"always":void 0},height:1,width:Xm,wrap:"wrap",children:t.map(t=>(0,i.jsx)(Kx,{event:{...e.event,volunteerRegistration:t}},`front-${t.userInfo.id}`))}),(0,i.jsx)(Na,{css:{overflow:"hidden",pageBreakBefore:"always"},height:1,width:Xm,wrap:"wrap",children:(0,Yg.A)(t,4).map(t=>(0,i.jsx)(Na,{direction:"rowReverse",width:1,children:t.map(t=>(0,i.jsx)(Ux,{event:{...e.event,volunteerRegistration:t}},`back-${t.userInfo.id}`))},`group-${t[0].utid}`))})]},`page-${n}`))}),Qx="#e30613",e_="#26306b",t_={cf25078:"Parcours",cf25079:"Plan village",cf25080:"Poste vélo",cf25511:"Poste course à pied",cf25512:"Plan d'accès"},n_=Object.keys(t_),i_=e=>{const t=qn(Kc),n=e.positionSlotUserInfo.position,s=n.category,o=e.positionSlotUserInfo.positionSlot,r=s.leaders[0],a=n_.some(e=>m(n.fields[e]?.url)),l=a||"Restauration athlètes"===s.name||"Ravitaillement"===s.name||"Retrait des dossards"===s.name;return(0,i.jsxs)(Na,{css:{background:"white",fontFamily:"$roboto"},direction:"column",height:Xm,width:Jm,children:[(0,i.jsxs)(Na,{height:185,width:1,children:[(0,i.jsx)(Na,{height:1,width:185,children:m(e.options.logo?.content)&&(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"100%"})}),(0,i.jsx)(Na,{css:{padding:"$4 $7"},width:609,children:(0,i.jsxs)(Na,{direction:"column",justify:"between",width:1,children:[(0,i.jsxs)(Na,{justify:"between",width:1,children:[(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsx)(yr,{css:{color:Qx,fontSize:"34px",fontWeight:"700",lineHeight:"40px"},children:m(n.acronym)?n.acronym:n.name}),(0,i.jsxs)(yr,{css:{color:Qx,ellipsis:!0,fontSize:"18px",fontWeight:"700"},children:["POSTE / ",s.name]})]}),l&&(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsx)(yr,{css:{color:Qx,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Adresse"}),(0,i.jsx)(yr,{css:{color:e_,fontSize:"16px",fontWeight:"500",textAlign:"right"},children:n.address})]})]}),l&&(0,i.jsxs)(Na,{justify:"between",width:1,children:[(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{color:e_,fontSize:"18px",fontWeight:"700"},children:"Point GPS"}),(0,i.jsxs)(yr,{css:{color:Qx,fontSize:"16px",fontWeight:"500"},children:[n.latitude,", ",n.longitude]})]}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{color:e_,fontSize:"18px",fontWeight:"700",textAlign:"right"},children:"Horaires de mission"}),(0,i.jsxs)(yr,{css:{color:Qx,fontSize:"16px",fontWeight:"500",textAlign:"right",textTransform:"capitalize"},children:[t.toLocaleString(o.range.start,{month:"short",day:"numeric",weekday:"short"})," ","| ",o.range.start.toFormat("HH'h'mm")," -"," ",o.range.end.toFormat("HH'h'mm")]})]})]}),!l&&(0,i.jsx)(Na,{width:1,children:(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{color:Qx,fontSize:"18px",fontWeight:"700"},children:"Adresse"}),(0,i.jsx)(yr,{css:{color:e_,fontSize:"16px",fontWeight:"500"},children:n.address})]})})]})})]}),(0,i.jsx)(yr,{css:{background:Qx},height:10,width:1}),(0,i.jsxs)(Na,{css:{flex:"1",padding:"$6 $7"},direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yr,{css:{color:Qx,fontSize:"20px",fontWeight:"700"},children:"VOTRE MISSION"}),(0,i.jsx)(yr,{css:{color:e_,fontSize:"16px",fontWeight:"500","& .h-rich-text > p":{margin:0}},children:(0,i.jsx)(xg,{text:n.description})})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{background:Qx},height:10,width:1}),(0,i.jsx)(Na,{css:{padding:"$5 $7"},gap:"5",height:335,width:1,children:n_.map(e=>{if(m(n.fields[e]?.url)){const t=t_[e];return(0,i.jsxs)(Na,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(yr,{css:{color:Qx,fontSize:"20px",fontWeight:"700"},children:t}),(0,i.jsx)(yr,{height:255,width:1,children:(0,i.jsx)("img",{height:"100%",src:n.fields[e].url,width:"100%"})})]},e)}return null})})]}),(0,i.jsx)(Na,{align:"center",css:{background:Qx,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Vous rencontrez un problème ?"}),(0,i.jsxs)(Na,{css:{padding:"$4"},direction:"column",height:88,width:1,children:[(0,i.jsx)(yr,{css:{color:e_,fontSize:"20px",fontWeight:"500",textAlign:"center"},width:1,children:"Contactez votre responsable de secteur"}),r&&(0,i.jsxs)(yr,{css:{color:e_,fontSize:"20px",fontWeight:"700",textAlign:"center"},width:1,children:[r.userInfo.name," : ",r.userInfo.phone?.internationalFormat]})]}),(0,i.jsx)(Na,{align:"center",css:{background:e_,color:"white",fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},height:40,justify:"center",width:1,children:"Merci"})]})},s_=e=>(0,i.jsx)(i.Fragment,{children:e.event.volunteerRegistration.positionsSlotsUsersInfos.map((t,n)=>(0,i.jsx)(i_,{options:e.options,positionSlotUserInfo:t,userInfo:e.event.volunteerRegistration.userInfo},n))}),o_=e=>{switch(e){case"Organisateur":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Organisation_Recto.jpg`;case"Bénévole":default:return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Benevole_Recto.jpg`;case"Partenaire":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Partenaire_Recto.jpg`;case"Officiel":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Officiel_Recto.jpg`;case"Exposant":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Exposant_Recto.jpg`;case"Prestataire":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Intervenant_Recto.jpg`}},r_=e=>{switch(e){case"Organisateur":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Organisation_Verso.jpg`;case"Bénévole":default:return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Benevole_Verso.jpg`;case"Partenaire":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Partenaire_Verso.jpg`;case"Exposant":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Exposant_Verso.jpg`;case"Prestataire":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Intervenant_Verso.jpg`;case"Officiel":return`${P.HEAVENT_ASSETS_URL}/badges/triathlonLaRochelle/2025/Officiel_Verso.jpg`}},a_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n?.fields?.cf27672?.value||"Organisateur",o=(0,lc.A)(t.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),r="Organisateur"!==s&&"Bénévole"!==s,a="Organisateur"===s||"Bénévole"==s;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${o_(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:597,width:435,children:[(0,i.jsx)(yr,{css:{color:"black",fontSize:"22px",fontWeight:"700",position:"absolute",top:"449px"},textAlign:"center",width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{color:"black",fontSize:"22px",fontWeight:"700",position:"absolute",top:"478px"},textAlign:"center",width:1,children:n.fields?.lastName?.value||""}),r&&(0,i.jsx)(yr,{css:{color:"black",fontSize:"18px",fontWeight:"500",position:"absolute",top:"519px"},textAlign:"center",width:1,children:n.fields?.cf27673?.value})]}),(0,i.jsx)(Na,{css:{background:`url(${r_(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",pageBreakBefore:"always",position:"relative"},height:597,width:435,children:a&&(0,i.jsx)(Na,{css:{position:"absolute",top:"83px"},direction:"column",gap:"2",width:1,children:o.map(e=>(0,i.jsxs)(yr,{css:{color:"black",fontSize:"12px",fontWeight:"500"},textAlign:"center",width:1,children:[e.position.name," :"," ",e.positionSlot.range.start.toFormat("dd MMMM yyyy H'h'mm",{locale:"fr"})," ","à ",e.positionSlot.range.end.toFormat("H'h'mm")]},e.id))})})]})},l_=e=>e.includes("Intervenant")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Bordeaux.jpg`:e.includes("VIP")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Dore.jpg`:e.includes("Protocole")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Blanc.jpg`:e.includes("Accrédité")||e.includes("Spare")||e.includes("Press")||e.includes("Pro")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Vert.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/a4/A4_Noir.jpg`,d_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf24297?.value||"Spare",o=s.includes("Protocole")?"black":"white";return(0,i.jsxs)(Na,{css:{background:`url(${l_(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$utopiales",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"408px"},textAlign:"center",width:397,children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"447px"},textAlign:"center",width:397,children:n.fields?.lastName?.value||""}),(0,i.jsx)(yr,{css:{color:o,fontSize:"24px",position:"absolute",textTransform:"uppercase",top:"505px"},textAlign:"center",width:397,children:s.includes("Bénévole")?s:s.includes("VIP")?"Pass VIP":n.fields.cf38606?.value}),(0,i.jsx)(yr,{css:{fontFamily:"$default",fontSize:"16px",left:"397px",position:"absolute",top:"300px"},textAlign:"center",width:397,children:"Code membre :"}),(0,i.jsx)(yr,{css:{left:"543px",position:"absolute",top:"367px"},height:106,width:106,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:106,width:106}),width:"100%"})})]})},c_=e=>e.includes("Intervenant")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Inrae_Recto.jpg`:e.includes("VIP")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Pass_vip_Recto.jpg`:e.includes("Protocole")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Ville_de_Nantes_Recto.jpg`:e.includes("Accrédité")||e.includes("Spare")||e.includes("Press")||e.includes("Pro")?`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Cea_Recto.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Staff_Recto.jpg`,u_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf24297?.value||"Spare",o=s.includes("Protocole")?"black":"white";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${c_(s)}) no-repeat`,backgroundSize:"cover",fontFamily:"$utopiales",position:"relative"},height:490,width:340,children:[(0,i.jsx)(yr,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"336px"},textAlign:"center",width:1,children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{color:o,fontSize:"32px",position:"absolute",textTransform:"uppercase",top:"375px"},textAlign:"center",width:1,children:n.fields?.lastName?.value||""}),(0,i.jsx)(yr,{css:{color:o,fontSize:"24px",position:"absolute",textTransform:"uppercase",top:"433px"},textAlign:"center",width:1,children:s.includes("Bénévole")?s:s.includes("VIP")?"Pass VIP":n.fields.cf38606?.value})]}),(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/utopiales/2024/imprimeur_v2/Verso.jpg) no-repeat`,backgroundSize:"cover",pageBreakBefore:"always",position:"relative"},height:490,width:340,children:[(0,i.jsx)(yr,{css:{fontSize:"16px",position:"absolute",top:"258px"},textAlign:"center",width:1,children:"Code membre :"}),(0,i.jsx)(yr,{css:{left:"117px",position:"absolute",top:"315px"},height:106,width:106,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:106,width:106}),width:"100%"})})]})]})},h_=Us.IX.after(Us.c9.fromObject({day:23,month:8,year:2024}),Us.dw.fromObject({day:3})),m_=e=>Us.IX.fromDateTimes(Us.c9.fromObject({day:e,month:8,year:2024,hour:7}),Us.c9.fromObject({day:e,month:8,year:2024,hour:25===e?15:16})),g_=e=>Us.IX.fromDateTimes(Us.c9.fromObject({day:e,month:8,year:2024,hour:25===e?15:16}),Us.c9.fromObject({day:e+1,month:8,year:2024,hour:4})),p_=e=>Us.IX.after(Us.c9.fromObject({day:e,month:8,year:2024}),Us.dw.fromObject({day:1})),f_=({event:e})=>{const t=e.volunteerRegistration,n=t.userInfo,s=n.fields?.cf22493?.value??"",o=n.fields?.cf26370?.value??"",r=t.positionsSlotsUsersInfos.filter(e=>e.positionSlot.range.overlaps(h_)),a=(0,Ns.A)(r.map(e=>e.position.category.name)).join(", "),l=r.reduce(([e,t,n],i)=>[e||i.positionSlot.range.overlaps(p_(23)),t||i.positionSlot.range.overlaps(p_(24)),n||i.positionSlot.range.overlaps(p_(25))],[!1,!1,!1]),d=(0,Ya.A)((0,Ns.A)(t.positionsSlotsUsersInfos.flatMap(e=>[e.positionSlot.range.start?.day,e.positionSlot.range.end?.day])));let c=0;d.length>2?c=2:d.length>0&&(c=1);const u=l.reduce((e,t)=>t?e+12:e,0),h=r.reduce(([e,t],n)=>{const i=n.positionSlot.range;return[[e[0]||i.overlaps(m_(23)),e[1]||i.overlaps(m_(24)),e[2]||i.overlaps(m_(25))],[t[0]||i.overlaps(g_(23)),t[1]||i.overlaps(g_(24)),t[2]||i.overlaps(g_(25))]]},[[!1,!1,!1],[!1,!1,!1]]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vandb/Contremarque_1.jpg) no-repeat`,backgroundSize:"cover",color:"#103725",fontFamily:"$firaSans",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsxs)(Na,{css:{gap:"10px",justifyContent:"space-between",left:"109px",position:"absolute",top:"181px",right:"109px"},children:[(0,i.jsxs)(Na,{css:{flexDirection:"column",gap:"6px"},children:[(0,i.jsx)(yr,{css:{fontFamily:"$badTyp",fontSize:"22px",fontWeight:500,lineHeight:"28px",textTransform:"uppercase"},children:n.name}),(0,i.jsxs)(yr,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:s}),` | ${a}`]}),(0,i.jsxs)(yr,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:"T-shirt :"}),` ${c} en taille ${o||""}`]}),(0,i.jsxs)(yr,{css:{fontSize:"16px",lineHeight:"normal"},children:[(0,i.jsx)("span",{style:{fontWeight:700},children:"Montant EXO :"}),` ${u}`]})]}),(0,i.jsxs)(Na,{css:{alignItems:"flex-end",flexDirection:"column",gap:"4px"},children:[(0,i.jsx)(yr,{height:80,width:80,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:80,width:80}),width:"100%"})}),(0,i.jsx)(yr,{css:{fontSize:"10px"},children:t.ticketId})]})]}),h[0][0]&&(0,i.jsx)(Na,{css:{height:"32px",justifyContent:"center",left:"265px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[0][1]&&(0,i.jsx)(Na,{css:{height:"32px",justifyContent:"center",left:"407px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[0][2]&&(0,i.jsx)(Na,{css:{height:"32px",justifyContent:"center",left:"549px",padding:"4px 10px",position:"absolute",top:"809px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][0]&&(0,i.jsx)(Na,{css:{height:"32px",justifyContent:"center",left:"265px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][1]&&(0,i.jsx)(Na,{css:{height:"32px",justifyContent:"center",left:"407px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})}),h[1][2]&&(0,i.jsx)(Na,{css:{height:"32px",justifyContent:"center",left:"549px",padding:"4px 10px",position:"absolute",top:"845px",width:"138px"},children:(0,i.jsx)("img",{height:"100%",src:`${P.HEAVENT_ASSETS_URL}/badges/vandb/catering.png`})})]}),(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vandb/Contremarque_2.jpg) no-repeat`,backgroundSize:"cover"},height:Xm,width:Jm})]})},x_=e=>(0,i.jsxs)(Na,{align:"center",css:{visibility:e.visible?"visible":"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{css:{border:"1px solid white",borderRadius:"6px"},height:24,width:24}),(0,i.jsx)(yr,{css:{color:"white",fontSize:"8px",fontWeight:"500"},children:e.children})]}),__=e=>{switch(e){case"BENEVOLES":return"#f49538";case"PARTENAIRES":return"#fecc16";case"EXPOSANTS":return"#17bd6d";case"MEDIAS":case"PHOTOGRAPHE":case"VIDÉASTE":return"#fd5e97";case"FOURNISSEURS":case"PRESTATAIRES":case"OFFICIEL":return"#da43c2";case"MEDICAL":return"#ff0000";case"ORGANISATION":return"#36b3e9";default:return""}},I_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=n.fields?.cf18560?.value||"",o=t.accreditationsUsersInfos.map(e=>e.accreditation.acronym||"");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vannes/2024/recto.png) no-repeat`,backgroundColor:__(s),backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:454,width:378,children:[(0,i.jsx)(yr,{css:{fontSize:"20px",fontWeight:"700",left:"39px",position:"absolute",top:"167px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"20px",fontWeight:"700",left:"39px",position:"absolute",top:"195px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"20px",fontWeight:"500",left:"39px",position:"absolute",textTransform:"capitalize",top:"241px"},children:s.toLowerCase()}),(0,i.jsx)(Na,{css:{left:"41px",position:"absolute",top:"347px"},gap:"2",children:(0,Oc.A)(1,8).map(e=>(0,i.jsx)(Na,{align:"center",css:{background:"#00e5ff",borderRadius:"32px",fontSize:"18px",fontWeight:"700",visibility:o.includes(e.toString(10))?"visible":"hidden"},height:32,justify:"center",width:32,children:e},e))})]}),(0,i.jsx)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vannes/2024/verso_v2.jpg) no-repeat`,backgroundSize:"cover",fontFamily:"$montserrat",position:"relative"},height:454,width:378,children:(0,i.jsxs)(Na,{css:{gap:"32px",left:"38px",position:"absolute",top:"374px"},children:[(0,i.jsx)(x_,{visible:o.includes("ven midi"),children:"Ven. Midi"}),(0,i.jsx)(x_,{visible:o.includes("sam midi"),children:"Sam. Midi"}),(0,i.jsx)(x_,{visible:o.includes("sam soir"),children:"Sam. Soir"}),(0,i.jsx)(x_,{visible:o.includes("dim"),children:"Dim."}),(0,i.jsx)(x_,{visible:o.includes("cocktail"),children:"Cocktail"})]})})]})};var v_;function b_(){return b_=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=qn(Kc),n=e.positionSlotUserInfo.positionSlot,s=e.positionSlotUserInfo.position,o=s.category,r=s.leaders.concat(o.leaders)[0];return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vannes/2024/assignemnt_v3.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{background:"#00e5ff",borderRadius:"$1",color:"white",fontSize:"24px",fontWeight:"700",padding:"10px",position:"absolute",right:"44px",top:"32px"},children:s.name}),(0,i.jsxs)(Na,{css:{left:"56px",padding:"$7",position:"absolute",top:"152px"},direction:"column",width:682,children:[(0,i.jsxs)(Na,{justify:"between",width:1,children:[(0,i.jsxs)(Na,{css:{color:"#1d2939",fontSize:"24px",fontWeight:"700",lineHeight:"28px"},direction:"column",children:[(0,i.jsx)(yr,{children:e.userInfo.fields?.firstName?.value||""}),(0,i.jsx)(yr,{children:e.userInfo.fields?.lastName?.value||""})]}),(0,i.jsxs)(Na,{align:"end",css:{lineHeight:"28px"},direction:"column",children:[(0,i.jsx)(yr,{css:{fontSize:"22px",fontWeight:"600",textTransform:"capitalize"},children:t.toLocaleString(n.range.start,Js.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(yr,{css:{fontSize:"16px",fontWeight:"700"},children:o.name})]})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(yr,{color:"gray800",children:["Nous te remercions chaleureusement d’avoir accepté de participer à l’organisation de la 24ème édition du"," ",(0,i.jsx)(Zm,{fontWeight:"bold",children:"Marathon de Vannes"})," en tant que bénévole."]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{css:{border:"1px solid $gray200",borderRadius:"5px",boxShadow:"$xs",padding:"$4"},children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(Tp,{})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:"Mission affectée"}),(0,i.jsx)(yr,{color:"gray800",children:s.name})]})]}),(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(j_,{})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:"Heure de la mission"}),(0,i.jsxs)(yr,{color:"gray800",children:["De"," ",t.toLocaleString(n.range.start,Js.TimeOnly)," ","à"," ",t.toLocaleString(n.range.end,Js.TimeOnly)]})]})]}),(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(Uf,{})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:"Lieu de rendez-vous"}),(0,i.jsx)(yr,{color:"gray800",children:s.address})]})]}),(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{css:{svg:{fill:"$gray700",height:"100%",width:"100%"}},height:16,width:16,children:(0,i.jsx)(k_,{})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:"Coordonnées GPS"}),(0,i.jsxs)(yr,{color:"gray800",children:[s.latitude,(0,i.jsx)("br",{}),s.longitude]})]})]})]}),(0,i.jsx)(yr,{height:255,width:308,children:(0,i.jsx)("a",{href:_g(s.latitude,s.longitude),style:{background:`url(${P.HEAVENT_API_URL}/image/event/${e.eventId}/position/${s.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{css:{lineHeight:"20px"},direction:"column",children:[(0,i.jsx)(yr,{fontWeight:"bold",children:"Description de la mission"}),m(s.description)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{color:"gray800",css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(xg,{text:s.description})})})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{css:{lineHeight:"20px"},direction:"column",children:[(0,i.jsx)(yr,{fontWeight:"bold",children:"Coordonnées des responsables"}),(0,i.jsx)(yr,{children:"Merci de te présenter avec cette convocation auprès de ton responsable sur place :"})]}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{fontSize:"textMd",fontWeight:"bold",textAlign:"center",width:1,children:r?`${r.userInfo.name} : ${r.userInfo.phone?.internationalFormat}`:""})]})]})},w_=e=>{const t=(0,L.useMemo)(()=>(0,lc.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event.volunteerRegistration.positionsSlotsUsersInfos]);return(0,i.jsx)(i.Fragment,{children:t.map(t=>(0,i.jsx)(A_,{eventId:e.event.id,positionSlotUserInfo:t,userInfo:e.event.volunteerRegistration.userInfo},t.positionSlot.id))})},S_=e=>(0,i.jsx)(Na,{align:"center",css:{background:e.color,flex:"1",visibility:e.visible?"visible":"hidden"},height:28,justify:"center",width:45,children:(0,i.jsx)(yr,{css:{color:"white",fontFamily:"$raleway",fontSize:"17px",fontWeight:"700"},children:e.children})}),E_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=t.accreditationsUsersInfos.map(({accreditation:e})=>e.acronym);return(0,i.jsxs)(Na,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vendanges/vendanges_2024.jpg) no-repeat`,backgroundSize:"cover",position:"relative"},height:325,width:204,children:[(0,i.jsx)(yr,{css:{borderRadius:"92px",height:"92px",left:"56px",overflow:"hidden",position:"absolute",top:"133px",width:"92px"},children:n.fields?.picture&&(0,i.jsx)("img",{height:"100%",src:n.fields.picture?.url,width:"100%"})}),(0,i.jsx)(yr,{css:{color:"#802c8d",fontFamily:"$raleway",fontSize:"12px",fontWeight:"800",position:"absolute",textAlign:"center",top:"240px",width:"100%"},children:n.name}),(0,i.jsxs)(Na,{css:{left:"0",position:"absolute",top:"146px"},direction:"column",children:[(0,i.jsx)(S_,{color:"#98cd00",visible:s.includes("JEU 19"),children:"JEU"}),(0,i.jsx)(S_,{color:"#ff9f01",visible:s.includes("VEN 20")||s.includes("VEN 20 & SAM 21"),children:"VEN"}),(0,i.jsx)(S_,{color:"#a655b1",visible:s.includes("SAM 21")||s.includes("VEN 20 & SAM 21"),children:"SAM"})]}),(0,i.jsxs)(Na,{css:{height:"53px",left:"0",position:"absolute",top:"272px",width:"100%"},children:[(0,i.jsx)(Na,{align:"center",css:{background:"#6eafe2",height:"100%",flex:"1",visibility:s.includes("1")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(yr,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"1"})}),(0,i.jsx)(Na,{align:"center",css:{background:"#9261a8",height:"100%",flex:"1",visibility:s.includes("2")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(yr,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"2"})}),(0,i.jsx)(Na,{align:"center",css:{background:"#accb44",height:"100%",flex:"1",visibility:s.includes("3")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(yr,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"3"})}),(0,i.jsx)(Na,{align:"center",css:{background:"#e7a726",height:"100%",flex:"1",visibility:s.includes("4")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(yr,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"4"})}),(0,i.jsx)(Na,{align:"center",css:{background:"#d23780",height:"100%",flex:"1",visibility:s.includes("5")?"visible":"hidden"},justify:"center",children:(0,i.jsx)(yr,{css:{color:"white",fontSize:"32px",fontWeight:"700"},children:"5"})})]})]})},T_=e=>(0,i.jsx)(yr,{css:{background:`url(${e.url})`,backgroundSize:"cover",visibility:e.visible?"visible":"hidden"},height:27,width:27}),z_=e=>{switch(e){case"Organisation":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-rouge.jpg`;case"Intervenant":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-violet.jpg`;case"Media":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-vert.jpg`;case"Partenaire":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-gris.jpg`;case"Team":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-bleu.jpg`;case"Village":return`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/backgrounds/v2/VG24-jaune.jpg`;default:return""}},O_=e=>{const t="Media"===wg(e.userInfo.fields,"population")?e.userInfo.fields?.cf37885?.value??"":e.delegation?.name??"";return t.includes("(")?t.substring(0,t.indexOf("(")).trim():t},R_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=wg(n.fields,"population",""),o=O_(t),r=t.accreditationsUsersInfos.map(e=>e.accreditation.acronym),a=r.includes("AAA")||r.includes("PVG")&&r.includes("PCM")&&r.includes("PCC")&&r.includes("ZE")&&r.includes("CAF"),l=n.fields?.cf37926?.value??"";return(0,i.jsxs)(Na,{css:{background:`url(${z_(s)}) no-repeat`,backgroundSize:"cover",color:"#231c45",fontFamily:"$poppins",position:"relative"},height:325,width:204,children:[(0,i.jsx)(yr,{css:{left:"16px",position:"absolute",top:"81px"},height:78,width:78,children:(0,i.jsx)("img",{height:"100%",src:m(n.fields?.picture?.url)?n.fields.picture.url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/avatar_defaut.jpg`,width:"100%"})}),(0,i.jsx)(Na,{css:{bottom:"133px",fontSize:"10px",fontWeight:"700",left:"16px",lineHeight:"10px",position:"absolute",textTransform:"uppercase"},width:106,wrap:"wrap",children:o}),(0,i.jsx)(yr,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/divider.png) no-repeat`,backgroundSize:"cover",height:"1px",left:"16px",position:"absolute",top:"194px",width:"78px"}}),(0,i.jsx)(yr,{css:{fontSize:"10px",fontWeight:"700",left:"16px",position:"absolute",textTransform:"uppercase",top:"198px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"14px",fontWeight:"700",left:"16px",position:"absolute",textTransform:"uppercase",top:"208px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(yr,{css:{color:"white",fontSize:"13px",fontWeight:"700",left:"15px",position:"absolute",textTransform:"uppercase",top:"244px"},children:s}),(0,i.jsx)(yr,{css:{color:"rgba(255, 255, 255, 0.70)",fontSize:"10px",fontWeight:"700",left:"15px",position:"absolute",textTransform:"uppercase",top:"258px"},children:l}),r.includes("CLE")&&(0,i.jsx)(yr,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v5/Accompagnant.png) no-repeat`,backgroundSize:"cover",left:"100px",position:"absolute",top:"81px"},height:59,width:27}),(0,i.jsx)(yr,{css:{left:"139px",position:"absolute",top:"22px"},height:46,width:46,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:46,width:46}),width:"100%"})}),a?(0,i.jsx)(yr,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v3/All_Access.png) no-repeat`,backgroundSize:"cover",left:"133px",position:"absolute",top:"80px"},height:143,width:27}):(0,i.jsxs)(Na,{css:{gap:"2px",left:"133px",position:"absolute",top:"80px"},direction:"column",children:[(0,i.jsx)(T_,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Ponton.png`,visible:r.includes("PVG")}),(0,i.jsx)(T_,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Media.png`,visible:r.includes("PCM")}),(0,i.jsx)(T_,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/PC_Course.png`,visible:r.includes("PCC")}),(0,i.jsx)(T_,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Equipage.png`,visible:r.includes("ZE")}),(0,i.jsx)(T_,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Cafe_de_Presse.png`,visible:r.includes("CAF")})]}),(0,i.jsxs)(Na,{css:{gap:"2px",left:"164px",position:"absolute",top:"80px"},direction:"column",children:[(0,i.jsx)(T_,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Hospitalite.png`,visible:r.includes("VH")}),(0,i.jsx)(T_,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/24h.png`,visible:r.includes("H24")}),(0,i.jsx)(T_,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Regie_TV.png`,visible:r.includes("TV")}),(0,i.jsx)(T_,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Couloir_Ponton.png`,visible:r.includes("COU")}),(0,i.jsx)(T_,{url:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/badge/assets/v2/Passerrelle.png`,visible:r.includes("PAS")})]})]})},$_=e=>{const t=e.event.volunteerRegistration,n=t.userInfo,s=O_(t),o=n.fields?.cf37884?.value||[],r=wg(n.fields,"population",""),a=n.fields?.cf37926?.value??"";return(0,i.jsxs)(Na,{css:{background:`url(${l=o,l.some(e=>e.includes("Anglais"))?`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/contremarque/contremarque_en.jpg`:`${P.HEAVENT_ASSETS_URL}/badges/vendeeGlobe/contremarque/contremarque_fr.jpg`}) no-repeat`,backgroundSize:"cover",color:"#231c45",fontFamily:"$poppins",position:"relative"},height:Xm,width:Jm,children:[(0,i.jsx)(yr,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",textTransform:"uppercase",top:"68px"},children:r}),(0,i.jsx)(yr,{css:{fontSize:"18px",left:"431px",position:"absolute",top:"99px"},children:a}),(0,i.jsx)(yr,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",top:"172px"},children:n.fields?.firstName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"20px",fontWeight:"700",left:"431px",position:"absolute",top:"201px"},children:n.fields?.lastName?.value||""}),(0,i.jsx)(yr,{css:{fontSize:"18px",left:"431px",position:"absolute",top:"238px"},children:s}),(0,i.jsx)(yr,{css:{position:"absolute",right:"60px",top:"64px"},height:84,width:84,children:(0,i.jsx)("img",{height:"100%",src:dg(t.ticketId,{height:84,width:84}),width:"100%"})}),(0,i.jsx)(yr,{css:{fontSize:"9px",fontWeight:"700",position:"absolute",right:"60px",top:"150px"},children:t.ticketId})]});var l};function D_(e,t,n,s){switch(e){case fe.Animajeconvention:return(0,i.jsx)(mg,{event:t});case fe.Asoassignment:return(0,i.jsx)(kg,{date:s,event:t,options:n});case fe.Cerclestaff:return(0,i.jsx)(Mg,{event:t});case fe.Cerclelivraison:return(0,i.jsx)($g,{event:t});case fe.Cerclepressandpartenaire:return(0,i.jsx)(Pg,{event:t});case fe.Cercleopcom:return(0,i.jsx)(Dg,{event:t});case fe.Delta:return(0,i.jsx)(Lg,{event:t});case fe.Dfcoa4:return(0,i.jsx)(Wg,{event:t});case fe.Dfcosmall:return(0,i.jsx)(qg,{event:t});case fe.Eurockeennes:return(0,i.jsx)(np,{event:t});case fe.Fcg:return(0,i.jsx)(rp,{event:t});case fe.Garorockplanning:return(0,i.jsx)(lp,{event:t});case fe.Goldencoast:return(0,i.jsx)(cp,{event:t});case fe.Hbcldc:return(0,i.jsx)(gp,{event:t});case fe.Hbclnh:return(0,i.jsx)(_p,{event:t});case fe.Lnh:return(0,i.jsx)(bp,{event:t});case fe.Moorea:return(0,i.jsx)(jp,{event:t});case fe.Nuitssecretes:return(0,i.jsx)(Cp,{event:t});case fe.Openbrest:return(0,i.jsx)(kp,{event:t});case fe.P2nassignment:return(0,i.jsx)(Dp,{event:t});case fe.P2nassignmentmontagedemontage:return(0,i.jsx)(Fp,{event:t});case fe.P2nbadge:return(0,i.jsx)(Np,{event:t});case fe.Paris20km:return(0,i.jsx)(Wp,{event:t});case fe.Paris20kmassignment:return(0,i.jsx)(Hp,{date:s,event:t});case fe.Paris20kmcontremarque:return(0,i.jsx)(qp,{event:t});case fe.Pastourelle:return(0,i.jsx)(Cx,{event:t});case fe.Pastourelleexposant:return(0,i.jsx)(Ax,{event:t});case fe.Pec:return(0,i.jsx)(Tx,{event:t,options:n});case fe.Playground:return(0,i.jsx)(Dx,{event:t});case fe.Roiarthur:return(0,i.jsx)(Px,{event:t});case fe.Rose:return(0,i.jsx)(Bx,{event:t});case fe.Roseparking:return(0,i.jsx)(Vx,{event:t});case fe.Salamandre:return(0,i.jsx)(Xx,{event:t});case fe.T24assignment:return(0,i.jsx)(s_,{event:t,options:n});case fe.Triathlonlarochellebadge:return(0,i.jsx)(a_,{event:t});case fe.Utopialesimprimeur:return(0,i.jsx)(u_,{event:t});case fe.Utopialesa4:return(0,i.jsx)(d_,{event:t});case fe.Vandbcontremarque:return(0,i.jsx)(f_,{event:t});case fe.Vannes:return(0,i.jsx)(I_,{event:t});case fe.Vannesassignment:return(0,i.jsx)(w_,{event:t});case fe.Vendanges:return(0,i.jsx)(E_,{event:t});case fe.Vendeeglobebadge:return(0,i.jsx)(R_,{event:t});case fe.Vendeeglobecontremarque:return(0,i.jsx)($_,{event:t});default:return rl()}}function P_(e){switch(e){case fe.Animajeconvention:return"Animaje Convention";case fe.Asoassignment:return"Fiche d'affectation ASO";case fe.Cerclestaff:return"Cercle Staff & Visiteurs";case fe.Cerclelivraison:return"Cercle Livraison";case fe.Cerclepressandpartenaire:return"Cercle Press & Partenaire";case fe.Cercleopcom:return"Cercle OPCom";case fe.Delta:return"Badge Delta";case fe.Dfcoa4:return"Badge Dijon DFCO A4";case fe.Dfcosmall:return"Badge Dijon DFCO Carte";case fe.Eurockeennes:return"Planning Les Eurockéennes";case fe.Fcg:return"Accréditation FCG";case fe.Garorockplanning:return"Planning Garorock";case fe.Goldencoast:return"Badge Golden Coast";case fe.Hbcldc:return"Badge HBC Ligue des Champions";case fe.Hbclnh:return"Badge HBC LNH";case fe.Lnh:return"Badge LNH";case fe.Moorea:return"Badge Moorea";case fe.Nuitssecretes:return"Badge Nuits Secrètes";case fe.Openbrest:return"Badge Open de Brest";case fe.P2nassignment:return"Fiche d'affectation P2N (Exploit)";case fe.P2nassignmentmontagedemontage:return"Fiche d'affectation P2N (Montage/Démontage)";case fe.P2nbadge:return"Badge P2N";case fe.Paris20km:return"Badge 20km de Paris";case fe.Paris20kmassignment:return"Fiche d'affectation 20km de Paris";case fe.Paris20kmcontremarque:return"Contremarque 20km de Paris";case fe.Pastourelle:return"Badge Pastourelle bénévoles";case fe.Pastourelleexposant:return"Badge Pastourelle staffs";case fe.Pec:return"Badge Paris Entertainment Company";case fe.Playground:return"Fiche d'affectation Playground";case fe.Roiarthur:return"Badge Roi Arthur";case fe.Rose:return"Contremarque Rose Festival";case fe.Roseparking:return"Rose Festival Pass Parking";case fe.Salamandre:return"Badge Salamandre";case fe.T24assignment:return"Fiche d'affectation T24";case fe.Triathlonlarochellebadge:return"Badge Triathlon la Rochelle";case fe.Utopialesimprimeur:return"Badge Utopiales (version imprimeur)";case fe.Utopialesa4:return"Badge Utopiales (version A4)";case fe.Vandbcontremarque:return"V and B Fest' Convocation";case fe.Vannes:return"Badge Marathon de Vannes";case fe.Vannesassignment:return"Fiche d'affectation Marathon de Vannes";case fe.Vendanges:return"Badge Les Vendanges Musicales";case fe.Vendeeglobebadge:return"Badge Vendée Globe";case fe.Vendeeglobecontremarque:return"Contremarque Vendée Globe";default:return rl()}}function F_(e){return"number"==typeof e?.latitude&&"number"==typeof e?.longitude?{lat:e.latitude,lng:e.longitude}:void 0}function M_(e,t,n){const i=Js.DateOnly.MonthLong;return t.equals(n)?e.toLocaleString(t,i):[e.toLocaleString(t,Js.DateOnly.MonthShort),e.toLocaleString(n,Js.DateOnly.MonthShort)].join(" - ")}function N_(e){switch(e){case Pe.Archived:case Pe.Done:return"error";case Pe.Ongoing:return"success";case Pe.Upcoming:return"purple";default:return rl()}}function L_(e,t){const n=Us.c9.now().setZone("utc",{keepLocalTime:!0}).startOf("day");return Us.IX.fromDateTimes(e.startOf("day"),t.endOf("day")).contains(n)?n:e}const B_=e=>{const{translate:t}=_l(),{mutate:n}=function(e={}){return Xn("mutation BackofficeEventUnarchive($eventId: EventId!) {\n backofficeEventUnarchive(eventId: $eventId)\n}\n",e)}();return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{width:100,children:e.event.id}),(0,i.jsx)(Ec,{children:(0,i.jsx)(qc,{to:Ui.EVENT({organizationId:e.organizationId,eventId:e.event.id}),children:e.event.name})}),(0,i.jsx)(Ec,{children:(0,i.jsx)(ic,{color:N_(e.event.state),children:t(e.event.state)})}),(0,i.jsx)(Ec,{children:e.event.state===Pe.Archived&&(0,i.jsx)(El,{color:"invisible",onClick:async()=>{await n({eventId:e.event.id}),e.reload()},children:t("d_sarchiver_76082")})})]})},V_=e=>{const{history:t,translate:n}=_l(),s=Mc(),o=qn(Ym),r=qn(Ba),{mutate:a}=function(e={}){return Xn("mutation BackofficeOrganizationUpdate(\n $id: OrganizationId!\n $organization: BackofficeOrganizationInput!\n) {\n backofficeOrganizationUpdate(id: $id, organization: $organization) {\n id\n }\n}\n",e)}(),[l,d,c]=Bc(""),[u,h]=(0,L.useState)([]),[g,p]=(0,L.useState)({direction:jt.Asc,attribute:De.Name}),[f,x]=(0,L.useState)(0),{data:_,isLoading:I,reload:v}=Zn("query BackofficeEvents(\n $organizationId: OrganizationId!\n $name: String\n $states: [EventState!]\n $sort: EventsSort\n $offset: Int\n) {\n backoffice {\n events(\n organizationId: $organizationId\n name: $name\n states: $states\n sort: $sort\n limit: 25\n offset: $offset\n ) {\n nodes {\n id\n name\n state\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:e.organization.id,name:m(d)?d:void 0,states:no(u)?u:void 0,sort:g,offset:f},[]);const{numberOfPages:b,totalCount:j}=ku(_.backoffice?.events),C=(0,L.useMemo)(()=>(0,ph.A)(P.ADMINS.concat(e.organization.users).map(e=>({id:e.id,name:e.email})),({id:e})=>e),[e.organization]),y=(0,L.useMemo)(()=>(0,lc.A)(en.map(e=>({value:e,name:P_(e)})),({name:e})=>e),[]),k=e=>{p(e),x(0)};return(0,i.jsx)(Cl,{height:1,hideDefaultErrors:!0,initialValues:{organization:o.organizationInputDefault(e.organization)},render:({form:t,handleSubmit:o,submitting:r})=>(0,i.jsx)(Pm,{button:(0,i.jsx)(El,{isLoading:r,textAlign:"center",onClick:o,children:n("mettre_jour_l_12499")}),category:"Backoffice",fallbackClosePath:$s.BACKOFFICE_ORGANIZATIONS,heading:n("mise_jour_de_17055",e.organization.name),children:(0,i.jsxs)($m,{children:[(0,i.jsx)(vl,{}),(0,i.jsxs)(Fm,{children:[(0,i.jsx)(Ll,{label:n("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Lm,{label:n("date_de_fin_de_17750"),name:"organization.periodEndAt"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,label:n("fonctionnalit_s_47714"),multiple:!0,name:"organization.features",children:cn.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Um,{isSearchVisible:!0,label:n("badges_personna_27045"),multiple:!0,name:"organization.customBadges",children:y.map(({value:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Um,{isSearchVisible:!0,label:n("utilisateurs_ay_27051"),multiple:!0,name:"organization.usersIds",children:C.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{label:n("id_de_l_organis_67465"),name:"organization.weezeventOrganizationId",rightIcon:"xmark",shouldParseAsInt:!0,onRightIconClick:()=>{t.change("organization.weezeventOrganizationId",null)}}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Nm,{name:"organization.isBlocked",children:n("bloquer_l_organ_81103")})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Mm,{hideToggle:!0,initialIsOpen:!0,heading:n("facturation_53594"),children:[(0,i.jsx)(Hm,{name:"organization.useOldBilling",children:n("utilise_l_ancie_40491")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Ll,{label:n("nombre_de_membr_16400"),name:"organization.membersLimit",shouldParseAsInt:!0}),(0,i.jsx)(Vm,{label:n("prix_par_membre_20633"),name:"organization.pricePerMember"})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{children:n("nombre_de_membr_20439",e.organization.membersStats.numberOfMembers)}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{children:n("nombre_de_membr_54470",e.organization.membersStats2024.numberOfMembers)}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Gm,{label:n("commentaire_sur_40207"),name:"organization.billingComment"})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Mm,{hideToggle:!0,initialIsOpen:!0,heading:n("Event"),children:(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:200,children:(0,i.jsx)(bc,{isSelectAllVisible:!0,multiple:!0,placeholder:n("status_06428"),values:u,onChange:e=>{h(e),x(0)},children:s(dn)})}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:n("rechercher_un_40024"),value:l,onChange:e=>{c(e),x(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{width:100,children:"ID"}),(0,i.jsx)(_m,{attribute:De.Name,setSort:k,sort:g,children:n("nom_de_l_v_nem_08711")}),(0,i.jsx)(Vc,{children:n("status_06428")}),(0,i.jsx)(Vc,{})]}),numberOfPages:b,offset:f,rows:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):_.backoffice.events.nodes.map(t=>(0,i.jsx)(B_,{event:t,organizationId:e.organization.id,reload:v},t.id)),setOffset:x,title:n("liste_des_v_ne_29929"),totalCount:j})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Fm,{children:(0,i.jsx)(El,{isLoading:r,textAlign:"center",onClick:o,children:n("mettre_jour_l_12499")})})]})}),validate:r.validateForForm(o.updateOrganizationSchema()),width:1,onSubmit:async n=>{await a({id:e.organization.id,organization:n.organization}),t.goBack($s.BACKOFFICE)}})},U_=()=>{const{organizationId:e}=Jn(),{data:t,loader:n}=Zn(Br,{organizationId:e},[Ls.OrganizationBackofficeFragment]);return n||(0,i.jsx)(V_,{organization:t.data.row})},W_=()=>(Dd(Yn()("back_office_83072")),(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:$s.BACKOFFICE_ORGANIZATIONS,children:(0,i.jsx)(Om,{})}),(0,i.jsx)(Ar.qh,{exact:!0,path:$s.EDIT_BACKOFFICE_ORGANIZATION(":organizationId"),children:(0,i.jsx)(U_,{})}),(0,i.jsx)(Ar.qh,{exact:!0,path:$s.BACKOFFICE_INVOICES,children:(0,i.jsx)(lu,{})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.BACKOFFICE_ORGANIZATIONS,replace:!0})})]})),G_=pr(Na,{backgroundColor:"$blueGray900",".amicale-theme &, .volunteers-theme &":{backgroundColor:"white"},".mso-theme &":{backgroundColor:"$cyan"}}),H_=()=>(0,i.jsx)(td,{}),q_=L.forwardRef((e,t)=>(0,i.jsxs)(G_,{ref:t,align:"stretch",css:{overflow:"auto",padding:"$6"},justify:"between",width:1,children:[(0,i.jsx)(yr,{width:100}),(0,i.jsxs)(Na,{align:"stretch",css:{height:"fit-content",py:"$2",width:"920px"},direction:"column",gap:"6",children:[(0,i.jsx)(Na,{css:{marginBottom:"$7","& svg":{height:"100%"}},height:32,justify:"center",children:(0,i.jsx)(H_,{})}),e.children]}),(0,i.jsx)(Na,{justify:"end",width:100,children:(0,i.jsx)(El,{color:"gray",leftIcon:"xmark",onClick:e.onClose})})]}));q_.displayName="OnboardingView";const Y_=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/North","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","Brazil/Acre","Brazil/East","Brazil/West","Canada/Atlantic","Canada/Central","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","Chile/Continental","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Mexico/General","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap"];function K_(e){return"string"!=typeof e||""===e.trim()||c(e.toLowerCase())===e}const Z_=["country","code","number"];let X_=class extends Ul{countriesService;constructor(e,t){super(e),this.countriesService=t}basePhoneInputDefault(){return{country:"",code:"",number:""}}phoneInputDefault(e){return{...this.basePhoneInputDefault(),...e.phone}}phoneInputSchema(){return d.Ik().shape({country:d.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.countriesCodes,this.t("le_num_ro_de_t_76885")),code:d.Yj().required(this.t("le_num_ro_de_t_76885")).oneOf(this.countriesService.phoneCodes,this.t("le_num_ro_de_t_76885")),number:d.Yj().required(this.t("le_num_ro_de_t_76885"))})}phoneInputSchemaNotRequired(){return d.Ik().nullable().shape({country:d.Yj(),code:d.Yj(),number:d.Yj()})}};X_=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn,du])],X_);let J_=class extends Ul{countriesService;phoneInputService;constructor(e,t,n){super(n),this.countriesService=e,this.phoneInputService=t}organizationInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{name:"",adminFirstName:"",adminLastName:"",adminPhone:this.phoneInputService.phoneInputDefault(t),weezeventOrganizationId:e}}organizationInputSchema(e){let t=d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_org_60618")),adminFirstName:d.Yj().required(this.t("le_pr_nom_est_r_10935")),adminLastName:d.Yj().required(this.t("le_nom_est_requ_61536")),adminPhone:this.phoneInputService.phoneInputSchema()});return e||(t=t.shape({termsAccepted:d.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})),t}createOrganizationSchema(e){return d.Ik().shape({organization:this.organizationInputSchema(e)})}organizationInfosInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{name:e.name??"",adminName:e.adminName??"",adminEmail:e.adminEmail??"",street:e.street??"",postalCode:e.postalCode??"",city:e.city??"",country:e.country??t.user.country,timeZone:e.timeZone??Us.c9.local().zoneName,emailSenderId:e.emailSenderId,dateFormat:e.dateFormat,datetimeFormat:e.datetimeFormat,timeFormat:e.timeFormat}}organizationInfosInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_org_60618")),adminName:d.Yj().required(this.t("le_nom_du_respo_43823")),adminEmail:d.Yj().required(this.t("l_e_mail_du_rep_90871")).email(this.t("l_e_mail_du_rep_90871")).test("clean-admin-email",this.t("l_e_mail_du_rep_90871"),function(){return K_(this.parent.adminEmail)}),street:d.Yj().required(this.t("l_adresse_est_r_40489")),postalCode:d.Yj().required(this.t("le_code_postal_43189")),city:d.Yj().required(this.t("la_ville_est_re_35239")),country:d.Yj().oneOf(this.countriesService.countriesCodes).required(this.t("le_pays_est_req_33749")),emailSenderId:d.ai().nullable(),dateFormat:d.Yj().required(this.t("le_format_est_r_17097")),datetimeFormat:d.Yj().required(this.t("le_format_est_r_17097")),timeFormat:d.Yj().required(this.t("le_format_est_r_17097"))})}updateOrganizationGeneralSchema(){return d.Ik().shape({organization:this.organizationInfosInputSchema()})}};J_=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,X_,Wn])],J_);let Q_=class extends Vl{countriesService;organizationInputService;translationService;constructor(e,t,n){super(n),this.countriesService=e,this.organizationInputService=t,this.translationService=n}eventInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{name:e?.name??"",description:e?.description??"",startAt:e?.startAt??Us.c9.invalid("Invalid"),endAt:e?.endAt??Us.c9.invalid("Invalid"),languages:e?.languages??[t.user.language],timeZone:e?.timeZone??Us.c9.local().zoneName??"utc",country:e?.country??t.user.country,layer:e?.layer??et.Google,latitude:e?.latitude??43.6087733,longitude:e?.longitude??3.87963579999996,emailSenderId:e?.emailSenderId,dayStartTime:e?.dayStartTime??"00:00",tagsIds:e?.tagsIds??[],fields:e?.fields??{},isWeezeventSynchronized:e?.isWeezeventSynchronized??!0,useAccreditations:e?.useAccreditations??!0,useCampaigns:e?.useCampaigns??!0,useDelegations:e?.useDelegations??!0,useDocuments:e?.useDocuments??!0,useForms:e?.useForms??!0,usePositions:e?.usePositions??!0,useWorkflows:e?.useWorkflows??!0}}eventInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("nom_de_l_v_nem_58512")),description:d.Yj(),startAt:qm.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:qm.required(this.t("la_date_de_fin_45068")).typeError(this.t("la_date_de_fin_45068")).test("after-start-at",this.t("la_date_de_fin_00429"),function(){return Us.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Us.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),languages:d.YO().of(d.Yj().oneOf(xd,this.t("les_langues_doi_27712"))).required(this.t("les_langues_son_53717")).min(1,this.t("vous_devez_s_le_16610")),timeZone:d.Yj().required(this.t("le_fuseau_horai_37109")).oneOf(Y_,this.t("le_fuseau_horai_37109")),latitude:d.ai().nullable().typeError(this.t("la_latitude_doi_17800")).min(-90,this.t("la_latitude_doi_17800")).max(90,this.t("la_latitude_doi_17800")),longitude:d.ai().nullable().typeError(this.t("la_longitude_do_28762")).min(-180,this.t("la_longitude_do_28762")).max(180,this.t("la_longitude_do_28762")),emailSenderId:d.ai().nullable(),dayStartTime:d.Yj().required(this.t("l_heure_laque_87748")),isWeezeventSynchronized:d.zM().required(),usePositions:d.zM().required(),useAccreditations:d.zM().required(),useDelegations:d.zM().required(),useForms:d.zM().required(),useDocuments:d.zM().required(),useWorkflows:d.zM().required()})}eventOrganizationInputSchema(e){return d.Ik().shape({event:this.eventInputSchema(),organization:this.organizationInputService.organizationInputSchema(e)})}createUpdateEventSchema(){return d.Ik().shape({event:this.eventInputSchema()})}};Q_=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,J_,Wn])],Q_);const eI=e=>{if(0===e.names.length)return e.render(e.fields);{const[t,...n]=e.names;return(0,i.jsx)(Ua.D0,{name:t,render:s=>(0,i.jsx)(eI,{fields:{...e.fields||{},[t]:s},names:n,render:e.render,subscription:e.subscription}),subscription:e.subscription})}},tI=({value:e,onChange:t,css:n,label:s,state:o,description:r,hint:a,...l})=>{const d=Yn(),u=(0,L.useCallback)(e=>{e&&p(e.getBoundingClientRect().width)},[]),h=(0,L.useCallback)(e=>e?.focus({preventScroll:!0}),[]),[g,p]=(0,L.useState)(200),[f,x]=(0,L.useState)(!1),[_,I]=(0,L.useState)(""),v=qn(du),b=(0,L.useMemo)(()=>(0,lc.A)(v.countries.flatMap(e=>to(e.phoneCode).map(t=>({...e,phoneCode:t}))),({name:e})=>c(e)),[]),j=(0,L.useMemo)(()=>b.find(({code:t,phoneCode:n})=>t===e.country&&n===e.code),[e.country,e.code]),C=(0,L.useMemo)(()=>b.filter(e=>!m(_)||e.name.toLowerCase().includes(_.trim().toLowerCase())||e.phoneCode.includes(_.trim())),[b,_]),y=(0,L.useMemo)(()=>C.map((n,s)=>(0,i.jsx)(Wd,{onClick:()=>{t({...e,country:n.code,code:n.phoneCode}),I(""),x(!1)},children:(0,i.jsxs)(Na,{gap:"2",width:1,children:[(0,i.jsx)(yr,{children:n.emoji}),(0,i.jsx)(yr,{css:{ellipsis:!0},children:n.name}),(0,i.jsx)(yr,{color:"gray500",children:n.phoneCode})]})},s)),[C,e,t]),{inputId:k,descId:A,errorId:w}=Ga();return(0,i.jsxs)(Na,{ref:u,css:n,direction:"column",width:1,children:[(0,i.jsx)(Pl,{htmlFor:k,children:s}),(0,i.jsx)($l,{id:A,children:r}),(s||r)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{children:[(0,i.jsxs)(Bd,{isOpen:f,onStateChange:e=>x(e),children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(Ml,{css:{borderRight:"none",borderBottomRightRadius:"0",borderTopRightRadius:"0",userSelect:"none",width:"100px","& .styled-input-container-circle-exclamation":{display:"none"}},cursor:"pointer",rightIcon:f?"chevron-up":"chevron-down",state:o,children:j&&(0,i.jsxs)(yr,{width:1,children:[j.emoji," ",j.phoneCode]})})}),(0,i.jsx)(qd,{placement:"bottom-start",renderOnPortal:!0,width:g,children:(0,i.jsxs)(Na,{direction:"column",height:Math.min(201,40*C.length+41),width:1,children:[(0,i.jsx)(yr,{css:{padding:"$2 $4","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},height:40,children:(0,i.jsx)("input",{ref:h,"aria-label":d("indicatif_t_l_p_02025"),placeholder:d("rechercher_un_p_04678"),type:"text",value:_,onChange:e=>{I(e.target.value)}})}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Na,{css:{height:"calc(100% - 41px)",overflowY:"auto"},direction:"column",children:y})]})})]}),(0,i.jsx)(Ml,{css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0",flex:"1"},cursor:"text",state:o,children:(0,i.jsx)(yr,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"},"& input::placeholder":{color:"$gray500",opacity:1},"& input::-ms-input-placeholder ":{color:"$gray500",opacity:1}},children:(0,i.jsx)("input",{"aria-describedby":r?A:void 0,"aria-errormessage":"error"===o?w:void 0,"aria-invalid":"error"===o,autoComplete:"tel-national",disabled:"disabled"===o,id:k,type:"tel",value:e.number,onChange:n=>{t({...e,number:n.target.value})},...l})})})]}),(0,i.jsx)(Dl,{id:w,state:o,children:a})]})},nI=(0,L.memo)(function({prefix:e,hint:t,state:n,...s}){const o=`${e}country`,r=`${e}code`,a=`${e}number`;return(0,i.jsx)(eI,{names:[o,r,a],render:e=>{const l=Ol(e[r].meta)||Ol(e[a].meta);return(0,i.jsx)(tI,{hint:l?e[r].meta.error||e[a].meta.error:t,state:l?"error":n,value:{country:e[o].input.value,code:e[r].input.value,number:e[a].input.value},onChange:t=>{e[o].input.onChange(t.country),e[r].input.onChange(t.code),e[a].input.onChange(t.number)},...s})}})}),iI=(0,L.memo)(function(){const e=Yn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ll,{label:e("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Ll,{label:e("pr_nom_66988"),name:"organization.adminFirstName"}),(0,i.jsx)(Ll,{label:e("last_name"),name:"organization.adminLastName"})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(nI,{label:e("Phone"),prefix:"organization.adminPhone."})]})}),sI=()=>{const e=Yn(),{user:t}=si();return(0,i.jsx)(Nm,{name:"organization.termsAccepted",children:(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("en_cr_ant_votre_88363",jd(Id(t?.language,new URL(location.href).searchParams)),vd)}})})},oI=e=>{const t=Yn(),n=Us.c9.utc(),{event:s}=e.values;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:"event.startAt",children:t=>{t.isValid&&!1===e.form.getFieldState("event.endAt").touched&&e.form.change("event.endAt",t)}}),(0,i.jsx)(Ll,{label:t("nom_de_l_v_nem_08711"),name:"event.name"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsx)(Lm,{label:t("date_de_d_but_43380"),min:n,name:"event.startAt"}),(0,i.jsx)(Lm,{label:t("date_de_fin_86920"),min:s.startAt&&s.startAt.isValid?s.startAt:n,name:"event.endAt"})]})]})},rI=()=>{const{translate:e,params:{weezeventOrganizationId:t}}=_l(),n=qn(Q_),s=qn(J_),o=qn(Ba),{mutate:r}=function(e={}){return Xn("mutation EventOrganizationCreate($eventOrganization: EventOrganizationInput!) {\n eventOrganizationCreate(eventOrganization: $eventOrganization) {\n id\n organizationId\n }\n}\n",e)}({redirectOnSuccess:!0}),a=Qn(),l=(0,L.useRef)(null),d=!!si().user?.termsAcceptedAt;return(0,i.jsx)(Cl,{customErrorRef:l,height:1,initialValues:{event:n.eventInputDefault(),organization:s.organizationInputDefault(t)},render:({form:t,values:n,handleSubmit:s})=>(0,i.jsxs)(q_,{ref:l,onClose:X,children:[(0,i.jsx)(vl,{}),(0,i.jsx)(Mm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:e("param_trer_votr_94121"),heading:e("dites_en_nous_u_13238"),children:(0,i.jsx)(oI,{form:t,values:n})}),(0,i.jsx)(Mm,{hideToggle:!0,initialIsOpen:!0,subtitle:e("ajouter_le_nom_69919"),heading:e("_propos_de_vot_88855"),children:(0,i.jsx)(iI,{})}),(0,i.jsxs)(Fm,{children:[!d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sI,{}),(0,i.jsx)(qa,{height:"4"})]}),(0,i.jsx)(El,{textAlign:"center",onClick:s,children:e("cr_er_l_v_neme_16731")})]})]}),validate:o.validateForForm(n.eventOrganizationInputSchema(d)),width:1,onSubmit:async e=>{const{eventOrganizationCreate:{id:t,organizationId:n}}=await r({eventOrganization:e});a.push(Ui.EVENT({organizationId:n,eventId:t}))}})},aI=()=>{const{data:e,loader:t}=Zn("query HomeOrganizations {\n user {\n roles {\n organizationId\n }\n }\n}\n",{},[]),n=Qn();return(0,i.jsx)(Ed,{loader:t,onLoad:()=>{const t=e.user?.roles?.[0]?.organizationId;t?n.replace(Ui.EVENTS({organizationId:t})):n.replace($s.CREATE_EVENT_WITH_ORGANIZATION())}})},lI=()=>{const{translate:e,history:t}=_l(),n=qn(J_),s=qn(Ba),{mutate:o}=function(e={}){return Xn("mutation OrganizationCreate($organization: OrganizationInput!) {\n organizationCreate(organization: $organization) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0}),r=(0,L.useRef)(null),{user:a}=si(),l=!!a?.termsAcceptedAt;return(0,i.jsx)(Cl,{customErrorRef:r,height:1,hideDefaultErrors:!0,initialValues:{organization:n.organizationInputDefault()},render:({handleSubmit:n})=>(0,i.jsxs)(q_,{ref:r,onClose:()=>t.goBack($s.BACKOFFICE),children:[(0,i.jsx)(vl,{}),(0,i.jsx)(Mm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:e("ajouter_le_nom_69919"),heading:e("_propos_de_vot_88855"),children:(0,i.jsx)(iI,{})}),(0,i.jsxs)(Fm,{children:[!l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sI,{}),(0,i.jsx)(qa,{height:"4"})]}),(0,i.jsx)(El,{textAlign:"center",onClick:n,children:e("cr_er_l_organis_55358")})]})]}),validate:s.validateForForm(n.createOrganizationSchema(l)),width:1,onSubmit:async e=>{const{organizationCreate:{id:n}}=await o({organization:e.organization});t.push(bi.ORGANIZATION({organizationId:n}))}})},dI=({children:e,termsAccepted:t})=>{const{organizationId:n}=Jn(),s=Qn();return t||window.location.pathname.includes($s.ACCEPT_TERMS_AND_CONDITIONS(n))?(0,i.jsx)(i.Fragment,{children:e}):(0,i.jsx)(ni,{path:$s.ACCEPT_TERMS_AND_CONDITIONS(n),state:s.location})};var cI=n(5830);class uI extends cI.Ay{events;forms;organizations;segmentsFolders;constructor(){super("recrewteer"),this.version(6).stores({events:"id",forms:"id",organizations:"id",segmentsFolders:"id"})}}const hI=new uI,mI=L.createContext({}),gI=e=>{const{history:t,params:{organizationId:n}}=_l(),{data:s,loader:o,reload:r}=Zn('query CommonOrganization($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n features\n }\n\n user {\n email\n language\n\n userInfo(organizationId: $organizationId) {\n name\n firstName: fieldValue(slug: "firstName")\n picture {\n url\n }\n }\n }\n}\n',{organizationId:n},[]),a=L.useCallback(e=>!!s.organization&&function(e,t){return e.features.includes(t)}(s.organization,e),[s.organization]);return o||(o||s.organization?(0,i.jsx)(mI.Provider,{value:{user:s.user,hasFeature:a,reload:r},children:e.children}):(setTimeout(()=>{t.replace($s.HOME)},100),null))},pI=[It.OrganizationAdmin],fI=[It.OrganizationAdmin,It.EventAdmin],xI=[It.OrganizationAdmin,It.OrganizationReader],_I=[It.OrganizationAdmin,It.OrganizationReader,It.EventAdmin,It.EventReader];function II(e,t,n){if("positionCategoryId"in n){const i=e.usersPositionsCategories.some(e=>"ANY"===n.positionCategoryId?t===e.roleId:t===e.roleId&&e.positionCategoryId===n.positionCategoryId);if("positionId"in n){const s=e.usersPositions.some(e=>t===e.roleId&&e.positionId===n.positionId);return i||s}return i}return"delegationCategoryId"in n?e.usersDelegationsCategories.some(e=>"ANY"===n.delegationCategoryId?t===e.roleId:t===e.roleId&&e.delegationCategoryId===n.delegationCategoryId):"eventId"in n&&e.usersEvents.some(e=>"ANY"===n.eventId?t===e.roleId:t===e.roleId&&e.eventId===n.eventId)}function vI(e,t,n){const i=n?e.roles.filter(t=>"positionCategoryId"in n||"positionId"in n?t.accessLevel===_t.Position?II(e,t.id,n):t.accessLevel===_t.Organization||t.accessLevel===_t.Event:"delegationCategoryId"in n?t.accessLevel===_t.DelegationCategory?II(e,t.id,n):t.accessLevel===_t.Organization||t.accessLevel===_t.Event:"eventId"in n&&(t.accessLevel===_t.Event?II(e,t.id,n):t.accessLevel===_t.Organization)):e.roles;return t.map(e=>i.some(t=>"1"===t.permissions[e]))}function bI(e,t){return e.roles.filter(e=>e.accessLevel===_t.Organization).some(e=>"1"===e.permissions[t])}const jI=L.createContext({}),CI=e=>{const{history:t,params:{organizationId:n},translate:s}=_l(),{data:o,loader:r,reload:a}=Zn('query Organization($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n id\n name\n periodEndAt\n features\n customBadges\n isBlocked\n key\n weezeventOrganizationId\n\n invoices(state: Overdue) {\n invoiceNumber\n url\n insertedAt\n }\n\n events(sort: { attribute: StartAt, direction: Desc }) {\n nodes {\n id\n name\n state\n weezeventEventId\n }\n }\n\n roles {\n id\n accessLevel\n name\n type\n }\n }\n\n user {\n email\n language\n termsAcceptedAt\n\n roles(organizationId: $organizationId) {\n id\n accessLevel\n type\n permissions\n }\n\n userInfo(organizationId: $organizationId) {\n name\n firstName: fieldValue(slug: "firstName")\n picture {\n url\n }\n }\n }\n}\n',{organizationId:n},[]),{hasFeature:l,reload:d}=L.useContext(mI),[c,h]=L.useState(),[m,g]=L.useState(null),p=L.useCallback(async e=>{const t=(0,Ka.A)(m,{id:n},e);await hI.organizations.put(t),g(t)},[n,m,g]),f=L.useMemo(()=>no(o.user?.roles??[]),[o.user]),x=L.useMemo(()=>(o.user?.roles??[]).some(e=>e.type===It.OrganizationAdmin),[o.user]),_=L.useMemo(()=>(o.user?.roles??[]).some(e=>e.type===It.OrganizationAdmin||e.type===It.OrganizationReader),[o.user]),I=L.useMemo(()=>o.organization?{organizationRoles:(0,lc.A)(o.organization.roles.filter(e=>e.accessLevel===_t.Organization),e=>u(e.name)),eventRoles:(0,lc.A)(o.organization.roles.filter(e=>e.accessLevel===_t.Event),e=>u(e.name)),delegationCategoryRoles:(0,lc.A)(o.organization.roles.filter(e=>e.accessLevel===_t.DelegationCategory),e=>u(e.name)),positionRoles:(0,lc.A)(o.organization.roles.filter(e=>e.accessLevel===_t.Position),e=>u(e.name))}:{organizationRoles:[],eventRoles:[],delegationCategoryRoles:[],positionRoles:[]},[o.organization]);return L.useEffect(()=>{o.organization&&(async()=>{let e=await hI.organizations.get(n);e||(e={id:n},await hI.organizations.put(e)),g(e)})()},[n,o.organization]),r||(r||o.organization?f?(0,i.jsx)(jI.Provider,{value:{isOrganizationAdmin:x,isOrganizationReader:_,localOrganization:m,organization:o.organization,roles:I,selectedEventId:c,user:o.user,hasPermission:e=>bI(o.user,e),hasPermissions:e=>function(e,t){return t.map(t=>bI(e,t))}(o.user,e),hasFeature:l,reload:()=>{d(),a()},setSelectedEventId:h,updateLocalOrganization:p},children:(0,i.jsx)(dI,{termsAccepted:null!==o.user.termsAcceptedAt,children:e.children})}):(0,i.jsx)(su,{size:"sm",onClose:Ql.A,children:(0,i.jsx)(yr,{textAlign:"center",children:s("vous_n_avez_pas_23261")})}):(setTimeout(()=>{t.replace($s.HOME)},100),null))};function yI(){return L.useContext(jI)}const kI=e=>{const t=Yn();return(0,i.jsxs)(Na,{align:"center",direction:"column",children:[(0,i.jsx)(Na,{align:"center",css:{background:"$primary500",borderRadius:"48px",fontSize:"$textXl",color:"white",height:"48px",width:"48px"},justify:"center",children:(0,i.jsx)(el,{icon:e.icon})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textMd",children:e.title||t("la_fonctionnali_59786")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:e.subtitle||t("si_vous_voulez_24448")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(El,{to:`mailto:${P.EMAIL_FROM}`,children:t("contacter_l_qu_16617")})]})},AI={PLURAL:"campaigns",SINGLE:"campaign"},wI={CAMPAIGNS:AI.PLURAL,CAMPAIGN:e=>ai([AI.SINGLE,e])},SI={CAMPAIGNS:({organizationId:e,eventId:t})=>ai([t?Ui.EVENT({organizationId:e,eventId:t}):yi.COMMUNITY({organizationId:e}),wI.CAMPAIGNS]),CAMPAIGNS_SEGMENT:({organizationId:e,segmentId:t})=>ai([SI.CAMPAIGNS({organizationId:e}),t]),CAMPAIGN:({organizationId:e,eventId:t,campaignId:n})=>ai([t?Ui.EVENT({organizationId:e,eventId:t}):yi.COMMUNITY({organizationId:e}),wI.CAMPAIGN(n)]),CAMPAIGN_DASHBOARD:e=>ai([SI.CAMPAIGN(e),ui.DASHBOARD]),CAMPAIGN_PREVIEW:({userInfoId:e,...t})=>ai([SI.CAMPAIGN(t),ui.PREVIEW,e]),CREATE(e){const t=mi(SI.CAMPAIGNS(e));return e.options?`${t}/${e.options}`:t},CREATE_TEMPLATE:e=>ai([mi(SI.CAMPAIGNS(e)),"template"]),UPDATE:e=>gi(SI.CAMPAIGN(e))},EI={PLURAL:"members",SINGLE:"member"},TI={PLURAL:"profiles",SINGLE:"profile"},zI="accreditations",OI="actions",RI="availabilities",$I="campaigns",DI="comments",PI="documents",FI="events",MI="history",NI="informations",LI="messages",BI="positions",VI="forms",UI="form",WI="scans",GI=e=>ai([EI.SINGLE,e]),HI=e=>ai([TI.SINGLE,e]),qI={USER_PROFILE:({userInfoId:e,...t})=>ai([bi.ORGANIZATION(t),HI(e)]),USER_PROFILES:e=>ai([bi.ORGANIZATION(e),TI.PLURAL]),MEMBERS:e=>ai(["delegationId"in e?ds.DELEGATION(e):"eventId"in e&&e.eventId?Ui.EVENT(e):yi.COMMUNITY(e),EI.PLURAL]),MEMBER:({userInfoId:e,...t})=>ai(["eventId"in t&&t.eventId?Ui.EVENT(t):yi.COMMUNITY(t),GI(e)]),MEMBER_INFORMATION:e=>ai([qI.MEMBER(e),NI]),MEMBER_ACTIONS:e=>ai([qI.MEMBER(e),OI]),MEMBER_AVAILABILITIES:e=>ai([qI.MEMBER(e),RI]),MEMBER_COMMENTS:e=>ai([qI.MEMBER(e),DI]),MEMBER_HISTORY:e=>ai([qI.MEMBER(e),MI]),MEMBER_HISTORY_CAMPAIGNS:e=>ai([qI.MEMBER(e),MI,$I]),MEMBER_HISTORY_EVENTS:e=>ai([qI.MEMBER(e),MI,FI]),MEMBER_HISTORY_FORMS:e=>ai([qI.MEMBER(e),MI,VI]),MEMBER_HISTORY_SCANS:e=>ai([qI.MEMBER(e),MI,WI]),MEMBER_POSITIONS:e=>ai([qI.MEMBER(e),BI]),MEMBER_ACCREDITATIONS:e=>ai([qI.MEMBER(e),zI]),MEMBER_FORMS:e=>ai([qI.MEMBER(e),VI]),MEMBER_FORM:e=>ai([qI.MEMBER(e),UI,e.formId]),MEMBER_FORM_EDIT:e=>gi(qI.MEMBER_FORM(e)),MEMBER_MESSAGES:e=>ai([qI.MEMBER(e),LI]),MEMBER_DOCUMENTS:e=>ai([qI.MEMBER(e),PI]),CREATE:e=>mi(qI.MEMBERS(e))},YI={PLURAL:"workflows",SINGLE:"workflow"},KI=e=>ai([YI.SINGLE,e]),ZI={WORKFLOWS:({eventId:e,...t})=>ai([e?Ui.EVENT({...t,eventId:e}):yi.COMMUNITY(t),YI.PLURAL]),WORKFLOW:({workflowId:e,eventId:t,...n})=>ai([t?Ui.EVENT({...n,eventId:t}):yi.COMMUNITY(n),KI(e)]),CREATE:e=>mi(ZI.WORKFLOWS(e)),UPDATE:e=>gi(ZI.WORKFLOW(e))};var XI;!function(e){e.Assignments="Assignments",e.Badge="Badge",e.Certificate="Certificate",e.UserHours="UserHours",e.UserPlanning="UserPlanning",e.UserPlanningDays="UserPlanningDays",e.UserPlanningList="UserPlanningList"}(XI||(XI={}));const JI=[XI.Assignments,XI.Badge,XI.Certificate,XI.UserHours,XI.UserPlanning,XI.UserPlanningDays,XI.UserPlanningList];function QI(e){let t=e;try{t=new URL(e).pathname}catch{}if(m(t)){const e=t.split(/[\\/]/).pop(),n=e.lastIndexOf(".");let i=e,s="";return n>=0&&(i=e.substring(0,n),s=e.substring(n+1).toLowerCase()),{path:t,name:i,extension:s}}return{path:"",name:"",extension:""}}const ev=["jpg","png","jpeg","gif"];var tv;!function(e){e.Csv="text/csv",e.Default="application/octet-stream",e.Excel="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",e.Gif="image/gif",e.Jpeg="image/jpeg",e.Pdf="application/pdf",e.Png="image/png",e.Zip="application/zip"}(tv||(tv={}));const nv=e=>{switch(e.toLowerCase()){case"csv":return tv.Csv;case"xls":case"xlsx":return tv.Excel;case"gif":return tv.Gif;case"jpg":case"jpeg":return tv.Jpeg;case"pdf":return tv.Pdf;case"png":return tv.Png;case"zip":return tv.Zip;default:return tv.Default}};function iv(e,t){const n=document.createElement("a");n.href=e,n.target="_blank",n.download=t,n.click()}async function sv(e,t,n,i){const s=await K(),{awsS3PostCredentials:{endpointUrl:o,policy:r,amzCredential:a,amzSignature:l,amzDate:d}}=await function(e,t){return ho("query AwsS3PostCredentials($organizationId: OrganizationId!, $acl: String!) {\n awsS3PostCredentials(organizationId: $organizationId, acl: $acl) {\n endpointUrl\n policy\n amzSignature\n amzCredential\n amzDate\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:e,acl:n},s),{name:c,extension:u}=QI(t.name),m=`organization/${e}/${V()}/${h(c)}.${u}`,g=new FormData;return g.append("key",m),g.append("acl",n),g.append("success_action_status","201"),g.append("X-Amz-Credential",a),g.append("X-Amz-Algorithm","AWS4-HMAC-SHA256"),g.append("X-Amz-Date",d),g.append("Policy",r),g.append("X-Amz-Signature",l),g.append("Content-Type",nv(u)),g.append("file",t),new Promise((e,s)=>{const r=new XMLHttpRequest;r.upload.onprogress=e=>{if(e.lengthComputable){const t=Math.round(e.loaded/e.total*100);i?.(t)}},r.onerror=()=>{s(new Error("Could not upload file to S3"))},r.onreadystatechange=()=>{if(4===r.readyState){const i=r.responseXML?.querySelector("Error Code");null!==i?(ri("Could not upload file to S3",{code:i?.textContent??"",message:r.responseXML?.querySelector("Error Message")?.textContent??""}),s(new Error("Could not upload file to S3"))):e({acl:n,key:m,name:t.name,size:t.size})}},r.open("POST",o,!0),r.send(g)})}function ov(e,t){return`https://${t}.s3-eu-west-1.amazonaws.com/${e.key}`}function rv(e){return new Promise((t,n)=>{!function(e,n,i){const s=document.createElement("script");s.onload=()=>{t(!0)},s.onerror=()=>{i&&i()},s.src=e,document.body.appendChild(s)}(e,0,()=>{n(new Error(`Could not load ${e}`))})})}function av(e,t,n){return 25===e?{transform:`translateX(${t}px) rotate(0.25turn)`,transformOrigin:"top left"}:50===e?{transform:"rotate(0.5turn)"}:75===e?{transform:`translateY(${n}px) rotate(0.75turn)`,transformOrigin:"top left"}:{}}const lv=pr("div",{alignItems:"center",background:"#434c5e",borderRadius:"$1",color:"white",cursor:"pointer",display:"flex",variants:{controls:{true:{height:"calc(100% - 10px)",paddingLeft:"10px",paddingRight:"10px",width:"200px"}},rotate:{true:{height:"40px",justifyContent:"center",marginLeft:"10px",width:"40px"}}}}),dv=pr("input",{"-webkit-appearance":"none",background:"transparent",marginLeft:"10px",marginRight:"10px",width:"100%","&::-webkit-slider-thumb":{"-webkit-appearance":"none",background:"white",borderRadius:"16px",cursor:"pointer",height:"16px",marginTop:"-7px",width:"16px"},"&::-webkit-slider-runnable-track":{background:"white",borderRadius:"2px",cursor:"pointer",height:"2px",width:"100%"},"&:focus::-webkit-slider-runnable-track":{background:"white"},"&::-moz-range-thumb":{background:"white",borderRadius:"16px",cursor:"pointer",height:"16px",width:"16px"},"&::-moz-range-track":{background:"white",borderRadius:"2px",cursor:"pointer",height:"2px",width:"100%"},"&::-ms-thumb":{background:"white",borderRadius:"16px",cursor:"pointer",height:"16px",width:"16px"},"&:focus":{ouline:"none"}});var cv;!function(e){e[e.EmptyFile=0]="EmptyFile",e[e.Pdf=1]="Pdf",e[e.Image=2]="Image"}(cv||(cv={}));class uv extends L.Component{contentRef;renderPagesDebounced;constructor(e){super(e);let t=cv.Image;"string"!=typeof this.props.fileUrl||0===this.props.fileUrl.trim().length?t=cv.EmptyFile:"pdf"===QI(this.props.fileUrl).extension&&(t=cv.Pdf),this.state={image:null,isLoading:!0,fileType:t,pdf:null,rotate:0,zoomLevel:100},this.renderPagesDebounced=(0,Nc.A)(()=>{this.renderPdfPages()},200),this.contentRef=L.createRef()}componentDidMount(){var e;this.state.fileType===cv.Pdf?(e=this.props.fileUrl,(void 0===window.pdfjsLib?rv("https://cdn.jsdelivr.net/npm/pdfjs-dist@2.0.943/build/pdf.min.js"):Promise.resolve(!0)).then(()=>window.pdfjsLib.getDocument(e))).then(e=>{this.setState({pdf:e}),this.renderPdfPages()}):this.state.fileType===cv.Image&&this.loaderImage()}renderPdfPages(){this.state.fileType===cv.Pdf&&async function(e,t,n,i){Array.from(t.childNodes).forEach(e=>{t.removeChild(e)});for(let s=1;s<=e.numPages;s++){const o=await e.getPage(s),r=o.getViewport(n),a=document.createElement("div"),l=document.createElement("canvas"),d=l.getContext("2d"),c=av(i,r.height,r.width);25===i||75===i?(a.style.height=`${r.width}px`,a.style.width=`${r.height}px`):(a.style.height=`${r.height}px`,a.style.width=`${r.width}px`),l.height=r.height,l.width=r.width,l.style.transform=c.transform||"",l.style.transformOrigin=c.transformOrigin||"",a.appendChild(l),t.appendChild(a),o.render({canvasContext:d,viewport:r})}}(this.state.pdf,this.contentRef.current,this.state.zoomLevel/100,this.state.rotate).then(()=>{this.setState({isLoading:!1})})}loaderImage(){if(this.state.fileType===cv.Image){const e=new Image;e.onload=()=>{const t=this.contentRef.current.getBoundingClientRect(),n=t.height/e.height,i=t.width/e.width,s=Math.min(n,i);let o=100;s<1&&(o=100*(s-.1*s)),this.setState({image:e,isLoading:!1,zoomLevel:o})},e.onerror=()=>{this.setState({isLoading:!1,fileType:cv.EmptyFile})},e.src=this.props.fileUrl}}imageHeight(){return this.state.image.height*(this.state.zoomLevel/100)}imageWidth(){return this.state.image.width*(this.state.zoomLevel/100)}zoomMinus(){this.setState({zoomLevel:Math.max(1,10*Math.floor((this.state.zoomLevel-10)/10))}),this.renderPagesDebounced()}zoomPlus(){this.setState({zoomLevel:10*Math.ceil((this.state.zoomLevel+10)/10)}),this.renderPagesDebounced()}rangeChange(e){this.setState({zoomLevel:parseInt(e.target.value,10)}),this.renderPagesDebounced()}rotate(){this.setState(e=>{const t=e.rotate+25;return{rotate:t>=100?0:t}}),this.renderPagesDebounced()}render(){return(0,i.jsx)(Hn,{children:({container:e})=>{const t=e.get(Wn);return(0,i.jsxs)(Na,{css:{position:"relative"},direction:"column",height:1,width:1,children:[(0,i.jsx)(yr,{ref:this.contentRef,css:{height:"calc(100% - 50px)",overflow:"auto",padding:"10px",width:"100%",zIndex:"1","& > div":{margin:"auto",marginBottom:"20px"},"& > div:last-child":{marginBottom:"0"}}}),this.state.fileType===cv.Image&&!1===this.state.isLoading&&(0,i.jsx)(yr,{css:{background:"white",height:"calc(100% - 50px)",left:"0",overflow:"auto",padding:"10px",position:"absolute",top:"0",width:"100%",zIndex:"5","& > div:last-child":{marginBottom:"0"}},children:(0,i.jsx)("img",{src:this.state.image.src,style:{height:`${this.imageHeight()}px`,width:`${this.imageWidth()}px`,...av(this.state.rotate,this.imageHeight(),this.imageWidth())}})}),!0===this.state.isLoading&&(0,i.jsx)(yr,{css:{background:"white",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"10"},children:(0,i.jsx)(kl,{})}),this.state.fileType===cv.EmptyFile&&(0,i.jsx)(Na,{align:"center",css:{background:"white",fontSize:"22px",height:"calc(100% - 50px)",left:"0",position:"absolute",top:"0",width:"100%",zIndex:"20"},justify:"center",children:t.translate("aucun_fichier_77247")}),(0,i.jsxs)(Na,{align:"center",css:{height:"50px",width:"100%"},justify:"center",children:[(0,i.jsxs)(lv,{controls:!0,children:[(0,i.jsx)("i",{className:"fas fa-minus",onClick:this.zoomMinus.bind(this)}),(0,i.jsx)(dv,{max:"200",min:"1",step:"1",type:"range",value:this.state.zoomLevel,onChange:this.rangeChange.bind(this)}),(0,i.jsx)("i",{className:"fas fa-plus",onClick:this.zoomPlus.bind(this)})]}),(0,i.jsx)(lv,{rotate:!0,onClick:this.rotate.bind(this),children:(0,i.jsx)("i",{className:"far fa-undo"})})]})]})}})}}const hv=({acl:e,document:t,onDelete:n,...s})=>{const{translate:o}=_l(),[r,a]=(0,L.useState)(!1),l=wc(),d="public-read"===e||m(t.url),c=m(t.url)?t.url:ov(t,P.HEAVENT_AWS_UPLOADS_BUCKET),{designSystem:u}=xl();return(0,i.jsxs)(Na,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",fontSize:"$textSm",overflow:"hidden",minHeight:"72px","@tablet":{border:"1px solid $gray300",borderRadius:"$2",fontSize:"$textMd"},...(()=>{switch(u){case"old":return{padding:"$3","@tablet":{padding:"$3"}};case"new2025":return{padding:"$4 $6"};default:rl()}})()},justify:"between",width:1,...l&&{onClick:()=>{iv(c,t.name)}},...s,children:[(0,i.jsxs)(Na,{align:"center",gap:"4",children:[(0,i.jsx)("img",{src:pd.FileCSV,style:{color:"black"}}),(0,i.jsx)(cl,{css:{ellipsis:!0,...(()=>{if("new2025"===u)return{fontWeight:"$medium"}})()},children:t.name})]}),d&&(0,i.jsxs)(i.Fragment,{children:[!1===l&&(0,i.jsx)(yr,{css:{cursor:"pointer"},onClick:()=>{a(!0)},children:(0,i.jsx)(el,{icon:"eye"})}),(0,i.jsx)(yr,{css:{cursor:"pointer"},...!1===l&&{onClick:()=>{iv(c,t.name)}},children:(0,i.jsx)(el,{icon:"download"})})]}),n&&(0,i.jsx)(El,{"aria-label":o("delete_file_40417"),color:"white",leftIcon:"trash-can",onClick:n}),r&&(0,Ht.createPortal)((0,i.jsx)(Na,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"250"},height:1,width:1,children:(0,i.jsx)(Pm,{heading:t.name,onClose:()=>a(!1),children:(0,i.jsx)(uv,{fileUrl:c})})}),document.body)]})},mv=pr("progress",{}),gv=e=>(0,i.jsx)(mv,{...e,children:e.children}),pv=({name:e,progress:t,...n})=>{const s=Math.min(100,Math.max(0,t)),{inputId:o}=Ga();return(0,i.jsxs)(Na,{css:{border:"1px solid $gray300",borderRadius:"$2",padding:"$4"},direction:"column",width:1,gap:"2",...n,children:[(0,i.jsx)(Pl,{htmlFor:o,children:e}),(0,i.jsxs)(gv,{id:o,max:"100",value:s,children:[s,"%"]})]})};var fv=n(3112);let xv=class{translationService;constructor(e){this.translationService=e}getFormatter(e={}){return Intl.NumberFormat(this.translationService.language.toString().toLowerCase(),{notation:e.notation||"compact",style:e.style||"unit",unit:e.unit||"byte",unitDisplay:e.unitDisplay||"narrow"})}toNumberOrInfinity(e){return"number"==typeof e&&e!==1/0?e.toLocaleString():"∞"}static bytesToMegabytes(e){return`${parseFloat((e/1e6).toPrecision(1))} MB`}static bytesToGigabytes(e){return`${parseFloat((e/1e9).toPrecision(1))} GB`}};xv=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],xv),n(8181);const _v=5e9;let Iv=class extends Ul{constructor(e){super(e)}schema(){const e=this.t("le_document_est_86403");return d.Ik().shape({acl:d.Yj().required(e),key:d.Yj().required(e).test("is-a-zip",this.t("le_fichier_n_es_91526"),e=>nv(QI(e).extension)===tv.Zip),name:d.Yj().required(e),file:d.gl().test("is-not-too-big",this.t("le_fichier_est_17522"),e=>!e||e.size<_v)})}};Iv=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Iv);var vv=n(5526);const bv=[" ","@","£","$","¥","è","é","ù","ì","ò","Ç","Ø","ø","Å","å","Æ","æ","ß","É","!",'"',"#","¤","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","¡","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","Ä","Ö","Ñ","Ü","§","¿","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","ä","ö","ñ","ü","à"],jv=["^","{","}","\\","|","[","]","~","€","\n"],Cv=bv.concat(jv);function yv(e,t){const n=t?145:160,i=Array.from(e??"").reduce((e,t)=>bv.includes(t)?e+1:jv.includes(t)?e+2:e,0);return i<=n?{numberOfCharacters:i,numberOfSms:1}:{numberOfCharacters:i,numberOfSms:Math.ceil(i/153)}}const kv=/^[a-z][a-z0-9]{2,10}$/i,Av=2e7;var wv;!function(e){e.Accreditations="accreditations",e.Everyone="everyone",e.Positions="positions",e.Segments="segments",e.States="states",e.Users="users"}(wv||(wv={}));let Sv=class extends Ul{constructor(e){super(e)}createUpdateCampaignValuesDefault(e,t,n,i){const s=this.campaignInputDefault(e,t,n,i);return{campaign:s,recipients:s.sendToEveryone?wv.Everyone:no(s.states)?wv.States:no(s.segmentsIds)?wv.Segments:no(s.accreditationsCategoriesIds)||no(s.accreditationsIds)||no(s.accreditationsSlotsIds)?wv.Accreditations:no(s.positionsCategoriesIds)||no(s.positionsIds)||no(s.positionsSlotsIds)?wv.Positions:wv.Users,customSender:m(n?.sender),textOrHtml:m(n?.html)?"html":"text",delivery:s.state===ue.Scheduled&&n?.scheduledAt?.isValid?"later":"now"}}campaignStep1Fields(){return{name:d.Yj().required(this.t("le_nom_de_la_ca_63405")),campaignType:d.Yj().required(this.t("le_type_de_camp_96559")).oneOf(Jt,this.t("le_type_de_camp_56467"))}}campaignStep1Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep1Fields()})})}campaignStep2Fields(){const e=this;return{sender:d.Yj().test("is-valid",this.t("l_metteur_ne_r_16421"),function(){return!m(this.parent.sender)||kv.test(this.parent.sender)}),text:d.Yj().test("non-empty-text",this.t("le_contenu_est_45048"),function(){return m(this.parent.text)||m(this.parent.html)}).test("only-valid-characters","",function(){if(this.parent.campaignType===he.Email)return!0;{const n=(t=this.parent.text,new Set(Array.from(t??"").filter(e=>!Cv.includes(e))));return!(n.size>0)||this.createError({message:e.translationService.translate("les_caract_res_84839",Array.from(n).join(", "))})}var t}).test("max-length",this.t("le_contenu_ne_p_25416"),function(){return this.parent.campaignType===he.Email||this.parent.text.length<1e3}).test("no-percent-encoded-variables",this.t("le_texte_de_l_e_71717"),function(){return!this.parent.text.includes("%7B")&&!this.parent.text.includes("%7D")}),subject:d.Yj().when("campaignType",{is:he.Email,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),html:d.Yj().test("non-empty-text",this.t(this.t("le_code_html_es_52280")),function(){return m(this.parent.text)||m(this.parent.html)}),replyTo:d.Yj().email(this.t("l_adresse_de_r_53879")).test("clean-reply-to",this.t("l_adresse_de_r_53879"),function(){return K_(this.parent.replyTo)}),documents:d.YO().test("max-size",this.t("l_ensemble_des_32797"),function(){return this.parent.campaignType!==he.Email||!no(this.parent.documents)||(0,vv.A)(this.parent.documents,e=>e.size)e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:qm.when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),otherwise:e=>e.nullable()}),calendarInviteStartTime:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:qm.when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")),otherwise:e=>e.nullable()}),calendarInviteEndTime:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})}}campaignStep2Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep2Fields()})})}campaignStep3Fields(){const e=this,t=function(){return this.parent.state!==ue.Draft&&this.parent.state!==ue.Scheduled||!1!==this.parent.sendToEveryone||0!==this.parent.states.length||0!==this.parent.positionsCategoriesIds.length||0!==this.parent.positionsIds.length||0!==this.parent.positionsSlotsIds.length||0!==this.parent.tagsIds.length||0!==this.parent.accreditationsCategoriesIds.length||0!==this.parent.accreditationsIds.length||0!==this.parent.accreditationsSlotsIds.length||0!==this.parent.usersInfosIds.length||0!==this.parent.segmentsIds.length||this.createError({message:e.translationService.translate("vous_devez_s_le_80552")})};return{sendToEveryone:d.zM().required(this.t("requis_75853")),states:d.YO().of(d.Yj()).test("non-empty","",t),positionsCategoriesIds:d.YO().of(d.ai()).test("non-empty","",t),positionsIds:d.YO().of(d.ai()).test("non-empty","",t),positionsSlotsIds:d.YO().of(d.ai()).test("non-empty","",t),tagsIds:d.YO().of(d.ai()).test("non-empty","",t),accreditationsCategoriesIds:d.YO().of(d.ai()).test("non-empty","",t),accreditationsIds:d.YO().of(d.ai()).test("non-empty","",t),accreditationsSlotsIds:d.YO().of(d.ai()).test("non-empty","",t),usersInfosIds:d.YO().of(d.ai()).test("non-empty","",t),segmentsIds:d.YO().of(d.ai()).test("non-empty","",t)}}campaignStep3Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep3Fields()})})}campaignStep4Fields(){return{scheduledAtDate:qm.when("state",{is:ue.Scheduled,then:e=>e.required(this.t("la_date_d_envoi_17792")).typeError(this.t("la_date_d_envoi_17792"))}),scheduledAtTime:d.Yj().when("state",{is:ue.Scheduled,then:e=>e.required(this.t("l_heure_d_envoi_53643")).matches(/\d{2}:\d{2}/,this.t("l_heure_d_envoi_53643"))})}}campaignStep4Schema(){return d.Ik().shape({campaign:d.Ik().shape({...this.campaignStep4Fields()})})}campaignInputSchema(){return d.Ik().shape({...this.campaignStep1Fields(),...this.campaignStep2Fields(),...this.campaignStep3Fields(),...this.campaignStep4Fields()})}createUpdateCampaignSchema(){return d.Ik().shape({campaign:this.campaignInputSchema()})}campaignInputDefault(e,t,n,i){let s=n?.segmentsIds??[],o=n?.usersInfosIds??[];if(m(i))try{const e=JSON.parse(r(i));e.segmentId&&(s=[e.segmentId]),no(e.usersInfosIds)&&(o=e.usersInfosIds)}catch{}const a=!no(s)&&!no(o)&&(n?.sendToEveryone??!1);return{name:n?.name??"",state:n?.state??(e?ue.Template:ue.Draft),campaignType:n?.campaignType??he.Email,sender:n?.sender??"",text:n?.text??"",subject:n?.subject??"",html:n?.html??"",replyTo:n?.replyTo??"",sendToEveryone:a,states:n?.states??[],positionsCategoriesIds:n?.positionsCategoriesIds??[],positionsIds:n?.positionsIds??[],positionsSlotsIds:n?.positionsSlotsIds??[],tagsIds:n?.tagsIds??[],accreditationsCategoriesIds:n?.accreditationsCategoriesIds??[],accreditationsIds:n?.accreditationsIds??[],accreditationsSlotsIds:n?.accreditationsSlotsIds??[],usersInfosIds:o,segmentsIds:s,scheduledAtDate:n?.scheduledAt??void 0,scheduledAtTime:n?.scheduledAt?.toFormat("HH:mm")??void 0,documents:n?.documents??[],emailSenderId:n?.emailSenderId??t,attachments:n?.attachments??[],hasCalendarInvite:n?.hasCalendarInvite??!1,calendarInviteName:n?.calendarInviteName??null,calendarInviteStartDate:n?.calendarInviteStartDate??null,calendarInviteStartTime:n?.calendarInviteStartTime??null,calendarInviteEndDate:n?.calendarInviteEndDate??null,calendarInviteEndTime:n?.calendarInviteEndTime??null}}};Sv=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Sv);var Ev=n(4809),Tv=n.n(Ev);const zv=2e7;let Ov=class extends Ul{constructor(e){super(e)}csvDocumentInputDefault(e){return{key:"",name:"",acl:"",formats:{timeFormat:"HH:mm",dateFormat:Ws,datetimeFormat:"yyyy-MM-dd HH:mm",...e}}}schema(){const e=this.t("le_document_est_86403");return d.Ik().shape({acl:d.Yj().required(e),delimiter:d.Yj().optional().test("is-valid-value",this.t("delimiter_value_52108"),e=>!e||!Tv().BAD_DELIMITERS.includes(e)),key:d.Yj().required(e).test("is-a-csv",this.t("le_fichier_n_es_33134"),e=>nv(QI(e).extension)===tv.Csv),name:d.Yj().required(e),newline:d.Yj().optional().test("is-valid-value",this.t("newline_charact_88066"),e=>!e||["\r","\n","\r\n"].includes(e)),quoteChar:d.Yj().optional(),formats:d.Ik().shape({timeFormat:d.Yj().optional(),dateFormat:d.Yj().optional(),datetimeFormat:d.Yj().optional()}),file:d.gl().test("is-not-empty",this.t("the_file_is_emp_77243"),e=>!e||e.size>0).test("is-not-too-big",this.t("le_fichier_est_17522"),e=>!e||e.size{switch(e){case Rv.Archives:return["zip"];case Rv.Csv:return["csv"];case Rv.Gpx:return["gpx"];case Rv.Images:return["jpg","png","jpeg","gif"];case Rv.Kml:return["kml"];case Rv.Pdf:return["pdf"];default:return rl()}})}function Dv(e){return to(e).flatMap(e=>e===Rv.Images?"image/*":$v(e).map(e=>`.${e}`)).join(",")}Ov=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Ov),function(e){e[e.Archives=0]="Archives",e[e.Csv=1]="Csv",e[e.Gpx=2]="Gpx",e[e.Images=3]="Images",e[e.Kml=4]="Kml",e[e.Pdf=5]="Pdf"}(Rv||(Rv={}));var Pv=n(9618);const Fv=({allowCrop:e,onChange:t,hint:n,label:s,...o})=>{const r=Yn(),a=(0,L.useRef)(null),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(null),[h,m]=(0,L.useState)(!1),g=$v(Rv.Images),p=e=>{if(e&&e[0]){const t=URL.createObjectURL(e[0]),n=e[0].type,i=new FileReader;i.onload=i=>{u({src:t,type:(0,fv.h)(i.target?.result,n),name:e[0].name})},i.readAsArrayBuffer(e[0])}m(!0)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{gap:"4",width:1,children:[(0,i.jsx)(Na,{align:"center",css:{background:l?"$primary50":"$gray50",border:l?"1px solid $primary300":"1px solid $gray200",borderRadius:"$1",cursor:"pointer"},height:126,justify:"center",width:126,onClick:()=>{a.current?.click()},onDragEnter:e=>{Rl(e),d(!0)},onDragLeave:e=>{Rl(e),d(!1)},onDragOver:e=>{Rl(e),l||d(!0)},onDrop:n=>{Rl(n),d(!1);const i=n.dataTransfer.files.item(0);i&&g.includes(QI(i.name).extension)&&(e?p(n.dataTransfer.files):t(i))},children:(0,i.jsx)(Na,{align:"center",css:{background:l?"$primary100":"$gray100",borderRadius:"36px",color:l?"$primary600":"$gray600"},height:l?48:32,justify:"center",width:l?48:32,children:(0,i.jsx)(el,{icon:"plus"})})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",children:s}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray400",children:n})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:()=>{a.current?.click()},children:r("s_lectionner_un_50712")})})]}),(0,i.jsx)(yr,{css:{display:"none"},children:(0,i.jsx)("input",{ref:a,accept:Dv(Rv.Images),type:"file",onChange:n=>{n.target.files?.[0]&&(e?p(n.target.files):t(n.target.files[0]))},...o})})]}),e&&h&&c&&(0,i.jsx)(Mv,{image:c,onChange:t,onClose:()=>m(!1)})]})},Mv=({image:e,onChange:t,onClose:n})=>{const s=Yn(),o=(0,L.useRef)(null);return(0,L.useEffect)(()=>()=>{e&&e.src&&URL.revokeObjectURL(e.src)},[e]),(0,i.jsx)(su,{size:"md",onClose:n,children:(0,i.jsxs)(Na,{css:{overflow:"auto"},direction:"column",gap:"3",children:[(0,i.jsx)(Pv.IOb,{ref:o,className:"cropper",defaultSize:({imageSize:e,visibleArea:t})=>({width:(t||e).width,height:(t||e).height}),src:e.src,stencilProps:{aspectRatio:1}}),(0,i.jsx)(El,{size:"lg",textAlign:"center",onClick:()=>{const i=o.current?.getCanvas();i&&i.toBlob(n=>{if(n){const i=new File([n],e.name,{lastModified:(new Date).getTime(),type:e.type});t(i)}},e.type,.95),n()},children:s("submit_21373")})]})})},Nv="dragover",Lv=({accept:e,allowCrop:t,"aria-describedby":n,capture:s,onChange:o,...r})=>{const{translate:a}=_l(),l=Kn(),d=(0,Wa.A)(),c=(0,L.useRef)(null),[u,h]=(0,L.useState)(void 0),[m,g]=(0,L.useState)(null),[p,f]=(0,L.useState)(!1),x=$v(e||[]),_=(I=e||[],Math.min(...to(I).flatMap(e=>{switch(e){case Rv.Archives:return _v;case Rv.Csv:return zv;case Rv.Images:case Rv.Pdf:return Av;case Rv.Kml:case Rv.Gpx:return 1/0;default:return rl()}})));var I;const v=e=>{if(e&&e[0]){const t=URL.createObjectURL(e[0]),n=e[0].type,i=new FileReader;i.onload=i=>{g({src:t,type:(0,fv.h)(i.target?.result,n),name:e[0].name})},i.readAsArrayBuffer(e[0])}f(!0)},{designSystem:b}=(0,L.useContext)(fl);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("input",{ref:c,accept:e?Dv(e):void 0,"aria-describedby":[n,d].join(" "),capture:s,style:{display:"none"},type:"file",onChange:n=>{if(n.target.files?.[0])if(t){if(e!==Rv.Images)throw new Error("Crop enabled on non-image file uploader");v(n.target.files)}else o(n.target.files[0])},...r}),(0,i.jsxs)(Na,{align:"center",className:u,css:{background:"$gray50",borderWidth:"1px",borderColor:"$gray200",borderRadius:"$2",cursor:"pointer",padding:"$4",[`&.${Nv}`]:{background:"$primary50",borderColor:"$gray200"},...(()=>{switch(b){case"old":return{borderStyle:"solid"};case"new2025":return{borderStyle:"dashed",[`&:hover, &:has( input:focus), &.${Nv}`]:{borderStyle:"solid",borderColor:"$primary700"}};default:rl()}})()},direction:"column",gap:"2",width:1,onClick:()=>c.current?.click(),onDragLeave:()=>h(void 0),onDragOver:()=>h(Nv),onDrop:n=>{Rl(n),h(void 0);const i=n.dataTransfer.files.item(0);if(i&&(0===x.length||x.includes(QI(i.name).extension)))if(t){if(e!==Rv.Images)throw new Error("Crop enabled on non-image file uploader");v(n.dataTransfer.files)}else o(i)},children:[(0,i.jsx)(Na,{align:"center","aria-hidden":!0,css:{color:"$gray600",...(()=>{switch(b){case"old":return{background:"$gray100",borderRadius:"36px"};case"new2025":return;default:rl()}})()},height:32,justify:"center",width:32,children:(0,i.jsx)(el,{icon:"cloud-arrow-down"})}),(0,i.jsxs)(Na,{css:{textAlign:"center"},direction:"column",justify:"center",wrap:"wrap",children:[(0,i.jsx)(cl,{textStyle:"subtitle",children:[...l(a("_1_ou_glisser_61813","{1}"),(0,i.jsx)(El,{color:"invisible",css:{height:"auto",padding:0},id:"clickHereLink",type:"button",children:a("cliquez_ici_98447")}))]}),(0,i.jsx)(cl,{id:d,textStyle:"subtitle",children:[...l(a("_1_accept_2_30390","{1}","{2}"),no(x)?x.map((e,t,{length:n})=>(0,i.jsxs)(L.Fragment,{children:[t>0?n-1!==t?", ":" & ":"",(0,i.jsxs)("code",{children:[".",e]})]},e)):a("all_file_format_50211"),_!==1/0?xv.bytesToMegabytes(_):a("no_55268"))]})]})]}),t&&p&&m&&(0,i.jsx)(Mv,{image:m,onChange:o,onClose:()=>f(!1)})]})};var Bv;!function(e){e[e.File=0]="File",e[e.Uploader=1]="Uploader",e[e.Uploading=2]="Uploading"}(Bv||(Bv={}));const Vv=({acl:e,css:t,descId:n,description:s,errorId:o,inputId:r,label:a,labelId:l,hint:d,onChange:c,organizationId:u,state:h,value:m,...g})=>{const{translate:p}=_l(),[f,x]=(0,L.useState)(m?Bv.File:Bv.Uploader),[_,I]=(0,L.useState)(""),[v,b]=(0,L.useState)(0);return(0,i.jsxs)(Na,{"aria-live":"polite",css:t,direction:"column",gap:"1",width:1,children:[(a||s)&&(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(Pl,{htmlFor:r,id:l,children:a}),(0,i.jsx)($l,{id:n,children:s})]}),f===Bv.File&&m?(0,i.jsx)(hv,{acl:e,"aria-label":p("delete_uploaded_14711"),document:m,id:r,role:"button",onDelete:()=>{c(null),x(Bv.Uploader)}}):f===Bv.Uploading?(0,i.jsx)(pv,{"aria-busy":!0,"aria-describedby":n,"aria-label":p("uploading_file_46483"),id:r,name:_,progress:v}):(0,i.jsx)(Lv,{"aria-describedby":n,"aria-errormessage":o,"aria-invalid":"error"===h,"aria-label":p("upload_file_97740"),id:r,onChange:async t=>{x(Bv.Uploading),I(t.name),b(0);try{const n=await sv(u,t,e,b);c({...n,file:t}),x(Bv.File)}catch{x(Bv.Uploader)}},...g}),(0,i.jsx)(Dl,{state:h,children:d})]})},Uv=e=>{const t=Yn();return(0,i.jsxs)(Na,{align:"center",gap:"1",children:[e.children,(0,i.jsxs)(yr,{color:"gray500",fontSize:"textXs",fontWeight:"regular",children:["(",t("facultatif_76747"),")"]})]})},Wv=(0,L.createContext)({}),Gv=pr("div",{background:"$gray50",border:"1px solid $gray100",borderRadius:"$2",display:"flex",gap:"$2",height:"44px",minHeight:"44px",padding:"$1",position:"relative",width:"100%"}),Hv=pr("div",{alignItems:"center",color:"$gray500",cursor:"pointer",display:"flex",fontWeight:"$medium",height:"100%",justifyContent:"center",userSelect:"none",width:"100%",variants:{selected:{true:{background:"white",borderRadius:"6px",boxShadow:"$sm",color:"$gray700"}}}}),qv=e=>(0,i.jsx)(Wv.Provider,{value:{selectedItem:e.selectedItem,onChange:e.onChange},children:(0,i.jsx)(Gv,{children:e.children})}),Yv=e=>{const{selectedItem:t,onChange:n}=(0,L.useContext)(Wv);return(0,i.jsx)(Hv,{selected:t===e.item,onClick:()=>{n(e.item)},children:e.children})};var Kv=n(3333),Zv=n(5488),Xv=n.n(Zv);n(4385),n(5833),n(9844),n(6871),n(2830);const Jv=({css:e,label:t,description:n,state:s,initialValue:o,onChange:r,onBlur:a,onFocus:l,hint:d,placeholder:c,value:u,...h})=>{const{translate:m,params:{organizationId:g}}=_l(),{language:p}=qn(Wn),f=(0,L.useMemo)(()=>[{color:"white",label:m("blanc_36425")},{color:fr.colors.gray800.value,label:m("gris_fonc_51159")},{color:fr.colors.gray400.value,label:m("gris_clair_52465")},{color:fr.colors.primary900.value,label:m("bleu_fonc_40491")},{color:fr.colors.primary700.value,label:m("bleu_41949")},{color:fr.colors.error700.value,label:m("rouge_fonc_45023")},{color:fr.colors.error500.value,label:m("rouge_75079")},{color:fr.colors.warning300.value,label:m("jaune_53503")},{color:fr.colors.warning600.value,label:m("orange_64132")},{color:fr.colors.success700.value,label:m("vert_fonc_37265")},{color:fr.colors.success500,label:m("vert_27018")},{color:fr.colors.purple700.value,label:m("violet_fonc_77270")},{color:fr.colors.purple500.value,label:m("violet_54005")},{color:fr.colors.pink700.value,label:m("rose_fonc_98996")},{color:fr.colors.pink500.value,label:m("rose_49360")}],[]);return(0,i.jsxs)(Na,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Pl,{children:t}),(0,i.jsx)($l,{children:n}),(t||n)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{css:{"--ck-border-radius":"$radii$1","--ck-color-toolbar-background":"$colors$gray100","& .ck.ck-toolbar":{borderColor:"error"===s?"$error500":"$gray300",borderBottom:"none","& .ck.ck-toolbar__separator":{background:"$gray200"},"& .ck.ck-button":{color:"$gray600","&:hover":{background:"$gray200",color:"$gray800",cursor:"pointer"},"&.ck-on, &.ck-on:hover:not(.ck-disabled)":{background:"$primary300",color:"$primary700"}}},"& .ck.ck-content":{borderColor:"error"===s?"$error500 !important":"$gray300 !important",borderStyle:"solid",borderWidth:"1px",borderTop:"none !important",color:"$gray800",minHeight:"100px",px:"$3","&.ck-editor__editable.ck-focused":{boxShadow:"none"},"& p.h-small":{fontSize:"12px"}},"& .ck.ck-editor__editable > .ck-placeholder::before":{color:"$gray500"},...fg("& .ck.ck-content")},width:1,children:(0,i.jsx)(Kv.CKEditor,{config:{placeholder:c,fontColor:{colors:f},fontBackgroundColor:{colors:f},language:p.toString().toLowerCase(),simpleUpload:{uploadUrl:`${P.HEAVENT_API_URL}/image/upload?organizationId=${g}`},heading:{options:[{model:"paragraphSmall",view:{name:"p",classes:"h-small"},title:m("paragraphe_pet_01073"),class:"ck-heading_paragraph_small",converterPriority:"high"},{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading2"}]}},data:o,editor:Xv(),onBlur:()=>{a?.()},onChange:(e,t)=>{r(t.getData())},onFocus:()=>{l?.()},...h})}),(0,i.jsx)(Dl,{state:s,children:d})]})},Qv=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ua.D0,{name:e,parse:zl.A,render:o=>{const r=Ol(o.meta);return(0,i.jsx)(Jv,{hint:r?o.meta.error:t,initialValue:o.input.value,name:e,state:r?"error":n,onChange:e=>{o.input.onChange(e)},...s})}}),eb=({value:e,css:t,label:n,description:s,hint:o,icon:r,onChange:a,state:l,...d})=>{const c=m(e)&&e.length>5?e.substring(0,5):e,{inputId:u,descId:h,errorId:g}=Ga();return(0,i.jsxs)(Na,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Pl,{htmlFor:u,children:n}),(0,i.jsx)($l,{id:h,children:s}),(n||s)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Ml,{cursor:"default",icon:r,state:l,children:(0,i.jsx)(yr,{css:{flex:"1",height:"100%","& input":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},children:(0,i.jsx)("input",{"aria-describedby":s?h:void 0,"aria-errormessage":"error"===l?g:void 0,"aria-invalid":"error"===l,disabled:"disabled"===l,id:u,type:"time",value:c,onChange:e=>{a(e.target.value)},...d})})}),(0,i.jsx)(Dl,{id:g,state:l,children:o})]})},tb=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ua.D0,{name:e,render:o=>{const r=Ol(o.meta);return(0,i.jsx)(eb,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),nb=e=>{const{translate:t}=_l();return(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(Nm,{name:`${e.prefix}hasCalendarInvite`,children:(0,i.jsxs)(Na,{align:"center",gap:"2",children:[t("ajouter_une_inv_92123"),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"gray500",children:(0,i.jsx)(el,{icon:"circle-exclamation"})})}),(0,i.jsx)(Cm,{placement:"top",children:t("un_fichier_ics_01663")})]})]})}),e.hasCalendarInvite&&(0,i.jsx)(Na,{css:{paddingLeft:"$6"},width:1,children:(0,i.jsxs)(Na,{css:{background:"$gray50",bd:!0,padding:"$4 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Ll,{label:t("nom_de_l_v_nem_08711"),name:`${e.prefix}calendarInviteName`}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Lm,{label:t("date_de_d_but_43380"),name:`${e.prefix}calendarInviteStartDate`}),(0,i.jsx)(tb,{label:t("heure_de_d_but_27566"),name:`${e.prefix}calendarInviteStartTime`})]}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Lm,{label:t("date_de_fin_86920"),name:`${e.prefix}calendarInviteEndDate`}),(0,i.jsx)(tb,{label:t("heure_de_fin_95071"),name:`${e.prefix}calendarInviteEndTime`})]})]})})]})},ib=e=>{const{history:t,translate:n,params:{organizationId:s}}=_l(),[o,r]=(0,L.useState)(e.values.campaign.documents);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ll,{label:n("sujet_36033"),name:"campaign.subject"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(qv,{selectedItem:e.values.textOrHtml,onChange:t=>{e.form.change("textOrHtml",t)},children:[(0,i.jsx)(Yv,{item:"text",children:n("contenu_en_vers_04808")}),(0,i.jsx)(Yv,{item:"html",children:n("contenu_parti_04631")})]}),(0,i.jsx)(qa,{height:"7"}),"text"===e.values.textOrHtml&&(0,i.jsx)(Qv,{hint:(0,i.jsx)(yr,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("contenu_29668"),name:"campaign.text"}),"html"===e.values.textOrHtml&&(0,i.jsx)(Gm,{hint:(0,i.jsx)(yr,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("code_html_60711"),name:"campaign.html"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Um,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:n("_metteur_de_l_e_51616")}),name:"campaign.emailSenderId",onCreateClick:()=>{t.push($s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(t=>(0,i.jsx)("option",{value:t.id,children:`${t.name} ${t.id===e.emailSenderId?n("_metteur_par_d_03442"):t.isValidToSendEmail?"":n("_e_mail_non_con_07618")}`},t.id))}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Ll,{isEmail:!0,label:(0,i.jsx)(Uv,{children:n("adresse_de_r_po_86181")}),name:"campaign.replyTo"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{align:"center",gap:"1",children:[(0,i.jsx)(yr,{color:"gray700",fontSize:"textMd",fontWeight:"semiBold",children:n("pi_ce_s_jointe_82370")}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"gray500",children:(0,i.jsx)(el,{icon:"circle-exclamation"})})}),(0,i.jsx)(Cm,{placement:"bottom",children:n("si_vos_pi_ces_j_95233")})]})]}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:n("int_grer_dans_v_73429")}),e.canCustomDocuments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Um,{isSearchVisible:!0,label:n("documents_dit_25968"),multiple:!0,name:"campaign.attachments",children:[e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),JI.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))]})]}),o.map(t=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Vv,{acl:"public-read",organizationId:s,value:t,onChange:()=>{const n=(0,dc.A)(o,t);r(n),e.form.change("campaign.documents",n)}})]},t.key)),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Vv,{acl:"public-read",label:n("fichier_personn_20046"),organizationId:s,value:null,onChange:t=>{const n=[...o,(0,dr.A)(t,"file")];r(n),e.form.change("campaign.documents",n)}}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(nb,{hasCalendarInvite:e.values.campaign.hasCalendarInvite,prefix:"campaign."})]})},sb=e=>(0,i.jsx)(Ua.D0,{name:e.name,render:t=>{const n=t.input.checked?"checked":"unchecked";return(0,i.jsx)(xc,{disabled:e.disabled,size:e.size,state:n,subtext:e.subtext,onClick:()=>{t.input.onChange(e.value)},children:e.children})},type:"radio",value:e.value}),ob=e=>{const t=Yn(),n=e.formRenderProps.values,{numberOfCharacters:s,numberOfSms:o}=yv(n.campaign.text,n.customSender);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("voulez_vous_per_07528")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(sb,{name:"customSender",value:!1,children:t("non_je_souhait_47056")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"customSender",value:!0,children:t("oui_je_souhait_40974")}),e.formRenderProps.values.customSender&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(yr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(Ll,{hint:t("doit_commencer_93759"),name:"campaign.sender",placeholder:t("_metteur_du_mes_17005")})})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Gm,{hint:(0,i.jsx)(yr,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:t("vous_pouvez_ajo_23408")}}),label:(0,i.jsxs)(Na,{justify:"between",children:[(0,i.jsx)(yr,{children:t("contenu_29668")}),(0,i.jsx)(yr,{color:"gray500",children:t("_1_caract_re_04414",s,o)})]}),name:"campaign.text"})]})},rb=e=>{const t=Yn();return(0,i.jsxs)(i.Fragment,{children:[e.formRenderProps.values.campaign.campaignType===he.Email?(0,i.jsx)(ib,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,form:e.formRenderProps.form,values:e.formRenderProps.values}):(0,i.jsx)(ob,{formRenderProps:e.formRenderProps}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:e.formRenderProps.submitting,onClick:e.formRenderProps.handleSubmit,children:e.isTemplate?e.isEdit?t("mettre_jour_l_13576"):t("cr_er_le_mod_le_06346"):e.isSent?t("mettre_jour_l_32694"):t("suivant_desti_10756")})})]})},ab=({css:e,footer:t,header:n,heading:s,subtitle:o,children:r,...a})=>(0,i.jsxs)(Na,{as:Pa.Section,className:"card",css:{padding:"unset !important",bd:!0,inlineSize:"100%",backgroundColor:"$white","& .card":{backgroundColor:"$gray50","& .card__body":{padding:"$4 $5"}},overflow:"hidden",...e},direction:"column",...a,children:[n||(s||o)&&(0,i.jsx)(Na,{align:"center",as:Pa.Header,css:{borderBlockEnd:"1px solid $gray200",padding:"$6 $7 $5 $7"},gap:"3",children:(0,i.jsxs)(yr,{css:{flex:"1"},children:[s&&(0,i.jsx)(ul,{textStyle:"heading",children:s}),o&&(0,i.jsx)(cl,{textStyle:"subtitle",children:o})]})}),(0,i.jsx)(Na,{className:"card__body",css:{gap:"$6",padding:"$6 $7","&:empty":{display:"none"}},direction:"column",children:r}),t&&(0,i.jsx)(Na,{as:Pa.Footer,css:{borderBlockStart:"1px solid $gray200",padding:"$6","&:empty":{display:"none"}},gap:"3",children:t})]}),lb=e=>(0,i.jsx)(Na,{as:"legend",css:{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",width:"1px",height:"1px",whiteSpace:"nowrap"},direction:"column",children:e.heading});var db;!function(e){e.Dark="dark",e.Normal="normal"}(db||(db={}));const cb=({canSelect:e,children:t,footerActions:n,heading:s,header:o,headerStyle:r=db.Normal,headerActions:a,hideHeader:l,isCompleted:d,isOpen:c,onSelect:u,stepNumber:h,subtitle:m,...g})=>{const{descId:p}=Ga();return(0,i.jsx)(ab,{"aria-describedby":p,as:"fieldset",css:g.css,direction:"column",footer:!1!==c&&n,header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(lb,{heading:s}),!l&&(0,i.jsxs)(Na,{align:"center",as:"header",css:{paddingBlockEnd:"$5",padding:"$6 $7 $5 $7",...r===db.Normal?{borderBlockEnd:"1px solid $gray200"}:{background:c?"$gray900":"white",cursor:e&&!c?"pointer":"default",px:"$6"}},gap:"3",onClick:u,children:[r===db.Dark&&(0,i.jsx)(Na,{align:"center",css:{background:d?"$success200":"white",border:d?"none":"1px solid $gray200",borderRadius:"32px",color:d?"$success700":"$gray800",fontWeight:"$medium"},height:32,justify:"center",width:32,children:d?(0,i.jsx)(el,{icon:"check"}):h}),(0,i.jsxs)(yr,{css:{flex:"1"},children:[s&&(0,i.jsx)(ul,{"aria-hidden":"true",css:{color:c?"white":"gray800"},textStyle:"heading",children:s}),m&&(0,i.jsx)(cl,{color:c?"white":"gray800",id:p,textStyle:"subtitle",children:m})]}),a&&(0,i.jsx)(Na,{gap:"4",justify:"end",children:a})]})]}),...g,children:!1!==c&&(0,i.jsx)(Na,{css:{gap:"$3","&:has(> fieldset.fieldset--column)":{gap:"$9"},"&:has(> fieldset.fieldset--row)":{gap:"unset"}},direction:"column",children:t})})},ub=e=>(0,i.jsxs)(yr,{css:{borderRadius:"$1",boxShadow:"$sm",overflow:"hidden",width:"100%"},children:[(0,i.jsxs)(Na,{align:"center",css:{background:e.isOpen?"$gray900":"white",cursor:e.canSelect&&!e.isOpen?"pointer":"default",px:"$6"},gap:"4",height:64,width:1,onClick:()=>{e.canSelect&&e.onSelect()},children:[(0,i.jsx)(Na,{align:"center",css:{background:e.isCompleted?"$success200":"white",border:e.isCompleted?"none":"1px solid $gray200",borderRadius:"32px",color:e.isCompleted?"$success700":"$gray800",fontWeight:"$medium"},height:32,justify:"center",width:32,children:e.isCompleted?(0,i.jsx)(el,{icon:"check"}):e.stepNumber}),(0,i.jsx)(yr,{color:e.isOpen?"white":"gray800",fontSize:"textMd",fontWeight:"medium",children:e.heading})]}),e.isOpen&&(0,i.jsx)(yr,{css:{background:"white",padding:"$6 70px",width:"100%"},children:e.children}),(0,i.jsx)(Na,{children:e.actions})]}),hb=e=>(0,i.jsx)(jl,{direction:"column",formRenderProps:e.formRenderProps,render:e.render}),mb=e=>{const{translate:t}=_l(),[n,s]=L.useState(!1),[o,r]=L.useState(0),a=qn(Ba),l=L.Children.toArray(e.children),{designSystem:d}=xl(),[c,u]=L.useState(!1);return c?(0,i.jsx)(cb,{heading:t("r_capitulaif_76565"),children:e.summaryStep}):(0,i.jsx)(Ua.lV,{initialValues:e.initialValues,initialValuesEqual:Pr.A,mutators:{...Va.A,forceErrors:bl},render:t=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ua.Pc,{subscription:{dirtyFields:!0},children:({dirtyFields:e})=>Object.keys(e).map((e,t)=>(0,i.jsx)(Ua.D0,{name:e,render:()=>null,subscription:{}},t))}),l.map((a,l)=>{const c=o>=l||e.isEdit&&t.valid;if("string"==typeof a||"number"==typeof a||"boolean"==typeof a||!("props"in a))throw new Error("Invalid step passed to wizard");return(0,i.jsxs)(Ha.Provider,{value:{formRenderProps:t,showErrors:n,setShowErrors:s},children:["new2025"===d?(0,i.jsx)(cb,{canSelect:c,footerActions:a.props.actions?.(t),headerStyle:db.Dark,heading:a.props.heading,isCompleted:o>l,isOpen:o===l,stepNumber:l+1,onSelect:()=>{c&&(s(!1),r(l))},children:L.cloneElement(a,{formRenderProps:t})}):(0,i.jsx)(ub,{canSelect:c,handleSubmit:t.handleSubmit,heading:a.props.heading,isCompleted:o>l,isOpen:o===l,stepNumber:l+1,onSelect:()=>{c&&(s(!1),r(l))},children:L.cloneElement(a,{formRenderProps:t})}),(0,i.jsx)(qa,{height:"6"})]},l)})]}),validate:e=>a.validateForForm(l[o].props.schema)(e),onSubmit:async(t,n)=>{o===l.length-1?(await e.onSubmit(t,n),u(!0)):(s(!1),r(o+1))}})},gb=L.createContext({}),pb=e=>{const{params:{eventId:t}}=_l(),n=L.useMemo(()=>function(e){return e.roles.some(e=>_I.includes(e.type))}(e.userPermissions),[e.userPermissions]);return t?(0,i.jsx)(gb.Provider,{value:{isEventAdmin:e.isEventAdmin??!1,isEventReader:n,userPermissions:e.userPermissions,hasPermission:(t,n)=>function(e,t,n){return vI(e,[t],n)[0]}(e.userPermissions,t,n),hasPermissions:(t,n)=>vI(e.userPermissions,t,n)},children:e.children}):(0,i.jsx)(i.Fragment,{children:e.children})};function fb(){return L.useContext(gb)}var xb=n(8923);const _b=L.createContext({}),Ib=e=>{const[t,n]=L.useState(e.numberOfWaitingAccreditations),[s,o]=L.useState(e.numberOfWaitingAssigments),[r,a]=L.useState(null),l=L.useCallback(async t=>{const n=(0,xb.A)(r,{id:e.event.id},t);await hI.events.put(n),a(n)},[e.event.id,r,a]),{isEventAdmin:d,isEventReader:c,userPermissions:u,hasPermission:h,hasPermissions:m}=fb();return L.useEffect(()=>{(async()=>{let t=await hI.events.get(e.event.id);t||(t={id:e.event.id},await hI.events.put(t)),a(t)})()},[e.event]),(0,i.jsx)(_b.Provider,{value:{event:e.event,isEventAdmin:d,isEventReader:c,localEvent:r,numberOfWaitingAccreditations:t,numberOfWaitingAssigments:s,userPermissions:u,hasPermission:h,hasPermissions:m,setNumberOfWaitingAccreditations:n,setNumberOfWaitingAssigments:o,updateLocalEvent:l},children:e.children})};function vb(){return L.useContext(_b)}const bb=e=>{const t=(0,L.useRef)(null),n=(0,L.useCallback)(e=>{e&&(t.current=e,setTimeout(()=>{e.style.right=fr.space[6].value},100))},[]),s=(0,L.useCallback)(()=>{t.current.style.right="-400px",e.onClose()},[e.onClose]);return(0,Ht.createPortal)((0,i.jsxs)(Na,{ref:n,align:"center",className:"h-notification",css:{background:"black"===e.color?"$gray900":"error"===e.color?"$error400":"$success500",borderRadius:"$2",boxShadow:"$lg",maxHeight:"120px",padding:"$2 $4",position:"absolute",right:"-400px",top:"$6",transition:"0.5s right ease-in-out",zIndex:"1000"},gap:"3",role:"status",width:400,children:[(0,i.jsx)(Na,{align:"center",css:{color:"white"},justify:"center",children:(0,i.jsx)(el,{icon:"black"===e.color?"circle-exclamation":"error"===e.color?"circle-xmark":"circle-check",iconStyle:"solid"})}),(0,i.jsx)(yr,{color:"white",css:{flex:"1","& a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:e.text},fontWeight:"medium"}),(0,i.jsx)(Na,{align:"center",css:{color:"white",cursor:"pointer",fontSize:"$textMd"},height:32,justify:"center",width:32,onClick:s,children:(0,i.jsx)(el,{icon:"xmark"})})]}),document.body)},jb=2e3,Cb=L.createContext({}),yb=e=>{const t=Yn(),[n,s]=L.useState(!1),[o,r]=L.useState({color:"success",text:""}),a=L.useCallback(()=>{setTimeout(()=>{s(!1)},1200)},[s]),l=L.useCallback(e=>{s(!0),r("string"==typeof e?{text:e}:e),setTimeout(a,Us.dw.fromObject({seconds:5}).toMillis())},[s,r,a]),{mutate:d}=function(e={}){return Xn("mutation DelegationsImportResult(\n $jobId: UUID!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n delegationsImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),c=L.useRef(null),u=L.useCallback((e,n,i)=>{c.current=window.setInterval(async()=>{const{delegationsImportResult:{state:s,event:o}}=await d({jobId:e,organizationId:n,eventId:i});s===Ce.Done&&(clearInterval(c.current),l({color:"success",text:t("votre_import_es_98992",o.name)}))},jb)},[]),{mutate:h}=function(e={}){return Xn("mutation EventDocumentsExportResult(\n $jobId: UUID!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n eventDocumentsExportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n url\n }\n}\n",e)}(),m=L.useRef(null),g=L.useCallback((e,n,i)=>{m.current=window.setInterval(async()=>{const{eventDocumentsExportResult:s}=await h({jobId:e,organizationId:n,eventId:i});s.state===Me.Done&&(clearInterval(m.current),l({color:"success",text:t("l_export_de_vos_38257",s.url)}))},jb)},[]),{mutate:p}=function(e={}){return Xn("mutation EventsImportResult($jobId: UUID!, $organizationId: OrganizationId!) {\n eventsImportResult(jobId: $jobId, organizationId: $organizationId) {\n state\n }\n}\n",e)}(),f=L.useRef(null),x=L.useCallback((e,n)=>{f.current=window.setInterval(async()=>{const{eventsImportResult:{state:i}}=await p({jobId:e,organizationId:n});i===$e.Done&&(clearInterval(f.current),l({color:"success",text:t("votre_import_es_60265")}))},jb)},[]),{mutate:_}=function(e={}){return Xn("mutation ExportResult($jobId: UUID!, $organizationId: OrganizationId!, $eventId: EventId) {\n exportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n url\n }\n}\n",e)}(),I=L.useRef(null),v=L.useCallback((e,n,i)=>{I.current=window.setInterval(async()=>{const{exportResult:s}=await _({jobId:e,organizationId:n,eventId:i});s.state===Me.Done&&(clearInterval(I.current),l({color:"success",text:t("votre_export_es_96069",s.url)}))},jb)},[]),{mutate:b}=function(e={}){return Xn("mutation FilesImportResult($jobId: UUID!, $organizationId: OrganizationId!, $eventId: EventId) {\n filesImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),j=L.useRef(null),C=L.useCallback((e,n,i)=>{j.current=window.setInterval(async()=>{const{filesImportResult:{state:s,event:o}}=await b({jobId:e,organizationId:n,eventId:i});s===Ue.Done&&(clearInterval(j.current),l({color:"success",text:o?t("votre_import_es_11791",o.name):t("votre_import_es_10672")}))},jb)},[]),{mutate:y}=function(e={}){return Xn("mutation PositionsImportResult(\n $jobId: UUID!\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n positionsImportResult(jobId: $jobId, organizationId: $organizationId, eventId: $eventId) {\n state\n event {\n name\n }\n }\n}\n",e)}(),k=L.useRef(null),A=L.useCallback((e,n,i)=>{k.current=window.setInterval(async()=>{const{positionsImportResult:{state:s,event:o}}=await y({jobId:e,organizationId:n,eventId:i});s===lt.Done&&(clearInterval(k.current),l({color:"success",text:t("votre_import_es_11848",o.name)}))},jb)},[]),{mutate:w}=function(e={}){return Xn("mutation VolunteersImportResult(\n $jobId: UUID!\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n) {\n volunteersImportResult(\n jobId: $jobId\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n ) {\n state\n event {\n name\n }\n }\n}\n",e)}(),S=L.useRef(null),E=L.useCallback((e,n,i)=>{S.current=window.setInterval(async()=>{const{volunteersImportResult:{state:s,event:o}}=await w({jobId:e,organizationId:n,eventId:i});s===Dt.Done&&(clearInterval(S.current),l({color:"success",text:o?t("votre_import_es_37822",o.name):t("votre_import_es_14145")}))},jb)},[]);return(0,i.jsx)(Cb.Provider,{value:{checkDelegationsImport:u,checkDocumentsExport:g,checkEventsImport:x,checkExport:v,checkFilesImport:C,checkPositionsImport:A,checkVolunteersImport:E,showNotification:l},children:(0,i.jsxs)(i.Fragment,{children:[n&&(0,i.jsx)(bb,{color:o.color??"success",text:o.text,onClose:a}),e.children]})})};function kb(){return L.useContext(Cb)}const Ab=L.createContext({});function wb(){return L.useContext(Ab)}const Sb=(0,hr.I4)("dialog",{background:"white",border:"none",display:"flex",flexDirection:"column",overflowY:"auto",padding:"0",variants:{mobile:{true:{height:"100%",width:"100%"},false:{borderRadius:"12px",maxHeight:"calc(100% - 80px)",width:"688px"}}},defaultVariants:{mobile:!1}}),Eb=e=>{const t=Yn(),{onClose:n}=wb();return(0,i.jsxs)(Na,{css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$6 $7"},gap:"3",justify:"end",children:[!e.hideCancelButton&&(0,i.jsx)(El,{color:"white",onClick:n,children:t("annuler_48254")}),"function"==typeof e.children?e.children(n):e.children]})},Tb=e=>(0,i.jsx)(Na,{direction:"column",...Fa(e),css:{borderTop:e.hideBorder?void 0:"1px solid $gray200",padding:"$5 $7 $7 $7",...e.css},children:e.children}),zb=({icon:e,iconColor:t,children:n,subtitle:s,onClose:o})=>(0,i.jsxs)(Na,{children:[(0,i.jsxs)(Na,{align:"center",css:{flexGrow:"1",padding:"$6 $7 $5 $7"},gap:"4",children:[(0,i.jsx)(Na,{align:"center",css:{border:"1px solid $gray200",borderRadius:"10px",boxShadow:"$xs",color:t||"$gray700",fontSize:"textMd",padding:"$3"},height:48,justify:"center",width:48,children:(0,i.jsx)(el,{className:"fa-xl",icon:e})}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{font:"gray900 textLg medium",children:n}),m(s)&&(0,i.jsx)(yr,{color:"gray500",children:s})]})]}),o&&(0,i.jsx)(Na,{align:"center",css:{color:"$gray500",cursor:"pointer",fontSize:"textMd",padding:"$2",margin:"$3 $3"},height:24,justify:"center",width:24,onClick:o,children:(0,i.jsx)(el,{className:"fa-xl",icon:"xmark"})})]}),Ob=({children:e})=>{const{isOpen:t,onClose:n}=wb();return Fd(n),tl("common-front/src/designSystem/components/modals/__deprecated/modal/modal.tsx","common-front/src/designSystem/components/modals/base/modal.tsx"),t?(0,Ht.createPortal)((0,i.jsx)(Na,{align:"center",css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"300"},justify:"center",onClick:n,children:(0,i.jsx)(Sb,{onClick:e=>Rl(e,!1),children:e})}),document.body):null},Rb=e=>{const[t,n]=L.useState(e.isOpen??!1),s=L.useCallback(()=>{n(!1),e.onClose?.()},[n,e.onClose]);return L.useEffect(()=>{"boolean"==typeof e.isOpen&&n(e.isOpen)},[e.isOpen]),(0,i.jsx)(Ab.Provider,{value:{isOpen:t,onClose:s,setIsOpen:n},children:e.children})},$b=e=>{const{setIsOpen:t}=wb(),n=e.children,s=L.useCallback(e=>{Rl(e),t(!0),n.props.onClick?.(e)},[t,n]),o=L.useMemo(()=>L.cloneElement(L.Children.only(n),{onClick:s,onKeyPress:s,tabIndex:0}),[n,s]);return(0,i.jsx)(i.Fragment,{children:o})};var Db=n(7431);const Pb=()=>{const{translate:e}=_l(),t=qn(du),[n,s]=(0,L.useState)(""),o=(0,L.useMemo)(()=>t.countries.filter(e=>"number"==typeof e.smsPrice),[t]),r=(0,L.useMemo)(()=>{if(m(n)){const e=u(n);return o.filter(t=>u(t.name).includes(e)||to(t.phoneCode).some(e=>e.includes(n)))}return o},[o,n]);return(0,i.jsxs)(Rb,{children:[(0,i.jsx)($b,{children:(0,i.jsx)(yr,{color:"primary700",children:e("voir_la_liste_d_69122")})}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"message",children:e("liste_des_prix_58579")}),(0,i.jsxs)(Tb,{css:{overflow:"auto"},direction:"column",gap:"3",height:300,children:[(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:"Rechercher un pays",state:"search",value:n,onChange:s}),(0,i.jsxs)(kc,{children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:e("Country")}),(0,i.jsx)(Vc,{children:e("indicatif_40634")}),(0,i.jsx)(Vc,{children:e("prix_ht_10965")})]}),r.map(e=>{return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:e.name}),(0,i.jsx)(Ec,{children:e.phoneCode}),(0,i.jsx)(Ec,{children:(0,Db.A)((t=e.smsPrice,t*(14/9)),3)})]},e.code);var t})]})]}),(0,i.jsx)(Eb,{})]})]})},Fb=e=>{const t=Yn(),{hasFeature:n}=yI(),s=n(Ne.Sms);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:"campaign.campaignType",children:t=>{t===he.Sms?s?(e.formRenderProps.form.change("campaign.text",""),e.formRenderProps.form.change("campaign.html","")):e.formRenderProps.form.change("campaign.campaignType",he.Email):(e.formRenderProps.form.change("campaign.text",""),e.formRenderProps.form.change("campaign.html",""))}}),(0,i.jsx)(Ll,{label:e.isTemplate?t("nom_de_votre_mo_02364"):t("nom_de_votre_ca_08001"),name:"campaign.name"}),!e.isSent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",children:e.isTemplate?t("quel_type_de_mo_32965"):t("quel_type_de_ca_11960")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"campaign.campaignType",value:he.Email,children:t("e_mail_13869")}),(0,i.jsx)(qa,{height:"3"}),e.isAdmin&&(0,i.jsx)(sb,{disabled:!s,name:"campaign.campaignType",value:he.Sms,children:(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{children:"SMS"}),(0,i.jsx)(Pb,{}),!s&&(0,i.jsx)(yr,{color:"gray500",css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:t("contactez_nous_22980",P.EMAIL_FROM,P.EMAIL_FROM)},fontSize:"textXs"})]})})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:e.formRenderProps.handleSubmit,children:e.isTemplate?t("suivant_conte_33443"):t("suivant_conte_90603")})})]})},Mb=e=>{const t=Yn(),{form:n,handleSubmit:s,values:o}=e.formRenderProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:"delivery",children:e=>{n.change("campaign.state","now"===e?ue.Draft:ue.Scheduled)}}),(0,i.jsx)(yr,{color:"gray800",children:t("quand_voulez_vo_96615")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"delivery",value:"now",children:t("je_souahite_l_e_46027")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"delivery",value:"later",children:t("je_souhaite_pro_98854")}),"later"===o.delivery&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Lm,{min:Us.c9.local(),name:"campaign.scheduledAtDate",placeholder:t("choisissez_la_d_30578")}),(0,i.jsx)(tb,{hint:t("le_fuseau_horai_57116",e.timeZone),name:"campaign.scheduledAtTime",placeholder:t("choisissez_l_he_55311")})]})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:s,children:t("suivant_r_cap_22677")})})]})};var Nb;!function(e){e[e.POSITION_READ=0]="POSITION_READ",e[e.POSITION_EDIT=1]="POSITION_EDIT",e[e.MEMBER_EDIT=2]="MEMBER_EDIT",e[e.MEMBER_ASSIGNMENT_STATE_EDIT=3]="MEMBER_ASSIGNMENT_STATE_EDIT",e[e.COMMENT_READ=4]="COMMENT_READ",e[e.COMMENT_ADD=5]="COMMENT_ADD",e[e.MEMBER_AVAILABILITIES_EDIT=6]="MEMBER_AVAILABILITIES_EDIT",e[e.MEMBER_ASSIGN=7]="MEMBER_ASSIGN",e[e.CAMPAIGN_SEND=8]="CAMPAIGN_SEND",e[e.ACCREDITATION_READ=9]="ACCREDITATION_READ",e[e.ACCREDITATION_EDIT=10]="ACCREDITATION_EDIT",e[e.MEMBER_ACCREDIT=11]="MEMBER_ACCREDIT",e[e.DELEGATION_READ=12]="DELEGATION_READ",e[e.DELEGATION_EDIT=13]="DELEGATION_EDIT",e[e.FORM_READ=14]="FORM_READ",e[e.FORM_EDIT=15]="FORM_EDIT",e[e.EMAIL_EDIT=16]="EMAIL_EDIT",e[e.CAMPAIGN_READ=17]="CAMPAIGN_READ",e[e.DOCUMENT_READ=18]="DOCUMENT_READ",e[e.DOCUMENT_EDIT=19]="DOCUMENT_EDIT",e[e.WORKFLOW_READ=20]="WORKFLOW_READ",e[e.WORKFLOW_EDIT=21]="WORKFLOW_EDIT",e[e.CUSTOM_FIELD_READ=22]="CUSTOM_FIELD_READ",e[e.CUSTOM_FIELD_EDIT=23]="CUSTOM_FIELD_EDIT",e[e.SEGMENT_EDIT=24]="SEGMENT_EDIT",e[e.MEMBER_CREATE=25]="MEMBER_CREATE",e[e.MEMBER_DELETE=26]="MEMBER_DELETE",e[e.EVENT_EDIT=27]="EVENT_EDIT",e[e.ORGANIZATION_PARAM_READ=28]="ORGANIZATION_PARAM_READ",e[e.ORGANIZATION_PARAM_EDIT=29]="ORGANIZATION_PARAM_EDIT",e[e.ORGANIZATION_USER_READ=30]="ORGANIZATION_USER_READ",e[e.ORGANIZATION_USER_EDIT=31]="ORGANIZATION_USER_EDIT"}(Nb||(Nb={}));const Lb=e=>{const{translate:t,params:{eventId:n}}=_l(),s=qn(Kc),[o,r]=(0,L.useState)(!0),[a,l]=(0,L.useState)(!0),[d,c]=(0,L.useState)([]),[u,h]=(0,L.useState)([]),[m,g]=(0,L.useState)(!1),[p,f]=(0,L.useState)([]);return(0,L.useEffect)(()=>{(async()=>{if("accreditations"===e.recipients&&o){const e=await(t={eventId:n},i=await K(),ho("query CampaignEventAccreditationsRecipients($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n\n accreditations {\n nodes {\n id\n name\n accreditationCategoryName\n\n slots {\n id\n name\n date\n }\n }\n }\n }\n}\n",{variables:t,token:i||void 0,fragments:[]}));c((0,lc.A)(e.event.accreditationsCategories,e=>e.name)),h(Object.entries((0,ac.A)(e.event.accreditations.nodes,e=>e.accreditationCategoryName))),g(no(e.event.accreditations.nodes.flatMap(e=>e.slots))),f(e.event.accreditations.nodes.map(e=>{const t=e.slots.map(t=>{const n=t.date?s.toLocaleString(t.date,Js.DateOnly.MonthLong):"",i=t.date?`${t.name} - ${n} - ${e.name}`:`${t.name} - ${e.name}`;return{id:t.id,name:i}});return[e.name,t]})),r(!1),l(!1)}var t,i})()},[e.recipients,o]),e.recipients===wv.Accreditations?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{marginLeft:"$2"},children:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsCategoriesIds",placeholder:t("ajouter_des_cat_17200"),children:d.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsIds",placeholder:t("ajouter_des_acc_26514"),children:u.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"campaign.accreditationsSlotsIds",placeholder:t("ajouter_des_cr_25566"),children:p.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))})]})]})})]}):null},Bb=e=>{const t=yI(),n=vb(),s=L.useMemo(()=>(t?.user?.roles.map(e=>e.type)||[]).concat(n?.userPermissions?.roles.map(e=>e.type)||[]),[t,n]);return L.useMemo(()=>!!s.includes(It.OrganizationAdmin)||(no(e.rolesTypes)?no((0,mh.A)(s,e.rolesTypes)):"function"==typeof n?.hasPermissions&&no(to(e.permissions))?n.hasPermissions(to(e.permissions),e.scope).some(e=>e):!!no(to(e.permissions))&&t.hasPermissions(to(e.permissions)).some(e=>e)),[e.permissions,e.rolesTypes,e.scope,s,n])?(0,i.jsx)(i.Fragment,{children:e.children}):null},Vb=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),o=qn(hh),{isEventAdmin:r}=vb(),[a,l]=(0,L.useState)(!0),[d,c]=(0,L.useState)(!0),[u,h]=(0,L.useState)([]),[g,p]=(0,L.useState)([]),[f,x]=(0,L.useState)([]),[_,I]=(0,L.useState)([]);return(0,L.useEffect)(()=>{(async()=>{if("positions"===e.recipients&&a){const e=await(t={organizationId:n,eventId:s},i=await K(),ho("query CampaignEventPositionsRecipients($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n\n positions {\n nodes {\n id\n name\n positionCategoryName\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",{variables:t,token:i||void 0,fragments:[]}));h((0,lc.A)(e.event.positionsCategories,e=>e.name)),p(Object.entries((0,ac.A)(e.event.positions.nodes,e=>e.positionCategoryName))),x(e.event.positions.nodes.map(e=>{const t=e.slots.map(t=>{const n=m(t.name)?`${t.name} - `:"",i=o.toDisplayString(t.range,{formats:{displayWeekday:!0}});return{id:t.id,name:`${n}${i} - ${e.name}`}});return[e.name,t]})),I(e.organization.tags.nodes),l(!1),c(!1)}var t,i})()},[e.recipients,a]),e.recipients===wv.Positions?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{marginLeft:"$6"},children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bb,{permissions:Nb.CAMPAIGN_SEND,scope:{positionCategoryId:"ANY"},children:[(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsCategoriesIds",placeholder:t("ajouter_des_cat_15537"),children:u.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(qa,{height:"2"})]}),(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsIds",placeholder:t("ajouter_des_mis_44522"),children:g.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"campaign.positionsSlotsIds",placeholder:t("ajouter_des_cr_25566"),children:f.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"campaign.tagsIds",placeholder:t("ajouter_des_tag_57392"),children:_.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]})]})})]}):null},Ub=e=>{const{translate:t,params:{eventId:n}}=_l(),[s,o]=(0,L.useState)(!0),[r,a]=(0,L.useState)(!0),[l,d]=(0,L.useState)([]);return(0,L.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&s){const e=await(t={eventId:n},i=await K(),ho("query CampaignEventSegmentsRecipients($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{variables:t,token:i||void 0,fragments:[]}));d(e.event.segmentsFolders),o(!1),a(!1)}var t,i})()},[e.recipients,s]),"segments"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{marginLeft:"$6"},children:r?(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"campaign.segmentsIds",placeholder:t("ajouter_des_vue_58990"),children:l.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})})]}):null};function Wb({eventId:e,hasSelected:t,includePhone:n,nameDebounced:s,organizationId:o,populationsIds:r,reloadKey:a,userInfoIds:l}){const[d,c]=L.useState(!1),[u,h]=L.useState(null),g=L.useMemo(()=>(0,lc.A)((0,ph.A)((u?.usersInfos.nodes??[]).concat(u?.selectedUsersInfos?.nodes??[]),e=>e.id),e=>e.name.toLowerCase()),[u]),p=L.useMemo(()=>g.map(e=>(0,i.jsxs)("option",{value:e.id,children:[m(e.name)?e.name:"-"," (",n?e.phone?.internationalFormat||"-":e.email,")"]},e.id)),[g]);return L.useEffect(()=>{(async()=>{c(!0);const{organization:i}=await(a={organizationId:o,eventId:e,hasSelected:t,includePhone:n||!1,userInfoIds:l,name:m(s)?s:void 0,populationsIds:r},d=await K(),ho('query UsersSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $userInfoIds: [UsersInfoId!]!\n $populationsIds: [BigInt!]\n $name: String\n $includePhone: Boolean!\n) {\n organization(id: $organizationId) {\n usersInfos(\n eventId: $eventId\n name: $name\n populationsIds: $populationsIds\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n email\n name\n phone: fieldValue(slug: "phone") @include(if: $includePhone)\n }\n }\n\n selectedUsersInfos: usersInfos(ids: $userInfoIds) @include(if: $hasSelected) {\n nodes {\n id\n email\n name\n phone: fieldValue(slug: "phone") @include(if: $includePhone)\n }\n }\n }\n}\n',{variables:a,token:d||void 0,fragments:[]}));var a,d;h(i),c(!1)})()},[o,e,n,s,r,a]),{usersInfos:g,usersInfosOptions:p,isLoading:d}}const Gb=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),[o,r,a]=Bc(""),{usersInfosOptions:l,isLoading:d}=Wb({organizationId:n,eventId:s,includePhone:e.campaignType===he.Sms,hasSelected:no(e.usersInfosIds),nameDebounced:r,userInfoIds:e.usersInfosIds});return"users"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{marginLeft:"$6"},children:(0,i.jsx)(Um,{isSearchLoading:d,isSearchVisible:!0,multiple:!0,name:"campaign.usersInfosIds",placeholder:t("ajouter_des_mem_58427"),searchElement:(0,i.jsx)(Nl,{icon:"magnifying-glass",name:o,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:a}),children:l})})]}):null},Hb=e=>{const t=Yn(),{event:n,isEventAdmin:s,hasPermission:o}=vb(),{form:r,handleSubmit:a,values:l}=e.formRenderProps,d=n.usePositions,c=n.useAccreditations&&s;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:"recipients",children:e=>{if("everyone"===e)r.change("campaign.sendToEveryone",!0),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("states"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("positions"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("accreditations"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.usersInfosIds",[]),r.change("campaign.segmentsIds",[]);else if("users"===e)r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.segmentsIds",[]);else{if("segments"!==e)throw new Error(`Recipients ${e} is not possible`);r.change("campaign.sendToEveryone",!1),r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.usersInfosIds",[])}}}),(0,i.jsx)(Fr.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(r.change("campaign.states",[]),r.change("campaign.positionsCategoriesIds",[]),r.change("campaign.positionsIds",[]),r.change("campaign.positionsSlotsIds",[]),r.change("campaign.tagsIds",[]),r.change("campaign.accreditationsCategoriesIds",[]),r.change("campaign.accreditationsIds",[]),r.change("campaign.accreditationsSlotsIds",[]),r.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Fr.Yr,{name:"campaign.positionsCategoriesIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsCategoriesIds.length>0&&r.change("campaign.positionsCategoriesIds",[])}}),(0,i.jsx)(Fr.Yr,{name:"campaign.positionsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsIds.length>0&&r.change("campaign.positionsIds",[])}}),(0,i.jsx)(Fr.Yr,{name:"campaign.positionsSlotsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.positionsSlotsIds.length>0&&r.change("campaign.positionsSlotsIds",[])}}),(0,i.jsx)(Fr.Yr,{name:"campaign.tagsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.tagsIds.length>0&&r.change("campaign.tagsIds",[])}}),(0,i.jsx)(Fr.Yr,{name:"campaign.usersInfosIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.usersInfosIds.length>0&&r.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Fr.Yr,{name:"campaign.segmentsIds",children:()=>{l.campaign.sendToEveryone&&l.campaign.segmentsIds.length>0&&r.change("campaign.segmentsIds",[])}}),(0,i.jsx)(yr,{color:"gray800",children:t("_qui_voulez_vo_96064")}),(0,i.jsx)(qa,{height:"3"}),s&&d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sb,{name:"recipients",value:"everyone",children:t("_tous_vos_memb_31761")}),(0,i.jsx)(qa,{height:"3"})]}),s&&d&&(0,i.jsx)(sb,{name:"recipients",value:"states",children:t("_certains_memb_35722")}),"states"===l.recipients&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{marginLeft:"$6"},children:(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"campaign.states",placeholder:t("ajouter_des_sta_70922"),children:Dn.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))})})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"recipients",value:"positions",children:s?t("_certaines_cat_59188"):o(Nb.CAMPAIGN_SEND,{positionCategoryId:"ANY"})?t("_certaines_cat_22161"):t("_certaines_mis_80674")})]}),(0,i.jsx)(Vb,{recipients:l.recipients}),(0,i.jsx)(qa,{height:"3"}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sb,{name:"recipients",value:"accreditations",children:t("_certaines_cat_14293")}),(0,i.jsx)(Lb,{recipients:l.recipients}),(0,i.jsx)(qa,{height:"3"})]}),(0,i.jsx)(sb,{name:"recipients",value:"users",children:t("_certains_memb_91094")}),(0,i.jsx)(Gb,{campaignType:e.formRenderProps.values.campaign.campaignType,recipients:l.recipients,usersInfosIds:e.formRenderProps.values.campaign.usersInfosIds}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"recipients",value:"segments",children:t("_certaines_vue_55512")}),(0,i.jsx)(Ub,{recipients:l.recipients}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:a,children:t("suivant_livra_97068")})})]})},qb=e=>{const{translate:t,params:{organizationId:n}}=_l(),[s,o]=(0,L.useState)(!0),[r,a]=(0,L.useState)(!0),[l,d]=(0,L.useState)([]);return(0,L.useEffect)(()=>{(async()=>{if("segments"===e.recipients&&s){const e=await(t={organizationId:n},i=await K(),ho("query CampaignOrganizationSegmentsRecipients($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n segmentsFolders(level: Organization, segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{variables:t,token:i||void 0,fragments:[]}));d(e.organization.segmentsFolders),o(!1),a(!1)}var t,i})()},[e.recipients,s]),"segments"===e.recipients?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{marginLeft:"$6"},children:r?(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"campaign.segmentsIds",placeholder:t("ajouter_des_vue_58990"),children:l.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})})]}):null},Yb=e=>{const t=Yn(),{form:n,handleSubmit:s,values:o}=e.formRenderProps;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:"recipients",children:e=>{if("everyone"===e)n.change("campaign.sendToEveryone",!0),n.change("campaign.usersInfosIds",[]),n.change("campaign.segmentsIds",[]);else if("users"===e)n.change("campaign.sendToEveryone",!1),n.change("campaign.segmentsIds",[]);else{if("segments"!==e)throw new Error(`Recipients ${e} is not possible`);n.change("campaign.sendToEveryone",!1),n.change("campaign.usersInfosIds",[])}}}),(0,i.jsx)(Fr.Yr,{name:"campaign.sendToEveryone",children:e=>{e&&(n.change("campaign.segmentsIds",[]),n.change("campaign.usersInfosIds",[]))}}),(0,i.jsx)(Fr.Yr,{name:"campaign.usersInfosIds",children:()=>{o.campaign.sendToEveryone&&o.campaign.usersInfosIds.length>0&&n.change("campaign.usersInfosIds",[])}}),(0,i.jsx)(Fr.Yr,{name:"campaign.segmentsIds",children:()=>{o.campaign.sendToEveryone&&o.campaign.segmentsIds.length>0&&n.change("campaign.segmentsIds",[])}}),(0,i.jsx)(sb,{name:"recipients",value:"everyone",children:t("_tous_vos_memb_83616")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"recipients",value:"users",children:t("_certains_memb_91094")}),(0,i.jsx)(Gb,{campaignType:e.formRenderProps.values.campaign.campaignType,recipients:o.recipients,usersInfosIds:e.formRenderProps.values.campaign.usersInfosIds}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"recipients",value:"segments",children:t("_certaines_vue_55512")}),(0,i.jsx)(qb,{recipients:o.recipients}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:s,children:t("suivant_livra_97068")})})]})},Kb=e=>{const t=Yn(),{organizationId:n,eventId:s}=Jn(),[o,r]=(0,L.useState)(null),{mutate:a}=function(e={}){return Xn("mutation CampaignEstimate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaign: CampaignInput!\n) {\n campaignEstimate(organizationId: $organizationId, eventId: $eventId, campaign: $campaign) {\n numberOfRecipients\n price\n }\n}\n",e)}(),{form:l,handleSubmit:d,submitting:c,values:u}=e.formRenderProps,h=(0,L.useMemo)(()=>{if(e.formRenderProps.values.campaign.campaignType===he.Email){const t=e.emailsSenders.find(t=>t.id===e.formRenderProps.values.campaign.emailSenderId);return t&&!t.isValidToSendEmail}return!1},[e.emailsSenders,e.formRenderProps.values.campaign.emailSenderId]);return(0,L.useEffect)(()=>{a({organizationId:n,eventId:s,campaign:e.formRenderProps.values.campaign}).then(e=>{r(e.campaignEstimate)})},[]),o?(0,i.jsxs)(i.Fragment,{children:[h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sl,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_33410")}),(0,i.jsx)(qa,{height:"4"})]}),(0,i.jsxs)(Na,{gap:"1",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("nombre_de_desti_22505")}),(0,i.jsx)(yr,{color:"gray800",children:t("_1_membre_49737",o.numberOfRecipients)})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsxs)(Na,{gap:"1",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("prix_total_03054")}),(0,i.jsx)(yr,{color:"gray800",children:0===o.price?t("gratuit_13712"):`${o.price}€`})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(El,{disabled:h,isLoading:c,onClick:()=>{u.campaign.state!==ue.Scheduled&&l.change("campaign.state",ue.InProgress),d()},children:u.campaign.state===ue.Scheduled?t("programmer_la_c_01938"):e.isEdit?t("mettre_jour_l_63945"):t("cr_er_et_envoye_81501")}),(0,i.jsx)(El,{color:"white",isLoading:c,onClick:()=>{l.change("campaign.state",ue.Draft),d()},children:t("enregistrer_en_81222")})]})]}):(0,i.jsx)(kl,{})},Zb=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=_l(),{showNotification:r}=kb(),a=qn(Sv),l=e.initialValues.campaign.state===ue.Template,d=(0,L.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.campaign.name):o(l?"cr_ation_d_un_m_50096":"cr_ation_d_une_80936"),[e.isEdit,e.initialValues]);Dd(d);const c=[ue.Done,ue.InProgress].includes(e.initialValues.campaign.state),u=SI.CAMPAIGNS({organizationId:n,eventId:s});return(0,i.jsx)(Pm,{category:d,fallbackClosePath:u,heading:e.isEdit?e.initialValues.campaign.name:o(l?"nouveau_mod_le_74336":"nouvelle_campag_28814"),children:(0,i.jsx)($m,{children:(0,i.jsxs)(mb,{initialValues:e.initialValues,isEdit:e.isEdit,onSubmit:async n=>{await e.mutate(n.campaign),r(e.isEdit?o("la_campagne_a_50262"):o("la_campagne_a_02968")),t.goBack(u)},children:[(0,i.jsx)(hb,{heading:o(l?"initialisation_84842":"initialisation_48904"),render:t=>(0,i.jsx)(Fb,{formRenderProps:t,isAdmin:e.isAdmin,isSent:c,isTemplate:l}),schema:a.campaignStep1Schema()}),(0,i.jsx)(hb,{heading:o("contenu_29668"),render:t=>(0,i.jsx)(rb,{canCustomDocuments:e.canCustomDocuments,customDocuments:e.customDocuments,emailSenderId:e.emailSenderId,emailsSenders:e.emailsSenders,formRenderProps:t,isEdit:e.isEdit,isSent:c,isTemplate:l}),schema:a.campaignStep2Schema()}),!l&&!c&&(0,i.jsx)(hb,{heading:o("destinataires_19592"),render:t=>"event"===e.campaignType?(0,i.jsx)(Hb,{formRenderProps:t}):(0,i.jsx)(Yb,{formRenderProps:t}),schema:a.campaignStep3Schema()}),!l&&!c&&(0,i.jsx)(hb,{heading:o("livraison_86944"),render:t=>(0,i.jsx)(Mb,{formRenderProps:t,timeZone:e.timeZone}),schema:a.campaignStep4Schema()}),!l&&!c&&(0,i.jsx)(hb,{heading:o("r_capitulatif_a_79107"),render:t=>(0,i.jsx)(Kb,{emailsSenders:e.emailsSenders,formRenderProps:t,isEdit:e.isEdit}),schema:a.createUpdateCampaignSchema()})]})})})},Xb=e=>{const{organizationId:t,eventId:n,options:s}=Jn(),o=qn(Sv),{data:r,loader:a}=ko({organizationId:t,eventId:n}),{mutate:l}=Co(),{event:d}=vb();return a||(0,i.jsx)(Zb,{campaignType:n?"event":"organization",canCustomDocuments:d?.useDocuments??!1,customDocuments:r.organization?.event?.customDocuments??[],emailSenderId:r.organization?.event?.emailSender?.id??r.organization.emailSenderId,emailsSenders:r.organization.emailsSenders,initialValues:o.createUpdateCampaignValuesDefault(e.isTemplate,r.organization.emailSenderId,null,s),isAdmin:!0,isEdit:!1,mutate:async e=>{const{campaignCreate:{id:i}}=await l({organizationId:t,eventId:n,campaign:e});return i},timeZone:r.organization?.event?.timeZone??r.organization.timeZone})},Jb=()=>{const{organizationId:e,eventId:t,campaignId:n}=Jn(),{data:s,loader:o}=Zn("query CampaignToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $campaignId: CampaignId!\n) {\n organization(id: $organizationId) {\n emailsSenders {\n ...CreateCampaignEmailSender\n }\n }\n\n event(id: $eventId) {\n timeZone\n\n campaign(id: $campaignId) {\n ...CampaignEdit\n }\n\n customDocuments {\n slug\n name\n }\n\n emailSender {\n ... on EmailsSender {\n id\n }\n }\n }\n}\n",{organizationId:e,eventId:t,campaignId:n},[Ls.CreateCampaignEmailSenderFragment,Ls.CampaignEditFragment]),r=qn(Sv),{mutate:a}=yo(),{event:l,isEventAdmin:d}=vb();return o||(0,i.jsx)(Zb,{campaignType:"event",canCustomDocuments:l.useDocuments,customDocuments:s.event.customDocuments,emailSenderId:s.event.emailSender?.id,emailsSenders:s.organization.emailsSenders,initialValues:r.createUpdateCampaignValuesDefault(!1,s.event.emailSender?.id,s.event.campaign,null),isAdmin:d,isEdit:!0,mutate:async i=>{const{campaignUpdate:{id:s}}=await a({organizationId:e,eventId:t,campaignId:n,campaign:i});return s},timeZone:s.event.timeZone})},Qb=()=>{const{organizationId:e,campaignId:t}=Jn(),{data:n,loader:s}=Zn("query CampaignOrganizationToEdit($organizationId: OrganizationId!, $campaignId: CampaignId!) {\n organization(id: $organizationId) {\n adminEmail\n emailSenderId\n timeZone\n\n campaign(id: $campaignId) {\n ...CampaignEdit\n }\n\n emailsSenders {\n ...CreateCampaignEmailSender\n }\n }\n}\n",{organizationId:e,campaignId:t},[Ls.CampaignEditFragment,Ls.CreateCampaignEmailSenderFragment]),o=qn(Sv),{mutate:r}=yo();return s||(0,i.jsx)(Zb,{campaignType:"organization",canCustomDocuments:!1,customDocuments:[],emailSenderId:n.organization.emailSenderId,emailsSenders:n.organization.emailsSenders,initialValues:o.createUpdateCampaignValuesDefault(!1,n.organization.emailSenderId,n.organization.campaign,null),isAdmin:!0,isEdit:!0,mutate:async n=>{const{campaignUpdate:{id:i}}=await r({organizationId:e,campaignId:t,campaign:n});return i},timeZone:n.organization.timeZone})},ej=e=>(0,i.jsx)(Na,{...Fa(e),css:{background:"$gray50",flex:"1",padding:"$7",...e.css},direction:"column",children:e.children}),tj=e=>(0,i.jsx)(Na,{css:{background:"white",borderBottom:e.hideBorder?"":"1px solid $gray200",padding:"$6 $7"},...Fa(e),children:e.children}),nj=e=>(0,i.jsx)(Na,{css:e.css,direction:"column",height:1,width:1,children:e.children}),ij=e=>{const t=ei().pathname.includes(e.basePath||e.path);return(0,i.jsxs)(i.Fragment,{children:[e.disabled?(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"gray500",css:{borderBottom:"unset",paddingBlock:"$3"},children:e.children})}),(0,i.jsx)(Cm,{placement:"top",children:e.disabledMessage})]}):(0,i.jsx)(Ja,{replace:!0,to:e.path,children:(0,i.jsx)(yr,{color:t?"primary700":"gray500",css:{borderBottom:t?"2px solid $primary700":"unset",cursor:t?"inherit":"pointer",paddingBlock:"$3","&:hover":{color:t?"$primary800":"$gray800"}},children:e.children})}),(0,i.jsx)(yr,{width:24})]})},sj=e=>(0,i.jsxs)(Na,{"aria-orientation":"horizontal",as:Pa.Nav,css:{borderBottom:"1px solid $gray200",...e.css},width:1,children:[e.center&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{css:{flex:"1"}})}),e.children,(0,i.jsx)(yr,{css:{flex:"1"}})]}),oj=e=>(0,i.jsx)(i.Fragment,{children:e.children});oj.displayName="TabPanel";const rj=e=>{const[t,n]=(0,nh.A)(L.Children.toArray(e.children),e=>L.isValidElement(e)&&e.type===oj);return(0,i.jsxs)(Na,{direction:"column",width:1,...Fa(e),children:[n,(0,i.jsx)(Ar.dO,{children:t.map((e,t)=>(0,i.jsx)(Ar.qh,{path:e.props.path,children:e},t))})]})},aj=L.createContext({}),lj=e=>(0,i.jsx)(aj.Provider,{value:{...e},children:e.children}),dj=e=>(0,i.jsxs)(yr,{css:{background:"white",bd:!0,padding:"$6",width:"100%"},children:[(0,i.jsx)(yr,{color:"gray500",fontWeight:"medium",children:e.title}),(0,i.jsx)(yr,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:e.content})]}),cj=pr(Na,{gap:"$3",variants:{avatarOnTop:{true:{flexDirection:"column",gap:"$2"},false:{alignItems:"center",flexDirection:"row"}}}}),uj=e=>{const{params:{organizationId:t,eventId:n}}=_l(),s=L.useMemo(()=>m(e.userInfo.name)?e.userInfo.name:"-",[e.userInfo.name]),o=()=>(0,i.jsx)(yr,{color:e.disabled?"gray300":"gray800",css:{ellipsis:""},disabled:e.disabled,fontWeight:"medium",title:s,children:s});return(0,i.jsxs)(cj,{avatarOnTop:{"@initial":!!e.badge,"@tablet":!1},width:1,children:[(0,i.jsx)(Jg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:e.size||40}),(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},direction:"column",justify:"center",children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[e.isClickDisabled?o():(0,i.jsx)(qc,{to:qI.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.userInfo.id}),children:o()}),(0,i.jsx)(yr,{css:{flexShrink:0},children:e.badge})]}),(0,i.jsx)(yr,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.email,children:e.areContactLinksEnabled?(0,i.jsx)(qc,{css:{fontWeight:"normal"},to:`mailto:${e.userInfo.email}`,children:e.userInfo.email}):(0,i.jsx)(i.Fragment,{children:e.userInfo.email})}),e.showPhoneNumber&&(0,i.jsx)(yr,{color:e.disabled?"gray300":"gray500",css:{ellipsis:""},fontSize:"textSm",title:e.userInfo.phone?.internationalFormat,children:e.areContactLinksEnabled?(0,i.jsx)(qc,{css:{fontWeight:"normal"},to:`tel:${e.userInfo.phone?.internationalFormat}`,children:e.userInfo.phone?.internationalFormat}):(0,i.jsx)(i.Fragment,{children:e.userInfo.phone?.internationalFormat})})]})]})};function hj(e){switch(e){case Te.Waiting:case Te.Queued:return{color:"warning",leftIcon:"hourglass-empty"};case Te.Bounced:return{color:"error",leftIcon:"circle-exclamation"};default:return{color:"success",leftIcon:"check"}}}const mj=e=>{const{translate:t,params:{organizationId:n,eventId:s,campaignId:o}}=_l(),r=qn(Kc),{mutate:a}=rr(),{mutate:l}=qo();return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(uj,{userInfo:e.email.userInfo})}),(0,i.jsx)(Ec,{children:e.email.sentAt?r.toLocaleString(e.email.sentAt.toLocal(),Js.DateTime):""}),(0,i.jsxs)(Ec,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(ic,{...hj(e.email.state),children:t(e.email.state)}),e.email.state===Te.Bounced&&m(e.email.infos?.bounceDiagnosticCode)&&(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.email.infos.bounceDiagnosticCode,width:1,children:e.email.infos.bounceDiagnosticCode})]}),(0,i.jsx)(Yc,{justify:"end",children:(0,i.jsx)(Hc,{children:(0,i.jsx)(Gd,{icon:"paper-plane",onClick:async()=>{e.emailType?await l({organizationId:n,eventId:s,userInfoId:e.email.userInfo.id,emailType:e.emailType}):await a({organizationId:n,eventId:s,campaignId:o,selecteds:{ids:[e.email.userInfo.id]}}),e.reload()},children:t("r_envoyer_90741")})})})]})},gj=e=>{const{params:{organizationId:t,campaignId:n},translate:s}=_l(),[o,r,a]=Bc(""),[l,d]=(0,L.useState)(""),[c,u]=(0,L.useState)(0),{data:h,isLoading:g,reload:p}=Zn("query CampaignEmails(\n $organizationId: OrganizationId!\n $campaignId: CampaignId!\n $name: String\n $state: EmailState\n $offset: Int\n) {\n organization(id: $organizationId) {\n campaign(id: $campaignId) {\n emails(name: $name, state: $state, limit: 25, offset: $offset) {\n nodes {\n ...EmailRecipient\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{organizationId:t,campaignId:n,name:m(r)?r:void 0,state:""!==l?l:void 0,offset:c},[Ls.EmailRecipientFragment]);const f=Mc();return(0,i.jsxs)(ej,{direction:"column",gap:"7",children:[(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsx)(dj,{content:e.campaign.numberOfRecipients,title:s("nombre_de_desti_21374")}),(0,i.jsx)(dj,{content:e.campaign.numberOfOpen??0,title:s("nombre_d_ouvert_84187")}),(0,i.jsx)(dj,{content:e.campaign.numberOfClick??0,title:s("nombre_de_clics_64232")})]}),(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{value:l,onChange:e=>{d(e),u(0)},children:[(0,i.jsx)("option",{value:"",children:s("tous_les_status_67644")}),f(an.filter(e=>e!==Te.Queued))]})}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:s("rechercher_un_d_02329"),value:o,onChange:e=>{a(e),u(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:s("nom_du_membre_69353")}),(0,i.jsx)(Vc,{children:s("date_d_envoi_74668")}),(0,i.jsx)(Vc,{children:s("status_06428")}),(0,i.jsx)(Vc,{width:100})]}),numberOfPages:h.organization?.campaign.emails.numberOfPages??0,offset:c,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:h.organization.campaign.emails.nodes.map((e,t)=>(0,i.jsx)(mj,{email:e,emailType:null,reload:p},t))}),setOffset:u,title:s("liste_des_desti_16448"),totalCount:h.organization?.campaign.emails.totalCount??0})]})},pj=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=_l(),[a,l,d]=Bc(""),{usersInfosOptions:c,isLoading:u}=Wb({organizationId:s,eventId:o,hasSelected:!0,nameDebounced:l,userInfoIds:[r],populationsIds:e.populationsIds});return(0,i.jsxs)(Na,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7",...e.css},gap:"4",children:[(0,i.jsx)(yr,{font:"gray900 textMd semiBold",children:n("aper_u_pour_le_81451")}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(bc,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(Nl,{icon:"magnifying-glass",name:a,placeholder:n("rechercher_un_m_05904"),state:"search",onChange:d}),values:[r],onChange:n=>{no(n)&&t.replace(e.getPath(n[0]))},children:c})}),m(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{flex:"1"}}),(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})]})};function fj(e){switch(e){case $t.Assigned:return{color:"success",leftIcon:"check"};case $t.Refused:return{color:"error",leftIcon:"xmark"};case $t.PreAssigned:return{color:"pink",leftIcon:"wand-magic-sparkles"};case $t.WaitingAssignment:return{color:"warning",leftIcon:"hourglass-empty"};case $t.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return rl()}}function xj(e){switch(e){case le.Accredited:return{color:"success",leftIcon:"check"};case le.AutoAccredited:return{color:"success",leftIcon:"bolt-auto"};case le.Refused:return{color:"error",leftIcon:"xmark"};case le.WaitingAccreditation:return{color:"warning",leftIcon:"hourglass-empty"};case le.NotApplicable:return{color:"gray",leftIcon:"infinity"};default:return rl()}}const _j=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),{getVolunteersSegmentPath:r}=L.useContext(aj),a=(0,L.useMemo)(()=>e.campaign.positionsCategories.map(e=>({id:`pc-${e.id}`,name:e.name,link:ps.POSITION_CATEGORY({organizationId:s,eventId:o,positionCategoryId:e.id})})).concat(e.campaign.positions.map(e=>({id:`p-${e.id}`,name:e.name,link:ps.POSITION({organizationId:s,eventId:o,positionId:e.id})}))).concat(e.campaign.positionsSlots.map(e=>({id:`ps-${e.id}`,name:`${e.position.name} - ${e.nameOrRange}`,link:ps.POSITION({organizationId:s,eventId:o,positionId:e.position.id})}))).concat(e.campaign.tags.map(e=>({id:`t-${e.id}`,name:e.name,link:""}))),[e.campaign]),l=(0,L.useMemo)(()=>e.campaign.accreditationsCategories.map(e=>({id:`ac-${e.id}`,name:e.name,link:""})).concat(e.campaign.accreditations.map(e=>({id:`a-${e.id}`,name:e.name,link:es.ACCREDITATION({organizationId:s,eventId:o,accreditationId:e.id})}))).concat(e.campaign.accreditationsSlots.map(e=>({id:`as-${e.id}`,name:`${e.accreditation.name} - ${e.name}}`,link:es.ACCREDITATION({organizationId:s,eventId:o,accreditationId:e.accreditation.id})}))),[e.campaign]),d=(0,L.useMemo)(()=>l.length+a.length,[l,a]);return(0,i.jsxs)(Na,{gap:"1",children:[(0,i.jsx)(yr,{color:"gray500",children:n("_96502")}),e.campaign.sendToEveryone?(0,i.jsx)(yr,{color:"gray800",children:n("tous_vos_membre_30731")}):no(e.campaign.states)?(0,i.jsx)(Na,{css:{flex:"1"},gap:"2",wrap:"wrap",children:e.campaign.states.map(e=>(0,i.jsx)(ic,{...fj(e),children:n(e)},e))}):no(e.campaign.usersInfos)?(0,i.jsx)(Na,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.usersInfos.map((n,r)=>(0,i.jsxs)(yr,{color:"primary700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(qI.MEMBER_INFORMATION({organizationId:s,eventId:o,userInfoId:n.id}))},children:[n.nameOrEmail,r!==e.campaign.usersInfos.length-1&&", "]},n.id))}):no(e.campaign.segments)?(0,i.jsx)(Na,{css:{flex:"1"},gap:"1",wrap:"wrap",children:e.campaign.segments.map((n,s)=>(0,i.jsxs)(yr,{color:"primary700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push(r(n.id))},children:[n.name,s!==e.campaign.segments.length-1&&", "]},n.id))}):(0,i.jsx)(Na,{css:{flex:"1"},gap:"1",wrap:"wrap",children:a.concat(l).map((e,n)=>(0,i.jsxs)(yr,{color:m(e.link)?"primary700":"gray800",css:{cursor:m(e.link)?"pointer":"initial",textDecoration:"underline"},onClick:()=>{m(e.link)&&t.push(e.link)},children:[e.name,n!==d-1?", ":""]},e.id))})]})},Ij=e=>{const t=Yn(),n=(0,L.useCallback)(e=>{e&&(e.onload=()=>{const t=e.contentDocument.body.scrollHeight;e.style.height=`${t}px`,e.contentDocument.body.style.margin="0",e.contentDocument.body.style.overflow="hidden",e.parentElement.style.height=`${t+64}px`})},[]);return(0,i.jsx)(Na,{css:{background:"$gray50",minHeight:"100%",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Na,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",minHeight:"100%",overflow:"hidden",paddingTop:e.userSelector?"0":"$6"},direction:"column",gap:"3",width:664,children:[e.userSelector,e.createdBy&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(yr,{color:"gray500",children:t("cr_e_par_16667")}),(0,i.jsx)(yr,{color:"gray800",children:e.createdBy})]}),(0,i.jsx)(yr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.from&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(yr,{color:"gray500",children:t("de_70487")}),(0,i.jsx)(yr,{color:"gray800",children:e.from})]}),(0,i.jsx)(yr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.to&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{margin:"0 $6"},width:1,children:(0,i.jsx)(_j,{campaign:e.to})}),(0,i.jsx)(yr,{css:{borderTop:"1px solid $gray200",height:"1px",margin:"0 $6"}})]}),e.subject&&(0,i.jsxs)(Na,{css:{margin:"0 $6"},gap:"1",children:[(0,i.jsx)(yr,{color:"gray500",children:t("objet_86482")}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:e.subject})]}),e.content&&(0,i.jsxs)(Na,{css:{background:"$gray100",borderBottomLeftRadius:"$2",borderBottomRightRadius:"$2",flexGrow:"1",padding:"$7"},direction:"column",gap:"6",children:[(0,i.jsx)(yr,{css:{minHeight:"300px",marginTop:"$3","& iframe":{background:"white",border:"none",borderRadius:"$2",overflow:"hidden",width:"100%"}},width:1,children:(0,i.jsx)("iframe",{ref:n,srcDoc:e.content})}),(no(e.attachments)||no(e.documents))&&(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{font:"gray900 textXl semiBold",children:t("pi_ces_jointes_36761")}),(0,i.jsx)(Na,{gap:"2",children:(e.attachments||[]).map(e=>(0,i.jsx)(ic,{color:"white",size:"md",children:JI.includes(e)?t(e):en.includes(e)?P_(e):e},e))}),(0,i.jsx)(Na,{direction:"column",gap:"3",children:(e.documents||[]).map(e=>(0,i.jsx)(hv,{acl:"public-read",document:e},e.id))})]})]})]})})},vj=()=>{const{params:{organizationId:e,eventId:t,campaignId:n,userInfoId:s}}=_l(),{data:o,loader:r}=Yr({organizationId:e,campaignId:n,userInfoId:s}),a=(0,L.useMemo)(()=>o.organization?.campaign.createdBy?`${o.organization.campaign.createdBy.name} (${o.organization.campaign.createdBy.email})`:null,[o.organization]),l=(0,L.useMemo)(()=>o.organization?.campaign.emailSender?`${o.organization.campaign.emailSender.fromName} (${o.organization.campaign.emailSender.fromEmail})`:P.EMAIL_FROM,[o.organization]);return r||(0,i.jsx)(ej,{children:(0,i.jsx)(Ij,{attachments:o.organization.campaign.attachments,content:o.organization.campaign.preview,createdBy:a,documents:o.organization.campaign.documents,from:l,subject:o.organization.campaign.subject,to:o.organization.campaign,userSelector:(0,i.jsx)(pj,{css:{border:"none",px:"$6"},getPath:i=>SI.CAMPAIGN_PREVIEW({organizationId:e,eventId:t,campaignId:n,userInfoId:i})})})})},bj=({children:e,color:t,fontWeight:n,returnPathFallback:s})=>{const o=Qn();return(0,i.jsxs)(Na,{align:"center",css:{color:"primary"===t?"$primary700":"$gray900",cursor:"pointer",fontSize:"textXl",fontWeight:n??"normal",padding:0},gap:"2",onClick:()=>o.goBack(s),children:[(0,i.jsx)(el,{icon:"arrow-left"}),e]})},jj=e=>{const{translate:t,params:{organizationId:n,eventId:s,campaignId:o}}=_l(),{isOrganizationAdmin:r}=yI(),{hasPermission:a}=vb(),l=r||a(Nb.CAMPAIGN_SEND);return(0,i.jsxs)(tj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(bj,{returnPathFallback:SI.CAMPAIGNS({organizationId:n,eventId:s})}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.campaign.name}),l&&(0,i.jsx)(El,{to:SI.UPDATE({organizationId:n,eventId:s,campaignId:o}),children:t("_diter_la_campa_04069")})]})};function Cj(e){switch(e){case wt.Waiting:return{color:"warning",leftIcon:"hourglass-empty"};case wt.Sent:case wt.Delivered:return{color:"success",leftIcon:"check"};default:return{color:"error",leftIcon:"circle-exclamation"}}}const yj=e=>(0,i.jsx)(yr,{color:"gray800",css:{borderBottom:"1px solid $gray200",padding:"$6"},fontSize:"textXl",fontWeight:"medium",children:e.children}),kj=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{gap:"3",width:1,children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[e.message.createdBy&&(0,i.jsx)(yr,{color:"gray800",textAlign:"end",children:e.message.createdBy.name}),(0,i.jsx)(yr,{css:{background:"$primary600",borderRadius:"$2",borderTopRightRadius:"0",boxShadow:"$sm",color:"white",padding:"$3"},width:1,children:e.message.text})]}),e.message.createdBy&&(0,i.jsx)(yr,{children:(0,i.jsx)(Jg,{email:e.message.createdBy.email,image:e.message.createdBy.picture?.url,name:e.message.createdBy.name,size:40})})]}),e.message.replies.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{gap:"3",width:1,children:[(0,i.jsx)(yr,{children:(0,i.jsx)(Jg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:40})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray800",children:e.userInfo.name}),(0,i.jsx)(yr,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},width:1,children:unescape(t)})]})]})]},n))]}),Aj=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation TextMessageSend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $parentId: TextMessageId!\n $content: String!\n) {\n textMessageSend(\n organizationId: $organizationId\n eventId: $eventId\n parentId: $parentId\n content: $content\n ) {\n id\n }\n}\n",e)}(),[s,o]=(0,L.useState)(""),{numberOfCharacters:r,numberOfSms:a}=yv(s,!1),l=m(s);return(0,i.jsxs)(Na,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Wm,{label:(0,i.jsxs)(Na,{justify:"between",children:[(0,i.jsx)(yr,{children:t("contenu_de_la_r_08075")}),(0,i.jsx)(yr,{color:"gray500",children:t("_1_caract_re_04414",r,a)})]}),value:s,onChange:o}),(0,i.jsx)(Na,{justify:"end",children:(0,i.jsx)(El,{disabled:!l,onClick:async()=>{await n({organizationId:e.organizationId,eventId:e.eventId,parentId:e.parentId,content:s}),e.reload()},children:t("envoyer_le_mess_41092")})})]})},wj=e=>{const t=Yn(),{data:n,loader:s,reload:o}=Zn("query TextMessageReplies($organizationId: OrganizationId!, $textMessageId: TextMessageId!) {\n organization(id: $organizationId) {\n textMessage(id: $textMessageId) {\n replies\n\n children {\n text: content\n replies\n sentAt: insertedAt\n\n createdBy {\n ...CreatedBy\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,textMessageId:e.textMessage.id},[Ls.CreatedByFragment]);const r=(0,L.useMemo)(()=>(0,lc.A)([{text:e.text,replies:n.organization?.textMessage.replies??[],sentAt:e.textMessage.sentAt,createdBy:e.createdBy}].concat(n.organization?.textMessage.children??[]),e=>e.sentAt.toMillis()),[n.organization]);return(0,i.jsxs)(xu,{size:"sm",onClose:e.onClose,children:[(0,i.jsx)(yj,{children:t("r_ponse_de_1_77675",e.userInfo.name)}),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(_u,{children:[r.map((t,n)=>(0,i.jsx)(kj,{message:t,userInfo:e.userInfo},n)),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(Iu,{children:(0,i.jsx)(Aj,{eventId:e.eventId,organizationId:e.organizationId,parentId:e.textMessage.id,reload:o})})]})]})},Sj=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),o=qn(Kc),{mutate:r}=function(e={}){return Xn("mutation TextMessageRepliesRead(\n $organizationId: OrganizationId!\n $eventId: EventId\n $textMessageId: TextMessageId!\n) {\n textMessageRepliesRead(\n organizationId: $organizationId\n eventId: $eventId\n textMessageId: $textMessageId\n ) {\n id\n }\n}\n",e)}(),[a,l]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Dc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(uj,{userInfo:e.textMessage.userInfo})}),(0,i.jsx)(Ec,{children:e.textMessage.userInfo.phone?.internationalFormat??""}),(0,i.jsx)(Ec,{children:e.textMessage.sentAt?o.toLocaleString(e.textMessage.sentAt,Js.DateTime):""}),(0,i.jsx)(Ec,{children:(0,i.jsx)(ic,{...Cj(e.textMessage.state),children:t(e.textMessage.state)})}),(0,i.jsx)(Ec,{children:e.textMessage.numberOfReplies>0?(0,i.jsx)(El,{color:"white",size:"sm",onClick:async t=>{Rl(t),await r({organizationId:n,eventId:s,textMessageId:e.textMessage.id}),l(!0)},children:t("voir_la_reponse",e.textMessage.numberOfReplies)}):""})]}),a&&(0,i.jsx)(wj,{createdBy:e.createdBy,eventId:s,organizationId:n,text:e.text,textMessage:e.textMessage,userInfo:e.textMessage.userInfo,onClose:()=>{l(!1)}})]})},Ej=e=>{const{params:{organizationId:t,campaignId:n},translate:s}=_l(),[o,r,a]=Bc(""),[l,d]=(0,L.useState)(""),[c,u]=(0,L.useState)(""),[h,g]=(0,L.useState)(0),{data:p,isLoading:f}=Zn("query CampaignTextMessages(\n $organizationId: OrganizationId!\n $campaignId: CampaignId!\n $name: String\n $state: TextMessageState\n $replies: TextMessageReplies\n $offset: Int\n) {\n organization(id: $organizationId) {\n campaign(id: $campaignId) {\n createdBy {\n ...CreatedBy\n }\n\n textMessages(\n name: $name\n state: $state\n replies: $replies\n limit: 25\n offset: $offset\n ) {\n nodes {\n id\n state\n sentAt: insertedAt\n numberOfReplies\n\n userInfo {\n ...CampaignUserInfo\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{organizationId:t,campaignId:n,name:m(r)?r:void 0,state:""!==l?l:void 0,replies:""!==c?c:void 0,offset:h},[Ls.CreatedByFragment,Ls.CampaignUserInfoFragment]);const x=Mc(),{numberOfPages:_,totalCount:I}=ku(p.organization?.campaign.textMessages);return(0,i.jsxs)(ej,{direction:"column",gap:"7",children:[(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsx)(dj,{content:e.campaign.numberOfRecipients,title:s("nombre_de_desti_21374")}),(0,i.jsx)(dj,{content:e.campaign.numberOfDelivery??0,title:s("nombre_de_messa_93859")}),(0,i.jsx)(dj,{content:e.campaign.cost,title:s("co_t_de_la_camp_54312")})]}),(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{value:l,onChange:e=>{d(e),g(0)},children:[(0,i.jsx)("option",{value:"",children:s("tous_les_status_67644")}),x(On)]})}),(0,i.jsx)(yr,{width:240,children:(0,i.jsxs)(zu,{value:c,onChange:e=>{u(e),g(0)},children:[(0,i.jsx)("option",{value:"",children:s("avec_et_sans_r_23765")}),x(zn)]})}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:s("rechercher_un_d_02329"),value:o,onChange:e=>{a(e),g(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:s("nom_du_membre_69353")}),(0,i.jsx)(Vc,{children:s("Phone")}),(0,i.jsx)(Vc,{children:s("date_d_envoi_74668")}),(0,i.jsx)(Vc,{children:s("status_06428")}),(0,i.jsx)(Vc,{children:s("r_ponses_97000")})]}),numberOfPages:_,offset:h,rows:f?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:p.organization.campaign.textMessages.nodes.map((t,n)=>(0,i.jsx)(Sj,{createdBy:p.organization.campaign.createdBy,text:e.campaign.text,textMessage:t},n))}),setOffset:g,title:s("liste_des_desti_16448"),totalCount:I})]})},Tj=()=>{const{params:{organizationId:e,eventId:t,campaignId:n,userInfoId:s}}=_l(),o=qn(Kc),{data:r,loader:a}=Yr({organizationId:e,campaignId:n,userInfoId:s}),l=r.organization?.campaign.sentAt?.setZone(Us.c9.local().zone);return a||(0,i.jsx)(ej,{children:(0,i.jsx)(Na,{css:{background:"$gray50",py:"$6"},justify:"center",width:1,children:(0,i.jsxs)(Na,{css:{background:"white",borderRadius:"$2",boxShadow:"$md",overflow:"hidden",paddingBottom:"$6"},direction:"column",gap:"3",width:640,children:[(0,i.jsx)(pj,{css:{border:"none",px:"$6"},getPath:i=>SI.CAMPAIGN_PREVIEW({organizationId:e,eventId:t,campaignId:n,userInfoId:i})}),(0,i.jsx)(yr,{css:{px:"$6"},children:(0,i.jsx)(_j,{campaign:r.organization.campaign})}),(0,i.jsx)(yr,{css:{borderTop:"1px solid $gray200",height:"1px",px:"$6"}}),(0,i.jsxs)(Na,{css:{px:"$6"},gap:"3",width:1,children:[r.organization.campaign.createdBy&&(0,i.jsx)(yr,{children:(0,i.jsx)(Jg,{email:r.organization.campaign.createdBy.email,image:r.organization.campaign.createdBy.picture?.url,name:r.organization.campaign.createdBy.name,size:40})}),(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(r.organization.campaign.createdBy||l)&&(0,i.jsxs)(Na,{gap:"3",width:1,children:[r.organization.campaign.createdBy&&(0,i.jsx)(yr,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:r.organization.campaign.createdBy.name}),l&&(0,i.jsx)(yr,{color:"gray500",children:o.toLocaleString(l,Js.DateTime)})]}),(0,i.jsx)(yr,{color:"gray800",css:{background:"$gray100",borderRadius:"$2",borderTopLeftRadius:"0",boxShadow:"$sm",padding:"$3"},dangerouslySetInnerHTML:{__html:r.organization.campaign.preview}})]})]})]})})})},zj=()=>{const{params:{organizationId:e,eventId:t,campaignId:n},translate:s}=_l(),{data:o,loader:r}=Zn("query Campaign($organizationId: OrganizationId!, $eventId: EventId, $campaignId: CampaignId!) {\n organization(id: $organizationId) {\n campaign(id: $campaignId) {\n name\n state\n campaignType\n text\n numberOfRecipients\n numberOfDelivery\n numberOfOpen\n numberOfClick\n cost\n states\n }\n\n usersInfos(limit: 1) {\n nodes {\n id\n }\n }\n\n event: eventMaybe(id: $eventId) {\n volunteersRegistrations(limit: 1) {\n nodes {\n userInfoId\n }\n }\n }\n }\n}\n",{organizationId:e,eventId:t,campaignId:n},[]),a=(0,L.useMemo)(()=>o.organization?t?o.organization.event?.volunteersRegistrations.nodes[0]?.userInfoId:o.organization.usersInfos.nodes[0].id:-1,[t,o.organization]);Dd(`${o.organization?.campaign.name??""} ${s("campagne_97871")}`);const l=i=>({organizationId:i?":organizationId":e,eventId:t?i?":eventId":t:void 0,campaignId:i?":campaignId":n}),d=e=>({...l(e),userInfoId:e?":userInfoId":a}),c=ai([SI.CAMPAIGN(l(!1)),ui.PREVIEW]);return r||(0,i.jsxs)(nj,{children:[(0,i.jsx)(jj,{campaign:o.organization.campaign}),(0,i.jsxs)(rj,{css:{flex:"1"},children:[(0,i.jsxs)(sj,{css:{px:"$7"},children:[(0,i.jsx)(ij,{path:SI.CAMPAIGN_DASHBOARD(l(!1)),children:s("tableau_de_bord_24627")}),(0,i.jsx)(ij,{basePath:c,disabled:!a,disabledMessage:s("vous_devez_avoir_2345"),path:SI.CAMPAIGN_PREVIEW(d(!1)),children:s("aper_u_25595")})]}),(0,i.jsx)(oj,{path:SI.CAMPAIGN_DASHBOARD(l(!0)),children:o.organization?.campaign.campaignType===he.Email?(0,i.jsx)(gj,{campaign:o.organization?.campaign}):(0,i.jsx)(Ej,{campaign:o.organization?.campaign})}),(0,i.jsx)(oj,{path:SI.CAMPAIGN_PREVIEW(d(!0)),children:o.organization?.campaign.campaignType===he.Email?(0,i.jsx)(vj,{}):(0,i.jsx)(Tj,{})})]})]})},Oj=()=>{const{organizationId:e,eventId:t}=Jn();return(0,i.jsx)(lj,{getVolunteersSegmentPath:n=>$s.VOLUNTEERS_SEGMENT(e,t,n),isOrganizationCampaign:!1,children:(0,i.jsx)(zj,{})})},Rj=()=>{const{organizationId:e}=Jn();return(0,i.jsx)(lj,{getVolunteersSegmentPath:t=>$s.COMMUNITY_USERS_SEGMENT(e,t),isOrganizationCampaign:!0,children:(0,i.jsx)(zj,{})})};function $j(e){switch(e){case ke.Expired:return{color:"error",leftIcon:"clock"};case ke.Full:return{color:"error",leftIcon:"hundred-points"};case ke.Locked:return{color:"error",leftIcon:"lock-keyhole"};case ke.Ongoing:return{color:"success",leftIcon:"check"};default:return rl()}}let Dj=class extends Ul{constructor(e){super(e)}createUpdateDelegationValuesDefault(e,t){return{delegation:this.delegationInputDefault(e,t),selectedAccreditationsSlotsIds:[]}}delegationInputDefault(e,t){const n=t?.forms&&t?.parentDelegation?t.forms.find(e=>e.name===t.parentDelegation?.form.name):null,i=e?.formId??n?.id??-1,s=no(t?.delegationsCategories)&&t?.parentDelegation?t.delegationsCategories.find(e=>e.name===t.parentDelegation?.delegationCategory.name):null;let o=e?.delegationCategoryId??s?.id??t?.delegationCategoryId;return Number.isInteger(o)||(o=null),{...this.getDefaultAccreditations(e),delegationCategoryId:o,parentId:e?.parentId??t?.parentId??null,name:e?.name??"",description:e?.description??"",leadersIds:e?.leadersIds??t?.parentDelegation?.leadersIds??[],formId:i,deadlineDate:e?.deadlineDate??null,maxResources:e?.maxResources??null,showInDelegationSpace:e?.showInDelegationSpace??!0,showFormLinkInDelegationSpace:e?.showFormLinkInDelegationSpace??!0,columns:e?.columns??t?.parentDelegation?.columns??["name","accreditations","accreditation_state"],canLeadersAddMembers:e?.canLeadersAddMembers??!0,canLeadersDeleteMembers:e?.canLeadersDeleteMembers??!0,canLeadersEditColumns:e?.canLeadersEditColumns??!0,canLeadersEditCustomFields:e?.canLeadersEditCustomFields??!0,canLeadersEditMembers:e?.canLeadersEditMembers??!0,canLeadersImportMembers:e?.canLeadersImportMembers??!1,canLeadersSeeHiddenAccreditationsSlots:e?.canLeadersSeeHiddenAccreditationsSlots??!1,privateNote:e?.privateNote??t?.parentDelegation?.privateNote??"",addDefaultAccreditationsByAvailability:e?.addDefaultAccreditationsByAvailability??!1,tagsIds:e?.tagsIds??t?.parentDelegation?.tagsIds??[],customFields:e?.customFields||[],fields:e?.fields??{},campaignsIds:e?.campaignsIds??[],customDocumentsSlugs:e?.customDocumentsSlugs??[],usedCustomFieldsIds:e?.usedCustomFieldsIds??[]}}delegationInputSchema(){return d.Ik().shape({parentId:d.ai().nullable(),name:d.Yj().when("parentId",{is:null,then:e=>e.required(this.t("le_nom_de_la_d_10042"))}),description:d.Yj(),delegationCategoryId:d.ai().required(this.t("la_cat_gorie_es_14008")).positive(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")),leadersIds:d.YO().of(d.ai()),formId:d.ai().required(this.t("le_formulaire_e_77404")).typeError(this.t("le_formulaire_e_77404")).test("form-id-valid",this.t("le_formulaire_e_77404"),e=>"number"==typeof e&&e>0),deadlineDate:qm.typeError(this.t("la_date_limite_91708")).nullable(),maxResources:d.ai().min(0).nullable(),showInDelegationSpace:d.zM().required(),showFormLinkInDelegationSpace:d.zM().required(),columns:d.YO().of(d.Yj()).required(this.t("vous_devez_choi_82605")).min(1,this.t("vous_devez_choi_82605")),canLeadersAddMembers:d.zM().required(),canLeadersDeleteMembers:d.zM().required(),canLeadersEditColumns:d.zM().required(),canLeadersEditMembers:d.zM().required(),canLeadersEditCustomFields:d.zM().required(),canLeadersImportMembers:d.zM().required(),canLeadersSeeHiddenAccreditationsSlots:d.zM().required(),privateNote:d.Yj(),accreditations:d.YO().of(d.Ik().shape({accreditationCategoryId:d.ai().required(),accreditationId:d.ai().required(),maxResources:d.gl().nullable(),willAutoAccredit:d.zM().required()})),accreditationsSlots:d.YO().of(d.Ik().shape({accreditationCategoryId:d.ai().required(),accreditationId:d.ai().required(),accreditationSlotId:d.ai().required(),isDefault:d.zM().required(),maxResources:d.gl().nullable()})),campaignsIds:d.YO().of(d.ai()),customDocumentsSlugs:d.YO().of(d.gl()),usedCustomFieldsIds:d.YO().of(d.ai())})}createUpdateDelegationSchema(){return d.Ik().shape({delegation:this.delegationInputSchema()})}adminAddSchema(){return d.Ik().shape({usersInfosIds:d.YO().of(d.ai())})}getDefaultAccreditations(e){let t=e?.accreditations||[];const n=e?.accreditationsSlots||[];return io(t)&&no(n)&&(t=(0,ph.A)(n,e=>e.accreditationId).map(e=>({accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,maxResources:null,willAutoAccredit:!1}))),{accreditations:t,accreditationsSlots:n}}};Dj=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Dj);var Pj=n(2662);const Fj=["key","name","acl"];let Mj=class extends Ul{constructor(e){super(e)}documentInputDefault(){return{key:"",name:"",acl:""}}documentInputSchema(e){const t=m(e)?this.t("_1_est_requis_99856",e):this.t("le_document_est_86403");return d.Ik().shape({key:d.Yj().required(t),name:d.Yj().required(t),acl:d.Yj().required(t)})}documentInputSchemaNotRequired(){return d.Ik().shape({key:d.Yj(),name:d.Yj(),acl:d.Yj()})}};Mj=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Mj);const Nj=({onChange:e,css:t,label:n,description:s,value:o,hint:r,state:a,initialValue:l,icon:d,...c})=>{const u=Yn(),h=(0,L.useRef)(null),m=(0,Nc.A)(t=>{e(t)},500),{inputId:g,descId:p,errorId:f}=Ga();return(0,i.jsxs)(Na,{css:t,direction:"column",width:1,children:[(0,i.jsx)(Pl,{htmlFor:g,isClickable:!1,children:n}),(0,i.jsx)($l,{id:p,children:s}),(n||s)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Ml,{cursor:"default",icon:d,state:a,onClick:()=>{h.current?.click()},children:[(0,i.jsxs)(Na,{align:"center",css:{flex:"1"},height:1,children:[(0,i.jsx)(yr,{css:{background:o,borderRadius:"$1",height:"24px",width:"24px","& input":{background:"transparent",border:"none",borderRadius:"$1",cursor:"pointer",height:"24px",width:"24px","&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"$1",border:"none"},"&::-moz-color-swatch":{border:"none"}}},children:(0,i.jsx)("input",{ref:h,"aria-describedby":s?p:void 0,id:g,type:"color",value:o,onChange:e=>{m(e.target.value)},...c})}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsx)(yr,{color:"gray800",css:{flex:"1","& input[type=text]":{background:"transparent",border:"none",color:"$gray800",height:"100%",outline:"none",width:"100%"}},height:1,onClick:Rl,children:(0,i.jsx)("input",{"aria-describedby":s?p:void 0,"aria-errormessage":"error"===a?f:void 0,"aria-invalid":"error"===a,disabled:"disabled"===a,id:g,type:"text",value:o,onChange:t=>{e(t.target.value)},...c})})]}),l&&o!==l&&(0,i.jsx)(El,{color:"invisible",css:{color:"$primary700"},onClick:t=>{Rl(t),e(l)},children:u("remettre_sa_v_90478")})]}),(0,i.jsx)(Dl,{id:f,state:a,children:r})]})},Lj=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ua.D0,{name:e,render:o=>{const r=Ol(o.meta);return(0,i.jsx)(Nj,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onChange:e=>{o.input.onChange(e)},...s})}}),Bj=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ua.D0,{name:e,render:o=>{const r=o.meta.data?.forceDisplayError&&o.meta.invalid||o.meta.touched&&o.meta.invalid;return(0,i.jsx)(Nu,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:o.input.onChange,onFocus:o.input.onFocus,...s})}}),Vj=({onChange:e,prefix:t,state:n,withFileField:s,...o})=>{const r=`${t}key`,a=`${t}name`,l=`${t}acl`,d=[r,a,l];let c;return s&&(c=`${t}file`,d.push(c)),(0,i.jsx)(eI,{names:d,render:t=>{let d=null;m(t[r].input.value)&&m(t[a].input.value)&&m(t[l].input.value)&&(d={key:t[r].input.value,name:t[a].input.value,acl:t[l].input.value});const{invalid:u,hint:h}=Object.values(t).reduce((e,t)=>e.invalid?e:Ol(t.meta)?{invalid:!0,hint:t.meta.error||t.meta.submitError}:e,{invalid:!1,hint:void 0});return(0,i.jsx)(Vv,{hint:h,state:u?"error":n,value:d,onChange:n=>{t[r].input.onChange(n?.key??""),t[r].input.onBlur(),t[a].input.onChange(n?.name??""),t[a].input.onBlur(),t[l].input.onChange(n?.acl??""),t[l].input.onBlur(),s&&(t[c].input.onChange(n?.file),t[c].input.onBlur(),n?.file&&e?.(n.file))},...o})}})},Uj=pr("div",{alignItems:"center",borderRadius:"$1",color:"$gray600",cursor:"pointer",display:"flex",height:"40px",justifyContent:"center",width:"40px",variants:{active:{true:{background:"$primary200",color:"$primary700"},false:{"&:hover":{background:"$gray200",color:"$gray800"}}}}}),Wj=({css:e,label:t,description:n,value:s,height:o,renderOnPortal:r,onChange:a,...l})=>{const d=Yn(),[c,u]=(0,L.useState)(!1),h=(0,L.useMemo)(()=>(0,lc.A)(pn.map(e=>({value:e,name:d(e)})),e=>e.name),[]);return(0,i.jsxs)(Na,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Pl,{children:t}),(0,i.jsx)($l,{children:n}),(t||n)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Bd,{isOpen:c,onStateChange:u,children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(Ml,{cursor:"pointer",icon:Qa(s),rightIcon:c?"chevron-up":"chevron-down",...l,children:(0,i.jsx)(yr,{css:{flex:"1"},children:d(s)})})}),(0,i.jsx)(qd,{maxHeight:300,placement:"bottom",renderOnPortal:r,width:"match",children:(0,i.jsx)(Na,{css:{px:"$2"},gap:"2",width:1,wrap:"wrap",children:h.map(e=>(0,i.jsx)(Uj,{active:s===e.value,onClick:()=>{u(!1),a(e.value)},children:(0,i.jsx)(el,{icon:Qa(e.value)})},e.value))})})]})]})},Gj=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ua.D0,{name:e,render:o=>{const r=Ol(o.meta);return(0,i.jsx)(Wj,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),Hj=({name:e,hint:t,state:n,...s})=>(0,i.jsx)(Ua.D0,{name:e,render:o=>{const r=Ol(o.meta);return(0,i.jsx)(zu,{hint:r?o.meta.error:t,name:e,state:r?"error":n,value:o.input.value,onBlur:o.input.onBlur,onChange:e=>{o.input.onChange(e)},onFocus:o.input.onFocus,...s})}}),qj=e=>{const{translate:t,params:{organizationId:n}}=_l(),s=qn(Mj),o=qn(X_),r=qn(du),a=Mc();if((0,L.useEffect)(()=>{e.slug===se.Acronym||e.slug===se.Address||e.slug===se.Color||e.slug===se.Description||e.slug===se.Icon||e.slug===se.Name||e.slug===rt.Acronym||e.slug===rt.Address||e.slug===rt.Color||e.slug===rt.Description||e.slug===rt.Icon||e.slug===rt.Name||e.slug===be.Description||e.slug===be.Name||e.customField?.fieldType===Ve.Address||e.customField?.fieldType===Ve.Country||e.customField?.fieldType===Ve.Language||e.customField?.fieldType===Ve.Nationality||e.customField?.fieldType===Ve.Sex||e.customField?.fieldType===Ve.Text||e.customField?.fieldType===Ve.Textarea||e.customField?.fieldType===Ve.Time?"string"!=typeof e.value&&e.change(e.name,""):e.slug===se.AutoAccredit||e.slug===se.WeezeventIsSynchronized||e.slug===_e.Privacy||e.slug===be.IsLocked||e.slug===be.ShowInDelegationSpace||e.slug===be.CanLeadersAddMembers||e.slug===be.CanLeadersEditCustomFields||e.slug===be.CanLeadersEditMembers||e.slug===be.CanLeadersDeleteMembers||e.slug===be.CanLeadersEditColumns||e.slug===be.CanLeadersImportMembers||e.slug===be.CanLeadersSeeHiddenAccreditationsSlots||e.slug===be.ShowFormLinkInDelegationSpace||e.customField?.fieldType===Ve.Checkbox||e.customField?.fieldType===Ve.Validation?"boolean"!=typeof e.value&&e.change(e.name,!1):e.slug===se.Category||e.slug===be.Category||e.slug===rt.Category?"number"!=typeof e.value&&e.change(e.name,e.categories[0]?.id):e.slug===se.Index||e.slug===se.Latitude||e.slug===se.Longitude||e.slug===rt.Latitude||e.slug===rt.Longitude||e.slug===be.MaxResources||e.customField?.fieldType===Ve.Number?"number"!=typeof e.value&&e.change(e.name,0):e.slug===se.Tag||e.slug===rt.Tag||e.slug===be.Campaigns||e.slug===be.Documents||e.slug===be.Tag||e.slug===rt.Traces?Array.isArray(e.value)||e.change(e.name,[]):e.slug===be.DeadlineDate||e.customField?.fieldType===Ve.Date||e.customField?.fieldType===Ve.Datetime?Us.c9.isDateTime(e.value)||m(e.value)||e.change(e.name,Us.c9.invalid("Invalid")):e.customField?.fieldType===Ve.File?null!==e.value&&"object"==typeof e.value||e.change(e.name,s.documentInputDefault()):e.customField?.fieldType===Ve.Phone?null!==e.value&&"object"==typeof e.value||e.change(e.name,o.basePhoneInputDefault()):e.customField?.fieldType===Ve.Select?e.customField.canSelectMultiple&&!Array.isArray(e.value)?e.change(e.name,[]):e.customField.canSelectMultiple||"number"==typeof e.value||e.change(e.name,""):e.slug===be.Form&&"number"!=typeof e.value&&e.change("massEdit.value",e.forms[0].id)},[e.customField,e.slug]),e.slug===se.Acronym||e.slug===rt.Acronym||e.slug===se.Address||e.slug===rt.Address||e.customField?.fieldType===Ve.Address||e.customField?.fieldType===Ve.Text)return(0,i.jsx)(Ll,{name:e.name});if(e.slug===se.AutoAccredit||e.slug===se.WeezeventIsSynchronized||e.slug===be.IsLocked||e.slug===be.ShowFormLinkInDelegationSpace||e.slug===be.ShowInDelegationSpace||e.slug===be.CanLeadersAddMembers||e.slug===be.CanLeadersEditCustomFields||e.slug===be.CanLeadersEditMembers||e.slug===be.CanLeadersDeleteMembers||e.slug===be.CanLeadersEditColumns||e.slug===be.CanLeadersImportMembers||e.slug===be.CanLeadersSeeHiddenAccreditationsSlots||e.customField?.fieldType===Ve.Checkbox||e.customField?.fieldType===Ve.Validation)return(0,i.jsxs)(Hj,{name:e.name,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]});if(e.slug===_e.Privacy)return(0,i.jsxs)(Hj,{name:e.name,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("Private")}),(0,i.jsx)("option",{value:"false",children:t("Public")})]});if(e.slug===se.Category||e.slug===be.Category||e.slug===rt.Category)return(0,i.jsx)(Um,{isSearchVisible:!0,name:e.name,children:e.categories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===se.Color||e.slug===rt.Color)return(0,i.jsx)(Lj,{name:e.name});if(e.slug===se.Description||e.slug===be.Description||e.slug===rt.Description)return(0,i.jsx)(yr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(Qv,{name:e.name})});if(e.slug===se.Icon||e.slug===rt.Icon)return(0,i.jsx)(Gj,{name:e.name});if(e.slug===se.Latitude||e.slug===rt.Latitude)return(0,i.jsx)(Vm,{name:e.name});if(e.slug===se.Longitude||e.slug===rt.Longitude)return(0,i.jsx)(Vm,{name:e.name});if(e.slug===se.Name||e.slug===rt.Name)throw new Error("Should not happen");if(e.slug===be.Campaigns)return(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===be.Documents)return(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))});if(e.slug===se.Tag||e.slug===rt.Tag||e.slug===be.Tag)return(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.tags.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===rt.Traces)return(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});if(e.slug===se.Index||e.slug===be.MaxResources||e.customField?.fieldType===Ve.Number)return(0,i.jsx)(Ll,{name:e.name,shouldParseAsInt:!0});if(e.customField?.fieldType===Ve.Country)return(0,i.jsx)(Um,{isSearchVisible:!0,name:e.name,children:r.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))});if(e.slug===be.DeadlineDate||e.customField?.fieldType===Ve.Date)return(0,i.jsx)(Lm,{name:e.name});if(e.customField?.fieldType===Ve.Datetime)return(0,i.jsx)(Bj,{name:e.name});if(e.customField?.fieldType===Ve.File){const t=e.customField.fieldProperty===Le.Picture?[Rv.Images]:[Rv.Images,Rv.Pdf],s=e.customField.fieldProperty===Le.Picture?"public-read":"private";return(0,i.jsx)(Vj,{accept:t,acl:s,organizationId:n,prefix:`${e.name}.`})}return e.customField?.fieldType===Ve.Language?e.customField.fieldProperty===Le.Language?(0,i.jsxs)(Hj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_31086")}),a(xd)]}):(0,i.jsxs)(Hj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_31086")}),a(_n)]}):e.customField?.fieldType===Ve.Nationality?(0,i.jsx)(Um,{isSearchVisible:!0,name:e.name,children:r.getNationalitiesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):e.customField?.fieldType===Ve.Phone?(0,i.jsx)(nI,{prefix:`${e.name}.`}):e.customField?.fieldType===Ve.Select?e.customField.canSelectMultiple?(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:e.name,children:e.customField.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):(0,i.jsx)(Um,{isSearchVisible:!0,name:e.name,placeholder:t("s_lectionnez_un_44130"),children:e.customField.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):e.customField?.fieldType===Ve.Sex?(0,i.jsxs)(Hj,{name:e.name,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_43620")}),a(Tn)]}):e.customField?.fieldType===Ve.Textarea?(0,i.jsx)(Gm,{name:e.name}):e.customField?.fieldType===Ve.Time?(0,i.jsx)(tb,{name:e.name}):e.slug===be.Form?(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!1,name:"massEdit.value",children:e.forms.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):null},Yj=e=>(0,i.jsxs)(ab,{children:[(0,i.jsxs)(Na,{align:"center",gap:"4",children:[(0,i.jsx)(ul,{css:{flex:"1",textTransform:"uppercase"},textStyle:"smallcapsheading",children:e.title}),e.buttons]}),e.children]}),Kj=e=>{const{translate:t}=_l(),n=e.customFields.find(t=>t.id===e.customFieldValues.customFieldId);return(0,i.jsx)(Yj,{buttons:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),(0,i.jsx)(Cm,{placement:"top",children:t("supprimer_43083")})]}),title:t("champ_de_formul_73221",e.index+1),children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsxs)(Um,{isSearchVisible:!0,label:t("CustomField"),name:`${e.field}.customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:t("s_lectionner_un_48159")}),e.customFields.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),n&&(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",children:t("nouvelle_valeur_39039",n.name)}),(0,i.jsx)(qj,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:n,forms:[],name:`${e.field}.value`,slug:n.slug,tags:[],traces:[],value:e.customFieldValues.value}),n.fieldType===Ve.Select&&n.canSelectMultiple&&(0,i.jsx)(Nm,{name:`${e.field}.addValues`,children:t("ajouter_les_val_22996")})]})]})})},Zj=e=>{const t=Yn();return(0,i.jsx)(Na,{direction:"column",gap:"3",children:no(e.values)?(0,i.jsxs)(i.Fragment,{children:[e.values.map((t,n)=>{const s=`${e.name}[${n}]`;return(0,i.jsx)(Na,{direction:"column",children:(0,i.jsx)(Na,{gap:"3",children:(0,i.jsx)(Kj,{change:e.change,customFieldValues:e.values[n],customFields:e.customFields,field:s,index:n,remove:()=>{e.change(e.name,ao(e.values,n))}})})},n)}),(0,i.jsx)(El,{color:"invisible",css:{"::before":{content:"+",marginInlineEnd:"$1"}},onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:t("ajouter_un_nouv_22370")})]}):(0,i.jsx)(ab,{align:"center",css:{background:"$gray50",textAlign:"center"},gap:"2",children:(0,i.jsxs)(Na,{align:"center",css:{textAlign:"center"},direction:"column",gap:"2",children:[(0,i.jsx)(cl,{css:{fontWeight:"$medium"},children:t("aucun_champ_est_98607")}),(0,i.jsx)(El,{color:"invisible",css:{inlineSize:"fit-content","::before":{content:"+",marginInlineEnd:"$1"}},onClick:()=>{e.change(e.name,e.values.concat([{customFieldId:-1,addValues:!1}]))},children:t("_lier_un_champ_52842")})]})})})},Xj=e=>(0,i.jsx)(Na,{align:"center",css:{background:`$${e.color}50`,borderRadius:"48px",color:`$${e.color}700`,...e.css||{}},height:48,justify:"center",width:48,children:(0,i.jsx)(Na,{align:"center",css:{background:`$${e.color}100`,borderRadius:"32px"},height:32,justify:"center",width:32,children:(0,i.jsx)(el,{icon:e.icon})})}),Jj=e=>{const t=Yn(),n=qn(Ba),s=Ga();return(0,i.jsx)(su,{size:e.size||"sm",onClose:e.onClose,children:(0,i.jsx)(Cl,{css:{overflow:"hidden"},direction:"column",height:1,hideDefaultErrors:!0,initialValues:e.initialValues,render:n=>{const{handleSubmit:o,submitting:r}=n;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:e.icon})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",id:s.labelId,textAlign:"center",children:e.title}),e.subtitle&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",id:s.descId,textAlign:"center",children:e.subtitle})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(vl,{errorId:s.errorId}),(0,i.jsx)(Na,{css:{overflowY:"auto"},direction:"column",children:"function"==typeof e.children?e.children(n):e.children}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{isLoading:r,onClick:o,children:e.buttonText}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},validate:t=>e.schema?n.validateForForm(e.schema)(t):{},onSubmit:e.onSubmit})})},Qj=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation TagCreate($organizationId: OrganizationId!, $eventId: EventId, $tag: String!) {\n tagCreate(organizationId: $organizationId, eventId: $eventId, tag: $tag) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(Jj,{buttonText:t("cr_er_82895"),icon:"tag",initialValues:{name:""},title:t("cr_er_un_tag_59505"),onClose:e.onClose,onSubmit:async t=>{const{tagCreate:i}=await n({organizationId:e.organizationId,tag:t.name});e.onSuccess(i),e.onClose()},children:(0,i.jsx)(Ll,{label:t("nom_du_tag_95054"),name:"name"})})},eC=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.tags),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Um,{isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:t("tags_79499")}),multiple:!0,name:`${e.name}tagsIds`,onCreateClick:()=>{r(!0)},children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),o&&(0,i.jsx)(Qj,{organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:t=>{s([...n,t]),e.change(`${e.name}tagsIds`,[...e.tagsIds,t.id])}})]})},tC=/^[0-9]{11}$/i,nC=Us.c9.now().year-2e3;function iC(e){if(m(e)&&tC.test(e)){const t=(0,Pj.A)(e.substring(0,2),10);let n=(0,Pj.A)(e.substring(0,9),10);const i=(0,Pj.A)(e.substring(9),10);return t<=nC&&(n=2e9+n),i===97-n%97}return!1}const sC=/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/,oC={AD:24,AE:23,AL:28,AO:25,AT:20,AX:18,AZ:28,BA:20,BE:16,BF:28,BG:22,BH:22,BI:27,BJ:28,BL:27,BR:29,BY:28,CF:27,CG:27,CH:21,CI:28,CM:27,CR:22,CV:25,CY:28,CZ:24,DE:22,DJ:27,DK:18,DO:28,DZ:26,EA:24,EE:20,EG:29,ES:24,FI:18,FK:18,FO:18,FR:27,GA:27,GB:22,GE:22,GF:27,GG:22,GI:23,GL:18,GP:27,GQ:27,GR:27,GT:28,GW:25,HN:28,HR:21,HU:28,IC:24,IE:22,IL:23,IM:22,IQ:23,IR:26,IS:26,IT:27,JE:22,JO:30,KM:27,KW:30,KZ:20,LB:28,LC:32,LI:21,LT:20,LU:20,LV:21,LY:25,MA:28,MC:27,MD:24,ME:22,MF:27,MG:27,MK:19,ML:28,MN:20,MQ:27,MR:27,MT:31,MU:30,MZ:25,NC:27,NE:28,NI:28,NL:18,NO:15,OM:23,PF:27,PK:24,PL:28,PM:27,PS:29,PT:25,QA:29,RE:27,RO:24,RS:22,RU:33,SA:24,SC:31,SD:18,SE:24,SI:19,SK:24,SM:27,SN:28,SO:23,ST:25,SV:28,TD:27,TF:27,TG:28,TL:23,TN:24,TR:26,UA:29,VA:22,VG:24,WF:27,XK:20,YE:30,YT:27};let rC=class{countriesService;dateTimeService;translationService;constructor(e,t,n){this.countriesService=e,this.dateTimeService=t,this.translationService=n}getValueString(e,t,n={}){switch(e.fieldType){case Ve.Text:case Ve.Textarea:case Ve.Time:case Ve.Address:return t[e.slug]||"";case Ve.Sex:return this.getSexValue(e,t);case Ve.Language:return this.getLanguageValue(e,t);case Ve.Nationality:return this.getNationalityValue(e,t);case Ve.Country:return this.getCountryValue(e,t);case Ve.Select:return this.getSelectValue(e,t);case Ve.Checkbox:case Ve.Validation:return this.getBooleanValue(e,t);case Ve.Date:return this.getDateValue(e,t,n.dateFormat);case Ve.Datetime:return this.getDatetimeValue(e,t,n.datetimeFormat);case Ve.File:return"name"===n.fileReturnValue?t[e.slug]?.name||"":t[e.slug]?.url||"";case Ve.Phone:return this.getPhoneValue(e,t);case Ve.Number:return this.getIntValue(e,t);default:return rl(e.fieldType)}}getValue(e,t){return t[e.slug]}getSelectValues(e,t){const n=to(this.getValue(e,t)??[]);return(0,Ya.A)(n.map(t=>e.values.find(e=>e.id===t)?.value))}getSexValue(e,t){return this.translationService.translate(this.getValue(e,t)??"")}getLanguageValue(e,t){return this.translationService.translate(this.getValue(e,t)??"")}getNationalityValue(e,t){return this.countriesService.getNationality(this.getValue(e,t)??"")??""}getCountryValue(e,t){return this.countriesService.getName(this.getValue(e,t)??"")??""}getBooleanValue(e,t){const n=this.getValue(e,t);return!0===n?this.translationService.translate("oui_54361"):!1===n?this.translationService.translate("non_33516"):""}getDateValue(e,t,n){let i=this.getValue(e,t);return m(i)&&(i=Us.c9.fromISO(i,{zone:"utc"})),Us.c9.isDateTime(i)&&i.isValid?m(n)?i.toFormat(n):this.dateTimeService.toLocaleString(i,Js.DateOnly.MonthLong):""}getDatetimeValue(e,t,n){let i=this.getValue(e,t);return m(i)&&(i=Us.c9.fromISO(i,{zone:"utc"})),Us.c9.isDateTime(i)&&i.isValid?m(n)?i.toFormat(n):this.dateTimeService.toLocaleString(i,Js.DateTime):""}getPhoneValue(e,t){return this.getValue(e,t)?.internationalFormat??""}getIntValue(e,t){return this.getValue(e,t)?.toString()??""}getSelectValue(e,t){const n=to(this.getValue(e,t)??[]);return(0,Ya.A)(n.map(t=>e.values.find(e=>e.id===t)?.value)).join(", ")}};rC=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],rC);const aC=[Ve.Country,Ve.Language,Ve.Nationality,Ve.Select];function lC(e,t,n){if(e.hasCondition&&e.conditionCustomField){const i=n.find(t=>t.id===e.conditionCustomField.id);if(i){if(lC(i,t,n)){const n=t[e.conditionCustomField.slug];return"boolean"==typeof n&&e.conditionCustomField.fieldType===Ve.Checkbox?n===e.conditionValue:!(!aC.includes(e.conditionCustomField.fieldType)||!no(e.conditionValue))&&(0,mh.A)(to(n),e.conditionValue).length>0}return!1}return!1}return!0}const dC=xd.concat(_n);let cC=class extends Ul{countriesService;documentInputService;phoneInputService;translationService;constructor(e,t,n,i){super(i),this.countriesService=e,this.documentInputService=t,this.phoneInputService=n,this.translationService=i}fieldsUpdateInputDefault(e,t,n,i){return Object.fromEntries(t.map(t=>{const s=this.getFieldValue(e,t);return[t.slug,s??this.fieldUpdateInputDefault(t,n,i)]}))}fieldSchema(e,t){const n=(n,i)=>{if(e.conditionCustomField)return d.Ik().when(e.conditionCustomField.slug,([s])=>t&&(e.conditionCustomField.fieldType===Ve.Checkbox&&s===e.conditionValue||aC.includes(e.conditionCustomField.fieldType)&&no(e.conditionValue)&&(0,mh.A)(to(s),e.conditionValue).length>0)?n():i());{let e;return e=t?n():i(),e}};switch(e.fieldType){case Ve.File:return n(()=>this.documentInputService.documentInputSchema(e.name),()=>this.documentInputService.documentInputSchemaNotRequired());case Ve.Phone:return n(()=>this.phoneInputService.phoneInputSchema(),()=>this.phoneInputService.phoneInputSchemaNotRequired());case Ve.Text:case Ve.Textarea:case Ve.Time:case Ve.Address:return e.fieldProperty===Le.Eid?n(()=>d.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)).test("valid-eid",this.t("le_num_ro_de_re_71488"),iC),()=>d.Yj()):e.fieldSubtype!==Be.Freeform?n(()=>d.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)).test("valid-eid",this.t("_1_n_est_pas_a_14932",e.name),t=>{switch(e.fieldSubtype){case Be.Eid:return iC(t);case Be.Avs:return function(e){if(m(e)){const t=e.replace(/\D/g,"");if(13===t.length&&t.startsWith("756")){const e=t.substring(0,12).split("").reduce((e,t,n)=>n%2==0?e+Number(t):e+3*Number(t),0)%10;return(0===e?0:10-e)===Number(t[12])}return!1}return!1}(t);case Be.Iban:return function(e){if(m(e)){const t=e.toUpperCase().trim().replace(/\s+/g,"");if(sC.test(t)){const e=t.substring(0,2);if(t.length===oC[e]){const e=`${t.substring(4)}${t.substring(0,4)}`;let n="";for(const t of e)n=/[A-Z]/.test(t)?`${n}${t.charCodeAt(0)-55}`:`${n}${t}`;return BigInt(n)%97n==1n}return!1}return!1}return!1}(t);case Be.Freeform:return!0;default:return rl(e.fieldSubtype)}}),()=>d.Yj()):n(()=>d.Yj().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj());case Ve.Number:return n(()=>d.ai().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.ai().nullable());case Ve.Checkbox:return n(()=>d.zM().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.zM());case Ve.Validation:return n(()=>d.zM().required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)).oneOf([!0],this.t("_1_doit_obliga_82862",e.name)),()=>d.zM());case Ve.Select:return e.canSelectMultiple?n(()=>d.YO().of(d.ai().required()).required(this.t("_1_est_requis_99856",e.name)).min(1,this.t("vous_devez_s_le_55757",e.name)),()=>d.YO().of(d.ai())):n(()=>d.ai().oneOf(e.values.map(({id:e})=>e),this.oneOfMessage(e.name,e.values.map(({value:e})=>e))).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.ai().oneOf(e.values.map(({id:e})=>e),this.oneOfMessage(e.name,e.values.map(({value:e})=>e))));case Ve.Date:case Ve.Datetime:return n(()=>qm.required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("la_date_est_inv_22002",e.name)),()=>d.gl().nullable());case Ve.Sex:return n(()=>d.Yj().oneOf(Tn,this.oneOfMessage(e.name,Tn)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj().oneOf(Tn,this.oneOfMessage(e.name,Tn)));case Ve.Language:return n(()=>d.Yj().oneOf(dC,this.oneOfMessage(e.name,dC)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj().oneOf(dC,this.oneOfMessage(e.name,dC)));case Ve.Nationality:case Ve.Country:return n(()=>d.Yj().oneOf(this.countriesService.countriesCodes,this.oneOfMessage(e.name,this.countriesService.countriesCodes)).required(this.t("_1_est_requis_99856",e.name)).typeError(this.t("_1_est_requis_99856",e.name)),()=>d.Yj().oneOf(this.countriesService.countriesCodes,this.oneOfMessage(e.name,this.countriesService.countriesCodes)));default:return rl(e.fieldType)}}fieldUpdateInputDefault(e,t,n){switch(e.fieldType){case Ve.Checkbox:case Ve.Validation:return!!n&&void 0;case Ve.File:return this.documentInputService.documentInputDefault();case Ve.Phone:return this.phoneInputService.phoneInputDefault(t);case Ve.Select:return e.canSelectMultiple?[]:void 0;case Ve.Address:case Ve.Date:case Ve.Datetime:case Ve.Language:case Ve.Number:case Ve.Sex:case Ve.Text:case Ve.Textarea:case Ve.Time:return;case Ve.Country:return t.user.country;case Ve.Nationality:return t.user.nationality;default:return rl(e.fieldType)}}getFieldValue(e,t){const n=e[t.slug];return t.fieldType===Ve.Phone&&n?(0,wr.A)(n,Z_):t.fieldType===Ve.File?(0,wr.A)(n,Fj):t.fieldType===Ve.Date&&n?Us.c9.fromISO(n,{zone:"UTC"}):n}};cC=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Mj,X_,Wn])],cC);const uC=({formattedAddressProps:e,latitudeProps:t,longitudeProps:n,placeProps:s,...o})=>{const r=(0,L.useRef)(null);return(0,L.useEffect)(()=>{const i=new google.maps.places.Autocomplete(r.current,{types:["geocode"]});i.addListener("place_changed",async()=>{const o=i.getPlace(),r=o.geometry.location.lat(),a=o.geometry.location.lng();e.input.onChange(o.formatted_address),t?.input.onChange(r),n?.input.onChange(a),s?.input.onChange(o)})},[]),(0,i.jsx)(Nl,{ref:r,value:e.input.value,onBlur:e.input.onBlur,onChange:e.input.onChange,onFocus:e.input.onFocus,...o})},hC=({addressName:e,latitudeName:t,longitudeName:n,placeName:s,...o})=>{const r=[e];return t&&r.push(t),n&&r.push(n),s&&r.push(s),(0,i.jsx)(eI,{names:r,render:r=>(0,i.jsx)(uC,{formattedAddressProps:r[e],latitudeProps:t?r[t]:void 0,longitudeProps:n?r[n]:void 0,placeProps:s?r[s]:void 0,...o})})},mC=e=>{const t=Yn();return(0,i.jsxs)(Na,{gap:"4",width:1,children:[(0,i.jsx)(yr,{css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden"},height:126,width:126,children:(0,i.jsx)("img",{height:"126px",src:e.url,width:"126px"})}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray400",children:e.hint})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(yr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",onClick:e.onDelete,children:t("supprimer_43083")})]})]})},gC=e=>(0,i.jsxs)(Na,{gap:"4",width:1,children:[(0,i.jsx)(Na,{align:"center",css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",cursor:"pointer"},height:126,justify:"center",width:126,children:(0,i.jsx)(Na,{height:64,width:64,children:(0,i.jsx)(yl,{color:fr.colors.gray900.value,height:"64px",strokeWidth:"4",width:"64px"})})}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",children:e.label}),e.hint&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray400",children:e.hint})]})]})]}),pC=({value:e,onChange:t,label:n,hint:s,organizationId:o,...r})=>{const[a,l]=(0,L.useState)(e?Bv.File:Bv.Uploader);return a===Bv.File&&e?(0,i.jsx)(mC,{hint:s,label:n,url:ov(e,P.HEAVENT_AWS_UPLOADS_BUCKET),onDelete:()=>{t(null),l(Bv.Uploader)}}):a===Bv.Uploading?(0,i.jsx)(gC,{hint:s,label:n}):(0,i.jsx)(Fv,{hint:s,label:n,onChange:async e=>{l(Bv.Uploading);try{const n=await sv(o,e,"public-read");t(n),l(Bv.File)}catch{l(Bv.Uploader)}},...r})},fC=({prefix:e,...t})=>{const n=`${e}key`,s=`${e}name`,o=`${e}acl`;return(0,i.jsx)(eI,{names:[n,s,o],render:e=>{let r=null;return m(e[n].input.value)&&m(e[s].input.value)&&m(e[o].input.value)&&(r={key:e[n].input.value,name:e[s].input.value,acl:e[o].input.value}),(0,i.jsx)(pC,{value:r,onChange:t=>{e[n].input.onChange(t?.key??""),e[s].input.onChange(t?.name??""),e[o].input.onChange(t?.acl??"")},...t})}})},xC=e=>{const t=Yn(),n=Mc(),s=qn(du),o=qn(cC),r=e.isMandatory?e.field.name:(0,i.jsx)(Uv,{children:e.field.name}),a=`${e.prefix}${e.field.slug}`,l=e.field.description,d=(0,L.useMemo)(()=>a.startsWith("formRegister.userInfo.fields."),[a]);if((0,L.useEffect)(()=>{e.display||e.change(a,o.fieldUpdateInputDefault(e.field,s.getDefaultCountryValues()))},[e.display,e.field,e.change]),!e.display)return null;switch(e.field.fieldType){case Ve.Text:return(0,i.jsx)(Ll,{description:l,label:r,name:a});case Ve.Textarea:return(0,i.jsx)(Gm,{description:l,label:r,name:a});case Ve.Checkbox:return(0,i.jsx)(Nm,{name:a,subtext:l,children:r});case Ve.Validation:return(0,i.jsx)(Nm,{name:a,subtext:(0,i.jsxs)(i.Fragment,{children:[m(l)&&(0,i.jsx)("span",{children:l}),m(l)&&e.field.document&&(0,i.jsx)("br",{}),e.field.document&&(0,i.jsx)(qc,{css:{color:"$primary700"},download:e.field.document.name,to:e.field.document.url,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},children:t("consulter_le_do_69928")})]}),children:r});case Ve.Select:return e.field.canSelectMultiple?(0,i.jsx)(Um,{description:l,isSearchVisible:!0,isSelectAllVisible:!0,label:r,multiple:!0,name:a,children:e.field.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}):(0,i.jsx)(Um,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:e.field.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))});case Ve.Date:return"dateOfBirth"===e.field.slug?(0,i.jsx)(Lm,{autoComplete:d?"bday":void 0,description:l,label:r,max:Us.c9.now(),name:a}):(0,i.jsx)(Lm,{description:l,label:r,name:a});case Ve.Datetime:return(0,i.jsx)(Bj,{description:l,label:r,name:a});case Ve.Time:return(0,i.jsx)(tb,{description:l,label:r,name:a});case Ve.Phone:return(0,i.jsx)(nI,{description:l,label:r,prefix:`${a}.`});case Ve.Number:return(0,i.jsx)(Ll,{description:l,label:r,name:a,shouldParseAsInt:!0});case Ve.Sex:return(0,i.jsxs)(Hj,{autoComplete:d?"sex":void 0,description:l,label:r,name:a,children:[(0,i.jsx)("option",{disabled:!0,value:"",children:t("choisir_une_val_00277")}),n(Tn)]});case Ve.Language:return e.field.fieldProperty===Le.Language?(0,i.jsx)(Um,{autoComplete:d?"language":void 0,description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:n(xd)}):(0,i.jsx)(Um,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:n(_n)});case Ve.Nationality:return(0,i.jsx)(Um,{description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:s.getNationalitiesIdName(e.countryCode).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});case Ve.Address:return(0,i.jsx)(hC,{addressName:a,autoComplete:d?"street-address":void 0,description:l,label:r,placeName:e.field.fieldProperty===Le.Street?"place":void 0});case Ve.Country:return(0,i.jsx)(Um,{autoComplete:d?"country":void 0,description:l,isSearchVisible:!0,label:r,name:a,placeholder:t("choisir_une_val_00277"),children:s.getCountriesIdName(e.countryCode).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))});case Ve.File:return e.field.fieldProperty===Le.Picture?(0,i.jsx)(fC,{allowCrop:!0,hint:l,label:r,organizationId:e.organizationId,prefix:`${a}.`}):(0,i.jsx)(Vj,{accept:[Rv.Images,Rv.Pdf],acl:e.fileAcl??"private",description:l,label:r,organizationId:e.organizationId,prefix:`${a}.`});default:return rl(e.field.fieldType)}},_C=e=>{const t=Yn(),[n,s]=(0,L.useState)(""),o=(0,L.useMemo)(()=>{if(m(n)){const t=n.trim().toLowerCase();return e.customFields.filter(e=>e.name.trim().toLowerCase().includes(t)||m(e.label)&&e.label.trim().toLowerCase().includes(t))}return e.customFields},[e.customFields,n]),r=(0,L.useMemo)(()=>(0,lc.A)(Object.entries((0,ac.A)(o,e=>e.category.name)),([e])=>e).map(([e,t])=>[e,(0,lc.A)(t,e=>e.name)]),[o]);return(0,i.jsxs)(Na,{css:{padding:"$3"},direction:"column",width:1,children:[(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_c_86475"),state:"search",value:n,onChange:s}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(yr,{css:{maxHeight:"300px",overflowY:"auto"},children:r.map(([n,s],o)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(uc,{index:o,children:n}),s.map(n=>n.conditionCustomField&&!e.selectedCustomFieldsIds.has(n.conditionCustomField.id)?(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsxs)(Na,{align:"center",css:{px:"$3"},gap:"3",height:40,width:1,children:[(0,i.jsx)(mc,{disabled:!0,shouldPreventDefault:!1,state:"unchecked",onClick:Ql.A}),(0,i.jsx)(yr,{color:"gray400",css:{ellipsis:!0,flex:"1"},title:n.name,children:n.name})]},n.id)}),(0,i.jsx)(Cm,{placement:"top-start",children:t("ce_champ_d_pend_31209",n.conditionCustomField?.name)})]},n.id):(0,i.jsx)(_c,{isCheckbox:!0,isRadio:!1,isSelected:e.selectedCustomFieldsIds.has(n.id),subtext:n.label,value:n.id,onClick:()=>{e.toggle(n)},children:n.name},n.id))]},o))})]})},IC=e=>{const{translate:t}=_l();return(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"invisible",leftIcon:"plus",children:t("ajouter_97327")})}),(0,i.jsx)(qd,{placement:"top-start",width:400,children:(0,i.jsx)(_C,{customFields:e.customFields,selectedCustomFieldsIds:e.usedCustomFieldsIds,toggle:e.toggle})})]})},vC=e=>{const{translate:t}=_l();return(0,i.jsxs)(Na,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("aucun_champ_per_21094")}),(0,i.jsx)(IC,{customFields:e.customFields,toggle:e.toggle,usedCustomFieldsIds:e.usedCustomFieldsIds})]})},bC=e=>{const{params:{organizationId:t}}=_l(),n=(0,L.useMemo)(()=>e.customFields.filter(t=>e.usedCustomFieldsIds.includes(t.id)),[e.customFields,e.usedCustomFieldsIds]),s=(0,L.useMemo)(()=>new Set(e.usedCustomFieldsIds),[e.usedCustomFieldsIds]),o=(0,L.useCallback)(t=>{s.has(t.id)?e.change(`${e.prefix}usedCustomFieldsIds`,e.usedCustomFieldsIds.filter(e=>e!==t.id)):e.change(`${e.prefix}usedCustomFieldsIds`,[...e.usedCustomFieldsIds,t.id])},[e.prefix,e.usedCustomFieldsIds,s]);return(0,i.jsx)(Na,{children:no(e.usedCustomFieldsIds)?(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:[n.map(n=>(0,i.jsxs)(Na,{align:"end",gap:"3",children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(xC,{change:e.change,display:!0,field:n,fileAcl:"public-read",isMandatory:!1,organizationId:t,prefix:`${e.prefix}fields.`})}),(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",onClick:()=>o(n)})]},n.id)),(0,i.jsx)(IC,{customFields:e.customFields,toggle:o,usedCustomFieldsIds:s})]}):(0,i.jsx)(vC,{customFields:e.customFields,toggle:o,usedCustomFieldsIds:s})})},jC=e=>{const t=Yn();return(0,i.jsxs)(Bd,{doNotCloseOnOtherOpen:!0,isOpen:e.isOpen,onStateChange:e.onStateChange,children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(yr,{children:(0,i.jsxs)(El,{color:e.color,leftIcon:"bars-filter",children:[t("filtres_64574")," ",(e.numberOfAppliedFilters||0)>0?`(${e.numberOfAppliedFilters})`:""]})})}),(0,i.jsx)(qd,{placement:"bottom-end",width:385,children:(0,i.jsxs)(Na,{direction:"column",onChange:Rl,children:[(0,i.jsxs)(Na,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),e.children]}),e.showButtons&&(0,i.jsxs)(Na,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:e.reinit,children:t("r_initialiser_77538")}),(0,i.jsx)(El,{size:"sm",onClick:e.apply,children:t("appliquer_05753")})]})]})})]})};function CC(e){return`${e.name}${m(e.acronym)?` (${e.acronym})`:""}`}function yC(e,t,n,i,s){return i.accreditationDisplay!==mt.None&&!i.hiddenAccreditationsIds.includes(e.id)&&(0===i.displayedAccreditationsIds.length||i.displayedAccreditationsIds.includes(e.id))&&Ah(e,n)&&(!e.hasSlots||e.slots.some(e=>Rh(e,t,i,s)))||s.some(n=>n.accreditationId===e.id&&(!e.hasSlots||e.slots.some(e=>Rh(e,t,i,s))))}function kC(e){return AC(e.map(({accreditationSlot:e})=>e))}function AC(e){return(0,lc.A)(Object.values((0,ac.A)(e,e=>e.accreditation.id)).map(e=>{const t=e[0].accreditationCategory,n=e[0].accreditation,i=e.map(e=>e.date?.toMillis()??1);return{id:n.id,category:t.name,index:n.index,text:m(n.acronym)?n.acronym:n.name,minDate:(0,gh.A)(i),color:n.color,count:e.length,icon:n.icon}}),({category:e,index:t,text:n,minDate:i})=>[e.toLowerCase(),wC(t),n.toLowerCase(),i])}function wC(e){return"number"!=typeof e||isNaN(e)?"9999":e.toString(10).padStart(4,"0")}function SC(e){return(0,lc.A)(e,e=>[e.accreditationCategoryName||"",wC(e.index),e.name.toLowerCase()])}function EC(e,t,n,i,s){let o;const r=t.map(e=>e.accreditationId);if(n){const t={accreditationCategoryId:i.accreditationCategoryId,accreditationId:i.accreditationId,maxResources:null,willAutoAccredit:!0};o=(0,ph.A)([...e,t],e=>e.accreditationId)}else o=e.filter(e=>r.includes(e.accreditationId));s("delegation.accreditations",o)}const TC=({accreditationCategoryId:e,accreditationId:t,accreditationName:n,accreditationSlotsIdsValues:s,change:o,slot:r,values:a})=>{const l=qn(Kc),d=(0,L.useMemo)(()=>s.includes(r.id),[s]);return(0,i.jsx)(gc,{state:d?"checked":"unchecked",onClick:()=>{const n={accreditationCategoryId:e,accreditationId:t,accreditationSlotId:r.id,isDefault:!1,isVisible:!0},i=d?a.accreditationsSlots.filter(e=>e.accreditationSlotId!==r.id):[...a.accreditationsSlots,n];o("delegation.accreditationsSlots",i),EC(a.accreditations,i,!d,n,o)},children:Oh(l,r,n)})},zC=({accreditationCategoryId:e,accreditation:t,accreditationSlotsIdsValues:n,change:s,fullAccreditation:o,values:r})=>{const a=Yn(),[l,d]=(0,L.useState)(!0),c=(0,L.useMemo)(()=>!o.slots.some(e=>!n.includes(e.id)),[t.slots,n]),u=no((0,L.useMemo)(()=>r.accreditationsSlots.filter(e=>e.accreditationId==t.id),[r])),h=(e,t,n)=>{const i=e?[...r.accreditationsSlots,...n]:r.accreditationsSlots.filter(e=>e.accreditationId!==t);s("delegation.accreditationsSlots",i),EC(r.accreditations,i,e,n[0],s)};return o.hasSlots?(0,i.jsxs)(Na,{css:{padding:"$4 0",borderRadius:"5px",border:"1px solid $gray200",boxShadow:"$xs",background:"$white"},direction:"column",gap:"4",children:[(0,i.jsxs)(Na,{css:{padding:"0 $5"},children:[(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer"},gap:"2",onClick:()=>{d(!l)},children:[(0,i.jsx)(el,{icon:l?"chevron-down":"chevron-up"}),t.name]}),(0,i.jsx)(yr,{css:{flex:"1"}}),(0,i.jsx)(El,{color:"invisible",onClick:()=>{const n=t.slots.map(n=>({accreditationCategoryId:e,accreditationId:t.id,accreditationSlotId:n.id,isDefault:!1,isVisible:!0}));h(!c,t.id,n)},children:a(c?"tout_des_lectio_13935":"tout_s_lectionn_48027")})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(Na,{css:{padding:"0 $5"},direction:"column",gap:"4",children:t.slots.toSorted((e,t)=>{if(e.date&&t.date){const n=e.date.toJSDate(),i=t.date.toJSDate();return ni?1:0}return e.namet.name?1:0}).map(o=>(0,i.jsx)(TC,{accreditationCategoryId:e,accreditationId:t.id,accreditationName:t.name,accreditationSlotsIdsValues:n,change:s,slot:o,values:r},o.id))})]})]}):(0,i.jsx)(gc,{css:{padding:"$4 $5",borderRadius:"5px",border:"1px solid $gray200",boxShadow:"$xs",background:"$white"},state:u?"checked":"unchecked",onClick:()=>{const n=[{accreditationCategoryId:e,accreditationId:t.id,accreditationSlotId:t.hiddenSlotId,isDefault:!1,isVisible:!0}];h(!u,t.id,n)},children:t.name})},OC=({accreditationCategory:e,accreditationSlotsIdsValues:t,change:n,fullAccreditationCategory:s,values:o})=>{const r=(0,L.useMemo)(()=>SC(e.accreditations),[e.accreditations]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray500",fontSize:"textSm",children:e.name}),r.map(r=>(0,i.jsx)(zC,{accreditation:r,accreditationCategoryId:e.id,accreditationSlotsIdsValues:t,change:n,fullAccreditation:s.accreditations.find(e=>e.id===r.id),values:o},r.id))]})},RC=({allAccreditationCategories:e,change:t,eventStartAt:n,eventEndAt:s,setIsAddAccreditationOpen:o,values:r})=>{const{params:{organizationId:a,eventId:l,delegationId:d},translate:c}=_l(),[u,h]=(0,L.useState)(""),[m,p]=(0,L.useState)([]),[f,x]=(0,L.useState)([]),[_,I]=(0,L.useState)(Us.c9.invalid("Invalid")),v=(0,L.useMemo)(()=>r.accreditationsSlots.flatMap(e=>e.accreditationSlotId),[r]),b=(0,L.useMemo)(()=>e.flatMap(e=>e.accreditations),[e]),j=(0,L.useMemo)(()=>(0,lc.A)(e.flatMap(e=>{const t=io(m)||m.includes(e.id),n=e.accreditations.flatMap(e=>{const t=(g(u)||(n=e.name,i=u,n.toUpperCase().includes(i.toUpperCase())))&&(io(f)||f.includes(e.id));var n,i;const s=e.slots.filter(e=>!_?.isValid||!e.date?.isValid||e.date.equals(_));return t&&(io(e.slots)||no(s))?[{...e,slots:s}]:[]});return t&&no(n)?[{...e,accreditations:n}]:[]}),e=>e.name.toLowerCase()),[u,m,f,_]);return(0,i.jsxs)(xu,{returnToFallback:ds.DELEGATION_ACCREDITATIONS({organizationId:a,eventId:l,delegationId:d}),size:"md",onClose:()=>{o(!1)},children:[(0,i.jsxs)(_u,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{font:"gray900 textXl medium",children:c("add_an_accreditation")}),(0,i.jsx)(yr,{color:"gray500",children:c("add_default_accreditations_to_delegation")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{gap:"3",justify:"evenly",children:[(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:c("rechercher_une_65646"),value:u,onChange:e=>{h(e)}}),(0,i.jsxs)(jC,{color:"gray",showButtons:!1,children:[(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,label:c("cat_gories_24533"),multiple:!0,renderOnPortal:!0,values:m,onChange:p,children:e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,label:c("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:f,onChange:x,children:b.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Du,{label:"Date",max:s,min:n,value:_,onChange:I})]})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Na,{direction:"column",gap:"4",children:j.map(n=>(0,i.jsx)(OC,{accreditationCategory:n,accreditationSlotsIdsValues:v,change:t,fullAccreditationCategory:e.find(e=>e.id===n.id),values:r},n.id))}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(Iu,{children:(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{onClick:()=>o(!1),children:c("ajouter_97327")}),(0,i.jsx)(El,{color:"white",onClick:()=>{t("delegation.accreditations",[]),t("delegation.accreditationsSlots",[])},children:c("r_initialiser_77538")})]})})]})},$C=e=>(0,i.jsx)(Na,{css:{background:"$gray50",overflowX:"auto",padding:"$6",...e.css},direction:"column",gap:"4",height:1,width:1,children:e.children}),DC=e=>(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:e.category.name}),(0,i.jsx)(Na,{direction:"column",gap:"3",children:e.children})]},e.category.id),PC=pr(Na,{borderRadius:"$2",fontSize:"$textSm",height:"32px",width:"32px","@tablet":{borderRadius:"$3",fontSize:"$textMd",height:"40px",width:"40px"}}),FC=e=>{const t=(0,L.useMemo)(()=>ec(e.color??""),[e.color]),n=(0,L.useMemo)(()=>pn.includes(e.icon)?Qa(e.icon):e.icon,[e.icon]);return(0,i.jsx)(PC,{align:"center",css:{background:t[100],color:t[700],...e.css},justify:"center",role:"presentation",children:(0,i.jsx)(el,{icon:n})})},MC=e=>{const{translate:t}=_l(),n=L.useMemo(()=>CC(e.accreditation),[e.accreditation]),[s,o]=L.useState(!0),r=e.displaySlots||"function"==typeof e.renderCheckbox;return(0,i.jsxs)(Na,{css:{background:"white",bd:!0,overflow:"hidden",userSelect:"none"},direction:"column",children:[(0,i.jsxs)(Na,{align:"center",css:{cursor:r?"pointer":"default",padding:"$3 $4"},gap:"2",onClick:()=>{o(!s),e.onClick?.()},children:[e.displaySlots&&(0,i.jsx)(Na,{align:"center",css:{fontSize:"$textXs"},height:20,justify:"center",width:20,children:(0,i.jsx)(el,{icon:s?"chevron-down":"chevron-right"})}),e.renderCheckbox?.(),(0,i.jsx)(FC,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:n}),e.displayNumberOfSlots&&(0,i.jsx)(yr,{color:"gray500",children:t("creneau",e.numberOfSlots)})]}),e.renderActions?.()]}),(e.displayFormCustomFields||e.displaySlots&&s)&&(0,i.jsx)(Na,{css:{borderTop:"1px solid $gray200"},direction:"column",children:e.children})]})},NC=e=>{const{translate:t}=_l(),[n,s]=(0,L.useState)(void 0),o=(0,L.useCallback)(t=>{e.change("delegation.accreditationsSlots",(0,pu.jM)(e.values.delegation.accreditationsSlots,n=>{n.forEach(n=>{e.slotsIds.includes(n.accreditationSlotId)&&(n.maxResources=t)})})),s(t)},[e.selectedSlotsIds,e.slotsIds,e.values,e.change,s]),r=(0,L.useMemo)(()=>e.values.delegation.accreditationsSlots.find(t=>t.accreditationSlotId===e.selectedSlotsIds[0]),[e.selectedSlotsIds,e.values]),a=r?.isDefault??!1,l=r?.isVisible??!0,d=(0,L.useCallback)(()=>{e.change("delegation.accreditationsSlots",(0,pu.jM)(e.values.delegation.accreditationsSlots,t=>{t.forEach(t=>{e.selectedSlotsIds.includes(t.accreditationSlotId)&&(a?(t.isDefault=!1,t.isVisible=!0):t.isDefault=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[e.selectedSlotsIds,e.values,e.change,a]),c=(0,L.useCallback)(()=>{e.change("delegation.accreditationsSlots",(0,pu.jM)(e.values.delegation.accreditationsSlots,t=>{t.forEach(t=>{e.selectedSlotsIds.includes(t.accreditationSlotId)&&(l?(t.isDefault=!0,t.isVisible=!1):t.isVisible=!0)})})),e.change("selectedAccreditationsSlotsIds",[])},[e.selectedSlotsIds,e.values,e.change,l]),u=(0,L.useCallback)(()=>{e.change("selectedAccreditationsSlotsIds",(0,cc.A)(e.values.selectedAccreditationsSlotsIds,e.selectedSlotsIds)),e.change("delegation.accreditationsSlots",e.values.delegation.accreditationsSlots.filter(t=>!e.selectedSlotsIds.includes(t.accreditationSlotId)))},[e.selectedSlotsIds,e.values,e.change]);return no(e.selectedSlotsIds)?(0,i.jsxs)(Na,{gap:"3",onClick:Rl,children:[(0,i.jsxs)(Na,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:d,children:[(0,i.jsx)(yr,{fontSize:"textXs",children:(0,i.jsx)(el,{icon:"badge"})}),(0,i.jsx)(yr,{fontWeight:"medium",children:t(a?"ne_pas_accr_dit_59893":"accr_diter_par_72403")})]}),(0,i.jsxs)(Na,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:c,children:[(0,i.jsx)(yr,{fontSize:"textXs",children:(0,i.jsx)(el,{icon:l?"eye-slash":"eye"})}),(0,i.jsx)(yr,{fontWeight:"medium",children:t(l?"masquer_34645":"rendre_visible_37057")})]}),(0,i.jsxs)(Na,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",children:[(0,i.jsx)(yr,{fontWeight:"medium",children:t("total_07173")}),(0,i.jsx)(yr,{width:100,children:(0,i.jsx)(Nl,{min:0,rightIcon:"xmark",shouldParseAsInt:!0,value:n??"",onChange:o,onRightIconClick:()=>o(void 0)})})]}),(0,i.jsxs)(Na,{align:"center",css:{color:"$gray800",cursor:"pointer"},gap:"2",onClick:u,children:[(0,i.jsx)(yr,{fontSize:"textXs",children:(0,i.jsx)(el,{icon:"trash-can"})}),(0,i.jsx)(yr,{fontWeight:"medium",children:t("supprimer_43083")})]})]}):(0,i.jsxs)(Na,{align:"center",gap:"6",onClick:Rl,children:[e.hasSlots&&(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{children:t("limite_totale_35352")}),(0,i.jsx)(yr,{width:100,children:(0,i.jsx)(Ll,{name:`${e.prefix}maxResources`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]}),(0,i.jsx)(Hm,{name:`${e.prefix}willAutoAccredit`,children:t("attribuer_autom_13895")})]})},LC=e=>{const{translate:t}=_l(),n=qn(Kc),s=(0,L.useMemo)(()=>e.values.delegation.accreditationsSlots.findIndex(t=>t.accreditationSlotId===e.slot.id),[e.values,e.slot]),o=e.values.delegation.accreditationsSlots[s],r=`delegation.accreditationsSlots[${s}].`,a=o?.isDefault?"checked":"unchecked",l=(0,L.useMemo)(()=>e.values.selectedAccreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked",[e.slot,e.values.selectedAccreditationsSlotsIds]),d=(0,L.useCallback)(t=>{e.change(`${r}isDefault`,"checked"===t),"checked"===t&&e.values.delegation.accreditationsSlots.forEach((t,n)=>{t.accreditationSlotId!==o.accreditationSlotId&&t.accreditationId===o.accreditationId&&e.change(`delegation.accreditationsSlots[${n}].isDefault`,!1)}),"unchecked"===t&&e.change(`${r}isVisible`,!0)},[r,o,e.values,e.change]),c=(0,L.useCallback)(t=>{e.change(`${r}isDefault`,"checked"===t),"unchecked"===t&&e.change(`${r}isVisible`,!0)},[r,e.change]),u=(0,L.useCallback)(t=>{e.change("selectedAccreditationsSlotsIds",so(e.values.selectedAccreditationsSlotsIds,e.slot.id,"checked"===t))},[e.slot,e.values.selectedAccreditationsSlotsIds,e.change]);return(0,i.jsxs)(Dc,{children:[e.displaySelectedCheckbox&&(0,i.jsx)(Ec,{width:48,children:(0,i.jsx)(mc,{state:l,onClick:u})}),(0,i.jsx)(Ec,{css:{textTransform:"capitalize"},children:e.slot.date?n.toLocaleString(e.slot.date,Js.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(Ec,{children:m(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(Ec,{children:e.accreditationDisplay===ie.Radio?(0,i.jsx)(xc,{state:a,onClick:d,children:t("accr_ditation_p_28030")}):(0,i.jsx)(gc,{state:a,onClick:c,children:t("accr_ditation_p_28030")})}),(0,i.jsx)(Ec,{width:100,children:(0,i.jsx)(El,{color:"white",disabled:!o.isDefault,leftIcon:o.isVisible?"eye":"eye-slash",onClick:()=>{e.change(`${r}isVisible`,!o.isVisible)}})}),(0,i.jsx)(Ec,{width:130,children:(0,i.jsx)(Ll,{min:0,name:`${r}maxResources`,shouldParseAsInt:!0,treatIntNaNAsNull:!0})})]})},BC=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>e.values.delegation.accreditations.findIndex(t=>t.accreditationId===e.accreditation.id),[e.values,e.accreditation]),s=(0,L.useMemo)(()=>Ph(e.slots.filter(t=>t.accreditationId===e.accreditation.id)),[e.slots,e.accreditation]),o=(0,L.useMemo)(()=>s.map(e=>e.id),[s]),r=`delegation.accreditations[${n}].`,a=(0,L.useMemo)(()=>{if(e.accreditation.hasSlots){const t=(0,Ns.A)(s.map(t=>e.values.selectedAccreditationsSlotsIds.includes(t.id)));return 2===t.length?"indeterminate":t[0]?"checked":"unchecked"}return"unchecked"},[e.accreditation,e.values.selectedAccreditationsSlotsIds,s]),l=(0,L.useMemo)(()=>o.filter(t=>e.values.selectedAccreditationsSlotsIds.includes(t)),[e.values.selectedAccreditationsSlotsIds,o]),d=(0,L.useCallback)(t=>{"checked"===t?e.change("selectedAccreditationsSlotsIds",(0,Ns.A)(e.values.selectedAccreditationsSlotsIds.concat(o))):e.change("selectedAccreditationsSlotsIds",(0,cc.A)(e.values.selectedAccreditationsSlotsIds,o))},[e.values.selectedAccreditationsSlotsIds,e.change,o]);return(0,i.jsx)(MC,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:s.length,renderActions:()=>(0,i.jsx)(NC,{change:e.change,hasSlots:e.accreditation.hasSlots,prefix:r,selectedSlotsIds:l,slotsIds:o,values:e.values}),children:(0,i.jsxs)(kc,{hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[e.accreditation.hasSlots&&(0,i.jsx)(Vc,{width:48,children:(0,i.jsx)(mc,{state:a,onClick:d})}),(0,i.jsx)(Vc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Vc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Vc,{children:t("accr_ditation_p_28030")}),(0,i.jsx)(Vc,{width:100,children:t("Privacy")}),(0,i.jsx)(Vc,{width:130,children:t("total_07173")})]}),s.map((t,n)=>(0,i.jsx)(LC,{accreditationDisplay:e.accreditation.accreditationDisplay,change:e.change,displaySelectedCheckbox:e.accreditation.hasSlots,slot:t,values:e.values},`${t.id}-${n}`))]})})},VC=e=>{const t=(0,L.useMemo)(()=>SC(e.accreditations.filter(t=>t.accreditationCategoryId===e.category.id)),[e.accreditations,e.category]);return(0,i.jsx)(DC,{category:e.category,children:t.map((t,n)=>(0,i.jsx)(BC,{accreditation:t,change:e.change,slots:e.slots,values:e.values},`${t.id}-${n}`))})},UC=e=>{const t=(0,L.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationCategoryId),[e.values]),n=(0,L.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationId),[e.values]),s=(0,L.useMemo)(()=>e.values.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),[e.values]),o=(0,L.useMemo)(()=>(0,lc.A)(e.accreditationCategories.filter(e=>t.includes(e.id)),e=>e.name.toLowerCase()),[e.accreditationCategories,t]),r=(0,L.useMemo)(()=>e.accreditationCategories.flatMap(e=>e.accreditations).filter(e=>n.includes(e.id)),[e.accreditationCategories,n]),a=(0,L.useMemo)(()=>r.flatMap(e=>e.slots).filter(e=>s.includes(e.id)),[r,s]);return(0,i.jsx)($C,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:o.map(t=>(0,i.jsx)(VC,{accreditations:r,category:t,change:e.change,slots:a,values:e.values},t.id))})},WC=({allAccreditationCategories:e,setIsAddAccreditationOpen:t,change:n,values:s})=>{const{translate:o}=_l(),r=(0,L.useMemo)(()=>s.delegation.accreditationsSlots.some(({isDefault:e})=>e),[s]);return(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{font:"gray900 textMd medium",children:o("liste_des_accr_46997")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(UC,{accreditationCategories:e,change:n,values:s}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(El,{color:"invisible",leftIcon:"plus",onClick:()=>{t(!0)},children:o("add_accreditation")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{font:"gray900 textMd medium",children:o("attribution_des_59896")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Hm,{name:"delegation.addDefaultAccreditationsByAvailability",children:o("attribuer_les_a_56919")})]})]})},GC=e=>(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",width:280,children:e.title}),(0,i.jsx)(Na,{css:{flex:"1"},direction:"column",children:e.children})]}),HC=e=>{const{translate:t}=_l(),n=qn(Hh),[s,o]=(0,L.useState)(!1),r=(0,L.useMemo)(()=>n.getDelegationMembersPossibleColumns(e.customFields,{isWeezeventConnected:!0,positionDisplay:pt.Position,slotDisplay:xt.Custom}),[n,e.customFields]),a=(0,L.useMemo)(()=>(0,Ya.A)(e.values.delegation.columns.map(e=>r.find(t=>t.slug===e))),[r,e.values.delegation]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(Na,{css:{background:"$gray50",borderBottom:"1px solid $gray200",color:"$gray500",padding:"$3 $6"},children:t("liste_des_colon_20101")}),(0,i.jsxs)(Na,{css:{padding:"$4"},direction:"column",gap:"4",children:[(0,i.jsx)(Na,{direction:"column",gap:"2",children:a.map(t=>(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid $gray200",borderRadius:"$1",overflow:"hidden",padding:"$3"},gap:"3",children:[(0,i.jsx)(yr,{color:"gray700",css:{flex:"1"},children:t.name}),(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.change("delegation.columns",(0,dc.A)(e.values.delegation.columns,t.slug))}})]},t.slug))}),(0,i.jsx)(El,{color:"invisible",leftIcon:"gear",onClick:()=>{o(!0)},children:t("_diter_les_colo_39630")})]})]}),s&&(0,i.jsx)(Cu,{columns:r,initialSelectedColumns:e.values.delegation.columns,saveButtonText:t("_diter_62574"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_96096"),title:t("_dition_des_col_70300"),onClose:()=>{o(!1)},onSave:t=>{e.change("delegation.columns",t)}})]})},qC=e=>{const{translate:t}=_l();return(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(GC,{title:t("liste_des_colon_20101"),children:(0,i.jsx)(HC,{change:e.change,customFields:e.customFields,values:e.values})}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsx)(GC,{title:t("droits_des_resp_01552"),children:(0,i.jsxs)(Na,{direction:"column",gap:"3",width:1,children:[(0,i.jsx)(Hm,{name:"delegation.showFormLinkInDelegationSpace",children:t("afficher_le_lie_05841")}),(0,i.jsx)(Hm,{name:"delegation.canLeadersAddMembers",children:t("CanLeadersAddMembers")}),(0,i.jsx)(Hm,{name:"delegation.canLeadersImportMembers",children:t("CanLeadersImportMembers")}),(0,i.jsx)(Hm,{name:"delegation.canLeadersEditMembers",children:t("CanLeadersEditMembers")}),(0,i.jsx)(Hm,{name:"delegation.canLeadersDeleteMembers",children:t("CanLeadersDeleteMembers")}),(0,i.jsx)(Hm,{name:"delegation.canLeadersEditColumns",children:t("CanLeadersEditColumns")}),(0,i.jsx)(Hm,{name:"delegation.canLeadersEditCustomFields",children:t("CanLeadersEditCustomFields")}),(0,i.jsx)(Hm,{name:"delegation.canLeadersSeeHiddenAccreditationsSlots",children:t("CanLeadersSeeHiddenAccreditationsSlots")})]})}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsx)(GC,{title:t("communication_05277"),children:(0,i.jsxs)(Na,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("liste_des_campa_21201"),multiple:!0,name:"delegation.campaignsIds",children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("liste_des_docum_18767"),multiple:!0,name:"delegation.customDocumentsSlugs",children:e.customDocuments.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})]})})]})};function YC(e){return(0,lc.A)(e,e=>e.name.toLowerCase())}const KC=e=>{const t=Yn(),n=(0,L.useMemo)(()=>d.Ik().shape({name:d.Yj().required(t("le_nom_est_requ_61536"))}),[]);return(0,i.jsx)(Jj,{buttonText:e.isEdit?t("renommer_42135"):t("cr_er_82895"),icon:"pen",initialValues:{name:e.initialName},schema:n,title:e.isEdit?t("renommer_1_40542",e.initialName):t("cr_er_une_nouve_72722"),onClose:e.onClose,onSubmit:async t=>{const n=await e.mutate(t.name);e.onClose(),e.onSuccess(n)},children:(0,i.jsx)(Ll,{label:t("nom_de_la_cat_g_03860"),name:"name"})})},ZC=e=>{const{mutate:t}=function(e={}){return Xn("mutation DelegationCategoryCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategory: DelegationsCategoryInput!\n) {\n delegationCategoryCreate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategory: $delegationCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(KC,{initialName:"",isEdit:!1,mutate:async n=>(await t({organizationId:e.organizationId,eventId:e.eventId,delegationCategory:{name:n}})).delegationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},XC=e=>{const{mutate:t}=function(e={}){return Xn("mutation DelegationCategoryUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n $delegationCategory: DelegationsCategoryInput!\n) {\n delegationCategoryUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n delegationCategory: $delegationCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(KC,{initialName:e.delegationCategory.name,isEdit:!0,mutate:async n=>(await t({organizationId:e.organizationId,eventId:e.eventId,delegationCategoryId:e.delegationCategory.id,delegationCategory:{name:n}})).delegationCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},JC=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),[o,r]=(0,L.useState)(0),[a,l,d]=Bc(""),{usersInfosOptions:c,isLoading:u}=Wb({organizationId:n,eventId:null,hasSelected:no(e.leadersIds),nameDebounced:l,reloadKey:o,userInfoIds:e.leadersIds}),[h,m]=(0,L.useState)(!1),[g,p]=(0,L.useState)(YC(e.categories)),[f,x]=(0,L.useState)(!!e.initialParentId),_=(0,L.useCallback)(t=>{t||e.change("delegation.parentId",null),x(t)},[e.change,x]),I=(0,L.useCallback)(t=>{const n=e.organizationDelegations.find(e=>e.id===t);n&&(e.change("delegation.leadersIds",n.leadersIds),r(e=>e+1))},[e.organizationDelegations,e.leadersIds]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:"delegation.parentId",children:I}),"event"===e.delegationType&&no(e.organizationDelegations)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{value:f,onChange:_,children:t("lier_cette_d_l_78975")}),(0,i.jsx)(qa,{height:"6"})]}),f?(0,i.jsx)(Um,{isSearchVisible:!0,label:t("_quelle_d_l_ga_70215"),name:"delegation.parentId",children:e.organizationDelegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):(0,i.jsx)(Ll,{label:t("nom_de_votre_d_69290"),name:"delegation.name"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Um,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"delegation.delegationCategoryId",onCreateClick:()=>{m(!0)},children:g.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Um,{isSearchLoading:u,isSearchVisible:!0,label:t("reponsable_82458_plural"),multiple:!0,name:"delegation.leadersIds",searchElement:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:a,onChange:d}),children:c}),h&&(0,i.jsx)(ZC,{eventId:s,organizationId:n,onClose:()=>{m(!1)},onSuccess:t=>{p(YC([...g,t])),e.change("delegation.delegationCategoryId",t.id)}})]})},QC=e=>(0,i.jsx)(JC,{categories:e.categories,change:e.change,delegationType:"event",initialParentId:e.initialParentId,leadersIds:e.leadersIds,organizationDelegations:e.organizationDelegations}),ey=e=>(0,i.jsx)(JC,{categories:e.categories,change:e.change,delegationType:"organization",initialParentId:null,leadersIds:e.leadersIds,organizationDelegations:[]}),ty=e=>{const t=Yn(),n=(0,L.useMemo)(()=>(0,lc.A)(e.forms,e=>e.name),[e.forms]),[s,o]=(0,L.useState)(!!e.initialValues.delegation.deadlineDate),[r,a]=(0,L.useState)(Number.isInteger(e.initialValues.delegation.maxResources));return(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(GC,{title:t("Form"),children:(0,i.jsx)(Um,{isSearchVisible:!0,label:t("avec_quel_formu_60160"),name:"delegation.formId",placeholder:t("s_lectionnez_un_77066"),children:n.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(GC,{title:t("inscription_dan_16147"),children:[(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:t("les_inscription_64653")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(xc,{state:s?"checked":"unchecked",onClick:()=>{o(!0)},children:t("oui_il_y_a_une_68479")}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Lm,{name:"delegation.deadlineDate"}),(0,i.jsx)(qa,{height:"3"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:s?"unchecked":"checked",onClick:()=>{o(!1),e.change("delegation.deadlineDate",null)},children:t("non_les_inscri_87979")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:t("les_inscription_76218")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(xc,{state:r?"checked":"unchecked",onClick:()=>{a(!0)},children:t("oui_il_y_a_une_02976")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Ll,{name:"delegation.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(qa,{height:"3"})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:r?"unchecked":"checked",onClick:()=>{a(!1),e.change("delegation.maxResources",null)},children:t("non_les_inscri_07566")})]})]})},ny=e=>{const{translate:t}=_l();return(0,i.jsx)(Rb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"triangle-exclamation",children:t("accr_ditations_34551")}),(0,i.jsx)(Tb,{children:(0,i.jsxs)(Na,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yr,{font:"gray900 textLg medium",children:t("voulez_vous_met_24993")}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("les_accr_ditati_76418",e.deletedAccreditationsSlots.join(", "))})]})}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("mettre_jour_l_69948")})})]})})},iy=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),o=L.useMemo(()=>m(e.initialValues.delegation.description)||m(e.initialValues.delegation.privateNote),[e.initialValues]),r=L.useMemo(()=>e.isEdit&&no(e.initialValues.delegation.accreditationsSlots),[e.initialValues,e.isEdit]),a=L.useMemo(()=>e.isEdit&&no(e.initialValues.delegation.usedCustomFieldsIds),[e.initialValues,e.isEdit]),l=L.useMemo(()=>e.isEdit&&no(e.initialValues.delegation.customFields),[e.initialValues,e.isEdit]),d=L.useMemo(()=>no(e.initialValues.delegation.tagsIds),[e.initialValues]),c=function(e,t,n){const i=qn(Kc),s=(0,L.useMemo)(()=>{const e=t.delegation.accreditationsSlots.map(e=>e.accreditationSlotId),i=n.delegation.accreditationsSlots.map(e=>e.accreditationSlotId);return(0,cc.A)(e,i)},[t,n]);return(0,L.useMemo)(()=>e.flatMap(e=>e.accreditations.flatMap(e=>e.slots.flatMap(t=>s.includes(t.id)?[Oh(i,t,e.name,{accreditation:{includeName:!0}})]:[]))),[s,e])}("event"===e.delegationType?e.accreditationsCategories:[],e.initialValues,e.values),[u,h]=L.useState(!1),[g,p]=L.useState(!1),f=L.useCallback(()=>{no(c)?p(!0):e.handleSubmit()},[c,p,e.handleSubmit]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pm,{button:e.isEdit?(0,i.jsx)(El,{isLoading:e.submitting,onClick:f,children:t("mettre_jour_l_69948")}):null,category:e.isEdit?t("mise_jour_de_17055",e.initialValues.delegation.name):t("cr_ation_d_une_07120"),color:"dark",fallbackClosePath:ds.DELEGATIONS({organizationId:n,eventId:s}),heading:e.isEdit?e.initialValues.delegation.name:t("nouvelle_d_l_ga_42871"),children:(0,i.jsxs)($m,{ref:e.centeredContainerRef,children:[(0,i.jsx)(vl,{}),(0,i.jsx)(Mm,{hideToggle:!0,initialIsOpen:!0,heading:t("informations_su_34607"),children:"event"===e.delegationType?(0,i.jsx)(QC,{categories:e.categories,change:e.form.change,initialParentId:e.initialValues.delegation.parentId,leadersIds:e.values.delegation.leadersIds,organizationDelegations:e.organizationDelegations}):(0,i.jsx)(ey,{categories:e.categories,change:e.form.change,leadersIds:e.values.delegation.leadersIds})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{hideToggle:!0,initialIsOpen:!0,heading:t("param_tres_de_l_81810"),children:(0,i.jsx)(ty,{change:e.form.change,forms:e.forms,initialValues:e.initialValues})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{initialIsOpen:e.values.delegation.showInDelegationSpace,subtitle:t("param_trer_les_35157"),heading:t("espace_d_l_gati_59251"),onToggle:t=>{t||(e.form.change("delegation.campaignsIds",[]),e.form.change("delegation.customDocumentsSlugs",[])),e.form.change("delegation.showInDelegationSpace",t)},children:(0,i.jsx)(qC,{campaigns:e.campaigns,change:e.form.change,customDocuments:"event"===e.delegationType?e.customDocuments:[],customFields:e.customFields,values:e.values})}),(0,i.jsx)(qa,{height:"5"}),"event"===e.delegationType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Mm,{initialIsOpen:r,subtitle:t("delegation_accreditations_desc"),heading:t("accr_ditations_39450"),onToggle:t=>{t||e.form.change("delegation.accreditationsSlots",[])},children:(0,i.jsx)(WC,{allAccreditationCategories:e.accreditationsCategories,change:e.form.change,setIsAddAccreditationOpen:h,values:e.values})}),(0,i.jsx)(qa,{height:"5"})]}),(0,i.jsx)(Mm,{initialIsOpen:a,subtitle:t("ajouter_des_inf_57824"),heading:t("champs_de_formu_64126"),onToggle:t=>{t||(e.form.change("delegation.usedCustomFieldsIds",[]),e.form.change("delegation.fields",(0,dr.A)(e.values.delegation.fields,e.delegationCustomFields.map(e=>e.slug))))},children:(0,i.jsx)(bC,{change:e.form.change,customFields:e.delegationCustomFields,prefix:"delegation.",usedCustomFieldsIds:e.values.delegation.usedCustomFieldsIds})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{initialIsOpen:l,subtitle:t("choisissez_une_24029"),heading:t("d_finir_la_vale_27863"),onToggle:t=>{t||e.form.change("delegation.customFields",[])},children:(0,i.jsx)(Zj,{change:e.form.change,customFields:e.customFields,name:"delegation.customFields",values:e.values.delegation.customFields})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsxs)(Mm,{initialIsOpen:o,subtitle:t("ajoutez_une_des_54307"),heading:t("description_et_59312"),onToggle:t=>{t||(e.form.change("delegation.description",""),e.form.change("delegation.privateNote",""))},children:[(0,i.jsx)(Qv,{label:(0,i.jsx)(Uv,{children:t("description_58935")}),name:"delegation.description"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Qv,{label:(0,i.jsx)(Uv,{children:t("note_priv_e_06303")}),name:"delegation.privateNote"})]}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{initialIsOpen:d,subtitle:t("ajouter_des_tag_35833"),heading:t("tags_79499"),onToggle:t=>{t||e.form.change("delegation.tagsIds",[])},children:(0,i.jsx)(eC,{change:e.form.change,name:"delegation.",organizationId:n,tags:e.tags,tagsIds:e.values.delegation.tagsIds})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Fm,{children:(0,i.jsx)(El,{isLoading:e.submitting,textAlign:"center",onClick:f,children:e.isEdit?t("mettre_jour_l_69948"):t("cr_er_la_d_l_ga_53268")})})]})}),"event"===e.delegationType&&u&&(0,i.jsx)(RC,{allAccreditationCategories:e.accreditationsCategories,change:e.form.change,eventEndAt:e.eventEndAt,eventStartAt:e.eventStartAt,setIsAddAccreditationOpen:h,values:e.values.delegation}),(0,i.jsx)(ny,{deletedAccreditationsSlots:c,handleSubmit:e.handleSubmit,isOpen:g,submitting:e.submitting,onClose:()=>{p(!1)}})]})},sy=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),{showNotification:r}=kb(),a=qn(Dj),l=qn(Ba),d=(0,L.useRef)(null);return Dd((0,L.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.delegation.name):n("cr_ation_d_une_07120"),[e.isEdit,e.initialValues])),(0,i.jsx)(Cl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:n,submitting:s,values:o})=>(0,i.jsx)(iy,{...e,centeredContainerRef:d,form:t,handleSubmit:n,submitting:s,values:o}),validate:l.validateForForm(a.createUpdateDelegationSchema()),width:1,onSubmit:async i=>{await e.mutate({organizationId:s,eventId:o,delegation:i.delegation}),r(e.isEdit?n("la_d_l_gation_a_86694"):n("la_d_l_gation_a_01157")),t.goBack(ds.DELEGATIONS({organizationId:s,eventId:o}))}})},oy=(e,t)=>{try{if(m(e)&&!isNaN((0,Pj.A)(e,10)))return{delegationCategoryId:(0,Pj.A)(e,10)};if(m(e)){const n=JSON.parse(r(e)),i=n.parentId,s=n.applyParentSettings?t.find(e=>e.id===i):null;return{parentId:i,parentDelegation:s}}return{}}catch{return{}}},ry=()=>{const{params:{organizationId:e,eventId:t,options:n}}=_l(),s=qn(Dj),{data:o,loader:r}=Zn("query DelegationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n delegations(level: Organization) {\n nodes {\n id\n name\n privateNote\n leadersIds\n tagsIds\n columns\n\n delegationCategory {\n name\n }\n\n form {\n name\n }\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateDelegationEvent\n }\n}\n",{organizationId:e,eventId:t},[Ls.CreatePositionTagsFragment,Ls.OrganizationCustomFieldsFragment,Ls.AttachCustomFieldFragment,Ls.CreateDelegationEventFragment]),{mutate:a}=Jr(),l=(0,L.useMemo)(()=>{if(o.organization){const{delegationCategoryId:e,parentId:t,parentDelegation:i}=oy(n,o.organization.delegations.nodes);return s.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e,delegationsCategories:o.organization.delegationsCategories.nodes,forms:o.event.forms.nodes,parentId:t,parentDelegation:i})}return{}},[n,o]);return r||(0,i.jsx)(sy,{accreditationsCategories:o.event.accreditationsCategories,campaigns:o.event.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:ds.DELEGATIONS({organizationId:e,eventId:t}),customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"event",eventEndAt:o.event.endAt,eventStartAt:o.event.startAt,forms:o.event.forms.nodes,initialValues:l,isEdit:!1,mutate:async e=>(await a(e)).delegationCreate.id,organizationDelegations:o.organization.delegations.nodes,tags:o.organization.tags.nodes})},ay=()=>{const{params:{organizationId:e,options:t}}=_l(),n=qn(Dj),{data:s,loader:o}=Zn("query DelegationOrganizationInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n campaigns(level: Organization, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n delegationsCategories(level: Organization) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...CreateDelegationForm\n }\n }\n }\n}\n",{organizationId:e},[Ls.CreatePositionTagsFragment,Ls.OrganizationCustomFieldsFragment,Ls.AttachCustomFieldFragment,Ls.CreateDelegationFormFragment]),{mutate:r}=Jr(),a=(0,L.useMemo)(()=>{const{delegationCategoryId:e}=oy(t,[]);return n.createUpdateDelegationValuesDefault(null,{delegationCategoryId:e})},[]);return o||(0,i.jsx)(sy,{campaigns:s.organization.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:$s.COMMUNITY_DELEGATIONS(e),customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"organization",forms:s.organization.forms.nodes,initialValues:a,isEdit:!1,mutate:async e=>(await r(e)).delegationCreate.id,tags:s.organization.tags.nodes})},ly=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=_l(),s=qn(Dj),{data:o,loader:r}=Zn("query DelegationEventToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n delegations(level: Organization) {\n nodes {\n id\n name\n leadersIds\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateDelegationEvent\n\n delegation(id: $delegationId) {\n name\n description\n delegationCategoryId\n parentId\n leadersIds\n formId\n deadlineDate\n maxResources\n columns\n privateNote\n tagsIds\n addDefaultAccreditationsByAvailability\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersEditMembers\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n campaignsIds\n customDocumentsSlugs\n usedCustomFieldsIds\n\n customFields {\n addValues\n customFieldId\n value\n }\n\n accreditations {\n accreditationCategoryId\n accreditationId\n maxResources\n willAutoAccredit\n }\n\n accreditationsSlots {\n accreditationCategoryId\n accreditationId\n accreditationSlotId\n isDefault\n maxResources\n isVisible\n }\n }\n }\n}\n",{organizationId:e,eventId:t,delegationId:n},[Ls.CreatePositionTagsFragment,Ls.OrganizationCustomFieldsFragment,Ls.AttachCustomFieldFragment,Ls.CreateDelegationEventFragment]),{mutate:a}=Qr(),l=(0,L.useMemo)(()=>s.createUpdateDelegationValuesDefault(o.event?.delegation,null),[o.event]);return r||(0,i.jsx)(sy,{accreditationsCategories:o.event.accreditationsCategories,campaigns:o.event.campaigns.nodes,categories:o.organization.delegationsCategories.nodes,closePath:ds.DELEGATION({organizationId:e,eventId:t,delegationId:n}),customDocuments:o.event.customDocuments,customFields:o.organization.customFields.nodes,delegationCustomFields:o.organization.delegationCustomFields.nodes,delegationType:"event",eventEndAt:o.event.endAt,eventStartAt:o.event.startAt,forms:o.event.forms.nodes,initialValues:l,isEdit:!0,mutate:async e=>(await a({...e,delegationId:n})).delegationUpdate.id,organizationDelegations:o.organization.delegations.nodes,tags:o.organization.tags.nodes})},dy=()=>{const{params:{organizationId:e,delegationId:t}}=_l(),n=qn(Dj),{data:s,loader:o}=Zn("query DelegationOrganizationToEdit($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n organization(id: $organizationId) {\n ...CreatePositionTags\n ...OrganizationCustomFields\n\n campaigns(level: Organization, states: [Template]) {\n nodes {\n id\n name\n }\n }\n\n delegationsCategories(level: Organization) {\n nodes {\n id\n name\n }\n }\n\n delegationCustomFields: customFields(variety: Delegation, privacy: Public) {\n nodes {\n ...AttachCustomField\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...CreateDelegationForm\n }\n }\n\n delegation(id: $delegationId) {\n name\n description\n delegationCategoryId\n leadersIds\n formId\n deadlineDate\n maxResources\n columns\n privateNote\n tagsIds\n addDefaultAccreditationsByAvailability\n showInDelegationSpace\n showFormLinkInDelegationSpace\n fields\n canLeadersAddMembers\n canLeadersDeleteMembers\n canLeadersEditColumns\n canLeadersEditCustomFields\n canLeadersEditMembers\n canLeadersImportMembers\n canLeadersSeeHiddenAccreditationsSlots\n campaignsIds\n customDocumentsSlugs\n usedCustomFieldsIds\n\n customFields {\n addValues\n customFieldId\n value\n }\n }\n }\n}\n",{organizationId:e,delegationId:t},[Ls.CreatePositionTagsFragment,Ls.OrganizationCustomFieldsFragment,Ls.AttachCustomFieldFragment,Ls.CreateDelegationFormFragment]),{mutate:r}=Qr(),a=(0,L.useMemo)(()=>n.createUpdateDelegationValuesDefault(s.organization?{...s.organization.delegation,accreditations:[],accreditationsSlots:[]}:null,null),[s.organization]);return o||(0,i.jsx)(sy,{campaigns:s.organization.campaigns.nodes,categories:s.organization.delegationsCategories.nodes,closePath:$s.COMMUNITY_DELEGATION(e,t),customFields:s.organization.customFields.nodes,delegationCustomFields:s.organization.delegationCustomFields.nodes,delegationType:"organization",forms:s.organization.forms.nodes,initialValues:a,isEdit:!0,mutate:async e=>(await r({...e,delegationId:t})).delegationUpdate.id,tags:s.organization.tags.nodes})};function cy(e,t,n){const{getLocalOrganization:i,updateLocalOrganization:s}=function(e){const t=L.useCallback(async()=>{let t=await hI.organizations.get(e);return t||(t={id:e},await hI.organizations.put(t)),t},[e]),n=L.useCallback(async n=>{const i=await t(),s=(0,xb.A)(i,{id:e},n);return await hI.organizations.put(s),s},[e,t]);return{getLocalOrganization:t,updateLocalOrganization:n}}(e),[o,r]=L.useState(n),[a,l]=L.useState(!0),d=L.useCallback(async e=>{r(e),await s({[t]:e})},[t,r,s]);return L.useEffect(()=>{(async()=>{const e=await i();e[t]&&r(e[t]),l(!1)})()},[e,i,r,l]),[o,d,a]}function uy(e){return(0,L.useMemo)(()=>new Map(e.map(e=>[e.slug,e])),[e])}function hy(e,t,n){if(t.startsWith("form_inserted_at")){const i=parseInt(t.substring(17),10);if(isNaN(i))return"";{const t=n.find(({form:e})=>e?.id===i);return t?e.toLocaleString(t.insertedAt.toLocal(),Js.DateTime):""}}return""}const my=(0,L.createContext)({});function gy(){return(0,L.useContext)(my)}const py=e=>{const t=qn(rC),{isEditMode:n}=gy(),{isEditMode:s}=rm(),o=n||s,r=t.getValue(e.customField,e.fields),a=t.getValueString(e.customField,e.fields),l=!0===r?"checked":!1===r?"unchecked":"indeterminate";return o&&e.updatable?(0,i.jsxs)(Ec,{css:{border:"2px solid transparent","& > .h-checkbox-cell-hover":{display:"none"},"&:hover":{border:"2px solid $primary700"},"&:hover > .h-checkbox-cell-default":{display:"none"},"&:hover > .h-checkbox-cell-hover":{display:"block"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Rl,children:[(0,i.jsx)(yr,{className:"h-checkbox-cell-default",children:a}),(0,i.jsx)(yr,{className:"h-checkbox-cell-hover",children:(0,i.jsx)(mc,{state:l,onClick:async t=>{await e.mutate("checked"===t,e.customField.slug),e.reload()}})})]}):(0,i.jsx)(Ec,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:a})},fy="h-update-cell-open",xy=e=>{const t=Yn(),n=L.useRef(V()),[s,o]=L.useState(!1),[r,a]=L.useState(e.initialValue),l=L.useCallback(t=>{o(t),document.body.dispatchEvent(new CustomEvent(fy,{bubbles:!0,detail:{uuid:n.current}})),e.onStateChange?.(t)},[o,e.onStateChange]),d=L.useCallback(e=>{e.detail.uuid!==n.current&&o(!1)},[o]),c=L.useCallback(()=>{l(!1),a(e.initialValue)},[e.initialValue,l,a]);return L.useEffect(()=>(document.addEventListener(fy,d),()=>{document.removeEventListener(fy,d)}),[d]),(0,i.jsxs)(Bd,{doNotCloseOnOtherOpen:!0,isOpen:s,onStateChange:l,children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(Ec,{css:{...e.css,border:"2px solid transparent",cursor:"text","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Rl,children:"string"==typeof e.renderValue?e.renderValue:e.renderValue()})}),(0,i.jsxs)(qd,{css:{padding:"0"},placement:"bottom-start",width:380,children:[(0,i.jsx)(Na,{css:{padding:"$4 $6"},onKeyDown:t=>{"Enter"===t.key&&e.onSave(r)},children:e.renderInput(r,a)}),(0,i.jsxs)(Na,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:c,children:t("annuler_48254")}),(0,i.jsx)(El,{size:"sm",onClick:()=>{e.onSave(r)},children:t("appliquer_05753")})]})]})]})},_y=e=>{const{isEditMode:t}=gy(),{isEditMode:n}=rm();return(t||n)&&e.updatable?(0,i.jsx)(xy,{column:e.column,initialValue:e.initialValue,renderInput:e.renderInput,renderValue:e.renderValue,onSave:async t=>{await e.mutate(t),e.reload()}}):(0,i.jsx)(Ec,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:"string"==typeof e.renderValue?e.renderValue:e.renderValue()})};function Iy(e,t){return(0,L.useCallback)(n=>t(n,e.slug),[e,t])}const vy=e=>{const t=qn(rC),n=t.getValueString(e.customField,e.fields),s=(0,L.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return m(n)?Us.c9.fromISO(n,{zone:"utc"}):n},[]),o=Iy(e.customField,e.mutate);return(0,i.jsx)(_y,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Du,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},by=e=>{const t=qn(rC),n=t.getValueString(e.customField,e.fields),s=(0,L.useMemo)(()=>{const n=t.getValue(e.customField,e.fields);return m(n)?Us.c9.fromISO(n,{zone:"utc"}):n},[]),o=Iy(e.customField,e.mutate);return(0,i.jsx)(_y,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Nu,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},jy=e=>{const{params:{organizationId:t}}=_l(),n=qn(rC),s=n.getValueString(e.customField,e.fields,{fileReturnValue:"name"}),o=n.getValueString(e.customField,e.fields,{fileReturnValue:"url"}),r=(0,L.useMemo)(()=>n.getValue(e.customField,e.fields),[e.customField,e.fields]),a=Iy(e.customField,e.mutate);return(0,i.jsx)(_y,{column:e.column,initialValue:r,mutate:a,reload:e.reload,renderInput:(n,s)=>(0,i.jsx)(Vv,{accept:[Rv.Images,Rv.Pdf],acl:"private",label:e.customField.name,organizationId:t,value:n,onChange:s}),renderValue:()=>(0,i.jsx)(qc,{css:{fontWeight:"$regular"},to:o,children:s}),updatable:e.updatable})},Cy=e=>{const t=qn(rC),n=t.getValueString(e.customField,e.fields),s=(0,L.useMemo)(()=>t.getValue(e.customField,e.fields)||0,[e.customField,e.fields]),o=Iy(e.customField,e.mutate);return(0,i.jsx)(_y,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Nl,{label:e.customField.name,shouldParseAsInt:!0,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},yy=e=>{const t=qn(rC),n=qn(X_),s=t.getValueString(e.customField,e.fields),o=(0,L.useMemo)(()=>{const i=t.getValue(e.customField,e.fields),s=n.basePhoneInputDefault();return{country:i?.country||s.country,code:i?.code||s.code,number:i?.number||s.number}},[e.fields]),r=Iy(e.customField,e.mutate);return(0,i.jsx)(_y,{column:e.column,initialValue:o,mutate:r,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(tI,{label:e.customField.name,value:t,onChange:n}),renderValue:s,updatable:e.updatable})};function ky(e){const t=qn(du),n=Mc();return(0,L.useMemo)(()=>e?e.fieldType===Ve.Country?t.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)):e.fieldType===Ve.Language?e.fieldProperty===Le.Language?n(xd):n(_n):e.fieldType===Ve.Nationality?t.getNationalitiesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e)):e.fieldType===Ve.Sex?n(Tn):e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e)):(0,i.jsx)(i.Fragment,{}),[e])}let Ay=null;function wy(e,{fontSize:t,fontWeight:n}={}){Ay||=document.createElement("canvas");const i=Ay.getContext("2d");return i.font=`${n||"400"} ${t||"14px"} 'Open Sans`,i.measureText(e).width}const Sy=({badge:e})=>(0,i.jsx)(ic,{color:e.color,count:e.count,css:{cursor:e.onClick?"pointer":"inherit"},leftIcon:e.icon?pn.includes(e.icon)?Qa(e.icon):e.icon:void 0,size:"md",onClick:e.onClick,children:e.text}),Ey=({badges:e})=>(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(ic,{cursor:"pointer",size:"md",children:`+${e.length}`})}),(0,i.jsx)(qd,{css:{flexWrap:"wrap",gap:"$2",overflow:"auto",padding:"$4",zIndex:100},maxHeight:300,placement:"top-end",width:400,children:e.map(e=>(0,i.jsx)(Na,{children:(0,i.jsx)(Sy,{badge:e})},e.id))})]}),Ty=({badges:e,doNotSort:t,onClick:n})=>{const[s,o]=(0,L.useState)(0),r=(0,L.useCallback)(e=>{e&&o(e.getBoundingClientRect().width)},[]),a=(0,L.useMemo)(()=>{const n=e.map(e=>({...e,textWidth:Math.floor(wy(e.text,{fontSize:"12px"}))+60}));return!0===t?n:(0,lc.A)(n,({textWidth:e})=>e)},[e,t]),[l,d]=(0,L.useMemo)(()=>{let e=37;const t=[],n=[];for(const i of a)e+=i.textWidth+8,eno(d),[d]);return(0,i.jsxs)(Na,{ref:r,align:"center",css:{cursor:n?"pointer":"inherit","&:hover":{color:"black"}},gap:"2",height:1,width:1,onClick:e=>{n&&no(a)&&(Rl(e),n())},children:[l.map(e=>(0,i.jsx)(Sy,{badge:e},e.id)),c&&(n?(0,i.jsx)(ic,{css:{cursor:"pointer"},size:"md",children:"+"+(a.length-l.length)}):(0,i.jsx)(Ey,{badges:d}))]})},zy=e=>{const t=Yn(),n=qn(rC),s=(0,L.useMemo)(()=>{if(e.customField.canSelectMultiple){const t=n.getSelectValues(e.customField,e.fields).map(e=>({id:e,color:"gray",icon:null,text:e}));return()=>(0,i.jsx)(Ty,{badges:t})}return n.getValueString(e.customField,e.fields)},[n,e.customField,e.fields]),o=(0,L.useMemo)(()=>{const t=n.getValue(e.customField,e.fields);return e.customField.canSelectMultiple?no(t)?t:[]:t||""},[]),r=ky(e.customField),a=Iy(e.customField,e.mutate);return(0,i.jsx)(_y,{column:e.column,initialValue:o,mutate:a,reload:e.reload,renderInput:(n,s)=>e.customField.canSelectMultiple?(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,label:e.customField.name,multiple:!0,renderOnPortal:!0,values:n,onChange:s,children:r}):(0,i.jsx)(bc,{isSearchVisible:!0,label:e.customField.name,multiple:!1,placeholder:t("choisir_une_val_00277"),renderOnPortal:!0,values:[n],onChange:e=>{no(e)?s(e[0]):s(null)},children:r}),renderValue:s,updatable:e.updatable})},Oy=e=>{const t=qn(rC).getValueString(e.customField,e.fields),n=Iy(e.customField,e.mutate);return(0,i.jsx)(_y,{column:e.column,initialValue:t,mutate:n,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Wm,{label:e.customField.name,value:t,onChange:n}),renderValue:t,updatable:e.updatable})},Ry=e=>{const t=qn(rC).getValueString(e.customField,e.fields),n=Iy(e.customField,e.mutate);return(0,i.jsx)(_y,{column:e.column,initialValue:t,mutate:n,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(Nl,{autoFocus:!0,label:e.customField.name,value:t,onChange:n}),renderValue:t,updatable:e.updatable})},$y=e=>{const t=qn(rC),n=t.getValueString(e.customField,e.fields),s=(0,L.useMemo)(()=>t.getValueString(e.customField,e.fields),[]),o=Iy(e.customField,e.mutate);return(0,i.jsx)(_y,{column:e.column,initialValue:s,mutate:o,reload:e.reload,renderInput:(t,n)=>(0,i.jsx)(eb,{label:e.customField.name,value:t,onChange:n}),renderValue:n,updatable:e.updatable})},Dy=e=>{const t=qn(rC);return e.customField?.fieldType===Ve.Checkbox?(0,i.jsx)(py,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ve.Date?(0,i.jsx)(vy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ve.Phone?(0,i.jsx)(yy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ve.Select||e.customField?.fieldType===Ve.Country||e.customField?.fieldType===Ve.Language||e.customField?.fieldType===Ve.Sex||e.customField?.fieldType===Ve.Nationality?(0,i.jsx)(zy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ve.Text?(0,i.jsx)(Ry,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ve.Textarea?(0,i.jsx)(Oy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ve.Number?(0,i.jsx)(Cy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ve.File?(0,i.jsx)(jy,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ve.Datetime?(0,i.jsx)(by,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):e.customField?.fieldType===Ve.Time?(0,i.jsx)($y,{column:e.column,customField:e.customField,fields:e.fields,mutate:e.mutate,reload:e.reload,updatable:e.updatable}):(0,i.jsx)(Ec,{children:e.customField?t.getValueString(e.customField,e.fields,{fileReturnValue:"name"}):""})},Py=e=>{const{translate:t}=_l(),{isEditMode:n}=gy(),{isEditMode:s}=rm(),o=n||s,r=(0,L.useMemo)(()=>({firstName:e.userInfo.fields.firstName||"",lastName:e.userInfo.fields.lastName||""}),[e.userInfo]),a=(0,L.useCallback)(async t=>{await e.mutate(t.firstName,"firstName"),await e.mutate(t.lastName,"lastName"),e.reload()},[e.mutate,e.reload]);return o&&e.updatable?(0,i.jsx)(xy,{column:e.column,initialValue:r,renderInput:(e,n)=>(0,i.jsxs)(Na,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Nl,{label:t("pr_nom_66988"),value:e.firstName,onChange:t=>{n({...e,firstName:t})}}),(0,i.jsx)(Nl,{label:t("last_name"),value:e.lastName,onChange:t=>{n({...e,lastName:t})}})]}),renderValue:()=>(0,i.jsx)(uj,{isClickDisabled:!0,size:32,userInfo:e.userInfo}),onSave:a}):(0,i.jsx)(Ec,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(uj,{isClickDisabled:!e.canClickMemberName,size:32,userInfo:e.userInfo})})};function Fy(e,t){return e?e.usersOrganizations.map(e=>({id:e.role.id,color:"gray",icon:e.role.type===It.OrganizationAdmin?"gem":"glasses-round",text:`${e.role.name}`})).concat(e.usersEvents.map(e=>({id:e.role.id,color:"gray",icon:e.role.type===It.EventAdmin?"gem":"glasses-round",text:`${e.event.name} - ${e.role.name}`}))).concat(e.usersDelegations.map((e,n)=>({id:`ud-${n}`,color:"gray",icon:"user-group",text:`${e.delegation.name} - ${t("responsable_de_70462")}`}))).concat(e.usersDelegationsCategories.map(e=>({id:e.role.id,color:"gray",icon:"user-group",text:`${e.delegationCategory.name} - ${e.role.name}`}))).concat(e.usersPositions.map(e=>({id:e.role.id,color:"gray",icon:"sitemap",text:`${e.position.name} - ${e.role.name}`}))).concat(e.usersPositionsCategories.map(e=>({id:e.role.id,color:"gray",icon:"sitemap",text:`${e.positionCategory.name} - ${e.role.name}`}))):[]}const My=e=>{const t=Yn(),n=(0,L.useMemo)(()=>e.userPermissions?Fy(e.userPermissions,t):[],[e.userPermissions]);return(0,i.jsx)(Ec,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ty,{badges:n,doNotSort:!0})})},Ny=({column:e,eventId:t,onClick:n,reload:s,updatable:o,volunteerRegistration:r})=>{const a=Yn(),{mutate:l}=jo(),{mutate:d}=Zo(),c=qn(Kc),{isEditMode:u}=gy(),{isEditMode:h}=rm(),m=u||h,[g,p]=(0,L.useState)(!0),[f,x]=(0,L.useState)(null),_=(0,L.useMemo)(()=>r?.accreditationsUsersInfos||[],[r]),I=(0,L.useMemo)(()=>kC(_),[_]),v=(0,L.useMemo)(()=>_.map(e=>e.accreditationSlot.id),[_]),b=(0,L.useCallback)(async e=>{if(e&&g){const{event:e}=await(n={eventId:t},s=await K(),ho("query UpdateCellAccreditationsSlots($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n name\n\n accreditations {\n id\n name\n accreditationDisplay\n hasSlots\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n isBlocked\n }\n }\n }\n }\n}\n",{variables:n,token:s||void 0,fragments:[]})),o=(0,lc.A)(e.accreditationsCategories,e=>e.name.toLowerCase()).flatMap(e=>SC(e.accreditations).map(t=>{const n=t.accreditationDisplay===ie.Radio?t.name:void 0,s=Ph(t.slots);return(0,i.jsx)("optgroup",{label:`${e.name} - ${t.name}`,children:s.map(e=>{const s=Oh(c,e,t.name,{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{"data-radio":n,disabled:e.isBlocked,value:e.id,children:s},e.id)})},t.id)}));x(o),p(!1)}var n,s},[g]),j=(0,L.useCallback)(async e=>{no(e)?await l({eventId:t,massAccredit:{accreditationsSlotsIds:e,selecteds:{ids:[r.userInfo.id]},strategy:tt.Replace}}):await d({eventId:t,massStateUpdate:{selecteds:{ids:[r.userInfo.id]},state:le.WaitingAccreditation}}),s()},[t,r,l,s]);return m&&o?(0,i.jsx)(xy,{column:e,css:{gap:"$2"},initialValue:v,renderInput:(e,t)=>g?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(bc,{isSearchVisible:!0,label:a("accr_ditations_39450"),multiple:!0,renderOnPortal:!0,values:e,onChange:t,children:f}),renderValue:()=>(0,i.jsx)(Ty,{badges:I,doNotSort:!0}),onSave:j,onStateChange:b}):(0,i.jsx)(Ec,{css:{border:"2px solid transparent"},minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(Ty,{badges:I,doNotSort:!0,onClick:n})})},Ly=e=>{const t=(0,L.useMemo)(()=>(0,ph.A)(e.volunteerRegistration?.accreditationsUsersInfos??[],e=>e.accreditationSlot.accreditationCategory.id).map(e=>({id:e.accreditationSlot.accreditationCategory.id,color:"gray",icon:null,text:e.accreditationSlot.accreditationCategory.name})),[e.volunteerRegistration]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},By=e=>{const t=Yn(),{mutate:n}=nr();return(0,i.jsx)(Na,{css:{cursor:"pointer",padding:"$3","&:hover":{background:"$gray100"}},onClick:async()=>{await n({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistrationId,slug:"accreditation_state",value:e.state}),e.reload(),e.close()},children:(0,i.jsx)(ic,{...xj(e.state),children:t(e.state)})})},Vy=e=>{const t=Yn(),{isEditMode:n}=gy(),{isEditMode:s}=rm(),o=n||s,[r,a]=(0,L.useState)(!1),l=(0,L.useCallback)(e=>{o&&a(e)},[o,a]),d=(0,L.useCallback)(()=>{l(!1)},[l]);return o&&e.updatable?(0,i.jsx)(Ec,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Rl,children:(0,i.jsxs)(Bd,{isOpen:r,onStateChange:l,children:[(0,i.jsx)(Yd,{children:(0,i.jsxs)(Na,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(ic,{...xj(e.state),cursor:"text",children:t(e.state)}),r&&(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"chevron-down"})})]})}),(0,i.jsxs)(qd,{offset:2,placement:"bottom",width:240,children:[e.state!==le.WaitingAccreditation&&(0,i.jsx)(By,{close:d,eventId:e.eventId,reload:e.reload,state:le.WaitingAccreditation,volunteerRegistrationId:e.volunteerRegistrationId}),e.state!==le.NotApplicable&&(0,i.jsx)(By,{close:d,eventId:e.eventId,reload:e.reload,state:le.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})]})}):(0,i.jsx)(Ec,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ic,{...xj(e.state),children:t(e.state)})})},Uy=e=>{const t=qn(Kc),n=qn(hh),s=(0,L.useMemo)(()=>{const i=e.volunteerRegistration.userInfo.formsUsersInfos||[];return(0,lc.A)(i.flatMap(e=>(e.slots||[]).map(t=>({range:t.range,display:e.form.slotDisplay}))),({range:e})=>e.start.toMillis()).map((e,i)=>({id:i,color:"gray",icon:null,text:e.display===xt.Calendar||e.display===xt.DisplayDays?t.toLocaleString(e.range.start,Js.DateOnly.Numeric):n.toDisplayString(e.range,{formats:{localeFormat:Js.DateOnly.Numeric}})}))},[e.volunteerRegistration.userInfo.formsUsersInfos]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:s,doNotSort:!0,onClick:e.onClick})})},Wy=e=>{const{translate:t}=_l();return(0,i.jsxs)(Rb,{children:[(0,i.jsx)($b,{children:(0,i.jsx)(yr,{css:{cursor:"pointer"},height:e.size,width:e.size,children:(0,i.jsx)("img",{height:"100%",src:dg(e.ticketId,{height:e.size,width:e.size}),width:"100%"})})}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"qrcode",children:t("code_barres_1_82428",e.nameOrEmail)}),(0,i.jsxs)(Tb,{align:"center",css:{padding:"$4"},gap:"3",justify:"center",children:[(0,i.jsx)(yr,{height:100,width:100,children:(0,i.jsx)("img",{height:"100%",src:dg(e.ticketId,{height:100,width:100}),width:"100%"})}),(0,i.jsx)(yr,{children:e.ticketId})]}),(0,i.jsx)(Eb,{})]})]})},Gy=e=>{const t=e.volunteerRegistration.ticketId;return(0,i.jsxs)(Ec,{align:"center",gap:"2",minWidth:e.column.minWidth,width:e.column.width,children:[(0,i.jsx)(Wy,{nameOrEmail:e.volunteerRegistration.userInfo.nameOrEmail,size:30,ticketId:e.volunteerRegistration.ticketId}),m(e.volunteerRegistration.weezeventTicketUrl)?(0,i.jsx)(qc,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventTicketUrl,children:t}):t]})},Hy=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(e.volunteerRegistration.userInfo.emails??[]).map(e=>{const{color:n,leftIcon:i}=hj(e.state);return{id:e.id,color:n,icon:i,text:`${e.campaign?.name??""} - ${t(e.state)}`}}),[e.volunteerRegistration]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:n})})},qy=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration.positionsSlotsUsersInfos||[]).filter(e=>e.state!==me.Waiting),[e.volunteerRegistration]),n=(0,L.useMemo)(()=>zh(t),[t]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:n,doNotSort:!0,onClick:e.onClick})})},Yy=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{mutate:o}=Jo(),{mutate:r}=Fo(),{isEditMode:a}=gy(),{isEditMode:l}=rm(),d=a||l,c=(0,L.useMemo)(()=>e.volunteerRegistration.delegation,[e.volunteerRegistration.delegation]),u=(0,L.useMemo)(()=>c?[c.id]:[],[c]),[h,m]=(0,L.useState)(!0),[g,p]=(0,L.useState)([]),f=(0,L.useCallback)(async e=>{if(e&&h){const{event:{delegations:e}}=await tr({eventId:s},await K());p(e.nodes),m(!1)}},[h]),x=(0,L.useCallback)(async t=>{no(t)?await o({eventId:s,delegationId:t[0],selecteds:{ids:[e.volunteerRegistration.userInfo.id]}}):c&&await r({organizationId:n,eventId:s,delegationId:c.id,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},deleteFromEvent:!1}),e.reload()},[s,e.volunteerRegistration]);return d&&e.updatable?(0,i.jsx)(xy,{column:e.column,css:{gap:"$2"},initialValue:u,renderInput:(e,n)=>h?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(bc,{isSearchVisible:!0,label:t("Delegation"),renderOnPortal:!0,values:e,onChange:n,children:g.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),renderValue:()=>c?(0,i.jsx)(ic,{cursor:"pointer",ellipsis:!0,children:c.name}):null,onSave:x,onStateChange:f}):(0,i.jsx)(Ec,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:c&&(0,i.jsx)(ic,{cursor:"pointer",ellipsis:!0,title:c.name,children:(0,i.jsx)(Ja,{to:ds.DELEGATION({organizationId:n,eventId:s,delegationId:c.id}),children:c.name})})})},Ky=e=>{const{params:{organizationId:t,eventId:n}}=_l(),s=e.volunteerRegistration.delegation?.delegationCategory;return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:s&&(0,i.jsx)(ic,{cursor:"pointer",ellipsis:!0,title:s.name,children:(0,i.jsx)(Ja,{to:ds.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:s.id}),children:s.name})})})},Zy=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration.userInfo?.formsUsersInfos??[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.volunteerRegistration.userInfo]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},Xy=e=>{const t=Yn(),{mutate:n}=Xo(),{mutate:s}=Qo(),o=qn(hh),{isEditMode:r}=gy(),{isEditMode:a}=rm(),l=r||a,d=(0,L.useMemo)(()=>e.volunteerRegistration?.positionsSlotsUsersInfos||[],[e.volunteerRegistration]),c=(0,L.useMemo)(()=>zh(d),[d]),u=(0,L.useMemo)(()=>d.map(e=>e.positionSlot.id),[d]),[h,m]=(0,L.useState)(!0),[g,p]=(0,L.useState)([]),f=(0,L.useCallback)(async t=>{if(t&&h){const{event:{positionsSlots:t}}=await(n={eventId:e.eventId},i=await K(),ho("query UpdateCellPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positionsSlots {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n }\n }\n}\n",{variables:n,token:i||void 0,fragments:[]})),s=(0,lc.A)(t.nodes,e=>[e.range.start.toMillis(),e.name]).map(e=>({id:e.id,positionName:e.position.name,name:vh(o,e,e.position.name,{position:{includeNameAtEnd:!0}})}));p((0,lc.A)(Object.entries((0,ac.A)(s,e=>e.positionName)),([e])=>e)),m(!1)}var n,i},[h]),x=(0,L.useCallback)(async t=>{no(t)?await n({eventId:e.eventId,massAssign:{positionsSlotsIds:t,selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:tt.Replace}}):await s({eventId:e.eventId,massStateUpdate:{selecteds:{ids:[e.volunteerRegistration.userInfo.id]},state:$t.WaitingAssignment}}),e.reload()},[e.eventId,e.volunteerRegistration,n,e.reload]);return l&&e.updatable?(0,i.jsx)(xy,{column:e.column,css:{gap:"$2"},initialValue:u,renderInput:(e,n)=>h?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(bc,{isSearchVisible:!0,label:t("missions_63972"),multiple:!0,renderOnPortal:!0,values:e,onChange:n,children:g.map(([e,t],n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},n))}),renderValue:()=>(0,i.jsx)(Ty,{badges:c,doNotSort:!0}),onSave:x,onStateChange:f}):(0,i.jsx)(Ec,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:c,doNotSort:!0,onClick:e.onClick})})},Jy=e=>{const t=(0,L.useMemo)(()=>(0,ph.A)(e.volunteerRegistration?.positionsSlotsUsersInfos??[],e=>e.positionCategory.id).map(e=>({id:e.positionCategory.id,color:"gray",icon:null,text:e.positionCategory.name})),[e.volunteerRegistration]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},Qy=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration?.preassignPositions||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},ek=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration?.preassignPositionsCategories||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},tk=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration.accreditationsUsersInfos||[]).filter(e=>e.checkInAt?.isValid),[e.volunteerRegistration]),n=(0,L.useMemo)(()=>kC(t),[t]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:n,doNotSort:!0,onClick:e.onClick})})},nk=e=>(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:m(e.volunteerRegistration.shortTag)&&m(e.volunteerRegistration.weezeventPayUrl)?(0,i.jsx)(qc,{css:{fontWeight:"normal"},to:e.volunteerRegistration.weezeventPayUrl,children:e.volunteerRegistration.shortTag}):e.volunteerRegistration.shortTag||""}),ik=(...e)=>({name:"canCommentFn",args:e}),sk=(...e)=>({name:"canRegistrationStateUpdateFn",args:e}),ok=(...e)=>({name:"canUserInfoSlotsUpdateFn",args:e});async function rk(e){try{const t=await K(),n=await function(e,t){return ho("query UserPermission($checks: [PermissionCheck!]!) {\n user {\n permission(checks: $checks)\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}(e,t);return n.user.permission}catch{return e.checks.map(e=>!1)}}const ak=new Map;function lk({checks:e}){const t=e.map(e=>[e,JSON.stringify(e)]),n=t.filter(([e,t])=>!ak.has(t));if(n.length>0){const e=rk({checks:n.map(([e,t])=>e)});n.forEach(([t,n],i)=>{ak.set(n,e.then(e=>e[i]))})}return Promise.all(t.map(([e,t])=>ak.get(t)))}function dk({withCaching:e,checks:t}){const[{isLoading:n,permissions:i},s]=(0,L.useState)({isLoading:!0,permissions:new Array(t.length).fill(!1)}),o=e?lk:rk;return(0,L.useEffect)(()=>{o({checks:t}).then(e=>{s({isLoading:!1,permissions:e})},()=>{s({isLoading:!1,permissions:i})})},[]),{isLoading:n,permissions:i}}function ck(...e){return dk({withCaching:!0,checks:e})}const uk=e=>{const t=Yn(),{mutate:n}=nr();return(0,i.jsx)(Na,{css:{cursor:"pointer",padding:"$3","&:hover":{background:"$gray100"}},onClick:async()=>{await n({eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistrationId,slug:"volunteer_registration_state",value:e.state}),e.reload(),e.close()},children:(0,i.jsx)(ic,{cursor:"pointer",...fj(e.state),children:t(e.state)})})},hk=e=>{const{permissions:[t,n],isLoading:s}=function(...e){return dk({withCaching:!1,checks:e})}(sk(e.eventId,$t.PreAssigned,e.volunteerRegistrationId),sk(e.eventId,$t.Assigned,e.volunteerRegistrationId));return s?null:(0,i.jsxs)(i.Fragment,{children:[n&&e.state!==$t.WaitingAssignment&&(0,i.jsx)(uk,{close:e.close,eventId:e.eventId,reload:e.reload,state:$t.WaitingAssignment,volunteerRegistrationId:e.volunteerRegistrationId}),t&&(0,i.jsx)(uk,{close:e.close,eventId:e.eventId,reload:e.reload,state:$t.PreAssigned,volunteerRegistrationId:e.volunteerRegistrationId}),n&&e.state!==$t.Refused&&(0,i.jsx)(uk,{close:e.close,eventId:e.eventId,reload:e.reload,state:$t.Refused,volunteerRegistrationId:e.volunteerRegistrationId}),n&&e.state!==$t.NotApplicable&&(0,i.jsx)(uk,{close:e.close,eventId:e.eventId,reload:e.reload,state:$t.NotApplicable,volunteerRegistrationId:e.volunteerRegistrationId})]})},mk=e=>{const t=Yn(),{isEditMode:n}=gy(),{isEditMode:s}=rm(),o=n||s,[r,a]=(0,L.useState)(!1),l=(0,L.useCallback)(e=>{o&&a(e)},[o,a]),d=(0,L.useCallback)(()=>{l(!1)},[l]);return o&&e.updatable?(0,i.jsx)(Ec,{css:{border:"2px solid transparent","&:hover":{border:"2px solid $primary700"}},minWidth:e.column.minWidth,width:e.column.width,onClick:Rl,children:(0,i.jsxs)(Bd,{isOpen:r,onStateChange:l,children:[(0,i.jsx)(Yd,{children:(0,i.jsxs)(Na,{align:"center",gap:"3",height:1,justify:"between",width:1,children:[(0,i.jsx)(ic,{...fj(e.state),cursor:"text",ellipsis:!0,children:t(e.state)}),r&&(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"chevron-down"})})]})}),(0,i.jsx)(qd,{offset:2,placement:"bottom",width:230,children:(0,i.jsx)(hk,{close:d,...e})})]})}):(0,i.jsx)(Ec,{css:{border:"2px solid transparent"},minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ic,{...fj(e.state),children:t(e.state)})})},gk=e=>{const t=(0,L.useMemo)(()=>e.volunteerRegistration.userInfo.tags||[],[e.volunteerRegistration]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:n})})},pk=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=_l(),{isEditMode:a}=gy(),{isEditMode:l}=rm(),d=a||l,{mutate:c}=nr(),u=(0,L.useMemo)(()=>e.volunteerRegistration.teams||[],[e.volunteerRegistration]),h=(0,L.useMemo)(()=>u.map(({teamCode:n})=>({id:n,color:"gray",icon:null,text:n,onClick:d?void 0:()=>{t.push($s.VOLUNTEERS_LIST_USER_PANEL_TEAM(s,o,r,e.volunteerRegistration.userInfo.id,n))}})),[u,d]);return 1===u.length&&d?(0,i.jsx)(xy,{column:e.column,css:{gap:"$2"},initialValue:u[0].teamCode,renderInput:(e,t)=>(0,i.jsx)(Nl,{label:n("code_quipe_14296"),value:e,onChange:t}),renderValue:()=>(0,i.jsx)(Ty,{badges:h}),onSave:async t=>{await c({eventId:o,volunteerRegistrationId:e.volunteerRegistration.id,slug:"team_code",value:t}),e.reload()}}):(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:h})})},fk=e=>{const{params:{organizationId:t,eventId:n}}=_l(),s=(0,L.useMemo)(()=>(0,lc.A)(e.teamMembers,e=>u(e.name)),[e.teamMembers]);return(0,i.jsx)(Na,{children:s.map((e,s)=>(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{css:{cursor:"pointer",position:"relative",left:-4*s+"px"},children:(0,i.jsx)(Ja,{to:qI.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.id}),children:(0,i.jsx)(Jg,{email:e.email,image:e.picture?.url,name:e.name,size:24})})})}),(0,i.jsx)(Cm,{placement:"top",children:e.name})]},e.id))})},xk=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration.userInfo.formsUsersInfos||[]).flatMap(e=>e.teamMembers||[]),[e.volunteerRegistration]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(fk,{teamMembers:t})})},_k=e=>{const t=(0,L.useMemo)(()=>(e.volunteerRegistration.weezaccessChecklists||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.volunteerRegistration]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},Ik=e=>{const t=(0,L.useMemo)(()=>AC(e.volunteerRegistration?.accreditationsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t,doNotSort:!0,onClick:e.onClick})})},vk=e=>{const t=qn(hh),n=(0,L.useMemo)(()=>function(e,t,n,i){return(0,ph.A)(t,e=>e.id).map(e=>({id:`c-${e.id}`,color:"gray",icon:null,text:e.name})).concat((0,ph.A)(n,e=>e.id).map(e=>({id:`p-${e.id}`,color:e.color,icon:e.icon,text:m(e.acronym)?e.acronym:e.name}))).concat((0,ph.A)(i,e=>e.id).map(t=>{const n=m(t.position.acronym)?t.position.acronym:t.position.name,i=vh(e,t,n,{interval:{options:{formats:{localeFormat:Js.DateOnly.Numeric}}}});return{id:`s-${t.id}`,color:t.position.color,icon:t.position.icon,text:`${n} | ${i}`}}))}(t,e.volunteerRegistration?.positionsCategories||[],e.volunteerRegistration?.positions||[],e.volunteerRegistration?.positionsSlots||[]),[e.volunteerRegistration]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:n,onClick:e.onClick})})},bk=e=>{const{history:t}=_l(),n=qn(Kc),s=qn(ep),o=(0,L.useMemo)(()=>function(e,t){return t.flatMap(t=>t.form?[`${t.form.name} : ${e.toLocaleString(t.insertedAt.toLocal(),Js.DateTime)}`]:[]).join(", ")}(n,e.row.userInfo.formsUsersInfos||[]),[e.row]),{mutate:r}=nr(),a=(0,L.useCallback)((t,n)=>r({eventId:e.eventId,volunteerRegistrationId:e.row.id,slug:n,value:t}),[e.eventId,e.row,r]),l=e.row.userInfo;switch(e.column.slug){case Wh.Accreditations:return(0,i.jsx)(Ny,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canAccredit,volunteerRegistration:e.row,onClick:m(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/assigned`)}:void 0});case Wh.AccreditationsCategories:return(0,i.jsx)(Ly,{column:e.column,volunteerRegistration:e.row});case Wh.AccreditationState:return(0,i.jsx)(Vy,{column:e.column,eventId:e.eventId,field:e.column,reload:e.reloadRow,state:e.row.accreditationState,updatable:e.canAccredit,volunteerRegistrationId:e.row.id});case Wh.ScannedAccreditations:return(0,i.jsx)(tk,{column:e.column,volunteerRegistration:e.row,onClick:m(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/scanned`)}:void 0});case Wh.Availability:return(0,i.jsx)(Uy,{column:e.column,volunteerRegistration:e.row,onClick:m(e.availabilitiesPanelPath)?()=>{t.push(e.availabilitiesPanelPath)}:void 0});case Wh.Comments:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:no(l.comments)?l.comments.flatMap(e=>e.content).join("; "):""});case Wh.CampaignsStates:return(0,i.jsx)(Hy,{column:e.column,volunteerRegistration:e.row});case Wh.CheckedInPositions:return(0,i.jsx)(qy,{column:e.column,volunteerRegistration:e.row,onClick:m(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Wh.CompletedForms:return(0,i.jsx)(Zy,{column:e.column,volunteerRegistration:e.row});case Wh.FormsInsertedAt:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:o,children:o})});case Wh.Delegations:return(0,i.jsx)(Yy,{column:e.column,reload:e.reloadRow,updatable:e.canChangeDelegation,volunteerRegistration:e.row});case Wh.DelegationLocalId:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.delegationLocalId||""});case Wh.DuplicatedFrom:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.duplicatedFrom?(0,i.jsx)(uj,{size:32,userInfo:e.row.duplicatedFrom.userInfo}):null});case Wh.DelegationCategory:return(0,i.jsx)(Ky,{column:e.column,volunteerRegistration:e.row});case Wh.Email:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:l.email});case Wh.Id:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:l.id});case Wh.LocalId:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.localId});case Wh.InsertedAt:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:n.toLocaleString(e.row.insertedAt.toLocal(),Js.DateTime)});case Wh.Name:return(0,i.jsx)(Py,{canClickMemberName:e.canClickMemberName,column:e.column,mutate:a,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0,userInfo:e.row.userInfo});case Wh.NumberOfAccreditations:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAccreditations});case Wh.NumberOfAssignments:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignments});case Wh.NumberOfAssignmentsDays:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAssignmentsDays});case Wh.NumberOfAvailableDays:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfAvailableDays});case"picture":return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Jg,{email:l.email,image:l.picture?.url,name:l.name,size:32})});case Wh.Positions:return(0,i.jsx)(Xy,{column:e.column,eventId:e.eventId,reload:e.reloadRow,updatable:e.canAssign,volunteerRegistration:e.row,onClick:m(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/assigned`)}:void 0});case Wh.PositionsCategories:return(0,i.jsx)(Jy,{column:e.column,volunteerRegistration:e.row});case Wh.PreassignedPositions:return(0,i.jsx)(Qy,{column:e.column,volunteerRegistration:e.row});case Wh.PreassignedPositionsCategories:return(0,i.jsx)(ek,{column:e.column,volunteerRegistration:e.row});case Wh.Roles:return(0,i.jsx)(My,{minWidth:e.column.minWidth,userPermissions:e.row.userInfo,width:e.column.width});case Wh.Tags:return(0,i.jsx)(gk,{column:e.column,volunteerRegistration:e.row});case Wh.TeamCode:return(0,i.jsx)(pk,{column:e.column,reload:e.reloadRow,volunteerRegistration:e.row});case Wh.TeamMembers:return(0,i.jsx)(xk,{column:e.column,volunteerRegistration:e.row});case Wh.VolunteerMinutes:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:s.minutesToHoursMinutesString(e.row.volunteerMinutes)});case Wh.VolunteerRegistrationState:return(0,i.jsx)(mk,{column:e.column,eventId:e.eventId,field:e.column,reload:e.reloadRow,state:e.row.state,updatable:e.row.canRegistrationStateUpdate??!0,volunteerRegistrationId:e.row.id});case Wh.WishedAccreditationSlots:return(0,i.jsx)(Ik,{column:e.column,volunteerRegistration:e.row,onClick:m(e.accreditationsPanelPath)?()=>{t.push(`${e.accreditationsPanelPath}/wished`)}:void 0});case Wh.WishedPositions:return(0,i.jsx)(vk,{column:e.column,volunteerRegistration:e.row,onClick:m(e.positionsPanelPath)?()=>{t.push(`${e.positionsPanelPath}/wished`)}:void 0});case Wh.WeezaccessChecklists:return(0,i.jsx)(_k,{column:e.column,volunteerRegistration:e.row});case Wh.WeezeventBarcodeId:return(0,i.jsx)(Gy,{column:e.column,volunteerRegistration:e.row});case Wh.WeezeventPairedAt:return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.weezeventPairedAt?.isValid?n.toLocaleString(e.row.weezeventPairedAt.toLocal(),Js.DateTime):""});case Wh.WeezeventShortTag:return(0,i.jsx)(nk,{column:e.column,volunteerRegistration:e.row});default:return Object.values(Wh).includes(e.column.slug)?(console.error(`003: Unhandled default column ${e.column.slug}`),(0,i.jsx)(Ec,{children:"ERR"})):e.column.slug.startsWith("form_inserted_at")?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:hy(n,e.column.slug,e.row.userInfo.formsUsersInfos||[])}):(0,i.jsx)(Dy,{column:e.column,customField:e.customField,fields:e.row.userInfo.fields,mutate:a,reload:e.reloadRow,updatable:e.row.userInfo.isEditable??!0})}},jk=({title:e,subtitle:t})=>(0,i.jsx)(Dc,{css:{height:"fit-content"},children:(0,i.jsx)(Ec,{children:(0,i.jsxs)(Na,{align:"center",css:{padding:"$8 0"},direction:"column",justify:"center",width:1,children:[(0,i.jsx)(Xj,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:e}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t})]})})}),Ck=L.createContext({}),yk=e=>{const{mutate:t}=jo(),{mutate:n}=ar(),[s,o]=L.useState(e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot)),r=L.useMemo(()=>s.map(({id:e})=>e),[s]),[a,l]=L.useState(e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>e.checkInAt?.isValid?[e.accreditationSlot]:[])),[d,c]=L.useState(e.volunteerRegistration.accreditationsSlots),u=L.useMemo(()=>(0,lc.A)((0,ph.A)(s.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[s]),h=L.useMemo(()=>(0,lc.A)((0,ph.A)(a.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[a]),m=L.useMemo(()=>(0,lc.A)((0,ph.A)(d.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[d]),g=L.useMemo(()=>(0,ph.A)(s.map(e=>e.accreditation),e=>e.id),[s]),p=L.useMemo(()=>(0,ph.A)(a.map(e=>e.accreditation),e=>e.id),[a]),f=L.useMemo(()=>(0,ph.A)(d.map(e=>e.accreditation),e=>e.id),[d]),x=L.useCallback(async n=>{await t({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:tt.Delete}}),o(e=>e.filter(e=>e.id!==n)),l(e=>e.filter(e=>e.id!==n))},[e.eventId,e.userInfoId,o,l]),_=L.useCallback(async t=>{await n({eventId:e.eventId,delegationId:e.delegationId,massAccredit:{accreditationsSlotsIds:[t],selecteds:{ids:[e.userInfoId]},strategy:tt.Delete}}),c(e=>e.filter(e=>e.id!==t))},[e.eventId,e.delegationId,e.userInfoId]),I=L.useCallback(async n=>{await t({eventId:e.eventId,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e.userInfoId]},strategy:tt.Add}});const i=d.find(e=>e.id===n);o(e=>[...e,i])},[e.eventId,e.volunteerRegistration,d,o]),v=L.useCallback(t=>e.volunteerRegistration.accreditationsUsersInfos.find(e=>e.accreditationSlot.id===t).checkInAt,[e.volunteerRegistration]);return(0,i.jsx)(Ck.Provider,{value:{assignedAccreditations:g,assignedCategories:u,assignedSlots:s,assignedSlotsIds:r,canAccredit:e.canAccredit,canEditWished:e.canEditWished,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,scannedCategories:h,scannedAccreditations:p,scannedSlots:a,wishedAccreditations:f,wishedCategories:m,wishedSlots:d,assignSlot:I,deleteAssignedSlot:x,deleteWishedSlot:_,getScannedAt:v},children:e.children})};function kk(){return L.useContext(Ck)}const Ak=e=>{const{translate:t}=_l(),n=qn(Kc),{assignedSlotsIds:s,assignSlot:o,canAccredit:r,canEditWished:a,defaultHiddenAccreditationsSlotsIds:l,deleteAssignedSlot:d,deleteWishedSlot:c,getScannedAt:u}=kk(),[h,m]=(0,L.useState)(!1);return"assigned"===e.state&&!e.isBlocked&&r?(0,i.jsx)(Na,{css:{flex:"1",px:"$4"},justify:"end",children:h?(0,i.jsx)(oc,{borderRadius:"$1",height:20,children:t("retirer_05155")}):(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{m(!0),await d(e.accreditationSlotId)},children:t("retirer_05155")})}):"wished"===e.state&&r?(0,i.jsx)(Na,{css:{flex:"1",px:"$4"},justify:"end",children:s.includes(e.accreditationSlotId)?(0,i.jsxs)(Na,{align:"center",gap:"1",children:[(0,i.jsx)(yr,{color:"success500",children:(0,i.jsx)(el,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(yr,{font:"gray800 textXs medium",children:t("d_j_attribu_e_06450")})]}):e.isBlocked?null:(0,i.jsx)(El,{isLoading:h,size:"sm",onClick:async()=>{m(!0),await o(e.accreditationSlotId),m(!1)},children:t("ajouter_97327")})}):"wished"!==e.state||!a||e.isBlocked||l.includes(e.accreditationSlotId)?"scanned"===e.state?(0,i.jsx)(Na,{css:{flex:"1",px:"$4"},children:(0,i.jsx)(yr,{css:{ellipsis:!0},children:n.toLocaleString(u(e.accreditationSlotId),Js.DateTime)})}):(0,i.jsx)(Na,{css:{flex:"1",px:"$4"}}):(0,i.jsx)(Na,{css:{flex:"1",px:"$4"},justify:"end",children:h?(0,i.jsx)(oc,{borderRadius:"$1",height:20,children:t("retirer_05155")}):(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"error700 textSm medium",onClick:async()=>{m(!0),await c(e.accreditationSlotId)},children:t("retirer_05155")})})},wk=e=>{const t=qn(Kc),{canAccredit:n,canEditWished:s}=kk(),o="assigned"===e.state&&n||"scanned"===e.state||"wished"===e.state&&(n||s),r=m(e.slot.name)?e.slot.name:"-";return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{css:{textTransform:"capitalize"},children:e.slot.date?t.toLocaleString(e.slot.date,Js.DateOnly.WeekdayShortMonthShort):"-"}),(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:r,width:1,children:r})}),o&&(0,i.jsx)(Ak,{accreditationSlotId:e.slot.id,isBlocked:e.slot.isBlocked,state:e.state})]})},Sk=e=>{const{translate:t}=_l(),{assignedSlots:n,canAccredit:s,canEditWished:o,scannedSlots:r,wishedSlots:a}=kk(),l=(0,L.useMemo)(()=>(0,lc.A)(("assigned"===e.state?n:"scanned"===e.state?r:a).filter(t=>t.accreditationId===e.accreditation.id),e=>[e.date?.toMillis()??1,e.name?.toLowerCase()||""]),[n,r,a,e.accreditation,e.state]),d="assigned"===e.state&&s||"scanned"===e.state||"wished"===e.state&&(s||o);return(0,i.jsx)(MC,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:e.accreditation.hasSlots,numberOfSlots:l.length,renderActions:!e.accreditation.hasSlots&&d?()=>(0,i.jsx)(Ak,{accreditationSlotId:e.accreditation.hiddenSlotId,isBlocked:!1,state:e.state}):void 0,children:(0,i.jsxs)(kc,{hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Vc,{children:t("nom_du_cr_neau_54351")}),d&&(0,i.jsx)(Vc,{children:"scanned"===e.state&&t("scann_e_le_27812")})]}),l.map(t=>(0,i.jsx)(wk,{slot:t,state:e.state},t.id))]})})},Ek=e=>{const{assignedAccreditations:t,scannedAccreditations:n,wishedAccreditations:s}=kk(),o=(0,L.useMemo)(()=>SC(("assigned"===e.state?t:"scanned"===e.state?n:s).filter(t=>t.accreditationCategoryId===e.category.id)),[t,s,e.category,e.state]);return(0,i.jsx)(DC,{category:e.category,children:o.map(t=>(0,i.jsx)(Sk,{accreditation:t,state:e.state},t.id))})},Tk=e=>{const t=Yn(),{assignedCategories:n,scannedCategories:s,wishedCategories:o}=kk(),r="assigned"===e.state?n:"scanned"===e.state?s:o;return(0,i.jsx)($C,{children:no(r)?r.map(t=>(0,i.jsx)(Ek,{category:t,state:e.state},t.id)):(0,i.jsx)(jk,{title:t("no_accreditations")})})},zk=e=>{const{translate:t}=_l();return(0,i.jsx)(yk,{canAccredit:e.canAccredit,canEditWished:e.canEditWished,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,userInfoId:e.userInfoId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(xu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yj,{children:t("accr_ditations_39450")}),(0,i.jsx)(_u,{css:{padding:"0"},children:(0,i.jsxs)(rj,{height:1,children:[(0,i.jsxs)(sj,{center:!0,children:[(0,i.jsx)(ij,{path:`${e.basePath}/assigned`,children:t("attribu_es_48167")}),(0,i.jsx)(ij,{path:`${e.basePath}/wished`,children:t("souhait_es_78101")}),(0,i.jsx)(ij,{path:`${e.basePath}/scanned`,children:t("scann_es_13169")})]}),(0,i.jsx)(oj,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(Tk,{state:"assigned"})}),(0,i.jsx)(oj,{path:`${e.basePath}/wished`,children:(0,i.jsx)(Tk,{state:"wished"})}),(0,i.jsx)(oj,{path:`${e.basePath}/scanned`,children:(0,i.jsx)(Tk,{state:"scanned"})})]})})]})})},Ok=e=>{const{translate:t,params:{organizationId:n}}=_l(),{mutate:s}=No(),[o,r]=(0,L.useState)(ge.CheckInOut),[a,l]=(0,L.useState)(e.positionSlotUserInfo.checkInAt?.toLocal()),[d,c]=(0,L.useState)(e.positionSlotUserInfo.checkOutAt?.toLocal()),[u,h]=(0,L.useState)(e.positionSlotUserInfo.breakTime),[m,g]=(0,L.useState)(!1),p=(0,L.useMemo)(()=>Qs(),[]),f=o===ge.Reset||a?.isValid&&d?.isValid&&d>a||a?.isValid&&!d?.isValid;return(0,i.jsx)(Rb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"sliders",children:t("mise_jour_du_76261")}),(0,i.jsxs)(Tb,{gap:"2",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(xc,{state:o===ge.CheckInOut?"checked":"unchecked",onClick:()=>{r(ge.CheckInOut)},children:t("mettre_jour_l_00128")}),o===ge.CheckInOut&&(0,i.jsxs)(Na,{css:{paddingBottom:"$3",paddingLeft:"$6"},gap:"6",children:[(0,i.jsx)(Nu,{hint:t("date_et_heure_d_93417"),rightIcon:"xmark",value:a,zone:p,onChange:l,onRightIconClick:()=>l(null)}),(0,i.jsx)(Nu,{hint:t("date_et_heure_d_65738"),rightIcon:"xmark",value:d,zone:p,onChange:c,onRightIconClick:()=>c(null)}),(0,i.jsx)(Nl,{css:{visibility:2723===n?"hidden":"visible"},hint:t("temps_de_pause_00051"),shouldParseAsInt:!0,value:u,onChange:h})]}),(0,i.jsx)(xc,{state:o===ge.Reset?"checked":"unchecked",onClick:()=>{r(ge.Reset)},children:t("remettre_z_ro_11572")})]}),(0,i.jsx)(Eb,{children:n=>(0,i.jsx)(El,{disabled:!f,isLoading:m,onClick:async()=>{g(!0),await s({eventId:e.positionSlotUserInfo.eventId,checkIn:{breakTime:u,checkInAt:a?.toUTC(),checkOutAt:d?.toUTC(),strategy:o,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),n()},children:t("mettre_jour_85141")})})]})})},Rk=e=>{const{translate:t}=_l(),{mutate:n}=No(),{mutate:s}=Xo(),[o,r]=L.useState(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{triggerElem:e.triggerElem,children:[e.canCheckIn&&(0,i.jsx)(Gd,{icon:"circle-check",onClick:()=>{r(!0)},children:t("mettre_jour_l_00128")}),e.canCheckIn&&e.psui.state!==me.Waiting&&(0,i.jsx)(Gd,{icon:"arrows-rotate",onClick:async()=>{await n({eventId:e.psui.eventId,checkIn:{strategy:ge.Reset,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reloadCheckIn(e.psui.id)},children:t("remettre_z_ro_11572")}),e.canDelete&&(0,i.jsx)(Gd,{color:"red",icon:"user-xmark",onClick:async()=>{await s({eventId:e.psui.eventId,massAssign:{positionsSlotsIds:[e.psui.positionSlot.id],selecteds:{ids:[e.psui.userInfoId]},strategy:tt.Delete}}),e.onDelete(e.psui.id)},children:t("d_saffecter_du_47122")})]}),(0,i.jsx)(Ok,{isOpen:o,positionSlotUserInfo:e.psui,onClose:()=>{e.reloadCheckIn(e.psui.id),r(!1)}})]})},$k=e=>{const{translate:t}=_l(),n=qn(Kc),s=qn(ep),o=qn(hh),{mutate:r}=No(),a=wc(),l=(0,L.useMemo)(()=>{const t=e.positionSlotUserInfo.positionSlot;return m(t.name)?`${t.name} - ${o.toDisplayString(t.range)}`:o.toDisplayString(t.range)},[e.positionSlotUserInfo.positionSlot]),d=()=>(0,i.jsxs)(Na,{align:"center",css:{padding:"$3","@tablet":{padding:"$3 $4"}},gap:"3",width:1,wrap:"wrap",children:[(0,i.jsx)(FC,{color:e.positionSlotUserInfo.position.color,icon:e.positionSlotUserInfo.position.icon}),(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray800",css:{fontWeight:"$medium",overflow:"hidden",textOverflow:"ellipsis","@tablet":{fontWeight:"$semiBold"}},children:e.positionSlotUserInfo.position.name}),(0,i.jsx)(yr,{color:"gray500",fontSize:"textSm",children:l})]})]});return(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs","@tablet":{borderRadius:"$2"}},direction:"column",width:1,children:[e.canCheckIn?(0,i.jsx)(Ja,{to:ps.POSITION({organizationId:e.positionSlotUserInfo.organizationId,eventId:e.positionSlotUserInfo.eventId,positionId:e.positionSlotUserInfo.position.id}),children:d()}):d(),(e.canCheckIn||e.canDelete)&&(0,i.jsxs)(Na,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$3","@tablet":{padding:"$3 $4"}},justify:"between",width:1,children:[e.positionSlotUserInfo.state===me.CheckedOut?(0,i.jsx)(ic,{leftIcon:"clock",children:t("temps_total_79448",s.minutesToHoursMinutesString(e.positionSlotUserInfo.timeDifferenceMinutes))}):e.positionSlotUserInfo.state===me.CheckedIn?(0,i.jsx)(ic,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("point_le_1_63576",n.toLocaleString(e.positionSlotUserInfo.checkInAt.toLocal(),a?Js.ShortDateTime:Js.DateTime))}):(0,i.jsx)(ic,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("non_point_42145")}),(0,i.jsxs)(Na,{gap:"3",children:[e.canCheckIn&&e.positionSlotUserInfo.state===me.Waiting&&(0,i.jsx)(El,{size:"sm",onClick:async()=>{await r({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:ge.CheckIn,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:t("pointer_80927")}),e.canCheckIn&&e.positionSlotUserInfo.state===me.CheckedIn&&(0,i.jsx)(El,{color:"white",size:"sm",onClick:async()=>{await r({eventId:e.positionSlotUserInfo.eventId,checkIn:{strategy:ge.CheckOut,positionsSlotsUsersInfosIds:[e.positionSlotUserInfo.id]}}),e.reloadCheckIn(e.positionSlotUserInfo.id)},children:t("d_pointer_25328")}),(0,i.jsx)(Rk,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,psui:e.positionSlotUserInfo,reloadCheckIn:e.reloadCheckIn,triggerElem:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",rightIcon:"ellipsis-vertical",size:"sm"})}),onDelete:e.onDelete})]})]})]})},Dk=L.createContext({}),Pk=e=>{const{data:t}=Lo({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.volunteerRegistration.userInfo.id}),[n,s]=L.useState(e.volunteerRegistration.positionsSlotsUsersInfos),o=L.useMemo(()=>(0,lc.A)((0,ph.A)(n.map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[n]),r=L.useCallback(e=>{s(t=>t.filter(t=>t.id!==e))},[s]),a=L.useCallback(async t=>{const i=n.find(e=>e.id===t),{event:{volunteerRegistration:{positionSlotUserInfo:o}}}=await(r={eventId:e.eventId,volunteerRegistrationId:e.volunteerRegistration.id,positionSlotId:i.positionSlot.id},a=await K(),ho("query PositionSlotUserInfo(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n $positionSlotId: PositionsSlotId!\n) {\n event(id: $eventId) {\n volunteerRegistration(id: $volunteerRegistrationId) {\n positionSlotUserInfo(positionSlotId: $positionSlotId) {\n ...UserPositionSlotUserInfo\n }\n }\n }\n}\n",{variables:r,token:a||void 0,fragments:[Ls.UserPositionSlotUserInfoFragment]}));var r,a;s(e=>e.map(e=>e.id===t?o:e))},[e.eventId,e.volunteerRegistration,n,s]);return(0,i.jsx)(Dk.Provider,{value:{assignedCategories:o,assignedPsuis:n,canCheckIn:e.canCheckIn,canDelete:e.canDelete,formsUsersInfos:t.organization?.userInfo.formsUsersInfos??[],onAssignedPsuiDelete:r,reloadCheckIn:a},children:e.children})};function Fk(){return L.useContext(Dk)}const Mk=()=>{const{assignedCategories:e,assignedPsuis:t,canCheckIn:n,canDelete:s,onAssignedPsuiDelete:o,reloadCheckIn:r}=Fk(),a=(0,L.useMemo)(()=>(0,ac.A)(t,e=>e.positionCategory.id),[t]);return(0,i.jsx)($C,{children:e.map(e=>{const t=a[e.id];return(0,i.jsx)(DC,{category:e,children:t.map(e=>(0,i.jsx)($k,{canCheckIn:"function"==typeof n?n(e.positionCategoryId,e.position.id):n,canDelete:s(e.positionCategoryId,e.position.id),positionSlotUserInfo:e,reloadCheckIn:r,onDelete:o},e.id))},e.id)})})},Nk=e=>(0,i.jsxs)(Na,{align:"center",css:e.css,direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(yr,{css:{inlineSize:"70%","@tablet":{inlineSize:"50%",blockSize:"auto",maxInlineSize:"100px"}},children:(0,i.jsx)("img",{alt:"Blank image",className:"blank-image",height:"100%",src:e.imageSrc??pd.WeezeventBlankPerson,width:"100%"})}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{css:{color:"$gray800",fontSize:"$textMd",fontWeight:"$semiBold","@tablet":{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}},textAlign:"center",children:e.title}),m(e.subtitle)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{color:"gray500",fontSize:"textSm",textAlign:"center",children:e.subtitle})]}),e.button&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Na,{justify:"center",children:e.button})]})]});function Lk(e,t,n,i){return(0,lc.A)(e.map(e=>{const s=e.positions.map((s,o)=>({name:s.name,range:s.range?t.toDisplayString(s.range):"-",path:ps.POSITION({organizationId:n,eventId:i,positionId:s.id}),form:e.form,rank:o+1})),o=e.positionsCategories.map((s,o)=>({name:s.name,range:s.range?t.toDisplayString(s.range):"-",path:ps.POSITION_CATEGORY({organizationId:n,eventId:i,positionCategoryId:s.id}),form:e.form,rank:o+1})),r=e.positionsSlots.map(t=>({name:t.position.name,range:t.nameOrRange,path:ps.POSITION({organizationId:n,eventId:i,positionId:t.position.id}),form:e.form,rank:-1}));return s.concat(o).concat(r)}).flat(),[e=>e.form.name,(e,t)=>t])}const Bk=({message:e,title:t})=>(0,i.jsxs)(sl,{color:"warning",leftIcon:"triangle-exclamation",children:[(0,i.jsx)(Na,{css:{fontWeight:"$medium"},direction:"column",children:t}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Na,{css:{fontWeight:"normal"},children:e})]}),Vk=({editDisabled:e,editPath:t,eventId:n,form:s,organizationId:o,userInfoId:r})=>{const a=Qn();return(0,i.jsx)(ic,{color:"primary",cursor:e?"default":"pointer",onContentClick:()=>{e||a.push(t?n?t(o,r,n,s.id):t(o,r,s.id):Ni.FORM({organizationId:o,eventId:n??void 0,formId:s.id}))},children:s.name})},Uk=({editFormPath:e,editPath:t,formsUsersInfos:n,isEditDisabled:s=!1})=>{const{history:o,params:{organizationId:r,eventId:a,userInfoId:l},translate:d}=_l(),c=qn(hh),u=(0,L.useMemo)(()=>Lk(n,c,r,a),[n]),h=wc();return(0,i.jsxs)(Na,{direction:"column",gap:"6",width:1,children:[s&&(0,i.jsx)(Bk,{message:d("you_are_already_assigned_to_missions"),title:d("wished_positions_can_no_longer_be_changed")}),(0,i.jsx)(Fc,{filters:m(t)&&(0,i.jsx)(El,{color:"white",disabled:s,size:"sm",to:t,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:d("nom_de_la_missi_64605")}),!h&&(0,i.jsx)(Vc,{children:d("Date")}),!h&&(0,i.jsx)(Vc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:no(u)?u.map((t,n)=>(0,i.jsxs)(Dc,{children:[(0,i.jsxs)(Ec,{align:"start",css:{color:"$gray800",fontWeight:"$medium",fontSize:"$textSm"},direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(yr,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{o.push(t.path)},children:t.name}),t.form.positionRanking===He.Ranked&&(0,i.jsx)(yr,{color:"gray500",children:d("choix_n_1_00613",t.rank)}),h&&(0,i.jsx)(yr,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:t.range})]}),!h&&(0,i.jsx)(Ec,{children:t.range}),!h&&(0,i.jsx)(Ec,{children:(0,i.jsx)(Vk,{editDisabled:s,editPath:e,eventId:a,form:t.form,organizationId:r,userInfoId:l})})]},n)):(0,i.jsx)(Dc,{css:{height:"200px"},children:(0,i.jsx)(Ec,{children:(0,i.jsx)(Nk,{title:d("aucune_mission_61179")})})})}),setOffset:Ql.A,title:d("missions_souhai_23225"),totalCount:0})]})},Wk=()=>{const{formsUsersInfos:e}=Fk();return(0,i.jsx)(Na,{css:{background:"$gray50",padding:"$6"},height:1,width:1,children:(0,i.jsx)(Uk,{formsUsersInfos:e})})},Gk=e=>{const{translate:t}=_l();return(0,i.jsx)(Pk,{canCheckIn:e.canCheckIn,canDelete:e.canDelete,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsxs)(xu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yj,{children:t("missions_63972")}),(0,i.jsx)(_u,{css:{padding:"0"},children:(0,i.jsxs)(rj,{height:1,children:[(0,i.jsxs)(sj,{center:!0,children:[(0,i.jsx)(ij,{path:`${e.basePath}/assigned`,children:t("attribu_es_48167")}),(0,i.jsx)(ij,{path:`${e.basePath}/wished`,children:t("souhait_es_78101")})]}),(0,i.jsx)(oj,{path:`${e.basePath}/assigned`,children:(0,i.jsx)(Mk,{})}),(0,i.jsx)(oj,{path:`${e.basePath}/wished`,children:(0,i.jsx)(Wk,{})})]})})]})})},Hk=L.createContext({}),qk=e=>{const{data:t,loader:n}=Zn("query TeamRightPanel($eventId: EventId!, $teamCode: TeamCode!) {\n event(id: $eventId) {\n team(teamCode: $teamCode) {\n form {\n name\n }\n\n members {\n ...UserInfoTeamRightPanel\n }\n }\n }\n}\n",{eventId:e.eventId,teamCode:e.teamCode},[Ls.UserInfoTeamRightPanelFragment]);const{mutate:s}=Xo(),[o,r]=L.useState([]),a=L.useMemo(()=>{const e=o.flatMap(e=>e.positionsCategories.flatMap(e=>e.positions.flatMap(e=>e.slots.map(t=>({...t,position:(0,wr.A)(e,["id","name","icon","color"])}))))),t=o.flatMap(e=>e.positions.flatMap(e=>e.slots.map(t=>({...t,position:(0,wr.A)(e,["id","name","icon","color"])})))),n=o.flatMap(e=>e.positionsSlots);return(0,ph.A)(e.concat(t).concat(n),e=>e.id)},[o]),l=L.useMemo(()=>(0,ph.A)(o.flatMap(e=>e.positionsSlotsUsersInfos.map(e=>({...e.positionSlot,position:e.position}))),e=>e.id),[o]),d=L.useMemo(()=>(0,lc.A)((0,ph.A)(a.concat(l),e=>e.id),e=>[e.position.name.toLowerCase(),e.range.start.toMillis()]),[a,l]),c=L.useMemo(()=>Object.fromEntries(o.map(e=>{const t=(0,Ns.A)(e.positionsCategories.flatMap(e=>e.positions.flatMap(e=>e.slots.map(e=>e.id))).concat(e.positions.flatMap(e=>e.slots.map(e=>e.id))).concat(e.positionsSlots.map(e=>e.id)));return[e.userInfo.id,t]})),[o]),u=L.useMemo(()=>Object.fromEntries(o.map(e=>{const t=e.positionsSlotsUsersInfos.map(e=>e.positionSlot.id);return[e.userInfo.id,t]})),[o]),h=L.useCallback(async(t,n)=>{await s({eventId:e.eventId,massAssign:{positionsSlotsIds:[n],selecteds:{ids:[t]},strategy:tt.Add}});const{event:i}=await function(e,t){return ho("query TeamRightPanelMember($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...UserInfoTeamRightPanel\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.UserInfoTeamRightPanelFragment]})}({eventId:e.eventId,userInfoId:t},await K());r(e=>e.map(e=>e.userInfo.id===t?i.volunteerRegistration:e))},[e.eventId,r]);return L.useEffect(()=>{r(t.event?.team?.members??[])},[t.event,r]),(0,i.jsx)(Hk.Provider,{value:{allSlots:d,form:t.event?.team?.form,loader:n,memberIdToAssignedSlotsIds:u,memberIdToWishedSlotsIds:c,members:o,assign:h},children:e.children})};function Yk(){return L.useContext(Hk)}const Kk=e=>{const{translate:t}=_l(),{assign:n,memberIdToAssignedSlotsIds:s,memberIdToWishedSlotsIds:o}=Yk(),[r,a]=(0,L.useState)(!1),l=s[e.member.userInfo.id].includes(e.slot.id),d=o[e.member.userInfo.id].includes(e.slot.id);return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(uj,{size:32,userInfo:e.member.userInfo})}),(0,i.jsx)(Ec,{justify:"end",children:l?(0,i.jsxs)(Na,{align:"center",gap:"1",children:[(0,i.jsx)(yr,{color:"success500",children:(0,i.jsx)(el,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(yr,{font:"gray800 textXs medium",children:t("d_j_affect_71706")})]}):d?(0,i.jsx)(El,{isLoading:r,size:"sm",onClick:()=>{a(!0),n(e.member.userInfo.id,e.slot.id)},children:t("affecter_94255")}):(0,i.jsxs)(Na,{align:"center",gap:"1",children:[(0,i.jsx)(yr,{color:"error500",children:(0,i.jsx)(el,{icon:"circle-xmark",iconStyle:"solid"})}),(0,i.jsx)(yr,{font:"gray800 textXs medium",children:t("non_souhait_46147")})]})})]})},Zk=e=>{const{translate:t}=_l(),{members:n}=Yk(),s=qn(hh),o=(0,L.useMemo)(()=>vh(s,e.slot,e.slot.position.name,{slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Na,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Na,{css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(FC,{color:e.slot.position.color,icon:e.slot.position.icon}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:e.slot.position.name}),(0,i.jsx)(yr,{color:"gray500",children:o})]})]}),(0,i.jsxs)(kc,{hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:t("full_name")}),(0,i.jsx)(Vc,{})]}),n.map(t=>(0,i.jsx)(Kk,{member:t,slot:e.slot},t.userInfo.id))]})]})},Xk=()=>{const{allSlots:e}=Yk();return(0,i.jsx)(Na,{direction:"column",gap:"3",width:1,children:e.map(e=>(0,i.jsx)(Zk,{slot:e},e.id))})},Jk=e=>{const{translate:t}=_l(),{form:n,loader:s}=Yk();return(0,i.jsxs)(xu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yj,{children:(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{children:t("_quipe_1_19590",e.teamCode)}),(0,i.jsx)(yr,{color:"gray500",fontSize:"textSm",children:t("formulaire_1_39637",n?.name)})]})}),(0,i.jsx)(_u,{css:{background:"$gray50",py:"$6"},children:s||(0,i.jsx)(Xk,{})})]})},Qk=e=>(0,i.jsx)(qk,{eventId:e.eventId,teamCode:e.teamCode,children:(0,i.jsx)(Jk,{...e})}),eA=({editFormPath:e,editPath:t,eventId:n,organizationId:s,formsUsersInfos:o,showEditButton:r,userInfoId:a,isEditDisabled:l=!1})=>{const{translate:d}=_l(),c=qn(Kc),u=qn(hh),h=(0,L.useMemo)(()=>(0,lc.A)(o.flatMap(e=>e.slots.map(t=>({range:t.range,display:e.form.slotDisplay,form:e.form}))),({range:e})=>e.start.toMillis()),[o]),m=wc(),g=(0,L.useCallback)((e,t)=>{switch(t){case xt.Calendar:case xt.DisplayDays:return(0,i.jsx)(yr,{children:c.toLocaleString(e.start,Js.DateOnly.MonthLong)});case xt.Display:case xt.Custom:return(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{css:{lineHeight:"20px"},children:u.toDisplayString(e,{hideTime:!0})}),(0,i.jsx)(yr,{color:"gray500",css:{fontWeight:400,lineHeight:"20px"},fontSize:"textSm",children:u.toDisplayString(e,{hideDate:!0})})]});case xt.Hide:return null;default:return rl()}},[]);return(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[l&&(0,i.jsx)(Bk,{message:d("you_are_already_assigned_to_missions"),title:d("availabilities_can_no_longer_be_changed")}),(0,i.jsx)(Fc,{filters:r&&(0,i.jsx)(El,{color:"white",disabled:l,size:"sm",to:t,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:d("Date")}),!m&&(0,i.jsx)(Vc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:no(h)?h.map((t,o)=>(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:g(t.range,t.display)}),!m&&(0,i.jsx)(Ec,{children:(0,i.jsx)(Vk,{editDisabled:l,editPath:e,eventId:n,form:t.form,organizationId:s,userInfoId:a})})]},o)):(0,i.jsx)(Dc,{css:{height:"200px"},children:(0,i.jsx)(Ec,{children:(0,i.jsx)(Nk,{title:d("aucune_disponib_15602")})})})}),setOffset:Ql.A,title:d("disponibilit_s_49923"),totalCount:0})]})},tA=e=>{const t=Yn(),{data:n,loader:s}=Yo({organizationId:e.organizationId,eventId:e.eventId,userInfoId:e.userInfoId}),{permissions:[o],isLoading:r}=ck(ok({eventId:e.eventId,userInfoId:e.userInfoId}));return(0,i.jsxs)(xu,{returnToFallback:e.returnPathFallback,size:"md",children:[(0,i.jsx)(yj,{children:t("disponibilit_s_49923")}),(0,i.jsx)(_u,{children:s||r?s:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(eA,{editFormPath:(t,n,i,s)=>location.host.startsWith("app.")?$s.EDIT_USER_SLOTS_FORM(t,i,n,s):e.delegationId?ds.MEMBER_EDIT({organizationId:t,userInfoId:n,delegationId:e.delegationId,eventId:i,formId:s}):qI.MEMBER_FORM_EDIT({organizationId:t,userInfoId:n,eventId:i,formId:s}),editPath:$s.EDIT_USER_SLOTS(e.organizationId,e.eventId,e.userInfoId),eventId:e.eventId,formsUsersInfos:n.organization.userInfo.formsUsersInfos,organizationId:e.organizationId,showEditButton:o,userInfoId:e.userInfoId}),(0,i.jsx)(qa,{height:"6"})]})})]})},nA=e=>{const{history:t}=_l();return(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:e.accreditationsPanelPath,children:(0,i.jsx)(zk,{basePath:e.accreditationsPanelPath,canAccredit:e.canAccredit,canEditWished:e.canEditWishedAccreditations,defaultHiddenAccreditationsSlotsIds:e.defaultHiddenAccreditationsSlotsIds,delegationId:e.delegationId,eventId:e.eventId,userInfoId:e.volunteerRegistration.userInfo.id,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})}),(0,i.jsx)(Ar.qh,{path:e.availabilitiesPanelPath,children:(0,i.jsx)(tA,{delegationId:e.delegationId,eventId:e.eventId,organizationId:e.organizationId,returnPathFallback:e.availabilitiesPanelPath,userInfoId:e.volunteerRegistration.userInfo.id})}),(0,i.jsx)(Ar.qh,{path:e.positionsPanelPath,children:(0,i.jsx)(Gk,{basePath:e.positionsPanelPath,canCheckIn:e.canCheckIn,canDelete:e.canDeletePosition,eventId:e.eventId,organizationId:e.organizationId,volunteerRegistration:e.volunteerRegistration,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})}),(e.teamsPanelsPath||[]).map((n,s)=>(0,i.jsx)(Ar.qh,{path:n,children:(0,i.jsx)(Qk,{eventId:e.eventId,teamCode:(e.volunteerRegistration.teams||[])[s].teamCode,onClose:()=>{e.reloadRow(),t.goBack(e.returnPathFallback)}})},s))]})};function iA(e,t){return 0===e.length||e.includes(t)}const sA=e=>{const t=Yn(),[n,s]=L.useState(!1),o=L.useCallback(async()=>{let t=!0;return s(!0),await e.onDelete(),t&&s(!1),()=>{t=!1}},[e.onDelete,n,s]);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Na,{align:"center",css:{background:"$error100",borderRadius:"48px",color:"$error600",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(el,{icon:"circle-exclamation",iconStyle:"light"})})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray900 textLg regular",textAlign:"center",title:e.text,children:e.text}),"subtext"in e&&to(e.subtext).map((e,t)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:e})]},t)),"children"in e&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{color:"gray500",css:{alignSelf:"center"},children:e.children})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{color:"error",isLoading:n,onClick:o,children:e.buttonText}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},oA=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=_l(),{mutate:r}=Ko(),{mutate:a}=Fo(),{mutate:l}=Vo(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1),m=(0,L.useMemo)(()=>e.customDocuments.filter(t=>iA(t.populationsIds,e.member.fields.population)),[e.customDocuments,e.member]),g=s&&e.canAccredit&&e.accreditationState===le.WaitingAccreditation,p=s&&e.showDocumentsDownload&&void 0!==e.member.links&&no(e.allowedCustomDocuments);return g||p||e.canDelete||e.showDeleteFromEvent?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gd,{icon:"check",onClick:async()=>{await r({eventId:s,delegationId:o,usersInfosIds:[e.member.id]}),e.reload()},children:t("valider_les_acc_80801")}),(0,i.jsx)(Gd,{icon:"badge-check",to:$s.ACCREDIT(n,s,e.member.id),children:t("accr_diter_70543")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"})]}),p&&(0,i.jsx)(i.Fragment,{children:no(e.allowedCustomDocuments)&&(0,i.jsx)(i.Fragment,{children:e.allowedCustomDocuments.map((n,s)=>{const o=m.find(e=>e.slug===n);return o?(0,i.jsx)(Gd,{download:`${e.member.nameOrEmail}-${o.name}`,icon:"arrow-down-to-bracket",target:"_blank",to:ug(e.member.links?.userCustomDocumentLinks[n],"pdf"),children:t("t_l_charger_1_80752",o.name)},s):en.includes(n)?(0,i.jsx)(Gd,{download:`${e.member.nameOrEmail}-custom-badge`,icon:"arrow-down-to-bracket",target:"_blank",to:ug(e.member.links?.userCustomBadgeLinks[n],"pdf"),children:t("t_l_charger_1_80752",P_(n))},s):null})})}),p&&e.canDelete&&(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),e.canDelete&&(0,i.jsx)(Gd,{color:"red",icon:"user-xmark",onClick:()=>c(!0),children:t("retirer_de_la_d_64963")}),e.showDeleteFromEvent&&(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>h(!0),children:t("delete_from_eve_69290")})]}),d&&(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_sur_d_88752")],text:t("suppression_de_73669",e.member.nameOrEmail),onClose:()=>c(!1),onDelete:async()=>{await a({organizationId:n,eventId:s,delegationId:o,selecteds:{ids:[e.member.id]},deleteFromEvent:e.deleteFromEvent}),e.reload()}}),u&&e.volunteerRegistrationId&&(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:[t("are_you_sure_yo_46668")],text:t("suppression_de_73669",e.member.nameOrEmail),onClose:()=>h(!1),onDelete:async()=>{await l({eventId:s,selecteds:{ids:[e.member.id]}}),e.reload()}})]}):null};function rA(e,t){switch(t){case ve.Accreditation:return e("accr_ditations_39450");case ve.Delegation:return e("d_l_gations_78318");case ve.Event:return e("Event");case ve.Position:return e("missions_63972");case ve.UserInfo:return e("membres_11310");default:return rl()}}function aA(e){return m(e.label)?`${e.name} (${e.label})`:e.name}const lA=({displayName:e,isAddDeleteVisible:t,isResetVisible:n,massEditFieldInput:s,reset:o,strategy:r,change:a})=>{const{translate:l}=_l();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray700 textSm medium",children:l("que_souhaitez_v_87607")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(xc,{state:o||r!==tt.Replace?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",tt.Replace)},children:l("remplacer_les_v_78885")}),!o&&r===tt.Replace&&s,(0,i.jsx)(qa,{height:"3"}),t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:o||r!==tt.Add?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",tt.Add)},children:l("ajouter_des_val_80159")}),!o&&r===tt.Add&&s,(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:o||r!==tt.Delete?"unchecked":"checked",onClick:()=>{a("massEdit.reset",!1),a("massEdit.strategy",tt.Delete)},children:l("supprimer_des_v_96120")}),!o&&r===tt.Delete&&s,(0,i.jsx)(qa,{height:"3"})]}),n&&(0,i.jsx)(xc,{state:o?"checked":"unchecked",onClick:()=>a("massEdit.reset",!0),children:l("r_initialiser_42983",e)})]})},dA=e=>{const t=Yn(),n=(0,L.useMemo)(()=>(0,lc.A)(e.customFields??[],e=>e.name.toLowerCase()),[e.customFields]),s=(0,L.useMemo)(()=>(0,lc.A)(n.map(e=>({slug:e.slug,name:e.name,label:e.label})).concat(e.properties.map(e=>({slug:e,name:t(e),label:null}))),e=>e.name.toLowerCase()),[n,e.properties]);return(0,i.jsx)(su,{size:"md",onClose:e.onClose,children:(0,i.jsx)(Ua.lV,{initialValues:{massEdit:{reset:!1,selecteds:e.selecteds,slug:"",value:"",strategy:tt.Replace}},initialValuesEqual:Pr.A,render:({form:o,handleSubmit:r,submitting:a,values:l})=>{const{reset:d,slug:c,strategy:u}=l.massEdit,h=s.find(e=>e.slug===c),g=n.find(e=>e.slug===c),p=m(c)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(qj,{campaigns:e.campaigns,categories:e.categories,change:o.change,customDocuments:e.customDocuments,customField:g,forms:e.forms,name:"massEdit.value",slug:c,tags:e.tags,traces:e.traces,value:l.massEdit.value})})]}):null,f=c===se.Tag||c===be.Campaigns||c===be.Documents||!0===g?.canSelectMultiple,x=c!==se.Category&&c!==_e.Category&&c!==be.Category&&c!==rt.Category&&c!==se.WeezeventIsSynchronized&&c!==_e.Privacy&&c!==be.Form&&c!==be.IsLocked&&c!==be.ShowFormLinkInDelegationSpace&&c!==be.ShowInDelegationSpace&&c!==be.CanLeadersAddMembers&&c!==be.CanLeadersEditCustomFields&&c!==be.CanLeadersEditMembers&&c!==be.CanLeadersDeleteMembers&&c!==be.CanLeadersEditColumns&&c!==be.CanLeadersImportMembers&&c!==be.CanLeadersSeeHiddenAccreditationsSlots;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("_dition_de_la_v_67585")}),(0,i.jsx)(qa,{height:"7"}),e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1})]}):(0,i.jsx)(Um,{isSearchVisible:!0,label:t("quel_est_le_cha_81138"),name:"massEdit.slug",placeholder:t("s_lectionnez_un_82446"),children:s.map(e=>(0,i.jsx)("option",{value:e.slug,children:aA(e)},e.slug))}),h&&(0,i.jsx)(lA,{change:o.change,displayName:h.name,isAddDeleteVisible:f,isResetVisible:x,massEditFieldInput:p,reset:d,strategy:u}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{disabled:(_=l.massEdit,I=g,!(_.reset||!I||I.fieldType!==Ve.Select||I.canSelectMultiple||"number"==typeof _.value&&!isNaN(_.value))),isLoading:a,onClick:r,children:t("modifier_la_val_07602")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]});var _,I},onSubmit:async t=>{const n=(await e.mutate(t.massEdit)).numberOfEdited;e.onSuccess(n),e.onClose()}})})},cA=e=>{const{data:t,isLoading:n}=Zn("query PositionsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Position, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n positionsCategories {\n id\n name\n }\n\n traces {\n id\n name\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Ls.MassEditCustomFieldFragment]);const s=(0,L.useMemo)(()=>jn.filter(e=>e!==rt.Name),[]);return(0,i.jsx)(dA,{campaigns:[],categories:t.event?.positionsCategories??[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:t.event?.traces??[],onClose:e.onClose,onSuccess:e.onSuccess})},uA=e=>{const{data:t,isLoading:n}=Zn("query AccreditationsMassEditInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Accreditation, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[Ls.MassEditCustomFieldFragment]);const s=(0,L.useMemo)(()=>Kt.filter(e=>e!==se.Name),[]);return(0,i.jsx)(dA,{campaigns:[],categories:t.event?.accreditationsCategories??[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:s,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},hA=e=>{const{data:t,isLoading:n}=(s={organizationId:e.organizationId},Zn(go,s,[]));var s;const o=(0,L.useMemo)(()=>tn.filter(e=>e!==_e.Label&&e!==_e.Name),[]);return(0,i.jsx)(dA,{campaigns:[],categories:t.organization?.customFieldsCategories.nodes??[],customDocuments:[],customFields:[],forms:[],isLoading:n,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},mA=e=>{const{data:t,isLoading:n}=(s={organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?it.Event:it.Organization},Zn(po,s,[Ls.MassEditCustomFieldFragment]));var s;const o=(0,L.useMemo)(()=>sn.filter(e=>e!==be.Name&&e!==be.Columns),[]);return(0,i.jsx)(dA,{campaigns:t.organization?.campaigns.nodes??[],categories:t.organization?.delegationsCategories.nodes??[],customDocuments:t.organization?.event?.customDocuments??[],customFields:t.organization?.customFields.nodes??[],forms:t.organization?.forms.nodes??[],isLoading:n,mutate:e.mutate,properties:o,selecteds:e.selecteds,tags:t.organization?.tags.nodes??[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},gA=e=>{const{data:t,isLoading:n}=Zn("query UsersInfosMassEditInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n }\n}\n",{organizationId:e.organizationId},[Ls.MassEditCustomFieldFragment]);return(0,i.jsx)(dA,{campaigns:[],categories:[],customDocuments:[],customFields:t.organization?.customFields.nodes??[],forms:[],isLoading:n,mutate:e.mutate,properties:[],selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess})},pA=e=>(0,i.jsx)(dA,{campaigns:[],categories:[],customDocuments:[],customFields:e.customFields,forms:[],isLoading:!1,mutate:e.mutate,properties:[],selecteds:e.selecteds,tags:[],traces:[],onClose:e.onClose,onSuccess:e.onSuccess});let fA=class extends Ul{translationService;constructor(e){super(e),this.translationService=e}massAccreditStep1Schema(){return d.Ik().shape({massAccredit:d.Ik().shape({...this.massAccreditStep1Fields()})})}massAccreditStep2Schema(){return d.Ik().shape({massAccredit:d.Ik().shape({...this.massAccreditStep2Fields()})})}massAccreditSchema(){return d.Ik().shape({...this.massAccreditStep1Fields(),...this.massAccreditStep2Fields()})}massAccreditStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(vn,this.t("la_strat_gie_es_82287"))}}massAccreditStep2Fields(){return{accreditationsSlotsIds:d.YO().of(d.ai()).required(this.t("vous_devez_s_le_72138")).min(1,this.t("vous_devez_s_le_72138"))}}};fA=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],fA);const xA=e=>(0,Ht.createPortal)((0,i.jsx)(yr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"50",...e.css},height:1,width:1,children:e.children}),document.body),_A=e=>{const t=Yn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"massAccredit.strategy",value:tt.Add,children:t("ajouter_des_acc_17744")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"massAccredit.strategy",value:tt.Replace,children:t("remplacer_les_a_92733")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"massAccredit.strategy",value:tt.Delete,children:t("supprimer_des_a_04246")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:e.handleSubmit,children:t("suivant_accr_25709")})})]})};var IA=n(9120);const vA=e=>(0,lc.A)(e,e=>e.toMillis()),bA=pr("div",{alignItems:"center",borderRadius:"$2",color:"$gray400",display:"flex",fontWeight:"$medium",height:"32px",justifyContent:"center",userSelect:"none",width:"32px",variants:{isSelectable:{true:{color:"$gray800",cursor:"pointer","&:hover":{background:"$primary700",color:"white"}}},isSelected:{true:{background:"$primary700",color:"white",cursor:"pointer"}}},compoundVariants:[{isSelectable:!0,isSelected:!0,css:{background:"$primary700",color:"white",cursor:"pointer"}}]}),jA=({disabledDates:e,firstDayOfMonth:t,max:n,min:s,onChange:o,startHour:r,values:a})=>{const l=Yn(),d=qn(Kc),c=(0,L.useMemo)(()=>t.minus({day:t.weekday-1}),[t]),u=(0,L.useMemo)(()=>t.endOf("month"),[t]),h=(0,L.useMemo)(()=>{const e=u.plus({day:7-u.weekday});return Math.ceil(e.diff(c,"days").days)},[u]),m=(0,L.useMemo)(()=>(0,Oc.A)(0,h).map(i=>{const o=c.plus({day:i}).set({hour:r||0}),l=o.toMillis(),d=a.some(e=>e.toMillis()===l),u=!!no(e)&&e.some(e=>e.toMillis()===l);return{day:o,isSelected:d,isDisabled:u,isSelectable:!u&&o.month===t.month&&o>=s&&o<=n}}),[c,h,a,e,r]),g=(0,L.useMemo)(()=>!m.some(({isSelectable:e,isSelected:t})=>e&&!t),[m]),p=(0,L.useCallback)(()=>{o(g?[]:m.flatMap(({day:e,isSelectable:t,isSelected:n})=>t||n?[e]:[]))},[m,g,o]);return(0,i.jsxs)(Na,{css:{background:"white",bd:!0,padding:"$5 $4"},direction:"column",children:[(0,i.jsx)(yr,{css:{textTransform:"capitalize"},font:"gray800 textXl semiBold",textAlign:"center",width:1,children:d.toLocaleString(t,{month:"long",year:"numeric"})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(cd,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:(0,Oc.A)(0,7).map(e=>{const t=c.plus({day:e});return(0,i.jsx)(yr,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",width:32,children:d.toLocaleString(t,{weekday:"short"})},e)})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(cd,{gap:"2",gridtemplatecolumns:"repeat(7, 32px)",gridtemplaterows:"auto",children:m.map(({day:e,isSelected:t,isSelectable:n},s)=>(0,i.jsx)(bA,{isSelectable:n,isSelected:t,onClick:i=>{if(n&&t)o(vA((0,IA.A)(a,[e],e=>e.toMillis())));else if(n&&!t){const t=a.findLast(t=>tt.plus({day:e+1}));o(vA([...a,...i]))}else o(vA([...a,e]))}},children:e.day},s))}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(El,{color:"white",textAlign:"center",onClick:p,children:l(g?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")})]})},CA=e=>{const{minDate:t,maxDate:n,numberOfMonths:s,totalDaysDiff:o}=(0,L.useMemo)(()=>$h(e.slots),[e.slots]),r=(0,L.useMemo)(()=>e.slots.flatMap(t=>t.date?.isValid&&e.accreditationsSlotsIds.includes(t.id)?[t.date]:[]),[e.slots,e.accreditationsSlotsIds]),a=(0,L.useMemo)(()=>(0,Oc.A)(0,o).flatMap(n=>{const i=t.plus({day:n});return e.slots.some(e=>e.date?.isValid&&e.date.toMillis()===i.toMillis())?[]:[i]}),[t,o,e.slots]);return(0,i.jsx)(Na,{gap:"4",wrap:"wrap",children:(0,Oc.A)(0,s).map(o=>{const l=t.plus({month:o}).startOf("month"),d=0===o?t:l,c=o===s-1?n:l.endOf("month"),u=r.filter(e=>e.startOf("month").equals(l));return(0,i.jsx)(jA,{disabledDates:a,firstDayOfMonth:l,max:c,min:d,values:u,onChange:t=>{e.change(`${e.prefix}accreditationsSlotsIds`,Dh(e.accreditationsSlotsIds,e.slots,l,t))}},o)})})},yA=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>e.slots.filter(e=>e.date?.isValid),[e.slots]);return no(n)?(0,i.jsx)(CA,{...e,slots:n}):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})},kA=e=>{const{translate:t}=_l(),n=qn(xv),s=(0,L.useMemo)(()=>CC(e.accreditation),[e.accreditation]),o=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",px:"$4",userSelect:"none"},gap:"2",height:64,onClick:()=>{e.onClick(e.slot.id,"unchecked"===o)},children:[(0,i.jsx)(mc,{shouldPreventDefault:!1,state:o,onClick:Ql.A}),(0,i.jsx)(FC,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(Na,{css:{px:"$3"},width:310,children:(0,i.jsx)(ic,{color:e.slot.assignedResources>=(e.slot.maxResources||1/0)?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,n.toNumberOrInfinity(e.slot.maxResources))})})]})},AA=e=>{const t=Yn(),n=qn(Kc),s=qn(xv),o=e.accreditationsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Dc,{css:{cursor:"pointer"},onClick:()=>{e.onClick(e.slot.id,"unchecked"===o)},children:[(0,i.jsx)(Ec,{justify:"center",width:48,children:e.shouldDisplayList?(0,i.jsx)(mc,{shouldPreventDefault:!1,state:o,onClick:Ql.A}):(0,i.jsx)(fc,{shouldPreventDefault:!1,state:o,onClick:Ql.A})}),(0,i.jsx)(Ec,{children:m(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(Ec,{children:e.slot.date?.isValid?n.toLocaleString(e.slot.date,Js.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(Ec,{children:(0,i.jsx)(ic,{color:e.slot.assignedResources>=(e.slot.maxResources||1/0)?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,s.toNumberOrInfinity(e.slot.maxResources))})})]})},wA=e=>{const t=Yn(),n=(0,L.useMemo)(()=>(0,lc.A)(e.slots.filter(t=>t.accreditation.id===e.accreditation.id),e=>(0,Ya.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.slots,e.accreditation]),s=(0,L.useMemo)(()=>n.map(e=>e.id),[n]),o=(0,L.useMemo)(()=>{const t=(0,mh.A)(e.accreditationsSlotsIds,s);return t.length===s.length?"checked":0===t.length?"unchecked":"indeterminate"},[s,e.accreditationsSlotsIds]),r=(0,L.useCallback)((t,n)=>{if(e.accreditation.accreditationDisplay===ie.Radio){const i=(0,cc.A)(e.accreditationsSlotsIds,s).concat(n?[t]:[]);e.change("massAccredit.accreditationsSlotsIds",i)}else e.change("massAccredit.accreditationsSlotsIds",so(e.accreditationsSlotsIds,t,n))},[e.accreditation,e.accreditationsSlotsIds,e.change,s]),a=e.accreditation.accreditationDisplay===ie.List||e.strategy===tt.Delete;return e.accreditation.hasSlots?(0,i.jsx)(MC,{accreditation:e.accreditation,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:n.length,children:e.accreditation.accreditationDisplay===ie.Calendar?(0,i.jsx)(Na,{css:{background:"$gray50",padding:"$4"},children:(0,i.jsx)(yA,{accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:"massAccredit.",slots:n})}):(0,i.jsxs)(kc,{hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{justify:"center",width:48,children:a&&(0,i.jsx)(mc,{state:o,onClick:t=>{"checked"===t?e.change("massAccredit.accreditationsSlotsIds",(0,Ns.A)(e.accreditationsSlotsIds.concat(s))):e.change("massAccredit.accreditationsSlotsIds",(0,cc.A)(e.accreditationsSlotsIds,s))}})}),(0,i.jsx)(Vc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Vc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Vc,{})]}),n.map(t=>(0,i.jsx)(AA,{accreditationsSlotsIds:e.accreditationsSlotsIds,shouldDisplayList:a,slot:t,onClick:r},t.id))]})}):(0,i.jsx)(kA,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,slot:n[0],onClick:r})},SA=e=>{const t=(0,L.useMemo)(()=>(0,lc.A)(e.accreditations.filter(t=>t.accreditationCategoryId===e.category.id),e=>e.name.toLowerCase()),[]);return(0,i.jsx)(DC,{category:e.category,children:t.map(t=>(0,i.jsx)(wA,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,slots:e.slots,strategy:e.strategy},t.id))})},EA=e=>{const t=Yn(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(e.excludeEmpty?"checked":"unchecked"),[a,l]=(0,L.useState)(e.excludeFull?"checked":"unchecked"),[d,c]=(0,L.useState)(e.excludePast?"checked":"unchecked"),u=(e.excludeEmpty?1:0)+(e.excludeFull?1:0)+(e.excludePast?1:0);return(0,i.jsxs)(Na,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:e.name,onChange:t=>{e.setName(t)}})}),(0,i.jsxs)(jC,{apply:()=>{e.setExcludeEmpty("checked"===o),e.setExcludeFull("checked"===a),e.setExcludePast("checked"===d),s(!1)},color:"white",isOpen:n,numberOfAppliedFilters:u,reinit:()=>{e.setExcludeEmpty(!1),r("unchecked"),e.setExcludeFull(!1),l("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setName(""),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsx)(gc,{state:o,onClick:r,children:t("cacher_les_cr_n_76382")}),(0,i.jsx)(gc,{state:a,onClick:l,children:t("cacher_les_cr_n_31908")}),(0,i.jsx)(gc,{state:d,onClick:c,children:t("masquer_les_cr_05336")})]})]})},TA=e=>{const t=Yn(),[n,s,o]=Bc(""),[r,a]=(0,L.useState)(!1),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1),{data:h,loader:g}=Zn("query MassAccreditSlots(\n $eventId: EventId!\n $delegationId: DelegationId\n $accreditationName: String\n $excludeFull: Boolean\n $excludeEmpty: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n accreditationsSlots(\n delegationId: $delegationId\n accreditationName: $accreditationName\n includeHidden: true\n excludeFull: $excludeFull\n excludeEmpty: $excludeEmpty\n excludePast: $excludePast\n ) {\n nodes {\n id\n name\n assignedResources\n maxResources\n date\n isBlocked\n isFull\n\n accreditation {\n id\n accreditationCategoryId\n name\n accreditationDisplay\n hasSlots\n color\n icon\n }\n\n accreditationCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationName:m(s)?s:void 0,excludeEmpty:r,excludeFull:l,excludePast:c},[]);const p=(0,L.useMemo)(()=>(h.event?.accreditationsSlots.nodes??[]).filter(e=>!e.isBlocked),[h.event]),f=(0,L.useMemo)(()=>(0,lc.A)((0,ph.A)(p.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[p]),x=(0,L.useMemo)(()=>(0,ph.A)(p.map(e=>e.accreditation),e=>e.id),[p]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(EA,{excludeEmpty:r,excludeFull:l,excludePast:c,name:n,setExcludeEmpty:a,setExcludeFull:d,setExcludePast:u,setName:o}),(0,i.jsx)(qa,{height:"6"}),g||(0,i.jsx)($C,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:f.map(t=>(0,i.jsx)(SA,{accreditations:x,accreditationsSlotsIds:e.values.massAccredit.accreditationsSlotsIds,category:t,change:e.change,slots:p,strategy:e.values.massAccredit.strategy},t.id))}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:e.submitting,onClick:e.handleSubmit,children:m(e.buttonText)?e.buttonText:t(e.values.massAccredit.strategy===tt.Add?"accr_diter_les_78545":e.values.massAccredit.strategy===tt.Replace?"r_accr_diter_le_34059":"d_saccr_diter_l_28590",e.numberOfSelected)})})]})},zA=({eventId:e,numberOfSelected:t,onClose:n,onSuccess:s,selecteds:o})=>{const r=Yn(),a=qn(fA),{mutate:l}=jo();return(0,i.jsx)(xA,{children:(0,i.jsx)(Pm,{category:r("Accreditation"),heading:r("accr_diter_les_48281"),onClose:n,children:(0,i.jsx)($m,{children:(0,i.jsxs)(mb,{initialValues:{massAccredit:{selecteds:o,strategy:tt.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{const i=(await l({eventId:e,massAccredit:t.massAccredit})).numberOfMembers;s(r("_1_membres_ont_05068",i)),n()},children:[(0,i.jsx)(hb,{heading:r("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(_A,{handleSubmit:e}),schema:a.massAccreditStep1Schema()}),(0,i.jsx)(hb,{heading:r("accr_ditations_39450"),render:({form:n,handleSubmit:s,submitting:o,values:r})=>(0,i.jsx)(TA,{change:n.change,delegationId:null,eventId:e,handleSubmit:s,numberOfSelected:t,submitting:o,values:r}),schema:a.massAccreditStep2Schema()})]})})})})},OA=e=>{const{history:t,translate:n}=_l(),{mutate:s,isLoading:r}=rr(),[a,l]=(0,L.useState)([]),d=no(a);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"people-group"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",textAlign:"center",children:n("SendCampaign")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(bc,{isSearchVisible:!0,label:n("campagne_97871"),values:a,onChange:l,children:e.campaigns.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),e.canCreate&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(El,{color:"invisible",leftIcon:"plus",onClick:()=>{const n=o(JSON.stringify({usersInfosIds:e.selecteds.ids}));t.push(SI.CREATE({organizationId:e.organizationId,eventId:e.eventId||void 0,options:n}))},children:n("cr_er_une_nouve_86635")})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{disabled:!d,isLoading:r,onClick:async()=>{if(no(a)){const t=e.campaigns.find(e=>e.id===a[0]),i=(await s({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegationId,selecteds:e.selecteds,campaignId:a[0]})).numberOfMembers;e.onSuccess(n("la_campagne_1_62015",t.name,i)),e.onClose()}},children:n("envoyer_26609")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:n("annuler_48254")})]})]})},RA=e=>{const{data:t}=Zn("query MassCampaignSendCampaigns(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n campaigns(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:e.organizationId,level:e.eventId?it.Event:it.Organization,eventId:e.eventId},[]);return(0,i.jsx)(OA,{campaigns:t.organization?.campaigns.nodes??[],canCreate:!0,delegationId:null,eventId:e.eventId,organizationId:e.organizationId,selecteds:e.selecteds,onClose:e.onClose,onSuccess:e.onSuccess})},$A=e=>{const{translate:t}=_l(),n=qn(fA),{mutate:s}=ar();return(0,i.jsx)(xA,{children:(0,i.jsx)(Pm,{category:t("Accreditation"),heading:t("update_desired_accreditations"),onClose:e.onClose,children:(0,i.jsx)($m,{css:{py:"$7"},children:(0,i.jsxs)(mb,{initialValues:{massAccredit:{selecteds:e.selecteds,strategy:tt.Add,accreditationsSlotsIds:[]}},isEdit:!1,onSubmit:async t=>{await s({eventId:e.eventId,delegationId:e.delegationId,massAccredit:t.massAccredit}),e.onSuccess(),e.onClose()},children:[(0,i.jsx)(hb,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(_A,{handleSubmit:e}),schema:n.massAccreditStep1Schema()}),(0,i.jsx)(hb,{heading:t("accr_ditations_39450"),render:({form:n,handleSubmit:s,values:o,submitting:r})=>(0,i.jsx)(TA,{buttonText:o.massAccredit.strategy===tt.Delete?t("supprimer_les_a_93519"):t("update_desired_accreditations"),change:n.change,delegationId:e.delegationId,eventId:e.eventId,handleSubmit:s,numberOfSelected:e.numberOfSelected,submitting:r,values:o}),schema:n.massAccreditStep2Schema()})]})})})})},DA=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=_l(),{mutate:r}=$o(),{mutate:a}=Ko(),{mutate:l}=Fo(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1),[m,g]=(0,L.useState)(!1),[p,f]=(0,L.useState)(!1),[x,_]=(0,L.useState)(!1),I=e.massActions.getSelectedsInput(null,null),v=e.showAccreditationsValidate||no(e.campaigns)||e.showDelete;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(El,{color:"invisible-gray",leftIcon:"pen",onClick:()=>{c(!0)},children:t("_diter_un_champ_64621")}),e.showWishedAccreditationsEdit&&(0,i.jsx)(El,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>{h(!0)},children:t("_diter_les_accr_41957")}),e.showAccreditationsEdit&&(0,i.jsx)(El,{color:"invisible-gray",leftIcon:"wand-magic-sparkles",onClick:()=>{g(!0)},children:t("_diter_les_accr_86042")}),v&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"invisible-gray",rightIcon:"chevron-down",children:t("plus_77692")})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[e.showAccreditationsValidate&&(0,i.jsx)(Gd,{icon:"check",onClick:async()=>{await a({eventId:s,delegationId:o,usersInfosIds:I.ids}),e.onMassEditSuccess()},children:t("valider_les_acc_80801")}),no(e.campaigns)&&(0,i.jsx)(Gd,{icon:"paper-plane",onClick:()=>{f(!0)},children:t("SendCampaign")}),e.showDelete&&(0,i.jsx)(Gd,{color:"red",icon:"user-xmark",onClick:()=>_(!0),children:t("retirer_de_la_d_64963")})]})]}),d&&(0,i.jsx)(pA,{customFields:e.customFields,mutate:e=>r({organizationId:n,eventId:s,delegationId:o,massEdit:e}),selecteds:I,onClose:()=>{c(!1)},onSuccess:e.onMassEditSuccess}),u&&(0,i.jsx)($A,{delegationId:o,eventId:s,numberOfSelected:e.massActions.numberOfSelected,selecteds:I,onClose:()=>{h(!1)},onSuccess:e.onMassEditSuccess}),m&&(0,i.jsx)(zA,{eventId:s,numberOfSelected:e.massActions.numberOfSelected,selecteds:I,onClose:()=>{g(!1)},onSuccess:e.onMassEditSuccess}),p&&(0,i.jsx)(OA,{campaigns:e.campaigns,canCreate:!1,delegationId:o,eventId:s,organizationId:n,selecteds:I,onClose:()=>{f(!1)},onSuccess:e.onMassEditSuccess}),x&&(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_sur_d_29974"),text:t("suppression_de_57689",I.ids?.length??0),onClose:()=>_(!1),onDelete:async()=>{await l({organizationId:n,eventId:s,delegationId:o,selecteds:I,deleteFromEvent:e.deleteFromEvent}),e.onMassEditSuccess()}})]})};function PA(e){return(0,lc.A)((0,ph.A)(e,e=>e.accreditation.id).map(t=>({...t.accreditation,accreditationCategory:t.accreditationCategory,slots:Ph(e.filter(e=>e.accreditation.id===t.accreditation.id))})),e=>[e.accreditationCategory.name.toLowerCase(),wC(e.index),e.name.toLowerCase()])}function FA(e,t){return e.flatMap(e=>{const n=e.slots.map(e=>e.id),i=io(t)?e.slots.length:(0,mh.A)(n,t).length;return 0===i?[]:[{...e,numberOfSlots:i}]})}function MA(e,t){return e.flatMap(e=>e.slots.filter(e=>io(t)||t.includes(e.id)))}const NA=e=>{const{translate:t}=_l(),n=L.useRef(null),s=qn(Kc);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{ref:n,css:{background:"white",border:"1px solid $gray200"},children:[(0,i.jsxs)(Na,{css:{width:"calc(2 * $cellWidth)"},direction:"column",children:[(0,i.jsx)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",borderRight:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,menuWidth:300,multiple:!0,triggerElem:(0,i.jsxs)(El,{color:"white",leftIcon:"bars-filter",size:"sm",children:[t("accr_ditations_39450"),no(e.selectedSlotsIds)&&` (${e.selectedSlotsIds.length})`]}),values:e.selectedSlotsIds,onChange:e.setSelectedSlotsIds,children:e.allAccreditations.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.slots.map(t=>(0,i.jsx)("option",{value:t.id,children:Oh(s,t,e.name,{accreditation:{includeNameAtEnd:!0}})},t.id))},e.id))})}),(0,i.jsx)(Na,{css:{borderRight:"1px solid $gray200",height:"$cellHeightSm"},width:1,onClick:()=>{n.current?.requestFullscreen()}}),e.data.map(t=>e.renderLeftColumn(t))]}),(0,i.jsx)(Na,{css:{flex:"1",overflowX:"auto"},children:(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(Na,{css:{borderBottom:"1px solid $gray200",height:"$cellHeightSm"},children:e.filteredAccreditations.map(t=>{const n=m(t.acronym)?t.acronym:t.name;return(0,i.jsxs)(Na,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`calc(${t.numberOfSlots} * ${e.cellWidth}px)`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:n,width:1,children:n}),(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:t.accreditationCategory.name,width:1,children:t.accreditationCategory.name})]},t.id)})}),(0,i.jsx)(Na,{css:{height:"$cellHeightSm"},children:e.slots.map(t=>{const n=t.date?.isValid?s.toLocaleString(t.date,Js.DateOnly.Numeric):"-";return(0,i.jsxs)(Na,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:`${e.cellWidth}px`},direction:"column",height:1,justify:"center",children:[(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray800 textSm medium",textAlign:"center",title:t.name||"-",width:1,children:t.name||"-"}),(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0},textAlign:"center",title:n,width:1,children:n})]},t.id)})}),e.data.map(t=>e.renderRow(t))]})})]}),(0,i.jsx)(Pc,{children:(0,i.jsx)($c,{limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,setLimit:e.setLimit,setOffset:e.setOffset,showLimits:!0,totalCount:e.totalCount})})]})},LA=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[e.accreditationSlotId]:[]),[e.vr]),s=(0,L.useMemo)(()=>(e.vr.matrixAuis||[]).flatMap(e=>e.isAutoAccredit?[]:[e.accreditationSlotId]),[e.vr]),o=(0,L.useMemo)(()=>(e.vr.matrixWishedSlots||[]).map(e=>e.id),[e.vr]);return(0,i.jsx)(Na,{css:{borderTop:"1px solid $gray200",height:"$cellHeightSm"},children:e.slotsIds.map(r=>{const a=n.includes(r),l=s.includes(r),d=o.includes(r),c=e.isEditMode&&("assigned"===e.editMode&&(a||l)||"wished"===e.editMode&&d),u=e.isEditMode&&("assigned"===e.editMode&&!a&&!l||"wished"===e.editMode&&!d);return(0,i.jsxs)(Na,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4",width:"$cellWidth","& > .h-accreditations-matrix-cell":{display:"flex"},"&:hover > .h-accreditations-matrix-cell":{display:"none"},"& > .h-accreditations-matrix-edit-cell":{display:"none"},"&:hover > .h-accreditations-matrix-edit-cell":{display:"flex"}},height:1,children:[c&&(0,i.jsx)(Na,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$error200",bd:"error500 1",color:"$error700",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.deleteAccreditationSlot(e.vr.userInfo.id,r),e.reloadRow(e.vr.id)},children:(0,i.jsx)(el,{icon:"trash-can"})}),u&&(0,i.jsx)(Na,{align:"center",className:"h-accreditations-matrix-edit-cell",css:{background:"$primary200",bd:"primary500 1",color:"$primary700",cursor:"pointer"},height:1,justify:"center",width:1,onClick:async()=>{await e.addAccreditationSlot(e.vr.userInfo.id,r),e.reloadRow(e.vr.id)},children:(0,i.jsx)(el,{icon:"plus"})}),a||l?(0,i.jsx)(Na,{align:"center",className:e.isEditMode?"h-accreditations-matrix-cell":"",css:{background:"$success200",bd:"success500 1",color:"$success700",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(el,{icon:n.includes(r)?"bolt-auto":"check"})}):d?(0,i.jsx)(Na,{align:"center",className:e.isEditMode?"h-accreditations-matrix-cell":"",css:{background:"white",bd:"gray300 1",borderStyle:"dashed"},height:1,justify:"center",width:1,children:(0,i.jsx)(yr,{font:"gray800 textXs medium",children:t("souhait_e_52100")})}):null]},r)})})},BA=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>PA(e.allAccreditationsSlots),[e.allAccreditationsSlots]),s=(0,L.useMemo)(()=>FA(n,e.selectedSlotsIds),[n,e.selectedSlotsIds]),o=(0,L.useMemo)(()=>MA(s,e.selectedSlotsIds),[s,e.selectedSlotsIds]),r=(0,L.useMemo)(()=>o.map(e=>e.id),[o]),a=(0,L.useCallback)(e=>(0,i.jsx)(Na,{css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightSm",px:"$4"},width:1,children:(0,i.jsx)(uj,{size:32,userInfo:e.userInfo})},e.userInfo.id),[]),l=(0,L.useCallback)(t=>e.isRowLoading(t.id)?(0,i.jsx)(Uc,{css:{border:"none",borderTop:"1px solid $gray200",height:"$cellHeightSm"}},t.userInfo.id):(0,i.jsx)(LA,{addAccreditationSlot:e.addAccreditationSlot,deleteAccreditationSlot:e.deleteAccreditationSlot,editMode:e.editMode,isEditMode:e.isEditMode,reloadRow:e.reloadRow,slotsIds:r,vr:t},t.userInfo.id),[e.addAccreditationSlot,e.deleteAccreditationSlot,e.editMode,e.isEditMode,e.isRowLoading,e.reloadRow,r]);return(0,i.jsx)(Na,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(kl,{}):io(e.members)||io(s)?(0,i.jsx)(Na,{css:{background:"white",border:"1px solid $gray200"},height:400,children:io(e.members)?(0,i.jsx)(Nk,{imageSrc:gd.Blanks.Member,title:t("aucun_membre_ne_07054")}):(0,i.jsx)(Nk,{imageSrc:gd.Blanks.Accreditation,title:t("aucune_accr_dit_97505")})}):(0,i.jsx)(NA,{allAccreditations:n,cellWidth:120,data:e.members,filteredAccreditations:s,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:a,renderRow:l,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setSelectedSlotsIds:e.setSelectedSlotsIds,slots:o,totalCount:e.totalCount})})},VA=e=>{const{params:{eventId:t,delegationId:n}}=_l(),{data:s,idToLoading:o,isEditMode:r,isLoading:a,limit:l,numberOfPages:d,offset:c,reloadRow:u,setLimit:h,setOffset:m,totalCount:g}=rm(),{mutate:p}=ar(),{data:f,isLoading:x}=Zn("query DelegationMembersAccreditationsMatrix($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationsSlots(onlyVisible: true) {\n accreditationSlot {\n ...AccreditationSlotMatrix\n }\n }\n }\n }\n}\n",{eventId:t,delegationId:n},[Ls.AccreditationSlotMatrixFragment]),_=(0,L.useMemo)(()=>(f.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlot),[f]),I=(0,L.useCallback)(e=>o[e]??!1,[o]),v=(0,L.useCallback)((e,i)=>p({eventId:t,delegationId:n,massAccredit:{accreditationsSlotsIds:[i],selecteds:{ids:[e]},strategy:tt.Add}}),[t,n,p]),b=(0,L.useCallback)((e,i)=>p({eventId:t,delegationId:n,massAccredit:{accreditationsSlotsIds:[i],selecteds:{ids:[e]},strategy:tt.Delete}}),[t,n,p]);return(0,i.jsx)(BA,{addAccreditationSlot:v,allAccreditationsSlots:_,deleteAccreditationSlot:b,editMode:"wished",isEditMode:r,isLoading:a||x,isRowLoading:I,limit:l,members:s,numberOfPages:d,offset:c,reloadRow:u,selectedSlotsIds:e.selectedSlotsIds,setLimit:h,setOffset:m,setSelectedSlotsIds:e.setSelectedSlotsIds,totalCount:g})},UA=e=>{const{params:{organizationId:t,eventId:n,delegationId:s}}=_l(),o=qn(Hh),r=ti(),[a,l,d]=cy(t,"eventDelegationMembers.columns",e.columns),[c,u,h]=cy(t,"eventDelegationMembers.limit",Tc),[m,g,p]=cy(t,"eventDelegationMembers.predicates",[]),[f,x,_]=cy(t,"eventDelegationMembers.rendering",Bh.List),[I,v,b]=cy(t,"eventDelegationMembers.selectedSlotsIds",[]),[j,C,y]=cy(t,"eventDelegationMembers.sort",null),{data:k,isLoading:A}=Zn("query EventDelegationMembersInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $delegationId: DelegationId!\n $privacy: CustomFieldPrivacy!\n) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n isWeezeventConnected\n\n customDocuments {\n ...CustomDocumentPopulation\n }\n\n delegation(id: $delegationId) {\n numberOfDelegationsAccreditationsSlots\n\n accreditationsSlots(onlyDefault: true, onlyHidden: true) {\n accreditationSlotId\n }\n\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n positionDisplay\n slotDisplay\n\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:t,eventId:n,delegationId:s,privacy:e.customFieldsPrivacy},[Ls.SegmentCustomFieldFragment,Ls.CustomDocumentPopulationFragment]);const w=d||h||p||_||b||y||A,S=(0,L.useMemo)(()=>e.customFieldsPrivacy===xe.All?k.organization?.customFields.nodes??[]:(0,Ya.A)((k.event?.delegation.form.elements.map(e=>e.customField)||[]).concat(k.event?.delegation.columnsCustomFields||[])),[e.customFieldsPrivacy,k.organization,k.event]),E=uy(S),T=(0,L.useMemo)(()=>k.event?o.getDelegationMembersFilters(t,n,S,k.event,k.event.delegation.form,k.event.isWeezeventConnected):[],[n,S,k.event]),z=(0,L.useMemo)(()=>k.event?o.getDelegationMembersPossibleColumns(S,{isWeezeventConnected:k.event.isWeezeventConnected,positionDisplay:k.event.delegation.form.positionDisplay,slotDisplay:k.event.delegation.form.slotDisplay}):[],[S,k.event]),O=(0,L.useMemo)(()=>(k.event?.delegation.accreditationsSlots??[]).map(e=>e.accreditationSlotId),[k.event]),R=(0,L.useMemo)(()=>"function"==typeof e.showEditMode?e.showEditMode(f):e.showEditMode,[e.showEditMode,f]),$=(k.event?.delegation.numberOfDelegationsAccreditationsSlots??0)>0;return(0,L.useEffect)(()=>{r.setItem(Bl.DELEGATIONS_SPACE_TAB,"members")},[]),w?(0,i.jsx)(kl,{}):(0,i.jsx)(mm,{columns:e.canEditColumns?a:e.columns,columnsSearch:[],columnsToIncludes:Gh,eventId:n,filters:T,getMassActionId:e=>e.userInfo.id,limit:c,loadDataList:or,loadDataListParams:{delegationId:s,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:ir,loadRowParams:{delegationId:s,onlyVisibleAccreditationsSlots:e.onlyVisibleAccreditationsSlots,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:z,possibleRenderings:[Bh.List,Bh.AccreditationsMatrix],predicates:m,renderActions:(t,n,s)=>(0,i.jsx)(DA,{campaigns:e.campaigns,customFields:S,deleteFromEvent:e.deleteFromEvent,massActions:t,showAccreditationsEdit:e.showAccreditationsEdit,showAccreditationsValidate:e.showAccreditationsValidate,showDelete:e.canDeleteMembers,showWishedAccreditationsEdit:$,onMassEditSuccess:s}),rendering:f,setColumns:l,setLimit:u,setPredicates:g,setRendering:x,setSort:C,showEditColumns:f===Bh.List&&e.canEditColumns,showEditMode:R,showFilters:!0,showMassActions:e.canEditMembers,showRowDropdown:!0,showRowEdit:e.canEditMembers,showSearchColumns:!1,sort:j,children:f===Bh.AccreditationsMatrix?(0,i.jsx)(VA,{selectedSlotsIds:I,setSelectedSlotsIds:v}):(0,i.jsx)(Am,{getEditPath:e.getEditPath,renderCell:(o,r,a)=>(0,i.jsx)(bk,{accreditationsPanelPath:ds.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:r.userInfo.id}),availabilitiesPanelPath:ds.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:n,delegationId:s,userInfoId:r.userInfo.id}),canAccredit:e.canAccredit,canAssign:!1,canChangeDelegation:!1,canClickMemberName:e.canClickMemberName,column:o,customField:E.get(o.slug),eventId:n,positionsPanelPath:ds.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:r.userInfo.id}),reloadRow:a,row:r}),renderRowDropdown:(t,n)=>(0,i.jsx)(oA,{accreditationState:t.accreditationState,allowedCustomDocuments:e.customBadges,canAccredit:e.canAccredit,canDelete:e.canDeleteMembers&&t.canDelete,customDocuments:k.event?.customDocuments??[],deleteFromEvent:e.deleteFromEvent,member:t.userInfo,reload:n,showDeleteFromEvent:e.showDeleteFromEvent,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:t.id}),renderRowPanels:(o,r)=>(0,i.jsx)(nA,{accreditationsPanelPath:ds.DELEGATION_MEMBER_ACCREDITATIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:o.userInfo.id}),availabilitiesPanelPath:ds.DELEGATION_MEMBER_AVAILABILITIES({organizationId:t,eventId:n,delegationId:s,userInfoId:o.userInfo.id}),canAccredit:e.canAccredit,canCheckIn:!1,canDeletePosition:()=>!1,canEditWishedAccreditations:!0,defaultHiddenAccreditationsSlotsIds:O,delegationId:s,eventId:n,organizationId:t,positionsPanelPath:ds.DELEGATION_MEMBER_POSITIONS({organizationId:t,eventId:n,delegationId:s,userInfoId:o.userInfo.id}),reloadRow:r,returnPathFallback:ds.DELEGATION_MEMBERS({organizationId:t,eventId:n,delegationId:s}),volunteerRegistration:o})})})};function WA(e){return{includeDelegations:e.includes("delegations")||e.includes("delegations_categories"),includeEvents:e.includes("events")||e.includes("number_of_events"),includeForms:e.includes("forms")||e.includes("forms_inserted_at"),includeTags:e.includes("tags"),includeRoles:e.includes("roles")}}let GA=class extends gu{constructor(e,t,n){super(e,t,n)}getOrganizationUsersFilters(e,t,n){return[...this.getBaseFilters(n.customFields.nodes),...this.getEventsFilters(e),...this.getFormsFilters(e),...this.getPositionsFilters(),...this.getDelegationsFilters(e),...this.getEmailsFilters(e),...this.getCommentsFilters(),{slug:"tag",name:this.t("Tag"),category:this.t("autres_99130"),fieldType:We.Select,needLoading:!0,organizationId:e,tagContext:kt.UsersInfos},{slug:"sameEmail",name:this.t("nombre_de_profi_42316"),category:this.t("autres_99130"),fieldType:We.Number,hideEmpty:!0},{slug:"segments",name:this.t("fait_partie_de_44650"),category:this.t("autres_99130"),fieldType:We.Select,values:n.segmentsFolders.flatMap(e=>e.segments).filter(e=>e.id!==t),hideEmpty:!0},{slug:"isAdmin",name:this.t("est_administrat_15766"),category:this.t("autres_99130"),fieldType:We.Checkbox},{slug:"isLeader",name:this.t("est_responsable_27270"),category:this.t("autres_99130"),fieldType:We.Checkbox}]}getDelegationMembersFilters(e){return this.getBaseFilters(e)}getOrganizationUsersPossibleColumns(e){return[...this.getBaseColumns(),{slug:"events",name:this.t("_v_nements_53672"),minWidth:320},{slug:"number_of_events",name:this.t("nombre_d_v_nem_14214"),width:230},{slug:"forms",name:this.t("formulaires_rem_62495"),minWidth:320},{slug:"forms_inserted_at",name:this.t("dates_de_rempli_65075"),minWidth:320},{slug:"delegations",name:this.t("d_l_gations_78318"),isSearchable:!0,minWidth:320},{slug:"delegations_categories",name:this.t("cat_gories_de_d_45259"),minWidth:320},{slug:"inserted_at",name:this.t("date_d_inscript_31369"),isSortable:!0,sortAttribute:Rt.InsertedAt,width:230},{slug:"tags",name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:"roles",name:this.t("r_les_61679"),minWidth:320},...this.customFieldsToPossibleColumns(e)]}getDelegationMembersPossibleColumns(e){return[...this.getBaseColumns(),...this.customFieldsToPossibleColumns(e)]}getBaseColumns(){return[{slug:"name",name:this.t("full_name"),isSearchable:!0,isSortable:!0,sortAttribute:Rt.Name,minWidth:240},{slug:"email",name:this.t("e_mail_du_membr_69509"),isSearchable:!0,minWidth:180},{slug:"id",name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:Rt.Id,width:100}]}getBaseFilters(e){return[{slug:"email",name:this.t("Email"),category:this.t("champs_de_formu_64126"),fieldType:We.Text},{slug:"registrationDate",name:this.t("date_d_inscript_31369"),category:this.t("champs_de_formu_64126"),fieldType:We.Date,hideEmpty:!0},...this.customFieldsToFilters(e)]}getEventsFilters(e){return[{slug:"event",name:this.t("_v_nement_22345"),category:this.t("Event"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"numberOfEvents",name:this.t("nombre_d_v_nem_14214"),category:this.t("Event"),fieldType:We.Number,hideEmpty:!0}]}getFormsFilters(e){return[{slug:"forms",name:this.t("formulaires_rem_62495"),category:this.t("Form_plural"),fieldType:We.Select,needLoading:!0,organizationId:e},{slug:"formsInsertedAt",name:this.t("dates_de_rempli_65075"),category:this.t("Form_plural"),fieldType:We.Date,hideEmpty:!0,needLoading:!0,organizationId:e}]}getPositionsFilters(){return[{slug:"positionName",name:this.t("nom_de_la_missi_80169"),category:this.t("missions_63972"),fieldType:We.Text,hideEmpty:!0},{slug:"positionCategoryName",name:this.t("nom_de_la_cat_g_57279"),category:this.t("missions_63972"),fieldType:We.Text,hideEmpty:!0},{slug:"numberOfAssignments",name:this.t("nombre_d_affect_31455"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0}]}getDelegationsFilters(e){return[{slug:"delegation",name:this.t("fait_partie_de_32196"),category:this.t("d_l_gations_78318"),fieldType:We.Select,needLoading:!0,organizationId:e},{slug:"delegationCategory",name:this.t("inscrit_via_la_12241"),category:this.t("d_l_gations_78318"),fieldType:We.Select,needLoading:!0,organizationId:e},{slug:"isDelegationLeader",name:this.t("est_responsable_87662"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox}]}getEmailsFilters(e){return[{slug:"campaign",name:this.t("campagne_97871"),category:this.t("e_mails_09850"),fieldType:We.Campaign,needLoading:!0,organizationId:e},{slug:"emailBlacklist",name:this.t("ne_souhaite_plu_08853"),category:this.t("e_mails_09850"),fieldType:We.Checkbox,hideEmpty:!0}]}getCommentsFilters(){return[{slug:"comments",name:this.t("commentaires_96492"),category:this.t("commentaires_96492"),fieldType:We.Text},{slug:"lastCommentAt",name:this.t("date_du_dernier_73554"),category:this.t("commentaires_96492"),fieldType:We.Date,hideEmpty:!0}]}};GA=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],GA);const HA=e=>{const t=(0,L.useMemo)(()=>(e.user.events||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.user]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},qA=e=>{const{params:{organizationId:t}}=_l(),n=qn(Kc),{mutate:s}=function(e={}){return Xn("mutation UserInfoUpdateField(\n $organizationId: OrganizationId!\n $userInfoId: UsersInfoId!\n $slug: String!\n $value: JSON!\n) {\n userInfoUpdateField(\n organizationId: $organizationId\n userInfoId: $userInfoId\n slug: $slug\n value: $value\n ) {\n id\n }\n}\n",e)}(),o=(0,L.useCallback)((n,i)=>s({organizationId:t,userInfoId:e.row.id,slug:i,value:n}),[e.row,s]),r=(0,L.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[{id:e.form.id,color:"gray",icon:null,text:e.form.name}]:[]),[e.row.formsUsersInfos]),a=(0,L.useMemo)(()=>(e.row.formsUsersInfos||[]).flatMap(e=>e.form?[`${e.form.name} : ${n.toLocaleString(e.insertedAt.toLocal(),Js.DateTime)}`]:[]).join(", "),[e.row.formsUsersInfos]),l=(0,L.useMemo)(()=>(e.row.delegations||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.delegations]),d=(0,L.useMemo)(()=>(0,ph.A)(e.row.delegations||[],e=>e.delegationCategory.id).map(e=>({id:e.delegationCategory.id,color:"gray",icon:null,text:e.delegationCategory.name})),[e.row.delegations]),c=(0,L.useMemo)(()=>(e.row.tags||[]).map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.row.tags]);return"name"===e.column.slug?(0,i.jsx)(Py,{canClickMemberName:e.canClickMemberName,column:e.column,mutate:o,reload:e.reloadRow,updatable:e.updatable,userInfo:e.row}):"id"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"picture"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Jg,{email:e.row.email,image:e.row.picture?.url,name:e.row.name,size:32})}):"email"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.email}):"events"===e.column.slug?(0,i.jsx)(HA,{column:e.column,user:e.row}):"number_of_events"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.events?.length??0}):"forms"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:r})}):"forms_inserted_at"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:a,children:a})}):"delegations"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:l})}):"delegations_categories"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:d})}):"inserted_at"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:n.toLocaleString(e.row.insertedAt.toLocal(),Js.DateTime)}):"tags"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:c})}):"roles"===e.column.slug?(0,i.jsx)(My,{minWidth:e.column.minWidth,userPermissions:e.row,width:e.column.width}):(0,i.jsx)(Dy,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:o,reload:e.reloadRow,updatable:e.updatable})},YA=e=>{const{params:{organizationId:t,delegationId:n}}=_l(),s=qn(GA),o=ti(),[r,a,l]=cy(t,"organizationDelegationMembers.columns",e.columns),[d,c,u]=cy(t,"organizationDelegationMembers.limit",Tc),[h,m,g]=cy(t,"organizationDelegationMembers.predicates",[]),[p,f,x]=cy(t,"organizationDelegationMembers.sort",null),{data:_,isLoading:I}=Zn("query OrganizationDelegationMembersInfos(\n $organizationId: OrganizationId!\n $delegationId: DelegationId!\n $privacy: CustomFieldPrivacy!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n delegation(id: $delegationId) {\n columnsCustomFields {\n ...SegmentCustomField\n }\n\n form {\n elements {\n customField {\n ...SegmentCustomField\n }\n }\n }\n }\n }\n}\n",{organizationId:t,privacy:e.isOrganizationAdmin?xe.All:xe.Public,delegationId:n},[Ls.SegmentCustomFieldFragment]);const v=l||u||g||x||I,b=(0,L.useMemo)(()=>e.isOrganizationAdmin?_.organization?.customFields.nodes??[]:(0,Ya.A)((_.organization?.delegation.form.elements.map(e=>e.customField)||[]).concat(_.organization?.delegation.columnsCustomFields??[])),[_.organization]),j=uy(b),C=(0,L.useMemo)(()=>s.getDelegationMembersFilters(b),[b]),y=(0,L.useMemo)(()=>s.getDelegationMembersPossibleColumns(b),[b]);return(0,L.useEffect)(()=>{o.setItem(Bl.DELEGATIONS_SPACE_TAB,"members")},[]),v?(0,i.jsx)(kl,{}):(0,i.jsx)(mm,{columns:e.canEditColumns?r:e.columns,columnsSearch:[],columnsToIncludes:WA,eventId:null,filters:C,limit:d,loadDataList:Wo,loadDataListParams:{delegationId:n},loadRow:Uo,organizationId:t,possibleColumns:y,predicates:h,renderActions:(t,n,s)=>(0,i.jsx)(DA,{campaigns:e.campaigns,customFields:b,deleteFromEvent:!1,massActions:t,showAccreditationsEdit:!1,showAccreditationsValidate:!1,showDelete:e.canDeleteMembers,showWishedAccreditationsEdit:!1,onMassEditSuccess:s}),rendering:Bh.List,setColumns:a,setLimit:c,setPredicates:m,setSort:f,showEditColumns:e.canEditColumns,showEditMode:e.isOrganizationAdmin,showFilters:!0,showMassActions:!0,showRowDropdown:!0,showRowEdit:e.canEditMembers,showSearchColumns:!1,sort:p,children:(0,i.jsx)(Am,{getEditPath:e.getEditPath,renderCell:(t,n,s)=>(0,i.jsx)(qA,{canClickMemberName:e.canClickMemberName,column:t,customField:j.get(t.slug),reloadRow:s,row:n,updatable:e.canEditMembers}),renderRowDropdown:(t,n)=>(0,i.jsx)(oA,{accreditationState:null,allowedCustomDocuments:e.customBadges,canAccredit:!1,canDelete:e.canDeleteMembers,customDocuments:[],deleteFromEvent:!1,member:t,reload:n,showDeleteFromEvent:!1,showDocumentsDownload:e.showDocumentsDownload,volunteerRegistrationId:null})})})};function KA(){return Ac(mr.desktop)}const ZA=e=>{const t=KA(),n=(0,L.useMemo)(()=>e.min.startOf("week").equals(e.value.startOf("week")),[e.min,e.value]),s=(0,L.useMemo)(()=>e.max.endOf("week").equals(e.value.endOf("week")),[e.max,e.value]);return(0,i.jsxs)(Na,{gap:"2",children:[(0,i.jsx)(El,{color:"white",disabled:n,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.value.minus(t?{week:1}:{day:1}))}}),(0,i.jsx)(yr,{width:160,children:(0,i.jsx)(Du,{...e})}),(0,i.jsx)(El,{color:"white",disabled:s,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.value.plus(t?{week:1}:{day:1}))}})]})},XA=L.createContext({}),JA=e=>{const{days:t,interval:n}=L.useContext(XA),s=t[0],o=t[6]??t[0],r=L.useMemo(()=>(e.startAt??Us.c9.max(s,n.start)).startOf("day"),[e.startAt,s,n]),a=L.useMemo(()=>(e.endAt??Us.c9.min(o,n.end)).endOf("day"),[e.endAt,o,n]),l=L.useMemo(()=>"number"==typeof e.startHour&&e.startHour>0&&e.startAt?.isValid&&e.startAt.hour{const e=Math.max(r.diff(s,"days").days+1,1);return l?e-1:e},[l,r,s]),c=L.useMemo(()=>{const e=Math.min(Math.ceil(a.diff(s,"days").days)+1,8);return l?e-1:e},[l,a,s]);return r>o||a{const t=L.useMemo(()=>{if("week"===e.display){const t=e.date.startOf("week");return(0,Oc.A)(0,7).map(e=>t.plus({day:e}))}return[e.date]},[e.date]),n=L.useMemo(()=>Us.IX.fromDateTimes(e.minDate.startOf("day"),e.maxDate.endOf("day")),[e.minDate,e.maxDate]),[s,o]=L.useState(300),r=L.useCallback(e=>{if(e){const t=Math.max(Math.ceil(e.getBoundingClientRect().height),300);o(t)}},[e.date,o]),a=e.showBorder?{bd:!0,overflow:"hidden"}:{};return(0,i.jsx)(XA.Provider,{value:{days:t,interval:n},children:(0,i.jsxs)(Na,{css:{...a,...e.css},direction:"column",children:[(0,i.jsx)(Na,{css:{borderBottom:"1px solid $gray200"},height:60,width:1,children:t.map(e=>(0,i.jsxs)(Na,{align:"center",css:{background:"$gray50"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(yr,{css:{textTransform:"capitalize"},font:"gray500 textXs medium",children:e.toLocaleString({weekday:"long"})}),(0,i.jsx)(yr,{font:"gray800 textXl semiBold",children:e.day})]},e.toISO()))}),(0,i.jsxs)(Na,{className:"h-calendar-events-container",css:{position:"relative"},direction:"column",height:s,width:1,children:[(0,i.jsx)(cd,{css:{flex:"1","& > div:last-child":{borderRight:"none"}},gridtemplatecolumns:"week"===e.display?"repeat(7, minmax(0, 1fr))":"1",gridtemplaterows:"1fr",width:1,children:t.map((e,t)=>(0,i.jsx)(Na,{css:{background:n.contains(e)?"white":"$primary50",borderRight:"1px solid $gray200",gridColumn:`${t+1} / ${t+2}`,gridRow:"1 / 2"}},e.toISO()))}),(0,i.jsx)(cd,{ref:r,css:{gridAutoFlow:"column",rowGap:"$2",position:"absolute",top:"0",py:"$2"},gridtemplatecolumns:"week"===e.display?"repeat(7, minmax(0, 1fr))":"1",width:1,children:e.children})]})]})})},ew=e=>{const{translate:t}=_l(),n=e.member.accreditationsUsersInfos.some(t=>t.accreditationSlotId===e.accreditationSlotId);return(0,i.jsx)(Dc,{children:(0,i.jsxs)(Ec,{children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(uj,{userInfo:e.member.userInfo})}),(0,i.jsx)(Na,{align:"center",gap:"3",children:n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",gap:"1",children:[(0,i.jsx)(yr,{color:"success500",children:(0,i.jsx)(el,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(yr,{font:"gray800 textXs medium",children:t("d_j_attribu_e_06450")})]}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsx)(qd,{placement:"bottom-end",children:(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>e.deleteAccreditationSlot(e.member.userInfo.id,e.accreditationSlotId),children:t("retirer_l_accr_62187")})})]})]}):(0,i.jsx)(El,{size:"sm",onClick:()=>e.addAccreditationSlot(e.member.userInfo.id,e.accreditationSlotId),children:t("ajouter_97327")})})]})})},tw=e=>{const t=Yn();return(0,i.jsx)(Na,{css:{background:"white",bd:!0,padding:"$4 $6"},direction:"column",gap:"2",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),e.isWeezeventConnected&&(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"badge-check"})}),(0,i.jsx)(yr,{css:{flex:"1"},children:t("attribu_es_48167")}),(0,i.jsx)(yr,{children:e.stats.assignedResources})]}),(0,i.jsxs)(Na,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"hand-holding-heart"})}),(0,i.jsx)(yr,{css:{flex:"1"},children:t("souhait_es_78101")}),(0,i.jsx)(yr,{children:e.stats.wishedResources})]}),e.isWeezeventConnected&&(0,i.jsxs)(Na,{align:"center",css:{color:"$gray700"},gap:"1",width:1,children:[(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"scanner-gun"})}),(0,i.jsx)(yr,{css:{flex:"1"},children:t("scann_es_13169")}),(0,i.jsx)(yr,{children:e.stats.scannedResources})]})]})})},nw=e=>{const{params:{eventId:t,delegationId:n},translate:s}=_l(),{mutate:o}=jo(),r=(0,L.useMemo)(()=>`${e.das.accreditation.name}${m(e.das.accreditationSlot.name)?` - ${e.das.accreditationSlot.name}`:""}`,[e.das]),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(e.das),[u,h]=(0,L.useState)((0,lc.A)(e.das.volunteersRegistrations,e=>e.userInfo.name)),[g,p]=(0,L.useState)({}),f=(0,L.useCallback)(async i=>{l(!0),p(e=>({...e,[i]:!0}));const{event:s}=await(o={eventId:t,delegationId:n,accreditationSlotId:e.accreditationSlotId,userInfoId:i},r=await K(),ho("query DelegationAccreditationSlotMember(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationSlotId: AccreditationsSlotId!\n $userInfoId: UsersInfoId!\n) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n }\n }\n\n member: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n}\n",{variables:o,token:r||void 0,fragments:[Ls.DelegationAccreditationSlotStatsFragment,Ls.VolunteerRegistrationDelegationAccreditationSlotFragment]}));var o,r;h(t=>t.flatMap(t=>{if(t.userInfo.id===i){const t=s.member.accreditationsUsersInfos.some(t=>t.accreditationSlotId===e.accreditationSlotId),n=s.member.accreditationsSlots.some(t=>t.id===e.accreditationSlotId);return t||n?[s.member]:[]}return[t]})),c(s.delegation.accreditationSlot),p(e=>({...e,[i]:!1})),l(!1)},[e.accreditationSlotId,n,t,l,c,p,h]),x=(0,L.useCallback)(async(e,n)=>{p(t=>({...t,[e]:!0})),await o({eventId:t,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e]},strategy:tt.Add}}),await f(e)},[t,f,p]),_=(0,L.useCallback)(async(e,n)=>{p(t=>({...t,[e]:!0})),await o({eventId:t,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[e]},strategy:tt.Delete}}),await f(e)},[t,f,p]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yj,{children:r}),(0,i.jsxs)(_u,{css:{background:"$gray50",gap:"$6",padding:"$6"},children:[(0,i.jsx)(tw,{isLoading:a,isWeezeventConnected:e.isWeezeventConnected,stats:d}),(0,i.jsxs)(kc,{children:[(0,i.jsx)(jc,{children:(0,i.jsx)(Vc,{children:s("nom_du_membre_69353")})}),u.map(t=>g[t.userInfo.id]?(0,i.jsx)(Uc,{bx:!0},t.id):(0,i.jsx)(ew,{accreditationSlotId:e.accreditationSlotId,addAccreditationSlot:x,deleteAccreditationSlot:_,member:t},t.id))]})]})]})},iw=e=>{const{data:t,loader:n,isLoading:s}=Zn("query DelegationAccreditationSlotMembers(\n $eventId: EventId!\n $delegationId: DelegationId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n event(id: $eventId) {\n isWeezeventConnected\n\n delegation(id: $delegationId) {\n accreditationSlot(id: $accreditationSlotId) {\n ...DelegationAccreditationSlotStats\n\n accreditationSlot {\n date\n name\n }\n\n accreditation {\n name\n }\n\n volunteersRegistrations {\n ...VolunteerRegistrationDelegationAccreditationSlot\n }\n }\n }\n }\n}\n",{eventId:e.eventId,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlotId},[Ls.DelegationAccreditationSlotStatsFragment,Ls.VolunteerRegistrationDelegationAccreditationSlotFragment]);return(0,i.jsx)(xu,{size:"md",onClose:e.onClose,children:s?n:(0,i.jsx)(nw,{accreditationSlotId:e.accreditationSlotId,das:t.event.delegation.accreditationSlot,isWeezeventConnected:t.event.isWeezeventConnected})})},sw=e=>(0,i.jsxs)(Na,{align:"center",gap:"2",width:1,children:[(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:e.icon})}),(0,i.jsx)(yr,{css:{flex:"1"},fontSize:"textXs",children:e.text}),(0,i.jsx)(Na,{align:"center",css:{background:e.background,borderRadius:"$1",fontSize:"$textXs",fontWeight:"$medium",padding:"2px 8px",minWidth:"30px"},justify:"center",children:e.count})]}),ow=e=>{const{translate:t,params:{eventId:n,delegationId:s}}=_l(),[o,r]=(0,L.useState)(e.das),a=(0,L.useMemo)(()=>ec(e.das.accreditation.color),[e.das]),l=(0,L.useMemo)(()=>({background:a[50],border:`1px solid ${a[500]}`,color:a[700]}),[a]),d=(0,L.useMemo)(()=>`${e.das.accreditation.name}${m(e.das.accreditationSlot.name)?` - ${e.das.accreditationSlot.name}`:""}`,[e.das]),c=(0,L.useCallback)(async()=>{const{event:{delegation:t}}=await Do({eventId:n,delegationId:s,accreditationSlotId:e.das.accreditationSlot.id},await K());r(t.accreditationSlot)},[e.das,r]),[u,h]=(0,L.useState)(!1),g=o.maxResources?`/${o.maxResources}`:"",p=`${o.assignedResources}${g}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"start",css:{...l,borderRadius:"$1",cursor:e.isEventAdmin?"pointer":"default",minHeight:"32px",px:"$2",py:"$2"},direction:"column",gap:"2",width:1,onClick:()=>{e.isEventAdmin&&h(!0)},children:[(0,i.jsx)(yr,{css:{flex:"1"},fontSize:"textXs",fontWeight:"medium",children:d}),(0,i.jsx)(sw,{background:a[100],count:p,icon:"badge-check",text:t("attribu_es_48167")}),e.showWished&&(0,i.jsx)(sw,{background:a[100],count:o.wishedResources,icon:"hand-holding-heart",text:t("souhait_es_78101")}),(0,i.jsx)(sw,{background:a[100],count:o.scannedResources,icon:"scanner-gun",text:t("scann_es_13169")})]}),e.isEventAdmin&&u&&(0,i.jsx)(iw,{accreditationSlotId:e.das.accreditationSlot.id,delegationId:s,eventId:n,onClose:()=>(h(!1),c())})]})},rw=e=>{const t=KA(),n=(0,L.useMemo)(()=>(0,lc.A)(e.accreditationsSlots.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,wC(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),s=(0,L.useMemo)(()=>(0,lc.A)(e.accreditationsSlots.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name,wC(e.accreditation.index),e.accreditation.name.toLowerCase()]),[e.accreditationsSlots]),o=(0,L.useMemo)(()=>Object.fromEntries(e.accreditations.map(e=>[e.accreditationId,e.willAutoAccredit||e.accreditation.willAutoAccredit])),[e.accreditations]);return(0,i.jsxs)(QA,{css:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:t?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[n.map(t=>(0,i.jsx)(JA,{children:(0,i.jsx)(ow,{das:t,isEventAdmin:e.isEventAdmin,showWished:!o[t.accreditationId]})},t.accreditationSlot.id)),s.map(t=>(0,i.jsx)(JA,{endAt:t.accreditationSlot.date,startAt:t.accreditationSlot.date,children:(0,i.jsx)(ow,{das:t,isEventAdmin:e.isEventAdmin,showWished:!o[t.accreditationId]})},t.accreditationSlot.id))]})},aw=e=>{const t=qn(xv),{delegationAccreditationsSlots:n,showWished:s}=hw(),o=n.find(t=>t.accreditationSlot.id===e.slot.id);return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{css:{paddingLeft:"76px",textTransform:"capitalize"},children:e.slot.name}),s&&(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(o?.wishedResources??0)}),(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(o?.assignedResources??0)}),(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(o?.maxResources)}),(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(o?.scannedResources??0)})]})},lw=e=>{const t=qn(xv),{delegationAccreditations:n,delegationAccreditationsSlots:s,accreditationIdToSlots:o,accreditationIdToOpen:r,setAccreditationIdToOpen:a,showWished:l}=hw(),d=r[e.accreditation.id]??!0,c=o[e.accreditation.id],u=(0,L.useMemo)(()=>{const t=n.find(t=>t.accreditationId===e.accreditation.id);if("number"==typeof t?.maxResources)return t.maxResources;{const t=s.filter(t=>t.accreditationId===e.accreditation.id&&"number"==typeof t.maxResources);return no(t)?(0,vv.A)(t,e=>e.maxResources):null}},[e.accreditation,n,s]),h=(0,L.useMemo)(()=>(0,vv.A)(s.filter(t=>t.accreditationId===e.accreditation.id),e=>e.wishedResources),[e.accreditation,s]),m=(0,L.useMemo)(()=>(0,vv.A)(s.filter(t=>t.accreditationId===e.accreditation.id),e=>e.assignedResources),[e.accreditation,s]),g=(0,L.useMemo)(()=>(0,vv.A)(s.filter(t=>t.accreditationId===e.accreditation.id),e=>e.scannedResources),[e.accreditation,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Dc,{children:[(0,i.jsxs)(Ec,{align:"center",css:{cursor:"pointer",paddingLeft:"44px",userSelect:"none"},gap:"2",onClick:()=>a({...r,[e.accreditation.id]:!d}),children:[e.accreditation.hasSlots&&(0,i.jsx)(Na,{align:"center",css:{color:"$gray800"},height:32,justify:"center",width:32,children:(0,i.jsx)(el,{icon:d?"chevron-up":"chevron-right"})}),(0,i.jsx)(FC,{color:e.accreditation.color,icon:e.accreditation.icon}),(0,i.jsx)(yr,{children:e.accreditation.name})]}),l&&(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(h)}),(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(m)}),(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(u)}),(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(g)})]}),e.accreditation.hasSlots&&d&&c.map(e=>(0,i.jsx)(aw,{slot:e},`s-${e.id}`))]})},dw=e=>{const t=qn(xv),{delegationAccreditations:n,delegationAccreditationsSlots:s,categoryIdToOpen:o,categoryIdToAccreditations:r,setCategoryIdToOpen:a,showWished:l}=hw(),d=o[e.category.id]??!0,c=(0,L.useMemo)(()=>SC(r[e.category.id]),[r,e.category.id]),u=(0,L.useMemo)(()=>{const t=(0,Ya.A)(n.filter(t=>t.accreditationCategoryId===e.category.id).map(e=>{if("number"==typeof e.maxResources)return e.maxResources;{const t=s.filter(t=>t.accreditationId===e.accreditationId&&"number"==typeof t.maxResources);return no(t)?(0,vv.A)(t,e=>e.maxResources):null}}));return no(t)?(0,Zg.A)(t):null},[e.category,n,s]),h=(0,L.useMemo)(()=>(0,vv.A)(s.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.wishedResources),[e.category,s]),m=(0,L.useMemo)(()=>(0,vv.A)(s.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.assignedResources),[e.category,s]),g=(0,L.useMemo)(()=>(0,vv.A)(s.filter(t=>t.accreditationCategory.id===e.category.id),e=>e.scannedResources),[e.category,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Dc,{css:{background:"$gray100"},children:[(0,i.jsxs)(Ec,{align:"center",css:{cursor:"pointer",userSelect:"none"},gap:"2",onClick:()=>a({...o,[e.category.id]:!d}),children:[(0,i.jsx)(Na,{align:"center",css:{color:"$gray800"},height:32,justify:"center",width:32,children:(0,i.jsx)(el,{icon:d?"chevron-up":"chevron-right"})}),(0,i.jsx)(yr,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"medium",children:e.category.name})]}),l&&(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(h)}),(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(m)}),(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(u)}),(0,i.jsx)(Ec,{width:150,children:t.toNumberOrInfinity(g)})]}),d&&c.map(e=>(0,i.jsx)(lw,{accreditation:e},`a-${e.id}`))]})},cw=(0,L.createContext)({}),uw=e=>{const{translate:t,params:{organizationId:n}}=_l(),s=qn(Kc),o=(0,L.useMemo)(()=>(0,lc.A)((0,ph.A)(e.accreditationsSlots.map(e=>e.accreditationCategory),e=>e.id),e=>e.name.toLowerCase()),[e.accreditationsSlots]),r=(0,L.useMemo)(()=>(0,rc.A)((0,ac.A)((0,ph.A)(e.accreditations.map(e=>e.accreditation),e=>e.id),e=>e.accreditationCategoryId),e=>(0,lc.A)(e,e=>e.name.toLowerCase())),[e.accreditations]),a=(0,L.useMemo)(()=>(0,rc.A)((0,ac.A)(e.accreditationsSlots.map(e=>({...e.accreditationSlot,name:Oh(s,e.accreditationSlot,"",{date:{localeFormat:Js.DateOnly.WeekdayLongMonthLong}})})),e=>e.accreditationId),e=>Ph(e)),[e.accreditationsSlots]),l=(0,L.useMemo)(()=>e.accreditations.some(e=>!e.willAutoAccredit&&!e.accreditation.willAutoAccredit),[e.accreditations]),[d,c]=cy(n,"eventDelegationAccreditations.categoryIdToOpen",{}),[u,h]=cy(n,"eventDelegationAccreditations.accreditationIdToOpen",{});return(0,i.jsx)(cw.Provider,{value:{accreditationIdToOpen:u,accreditationIdToSlots:a,categories:o,categoryIdToAccreditations:r,categoryIdToOpen:d,delegationAccreditations:e.accreditations,delegationAccreditationsSlots:e.accreditationsSlots,setAccreditationIdToOpen:h,setCategoryIdToOpen:c,showWished:l},children:(0,i.jsxs)(kc,{hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:t("cat_gorie_accr_40335")}),l&&(0,i.jsx)(Vc,{width:150,children:t("souhait_es_78101")}),(0,i.jsx)(Vc,{width:150,children:t("affect_es_00048")}),(0,i.jsx)(Vc,{width:150,children:t("quota_00069")}),(0,i.jsx)(Vc,{width:150,children:t("scann_es_13169")})]}),o.map(e=>(0,i.jsx)(dw,{category:e},`c-${e.id}`))]})})};function hw(){return(0,L.useContext)(cw)}const mw=e=>{const{translate:t,params:{organizationId:n}}=_l(),[s,o]=(0,L.useState)(""),[r,a]=cy(n,"eventDelegationAccreditations.rendering","calendar"),[l,d]=(0,L.useState)(e.event.delegation.minAccreditationSlotDate),c=(0,L.useMemo)(()=>l?.isValid?l:e.event.startAt,[e.event,l]),[u,h]=(0,L.useState)(null),g=(0,L.useMemo)(()=>e.event.delegation.accreditationsSlots.filter(e=>{const t=!m(s)||e.accreditation.name.toLowerCase().includes(s.toLowerCase())||e.accreditationSlot.name.toLowerCase().includes(s.toLowerCase())||"table"!==r||e.accreditationCategory.name.toLowerCase().includes(s.toLowerCase()),n=!u?.isValid||!!e.accreditationSlot.date?.isValid&&u.toSQLDate()===e.accreditationSlot.date.toSQLDate();return t&&n}),[e.event,s,r,u]);return(0,i.jsxs)(Na,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Na,{css:{background:"white",padding:"$5 $5"},gap:"3",children:[(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:s,onChange:o})}),(0,i.jsx)(yr,{css:{flex:"1"}}),"calendar"===r&&(0,i.jsx)(ZA,{max:e.event.endAt,min:e.event.startAt,value:c,onChange:d}),"table"===r&&(0,i.jsx)(yr,{width:160,children:(0,i.jsx)(Du,{max:e.event.endAt,min:e.event.startAt,value:u,onChange:h})}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"table"===r?"table":"calendar",children:t("table"===r?"vue_tableau_18026":"vue_calendrier_58086")})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"calendar",onClick:()=>a("calendar"),children:t("vue_calendrier_58086")}),(0,i.jsx)(Gd,{icon:"table",onClick:()=>a("table"),children:t("vue_tableau_18026")})]})]})]}),"table"===r?(0,i.jsx)(uw,{accreditations:e.event.delegation.accreditations,accreditationsSlots:g}):(0,i.jsx)(rw,{accreditations:e.event.delegation.accreditations,accreditationsSlots:g,event:e.event,isEventAdmin:e.isEventAdmin,selectedDay:c})]})},gw=()=>{const e=Yn();return(0,i.jsx)(Na,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},height:1,justify:"center",width:1,children:(0,i.jsx)(yr,{height:250,width:1,children:(0,i.jsx)(Nk,{title:e("aucune_accr_dit_27643")})})})},pw=e=>{const{params:{eventId:t,delegationId:n}}=_l(),{data:s,loader:o}=Zn("query DelegationAccreditations(\n $eventId: EventId!\n $delegationId: DelegationId!\n $onlyVisible: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n delegation(id: $delegationId) {\n minAccreditationSlotDate\n\n accreditations {\n accreditationId\n accreditationCategoryId\n willAutoAccredit\n maxResources\n\n accreditation {\n id\n accreditationCategoryId\n name\n color\n icon\n hasSlots\n index\n willAutoAccredit\n }\n }\n\n accreditationsSlots(onlyVisible: $onlyVisible) {\n ...DelegationAccreditationSlotStats\n\n accreditationSlot {\n id\n accreditationId\n date\n name\n }\n\n accreditation {\n name\n color\n index\n }\n\n accreditationCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:t,delegationId:n,onlyVisible:e.onlyVisible},[Ls.DelegationAccreditationSlotStatsFragment]);return o||(no(s.event?.delegation.accreditationsSlots)?(0,i.jsx)(mw,{event:s.event,isEventAdmin:e.isEventAdmin}):(0,i.jsx)(gw,{}))},fw=e=>{const{params:{organizationId:t,eventId:n,delegationId:s},translate:o}=_l(),{mutate:r,isLoading:a}=Po(),l=(0,L.useMemo)(()=>e.customDocuments.filter(t=>t.slug===e.slug),[e.customDocuments,e.slug]),d=(0,L.useMemo)(()=>no(l)?l.map(e=>e.name).join(", "):en.includes(e.slug)?P_(e.slug):null,[l,e.slug]),c=no(l);return d?(0,i.jsxs)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Na,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(el,{icon:"file-lines"})}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 textSm medium",children:d}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",isLoading:a,leftIcon:"download",onClick:()=>r({organizationId:t,eventId:n,delegationId:s,documentsExport:{badgeType:c?null:e.slug,customDocumentSlug:c?e.slug:null,documentType:c?Ee.UserCustomDocument:Ee.CustomBadge,language:yt.Fr,oneFile:!1,segmentsIds:[],strategy:we.OnePerPage}})})})}),(0,i.jsx)(Cm,{placement:"top",children:o("recevoir_les_do_31669")})]})]}):null},xw=e=>{const{translate:t}=_l();return(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("documents_dispo_46996")}),(0,i.jsx)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:e.delegationsSpaceCustomBadges.map(t=>(0,i.jsx)(fw,{customDocuments:e.customDocuments,slug:t},t))})]})},_w=pr(yr,{overflow:"hidden",textOverflow:"ellipsis"}),Iw=e=>{const t=qn(rC);switch(e.field.fieldType){case Ve.File:{const n=t.getValue(e.field,e.fields);return n?(0,i.jsx)(hv,{acl:"public-read",document:n}):(0,i.jsx)(_w,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:"-"})}case Ve.Phone:{const n=t.getValueString(e.field,e.fields);return(0,i.jsx)(_w,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:m(n)?(0,i.jsx)(qc,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:`tel:${n}`,children:n}):"-"})}default:{const n=t.getValueString(e.field,e.fields);return(0,i.jsx)(_w,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:m(n)?URL.canParse(n)?(0,i.jsx)(qc,{css:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},hideIcon:!0,to:n,children:n}):n:"-"})}}},vw=e=>(0,i.jsx)(Na,{css:{background:"white",bd:!0,...e.css},direction:"column",width:1,children:(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsxs)(Na,{css:{borderBottom:e.hideTitleBorder?void 0:"1px solid $gray200",paddingBottom:e.hideTitleBorder?"0":"$5",paddingTop:"$5",px:"$6"},gap:"3",width:1,children:[(0,i.jsx)(yr,{color:"gray900",css:{flex:"1",alignContent:"center"},fontSize:"textMd",fontWeight:"semiBold",children:e.title}),e.rightIcon&&(0,i.jsx)(yr,{color:"gray900",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"semiBold",textAlign:"center",width:20,onClick:t=>{e.rightIconClick?.(t)},children:(0,i.jsx)(el,{icon:e.rightIcon})}),e.select]}),(0,i.jsx)(yr,{className:"h-detail-box-content",css:{flex:"1",padding:"$6"},width:1,children:e.children})]})}),bw=({css:e,title:t,children:n})=>(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:t}),(0,i.jsx)(Na,{css:{bd:!0,padding:"$4",...e},direction:"column",children:n})]}),jw=({children:e,...t})=>wc()?(0,i.jsx)(bw,{...t,children:e}):(0,i.jsx)(vw,{...t,children:e});var Cw=n(6502),yw=n(2716);function kw(e){return e<=.2?fr.colors.error500.value:e<.7?fr.colors.warning500.value:e<=1?fr.colors.success500.value:fr.colors.blueGray500.value}const Aw=({percent:e,prospectivePercent:t})=>(0,i.jsxs)(yr,{css:{background:"$gray100",borderRadius:"$1",position:"relative"},height:8,width:1,children:[(0,i.jsx)(yr,{css:{background:kw(e),borderRadius:"$1",left:0,maxWidth:"100%",position:"absolute",top:0,width:100*e+"%"},height:1}),void 0!==t&&(0,i.jsx)(yr,{css:{background:kw(t),borderRadius:"$1",left:0,opacity:.4,maxWidth:"100%",position:"absolute",top:0,width:100*t+"%"},height:1})]}),ww=e=>{const t=(0,L.useMemo)(()=>(0,yw.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(Math.PI/2),[]),n=(0,L.useMemo)(()=>e.total===1/0?1:0===e.total?1/0:e.count/e.total,[e.count,e.total]),s=(0,L.useMemo)(()=>{const e=(0,Cw.A)().domain([0,1]).range([-Math.PI/2,Math.PI/2]);return(0,yw.A)().innerRadius(70).outerRadius(90).cornerRadius(20).startAngle(-Math.PI/2).endAngle(e(n<=1?n:1))},[n]);return(0,i.jsxs)(yr,{css:{position:"relative","& svg":{height:"100%",width:"100%"}},height:90,width:180,children:[(0,i.jsx)("svg",{children:(0,i.jsxs)("g",{transform:"translate(90, 90)",children:[(0,i.jsx)("path",{d:t(void 0),fill:fr.colors.gray100.value}),(0,i.jsx)("path",{d:s(void 0),fill:kw(n)})]})}),(0,i.jsxs)(Na,{align:"baseline",css:{bottom:"0",left:"0",position:"absolute"},gap:"2",justify:"center",width:1,children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:e.count}),(0,i.jsxs)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:["/",e.total===1/0?"∞":e.total]})]})]})},Sw=(e,t=null,n={})=>(Object.entries(e).forEach(([e,i])=>{const s=t?`${t}.${e}`:e;"object"!=typeof i||null===i||Array.isArray(i)?n[s]=i:Sw(i,s,n)}),n);const Ew=/(\{([\w\.]+)\})/g;let Tw=class{fieldService;constructor(e){this.fieldService=e}renderText(e,t={}){const n={organization:t.organization||void 0,event:t.event||void 0,delegation:t.delegation||void 0,invitedBy:t?.invitedBy?this.getUser(t.invitedBy,t):void 0,recipient:t?.recipient?this.getUser(t.recipient,t):void 0,user:t.userInfo?this.getUser(t.userInfo,t):void 0,...t.extraInfos},i=Sw(n);return Object.entries(i).reduce((e,[t,n])=>e.replaceAll(`{${t}}`,n),e).replace(Ew,(e,n,i)=>{const[s,o,r,a]=i.split("."),l=t?.userInfo?{lang:this.getLanguage(t.userInfo)}:{};if(8===a?.length?l.date=a:16===a?.length&&(l.date=a.substring(0,8),l.endDate=a.substring(8)),t.userInfo?.links){const e=t.userInfo.links;return i.includes("planningDays")?ug(e.userPlanningDaysLink,"pdf",l):i.includes("planningList")?ug(e.userPlanningListLink,"pdf",l):i.includes("planning")?ug(e.userPlanningLink,"pdf",l):i.includes("assignments")?ug(e.userAssignmentsLink,"pdf",l):i.includes("paris20kmassignment")&&e?.userCustomBadgeLinks[fe.Paris20kmassignment]?ug(e.userCustomBadgeLinks[fe.Paris20kmassignment],"pdf",l):""}return""})}getUser(e,t){const n=t.customFields||[],i=this.getFields(e,n),s=this.getLanguage(e),o=s?{lang:s.toString()}:{},r=e.links?ug(e.links.userAssignmentsLink,"pdf",o):"",a=e.links?ug(e.links.userPlanningLink,"pdf",o):"",l=e.links?ug(e.links.userPlanningListLink,"pdf",o):"",d=e.links?ug(e.links.userPlanningDaysLink,"pdf",o):"",c=e.links?{assignments:r,badge:ug(e.links.userBadgeLink,"pdf",o),certificate:ug(e.links.userCertificateLink,"pdf",o),planning:a,planningList:l,planningDays:d,...Object.fromEntries(Object.entries(e.links.userCustomBadgeLinks).map(([e,t])=>[e.toLowerCase(),ug(t,"pdf",o)])),...Object.fromEntries(Object.entries(e.links.userCustomDocumentLinks).map(([e,t])=>[e,ug(t,"pdf",o)]))}:{},u=t.volunteerRegistration?.ticketId??"",h=(e.fields.isExpanded?e.fields?.firstName?.value:e.fields.firstName)||"",m=(e.fields.isExpanded?e.fields?.lastName?.value:e.fields.lastName)||"",g=`
\n \n
`;return{id:e.id,localId:t.volunteerRegistration?.localId||"",email:e.email,...i,firstName:h,lastName:m,ticketId:u,qrcode:g,memberCode:t.volunteerRegistration?.weezevent?.memberCode||"",name:Ag({firstName:h,lastName:m}),registrationDate:e.registrationDate?.toFormat(t.organization?.datetimeFormat??"yyyy-MM-dd HH:mm")??"",assignmentSheet:t.event?r:"",documents:c,delegation:{name:t.volunteerRegistration?.delegation?.name??"",leader:{firstName:t.volunteerRegistration?.delegation?.leaders?.[0]?.firstName??"",lastName:t.volunteerRegistration?.delegation?.leaders?.[0]?.lastName??"",phone:t.volunteerRegistration?.delegation?.leaders?.[0]?.phone?.internationalFormat??""}},weezevent:{barcode:u,qrcode:g,identificationNumber:""}}}getFields(e,t){return e.fields.isExpanded?Object.fromEntries(Object.entries(e.fields).map(([e,{value:t}])=>[e,no(t)?t.join(", "):m(t)?t:""])):Object.fromEntries(t.map(t=>[t.slug,this.fieldService.getValueString(t,e.fields)]))}getLanguage(e){return e.fields.isExpanded?e.fields?.language?.rawValue:e.fields?.language}};Tw=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[rC])],Tw);const zw=({description:e})=>{const t=Yn();return(0,i.jsx)(jw,{title:t("description_58935"),children:m(e)?(0,i.jsx)(xg,{text:e}):(0,i.jsx)(yr,{color:"gray500",textAlign:"center",width:1,children:t("aucune_descript_25737")})})},Ow=({privateNote:e})=>{const t=Yn();return(0,i.jsx)(jw,{title:(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(el,{icon:"lock"}),(0,i.jsx)(yr,{children:t("note_priv_e_06303")})]}),children:m(e)?(0,i.jsx)(xg,{text:e}):(0,i.jsx)(yr,{color:"gray500",textAlign:"center",width:1,children:t("aucune_note_pri_86832")})})};let Rw=class extends Ul{constructor(e){super(e)}associateTagsIdsSchema(){return d.Ik().shape({tagsIds:d.YO().of(d.ai())})}};Rw=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],Rw);const $w=e=>{const t=Yn(),n=qn(Rw),[s,o]=(0,L.useState)(e.tags),[r,a]=(0,L.useState)(!1);return(0,i.jsx)(Jj,{buttonText:t("enregistrer_06519"),icon:"tag",initialValues:{tagsIds:e.tagsIds},schema:n.associateTagsIdsSchema(),size:"md",subtitle:e.subtitle,title:t("ajout_d_un_ou_p_17767"),onClose:e.onClose,onSubmit:async t=>{e.onSave(t.tagsIds)},children:({form:t,values:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Um,{isCreateVisible:!0,isSearchVisible:!0,multiple:!0,name:"tagsIds",onCreateClick:()=>{a(!0)},children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.name))}),r&&(0,i.jsx)(Qj,{organizationId:e.organizationId,onClose:()=>{a(!1)},onSuccess:e=>{o([...s,e]),t.change("tagsIds",[...n.tagsIds,e.id])}})]})})},Dw=e=>{const{data:t,loader:n}=(s={organizationId:e.organizationId},Zn(xo,s,[]));var s;return n?null:(0,i.jsx)($w,{organizationId:e.organizationId,subtitle:e.subtitle,tags:t.organization.tags.nodes,tagsIds:e.tagsIds,onClose:e.onClose,onSave:e.onSave})},Pw=e=>{const t=Yn(),{organizationId:n}=Jn(),[s,o]=(0,L.useState)(!1);return"associateTags"in e?(0,i.jsxs)(jw,{rightIcon:"pen",rightIconClick:()=>{o(!0)},title:t("tags_79499"),children:[no(e.tags)?(0,i.jsx)(Na,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(ic,{children:e.name},e.id))}):(0,i.jsx)(yr,{color:"gray500",textAlign:"center",width:1,children:t("aucun_tag_ajout_63348")}),s&&(0,i.jsx)(Dw,{organizationId:n,subtitle:e.modalSubtitle,tagsIds:e.tags.map(({id:e})=>e),onClose:()=>{o(!1)},onSave:async t=>{await e.associateTags(t),e.reload(),o(!1)}})]}):(0,i.jsx)(jw,{title:t("tags_79499"),children:no(e.tags)?(0,i.jsx)(Na,{gap:"2",wrap:"wrap",children:e.tags.map(e=>(0,i.jsx)(ic,{children:e.name},e.id))}):(0,i.jsx)(yr,{color:"gray500",textAlign:"center",width:1,children:t("aucun_tag_ajout_63348")})})},Fw=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=_l(),{hasFeature:r}=yI(),a=qn(Kc),l=qn(Tw),{isOrganizationAdmin:d}=yI(),{mutate:c}=To(),u=(0,L.useMemo)(()=>ag({organizationId:n,eventId:s,delegationId:o,formId:e.delegation?.form.id}),[e.delegation]),h=(0,L.useMemo)(()=>rg(n,ds.DELEGATION({organizationId:n,eventId:s,delegationId:o})),[e.delegation]),g=(0,L.useMemo)(()=>m(e.delegation.description)?l.renderText(e.delegation.description,{delegation:{...e.delegation,formLink:u}}):"",[e.delegation]),p=(0,L.useMemo)(()=>e.delegation.usedCustomFields.concat(e.customFields),[e.customFields,e.delegation]),f=(e,t)=>(0,i.jsxs)(Na,{children:[(0,i.jsx)(yr,{textAlign:"start",children:e}),(0,i.jsx)(yr,{css:{borderBlockEnd:"2px dotted $gray500",flex:"1",marginBlockEnd:"$1"}}),(0,i.jsx)(yr,{color:"gray900",css:{fontSize:"$textMd"},textAlign:"end",children:t})]});return(0,i.jsx)(ej,{children:(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsx)(Na,{css:{flex:"3",height:"100%"},direction:"column",gap:"6",children:(0,i.jsx)(jw,{css:{flex:"1 1"},title:t("limite_de_membr_42978"),children:(0,i.jsxs)(Na,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:[(0,i.jsx)(yr,{css:{margin:"auto"},children:(0,i.jsx)(ww,{count:e.delegation.numberOfResources,total:e.delegation.maxResources??1/0})}),(0,i.jsx)(Na,{direction:"column",gap:"4",children:r(Ne.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray700",css:{fontSize:"$textXs",fontWeight:600,fontFamily:"Open Sans",lineHeight:"18px",textTransform:"uppercase"},children:t("dont_76603")}),(0,i.jsxs)(Na,{color:"gray500",css:{fontSize:"$textSm",fontWeight:"$medium",lineHeight:"20px",justifyContent:"space-between"},direction:"column",gap:"2",children:[f(t("membres_accr_di_73664"),e.delegation.numberOfMembersAccredited),f(t("membres_en_atte_57336"),e.delegation.numberOfMembersWaitingAccreditation),f(t("membres_refus_31757"),e.delegation.numberOfMembersRefusedAccreditation)]})]})})]})})}),(0,i.jsx)(Na,{css:{flex:"6"},direction:"column",gap:"6",children:(0,i.jsx)(jw,{title:t("param_tres_78420"),children:(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Na,{gap:"3",justify:"between",children:[(0,i.jsx)(yr,{color:"gray500",children:t("cat_gorie_00291")}),(0,i.jsx)(yr,{children:(0,i.jsx)(qc,{to:ds.DELEGATION_CATEGORY({organizationId:n,eventId:s,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})]}),(0,i.jsx)(Yu,{direction:"horizontal"}),d&&e.delegation.parent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{gap:"3",justify:"between",children:[(0,i.jsx)(yr,{color:"gray500",children:t("d_l_gation_pare_68507")}),(0,i.jsx)(Na,{align:"center",css:{color:"$primary700",fontWeight:"$medium","&:hover":{textDecoration:"underline"}},gap:"2",children:(0,i.jsx)(Ja,{to:ds.DELEGATION({organizationId:n,delegationId:e.delegation.parent.id}),children:(0,i.jsx)(ic,{color:"white",cursor:"pointer",size:"md",children:e.delegation.parent.name},e.delegation.parent.id)})})]}),(0,i.jsx)(Yu,{direction:"horizontal"})]}),(0,i.jsxs)(Na,{gap:"3",justify:"between",children:[(0,i.jsx)(yr,{color:"gray500",children:t("status_06428")}),(0,i.jsx)(yr,{color:"gray800",children:(0,i.jsx)(ic,{color:"success",children:t(e.delegation.state)})})]}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsxs)(Na,{gap:"3",justify:"between",children:[(0,i.jsx)(yr,{color:"gray500",children:t("date_limite_d_i_79779")}),(0,i.jsx)(yr,{color:"gray800",children:e.delegation.deadlineDate?a.toLocaleString(e.delegation.deadlineDate,Js.DateOnly.MonthLong):"-"})]}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsxs)(Na,{gap:"3",justify:"between",children:[(0,i.jsx)(yr,{color:"gray500",children:t("Form")}),(0,i.jsx)(qc,{css:{color:"$primary700"},to:u,children:e.delegation.form.name})]}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsxs)(Na,{gap:"3",justify:"between",children:[(0,i.jsx)(yr,{color:"gray500",children:t("DelegationSpaceLink")}),(0,i.jsx)(qc,{css:{color:"$primary700"},to:h,children:t("portail_d_l_gat_06817")})]})]})})})]}),no(p)&&(0,i.jsx)(jw,{title:t("champs_de_formu_64126"),children:(0,i.jsx)(Na,{direction:"column",gap:"4",width:1,children:p.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsxs)(Na,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(yr,{color:"gray500",css:{flex:"1"},children:t.name}),(0,i.jsx)(Na,{justify:"end",width:300,children:(0,i.jsx)(Iw,{field:t,fields:e.delegation.fields})})]})]},t.slug))})}),(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(jw,{title:t("reponsable_82458_plural"),children:no(e.delegation.leaders)?e.delegation.leaders.map((e,t)=>(0,i.jsxs)(L.Fragment,{children:[0!==t&&(0,i.jsx)(Ku,{height:"4"}),(0,i.jsx)(uj,{userInfo:e})]},e.id)):(0,i.jsx)(yr,{color:"gray500",textAlign:"center",width:1,children:t("aucun_reponsabl_38504")})}),(0,i.jsx)(Pw,{associateTags:e=>c({organizationId:n,eventId:s,massEdit:{reset:!1,selecteds:{ids:[o]},slug:be.Tag,strategy:tt.Replace,value:e}}),modalSubtitle:t("ajouter_des_tag_35833"),reload:e.reload,tags:e.delegation.tags})]}),(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(zw,{description:g}),(0,i.jsx)(Ow,{privateNote:e.delegation.privateNote})]})]})]})})},Mw=()=>{const{params:{organizationId:e,delegationId:t}}=_l(),{data:n,loader:s,reload:o}=Zn("query DelegationDashboard($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n organization(id: $organizationId) {\n customFields(variety: Delegation, privacy: Private) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n delegation(id: $delegationId) {\n id\n name\n description\n deadlineDate\n privateNote\n state\n numberOfResources\n maxResources\n numberOfMembersAccredited\n numberOfMembersWaitingAccreditation\n numberOfMembersRefusedAccreditation\n fields\n\n delegationCategory {\n id\n name\n }\n\n parent {\n id\n name\n }\n\n form {\n id\n name\n }\n\n leaders {\n id\n email\n name\n\n picture {\n url\n }\n }\n\n tags {\n id\n name\n }\n\n usedCustomFields {\n ...CustomFieldWithCondition\n }\n }\n }\n}\n",{organizationId:e,delegationId:t},[Ls.CustomFieldWithConditionFragment]);return s||(0,i.jsx)(Fw,{customFields:n.organization.customFields.nodes,delegation:n.organization.delegation,reload:o})},Nw=e=>{switch(e){case Lw.Event:return{color:"success",leftIcon:"calendar"};case Lw.ParentDelegation:return{color:"pink",leftIcon:"people-group"};default:return rl()}};var Lw;!function(e){e.Event="event",e.ParentDelegation="parent-delegation"}(Lw||(Lw={}));const Bw=({state:e,userInfo:t,onClick:n})=>{const s=Yn(),o=m(t.name);return(0,i.jsxs)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},onClick:n,children:[(0,i.jsx)(mc,{shouldPreventDefault:!1,state:e,onClick:Ql.A}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsx)(Jg,{email:t.email,image:t.picture?.url,name:t.name,size:40}),(0,i.jsx)(qa,{width:"4"}),(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(yr,{ellipsis:!0,color:"gray700",children:o?t.name:t.email}),o&&(0,i.jsx)(yr,{ellipsis:!0,color:"gray500",children:t.email})]}),t.source&&(0,i.jsx)(yr,{children:(0,i.jsx)(ic,{...Nw(t.source),leftIconStyle:"solid",children:t.source===Lw.Event?s("_v_nement_22345"):s("d_l_gation_pare_68507")})})]})},Vw=({availableMembers:e,select:t,usersInfosIds:n})=>(0,i.jsx)(i.Fragment,{children:e.map(e=>{const s=n.includes(e.id)?"checked":"unchecked";return(0,i.jsx)(Bw,{state:s,userInfo:e,onClick:()=>{t(e.id)}},e.id)})}),Uw=({delegationId:e,nameOrEmail:t,organizationId:n,usersInfosIds:s,select:o})=>{const{data:r,loader:a}=wa({organizationId:n,excludedDelegationId:e,name:m(t)?t:null});return a||(0,i.jsx)(Vw,{availableMembers:r.organization.usersInfos.nodes,select:o,usersInfosIds:s})},Ww=({delegationId:e,eventId:t,nameOrEmail:n,usersInfosIds:s,select:o})=>{const{data:r,loader:a}=Zn("query EventUsersInfos($eventId: EventId!, $delegationId: DelegationId!, $name: String) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n parentUsersInfos(name: $name) {\n ...ExistingVolunteer\n }\n }\n\n volunteersRegistrations(excludeDelegationMembers: true, name: $name, limit: 25) {\n nodes {\n userInfo {\n ...ExistingVolunteer\n }\n }\n }\n }\n}\n",{eventId:t,delegationId:e,name:m(n)?n:null},[Ls.ExistingVolunteerFragment]);const l=(0,L.useMemo)(()=>{if(r.event){const e=r.event.volunteersRegistrations.nodes.map(e=>({...e.userInfo,source:Lw.Event})),t=e.map(({id:e})=>e),n=r.event.delegation.parentUsersInfos.flatMap(e=>t.includes(e.id)?[]:[{...e,source:Lw.ParentDelegation}]);return e.concat(n)}return[]},[r.event]);return a||(0,i.jsx)(Vw,{availableMembers:l,select:o,usersInfosIds:s})},Gw=({delegationId:e,eventId:t,organizationId:n,onClose:s,reload:o})=>{const r=Yn(),a=qn(Dj),[l,d,c]=Bc(""),{mutate:u}=Jo(),{mutate:h}=Ta();return(0,i.jsx)(Jj,{buttonText:r("ajouter_un_memb_33261"),icon:"sliders",initialValues:{usersInfosIds:[]},schema:a.adminAddSchema(),size:"md",subtitle:r(t?"ajouter_un_memb_95658":"ajouter_un_memb_89696"),title:r("add_member_to_delegation"),onClose:s,onSubmit:async i=>{t?await u({eventId:t,delegationId:e,selecteds:{ids:i.usersInfosIds}}):await h({organizationId:n,delegationId:e,selecteds:{ids:i.usersInfosIds}}),s(),o()},children:({form:s,values:o})=>{const a=e=>{s.change("usersInfosIds",oo(o.usersInfosIds,e))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:r("rechercher_un_m_05904"),value:l,onChange:c}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(vl,{}),(0,i.jsx)(Na,{css:{flex:"1",overflowY:"auto"},direction:"column",children:t?(0,i.jsx)(Ww,{delegationId:e,eventId:t,nameOrEmail:d,select:a,usersInfosIds:o.usersInfosIds}):(0,i.jsx)(Uw,{delegationId:e,nameOrEmail:d,organizationId:n,select:a,usersInfosIds:o.usersInfosIds})})]})}})},Hw=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{showNotification:o}=kb(),{mutate:r}=na();return(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_66412"),text:t("suppression_de_73669",e.delegation.name),onClose:e.onClose,onDelete:async()=>{await r({organizationId:n,eventId:s,selecteds:{ids:[e.delegation.id]}}),o(t("la_d_l_gation_31201",e.delegation.name)),e.onSuccess()}})},qw=({delegation:e,reload:t})=>{const{history:n,translate:s,params:{organizationId:o,eventId:r,delegationId:a}}=_l(),{isOrganizationAdmin:l}=yI(),{isEventAdmin:d,hasPermission:c}=vb(),{mutate:u}=ea(),{mutate:h}=Ko(),{mutate:m}=To(),[g,p]=(0,L.useState)(!1),[f,x]=(0,L.useState)(!1),_=l||d,I=l||c?.(Nb.MEMBER_ACCREDIT),v=l||c?.(Nb.DELEGATION_EDIT),b=e.lockedAt?.isValid;return(0,i.jsxs)(tj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(bj,{returnPathFallback:ds.DELEGATIONS({organizationId:o,eventId:r})}),(0,i.jsxs)(Na,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(yr,{font:"gray900 displayXs medium",children:e.name}),b&&(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"error600",fontSize:"textMd",children:(0,i.jsx)(el,{icon:"lock-keyhole"})})}),(0,i.jsx)(Cm,{placement:"top",children:s("cette_d_l_gatio_29556")})]})]}),_&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",disabled:e.numberOfResources>=(e.maxResources??1/0),children:s("ajouter_un_memb_33261")})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"user-plus",onClick:()=>{n.push(qI.CREATE({organizationId:o,eventId:r,delegationId:a}))},children:s("ajouter_un_nouv_29283")}),(0,i.jsx)(Gd,{icon:"user-group",onClick:e=>{Nd(e.target),x(!0)},children:s("ajouter_des_mem_06922")})]})]}),v&&(0,i.jsx)(El,{to:gi(ds.DELEGATION({organizationId:o,eventId:r,delegationId:e.id})),children:s("_diter_la_d_l_g_30300")}),(I||v)&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[I&&r&&(0,i.jsx)(Gd,{icon:"check",onClick:async()=>{await h({eventId:r,delegationId:e.id}),t()},children:s("valider_les_acc_80801")}),v?b?(0,i.jsx)(Gd,{icon:"lock-keyhole-open",onClick:async()=>{await m({organizationId:o,eventId:r,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:be.IsLocked,strategy:tt.Replace,value:!1}}),t()},children:s("d_verrouiller_67042")}):(0,i.jsx)(Gd,{icon:"lock-keyhole",onClick:async()=>{await m({organizationId:o,eventId:r,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:be.IsLocked,strategy:tt.Replace,value:!0}}),t()},children:s("verrouiller_24528")}):null,v&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>{const{delegationDuplicate:t}=await u({organizationId:o,eventId:r,delegationId:e.id});n.push(gi(ds.DELEGATION({organizationId:o,eventId:r,delegationId:t.id})))},children:s("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:s("supprimer_43083")})]})]})]}),g&&(0,i.jsx)(Hw,{delegation:e,onClose:()=>p(!1),onSuccess:()=>n.replace(r?ds.DELEGATIONS({organizationId:o,eventId:r}):$s.COMMUNITY_DELEGATIONS(o))}),f&&(0,i.jsx)(Gw,{delegationId:e.id,eventId:r,organizationId:o,reload:t,onClose:()=>{x(!1)}})]})};var Yw=n(6349);const Kw=e=>({title:{display:!0,font:{weight:500},padding:{bottom:30},text:e}}),Zw=()=>({border:{display:!1},grid:{color:fr.colors.gray100.value}}),Xw=({datasets:e,labels:t,options:n})=>{const s=(0,L.useMemo)(()=>(0,Wa.A)("chart-"),[]),o=(0,L.useRef)(null),r={animation:!1,datasets:{bar:{borderRadius:8}},maintainAspectRatio:!1,plugins:{legend:{align:"end",labels:{useBorderRadius:!0,borderRadius:5,boxWidth:10,boxHeight:10}}},scales:{x:{grid:{display:!1}},y:Zw()}};return(0,L.useEffect)(()=>{o.current&&o.current.destroy(),o.current=new Yw.Ay(document.getElementById(s),{type:"bar",options:(0,Ka.A)(r,n),data:{labels:t,datasets:e}})},[e,t,n]),(0,i.jsx)(yr,{height:1,width:1,children:(0,i.jsx)("canvas",{id:s})})},Jw=e=>{const t=Yn(),n=qn(Kc),s=(0,L.useMemo)(()=>Ph(e.slots),[e.slots]),o=(0,L.useMemo)(()=>e.accreditation.hasSlots?s.map(e=>Oh(n,e,"",{accreditation:{includeName:!1}})):[e.accreditation.name],[s,e.accreditation]),r=(0,L.useMemo)(()=>{const n=s.some(e=>"number"==typeof e.maxResources),i=s.some(e=>"number"==typeof e.delegationsTotalResources&&e.delegationsTotalResources>0);return(0,Ya.A)([e.accreditation.willAutoAccredit?null:{label:t("souhait_es_78101"),data:s.map(e=>e.wishedResources),backgroundColor:n?s.map(e=>e.assignedResources+e.wishedResources<=(e.maxResources??1/0)?fr.colors.primary400.value:Xd(fr.colors.primary400.value,.5)):fr.colors.primary400.value},{label:t("affect_es_00048"),data:s.map(e=>e.assignedResources),backgroundColor:n?s.map(e=>e.assignedResources<=(e.maxResources??1/0)?fr.colors.primary700.value:Xd(fr.colors.error500.value,.7)):fr.colors.primary700.value},{label:t("scann_es_13169"),data:s.map(e=>e.scannedResources),backgroundColor:fr.colors.primary900.value},n?{label:t("maximum_56225"),data:s.map(e=>e.maxResources??1/0),backgroundColor:fr.colors.gray200.value}:null,i?{label:t("total_attribu_e_97130"),data:s.map(e=>e.delegationsTotalResources??0),backgroundColor:fr.colors.gray400.value}:null])},[s]);return(0,i.jsx)(Xw,{datasets:r,labels:o,options:{scales:{y:{...Zw(),ticks:{precision:0},...Kw(t("nb_d_accr_dita_23359"))},x:{grid:{display:!1},...Kw(t(e.accreditation.hasSlots?"slots_05517":"Accreditation"))}}}})},Qw=e=>{const t=(0,L.useMemo)(()=>e.event.delegation.accreditationsSlots.filter(t=>t.accreditationId===e.accreditation.id).map(e=>({maxResources:e.maxResources,assignedResources:e.assignedResources,scannedResources:e.scannedResources,wishedResources:e.wishedResources,name:e.accreditationSlot.name,date:e.accreditationSlot.date})),[e.accreditation,e.event]);return(0,i.jsx)(jw,{title:e.accreditation.name,children:(0,i.jsx)(yr,{height:380,width:1,children:(0,i.jsx)(Jw,{accreditation:e.accreditation,slots:t})})})},eS=e=>{const t=(0,L.useMemo)(()=>SC((0,ph.A)(e.event.delegation.accreditations.map(e=>{const t=e.willAutoAccredit||e.accreditation.willAutoAccredit;return{...e.accreditation,willAutoAccredit:t}}),e=>e.id)),[e.event]);return(0,i.jsx)(Na,{direction:"column",gap:"4",children:no(t)?t.map(t=>(0,i.jsx)(Qw,{accreditation:t,event:e.event},t.id)):(0,i.jsx)(gw,{})})},tS=()=>{const{params:{eventId:e,delegationId:t}}=_l(),{data:n,loader:s}=Zn("query DelegationReporting($eventId: EventId!, $delegationId: DelegationId!) {\n event(id: $eventId) {\n delegation(id: $delegationId) {\n accreditations {\n accreditationId\n willAutoAccredit\n\n accreditation {\n id\n name\n accreditationCategoryName\n hasSlots\n index\n willAutoAccredit\n }\n }\n\n accreditationsSlots {\n accreditationId\n maxResources\n assignedResources\n scannedResources\n wishedResources\n\n accreditationSlot {\n name\n date\n }\n }\n }\n }\n}\n",{eventId:e,delegationId:t},[]);return s||(0,i.jsx)(eS,{event:n.event})},nS=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationId:o}}=_l(),{hasFeature:r,isOrganizationAdmin:a}=yI(),{isEventAdmin:l,isEventReader:d}=vb(),c=a||l,u=(0,L.useMemo)(()=>e.organization.allowDelegationSpaceDownload||no(e.organization.delegation.customDocuments??[]),[e.organization]),h=(0,L.useMemo)(()=>(e.organization.delegationsSpaceCustomBadges??[]).concat(e.organization.delegation.customDocuments.map(e=>e.slug)??[]),[e.organization]),m=(0,L.useMemo)(()=>e.organization.delegation.event?.customDocuments??[],[e.organization]),g=e=>({organizationId:e?":organizationId":n,eventId:s?e?":eventId":s:void 0,delegationId:e?":delegationId":o});return Dd(e.organization.delegation.name),(0,i.jsxs)(nj,{children:[(0,i.jsx)(qw,{delegation:e.organization.delegation,reload:e.reload}),(0,i.jsxs)(rj,{css:{flex:"1"},children:[(0,i.jsxs)(sj,{css:{px:"$7"},children:[(0,i.jsx)(ij,{path:ds.DELEGATION_DASHBOARD(g(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(ij,{path:ds.DELEGATION_MEMBERS(g(!1)),children:t("membres_125561",e.organization.delegation.numberOfResources)}),s&&r(Ne.Accreditation)&&(0,i.jsx)(ij,{path:ds.DELEGATION_ACCREDITATIONS(g(!1)),children:t("accr_ditations_39450")}),s&&r(Ne.Accreditation)&&(0,i.jsx)(ij,{path:ds.DELEGATION_REPORTING(g(!1)),children:"Reporting"}),s&&u&&(0,i.jsx)(ij,{path:ds.DELEGATION_DOCUMENTS(g(!1)),children:t("Documents")})]}),(0,i.jsx)(oj,{path:ds.DELEGATION_DASHBOARD(g(!0)),children:(0,i.jsx)(Mw,{})}),(0,i.jsx)(oj,{path:ds.DELEGATION_MEMBERS(g(!0)),children:s?(0,i.jsx)(ej,{children:(0,i.jsx)(UA,{campaigns:e.organization.delegation.campaigns,canAccredit:c,canClickMemberName:!0,canDeleteMembers:c,canEditColumns:!0,canEditMembers:c,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,customFieldsPrivacy:xe.All,deleteFromEvent:!1,getEditPath:t=>$s.EDIT_USER_DELEGATION_FORM(n,s,o,t.userInfo.id,e.organization.delegation.formId),onlyVisibleAccreditationsSlots:!d,showAccreditationsEdit:c,showAccreditationsValidate:c,showDeleteFromEvent:c,showDocumentsDownload:!0,showEditMode:c})}):(0,i.jsx)(ej,{children:(0,i.jsx)(YA,{campaigns:e.organization.delegation.campaigns,canClickMemberName:!0,canDeleteMembers:c,canEditColumns:!0,canEditMembers:c,columns:e.organization.delegation.columns,customBadges:e.organization.delegationsSpaceCustomBadges,getEditPath:e=>$s.COMMUNITY_EDIT_USER_DELEGATION(n,o,e.id),isOrganizationAdmin:c,showDocumentsDownload:!0})})}),(0,i.jsx)(oj,{path:ds.DELEGATION_ACCREDITATIONS(g(!0)),children:(0,i.jsx)(ej,{children:(0,i.jsx)(pw,{isEventAdmin:l,onlyVisible:!d})})}),(0,i.jsx)(oj,{path:ds.DELEGATION_REPORTING(g(!0)),children:(0,i.jsx)(ej,{children:(0,i.jsx)(tS,{})})}),(0,i.jsx)(oj,{path:ds.DELEGATION_DOCUMENTS(g(!0)),children:(0,i.jsx)(ej,{children:(0,i.jsx)(xw,{customDocuments:m,delegationsSpaceCustomBadges:h})})})]})]})},iS=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=_l(),{data:s,loader:o,reload:r}=Zn("query Delegation($organizationId: OrganizationId!, $delegationId: DelegationId!) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n delegation(id: $delegationId) {\n id\n name\n formId\n numberOfResources\n maxResources\n columns\n parentId\n lockedAt\n\n campaigns {\n id\n name\n }\n\n customDocuments {\n slug\n name\n }\n\n event {\n customDocuments {\n slug\n name\n }\n }\n }\n }\n}\n",{organizationId:e,delegationId:n},[Ls.OrganizationCustomFieldsFragment]);return o||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:ds.DELEGATION({organizationId:":organizationId",eventId:t?":eventId":void 0,delegationId:":delegationId"}),children:(0,i.jsx)(ni,{path:ds.DELEGATION_DASHBOARD({organizationId:e,eventId:t,delegationId:n}),replace:!0})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(nS,{organization:s.organization,reload:r})})]})},sS=({backgroundColor:e,button:t,iconColor:n,value:s,icon:o,text:r})=>(0,i.jsxs)(Na,{css:{backgroundColor:e??"$white",bd:!0,flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Na,{css:{borderBottom:t?"1px solid $gray200":"none",padding:"$6"},direction:"column",children:[o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Xj,{color:n??"primary",icon:o}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(yr,{color:"gray500",children:r}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"displayMd",fontWeight:"semiBold",children:s})]}),t&&(0,i.jsx)(Na,{css:{background:"$gray50",padding:"$4 $6"},gap:"4",justify:"end",children:t})]}),oS=e=>{const t=Yn(),[n,s,o]=Bc(""),{data:r,loader:a}=Zn("query CollaboratorsVolunteers($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n event(id: $eventId) {\n collaborators(name: $name) {\n userInfo(organizationId: $organizationId) {\n ...LeaderUserInfo\n }\n }\n\n volunteersRegistrations(name: $name, limit: 50) {\n nodes {\n userInfo {\n ...LeaderUserInfo\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,name:m(s)?s:void 0},[Ls.LeaderUserInfoFragment]);const[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(null),[h,g]=(0,L.useState)(null),{styles:p,attributes:f,update:x}=(0,Hd.E)(c,h,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,8]}}]}),_=(0,L.useMemo)(()=>c?.getBoundingClientRect().width??100,[c]),I=(0,L.useMemo)(()=>{const t=t=>void 0!==e.currentLeaders.find(e=>e.userInfo.id===t),n=(r.event?.collaborators??[]).map(({userInfo:e})=>e.id);return(r.event?.collaborators??[]).map(({userInfo:e})=>({...e,isAdmin:!0,isDisabled:t(e.id)})).concat((r.event?.volunteersRegistrations.nodes??[]).filter(({userInfo:e})=>!n.includes(e.id)).map(({userInfo:e})=>({...e,isAdmin:!1,isDisabled:t(e.id)})))},[r.event,e.currentLeaders]);return(0,L.useEffect)(()=>{x?.()},[x,l,c,I]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Na,{ref:u,onClick:e=>{Rl(e),d(!l)},children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_17775"),value:n,onChange:o})}),(0,i.jsx)(Na,{ref:g,css:{background:"white",border:"1px solid $gray100",borderRadius:"$2",boxShadow:"$md",display:l?"flex":"none",maxHeight:"360px",overflowY:"auto",py:"$2",zIndex:1e3,...p.popper},direction:"column",width:_,onClick:e=>{Rl(e)},...f.poppeer,children:a||I.map(n=>(0,i.jsxs)(Na,{align:"center",css:{cursor:n.isDisabled?"initial":"pointer",padding:"10px $4",userSelect:"none","&:hover":{background:n.isDisabled?"inherit":"$primary100"}},gap:"3",children:[(0,i.jsx)(uj,{badge:n.isAdmin&&(0,i.jsx)(ic,{color:"primary",children:t("administrateur_38490")}),disabled:n.isDisabled,userInfo:n}),!n.isDisabled&&(0,i.jsx)(El,{color:"white",leftIcon:"plus",size:"sm",onClick:()=>{e.onAdd(n)}})]},n.id))})]})},rS=e=>{const t=Yn();return(0,i.jsxs)(Na,{align:"center",gap:"5",children:[(0,i.jsx)(yr,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(uj,{userInfo:e.leader.userInfo})}),(0,i.jsx)(yr,{css:{flex:1,maxWidth:"calc(50% - 32px)"},children:(0,i.jsx)(zu,{shouldParseAsInt:!0,value:e.leader.role.id,onChange:t=>{e.onRoleChange(t)},children:e.roles.map((e,n)=>(0,i.jsx)("option",{value:e.id,children:t(e.name)},n))})}),(0,i.jsx)(yr,{color:"gray500",css:{cursor:"pointer",width:"$6",padding:"$1"},onClick:e.onDelete,children:(0,i.jsx)(el,{icon:"trash-can"})})]})},aS=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.currentLeaders),o=e.roles[0];return(0,i.jsxs)(su,{size:"lg",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"user-gear"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("modification_de_24714")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("les_responsable_92946")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(oS,{currentLeaders:n,eventId:e.eventId,organizationId:e.organizationId,onAdd:e=>{s(n.concat([{userInfo:e,role:o}]))}}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Na,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:n.map((t,o)=>(0,i.jsx)(rS,{leader:t,roles:e.roles,onDelete:()=>{s((0,dc.A)(n,t))},onRoleChange:t=>{s((0,pu.jM)(n=>{n[o].role=e.roles.find(e=>e.id===t)}))}},t.userInfo.id))}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{onClick:()=>{e.onSave(n.map(e=>({userInfoId:e.userInfo.id,roleId:e.role.id})))},children:t("enregistrer_06519")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},lS=({leaders:e})=>{const t=Yn();return no(e)?(0,i.jsx)(i.Fragment,{children:e.map((e,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Ku,{height:"4"}),(0,i.jsx)(uj,{badge:(0,i.jsx)(ic,{color:"gray",children:t(e.role.name)}),userInfo:e.userInfo})]},e.userInfo.id))}):(0,i.jsx)(yr,{color:"gray500",textAlign:"center",width:1,children:t("aucun_reponsabl_38504")})},dS=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{isEventAdmin:o}=vb(),[r,a]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jw,{rightIcon:o?"pen":void 0,rightIconClick:()=>{a(!0)},title:t("reponsable_82458_plural"),children:(0,i.jsx)(lS,{leaders:e.leaders})}),o&&r&&(0,i.jsx)(aS,{currentLeaders:e.leaders,eventId:s,organizationId:n,roles:e.roles,onClose:()=>{a(!1)},onSave:async t=>{await e.onSave(t),e.reload()}})]})},cS=e=>{const t=Yn();return"onSave"in e?(0,i.jsx)(dS,{...e}):(0,i.jsx)(jw,{title:t("reponsable_82458_plural"),children:(0,i.jsx)(lS,{leaders:e.leaders})})},uS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,delegationCategoryId:o}}=_l(),[r,a,l]=Bc(""),[d,c]=(0,L.useState)(0),{data:u,isLoading:h}=Zn("query DelegationCategoryDelegations(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n $name: String\n $offset: Int\n) {\n organization(id: $organizationId) {\n delegations(\n level: $level\n eventId: $eventId\n name: $name\n delegationsCategoriesIds: [$delegationCategoryId]\n limit: 25\n offset: $offset\n ) {\n nodes {\n id\n name\n state\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:n,eventId:s,level:s?it.Event:it.Organization,delegationCategoryId:o,name:m(a)?a:void 0,offset:d},[]);const{numberOfPages:g,totalCount:p}=ku(u.organization?.delegations);return(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_une_31213"),value:r,onChange:l})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:t("nom_de_la_d_l_g_28087")}),(0,i.jsx)(Vc,{children:t("status_06428")})]}),numberOfPages:g,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):u.organization.delegations.nodes.map(o=>(0,i.jsxs)(Dc,{css:{cursor:"pointer"},onClick:()=>{e.push(ds.DELEGATION({organizationId:n,eventId:s,delegationId:o.id}))},children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{font:"gray900 textSm medium",children:o.name})}),(0,i.jsx)(Ec,{children:(0,i.jsx)(ic,{...$j(o.state),children:t(o.state)})})]},o.id)),setOffset:c,title:t("liste_des_d_l_g_86270"),totalCount:p})},hS=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationCategoryId:o}}=_l(),{roles:r}=yI(),{mutate:a}=function(e={}){return Xn("mutation DelegationsCategoriesMassLeadersEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massLeaders: MassLeadersInput!\n) {\n delegationsCategoriesMassLeadersEdit(\n organizationId: $organizationId\n eventId: $eventId\n massLeaders: $massLeaders\n )\n}\n",e)}();return(0,i.jsx)(ej,{children:(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[(0,i.jsxs)(Na,{gap:"6",width:1,children:[(0,i.jsx)(sS,{text:t("nombre_de_d_l_g_45708"),value:e.delegationCategory.numberOfDelegations}),(0,i.jsx)(sS,{text:t("number_of_membe_24698"),value:e.delegationCategory.numberOfResources})]}),(0,i.jsx)(Na,{children:(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(uS,{})})}),(0,i.jsx)(Na,{children:(0,i.jsx)(cS,{leaders:e.delegationCategory.leaders,reload:e.reload,roles:r.delegationCategoryRoles,onSave:e=>a({organizationId:n,eventId:s,massLeaders:{leaders:e,selecteds:{ids:[o]},strategy:tt.Replace}})})})]})})},mS=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation DelegationCategoryDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n) {\n delegationCategoryDelete(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954"),t("cela_supprimera_35330")],text:t("suppression_de_73669",e.delegationCategory.name),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,eventId:e.eventId,delegationCategoryId:e.delegationCategory.id}),e.onSuccess()}})},gS=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),{isOrganizationAdmin:r}=yI(),{hasPermission:a}=vb(),{mutate:l}=function(e={}){return Xn("mutation DelegationCategoryDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationCategoryId: DelegationsCategoryId!\n) {\n delegationCategoryDuplicate(\n organizationId: $organizationId\n eventId: $eventId\n delegationCategoryId: $delegationCategoryId\n ) {\n id\n }\n}\n",e)}(),d=r||a(Nb.DELEGATION_EDIT),[c,u]=(0,L.useState)(!1),[h,m]=(0,L.useState)(!1);return(0,i.jsxs)(tj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(bj,{returnPathFallback:ds.DELEGATIONS({organizationId:s,eventId:o})}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.category.name}),d&&(0,i.jsx)(El,{color:"white",onClick:()=>m(!0),children:n("_diter_62574")}),d&&(0,i.jsx)(El,{onClick:()=>{t.push(o?$s.CREATE_DELEGATION(s,o,e.category.id):$s.COMMUNITY_CREATE_DELEGATION(s,e.category.id))},children:n("ajouter_une_d_l_79133")}),d&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"copy",onClick:async()=>{const{delegationCategoryDuplicate:{id:n}}=await l({organizationId:s,eventId:o,delegationCategoryId:e.category.id});t.push(ds.DELEGATION_CATEGORY({organizationId:s,eventId:o,delegationCategoryId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{u(!0)},children:n("supprimer_43083")})]})]}),h&&(0,i.jsx)(XC,{delegationCategory:e.category,eventId:o,organizationId:s,onClose:()=>{m(!1)},onSuccess:e.reload}),c&&(0,i.jsx)(mS,{delegationCategory:e.category,eventId:o,organizationId:s,onClose:()=>{u(!1)},onSuccess:()=>{t.replace(ds.DELEGATIONS({organizationId:s,eventId:o}))}})]})},pS=()=>{const{params:{organizationId:e,eventId:t,delegationCategoryId:n}}=_l(),s=qn(Hh),o=qn(GA),{isOrganizationAdmin:r}=yI(),{isEventAdmin:a}=vb(),l=r||a,[d,c,u]=cy(e,"delegationCategoryMembers.columns",["name","delegations"]),[h,m,g]=cy(e,"delegationCategoryMembers.limit",Tc),[p,f,x]=cy(e,"delegationCategoryMembers.predicates",[]),[_,I,v]=cy(e,"delegationCategoryMembers.sort",null),{data:b,isLoading:j}=Zn("query DelegationCategoryMembersInfos($organizationId: OrganizationId!, $eventId: EventId) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: All) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n isWeezeventConnected\n }\n }\n}\n",{organizationId:e,eventId:t},[Ls.SegmentCustomFieldFragment]),C=u||g||x||v||j,y=(0,L.useMemo)(()=>b.organization?.customFields.nodes??[],[b.organization]),k=uy(y),A=(0,L.useMemo)(()=>b.organization?t?s.getDelegationCategoryMembersFilters(e,t,y,b.organization.event,b.organization?.event?.isWeezeventConnected??!1):o.getDelegationMembersFilters(y):[],[t,y]),w=(0,L.useMemo)(()=>t?s.getDelegationCategoryMembersPossibleColumns(y,b.organization?.event?.isWeezeventConnected??!1):o.getDelegationMembersPossibleColumns(y),[t,y,b]);return C?(0,i.jsx)(kl,{}):(0,i.jsx)(ej,{children:(0,i.jsx)(mm,{columns:d,columnsSearch:[],columnsToIncludes:t?Gh:WA,eventId:t,filters:A,getMassActionId:e=>t?e.userInfo.id:e.id,limit:h,loadDataList:t?or:Wo,loadDataListParams:{delegationCategoryId:n,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:t?ir:Uo,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:e,possibleColumns:w,predicates:p,renderActions:(e,t,n)=>(0,i.jsx)(DA,{campaigns:[],customFields:y,deleteFromEvent:!1,massActions:e,showAccreditationsEdit:!1,showAccreditationsValidate:!1,showDelete:!1,showWishedAccreditationsEdit:!1,onMassEditSuccess:n}),rendering:Bh.List,setColumns:c,setLimit:m,setPredicates:f,setSort:I,showEditColumns:!0,showEditMode:l,showFilters:!0,showMassActions:l,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:_,children:(0,i.jsx)(Am,{renderCell:(e,n,s)=>t?(0,i.jsx)(bk,{canAccredit:!0,canAssign:!1,canChangeDelegation:!0,canClickMemberName:!0,column:e,customField:k.get(e.slug),eventId:t,reloadRow:s,row:n}):(0,i.jsx)(qA,{canClickMemberName:!0,column:e,customField:k.get(e.slug),reloadRow:s,row:n,updatable:!0})})})})},fS=e=>{const{translate:t,params:{organizationId:n,eventId:s,delegationCategoryId:o}}=_l(),r=e=>({organizationId:e?":organizationId":n,eventId:s?e?":eventId":s:void 0,delegationCategoryId:e?":delegationCategoryId":o}),a=e.organization.delegationCategory;return(0,i.jsxs)(nj,{children:[(0,i.jsx)(gS,{category:a,reload:e.reload}),(0,i.jsxs)(rj,{css:{flex:"1"},children:[(0,i.jsxs)(sj,{css:{px:"$7"},children:[(0,i.jsx)(ij,{path:ds.DELEGATION_CATEGORY_DASHBOARD(r(!1)),children:t("tableau_de_bord_24627")}),(0,i.jsx)(ij,{path:ds.DELEGATION_CATEGORY_MEMBERS(r(!1)),children:t("membres_125561",a.numberOfResources)})]}),(0,i.jsx)(oj,{path:ds.DELEGATION_CATEGORY_DASHBOARD(r(!0)),children:(0,i.jsx)(hS,{delegationCategory:a,reload:e.reload})}),(0,i.jsx)(oj,{path:ds.DELEGATION_CATEGORY_MEMBERS(r(!0)),children:(0,i.jsx)(pS,{})})]})]})},xS=e=>{const{params:{organizationId:t,eventId:n,delegationCategoryId:s}}=_l(),{data:o,loader:r,reload:a}=Zn("query DelegationCategory(\n $organizationId: OrganizationId!\n $delegationCategoryId: DelegationsCategoryId!\n) {\n organization(id: $organizationId) {\n delegationsSpaceCustomBadges\n\n delegationCategory(id: $delegationCategoryId) {\n id\n name\n numberOfDelegations\n numberOfResources\n\n leaders {\n ...LeaderInfos\n }\n }\n }\n}\n",{organizationId:t,delegationCategoryId:s},[Ls.LeaderInfosFragment]);return r||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:ds.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(ni,{path:ds.DELEGATION_CATEGORY_DASHBOARD({organizationId:t,eventId:n,delegationCategoryId:s}),replace:!0})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(fS,{organization:o.organization,reload:a})})]})},_S=()=>{const e=Yn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sl,{color:"primary",leftIcon:"clock",children:e("votre_import_es_05273")}),(0,i.jsx)(qa,{height:"6"})]})};let IS=class extends Ul{documentInputService;archiveInputService;constructor(e,t,n){super(n),this.documentInputService=e,this.archiveInputService=t}default(){return{input:{archive:this.documentInputService.documentInputDefault(),fieldId:-1}}}schema(){return d.Ik().shape({input:d.Ik().shape({archive:this.archiveInputService.schema(),fieldId:d.Yj().required(this.t("le_champ_person_80074")).typeError(this.t("le_champ_person_80074"))})})}};IS=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mj,Iv,Wn])],IS);const vS=()=>{const{translate:e,params:{organizationId:t}}=_l();return(0,i.jsx)(Mm,{hideToggle:!0,initialIsOpen:!0,subtitle:e("s_lectionnez_vo_27155",xv.bytesToGigabytes(_v),xv.bytesToMegabytes(2e7)),heading:e("votre_fichier_d_51776"),children:(0,i.jsx)(Vj,{accept:Rv.Archives,acl:"private",organizationId:t,prefix:"input.archive.",withFileField:!0})})},bS=({customFields:e})=>{const t=Yn();return(0,i.jsx)(Mm,{hideToggle:!0,initialIsOpen:!0,subtitle:t("_ditez_la_corre_24969"),heading:t("correspondance_10480"),children:(0,i.jsxs)(Hj,{label:t("sur_quel_champ_17516"),name:"input.fieldId",children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:t("s_lectionnez_un_82446")}),e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})})},jS=({customFileFields:e})=>(0,i.jsx)(bS,{customFields:e}),CS=e=>!!e.getFieldState("input.archive.key")?.valid&&!!e.getFieldState("input.archive.file")?.valid,yS=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=_l(),s=qn(IS),o=qn(Ba),r=(0,L.useRef)(null),{data:a,loader:l}=Zn("query FilesImportCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFileFields: customFields(variety: UserInfo, fieldTypes: [File]) {\n nodes {\n id\n name\n slug\n customFieldCategoryId\n customFieldCategoryName\n fieldType\n fieldProperty\n canSelectMultiple\n\n values {\n id\n value\n }\n }\n }\n }\n}\n",{organizationId:t},[]),{mutate:d}=function(e={}){return Xn("mutation FilesImport(\n $organizationId: OrganizationId!\n $eventId: EventId\n $input: FilesImportInput!\n) {\n jobId: filesImport(organizationId: $organizationId, eventId: $eventId, input: $input)\n}\n",e)}(),{checkFilesImport:c}=kb();return l||(0,i.jsx)(Cl,{customErrorRef:r,height:1,initialValues:{input:s.default().input},render:({form:s,handleSubmit:o,submitting:l,values:d})=>(0,i.jsx)(Pm,{button:(0,i.jsx)(El,{isLoading:l,onClick:o,children:e("importer_la_lis_12866")}),category:e("importe_des_fic_85041"),color:"dark",fallbackClosePath:n?$s.VOLUNTEERS(t,n):yi.COMMUNITY_USERS({organizationId:t}),heading:e("nouvel_import_48306"),children:(0,i.jsxs)($m,{ref:r,children:[s.getState().submitSucceeded&&(0,i.jsx)(_S,{}),(0,i.jsx)(vl,{}),(0,i.jsxs)(Na,{direction:"column",gap:"5",children:[(0,i.jsx)(vS,{}),d.input.archive?.file&&CS(s)&&(0,i.jsx)(jS,{customFileFields:a.organization.customFileFields.nodes})]})]})}),validate:o.validateForForm(s.schema()),onSubmit:async({input:e})=>{const i=(e=>{const t={...e.archive};return delete t.file,{...e,archive:t}})(e);try{const{jobId:e}=await d({organizationId:t,eventId:n,input:i});r.current&&(r.current.scrollTop=0),c(e,t,n)}catch{}}})},kS=e=>{const t=Yn(),{mutate:n}=oa(),{data:s}=ia({organizationId:e.organizationId}),o=(0,L.useMemo)(()=>(s.organization?.events.nodes??[]).filter(t=>t.id!==e.eventId),[s.organization,e.eventId]),r=(0,L.useMemo)(()=>d.Ik().shape({eventId:d.ai().required(t("l_v_nement_est_88155")).oneOf(o.map(e=>e.id),t("l_v_nement_est_88155"))}),[o]);return(0,i.jsxs)(Jj,{buttonText:t("dupliquer_ce_fo_10581"),icon:"sliders",initialValues:{eventId:-1},schema:r,size:"md",subtitle:t("dupliquer_votre_17703"),title:t("dupliquer_vers_48809"),onClose:e.onClose,onSubmit:async t=>{await n({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,newEventId:t.eventId}),e.onClose()},children:[(0,i.jsxs)(sl,{color:"warning",leftIcon:"triangle-exclamation",children:[t("toutes_les_info_60876"),(0,i.jsx)("br",{}),t("certains_param_05954")]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Um,{isSearchVisible:!0,label:t("sur_quel_v_nem_94155"),multiple:!1,name:"eventId",children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})},AS=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{isOrganizationAdmin:o}=yI(),{showNotification:r}=kb(),{mutate:a}=oa(),{mutate:l}=function(e={}){return Xn("mutation FormDelete($organizationId: OrganizationId!, $eventId: EventId, $formId: FormId!) {\n formDelete(organizationId: $organizationId, eventId: $eventId, formId: $formId) {\n id\n }\n}\n",e)}(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"6",width:1,children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(qc,{to:Ni.FORM_ELEMENTS({organizationId:n,eventId:s,formId:e.form.id}),children:e.form.name})}),(0,i.jsxs)(yr,{color:"gray500",children:[t("nombre_de_champ_91879")," ",(0,i.jsx)(Zm,{color:"gray800",children:e.form.numberOfCustomFields})]}),(0,i.jsx)(Bb,{permissions:Nb.FORM_EDIT,children:(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[e.canDuplicate&&(0,i.jsx)(Gd,{icon:"clone",onClick:async t=>{Rl(t),await a({organizationId:n,eventId:s,formId:e.form.id}),e.reload()},children:t("dupliquer_28256")}),o&&s&&e.canDuplicate&&(0,i.jsx)(Gd,{icon:"clone",onClick:()=>{c(!0)},children:t("dupliquer_sur_u_11076")}),e.canDuplicate&&(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:e=>{Rl(e),h(!0)},children:t("supprimer_43083")})]})]})})]}),d&&(0,i.jsx)(kS,{eventId:s,formId:e.form.id,organizationId:n,onClose:()=>{c(!1)}}),u&&(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_75358"),text:t("suppression_de_73669",e.form.name),onClose:()=>{h(!1)},onDelete:async()=>{await l({organizationId:n,eventId:s,formId:e.form.id}),r(t("le_formulaire_76783",e.form.name)),e.reload()}})]})};function wS(){const{hasFeature:e,hasPermission:t}=yI(),{event:n,hasPermission:i}=vb();return(0,L.useMemo)(()=>{const s=e=>t(e)||(i?.(e)??!1),o=e(Ne.Accreditation)&&(n?.useAccreditations??!1),r=n?.useCampaigns??!0,a=e(Ne.Delegation)&&(n?.useDelegations??!0),l=(e(Ne.Documents)||e(Ne.CustomDocument))&&(n?.useDocuments??!1),d=n?.useForms??!0,c=n?.usePositions??!1,u=n?.useWorkflows??!0;return{canAccreditationEdit:o&&s(Nb.ACCREDITATION_EDIT),canAccreditationRead:o&&s(Nb.ACCREDITATION_READ),canCampaignRead:r&&s(Nb.CAMPAIGN_READ),canCampaignSend:r&&s(Nb.CAMPAIGN_SEND),canCommentAdd:s(Nb.COMMENT_ADD),canCommentRead:s(Nb.COMMENT_READ),canCustomFieldEdit:s(Nb.CUSTOM_FIELD_EDIT),canCustomFieldRead:s(Nb.CUSTOM_FIELD_READ),canDelegationEdit:a&&s(Nb.DELEGATION_EDIT),canDelegationRead:a&&s(Nb.DELEGATION_READ),canDocumentEdit:l&&s(Nb.DOCUMENT_EDIT),canDocumentRead:l&&s(Nb.DOCUMENT_READ),canEmailEdit:s(Nb.EMAIL_EDIT),canEventEdit:s(Nb.EVENT_EDIT),canFormEdit:d&&s(Nb.FORM_EDIT),canFormRead:d&&s(Nb.FORM_READ),canMemberAccredit:o&&s(Nb.MEMBER_ACCREDIT),canMemberAssign:c&&s(Nb.MEMBER_ASSIGN),canMemberAssignmentStateEdit:c&&s(Nb.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:s(Nb.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:s(Nb.MEMBER_CREATE),canMemberDelete:s(Nb.MEMBER_DELETE),canMemberEdit:s(Nb.MEMBER_EDIT),canOrganizationParamEdit:s(Nb.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:s(Nb.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:s(Nb.ORGANIZATION_USER_EDIT),canOrganizationUserRead:s(Nb.ORGANIZATION_USER_READ),canPositionEdit:c&&s(Nb.POSITION_EDIT),canPositionRead:c&&s(Nb.POSITION_READ),canSegmentEdit:s(Nb.SEGMENT_EDIT),canWorkflowEdit:u&&s(Nb.WORKFLOW_EDIT),canWorkflowRead:u&&s(Nb.WORKFLOW_READ)}},[e,n,t,i])}function SS(){const{hasFeature:e,hasPermission:t}=yI();return(0,L.useMemo)(()=>{const n=e(Ne.Accreditation),i=e(Ne.Delegation),s=e(Ne.CustomDocument);return{canAccreditationEdit:n&&t(Nb.ACCREDITATION_EDIT),canAccreditationRead:n&&t(Nb.ACCREDITATION_READ),canCampaignRead:t(Nb.CAMPAIGN_READ),canCampaignSend:t(Nb.CAMPAIGN_SEND),canCommentAdd:t(Nb.COMMENT_ADD),canCommentRead:t(Nb.COMMENT_READ),canCustomFieldEdit:t(Nb.CUSTOM_FIELD_EDIT),canCustomFieldRead:t(Nb.CUSTOM_FIELD_READ),canDelegationEdit:i&&t(Nb.DELEGATION_EDIT),canDelegationRead:i&&t(Nb.DELEGATION_READ),canDocumentEdit:s&&t(Nb.DOCUMENT_EDIT),canDocumentRead:s&&t(Nb.DOCUMENT_READ),canEmailEdit:t(Nb.EMAIL_EDIT),canEventEdit:t(Nb.EVENT_EDIT),canFormEdit:t(Nb.FORM_EDIT),canFormRead:t(Nb.FORM_READ),canMemberAccredit:t(Nb.MEMBER_ACCREDIT),canMemberAssign:t(Nb.MEMBER_ASSIGN),canMemberAssignmentStateEdit:t(Nb.MEMBER_ASSIGNMENT_STATE_EDIT),canMemberAvailabilitiesEdit:t(Nb.MEMBER_AVAILABILITIES_EDIT),canMemberCreate:t(Nb.MEMBER_CREATE),canMemberDelete:t(Nb.MEMBER_DELETE),canMemberEdit:t(Nb.MEMBER_EDIT),canOrganizationParamEdit:t(Nb.ORGANIZATION_PARAM_EDIT),canOrganizationParamRead:t(Nb.ORGANIZATION_PARAM_READ),canOrganizationUserEdit:t(Nb.ORGANIZATION_USER_EDIT),canOrganizationUserRead:t(Nb.ORGANIZATION_USER_READ),canPositionEdit:t(Nb.POSITION_EDIT),canPositionRead:t(Nb.POSITION_READ),canSegmentEdit:t(Nb.SEGMENT_EDIT),canWorkflowEdit:t(Nb.WORKFLOW_EDIT),canWorkflowRead:t(Nb.WORKFLOW_READ)}},[e,t])}let ES=class extends Ul{constructor(e){super(e)}formInputDefault(){return{name:""}}formInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536"))})}createFormSchema(){return d.Ik().shape({form:this.formInputSchema()})}};ES=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],ES);const TS=e=>{const t=Yn(),n=qn(ES),{mutate:s}=function(e={}){return Xn("mutation FormCreate($organizationId: OrganizationId!, $eventId: EventId, $form: FormInput!) {\n formCreate(organizationId: $organizationId, eventId: $eventId, form: $form) {\n id\n }\n}\n",e)}();return(0,i.jsx)(Jj,{buttonText:t("cr_er_le_formul_42369"),icon:"sliders",initialValues:{form:n.formInputDefault()},schema:n.createFormSchema(),size:"md",title:t("nouveau_formula_44488"),onClose:e.onClose,onSubmit:async t=>{const{formCreate:n}=await s({organizationId:e.organizationId,eventId:e.eventId,form:t.form});e.onSuccess(n.id)},children:(0,i.jsx)(Ll,{label:t("nom_du_formulai_14952"),name:"form.name"})})},zS=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),{canFormEdit:r}=wS(),[a,l]=(0,L.useState)(e.isCreateOpen);return(0,i.jsxs)(tj,{gap:"4",children:[(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:n("Form_plural")}),e.isSearchVisible&&(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:n("rechercher_un_f_28561"),value:e.name,onChange:e.setName})}),r&&e.canCreateNewForm&&(0,i.jsx)(El,{onClick:()=>{l(!0)},children:n("cr_er_un_formul_78352")}),a&&(0,i.jsx)(TS,{eventId:o,organizationId:s,onClose:()=>{l(!1)},onSuccess:e=>{t.push(Ni.FORM_ELEMENTS({organizationId:s,eventId:o,formId:e}))}})]})},OS=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oc,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(oc,{borderRadius:"$2",height:72,width:1}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(oc,{borderRadius:"$2",height:72,width:1})]}),RS=e=>{const{translate:t}=_l(),{event:n}=vb(),{hasFeature:s}=yI();Dd(`${n?.name??t("communaut_20896")} ${t("Form_plural")}`);const[o,r]=(0,L.useState)(""),a=(0,L.useMemo)(()=>m(o)?e.forms.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())||e.id.toString(10)===o):e.forms,[e.forms,o]),l=(0,L.useMemo)(()=>0===e.forms.length||s(Ne.Multiform),[e.forms]);return(0,i.jsxs)(nj,{children:[(0,i.jsx)(zS,{canCreateNewForm:l,isCreateOpen:e.isCreateOpen,isSearchVisible:no(e.forms),name:o,setName:r}),(0,i.jsx)(ej,{children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(OS,{})]}):0===e.forms.length?(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Nk,{subtitle:t("cr_er_vos_formu_26049"),title:t("aucun_formulair_74743")})}):(0,i.jsxs)(i.Fragment,{children:[!l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sl,{color:"warning",leftIcon:"circle-info",children:(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{fontWeight:"semiBold",children:t("vous_avez_attei_23858")}),(0,i.jsx)(yr,{children:t("votre_abonnemen_18069")})]})}),(0,i.jsx)(qa,{height:"7"})]}),a.map(t=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(AS,{canDuplicate:l,form:t,reload:e.reload}),(0,i.jsx)(qa,{height:"3"})]},t.id))]})})]})},$S=e=>{const{organizationId:t,eventId:n}=Jn(),{data:s,isLoading:o,reload:r}=ra({organizationId:t,level:it.Event,eventId:n}),a=(0,L.useMemo)(()=>(0,lc.A)(s.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[s.organization]);return(0,i.jsx)(RS,{forms:a,isCreateOpen:e.isCreateOpen,isLoading:o,reload:r})},DS=e=>{const{organizationId:t}=Jn(),{data:n,isLoading:s,reload:o}=ra({organizationId:t,level:it.Organization}),r=(0,L.useMemo)(()=>(0,lc.A)(n.organization?.forms.nodes??[],e=>e.name.toLowerCase()),[n.organization]);return(0,i.jsx)(RS,{forms:r,isCreateOpen:e.isCreateOpen,isLoading:s,reload:o})};function PS(e){navigator.clipboard.writeText(e)}function FS(){const[e,t]=(0,L.useState)(!1);return{isLoading:e,copy:(0,L.useCallback)(e=>{t(!0),PS(e),setTimeout(()=>t(!1),500)},[])}}var MS=n(5848);const NS=e=>{const{translate:t}=_l(),{isLoading:n,copy:s}=FS(),o=()=>(0,i.jsx)("iframe",{height:"100%",src:e.link,style:{border:"none"},width:"100%"});return(0,i.jsxs)(Na,{direction:"column",gap:"7",children:[e.alert,(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(ul,{css:{fontWeight:"$medium"},textStyle:"bodyText",children:e.iframeLabel}),(0,i.jsx)(yr,{css:{bd:!0,borderRadius:"$1",padding:"$2 $3"},children:(0,i.jsx)("code",{children:(0,MS.renderToStaticMarkup)((0,i.jsx)(o,{}))})})]}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:n,leftIcon:"copy",onClick:()=>s((0,MS.renderToStaticMarkup)((0,i.jsx)(o,{}))),children:t("copier_75889")})})]})]})},LS=e=>{const{translate:t}=_l(),{isLoading:n,copy:s}=FS();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"end",gap:"5",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(ul,{css:{fontWeight:"$medium"},textStyle:"bodyText",children:e.heading}),(0,i.jsx)(yr,{css:{bd:!0,borderRadius:"$1",padding:"$2 $3"},children:(0,i.jsx)(qc,{css:{inlineSize:"max-content",fontWeight:"normal",textDecoration:"underline"},hideIcon:!0,to:e.link,children:e.link})})]}),(0,i.jsx)(El,{isLoading:n,leftIcon:"copy",onClick:()=>s(e.link),children:t("copier_75889")})]}),(0,i.jsxs)(Na,{align:"center",css:{bd:!0,borderRadius:"$1",padding:"$6 $8"},direction:"column",gap:"6",children:[(0,i.jsxs)(Na,{align:"center",direction:"column",children:[(0,i.jsx)(ul,{children:t("qr_code_60722")}),(0,i.jsx)(cl,{textStyle:"subtitle",children:e.qrCodeDescription})]}),(0,i.jsx)(yr,{height:120,width:120,children:(0,i.jsx)("img",{height:"100%",src:dg(e.link,{height:120,width:120}),width:"100%"})}),(0,i.jsx)(El,{download:"qr-code",to:dg(e.link,{height:120,width:120}),children:t("t_l_charger_le_18439")})]})]})},BS=({children:e,isActive:t,onClick:n,replace:s=!0,to:o})=>{const r=ei(),a=t?.(r.pathname)??r.pathname===o;return(0,i.jsx)(Na,{align:"center",css:{borderBottom:a?"2px solid $primary700":"2px solid transparent",borderTop:"2px solid transparent",color:a?"$primary700":"$gray500",fontWeight:"$medium",px:"$3",userSelect:"none"},height:1,children:(0,i.jsx)(Ja,{height:1,replace:s,to:o,width:1,onClick:async()=>{n&&await n()},children:e})})},VS=e=>(0,i.jsx)(Na,{as:Pa.Nav,css:{borderBottom:"1px solid $gray200"},gap:"2",height:e.height,justify:"center",role:"menubar",width:e.width,children:e.children}),US=()=>{const{translate:e,params:t}=_l();return(0,i.jsxs)(VS,{height:1,width:1,children:[(0,i.jsx)(BS,{to:Ni.FORM_ELEMENTS(t),children:e("champs_91671")}),(0,i.jsx)(BS,{isActive:e=>null!==e.match(/\/form\/\d+\/parameters/),to:Ni.FORM_PARAMETERS_GENERAL(t),children:e("param_tres_78420")}),(0,i.jsx)(BS,{to:Ni.FORM_INTEGRATION(t),children:e("int_gration_10662")}),(0,i.jsx)(BS,{to:Ni.FORM_EMAILS(t),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(BS,{to:Ni.FORM_PREVIEW(t),children:e("aper_u_25595")})]})},WS=e=>{const{translate:t}=_l(),{canFormEdit:n}=wS();return(0,i.jsx)(Pm,{button:n&&e.button,category:t("cr_ation_d_un_f_67278"),color:"dark",heading:e.title,onClose:e.onClose,children:(0,i.jsxs)(cd,{gridtemplatecolumns:"1fr",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(US,{}),(0,i.jsx)(yr,{css:{overflowY:"auto"},children:e.children})]})})},GS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=_l(),{data:r}=aa({organizationId:n,formId:o});Dd(r.organization?.form.name??"");const a=ag({organizationId:n,eventId:s,formId:o});return(0,i.jsx)(WS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(Ni.FORMS({organizationId:n,eventId:s}))},children:(0,i.jsx)(Na,{justify:"center",width:1,children:(0,i.jsxs)(Na,{css:{paddingBlockStart:"$8"},gap:"8",width:"$container",children:[(0,i.jsx)(Na,{direction:"column",gap:"6",children:(0,i.jsx)(LS,{heading:t("FormLink"),link:a,qrCodeDescription:t("facilitez_la_co_59826")})}),(0,i.jsx)(Na,{direction:"column",gap:"6",children:(0,i.jsx)(NS,{alert:(0,i.jsxs)(hl,{alertStyle:"warning",children:[(0,i.jsx)(ml,{children:t("comment_marche_73229")}),(0,i.jsx)(gl,{children:t("ce_code_va_vous_31197")})]}),heading:t("iframe_27513"),iframeLabel:t("code_html_pour_12471"),link:a})})]})})})},HS=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=_l(),{data:r}=aa({organizationId:n,formId:o});Dd(r.organization?.form.name??"");const[a,l]=(0,L.useState)("opened"),d=ag({organizationId:n,eventId:s,formId:o,query:{preview:!0,previewState:a}});return(0,i.jsx)(WS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(Ni.FORMS({organizationId:n,eventId:s}))},children:(0,i.jsxs)(Na,{align:"center",direction:"column",height:1,width:1,children:[(0,i.jsxs)(Na,{direction:"column",width:"$container",children:[(0,i.jsx)(qa,{height:"8"}),(0,i.jsxs)(Na,{align:"center",gap:"4",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(yr,{font:"gray900 textLg semiBold",children:t("aper_u_du_formu_51076")}),(0,i.jsx)(yr,{color:"gray500",children:t("pr_visualiser_v_58073")})]}),(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"opened",children:t("Opened")}),(0,i.jsx)("option",{value:"closed",children:t("cl_tur_79063")}),(0,i.jsx)("option",{value:"blocked",children:t("acc_s_r_fus_68875")})]})})]})]}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)("iframe",{height:"100%",src:d,style:{border:"none"},width:"100%"})})]})})},qS=e=>{const{history:t,translate:n}=_l();return(0,i.jsx)(Rb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"triangle-exclamation",children:n("changements_non_17558")}),(0,i.jsx)(Tb,{children:(0,i.jsxs)(Na,{align:"center",direction:"column",gap:"1",width:1,children:[(0,i.jsx)(yr,{font:"gray900 textLg medium",children:n("voulez_vous_qui_84408")}),(0,i.jsx)(yr,{color:"gray500",children:n("des_donn_es_ne_27178")})]})}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{color:"error",onClick:()=>t.goBack(e.fallbackPath),children:n("quitter_sans_sa_28486")})})]})})},YS=(0,hr.I4)("div",{alignItems:"center",borderRadius:"$1",cursor:"pointer",display:"flex",fontWeight:"$semiBold",overflow:"hidden",userSelect:"none",variants:{color:{primary:{background:"$primary700",color:"white","& > .h-button-dropdown-content":{border:"1px solid $primary700",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $primary700",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0",borderLeft:"1px solid $primary800"},"& > .h-button-dropdown-content:hover":{background:"$primary800",border:"1px solid $primary800",borderRight:"none"},"& > .h-button-dropdown-icon:hover":{background:"$primary800",border:"1px solid $primary800"}},white:{background:"white",color:"$gray700","& > .h-button-dropdown-content":{border:"1px solid $gray300",borderRadius:"$1",borderBottomRightRadius:"0",borderTopRightRadius:"0",borderRight:"none"},"& > .h-button-dropdown-icon":{border:"1px solid $gray300",borderRadius:"$1",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},"& > .h-button-dropdown-content:hover":{background:"$gray50",color:"$gray800"},"& > .h-button-dropdown-icon:hover":{background:"$gray50",color:"$gray800"}}},size:{sm:{height:"32px",fontSize:"$textSm"},md:{height:"40px",fontSize:"$textSm"},lg:{height:"44px",fontSize:"$textMd"},xl:{height:"48px",fontSize:"$textMd"},"2xl":{height:"60px",fontSize:"$textLg"}}},defaultVariants:{color:"primary",size:"md"}}),KS=L.forwardRef((e,t)=>{const{history:n}=_l();return(0,i.jsxs)(YS,{color:e.color,size:e.size,children:[(0,i.jsx)(Na,{ref:t,align:"center",className:"h-button-dropdown-content",css:{flex:"1",px:"$4"},height:1,onClick:t=>{e.onClick&&e.onClick(t),m(e.path)&&n.push(e.path)},children:e.children}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(Na,{align:"center",className:"h-button-dropdown-icon",height:40,justify:"center",width:40,children:(0,i.jsx)(el,{icon:"chevron-down"})})}),(0,i.jsx)(qd,{placement:"bottom-end",renderOnPortal:!0,children:e.menu})]})]})});KS.displayName="ButtonDropdown";const ZS=({returnPathFallback:e})=>(0,i.jsx)(xu,{returnToFallback:e,size:"md",children:(0,i.jsx)(_u,{children:(0,i.jsx)(kl,{})})});let XS=class extends Ul{documentInputService;constructor(e,t){super(t),this.documentInputService=e}customFieldInputDefault(e,t){return{name:e?.name??"",label:e?.label??"",customFieldCategoryId:e?.customFieldCategoryId??t[0].id,description:e?.description??"",variety:e?.variety??ve.UserInfo,fieldType:e?.fieldType??Ve.Text,fieldSubtype:e?.fieldSubtype??Be.Freeform,isPrivate:e?.isPrivate??!1,values:no(e?.values)?e.values:[],hasCondition:e?.hasCondition??!1,conditionCustomFieldId:e?.conditionCustomFieldId??null,conditionValue:e?.conditionValue??!1,canSelectMultiple:e?.canSelectMultiple??!1,document:e?.document||this.documentInputService.documentInputDefault(),isEncrypted:e?.isEncrypted??!1}}customFieldInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_champ_17959")),label:d.Yj(),customFieldCategoryId:d.ai().required(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")).min(1,this.t("la_cat_gorie_es_14008")),fieldType:d.Yj().required(this.t("le_type_est_req_41180")).oneOf(hn,this.t("le_type_est_req_41180")),isPrivate:d.zM().nullable(),hasCondition:d.zM().nullable(),values:d.YO().when("fieldType",{is:Ve.Select,then:e=>e.of(d.Ik().shape({id:d.ai(),value:d.Yj().required(this.t("la_valeur_est_r_70136"))})).required(this.t("vous_devez_s_le_95641")).min(1,this.t("vous_devez_s_le_95641"))}),conditionCustomFieldId:d.ai().when("hasCondition",{is:!0,then:e=>e.required(),otherwise:e=>e.nullable()}),conditionValue:d.gl(),canSelectMultiple:d.zM().nullable(),document:this.documentInputService.documentInputSchemaNotRequired(),isEncrypted:d.zM().required()})}createUpdateCustomFieldSchema(){return d.Ik().shape({customField:this.customFieldInputSchema()})}};XS=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mj,Wn])],XS);const JS=e=>{const t=Yn(),n=(0,L.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.change("customField.values",ro(e.values,n.index,i.index))},[e.values,e.change]),s=!e.isEdit||e.isSelectV2;return(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",children:t("valeurs_de_la_l_43599")}),(0,i.jsxs)(Na,{css:{background:"$gray100",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[s?(0,i.jsx)(fu.JY,{onDragEnd:n,children:(0,i.jsx)(fu.gL,{droppableId:"1",children:t=>(0,i.jsxs)(Na,{direction:"column",gap:"3",...t.droppableProps,ref:t.innerRef,children:[e.values.map((t,n)=>(0,i.jsx)(fu.sx,{draggableId:n.toString(),index:n,children:t=>(0,i.jsxs)(Na,{align:"center",gap:"4",...t.draggableProps,ref:t.innerRef,children:[(0,i.jsx)(yr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...t.dragHandleProps,children:(0,i.jsx)(el,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Ll,{name:`customField.values[${n}].value`})}),(0,i.jsx)(yr,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{e.change("customField.values",ao(e.values,n))},children:(0,i.jsx)(el,{icon:"trash-can"})})]})},n)),t.placeholder]})})}):e.values.map((e,t)=>(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Ll,{name:`customField.values[${t}].value`})},t)),(0,i.jsxs)(yr,{css:{cursor:"pointer"},font:"primary700 textSm medium",onClick:()=>{e.change("customField.values",e.values.concat([{value:""}]))},children:["+ ",t("ajouter_une_nou_98358")]})]})]})},QS=e=>{const{translate:t}=_l(),{showNotification:n}=kb(),s=qn(XS),o=Mc(),r=qn(Ba),{mutate:a}=function(e={}){return Xn("mutation CustomFieldCategoryCreate(\n $organizationId: OrganizationId!\n $category: CustomFieldsCategoryInput!\n) {\n customFieldCategoryCreate(organizationId: $organizationId, customFieldCategory: $category) {\n id\n name\n }\n}\n",e)}(),l=(0,L.useRef)(null),d=(0,L.useMemo)(()=>e.isEdit?t("mise_jour_de_17055",e.initialValues.customField.name):t("nouveau_champ_p_27686"),[e.isEdit,e.initialValues]);Dd(d);const c=(0,L.useMemo)(()=>(0,lc.A)(e.organization.customFields.nodes.filter(t=>t.id!==e.customFieldId),e=>e.name.toLowerCase()),[e.customFieldId,e.organization]),[u,h]=(0,L.useState)(YC(e.organization.customFieldsCategories.nodes)),[m,g]=(0,L.useState)(e.initialValues.customField.fieldType),[p,f]=(0,L.useState)(e.initialValues.customField.hasCondition),[x,_]=(0,L.useState)(c.find(t=>t.id===e.initialValues.customField.conditionCustomFieldId)),[I,v]=(0,L.useState)(!1),b=!e.isFromForm,j=x?.fieldType===Ve.Checkbox,C=ky(x);return(0,i.jsx)(Cl,{customErrorRef:l,initialValues:e.initialValues,render:({form:n,handleSubmit:s,submitting:r,values:y})=>{const k=(y.customField.variety===ve.Delegation||y.customField.variety===ve.UserInfo)&&m===Ve.Text,A=e.isEdit||y.customField.fieldSubtype!==Be.Freeform,w=(y.customField.variety===ve.Delegation||y.customField.variety===ve.UserInfo)&&m!==Ve.Validation&&!0!==e.isFromForm,S=y.customField.variety===ve.UserInfo&&no(c);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(xu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yj,{children:d}),(0,i.jsxs)(_u,{ref:l,children:[(0,i.jsx)(Fr.Yr,{name:"customField.fieldType",children:e=>{g(e),e===Ve.Validation&&n.change("customField.isPrivate",!1)}}),(0,i.jsx)(Fr.Yr,{name:"customField.fieldSubtype",children:e=>{n.change("customField.isEncrypted",e!==Be.Freeform)}}),(0,i.jsx)(Fr.Yr,{name:"customField.hasCondition",children:e=>{n.change("customField.conditionCustomFieldId",c[0].id),f(e)}}),(0,i.jsx)(Fr.Yr,{name:"customField.conditionCustomFieldId",children:e=>{const t=c.find(t=>t.id===e);t&&(n.change("customField.conditionValue",t.fieldType===Ve.Checkbox||[]),_(t))}}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(vl,{}),(0,i.jsxs)(Na,{direction:"column",gap:"6",width:1,children:[b&&(0,i.jsxs)(Hj,{label:t("typologie_34041"),name:"customField.variety",state:e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:ve.Accreditation,children:t("accr_ditations_39450")}),(0,i.jsx)("option",{value:ve.Delegation,children:t("d_l_gations_78318")}),(0,i.jsx)("option",{value:ve.Event,children:t("Event")}),(0,i.jsx)("option",{value:ve.Position,children:t("missions_63972")}),(0,i.jsx)("option",{value:ve.UserInfo,children:t("membres_11310")})]}),(0,i.jsx)(Ll,{hint:t("titre_de_la_que_69079"),label:t("nom_du_champ_48329"),name:"customField.name"}),(0,i.jsx)(Ll,{hint:t("nom_technique_u_74183"),label:(0,i.jsx)(Uv,{children:t("label_08243")}),name:"customField.label"}),(0,i.jsx)(Ll,{hint:t("sous_titre_de_l_90967"),label:(0,i.jsx)(Uv,{children:t("sous_titre_97472")}),name:"customField.description"}),(0,i.jsx)(Hj,{label:t("type_35427"),name:"customField.fieldType",state:e.isEdit?"disabled":"active",children:o(hn)}),y.customField.fieldType===Ve.Text&&(0,i.jsx)(Hj,{label:t("sous_type_de_ch_73883"),name:"customField.fieldSubtype",state:e.isEdit?"disabled":"active",children:o(un)}),(0,i.jsx)(Um,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"customField.customFieldCategoryId",placeholder:t("rechercher_ou_c_16469"),onCreateClick:()=>{v(!0)},children:u.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),m===Ve.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(JS,{change:n.change,isEdit:e.isEdit,isSelectV2:e.isSelectV2,values:y.customField.values}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t("est_ce_qu_il_es_10680")}),(0,i.jsx)(Nm,{disabled:e.isEdit,name:"customField.canSelectMultiple",children:t("oui_il_est_pos_25233")})]})]}),m===Ve.Validation&&(0,i.jsx)(Vj,{accept:[Rv.Images,Rv.Pdf],acl:"public-read",label:(0,i.jsx)(Uv,{children:t("document_87149")}),organizationId:e.organizationId,prefix:"customField.document."}),k&&(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("chiffrement_des_84602")}),(0,i.jsx)(Hm,{disabled:A,name:"customField.isEncrypted",subtext:t("seuls_les_4_der_85542"),children:t("les_donn_es_son_85588")})]}),w&&(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t("ce_champ_est_il_98722")}),(0,i.jsx)(Nm,{name:"customField.isPrivate",children:t("oui_le_champ_n_99925")})]}),S&&(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t("l_affichage_de_99189")}),(0,i.jsx)(Nm,{name:"customField.hasCondition",children:t("oui_le_champ_d_00513")})]}),p&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",gap:"4",children:[(0,i.jsx)(Um,{isSearchVisible:!0,label:t("nom_du_champ_do_17104"),name:"customField.conditionCustomFieldId",children:c.map(e=>(0,i.jsx)("option",{value:e.id,children:aA(e)},e.id))}),x&&(0,i.jsx)(i.Fragment,{children:j?(0,i.jsxs)(Hj,{label:t("pour_quelle_val_60529",x.name),name:"customField.conditionValue",shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}):(0,i.jsx)(Um,{isSearchVisible:!0,label:t("pour_quelle_val_60529",x.name),multiple:!0,name:"customField.conditionValue",children:C},x.id)})]})]})]}),(0,i.jsx)(qa,{height:"7"})]}),(0,i.jsx)(Iu,{children:(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{isLoading:r,onClick:s,children:e.isEdit?t("mettre_jour_l_31784"):t("cr_er_le_champ_05516")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})})]}),I&&(0,i.jsx)(KC,{initialName:"",isEdit:!1,mutate:async t=>{const{customFieldCategoryCreate:n}=await a({organizationId:e.organizationId,category:{name:t}});return n},onClose:()=>{v(!1)},onSuccess:e=>{h(YC([...u,e])),n.change("customField.customFieldCategoryId",e.id)}})]})},validate:r.validateForForm(s.createUpdateCustomFieldSchema()),onSubmit:async i=>{const{customField:s}=await e.mutate({organizationId:e.organizationId,customField:{...i.customField,description:i.customField.description||""}});n(e.isEdit?t("le_champ_person_31517"):t("le_champ_person_90348")),e.onClose(),e.onSuccess(s)}})},eE=e=>{const{organizationId:t}=Jn(),n=qn(XS),{data:s,loader:o}=Zn("query OrganizationInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n }\n}\n",{organizationId:e.organizationId},[Ls.CreateCustomFieldInfosFragment]);const{mutate:r}=function(e={}){return Xn("mutation CustomFieldCreate($organizationId: OrganizationId!, $customField: CustomFieldInput!) {\n customField: customFieldCreate(organizationId: $organizationId, customField: $customField) {\n id\n name\n label\n fieldType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return o?(0,i.jsx)(ZS,{returnPathFallback:$s.CUSTOM_FIELDS(t)}):(0,i.jsx)(QS,{customFieldId:null,initialValues:{customField:n.customFieldInputDefault(null,s.organization.customFieldsCategories.nodes)},isEdit:!1,isFromForm:e.isFromForm,isSelectV2:!0,mutate:r,organization:s.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},tE=e=>{const{organizationId:t}=Jn(),n=qn(XS),{data:s,loader:o}=Zn("query CustomFieldToEdit($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n organization(id: $organizationId) {\n ...CreateCustomFieldInfos\n\n customField(id: $customFieldId) {\n name\n label\n customFieldCategoryId\n description\n variety\n fieldType\n fieldSubtype\n isPrivate\n hasCondition\n conditionCustomFieldId\n canSelectMultiple\n conditionValue\n isSelectV2\n isEncrypted\n\n document {\n acl\n name\n key\n }\n\n values {\n id\n value\n }\n }\n }\n}\n",{organizationId:e.organizationId,customFieldId:e.customFieldId},[Ls.CreateCustomFieldInfosFragment]);const{mutate:r}=function(e={}){return Xn("mutation CustomFieldUpdate(\n $organizationId: OrganizationId!\n $customFieldId: CustomFieldId!\n $customField: CustomFieldInput!\n) {\n customField: customFieldUpdate(\n organizationId: $organizationId\n customFieldId: $customFieldId\n customField: $customField\n ) {\n id\n name\n label\n fieldType\n fieldProperty\n\n category {\n id\n name\n }\n\n conditionCustomField {\n id\n name\n }\n\n values {\n id\n value\n }\n }\n}\n",e)}({redirectOnSuccess:!0});return o?(0,i.jsx)(ZS,{returnPathFallback:$s.CUSTOM_FIELDS(t)}):(0,i.jsx)(QS,{customFieldId:e.customFieldId,initialValues:{customField:n.customFieldInputDefault(s.organization.customField,s.organization.customFieldsCategories.nodes)},isEdit:!0,isSelectV2:s.organization.customField.isSelectV2,mutate:t=>r({...t,customFieldId:e.customFieldId}),organization:s.organization,organizationId:e.organizationId,onClose:e.onClose,onSuccess:e.onSuccess})},nE=e=>{const{params:{organizationId:t,customFieldId:n}}=_l();return(0,i.jsx)(tE,{customFieldId:n,organizationId:t,...e})},iE=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.initialName);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("nouvelle_sectio_88105")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("ajouter_des_sec_58545")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Nl,{label:t("nom_de_la_secti_38728"),value:n,onChange:s}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{onClick:()=>{e.onAdd(n),e.onClose()},children:m(e.initialName)?t("renommer_la_sec_00650"):t("cr_er_la_sectio_96175")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},sE=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.initialText);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("champ_texte_lib_91587")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("ajouter_des_cha_68672")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(Jv,{initialValue:n,onChange:s})}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{onClick:()=>{e.onAdd(n),e.onClose()},children:m(e.initialText)?t("mettre_jour_l_69246"):t("ajouter_le_cham_74670")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},oE=e=>{const{translate:t,params:{organizationId:n}}=_l(),{canCustomFieldEdit:s}=wS(),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fu.sx,{draggableId:e.elementId,index:e.index,children:n=>(0,i.jsxs)(Na,{align:"center",css:{bd:!0,padding:"$4 $6",...e.css},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(Bb,{permissions:Nb.FORM_EDIT,children:(0,i.jsx)(yr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(el,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Na,{gap:"2",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:e.field.name}),e.field.conditionCustomField&&(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(el,{icon:"split"})})}),(0,i.jsx)(Cm,{placement:"top",children:t("ce_champ_d_pend_31209",e.field.conditionCustomField?.name)})]})]}),(0,i.jsx)(yr,{color:"gray500",children:t(e.field.fieldType)})]}),(0,i.jsxs)(Bb,{permissions:Nb.FORM_EDIT,children:[(0,i.jsx)(ju,{value:e.isMandatory,onChange:t=>{e.toggleIsMandatory(e.index,t)},children:t("obligatoire_35326")}),(0,i.jsxs)(Na,{gap:"2",children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>{e.onDelete(e.index)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("supprimer_le_ch_99740")})]}),e.showEdit&&s&&(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{r(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_le_champ_78018")})]})]})]})]})}),o&&(0,i.jsx)(tE,{customFieldId:e.field.id,organizationId:n,onClose:()=>{r(!1)},onSuccess:e.updateCustomField})]})},rE=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>e.conditionCustomFields.map(e=>(0,i.jsx)("option",{value:e.id,children:aA(e)},e.id)),[e.conditionCustomFields]),s=e.conditionCustomFields.find(t=>t.id===e.conditionCustomFieldId),o=ky(s);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bc,{isSearchVisible:!0,label:t("champ_sur_leque_68198"),renderOnPortal:!0,values:e.conditionCustomFieldId?[e.conditionCustomFieldId]:[],onChange:t=>{no(t)?e.setConditionCustomFieldId(t[0]):e.setConditionCustomFieldId(null)},children:n}),s&&(0,i.jsx)(i.Fragment,{children:s.fieldType===Ve.Checkbox?(0,i.jsxs)(zu,{label:t("pour_quelle_val_60529",s.name),shouldParseAsBoolean:!0,value:e.conditionValue,onChange:e.setConditionValue,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}):(0,i.jsx)(bc,{isSearchVisible:!0,label:t("pour_quelle_val_60529",s.name),multiple:!0,renderOnPortal:!0,values:e.conditionValue,onChange:e.setConditionValue,children:o},s.id)})]})},aE=e=>{const{translate:t}=_l(),[n,s]=L.useState(e.element.conditionCustomFieldId),[o,r]=L.useState(e.element.conditionValue),a=null!==n&&("boolean"==typeof o||no(o));return(0,i.jsx)(Rb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"split",children:t("ajouter_une_con_66324")}),(0,i.jsx)(Tb,{gap:"4",children:(0,i.jsx)(rE,{conditionCustomFieldId:n,conditionCustomFields:e.conditionCustomFields,conditionValue:o,setConditionCustomFieldId:t=>{const n=e.conditionCustomFields.find(e=>e.id===t);n&&(r(n.fieldType===Ve.Checkbox||[]),s(t))},setConditionValue:r})}),(0,i.jsxs)(Eb,{hideCancelButton:!0,children:[(0,i.jsx)(El,{disabled:!a,onClick:()=>{e.onConditionAdd(e.index,n,o),e.onClose()},children:t("ajouter_une_con_66324")}),(0,i.jsx)(El,{color:"white",onClick:()=>{e.onConditionDelete(e.index),e.onClose()},children:t("supprimer_la_co_57888")})]})]})})},lE=e=>{const t=Yn(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1),a=(0,L.useMemo)(()=>e.conditionCustomFields.find(t=>t.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fu.sx,{draggableId:e.element.id,index:e.index,children:n=>(0,i.jsxs)(Na,{align:"center",css:{background:"$gray900",bd:"gray900 2",color:"white",marginBottom:"$2",marginTop:"$5",padding:"$4 $6"},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(Bb,{permissions:Nb.FORM_EDIT,children:(0,i.jsx)(yr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(el,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Na,{css:{flex:"1"},gap:"2",children:[(0,i.jsx)(yr,{fontWeight:"semiBold",children:e.element.section||""}),a&&(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"white",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(el,{icon:"split"})})}),(0,i.jsx)(Cm,{placement:"top",children:t("cette_section_d_50768",a.name)})]})]}),(0,i.jsx)(Bb,{permissions:Nb.FORM_EDIT,children:(0,i.jsxs)(Na,{gap:"2",children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"split",size:"sm",onClick:()=>r(!0)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("ajouter_une_con_66324")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("supprimer_43083")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("renommer_42135")})]})]})})]})}),n&&(0,i.jsx)(iE,{initialName:e.element.section||"",onAdd:t=>{e.onRename(e.index,t)},onClose:()=>{s(!1)}}),o&&(0,i.jsx)(aE,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:o,onClose:()=>r(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},dE=e=>{const t=Yn(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1),a=(0,L.useMemo)(()=>e.conditionCustomFields.find(t=>t.id===e.element.conditionCustomFieldId),[e.element.conditionCustomFieldId,e.conditionCustomFields]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fu.sx,{draggableId:e.element.id,index:e.index,children:n=>(0,i.jsxs)(Na,{align:"center",css:{bd:!0,padding:"$4 $6"},gap:"5",...n.draggableProps,ref:n.innerRef,children:[(0,i.jsx)(Bb,{permissions:Nb.FORM_EDIT,children:(0,i.jsx)(yr,{color:"gray300",css:{cursor:"grab"},fontSize:"textMd",...n.dragHandleProps,children:(0,i.jsx)(el,{icon:"grip-vertical",iconStyle:"solid"})})}),(0,i.jsxs)(Na,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(yr,{children:(0,i.jsx)(xg,{text:e.element.text||""})}),a&&(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"gray800",css:{cursor:"pointer"},fontWeight:"semiBold",children:(0,i.jsx)(el,{icon:"split"})})}),(0,i.jsx)(Cm,{placement:"top",children:t("ce_texte_d_pend_87251",a.name)})]})]}),(0,i.jsx)(Bb,{permissions:Nb.FORM_EDIT,children:(0,i.jsxs)(Na,{gap:"2",children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"split",size:"sm",onClick:()=>r(!0)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("ajouter_une_con_66324")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",size:"sm",onClick:()=>e.onDelete(e.index)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("supprimer_43083")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>s(!0)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]})]})})]})}),n&&(0,i.jsx)(sE,{initialText:e.element.text||"",onAdd:t=>{e.onEdit(e.index,t)},onClose:()=>s(!1)}),o&&(0,i.jsx)(aE,{conditionCustomFields:e.conditionCustomFields,element:e.element,index:e.index,isOpen:o,onClose:()=>r(!1),onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete})]})},cE=e=>{const t=(0,L.useMemo)(()=>Object.fromEntries(e.customFields.map(e=>[e.id,e])),[e.customFields]),n=(0,L.useMemo)(()=>e.customFields.filter(e=>[Ve.Checkbox,Ve.Country,Ve.Language,Ve.Nationality,Ve.Select].includes(e.fieldType)),[e.customFields]);return(0,i.jsx)(fu.JY,{onDragEnd:e.onDragEnd,children:(0,i.jsx)(fu.gL,{droppableId:"1",children:s=>(0,i.jsxs)(Na,{direction:"column",gap:"3",width:1,...s.droppableProps,ref:s.innerRef,children:[e.elements.map((s,o)=>{switch(s.elementType){case Ge.Field:return(0,i.jsx)(oE,{elementId:s.id,field:t[s.customFieldId],index:o,isMandatory:s.isMandatory,showEdit:!0,toggleIsMandatory:e.fieldsToggleMandatory,updateCustomField:e.updateCustomField,onDelete:e.onDelete},s.id);case Ge.Section:return(0,i.jsx)(lE,{conditionCustomFields:n,element:s,index:o,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onRename:e.sectionOnRename},s.id);case Ge.Text:return(0,i.jsx)(dE,{conditionCustomFields:n,element:s,index:o,onConditionAdd:e.onConditionAdd,onConditionDelete:e.onConditionDelete,onDelete:e.onDelete,onEdit:e.textOnEdit},s.id);default:return rl(s.elementType)}}),s.placeholder]})})})},uE=e=>{const{translate:t,params:{organizationId:n}}=_l(),{isOrganizationAdmin:s}=yI(),[o,r]=L.useState(!1),[a,l]=L.useState(!1),[d,c]=L.useState(!1),[u,h]=L.useState(e.customFields),m=L.useMemo(()=>new Set(e.elements.flatMap(e=>e.elementType===Ge.Field?[e.customFieldId]:[])),[e.elements]),g=L.useCallback(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.setElements(ro(e.elements,n.index,i.index))},[e.elements,e.setElements]),p=L.useCallback(t=>{m.has(t.id)?e.setElements(e.elements.filter(e=>!e.customFieldId||e.customFieldId!==t.id)):e.setElements([...e.elements,{id:V(),elementType:Ge.Field,customFieldId:t.id,isMandatory:!0,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements,m]),f=L.useCallback((t,n)=>{e.setElements((0,pu.jM)(e=>{e[t].isMandatory=n}))},[e.setElements]),x=L.useCallback(t=>{e.setElements([...e.elements,{id:V(),elementType:Ge.Section,section:t,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),_=L.useCallback((t,n)=>{e.setElements((0,pu.jM)(e=>{e[t].section=n}))},[e.setElements]),I=L.useCallback(t=>{e.setElements([...e.elements,{id:V(),elementType:Ge.Text,text:t,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}])},[e.elements,e.setElements]),v=L.useCallback((t,n)=>{e.setElements((0,pu.jM)(e=>{e[t].text=n}))},[e.setElements]),b=L.useCallback(t=>{e.setElements((0,pu.jM)(e=>{e.splice(t,1)}))},[e.setElements]),j=L.useCallback(e=>{h(u.map(t=>t.id===e.id?e:t))},[u]),C=L.useCallback((t,n,i)=>{e.setElements((0,pu.jM)(e=>{e[t].hasCondition=!0,e[t].conditionCustomFieldId=n,e[t].conditionValue=i}))},[e.setElements]),y=L.useCallback(t=>{e.setElements((0,pu.jM)(e=>{e[t].hasCondition=!1,e[t].conditionCustomFieldId=null,e[t].conditionValue=!1}))},[e.setElements]);return(0,i.jsxs)(i.Fragment,{children:[0===e.elements.length?(0,i.jsx)(yr,{height:.5,width:1,children:(0,i.jsx)(Nk,{subtitle:t("ajouter_des_cha_37944"),title:t("aucun_champ_ou_18338")})}):(0,i.jsx)(cE,{customFields:u,elements:e.elements,fieldsToggleMandatory:f,sectionOnRename:_,textOnEdit:v,updateCustomField:j,onConditionAdd:C,onConditionDelete:y,onDelete:b,onDragEnd:g}),(0,i.jsxs)(Bb,{permissions:Nb.FORM_EDIT,children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{gap:"4",justify:0===e.elements.length?"center":"start",width:1,children:[(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:s?(0,i.jsx)(KS,{menu:(0,i.jsx)(Gd,{icon:"pen-field",onClick:()=>{c(!0)},children:t("cr_eer_un_champ_08883")}),children:t("ajouter_des_cha_35843")}):(0,i.jsx)(El,{children:t("ajouter_des_cha_35843")})}),(0,i.jsx)(qd,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)(_C,{customFields:u,selectedCustomFieldsIds:m,toggle:p})})]}),(0,i.jsx)(El,{color:"white",onClick:()=>{r(!0)},children:t("ajouter_une_sec_90063")}),(0,i.jsx)(El,{color:"white",onClick:()=>{l(!0)},children:t("ajouter_un_cham_31151")})]})]}),o&&(0,i.jsx)(iE,{initialName:"",onAdd:x,onClose:()=>{r(!1)}}),a&&(0,i.jsx)(sE,{initialText:"",onAdd:I,onClose:()=>{l(!1)}}),d&&(0,i.jsx)(eE,{isFromForm:!0,organizationId:n,onClose:()=>{c(!1)},onSuccess:async t=>{h([...u,t]),setTimeout(()=>{p(t),e.onSave()}),c(!1)}})]})},hE=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oc,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(oc,{borderRadius:"$2",height:76,width:1}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(oc,{borderRadius:"$2",height:76,width:1})]}),mE=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=_l(),{data:r,isLoading:a}=Zn("query FormElements($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n ...FormCustomFields\n\n form(id: $formId) {\n name\n\n elements {\n ...FormElementsElement\n }\n }\n }\n}\n",{organizationId:n,formId:o},[Ls.FormCustomFieldsFragment,Ls.FormElementsElementFragment]);Dd(r.organization?.form.name??"");const{mutate:l,isLoading:d}=function(e={}){return Xn("mutation FormElementsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $elements: [FormsElementInput!]!\n) {\n formElementsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n elements: $elements\n ) {\n id\n }\n}\n",e)}(),[c,u]=(0,L.useState)([]),[h,m]=(0,L.useState)(""),g=(0,L.useCallback)(async()=>{await l({organizationId:n,eventId:s,formId:o,elements:c.map((e,t)=>({id:e.id,elementType:e.elementType,customFieldId:e.customFieldId,section:e.section,text:e.text,isMandatory:e.isMandatory,hasCondition:e.hasCondition,conditionCustomFieldId:e.conditionCustomFieldId,conditionValue:e.conditionValue,index:t}))}),m(JSON.stringify(c))},[l,c]),[p,f]=(0,L.useState)(!1),x=(0,L.useCallback)(()=>{JSON.stringify(c)===h?e.push(Ni.FORMS({organizationId:n,eventId:s})):f(!0)},[c,h]);return(0,L.useEffect)(()=>{u(r.organization?.form.elements??[]),m(JSON.stringify(r.organization?.form.elements??[]))},[r.organization]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(WS,{button:(0,i.jsx)(El,{isLoading:d,onClick:g,children:t("enregistrer_06519")}),title:r.organization?.form.name??"-",onClose:x,children:(0,i.jsx)(Na,{justify:"center",width:1,children:(0,i.jsxs)(Na,{direction:"column",width:"$container",children:[(0,i.jsx)(qa,{height:"8"}),a?(0,i.jsx)(hE,{}):(0,i.jsx)(uE,{customFields:r.organization.formCustomFields.nodes,elements:c,setElements:u,onSave:g}),(0,i.jsx)(qa,{height:"8"})]})})}),(0,i.jsx)(qS,{fallbackPath:Ni.FORMS({organizationId:n,eventId:s}),isOpen:p,onClose:()=>{f(!1)}})]})},gE=e=>(0,i.jsx)(Dc,{css:{background:e.isSelected?"$primary100":"white",cursor:"pointer","&:hover":{background:"$gray100"}},onClick:e.onClick,children:(0,i.jsxs)(Ec,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(yr,{color:"gray900",fontWeight:"medium",children:e.title}),(0,i.jsx)(yr,{color:"gray500",children:e.subtitle})]})});let pE=class extends Ul{constructor(e){super(e)}emailTemplateDefault(e,t,n,i,s){const o=this.emailTypeToDefault(e,t,i,s);return n&&(o.subject=n.subject,o.content=n.content),{useDefault:n?.useDefault??!0,emailType:e,emailSenderId:n?.emailSenderId,attachments:n?.attachments??[],hasCalendarInvite:n?.hasCalendarInvite??!1,calendarInviteName:n?.calendarInviteName??null,calendarInviteStartDate:n?.calendarInviteStartDate??null,calendarInviteStartTime:n?.calendarInviteStartTime??null,calendarInviteEndDate:n?.calendarInviteEndDate??null,calendarInviteEndTime:n?.calendarInviteEndTime??null,...o}}emailTemplateSchema(){return d.Ik().shape({useDefault:d.zM().required(""),emailType:d.Yj().required(this.t("le_type_d_e_mai_84281")).oneOf(ln,this.t("le_type_d_e_mai_84281")),subject:d.Yj().when("useDefault",{is:!1,then:e=>e.required(this.t("le_sujet_est_re_18923"))}),content:d.Yj().when("useDefault",{is:!1,then:e=>e.required(this.t("le_contenu_est_45048")).test("contains-code",this.t("le_contenu_doit_64437"),function(){return!(!this.parent.useDefault&&this.parent.emailType===Oe.Code)||this.parent.content.includes("{code}")})}),attachments:d.YO().of(d.Yj()),hasCalendarInvite:d.zM().required(),calendarInviteName:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("nom_de_l_v_nem_58512")),otherwise:e=>e.nullable()}),calendarInviteStartDate:qm.when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),otherwise:e=>e.nullable()}),calendarInviteStartTime:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("heure_de_d_but_90785")),otherwise:e=>e.nullable()}),calendarInviteEndDate:qm.when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")),otherwise:e=>e.nullable()}),calendarInviteEndTime:d.Yj().when("hasCalendarInvite",{is:!0,then:e=>e.required(this.t("l_heure_de_fin_78626")),otherwise:e=>e.nullable()})})}updateEmailTemplateSchema(){return d.Ik().shape({emailTemplate:this.emailTemplateSchema()})}emailTypeToDefault(e,t,n,i){switch(e){case Oe.Accreditations:return this.accreditationsDefault();case Oe.AccreditationsRefused:return this.accreditationsRefusedDefault();case Oe.Assignments:return this.assignmentsDefault();case Oe.Code:return this.codeDefault(n,i);case Oe.FormInvite:return this.formInviteDefault();case Oe.FormSubmit:return this.formSubmitDefault(n);case Oe.NotifyLeaders:return this.notifyLeadersDefault(t);case Oe.DelegationCategoryLeaderAssign:return this.delegationCategoryLeaderAssign(t);case Oe.DelegationFormInvite:return this.delegationFormInviteDefault();case Oe.DelegationLeaderAssign:return this.delegationLeaderAssign();case Oe.PositionCategoryLeaderAssign:return this.positionCategoryLeaderAssignDefault(t);case Oe.PositionLeaderAssign:return this.positionLeaderAssign(t);case Oe.Refused:return this.refusedDefault();case Oe.VolunteerRegistration:return this.volunteerRegistrationDefault();case Oe.Campaign:case Oe.DelegationsImport:case Oe.EventsImport:case Oe.FilesImport:case Oe.Documents:case Oe.EventInvite:case Oe.Export:case Oe.MembersImport:case Oe.NewMember:case Oe.OrganizationInvite:case Oe.PositionsImport:throw new Error("Impossible to change this email");default:return rl()}}accreditationsDefault(){return{subject:this.t("_event_name_49280"),content:this.t("accreditations_default")}}accreditationsRefusedDefault(){return{subject:this.t("_event_name_01805"),content:this.t("accreditations_refused_default")}}assignmentsDefault(){return{subject:this.t("_event_name_72063"),content:this.t("assignments_default")}}codeDefault(e,t){return{subject:e&&!t?this.t("code_de_v_rific_41117"):this.t("code_de_connexi_57121"),content:this.t("code_default")}}formInviteDefault(){return{subject:this.t("form_invite_subject"),content:this.t("form_invite_content")}}formSubmitDefault(e){return e?{subject:this.t("_event_name_12686"),content:this.t("form_submit_event_default")}:{subject:this.t("_organization_n_21926"),content:this.t("form_submit_organization_default")}}notifyLeadersDefault(e){return{subject:this.t("_event_name_95901"),content:this.t("notify_leaders_default_1",e.href,vd)}}delegationCategoryLeaderAssign(e){return{subject:this.t("_event_name_69973"),content:this.t("_p_bonjour_use_97817",vd,e.href,vd)}}delegationLeaderAssign(){return{subject:this.t("_event_name_92886"),content:this.t("_p_bonjour_use_96380")}}delegationFormInviteDefault(){return{subject:this.t("invitation_re_29033"),content:this.t("_p_bonjour_use_29618")}}positionCategoryLeaderAssignDefault(e){return{subject:this.t("_event_name_63708"),content:this.t("category_leader_assign_default_1",vd,e.href,vd)}}positionLeaderAssign(e){return{subject:this.t("_event_name_60486"),content:this.t("leader_assign_default_1",vd,e.href,vd)}}refusedDefault(){return{subject:this.t("_event_name_59248"),content:this.t("refused_default")}}volunteerRegistrationDefault(){return{subject:this.t("_event_name_12686"),content:this.t("volunteer_registration_default")}}};pE=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],pE);const fE=e=>{const{history:t,translate:n}=_l(),{organization:s}=yI(),{event:o}=vb(),{data:r,loader:a}=Zn("query EmailTemplate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId\n $source: LoginCodeSource\n $emailType: EmailType!\n) {\n organization(id: $organizationId) {\n emailsSenders {\n id\n name\n }\n\n event: eventMaybe(id: $eventId) {\n customDocuments {\n slug\n name\n }\n }\n\n emailTemplate(emailType: $emailType, eventId: $eventId, formId: $formId, source: $source) {\n emailType\n useDefault\n subject\n content\n emailSenderId\n attachments\n hasCalendarInvite\n calendarInviteName\n calendarInviteStartDate\n calendarInviteStartTime\n calendarInviteEndDate\n calendarInviteEndTime\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailType:e.emailType},[]);const{mutate:l,isLoading:d}=function(e={}){return Xn("mutation EmailTemplateUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId\n $source: LoginCodeSource\n $emailTemplate: EmailsTemplateInput!\n) {\n emailTemplateUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n source: $source\n emailTemplate: $emailTemplate\n ) {\n id\n }\n}\n",e)}(),c=qn(pE),u=qn(Ba),h=o?.useDocuments&&(e.emailType===Oe.Accreditations||e.emailType===Oe.Assignments||e.emailType===Oe.FormSubmit&&e.eventId),m=e.emailType===Oe.Accreditations||e.emailType===Oe.Assignments||e.emailType===Oe.FormSubmit||e.emailType===Oe.VolunteerRegistration;return a||(0,i.jsx)(Cl,{direction:"column",initialValues:{emailTemplate:c.emailTemplateDefault(e.emailType,P.HEAVENT_APP_URL,r.organization.emailTemplate,e.eventId,e.formId)},render:({handleSubmit:o,values:a})=>(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[(0,i.jsx)(ul,{children:n("contenu_de_l_e_19848")}),(0,i.jsx)(Nm,{name:"emailTemplate.useDefault",children:n("utiliser_le_mod_93521")}),!a.emailTemplate.useDefault&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ll,{label:n("sujet_de_l_e_ma_66809"),name:"emailTemplate.subject"}),(0,i.jsx)(Um,{hint:n("cet_metteur_se_80394"),isCreateVisible:!0,isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:n("_metteur_de_l_e_51616")}),name:"emailTemplate.emailSenderId",onCreateClick:()=>{t.push($s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:(r.organization?.emailsSenders??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Qv,{hint:(0,i.jsx)(yr,{css:{"& a":{color:"$primary700"}},dangerouslySetInnerHTML:{__html:n("vous_pouvez_ajo_23408")}}),label:n("contenu_de_l_e_19848"),name:"emailTemplate.content"}),h&&(0,i.jsxs)(Um,{isSearchVisible:!0,label:n("pi_ce_s_jointe_82370"),multiple:!0,name:"emailTemplate.attachments",children:[(r.organization?.event?.customDocuments??[]).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),s.customBadges.map(e=>(0,i.jsx)("option",{value:e,children:P_(e)},e)),JI.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))]}),m&&(0,i.jsx)(nb,{hasCalendarInvite:a.emailTemplate.hasCalendarInvite,prefix:"emailTemplate."})]}),(0,i.jsx)(Bb,{permissions:Nb.EMAIL_EDIT,children:(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:d,onClick:o,children:n("enregistrer_le_77369")})})})]}),validate:u.validateForForm(c.updateEmailTemplateSchema()),width:1,onSubmit:async t=>{await l({organizationId:e.organizationId,eventId:e.eventId,formId:e.formId,source:e.source,emailTemplate:t.emailTemplate})}})},xE=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,formId:o}}=_l(),{data:r}=aa({organizationId:n,formId:o});Dd(r.organization?.form.name??"");const[a,l]=(0,L.useState)(Oe.FormSubmit);return(0,i.jsx)(WS,{title:r.organization?.form.name??"-",onClose:()=>{e.push(Ni.FORMS({organizationId:n,eventId:s}))},children:(0,i.jsx)(Na,{justify:"center",width:1,children:(0,i.jsxs)(Na,{direction:"column",width:"$container",children:[(0,i.jsx)(qa,{height:"8"}),(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_e_mai_73508")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(kc,{children:[(0,i.jsx)(jc,{children:(0,i.jsx)(Vc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(gE,{isSelected:a===Oe.FormSubmit,subtitle:t("cet_e_mail_est_29404"),title:t("remplissage_du_09925"),onClick:()=>l(Oe.FormSubmit)}),(0,i.jsx)(gE,{isSelected:a===Oe.Code,subtitle:t("cet_e_mail_est_49525"),title:t("code_20843"),onClick:()=>l(Oe.Code)}),s&&(0,i.jsx)(gE,{isSelected:a===Oe.FormInvite,subtitle:t("cet_email_est_e_46197"),title:t("invitation_d_un_88753"),onClick:()=>l(Oe.FormInvite)})]})]}),(0,i.jsx)(yr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Na,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(fE,{emailType:a,eventId:s,formId:o,organizationId:n,source:null})})]}),(0,i.jsx)(qa,{height:"8"})]})})})};let _E=class extends Ul{constructor(e){super(e)}formParametersBroadcastInputDefault(e){return{segmentsIds:(e?.segments??[]).map(e=>e.segmentId),noAccessTitle:e?.noAccessTitle||"",noAccessMessage:e?.noAccessMessage||""}}formParametersBroadcastInputSchema(){return d.Ik().shape({segmentsIds:d.YO().of(d.ai())})}updateFormParametersBroadcastSchema(){return d.Ik().shape({form:this.formParametersBroadcastInputSchema()})}};_E=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],_E);const IE=({children:e,isActive:t,replace:n=!0,to:s})=>{const o=ei(),r=t?.(o.pathname)??o.pathname===s;return(0,i.jsx)(yr,{css:{background:r?"$primary100":"transparent",borderRadius:"6px",color:r?"$primary700":"$gray500",cursor:r?"default":"pointer",padding:"$2 $3"},children:(0,i.jsx)(Ja,{replace:n,to:s,children:e})})},vE=e=>(0,i.jsx)(Na,{"aria-orientation":"vertical",as:Pa.Nav,direction:"column",gap:"2",role:"menubar",width:1,children:e.children}),bE=e=>{const{translate:t,params:n}=_l(),{hasFeature:s}=yI(),{event:o}=vb();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(cd,{css:{py:"$8"},gridtemplatecolumns:"1fr 210px 80px 880px 1fr",gridtemplaterows:"1fr",width:1,children:[(0,i.jsx)(yr,{css:{gridColumn:"2 / 3"},children:(0,i.jsxs)(vE,{children:[(0,i.jsx)(IE,{to:Ni.FORM_PARAMETERS_GENERAL(n),children:t("g_n_ral_64953")}),(0,i.jsx)(IE,{to:Ni.FORM_PARAMETERS_DESIGN(n),children:t("design_15043")}),n.eventId&&(0,i.jsx)(IE,{to:Ni.FORM_PARAMETERS_AVAILABILITIES(n),children:t("disponibilit_s_49923")}),n.eventId&&o.usePositions&&(0,i.jsx)(IE,{to:Ni.FORM_PARAMETERS_MISSIONS(n),children:t("missions_63972")}),n.eventId&&o.useAccreditations&&s(Ne.Accreditation)&&(0,i.jsx)(IE,{to:Ni.FORM_PARAMETERS_ACCREDITATIONS(n),children:t("accr_ditations_39450")}),(0,i.jsx)(IE,{to:Ni.FORM_PARAMETERS_BROADCAST(n),children:t("diffusion_56689")}),(0,i.jsx)(IE,{to:Ni.FORM_PARAMETERS_STATE(n),children:t("cl_turer_88223")})]})}),(0,i.jsx)(yr,{css:{gridColumn:"4 / 5"},width:1,children:e.children})]}),(0,i.jsx)(qS,{fallbackPath:Ni.FORMS({organizationId:n.organizationId,eventId:n.eventId}),isOpen:e.isNotSavedOpen,onClose:e.onNotSavedClose})]})};function jE(e,t,n){const{history:i,params:{organizationId:s,eventId:o}}=_l(),[r,a]=(0,L.useState)(!1),[l,d]=(0,L.useState)(JSON.stringify(e)),c=(0,L.useCallback)(()=>{const e=JSON.stringify(t);l===e?i.push(Ni.FORMS({organizationId:s,eventId:o})):a(!0)},[l,t]),u=(0,L.useCallback)(()=>{a(!1)},[a]),h=(0,L.useCallback)(()=>{n(),d(JSON.stringify(t))},[n,t]);return(0,L.useEffect)(()=>{d(JSON.stringify(e))},[e]),{isNotSavedModalOpen:r,onClose:c,onNotSavedClose:u,onSave:h}}const CE=e=>{const t=Yn(),{isNotSavedModalOpen:n,onClose:s,onNotSavedClose:o,onSave:r}=jE(e.initialValues,e.values,e.handleSubmit),[a,l]=L.useState(no(e.initialValues.form.segmentsIds)),d=L.useMemo(()=>no(e.eventSegments)&&no(e.organizationSegments)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("optgroup",{label:t("vues_de_l_v_ne_57031"),children:e.eventSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:t("vues_de_l_organ_32624"),children:e.organizationSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}):no(e.eventSegments)?(0,i.jsx)(i.Fragment,{children:e.eventSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):no(e.organizationSegments)?(0,i.jsx)(i.Fragment,{children:e.organizationSegments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):(0,i.jsx)(i.Fragment,{}),[e.eventSegments,e.organizationSegments]);return L.useEffect(()=>{l(no(e.initialValues.form.segmentsIds))},[e.initialValues.form.segmentsIds]),(0,i.jsx)(WS,{button:(0,i.jsx)(El,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(bE,{isNotSavedOpen:n,onNotSavedClose:o,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("diffusion_du_fo_47764")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("personnalisez_l_57514")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("_qui_s_adresse_82507")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:a?"unchecked":"checked",onClick:()=>{l(!1),e.change("form.segmentsIds",[])},children:t("_tout_le_monde_35921")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:a?"checked":"unchecked",onClick:()=>{l(!0)},children:t("_certaines_vue_55512")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!0,name:"form.segmentsIds",children:d})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{label:t("nom_de_l_tape_85862"),name:"form.noAccessTitle"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Qv,{label:t("message_affich_57692"),name:"form.noAccessMessage"})]})]})})})},yE=e=>{const{params:{organizationId:t,eventId:n,formId:s}}=_l(),o=qn(Ba),r=qn(_E),{mutate:a,isLoading:l}=function(e={}){return Xn("mutation FormParametersBroadcastUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersBroadcastInput!\n) {\n formParametersBroadcastUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),d=L.useMemo(()=>({form:r.formParametersBroadcastInputDefault(e.form)}),[e.form]);return(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:d,render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(CE,{change:t.change,eventSegments:e.eventSegments,handleSubmit:n,initialValues:d,isMutateLoading:l,loader:e.loader,name:e.form?.name??"",organizationSegments:e.organizationSegments,values:s}),validate:o.validateForForm(r.updateFormParametersBroadcastSchema()),width:1,onSubmit:e=>a({organizationId:t,eventId:n,formId:s,form:e.form})})},kE=()=>{const{params:{organizationId:e,formId:t}}=_l(),{data:n,loader:s}=Zn("query FormParametersBroadcastOrganization($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n segments(segmentType: Volunteers) {\n id\n name\n }\n\n form(id: $formId) {\n name\n noAccessMessage\n noAccessTitle\n\n segments {\n segmentId\n }\n }\n }\n}\n",{organizationId:e,formId:t},[]);return Dd(n.organization?.form.name??""),(0,i.jsx)(yE,{eventSegments:[],form:n.organization?.form,loader:s,organizationSegments:n.organization?.segments??[]})},AE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=_l(),{data:s,loader:o}=Zn("query FormParametersBroadcastEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n noAccessMessage\n noAccessTitle\n\n segments {\n segmentId\n }\n }\n\n segments(segmentType: Volunteers) {\n id\n name\n }\n }\n\n event(id: $eventId) {\n segments(segmentType: Volunteers) {\n id\n name\n }\n }\n}\n",{organizationId:e,eventId:t,formId:n},[]);return Dd(s.organization?.form.name??""),(0,i.jsx)(yE,{eventSegments:s.event?.segments??[],form:s.organization?.form,loader:o,organizationSegments:s.organization?.segments??[]})};function wE(e){return{gray50:e?.gray50??fr.colors.gray50.value,gray500:e?.gray500??fr.colors.gray500.value,gray700:e?.gray700??fr.colors.gray700.value,gray800:e?.gray800??fr.colors.gray800.value,gray900:e?.gray900??fr.colors.gray900.value,primary700:e?.primary700??fr.colors.primary700.value,primary800:e?.primary800??fr.colors.primary800.value}}let SE=class extends Ul{documentInputService;constructor(e,t){super(t),this.documentInputService=e}organizationDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),logo:e?.logo??this.documentInputService.documentInputDefault(),colors:wE(e?.colors)}}formParametersDesignInputDefault(e){return{banner:e?.banner??this.documentInputService.documentInputDefault(),colors:wE(e?.colors)}}};SE=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Mj,Wn])],SE);const EE=e=>{const t=(0,L.useRef)(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("details",{ref:t,open:e.showSection,onToggle:t=>e.setShowSection(t.currentTarget.open),children:[(0,i.jsx)("summary",{style:{cursor:"pointer"},children:(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(bu,{tabIndex:-1,value:e.showSection,onChange:Ql.A}),(0,i.jsx)(cl,{css:{fontWeight:"$medium"},children:e.toggle})]})}),(0,i.jsx)(Na,{css:{marginBlockStart:"$5",borderBlockStart:"1px solid $gray200",paddingBlockStart:"$6"},direction:"column",gap:"3",children:e.children})]})})},TE=({css:e,isOpen:t,isOpenToggleLabel:n,...s})=>{const{descId:o}=Ga(),[r,a]=L.useState(t??!1);return(0,i.jsxs)(Na,{"aria-describedby":o,as:"fieldset",className:"fieldset--column",css:{border:"unset",padding:"unset",margin:"unset",...e},direction:"column",disabled:n?!r:void 0,gap:n?"5":"6",...s,children:[(0,i.jsx)(lb,{heading:s.heading}),(0,i.jsxs)(Na,{as:Pa.Header,css:{paddingBlockEnd:n?void 0:"$5",borderBlockEnd:n?void 0:"1px solid $gray200"},direction:"column",gap:"1",children:[(0,i.jsx)(ul,{"aria-hidden":"true",color:"gray800",textStyle:"heading",children:s.heading}),(0,i.jsx)(cl,{id:o,textStyle:"subtitle",children:s.subtitle})]}),n?(0,i.jsx)(EE,{setShowSection:a,showSection:r,toggle:n,children:s.children}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Na,{css:{gap:"$4","&:has(> fieldset.fieldset--column)":{gap:"$9"},"&:has(> fieldset.fieldset--row)":{gap:"unset"}},direction:"column",children:s.children})})]})},zE=e=>{const{descId:t}=Ga();return(0,i.jsxs)(Na,{"aria-describedby":t,as:"fieldset",className:"fieldset--row",css:{border:"unset",padding:"unset",margin:"unset","&:not(:first-of-type)":{paddingBlockStart:"$5"},"&:not(:last-of-type)":{paddingBlockEnd:"$5",borderBlockEnd:"1px solid $gray200"},"& fieldset.fieldset--column":{gap:"$2","& header":{paddingBlockEnd:"unset",borderBlockEnd:"unset !important","& > :is(h1, h2, h3, h4, h5, h6)":{fontSize:"$textSm !important"}}}},direction:"row",gap:"7",...e,children:[(0,i.jsx)(lb,{heading:e.heading}),(0,i.jsxs)(Na,{as:Pa.Header,direction:"row",gap:"1",width:280,children:[(0,i.jsx)(ul,{"aria-hidden":"true",color:"gray800",css:{fontSize:"$textSm"},textStyle:"subheading",children:e.heading}),(0,i.jsx)(cl,{id:t,textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsx)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:e.children})]})},OE=()=>{const{translate:e}=_l();return(0,i.jsxs)(TE,{heading:e("charte_graphiqu_02725"),children:[(0,i.jsx)(zE,{heading:e("textes_07935"),children:(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Lj,{initialValue:fr.colors.gray800.value,label:e("couleur_du_text_32021"),name:"design.colors.gray800"}),(0,i.jsx)(Lj,{initialValue:fr.colors.gray900.value,label:e("couleur_des_tit_58918"),name:"design.colors.gray900"}),(0,i.jsx)(Lj,{initialValue:fr.colors.gray500.value,label:e("couleur_des_sou_18968"),name:"design.colors.gray500"}),(0,i.jsx)(Lj,{initialValue:fr.colors.gray700.value,label:e("couleur_des_lab_38397"),name:"design.colors.gray700"})]})}),(0,i.jsx)(zE,{heading:e("boutons_35604"),children:(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Lj,{initialValue:fr.colors.primary700.value,label:e("couleur_des_bou_24410"),name:"design.colors.primary700"}),(0,i.jsx)(Lj,{initialValue:fr.colors.primary800.value,label:e("couleur_des_bou_16515"),name:"design.colors.primary800"})]})})]})},RE=()=>{const{params:{organizationId:e},translate:t}=_l();return(0,i.jsxs)(TE,{heading:t("design_du_formu_57145"),subtitle:t("personnalisez_l_27035"),children:[(0,i.jsx)(zE,{heading:t("banni_re_du_for_40749"),children:(0,i.jsx)(fC,{hint:t("taille_de_l_ima_84109"),label:t("s_lectionnez_un_82734"),organizationId:e,prefix:"design.banner."})}),(0,i.jsx)(OE,{})]})},$E=e=>{const t=Yn(),{isNotSavedModalOpen:n,onClose:s,onNotSavedClose:o,onSave:r}=jE(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(WS,{button:(0,i.jsx)(El,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(bE,{isNotSavedOpen:n,onNotSavedClose:o,children:e.loader||(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(RE,{})})})})},DE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=_l(),{data:s,loader:o}=Zn("query FormParametersDesign($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n\n design {\n banner {\n acl\n name\n key\n }\n\n colors\n }\n }\n }\n}\n",{organizationId:e,formId:n},[]);Dd(s.organization?.form.name??"");const r=qn(SE),{mutate:a,isLoading:l}=function(e={}){return Xn("mutation FormParametersDesignUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $design: DesignInput!\n) {\n formParametersDesignUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n design: $design\n ) {\n id\n }\n}\n",e)}(),d=L.useMemo(()=>({design:r.formParametersDesignInputDefault(s.organization?.form.design)}),[s.organization]);return(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:d,render:({handleSubmit:t,values:n})=>(0,i.jsx)($E,{handleSubmit:t,initialValues:d,isMutateLoading:l,loader:o,name:s.organization?.form.name??"",organizationId:e,values:n}),width:1,onSubmit:i=>a({organizationId:e,eventId:t,formId:n,design:i.design})})};let PE=class extends Ul{constructor(e){super(e)}formParametersGeneralInputDefault(e){return{name:e?.name??"",setAssignmentStateToWaiting:e?.setAssignmentStateToWaiting??!1,setAccreditationStateToWaiting:e?.setAccreditationStateToWaiting??!1,allowMultiProfiles:e?.allowMultiProfiles??!1,canRefill:e?.canRefill??!1,description:e?.description||"",successMessage:e?.successMessage||"",customFields:e?.customFields||[],areTeamsAllowed:e?.areTeamsAllowed??!1,maxTeamMembers:e?.maxTeamMembers,teamMemberFillFullForm:e?.teamMemberFillFullForm??!0,emailTitle:e?.emailTitle||"",informationTitle:e?.informationTitle||"",registerButtonText:e?.registerButtonText||"",isEditableInMemberSpace:e?.isEditableInMemberSpace??!0}}formParametersGeneralInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),allowMultiProfiles:d.zM().required(),setAssignmentStateToWaiting:d.zM().required(),setAccreditationStateToWaiting:d.zM().required(),description:d.Yj(),successMessage:d.Yj(),areTeamsAllowed:d.zM().required(),maxTeamMembers:d.ai().nullable(),teamMemberFillFullForm:d.zM().required(),informationTitle:d.Yj(),registerButtonText:d.Yj()})}updateFormParametersGeneralSchema(){return d.Ik().shape({form:this.formParametersGeneralInputSchema()})}};PE=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],PE);const FE=e=>{const t=Yn(),[n,s]=L.useState(no(e.values)),o=L.useCallback(t=>{s(t),t||e.change(e.name,[])},[e.name,e.change,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("d_finir_la_vale_27863")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("choisissez_une_24029")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(ju,{value:n,onChange:o,children:t("je_souhaite_d_f_72912")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Zj,{...e})]})]})},ME=e=>{const{translate:t,params:{eventId:n}}=_l(),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:r,onSave:a}=jE(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(WS,{button:(0,i.jsx)(El,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(bE,{isNotSavedOpen:s,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("initialisation_29288")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("personnaliser_l_27381")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{label:t("nom_du_formulai_14952"),name:"form.name"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t("affectation_des_81808")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Nm,{name:"form.setAssignmentStateToWaiting",children:t("les_membres_ser_52180")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t("accr_ditation_d_48426")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Nm,{name:"form.setAccreditationStateToWaiting",children:t("les_membres_ser_34727")})]}),(0,i.jsx)(Ku,{height:"7"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("param_trage_de_41992")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("donner_la_possi_56694")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:t("inscriptions_mu_35073")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Hm,{name:"form.allowMultiProfiles",children:t("autoriser_les_i_26880")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:t("remplissages_mu_72343")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Hm,{name:"form.canRefill",subtext:t("permet_aux_memb_26701"),children:t("autoriser_les_m_44818")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:t("inscriptions_en_77739")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Hm,{name:"form.areTeamsAllowed",children:t("permettre_aux_m_56083")}),e.values.form.areTeamsAllowed&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Hm,{name:"form.teamMemberFillFullForm",children:t("tous_les_membre_59937")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{label:t("nombre_maximum_14615"),name:"form.maxTeamMembers",shouldParseAsInt:!0})]})]}),(0,i.jsx)(Ku,{height:"7"}),(0,i.jsx)(FE,{change:e.change,customFields:e.customFields,name:"form.customFields",values:e.values.form.customFields}),(0,i.jsx)(Ku,{height:"7"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_00197")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("personnaliser_l_68212")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Ll,{name:"form.emailTitle"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("description_de_80800")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("la_description_13257")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Qv,{name:"form.description"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_de_l_tap_92536")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("personnaliser_l_66470")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Ll,{name:"form.informationTitle"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("texte_du_bouton_05866")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("personnaliser_l_02611")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Ll,{name:"form.registerButtonText"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("message_de_succ_99510")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("personnaliser_l_55334")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Qv,{name:"form.successMessage"}),(0,i.jsx)(Ku,{height:"7"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("_dition_des_inf_90758")}),(0,i.jsx)(yr,{color:"gray500",children:t("donner_la_possi_56683")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t("espace_membre_06532")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Hm,{name:"form.isEditableInMemberSpace",children:t("permettre_aux_m_40630")})]})})})},NE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=_l(),{data:s,loader:o}=Zn("query FormParametersGeneral($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...MassEditCustomField\n }\n }\n\n form(id: $formId) {\n name\n setAssignmentStateToWaiting\n setAccreditationStateToWaiting\n allowMultiProfiles\n canRefill\n description\n successMessage\n areTeamsAllowed\n maxTeamMembers\n teamMemberFillFullForm\n emailTitle\n informationTitle\n registerButtonText\n isEditableInMemberSpace\n\n customFields {\n addValues\n customFieldId\n value\n }\n }\n }\n}\n",{organizationId:e,formId:n},[Ls.MassEditCustomFieldFragment]);Dd(s.organization?.form.name??"");const r=qn(Ba),a=qn(PE),{mutate:l,isLoading:d}=function(e={}){return Xn("mutation FormParametersGeneralUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersGeneralInput!\n) {\n formParametersGeneralUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=L.useMemo(()=>({form:a.formParametersGeneralInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(ME,{change:e.change,customFields:s.organization?.customFields.nodes??[],handleSubmit:t,initialValues:c,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",values:n}),validate:r.validateForForm(a.updateFormParametersGeneralSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:{...i.form,description:i.form.description||"",successMessage:i.form.successMessage||""}})})})};let LE=class extends Ul{constructor(e){super(e)}formParametersStateInputDefault(e){return{state:e?.state||Ye.Open,closedTitle:e?.closedTitle||"",closedMessage:e?.closedMessage||"",closedAt:e?.closedAt||null}}formParametersStateInputSchema(){return d.Ik().shape({state:d.Yj().required(this.t("cl_turer_le_for_10541")).oneOf(gn,this.t("cl_turer_le_for_10541")),closedMessage:d.Yj(),closedAt:qm.when("state",{is:Ye.ClosedAt,then:e=>e.required(this.t("la_date_de_cl_t_63358")).typeError(this.t("la_date_de_cl_t_63358")),otherwise:e=>e.nullable()})})}updateFormParametersStateSchema(){return d.Ik().shape({form:this.formParametersStateInputSchema()})}};LE=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],LE);const BE=e=>{const{translate:t,params:{eventId:n}}=_l(),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:r,onSave:a}=jE(e.initialValues,e.values,e.handleSubmit);return(0,i.jsx)(WS,{button:(0,i.jsx)(El,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(bE,{isNotSavedOpen:s,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:"form.state",children:t=>{t!==Ye.ClosedAt&&e.change("form.closedAt",null)}}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("cl_turer_le_for_46483")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("choisir_si_le_f_14519")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(sb,{name:"form.state",value:Ye.Open,children:t("ne_pas_cl_turer_46870")}),(0,i.jsx)(qa,{height:"3"}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sb,{name:"form.state",value:Ye.CloseWhenEventDone,children:t("cl_turer_le_for_61719")}),(0,i.jsx)(qa,{height:"3"})]}),(0,i.jsx)(sb,{name:"form.state",value:Ye.Closed,children:t("cl_turer_le_for_10120")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"form.state",value:Ye.ClosedAt,children:t("cl_turer_le_for_19176")}),e.values.form.state===Ye.ClosedAt&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(Bj,{name:"form.closedAt"})]})]}),e.values.form.state!==Ye.Open&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{label:t("nom_de_l_tape_85862"),name:"form.closedTitle"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Qv,{hint:t("ce_message_sera_03472"),label:t("message_de_cl_t_95276"),name:"form.closedMessage"})]})]})})})},VE=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=_l(),{data:s,loader:o}=Zn("query FormParametersState($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n state\n closedTitle\n closedMessage\n closedAt\n }\n }\n}\n",{organizationId:e,formId:n},[]);Dd(s.organization?.form.name??"");const r=qn(Ba),a=qn(LE),{mutate:l,isLoading:d}=function(e={}){return Xn("mutation FormParametersStateUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersStateInput!\n) {\n formParametersStateUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=L.useMemo(()=>({form:a.formParametersStateInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(BE,{change:e.change,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",values:n}),validate:r.validateForForm(a.updateFormParametersStateSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})};function UE(e,t,n,i){return(0,Ya.A)([i.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:qI.CREATE({organizationId:t})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:yi.COMMUNITY_USERS({organizationId:t})},i.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:$s.CREATE_EVENT(t)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${bi.ORGANIZATION({organizationId:t})}/events`},i.canCustomFieldEdit&&-1!==n?{icon:"text",text:e("cr_eer_un_champ_08883"),link:$s.CREATE_CUSTOM_FIELD(t,n)}:null,i.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:$s.CUSTOM_FIELDS(t)}:null,i.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:Ni.CREATE({organizationId:t})}:null,i.canFormEdit?{icon:"file-lines",text:e("voir_les_formul_55824"),link:Ni.FORMS({organizationId:t})}:null,i.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:$s.COMMUNITY_CREATE_DELEGATION(t)}:null,i.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:ds.DELEGATIONS({organizationId:t})}:null,i.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:SI.CREATE({organizationId:t})}:null,i.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:SI.CAMPAIGNS({organizationId:t})}:null,i.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:ZI.CREATE({organizationId:t})}:null,i.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:ZI.WORKFLOWS({organizationId:t})}:null])}function WE(e,t,n,i,s){return(0,Ya.A)([s.canMemberEdit?{icon:"user-plus",text:e("cr_er_un_membre_38547"),link:qI.CREATE({organizationId:t,eventId:n})}:null,{icon:"user-group",text:e("voir_les_membre_27923"),link:$s.VOLUNTEERS(t,n)},s.canEventEdit?{icon:"cake-candles",text:e("cr_er_un_v_nem_28126"),link:$s.CREATE_EVENT(t)}:null,{icon:"cake-candles",text:e("voir_les_v_nem_52491"),link:`${bi.ORGANIZATION({organizationId:t})}/events`},s.canCustomFieldEdit&&-1!==i?{icon:"text",text:e("cr_eer_un_champ_08883"),link:$s.CREATE_CUSTOM_FIELD(t,i)}:null,s.canCustomFieldRead?{icon:"text",text:e("voir_les_champs_59185"),link:$s.CUSTOM_FIELDS(t)}:null,s.canPositionEdit?{icon:"sitemap",text:e("cr_er_une_missi_66818"),link:$s.CREATE_POSITION(t,n)}:null,s.canPositionRead?{icon:"sitemap",text:e("voir_les_missio_71964"),link:ps.POSITIONS({organizationId:t,eventId:n})}:null,s.canFormEdit?{icon:"file-lines",text:e("cr_er_un_formul_78352"),link:Ni.CREATE({organizationId:t,eventId:n})}:null,s.canFormRead?{icon:"file-lines",text:e("voir_les_formul_55824"),link:Ni.FORMS({organizationId:t,eventId:n})}:null,s.canAccreditationEdit?{icon:"badge-check",text:e("cr_er_une_accr_33475"),link:$s.CREATE_ACCREDITATION(t,n)}:null,s.canAccreditationRead?{icon:"badge-check",text:e("voir_les_accr_d_34867"),link:es.ACCREDITATIONS({organizationId:t,eventId:n})}:null,s.canDelegationEdit?{icon:"users",text:e("cr_er_une_d_l_g_23035"),link:$s.CREATE_DELEGATION(t,n)}:null,s.canDelegationRead?{icon:"users",text:e("voir_les_d_l_ga_71959"),link:ds.DELEGATIONS({organizationId:t,eventId:n})}:null,s.canCampaignSend?{icon:"paper-plane",text:e("cr_er_une_campa_96023"),link:SI.CREATE({organizationId:t,eventId:n})}:null,s.canCampaignRead?{icon:"paper-plane",text:e("voir_les_campag_02148"),link:SI.CAMPAIGNS({organizationId:t,eventId:n})}:null,s.canWorkflowEdit?{icon:"hand-sparkles",text:e("cr_er_une_autom_91246"),link:ZI.CREATE({organizationId:t,eventId:n})}:null,s.canWorkflowRead?{icon:"hand-sparkles",text:e("voir_les_automa_58340"),link:ZI.WORKFLOWS({organizationId:t,eventId:n})}:null])}function GE(e){switch(e.segmentType){case vt.Accreditations:return e.eventId?$s.ACCREDITATIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case vt.Campaigns:return SI.CAMPAIGNS_SEGMENT({organizationId:e.organizationId,segmentId:e.id});case vt.CustomFields:return $s.CUSTOM_FIELDS_SEGMENT(e.organizationId,e.id);case vt.Delegations:return e.eventId?$s.DELEGATIONS_SEGMENT(e.organizationId,e.eventId,e.id):$s.COMMUNITY_DELEGATIONS_SEGMENT(e.organizationId,e.id);case vt.Events:return $s.EVENTS_SEGMENT(e.organizationId,e.id);case vt.Positions:return e.eventId?$s.POSITIONS_SEGMENT(e.organizationId,e.eventId,e.id):"";case vt.Volunteers:return e.eventId?$s.VOLUNTEERS_SEGMENT(e.organizationId,e.eventId,e.id):$s.COMMUNITY_USERS_SEGMENT(e.organizationId,e.id);default:return rl(e.segmentType)}}const HE=e=>(0,i.jsx)(qc,{css:{"&:hover":{textDecoration:"none"}},hideIcon:!0,to:e.link,width:1,onClick:()=>{e.onClose()},children:(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer",px:"$4","&:hover":{background:"$gray100"}},gap:"2",height:40,width:1,children:[e.avatar,e.icon&&(0,i.jsx)(yr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(el,{icon:e.icon})}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:e.children})]})}),qE=e=>(0,i.jsx)(Na,{css:{px:"$4"},children:(0,i.jsx)(yr,{font:"gray500 textSm medium",children:e.children})}),YE=e=>(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(qE,{children:e.title}),e.children]}),KE="h-open-omnibar",ZE=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),o=SS(),r=wS(),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(!1),[h,g,p]=Bc(""),[f,x]=(0,L.useState)([]),[_,I]=(0,L.useState)([]),[v,b]=(0,L.useState)([]),[j,C]=(0,L.useState)(-1),[y,k]=(0,L.useState)([]),[A,w]=(0,L.useState)([]),[S,E]=(0,L.useState)([]),[T,z]=(0,L.useState)([]),[O,R]=(0,L.useState)([]),[$,D]=(0,L.useState)([]),[P,F]=(0,L.useState)([]),[M,N]=(0,L.useState)(s?WE(t,n,s,j,r):UE(t,n,j,o)),B=(0,L.useMemo)(()=>io(M)&&io(f)&&io(_)&&io(v)&&io(y)&&io(A)&&io(S)&&io(T)&&io(O)&&io($)&&io(P),[M,f,_,v,y,A,S,T,O,$,P]),V=(0,L.useCallback)(()=>{N(s?WE(t,n,s,j,r):UE(t,n,j,o)),x([]),I([]),b([]),k([]),w([]),E([]),z([]),R([]),D([]),F([])},[n,s,o,r,N,x,I,b,k,w,E,z,R,D,F]),U=(0,L.useCallback)(e=>{Rl(e),c(!1),p(""),V(),l(e=>!e)},[l,c,p,V]),W=(0,L.useCallback)(()=>{l(!1)},[l]);return dm("k",U),Fd(W),Pd(W),(0,L.useEffect)(()=>(document.addEventListener(KE,U),()=>{document.removeEventListener(KE,U)}),[U]),(0,L.useEffect)(()=>{(async()=>{if(m(g)){if(c(!0),s){const{organization:o,event:a}=await(e={organizationId:n,eventId:s,name:g},i=await K(),ho('query EventOmnibar($organizationId: OrganizationId!, $eventId: EventId!, $name: String) {\n organization(id: $organizationId) {\n customFields(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n events(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customFieldsSegment: segments(segmentType: CustomFields) {\n id\n }\n }\n\n event(id: $eventId) {\n accreditations(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n campaigns(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n delegations(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n forms(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n positions(columnsSearch: ["id", "name", "acronym"], name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n segments(name: $name) {\n id\n organizationId\n eventId\n name\n segmentType\n }\n\n volunteersRegistrations(\n columnsSearch: [\n "email"\n "id"\n "name"\n "phone"\n "teamCode"\n "weezevent_barcode_id"\n "weezevent_short_tag"\n ]\n name: $name\n limit: 5\n ) {\n nodes {\n userInfo {\n id\n email\n name\n\n picture {\n url\n }\n }\n }\n }\n\n workflows(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n }\n}\n',{variables:e,token:i||void 0,fragments:[]}));N(WE(t,n,s,o.customFieldsSegment[0].id,r).filter(e=>u(e.text).includes(u(g)))),x(a.volunteersRegistrations.nodes.map(e=>e.userInfo)),I(r.canEventEdit?o.events.nodes:[]),b(r.canCustomFieldEdit?o.customFields.nodes:[]),C(o.customFieldsSegment[0].id),k(r.canPositionRead?a.positions.nodes:[]),w(r.canFormRead?a.forms.nodes:[]),E(r.canAccreditationRead?a.accreditations.nodes:[]),z(r.canDelegationRead?a.delegations.nodes:[]),R(r.canCampaignRead?a.campaigns.nodes:[]),D(r.canWorkflowRead?a.workflows.nodes:[]),F(a.segments)}else{const{organization:e}=await function(e,t){return ho("query OrganizationOmnibar($organizationId: OrganizationId!, $name: String) {\n organization(id: $organizationId) {\n accreditations(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n campaigns(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customFields(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n customFieldsSegment: segments(segmentType: CustomFields) {\n id\n }\n\n delegations(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n events(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n forms(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n positions(name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n\n segments(name: $name) {\n id\n organizationId\n eventId\n name\n segmentType\n }\n\n usersInfos(name: $name, limit: 5) {\n nodes {\n id\n email\n name\n\n picture {\n url\n }\n }\n }\n\n workflows(level: Both, name: $name, limit: 5) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[]})}({organizationId:n,name:g},await K());N(UE(t,n,j,o).filter(e=>u(e.text).includes(u(g)))),x(e.usersInfos.nodes),I(e.events.nodes),b(o.canCustomFieldRead?e.customFields.nodes:[]),C(e.customFieldsSegment[0].id),k(o.canPositionRead?e.positions.nodes:[]),w(o.canFormRead?e.forms.nodes:[]),E(o.canAccreditationRead?e.accreditations.nodes:[]),z(o.canDelegationRead?e.delegations.nodes:[]),R(o.canCampaignRead?e.campaigns.nodes:[]),D(o.canWorkflowRead?e.workflows.nodes:[]),F(e.segments)}c(!1)}else V();var e,i})()},[n,s,o,r,g,c,N,x,I,b,C,k,w,E,z,R,D,F,V]),a&&("organization"===e.level&&!s||"event"===e.level&&s)?(0,Ht.createPortal)((0,i.jsx)(Na,{align:"center",css:{background:"rgba(52, 64, 84, 0.7)",height:"100%",left:0,position:"absolute",top:0,width:"100%",zIndex:"300"},justify:"center",children:(0,i.jsxs)(Na,{css:{background:"white",borderRadius:"$3",overflow:"hidden"},direction:"column",width:640,onClick:e=>Rl(e),children:[(0,i.jsx)(yr,{css:{"& .h-styled-input-container":{height:"48px"}},height:48,children:(0,i.jsx)(Nl,{autoFocus:!0,css:{borderBottom:"1px solid $gray200","& .h-styled-input-container":{border:"none"}},height:"fluid",icon:"magnifying-glass",placeholder:t("rechercher_un_m_45772"),value:h,onChange:p})}),(0,i.jsx)(Na,{css:{overflowY:"auto",py:"$4"},direction:"column",height:350,children:d?(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(oc,{borderRadius:"$1",height:36}),(0,i.jsx)(oc,{borderRadius:"$1",height:36}),(0,i.jsx)(oc,{borderRadius:"$1",height:36})]}):B?(0,i.jsxs)(Na,{align:"center",direction:"column",gap:"4",height:1,justify:"center",children:[(0,i.jsx)(Na,{align:"center",css:{bd:!0,fontSize:"$textMd"},height:48,justify:"center",width:48,children:(0,i.jsx)(el,{icon:"magnifying-glass"})}),(0,i.jsx)(yr,{font:"gray900 textSm semiBold",children:t("aucun_r_sultat_73664",g)})]}):(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[no(M)&&(0,i.jsx)(YE,{title:t("actions_rapides_42479"),children:M.map((e,t)=>(0,i.jsx)(HE,{icon:e.icon,link:e.link,onClose:W,children:e.text},t))}),no(f)&&(0,i.jsx)(YE,{title:t("membres_11310"),children:f.map(e=>(0,i.jsx)(HE,{avatar:(0,i.jsx)(Jg,{email:e.email,image:e.picture?.url,name:e.name,size:24}),link:qI.MEMBER_INFORMATION({organizationId:n,eventId:s,userInfoId:e.id}),onClose:W,children:e.name},e.id))}),no(_)&&(0,i.jsx)(YE,{title:t("Event"),children:_.map(e=>(0,i.jsx)(HE,{icon:"cake-candles",link:Ui.EVENT({organizationId:n,eventId:e.id}),onClose:W,children:e.name},e.id))}),no(v)&&(0,i.jsx)(YE,{title:t("champs_de_formu_64126"),children:v.map(e=>(0,i.jsx)(HE,{icon:"text",link:$s.EDIT_CUSTOM_FIELD(n,j,e.id),onClose:W,children:e.name},e.id))}),no(y)&&(0,i.jsx)(YE,{title:t("missions_63972"),children:y.map(e=>(0,i.jsx)(HE,{icon:"sitemap",link:ps.POSITION({organizationId:n,eventId:s,positionId:e.id}),onClose:W,children:e.name},e.id))}),no(A)&&(0,i.jsx)(YE,{title:t("Form_plural"),children:A.map(e=>(0,i.jsx)(HE,{icon:"file-lines",link:Ni.FORM_ELEMENTS({organizationId:n,eventId:s,formId:e.id}),onClose:W,children:e.name},e.id))}),no(S)&&(0,i.jsx)(YE,{title:t("accr_ditations_39450"),children:S.map(e=>(0,i.jsx)(HE,{icon:"badge-check",link:es.ACCREDITATION({organizationId:n,eventId:s,accreditationId:e.id}),onClose:W,children:e.name},e.id))}),no(T)&&(0,i.jsx)(YE,{title:t("d_l_gations_78318"),children:T.map(e=>(0,i.jsx)(HE,{icon:"users",link:ds.DELEGATION({organizationId:n,eventId:s,delegationId:e.id}),onClose:W,children:e.name},e.id))}),no(O)&&(0,i.jsx)(YE,{title:t("Campaigns"),children:O.map(e=>(0,i.jsx)(HE,{icon:"paper-plane",link:SI.CAMPAIGN_DASHBOARD({organizationId:n,eventId:s,campaignId:e.id}),onClose:W,children:e.name},e.id))}),no($)&&(0,i.jsx)(YE,{title:t("automatisations_60045"),children:$.map(e=>(0,i.jsx)(HE,{icon:"hand-sparkles",link:ZI.UPDATE({organizationId:n,eventId:s,workflowId:e.id}),onClose:W,children:e.name},e.id))}),no(P)&&(0,i.jsx)(YE,{title:t("vues_personnali_80652"),children:P.map(e=>(0,i.jsx)(HE,{link:GE(e),onClose:W,children:e.name},e.id))})]})})]})}),document.body):null},XE=(0,L.memo)(function(){const{translate:e}=_l(),{pathname:t}=ei(),{organization:n,selectedEventId:s}=yI(),[o,r]=(0,L.useState)(!1),a=t===Ui.EVENTS({organizationId:n.id})||null!==t.match(/\/events/)||null!==t.match(/\/event\/\d+/),l=(0,lc.A)(n.events.nodes.filter(e=>e.state===Pe.Ongoing||e.state===Pe.Upcoming),e=>e.name),d=n.events.nodes.find(e=>e.id===s);return(0,i.jsxs)(Bd,{onStateChange:r,children:[(0,i.jsx)(Yd,{children:(0,i.jsxs)(Na,{align:"center","aria-expanded":o,"aria-label":e("ouvrir_la_liste_52670"),"aria-selected":o,css:{blockSize:"100%",color:"white",opacity:a?"1":"0.6",px:"$4","&:hover":{opacity:"1"}},gap:"2",role:"button",onClick:e=>{e.nativeEvent.stopImmediatePropagation(),document.getElementById("events-menu")?.focus()},children:[d?d.name:e("_v_nements_53672"),o?(0,i.jsx)(el,{icon:"angle-up"}):(0,i.jsx)(el,{icon:"angle-down"})]})}),(0,i.jsxs)(qd,{"aria-orientation":"vertical",id:"events-menu",maxHeight:300,offset:-10,placement:"bottom-start",children:[(0,i.jsx)(Na,{css:{flex:"1",overflowY:"auto"},direction:"column",children:l.map(e=>(0,i.jsx)(Wd,{to:Ui.EVENT({organizationId:n.id,eventId:e.id}),onClick:e=>{Nd(e.target),document.getElementById("main")?.focus()},children:e.name},e.id))}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Wd,{to:Ui.EVENTS({organizationId:n.id}),onClick:e=>{Nd(e.target),document.getElementById("main")?.focus()},children:e("tous_les_v_nem_16033")})]})]})});var JE,QE;function eT(){return eT=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{translate:t,params:{eventId:n}}=_l(),{organization:s}=yI(),o=(0,L.useMemo)(()=>{let t=`https://admin.${P.WEEZEVENT_DOMAIN}/ticket/O${e.weezeventOrganizationId}`;if(n){const e=s.events.nodes.find(e=>e.id===n);"number"==typeof e?.weezeventEventId&&(t+=`/E${e.weezeventEventId}`)}return t},[n,s]),r=`https://admin.${P.WEEZEVENT_DOMAIN}/access/O${e.weezeventOrganizationId}`,a=`https://admin.${P.WEEZEVENT_DOMAIN}/pay/#!/${e.weezeventOrganizationId}`;return(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(Na,{align:"center",css:{borderRadius:"$2",padding:"$2","&:hover":{background:"$gray700"}},justify:"center",children:(0,i.jsx)(Na,{align:"center",css:{fontSize:"$textMd"},children:(0,i.jsx)(el,{icon:"grid",iconStyle:"solid"})})})}),(0,i.jsx)(qd,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Na,{css:{padding:"$3 $4"},direction:"column",gap:"3",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("passer_75488")}),(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(Ja,{to:o,children:(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(yr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(dT,{})}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:"WeezTicket"}),(0,i.jsx)(yr,{color:"gray500",fontWeight:"medium",children:t("billetterie_53780")})]})]})}),(0,i.jsx)(Ja,{to:r,children:(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(yr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(tT,{})}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:"WeezAccess"}),(0,i.jsx)(yr,{color:"gray500",fontWeight:"medium",children:t("contr_le_d_acc_03854")})]})]})}),(0,i.jsx)(Ja,{to:a,children:(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(yr,{css:{"& svg":{height:"100%"}},height:30,width:30,children:(0,i.jsx)(oT,{})}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:"WeezPay"}),(0,i.jsx)(yr,{color:"gray500",fontWeight:"medium",children:"Cashless"})]})]})})]})]})})]})},uT=({to:e,children:t,isActive:n,onClick:s})=>{const{pathname:o}=ei(),r=n?n(o):e===o;return(0,i.jsx)(Na,{"aria-selected":r,css:{alignItems:"center",blockSize:"100%",color:"white",cursor:"pointer",opacity:r?"1":"0.6",px:"$4","&:hover":{opacity:"1"}},height:1,role:"menuitem",children:(0,i.jsx)(Ja,{height:1,to:e,width:1,onClick:s,children:t})})},hT=L.memo(function(){const{translate:e,params:{organizationId:t}}=_l(),{organization:n,roles:s,user:o,updateLocalOrganization:r}=yI(),{data:a}=da({}),[l,d]=L.useState(!1),c=L.useMemo(()=>{const e=(0,ac.A)(a.user?.roles??[],e=>e.organizationId);return(0,lc.A)((a.organizations||[]).filter(t=>no(e[t.id])),e=>e.name)},[a.organizations,a.user]),u=(0,L.useMemo)(()=>no(s.organizationRoles),[s]);return(0,i.jsxs)(Na,{align:"center",css:{background:fr.colors.blueGray900.value,color:"white",cursor:"pointer",position:"relative",px:"$6"},height:1,justify:"between",width:1,children:[(0,i.jsx)(Na,{align:"center","aria-label":e("page_d_accueil_12532"),css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(Ja,{height:1,to:Ui.EVENTS({organizationId:t}),children:(0,i.jsx)(td,{})})}),(0,i.jsx)(Na,{"aria-label":e("menu_de_l_organ_58508"),as:Pa.Nav,height:1,children:(0,i.jsxs)(Na,{align:"center",justify:"center",role:"menubar",children:[(0,i.jsx)(XE,{}),(0,i.jsx)(Bb,{permissions:Nb.CUSTOM_FIELD_READ,children:(0,i.jsx)(uT,{isActive:e=>e.startsWith($s.CUSTOM_FIELDS(t)),to:$s.CUSTOM_FIELDS(t),onClick:async()=>await r({customFieldsSegmentId:null}),children:e("champs_de_formu_64126")})}),u&&(0,i.jsx)(uT,{isActive:e=>e.startsWith(yi.COMMUNITY({organizationId:t})),to:yi.COMMUNITY_USERS({organizationId:t}),children:e("communaut_20896")}),(0,i.jsx)(uT,{isActive:e=>e.startsWith($s.ORGANIZATION_PARAMETERS(t)),to:$s.ORGANIZATION_PARAMETERS_PROFILE(t),children:e("param_tres_78420")})]})}),(0,i.jsxs)(Na,{align:"center",gap:"6",justify:"end",width:300,children:["number"==typeof n.weezeventOrganizationId&&(0,i.jsx)(cT,{weezeventOrganizationId:n.weezeventOrganizationId}),(0,i.jsxs)(Bd,{"aria-label":e("menu_utilisateu_40033"),"aria-orientation":"vertical",isOpen:l,onStateChange:d,children:[(0,i.jsx)(Yd,{children:(0,i.jsxs)(Na,{align:"center","aria-expanded":l,"aria-label":e("ouvrir_le_menu_47803"),css:{color:"white",cursor:"default"},gap:"3",role:"button",onClick:()=>document.getElementById("user-menu")?.focus(),children:[(0,i.jsx)(Jg,{email:o.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:32}),(0,i.jsxs)(yr,{css:{maxWidth:"calc(100% - 66px)"},children:[(0,i.jsx)(yr,{css:{ellipsis:!0},fontWeight:"semiBold",children:o.userInfo.firstName||o.email}),(0,i.jsx)(yr,{css:{ellipsis:!0},fontSize:"textXs",children:n.name})]}),(0,i.jsx)("div",{children:l?(0,i.jsx)("i",{className:"far fa-angle-up"}):(0,i.jsx)("i",{className:"far fa-angle-down"})})]})}),(0,i.jsxs)(qd,{"aria-orientation":"vertical",id:"user-menu",maxHeight:500,placement:"bottom-end",width:300,children:[(0,i.jsx)(Wd,{children:(0,i.jsxs)(Na,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(Jg,{email:o.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:32}),(0,i.jsxs)(yr,{css:{width:"calc(100% - 44px)"},children:[(0,i.jsx)(yr,{css:{ellipsis:!0},fontWeight:"semiBold",children:o.userInfo.name||o.email}),m(o.userInfo.name)&&(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0},children:o.email})]})]})}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(Na,{as:Pa.Nav,direction:"column",role:"menubar",children:[c.map(({id:e,name:t})=>(0,i.jsx)(Wd,{onClick:async()=>{await r({eventsSegmentId:null}),location.href=`${P.HEAVENT_APP_URL.pathname}${Ui.EVENTS({organizationId:e})}`,document.getElementById("main")?.focus()},children:t},e)),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsxs)(Bb,{rolesTypes:xI,children:[(0,i.jsx)(Wd,{to:$s.ORGANIZATION_PARAMETERS_PROFILE(t),onClick:()=>{d(!1),document.getElementById("main")?.focus()},children:e("mon_profil_48224")}),(0,i.jsx)(Wd,{to:$s.ORGANIZATION_PARAMETERS_INFOS(t),onClick:()=>{d(!1),document.getElementById("main")?.focus()},children:e("organisation_71863")}),(0,i.jsx)(Wd,{to:$s.ORGANIZATION_PARAMETERS_TEAM(t),onClick:()=>{d(!1),document.getElementById("main")?.focus()},children:e("utilisateurs_04975")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"})]}),Wc(o.email)&&(0,i.jsx)(Wd,{to:$s.BACKOFFICE,onClick:()=>{document.getElementById("main")?.focus()},children:e("back_office_83072")}),(0,i.jsx)(Wd,{color:"red",onClick:X,children:e("se_d_connecter_74151")})]})]})]})]})]})}),mT=[1033,1538,1787,2574,2954,3059],gT=e=>{const t=Yn(),{organizationId:n}=Jn(),s=ei(),{organization:o}=yI(),[r,a]=L.useState(!1),l=function(e){return Math.ceil(e.periodEndAt.diff(Us.c9.utc(),"days").days)}(o),d=(c=l)>0&&c<=15;var c;const u=o.invoices.length>0,h=L.useCallback(()=>{a(!0)},[a]);if(L.useEffect(()=>(document.addEventListener(uo,h),()=>{document.removeEventListener(uo,h)}),[]),o.isBlocked&&!s.pathname.endsWith(_i))return(0,i.jsx)(ni,{path:bi.IS_BLOCKED(bi.ORGANIZATION({organizationId:n}))});if(!o.isBlocked&&s.pathname.endsWith(_i))return(0,i.jsx)(ni,{path:bi.ORGANIZATION({organizationId:n})});if(l<=0&&!s.pathname.endsWith(Ii))return(0,i.jsx)(ni,{path:bi.IS_EXPIRED(bi.ORGANIZATION({organizationId:n}))});if(l>0&&s.pathname.endsWith(Ii))return(0,i.jsx)(ni,{path:bi.ORGANIZATION({organizationId:n})});{const s=u&&!mT.includes(n),c=64+(r?40:0)+(d||s?64:0);return(0,i.jsxs)(Na,{css:{overflow:"hidden"},direction:"column",height:1,role:"presentation",width:1,children:[r&&(0,i.jsxs)(Na,{align:"center",css:{background:"$primary700",px:"$6"},gap:"1",height:40,justify:"between",role:"alert",width:1,children:[(0,i.jsx)(yr,{}),(0,i.jsxs)(Na,{gap:"1",children:[(0,i.jsx)(yr,{color:"white",children:t("une_nouvelle_ve_69718")}),(0,i.jsx)(yr,{color:"white",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{window.location.reload()},children:t("cliquez_pour_re_36838")})]}),(0,i.jsx)(yr,{color:"white",css:{cursor:"pointer"},fontSize:"textMd",onClick:()=>{a(!1)},children:(0,i.jsx)(el,{icon:"xmark"})})]}),d&&!s&&(0,i.jsx)(Na,{align:"center",css:{background:"$primary700",color:"white"},dangerouslySetInnerHTML:{__html:`

${t("trial_remaining_days",l,`${P.EMAIL_FROM}`,vd)}

`},height:64,justify:"center",width:1}),s&&(0,i.jsx)(Na,{align:"center",css:{background:"$primary700",color:"white","& > a":{color:"white",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:t("sauf_erreur_de_03325",o.invoices[0].url,o.invoices[0].invoiceNumber)},height:64,justify:"center",width:1}),(0,i.jsx)(yr,{as:Pa.Header,height:64,width:1,children:(0,i.jsx)(hT,{})}),(0,i.jsx)(yr,{as:Pa.Main,css:{height:`calc(100% - ${c}px)`},id:"main",tabIndex:-1,width:1,children:e.children}),(0,i.jsx)(ZE,{level:"organization"})]})}};let pT=class extends Ul{countriesService;documentInputService;fieldInputService;phoneInputService;constructor(e,t,n,i,s){super(e),this.countriesService=t,this.documentInputService=n,this.fieldInputService=i,this.phoneInputService=s}userInfoUpdateInputDefault(e,t,n={}){const i=this.countriesService.getDefaultCountryValues(n.countryCode);return{id:e?.id??null,fields:this.fieldInputService.fieldsUpdateInputDefault(e?.fields||{},t,i,n.checkboxDefaultEmpty)}}formUserInfoInputSchema(e){return d.Ik().shape({fields:d.Ik().shape(Object.fromEntries(e.map(({isMandatory:e,customField:t})=>[t.slug,this.fieldInputService.fieldSchema(t,e)])))})}userInfoInputSchema(e,t){const n={};return e.forEach(e=>{const t=e.field,i=this.fieldInputService.fieldSchema(e.field,e.isMandatory);n[t.slug]=i}),t&&t.forEach(e=>{n[e.slug]=this.fieldInputService.fieldSchema(e,!1)}),d.Ik().shape({fields:d.Ik().shape({...n})})}userInfoProfileInputDefault(e){const t=this.countriesService.getDefaultCountryValues();return{email:e.email,fields:{firstName:e.userInfo?.fields?.firstName??"",lastName:e.userInfo?.fields?.lastName??"",language:e.userInfo?.fields?.language??e.language??t.user.language??yt.En,picture:e.userInfo.fields.picture?(0,wr.A)(e.userInfo.fields.picture,Fj):this.documentInputService.documentInputDefault(),phone:e.userInfo.fields.phone?(0,wr.A)(e.userInfo.fields.phone,Z_):this.phoneInputService.phoneInputDefault(t)}}}userInfoFields(){return{fields:d.Ik().shape({firstName:d.Yj().nullable(),lastName:d.Yj().nullable(),picture:this.documentInputService.documentInputSchemaNotRequired(),language:d.Yj().required(this.t("les_langues_doi_27712")).oneOf(xd,this.t("les_langues_doi_27712")),phone:this.phoneInputService.phoneInputSchemaNotRequired()})}}userInfoProfileInputSchema(){return d.Ik().shape({email:d.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),...this.userInfoFields()})}updateUserInfoSchema(e){return d.Ik().shape({userInfo:this.formUserInfoInputSchema(e)})}updateProfileSchema(){return d.Ik().shape({userInfo:this.userInfoProfileInputSchema()})}userInfoAndTermsInputDefault(e){return{...(0,dr.A)(e.userInfo,["id"]),termsAccepted:!1}}userInfoAndTermsInputSchema(){return d.Ik().shape({firstName:d.Yj().nullable(),lastName:d.Yj().nullable(),phone:this.phoneInputService.phoneInputSchemaNotRequired(),termsAccepted:d.zM().oneOf([!0],this.t("il_est_n_cessai_83896")).required(this.t("il_est_n_cessai_83896"))})}updateUserInfoAndTermsSchema(){return d.Ik().shape({userInfoAndTerms:this.userInfoAndTermsInputSchema()})}};pT=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn,du,Mj,cC,X_])],pT);let fT=class extends Ul{constructor(e){super(e)}volunteersRegistrationsSlotInputDefault(e){return{startDate:e||Us.c9.invalid("Invalid"),startTime:"",endDate:e||Us.c9.invalid("Invalid"),endTime:""}}volunteersRegistrationsSlotInputSchema(e,t){const n=t.plus({day:1}).endOf("day");return d.Ik().shape({startDate:qm.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")).test("after-event-start-date",this.t("la_date_de_d_bu_68630",e.toLocaleString()),t=>t>=e),startTime:d.Yj().required(this.t("heure_de_d_but_90785")),endDate:qm.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")).test("after-start-date",this.t("la_date_de_fin_00429"),(e,t)=>Us.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid&&Us.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid&&t.parent.endDate>=t.parent.startDate).test("before-event-end-date",this.t("la_date_de_fin_49125",t.toLocaleString()),e=>e<=n),endTime:d.Yj().required(this.t("l_heure_de_fin_78626"))})}};fT=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],fT);let xT=class extends Ul{translationService;userInfoInputService;volunteerRegistrationSlotInputService;constructor(e,t,n){super(e),this.translationService=e,this.userInfoInputService=t,this.volunteerRegistrationSlotInputService=n}slotsFields(e,t,n){switch(e){case xt.Display:case xt.DisplayDays:case xt.Calendar:case xt.Custom:return{slots:d.YO().of(this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputSchema(t,n)).min(1,this.t("vous_devez_ajou_68961"))};case xt.Hide:return{};default:return rl()}}volunteersRegistrationsSlotsUpdateInputDefault(e){return no(e)?e.map(e=>({startDate:e.startDate,startTime:e.startTime,endDate:e.endDate,endTime:e.endTime})):[]}userInfoSlotsSchema(e,t,n){return d.Ik().shape({userInfo:d.Ik().shape({slots:d.YO().of(d.Ik().shape({formId:d.ai().required(),...this.slotsFields(e,t,n)}))})})}volunteersRegistrationsWishedPositionsInputDefault(){return{positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[]}}volunteersRegistrationsWishedPositionsUpdateInputDefault(e){return e?{positionsCategoriesIds:e?.positionsCategoriesIds,positionsIds:e?.positionsIds,positionsSlotsIds:e?.positionsSlotsIds}:this.volunteersRegistrationsWishedPositionsInputDefault()}wishedPositionsFields(e,t){if(e===He.Ranked){if(t===pt.Category)return{positionsCategoriesIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_32044")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,Ya.A)((e||[]).filter(e=>-1!==e));return no(t)&&(0,Ns.A)(t).length===t.length})};if(t===pt.Position)return{positionsIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_89603")).test("different",this.t("les_missions_so_04441"),e=>{const t=(0,Ya.A)((e||[]).filter(e=>-1!==e));return no(t)&&(0,Ns.A)(t).length===t.length})};throw new Error("Should not happen")}switch(t){case pt.Category:return{positionsCategoriesIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_32044"))};case pt.Position:return{positionsIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_26253"))).min(1,this.t("vous_devez_s_le_89603"))};case pt.Slot:return{positionsSlotsIds:d.YO().of(d.ai()).min(1,this.t("vous_devez_s_le_89603"))};case pt.None:return{};default:return rl()}}volunteerRegistrationWishedPositionsSchema(e,t){return d.Ik().shape({volunteerRegistration:d.Ik().shape({...this.wishedPositionsFields(e,t)})})}userInfoWishedPositionsSchema(e,t){return d.Ik().shape({userInfo:d.Ik().shape({missions:d.YO().of(d.Ik().shape({formId:d.ai().required(),...this.wishedPositionsFields(e,t)}))})})}volunteersRegistrationsWishedAccreditationsInputDefault(){return{accreditationsSlotsIds:[]}}volunteersRegistrationsWishedAccreditationsUpdateInputDefault(e){return e?{accreditationsSlotsIds:e.accreditationsSlotsIds}:this.volunteersRegistrationsWishedAccreditationsInputDefault()}accreditationsFields(e,t){if(t)return{};switch(e){case mt.Accreditation:return{accreditationsSlotsIds:d.YO().of(d.ai().typeError(this.t("s_lectionner_un_96571"))).min(1,this.t("vous_devez_s_le_72138"))};case mt.None:return{};default:return rl()}}volunteerRegistrationAccreditationsSchema(e){return d.Ik().shape({volunteerRegistration:d.Ik().shape({...this.accreditationsFields(e,null)})})}userInfoAccreditationsSchema(e){return d.Ik().shape({userInfo:d.Ik().shape({accreditations:d.YO().of(d.Ik().shape({formId:d.ai().required(),...this.accreditationsFields(e,null)}))})})}updateVolunteerRegistrationSchema(e,t,n,i,s,o,r){let a={userInfo:this.userInfoInputService.userInfoInputSchema(e,t)};return a={...a,...this.slotsFields(n,o,r),...this.wishedPositionsFields(i,s)},d.Ik().shape({email:d.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),volunteerRegistration:d.Ik().shape({...a})})}adminCreateSchema(){return d.Ik().shape({email:d.Yj().email(this.t("l_e_mail_n_est_57882")).required(this.t("l_e_mail_n_est_57882")),sendVolunteerRegistrationEmail:d.zM().required(),firstName:d.Yj(),lastName:d.Yj()})}adminAddSchema(){return d.Ik().shape({usersInfosIds:d.YO().of(d.ai()).min(1,this.t("vous_devez_s_le_83608")),sendVolunteerRegistrationEmail:d.zM().required()})}};xT=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn,pT,fT])],xT);let _T=class extends Ul{fieldInputService;userInfoInputService;volunteerRegistrationInputService;volunteerRegistrationSlotInputService;constructor(e,t,n,i,s){super(e),this.fieldInputService=t,this.userInfoInputService=n,this.volunteerRegistrationInputService=i,this.volunteerRegistrationSlotInputService=s}formRegisterInputDefault(e,t,n,i){return{autoAccredit:!1,forOther:i.forOther,positionsSlotsIds:i.team?.positionsSlotsIds??[],positionsIds:i.team?.positionsIds??[],positionsCategoriesIds:i.team?.positionsCategoriesIds??[],accreditationsSlotsIds:(i.delegationAccreditations??[]).filter(e=>e.isDefault).map(e=>e.accreditationSlotId),userInfo:this.userInfoInputService.userInfoUpdateInputDefault(t,n,{countryCode:i.countryCode}),sendNotificationEmail:i.sendNotificationEmail,slots:i.slotDisplay===xt.Display?[this.volunteerRegistrationSlotInputService.volunteersRegistrationsSlotInputDefault(i.eventStartDate)]:i.team?.slots??[],source:e}}formRegisterInformationsSchema(e){return d.Ik().shape({formRegister:d.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e)})})}formRegisterSlotsSchema(e,t,n){return d.Ik().shape({formRegister:d.Ik().shape({...this.volunteerRegistrationInputService.slotsFields(e,t,n)})})}formRegisterPositionsSchema(e,t){return d.Ik().shape({formRegister:d.Ik().shape({...this.volunteerRegistrationInputService.wishedPositionsFields(e,t)})})}formRegisterAccreditationsSchema(e,t,n,i){const s=function(e){return Object.values(e.reduce((e,t)=>{if(e[t.customField.slug]){const n=e[t.customField.slug];return{...e,[t.customField.slug]:{accreditationsSlotsIds:n.accreditationsSlotsIds.concat(t.accreditationsSlotsIds),customField:t.customField,isMandatory:n.isMandatory||t.isMandatory}}}return{...e,[t.customField.slug]:{accreditationsSlotsIds:t.accreditationsSlotsIds,customField:t.customField,isMandatory:t.isMandatory}}},{}))}(n);return d.Ik().shape({formRegister:d.Ik().shape({...this.volunteerRegistrationInputService.accreditationsFields(e,i),userInfo:d.Ik().shape({fields:d.Ik().shape(Object.fromEntries(s.map(e=>{const n=e.isMandatory&&no((0,mh.A)(e.accreditationsSlotsIds,t));return[e.customField.slug,this.fieldInputService.fieldSchema(e.customField,n)]})))})})})}formRegisterSchema(e,t,n,i,s,o,r,a){return d.Ik().shape({email:d.Yj().required(this.t("l_e_mail_est_re_04856")).email(this.t("l_e_mail_est_re_04856")),formRegister:d.Ik().shape({userInfo:this.userInfoInputService.formUserInfoInputSchema(e),...this.volunteerRegistrationInputService.slotsFields(t,n,i),...this.volunteerRegistrationInputService.wishedPositionsFields(s,o),...this.volunteerRegistrationInputService.accreditationsFields(r,a)})})}};_T=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn,cC,pT,xT,fT])],_T);const IT=e=>{const t=qn(du);return(0,i.jsx)(Fr.Yr,{name:e.name,children:n=>{e.change(`${e.prefix}street`,n.name);const i=n.geometry?.location?.lat(),s=n.geometry?.location?.lng(),o=n.address_components?.find(({types:e})=>e.includes("locality")),r=n.address_components?.find(({types:e})=>e.includes("postal_code")),a=n.address_components?.find(({types:e})=>e.includes("country"))?.short_name;"number"==typeof i&&"number"==typeof s&&e.changeLatLng&&(e.change(`${e.prefix}latitude`,i),e.change(`${e.prefix}longitude`,s)),o&&e.changeCity&&e.change(`${e.prefix}city`,o.long_name),r&&e.changePostalCode&&e.change(`${e.prefix}postalCode`,r.long_name),t.countryCodeExists(a)&&e.changeCountry&&e.change(`${e.prefix}country`,a)}})},vT=e=>{const t=L.useMemo(()=>e.elements.flatMap(e=>e.elementType===Ge.Field?[e.customField]:e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.elements]);return(0,i.jsx)(yr,{children:e.elements.map((n,s)=>{switch(n.elementType){case Ge.Field:{const o=n.customField,r=lC(o,e.values,t);return(0,i.jsxs)(L.Fragment,{children:[o.fieldProperty===Le.Street&&(0,i.jsx)(IT,{change:e.change,changeCity:!0,changeCountry:!0,changeLatLng:!0,changePostalCode:!0,name:"place",prefix:e.prefix}),r&&0!==s&&(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(xC,{change:e.change,countryCode:e.countryCode,display:r,field:o,isMandatory:!0===n.isMandatory,organizationId:e.organizationId,prefix:e.prefix},s)]},s)}case Ge.Section:return lC(n,e.values,t)?(0,i.jsx)(L.Fragment,{children:"function"==typeof e.renderSection?e.renderSection(n.section,s):(0,i.jsxs)(i.Fragment,{children:[e.featureFlags?.isV4?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(qa,{height:"5"})]}):0!==s&&(0,i.jsx)(qa,{height:"8"}),(0,i.jsx)(yr,{font:"gray800 textMd semiBold",children:"function"==typeof e.renderText?e.renderText(n.section):n.section})]})},s):null;case Ge.Text:return lC(n,e.values,t)?(0,i.jsx)(L.Fragment,{children:(0,i.jsxs)(i.Fragment,{children:[0!==s&&(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(xg,{text:"function"==typeof e.renderText?e.renderText(n.text):n.text})]})},s):null;default:return rl(n.elementType)}})})},bT=e=>{const t=Yn();return(0,i.jsxs)(su,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(El,{onClick:e.onClose,children:t("fermer_62479")})}),size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",width:1,children:(0,i.jsx)(Xj,{color:"primary",icon:"circle-info"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",textAlign:"center",width:1,children:t("informations_su_86120",e.name)}),(0,i.jsx)(qa,{height:"7"}),m(e.description)&&(0,i.jsxs)(Na,{css:{overflowY:"auto"},direction:"column",gap:"2",children:[(0,i.jsx)(yr,{font:"gray900 textMd semiBold",children:t("description_58935")}),(0,i.jsx)(xg,{text:e.description})]}),(0,i.jsx)(qa,{height:"4"})]})},jT=e=>{const{translate:t}=_l(),n=qn(Kc);return(0,i.jsx)(i.Fragment,{children:no(e.slots)?e.slots.map(t=>(0,i.jsx)(gc,{state:e.accreditationsSlotsIds.includes(t.id)?"checked":"unchecked",onClick:n=>{e.change(`${e.prefix}accreditationsSlotsIds`,so(e.accreditationsSlotsIds,t.id,"checked"===n))},children:(0,i.jsx)(yr,{css:{textTransform:"capitalize"},children:Oh(n,t,e.accreditation.name,{date:{localeFormat:Js.DateOnly.WeekdayLongMonthLong}})})},t.id)):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},CT=e=>{const{translate:t}=_l(),n=qn(Kc),s=(0,L.useMemo)(()=>e.slots.map(e=>e.id),[e.slots]);return(0,i.jsx)(i.Fragment,{children:no(e.slots)?e.slots.map(t=>(0,i.jsx)(xc,{state:e.accreditationsSlotsIds.includes(t.id)?"checked":"unchecked",onClick:n=>{const i=[...e.accreditationsSlotsIds.filter(e=>!s.includes(e)),..."checked"===n?[t.id]:[]];e.change(`${e.prefix}accreditationsSlotsIds`,i)},children:(0,i.jsx)(yr,{css:{textTransform:"capitalize"},children:Oh(n,t,e.accreditation.name,{date:{localeFormat:Js.DateOnly.WeekdayLongMonthLong}})})},t.id)):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},yT=e=>{const{params:{organizationId:t},translate:n}=_l(),[s,o]=(0,L.useState)(!1),r=(0,L.useMemo)(()=>(0,lc.A)(e.accreditation.slots.filter(t=>Rh(t,e.slots,e.options,e.delegationAccreditations)),e=>(0,Ya.A)([e.date?.toMillis(),e.name.toLowerCase()])),[e.accreditation.slots,e.delegationAccreditations,e.slots,e.options]),a=(0,L.useMemo)(()=>m(e.accreditation.description)&&e.options.showAccreditationDescription,[e.accreditation,e.options]),l=(0,L.useMemo)(()=>{const t=e.accreditation.hasSlots?r.map(e=>e.id):[e.accreditation.hiddenSlotId];return e.displayFormCustomFields&&no(e.accreditation.formCustomFields)&&no((0,mh.A)(t,e.accreditationsSlotsIds))},[e.accreditation,e.accreditationsSlotsIds,e.displayFormCustomFields,r]),d=e.accreditationsSlotsIds.includes(e.accreditation.hiddenSlotId)?"checked":"unchecked";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(MC,{accreditation:e.accreditation,displayFormCustomFields:l,displayNumberOfSlots:!1,displaySlots:e.accreditation.hasSlots,numberOfSlots:0,renderActions:()=>a&&(0,i.jsx)(El,{color:"white",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),o(!0)},children:n("voir_la_descrip_62304")}),renderCheckbox:()=>!e.accreditation.hasSlots&&(0,i.jsx)(mc,{shouldPreventDefault:!1,state:d,onClick:Ql.A}),onClick:()=>{e.accreditation.hasSlots||e.change(`${e.prefix}accreditationsSlotsIds`,so(e.accreditationsSlotsIds,e.accreditation.hiddenSlotId,"unchecked"===d))},children:(0,i.jsxs)(Na,{css:{background:"white",padding:"$4"},direction:"column",gap:"3",children:[e.accreditation.hasSlots?e.accreditation.accreditationDisplay===ie.Calendar?(0,i.jsx)(yA,{accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r}):(0,i.jsx)(Na,{css:{background:"white",bd:!0,padding:"$4"},direction:"column",gap:"3",width:1,children:e.accreditation.accreditationDisplay===ie.Radio?(0,i.jsx)(CT,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r}):(0,i.jsx)(jT,{accreditation:e.accreditation,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,prefix:e.prefix,slots:r})}):null,l&&(0,i.jsx)(Na,{css:{background:"white",bd:!0,padding:"$4"},direction:"column",gap:"3",width:1,children:e.accreditation.formCustomFields.map(({customField:n,isMandatory:s})=>(0,i.jsx)(xC,{change:e.change,display:!0,field:n,isMandatory:s,organizationId:t,prefix:`${e.prefix}userInfo.fields.`},n.id))})]})}),s&&(0,i.jsx)(bT,{description:e.accreditation.description,name:e.accreditation.name,onClose:()=>{o(!1)}})]})},kT=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>SC(e.category.accreditations.filter(t=>yC(t,e.slots,e.userInfoFields,e.options,e.delegationAccreditations))),[e.category,e.delegationAccreditations,e.slots,e.userInfoFields,e.options]);return(0,i.jsx)(DC,{category:e.category,children:no(n)?n.map(t=>(0,i.jsx)(yT,{accreditation:t,accreditationsSlotsIds:e.accreditationsSlotsIds,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.slots},t.id)):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},AT=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(0,lc.A)(e.categories,e=>e.name.toLowerCase()),[e.categories]);return(0,i.jsx)($C,{css:{background:"transparent",padding:"0"},children:no(n)?(0,i.jsxs)(i.Fragment,{children:[n.map(t=>(0,i.jsx)(kT,{accreditationsSlotsIds:e.accreditationsSlotsIds,category:t,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t.id)),e.showAutoAccredit&&(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray900 textSm medium",children:t("attribution_des_59896")}),(0,i.jsx)(Hm,{name:`${e.prefix}autoAccredit`,children:t("attribuer_les_a_75431")})]})]}):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},wT=e=>{const t=(0,L.useMemo)(()=>e.event.accreditationsCategories.filter(t=>{return n=t,i=e.slots,s=e.userInfosFields,o=e.options,r=e.delegationAccreditations,o.accreditationDisplay!==mt.None&&!o.hiddenAccreditationsCategoriesIds.includes(n.id)&&(0===o.displayedAccreditationsCategoriesIds.length||o.displayedAccreditationsCategoriesIds.includes(n.id))&&n.accreditations.some(e=>yC(e,i,s,o,r))||r.some(e=>e.accreditationCategoryId===n.id&&n.accreditations.some(e=>yC(e,i,s,o,r)));var n,i,s,o,r}),[e.event.accreditationsCategories,e.slots,e.userInfosFields,e.options]);return no(e.delegationAccreditations)||e.options.accreditationDisplay===mt.Accreditation?(0,i.jsx)(AT,{accreditationsSlotsIds:e.accreditationsSlotsIds,categories:t,change:e.change,delegationAccreditations:e.delegationAccreditations,displayFormCustomFields:e.displayFormCustomFields,options:e.options,prefix:e.prefix,showAutoAccredit:e.showAutoAccredit,slots:e.slots,userInfoFields:e.userInfosFields}):null},ST=e=>{const[t,n]=(0,L.useState)(!1),s=m(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(gc,{css:{alignItems:"center"},state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:t=>{e.change(`${e.prefix}positionsCategoriesIds`,so(e.positionsCategoriesIds,e.category.id,"checked"===t))},children:(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{children:e.category.name}),s&&(0,i.jsx)(yr,{onClick:e=>{Rl(e),n(!0)},children:(0,i.jsx)(el,{icon:"circle-info"})})]})}),t&&(0,i.jsx)(bT,{description:e.category.description,name:e.category.name,onClose:()=>{n(!1)}})]})},ET=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(0,lc.A)(e.categories,e=>e.name),[e.categories]);return(0,i.jsx)(i.Fragment,{children:no(n)?n.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(ST,{category:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},TT=e=>{const[t,n]=(0,L.useState)(!1),s=m(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(gc,{css:{alignItems:"center"},state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:t=>{e.change(`${e.prefix}positionsIds`,so(e.positionsIds,e.position.id,"checked"===t))},children:(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{children:e.position.name}),s&&(0,i.jsx)(yr,{onClick:e=>{Rl(e),n(!0)},children:(0,i.jsx)(el,{icon:"circle-info"})})]})}),t&&(0,i.jsx)(bT,{description:e.position.description,name:e.position.name,onClose:()=>{n(!1)}})]})},zT=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(0,lc.A)(e.category.positions.filter(t=>wh(t,e.userInfoFields,e.slots,e.options)),e=>e.name),[e.category,e.userInfoFields,e.slots,e.options]),[s,o]=(0,L.useState)(!1),r=m(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{color:"gray900",fontWeight:"semiBold",children:e.category.name}),r&&(0,i.jsx)(yr,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(el,{icon:"circle-info"})})]}),(0,i.jsx)(qa,{height:"2"}),no(n)?n.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(TT,{change:e.change,options:e.options,position:t,positionsIds:e.positionsIds,prefix:e.prefix})]},t.id)):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),s&&(0,i.jsx)(bT,{description:e.category.description,name:e.category.name,onClose:()=>{o(!1)}})]})},OT=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(0,lc.A)(e.categories,e=>e.name),[e.categories]);return(0,i.jsx)(i.Fragment,{children:no(n)?n.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(zT,{category:t,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields})]},t.id)):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},RT=e=>{const t=Yn(),n=KA(),s=(0,L.useMemo)(()=>(0,lc.A)(e.categories,e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[no(s)?n?(0,i.jsxs)(bc,{isSearchVisible:!0,label:t("souhait_n_1_47211",e.index+1),values:[e.positionsCategoriesIds?.[e.index]??-1],onChange:t=>{no(t)&&e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,t[0])},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsxs)(zu,{label:t("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsCategoriesIds?.[e.index]??-1,onChange:t=>{e.change(`${e.prefix}positionsCategoriesIds[${e.index}]`,t)},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(qa,{height:"4"})]})},$T=e=>{const t=Yn(),n=KA(),s=(0,L.useMemo)(()=>e.categories.flatMap(t=>(0,lc.A)(t.positions.filter(t=>wh(t,e.userInfoFields,e.slots,e.options)),e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))),[e.categories]);return(0,i.jsxs)(i.Fragment,{children:[no(s)?n?(0,i.jsxs)(bc,{isSearchVisible:!0,label:t("souhait_n_1_47211",e.index+1),values:[e.positionsIds?.[e.index]??-1],onChange:t=>{no(t)&&e.change(`${e.prefix}positionsIds[${e.index}]`,t[0])},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsxs)(zu,{label:t("souhait_n_1_47211",e.index+1),shouldParseAsInt:!0,value:e.positionsIds?.[e.index]??-1,onChange:t=>{e.change(`${e.prefix}positionsIds[${e.index}]`,t)},children:[(0,i.jsx)("option",{value:-1,children:t("choisir_une_mis_90627")}),s]}):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),e.index!==e.options.positionLimit-1&&(0,i.jsx)(qa,{height:"4"})]})},DT=e=>{const{translate:t}=_l();return(0,i.jsx)(i.Fragment,{children:no(e.categories)?(0,Oc.A)(0,e.options.positionLimit).map(t=>e.options.positionDisplay===pt.Category?(0,i.jsx)(RT,{categories:e.categories,change:e.change,index:t,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix},t):(0,i.jsx)($T,{categories:e.categories,change:e.change,index:t,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t)):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})};function PT(e){const t=qn(hh),n=(0,L.useMemo)(()=>t.toDisplayString(e.range,{formats:{displayWeekday:!0}}),[e]),i=m(e.name);return{isRenamed:i,finalName:i?e.name:n,rangeString:n}}const FT=e=>{const{translate:t}=_l(),{rangeString:n,finalName:s,isRenamed:o}=PT(e.slot),r=(0,L.useMemo)(()=>{if(e.options.willAutoAssign){const t=e.allSlots.filter(t=>e.positionsSlotsIds.includes(t.id));return bh(e.slot,t)}return!1},[e.options.willAutoAssign,e.allSlots,e.positionsSlotsIds]);return(0,i.jsxs)(L.Fragment,{children:[0!==e.index&&(0,i.jsx)(qa,{height:"3"}),r?(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(gc,{disabled:!0,shouldPreventDefault:!1,state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:o?n:void 0,onClick:Ql.A,children:s})})}),(0,i.jsx)(Cm,{placement:"top-start",children:t("ce_cr_neau_en_c_55775")})]}):(0,i.jsx)(gc,{state:e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked",subtext:o?n:void 0,onClick:t=>{e.change(`${e.prefix}positionsSlotsIds`,so(e.positionsSlotsIds,e.slot.id,"checked"===t))},children:s})]},e.slot.id)},MT=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(0,lc.A)(e.position.slots.filter(t=>Ch(t,e.slots,e.options)),[e=>e.range.start.toMillis(),e=>e.nameOrRange]),[e.position,e.slots,e.options]),[s,o]=(0,L.useState)(!1),r=m(e.position.description)&&e.options.showPositionDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{color:"gray900",fontWeight:"semiBold",children:e.position.name}),r&&(0,i.jsx)(yr,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(el,{icon:"circle-info"})})]}),(0,i.jsx)(qa,{height:"2"}),no(n)?n.map((t,n)=>(0,i.jsx)(FT,{allSlots:e.allSlots,change:e.change,index:n,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slot:t},t.id)):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),s&&(0,i.jsx)(bT,{description:e.position.description,name:e.position.name,onClose:()=>{o(!1)}})]})},NT=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(0,lc.A)(e.category.positions.filter(t=>wh(t,e.userInfoFields,e.slots,e.options)),e=>e.name),[e.category,e.userInfoFields,e.slots,e.options]),[s,o]=(0,L.useState)(!1),r=m(e.category.description)&&e.options.showPositionCategoryDescription;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{color:"gray500",css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.category.name}),r&&(0,i.jsx)(yr,{color:"gray700",onClick:()=>{o(!0)},children:(0,i.jsx)(el,{icon:"circle-info"})})]}),no(n)?n.map(t=>(0,i.jsx)(MT,{allSlots:e.allSlots,change:e.change,options:e.options,position:t,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots},t.id)):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")}),s&&(0,i.jsx)(bT,{description:e.category.description,name:e.category.name,onClose:()=>{o(!1)}})]})},LT=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(0,lc.A)(e.categories,e=>e.name),[e.categories]),s=(0,L.useMemo)(()=>e.categories.flatMap(e=>e.positions.flatMap(e=>e.slots)),[e.categories]);return(0,i.jsx)(i.Fragment,{children:no(n)?n.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(NT,{allSlots:s,category:t,change:e.change,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields},t.id)]},t.id)):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,subtitle:t("this_may_be_bec_43194"),title:t("no_items_are_cu_47996")})})},BT=e=>{const t=(0,L.useMemo)(()=>(0,lc.A)(e.event.positionsCategories.filter(t=>{return n=t,i=e.slots,s=e.userInfoFields,!(o=e.options).hiddenPositionsCategoriesIds.includes(n.id)&&(0===o.displayedPositionsCategoriesIds.length||o.displayedPositionsCategoriesIds.includes(n.id))&&n.positions.some(e=>wh(e,s,i,o));var n,i,s,o}),e=>(0,gh.A)(e.positions.flatMap(e=>e.slots.flatMap(e=>e.range.start.toMillis())))),[e.event.positionsCategories,e.slots,e.userInfoFields,e.options]);if(e.options.positionRanking===He.Ranked)return(0,i.jsx)(DT,{categories:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});switch(e.options.positionDisplay){case pt.Category:return(0,i.jsx)(ET,{categories:t,change:e.change,options:e.options,positionsCategoriesIds:e.positionsCategoriesIds,prefix:e.prefix});case pt.Position:return(0,i.jsx)(OT,{categories:t,change:e.change,options:e.options,positionsIds:e.positionsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case pt.Slot:return(0,i.jsx)(LT,{categories:t,change:e.change,options:e.options,positionsSlotsIds:e.positionsSlotsIds,prefix:e.prefix,slots:e.slots,userInfoFields:e.userInfoFields});case pt.None:return null;default:return rl(e.options.positionDisplay)}},VT=e=>{const t=(0,L.useMemo)(()=>Ih(e.dayStartTime)?.[0]??0,[e.dayStartTime]),n=(0,L.useMemo)(()=>qh(e.startAt,e.endAt,e.ranges,e.daysDisplay,t),[e.startAt,e.endAt,e.ranges,e.daysDisplay,t]),s=(0,L.useMemo)(()=>(0,ih.A)(n,e=>e.toMillis()),[n]),o=(0,L.useMemo)(()=>(0,sh.A)(n,e=>e.toMillis()),[n]),r=(0,L.useMemo)(()=>Math.ceil(o.endOf("month").diff(s.startOf("month"),"months").months),[s,o]),a=(0,L.useCallback)((t,n)=>{const i=e.currentSlots.filter(e=>e.startDate.year!==t.year||e.startDate.month!==t.month).concat(n.map(e=>Zs(Us.IX.fromDateTimes(e,e.plus({day:1})))));e.change(`${e.prefix}slots`,i)},[e.currentSlots,e.prefix,e.change]);return(0,i.jsx)(Na,{gap:"6",wrap:"wrap",children:(0,Oc.A)(0,r).map(n=>{const l=s.plus({month:n}).startOf("month"),d=0===n?s:l,c=n===r-1?o:l.endOf("month"),u=e.currentSlots.flatMap(e=>e.startDate.year===l.year&&e.startDate.month===l.month?[e.startDate.startOf("day").set({hour:t||0})]:[]);return(0,i.jsx)(jA,{firstDayOfMonth:l,max:c,min:d,startHour:t,values:u,onChange:e=>{a(l,e)}},n)})})},UT=e=>{const{intervals:t,minDate:n,maxDate:s,numberOfMonths:o}=(0,L.useMemo)(()=>{const t=e.intervalsGrouped.flatMap(([e,t])=>t.map(({interval:e})=>e)),n=(0,ih.A)(t,e=>e.start.toMillis()).start.startOf("day"),i=(0,sh.A)(t,e=>e.end.toMillis()).end.endOf("day"),s=Math.ceil(i.endOf("month").diff(n.startOf("month"),"months").months);return{intervals:t,minDate:n,maxDate:i,numberOfMonths:s}},[e.intervalsGrouped]),r=t.flatMap(t=>e.isSelected(t)?[t.start.startOf("day")]:[]);return(0,i.jsx)(Na,{gap:"6",wrap:"wrap",children:(0,Oc.A)(0,o).map(a=>{const l=n.plus({month:a}).startOf("month"),d=0===a?n:l,c=a===o-1?s:l.endOf("month"),u=r.filter(e=>e.month===l.month&&e.year===l.year);return(0,i.jsx)(jA,{firstDayOfMonth:l,max:c,min:d,values:u,onChange:n=>{((n,i)=>{e.setSelectedBatch(t.flatMap(e=>{if(e.start.startOf("month").equals(n)){const t=i.some(t=>t.equals(e.start.startOf("day")));return[{interval:e,isSelected:t}]}return[]}))})(l,n)}},a)})})},WT=e=>{const[t,n]=(0,L.useState)(e.intervals.some(({interval:t})=>e.isSelected(t))?"checked":"unchecked"),s=(0,L.useCallback)(()=>{const i="checked"===t?"unchecked":"checked";n(i),"unchecked"===i&&e.intervals.forEach(({interval:t})=>{e.setSelected(t,!1)})},[e.intervals,t,n,e.setSelected]);return(0,i.jsxs)(Na,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs"},direction:"column",children:[(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer",padding:"$4 $5"},gap:"2",onClick:s,children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textXs",children:(0,i.jsx)(el,{icon:"checked"===t?"chevron-down":"chevron-right"})}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:e.day})]}),"checked"===t&&(0,i.jsx)(Na,{css:{borderTop:"1px solid $gray200",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervals.map(({name:t,interval:n},s)=>(0,i.jsx)(gc,{state:e.isSelected(n)?"checked":"unchecked",onClick:t=>{e.setSelected(n,"checked"===t)},children:Kh(t,n)},s))})]})},GT=e=>(0,i.jsx)(Na,{css:{border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $5"},direction:"column",gap:"3",children:e.intervalsGrouped.map(([t,[{name:n,interval:s}]],o)=>{const r=`${n} ${s.toFormat("HH:mm")}`.trim(),a=`${t} ${e.hideNameDates?"":`(${r})`}`.trim();return(0,i.jsx)(gc,{state:e.isSelected(s)?"checked":"unchecked",onClick:t=>{e.setSelected(s,"checked"===t)},children:a},o)})}),HT=({customSlotPeriod:e,daysDisplay:t,event:n,isSelected:s,setSelected:o,setSelectedBatch:r})=>{const a=qn(Kc),l=(0,L.useMemo)(()=>Yh(e.startDate??n.startAt,e.endDate??n.endAt,e.customSlots,n.ranges,t),[e,n,t]),d=(0,L.useMemo)(()=>(0,lc.A)(Object.entries((0,ac.A)(l,({interval:e})=>a.toLocaleString(e.start.startOf("day"),Js.DateOnly.WeekdayLongMonthLong))),([e,[{interval:t}]])=>t.start.startOf("day").toMillis()),[l]);return(0,i.jsxs)(Na,{direction:"column",gap:"2",width:1,children:[m(e.name)&&(0,i.jsx)(yr,{font:"gray900 textSm semiBold",children:e.name}),1===e.customSlots.length?0===d.length?null:e.displayAsCalendar?(0,i.jsx)(UT,{intervalsGrouped:d,isSelected:s,setSelectedBatch:r}):(0,i.jsx)(GT,{hideNameDates:e.hideNameDates,intervalsGrouped:d,isSelected:s,setSelected:o}):d.map(([e,t],n)=>(0,i.jsx)(WT,{day:e,intervals:t,isSelected:s,setSelected:o},n))]})},qT=e=>{const t=(0,L.useMemo)(()=>e.customSlotsPeriods.flatMap(t=>Yh(t.startDate??e.event.startAt,t.endDate??e.event.endAt,t.customSlots,e.event.ranges,e.daysDisplay)).map(({interval:e})=>e),[e.customSlotsPeriods,e.event,e.daysDisplay]),[n,s]=(0,L.useState)(Object.fromEntries(t.map(t=>{const n=e.currentSlots.some(e=>Ys(e).equals(t));return[t.toISO(),n]}))),o=(0,L.useCallback)(e=>n[e.toISO()],[n]),r=(0,L.useCallback)((t,n)=>{const i=t.toISO();s(e=>({...e,[i]:n})),e.change(`${e.prefix}slots`,Zh(e.currentSlots,t,n))},[e.currentSlots,s]),a=(0,L.useCallback)(t=>{const n=t.reduce((e,{interval:t,isSelected:n})=>{const i=t.toISO();return s(e=>({...e,[i]:n})),Zh(e,t,n)},e.currentSlots);e.change(`${e.prefix}slots`,n)},[e.currentSlots,s]),l=(0,L.useMemo)(()=>e.customSlotsPeriods.flatMap(e=>e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.customSlotsPeriods]);return(0,i.jsx)(Na,{direction:"column",gap:"6",children:e.customSlotsPeriods.map(t=>lC(t,e.userInfoFields,l)?(0,i.jsx)(HT,{customSlotPeriod:t,daysDisplay:e.daysDisplay,event:e.event,isSelected:o,setSelected:r,setSelectedBatch:a},t.id):null)})},YT=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>qh(e.startAt,e.endAt,e.ranges,e.daysDisplay,Ih(e.dayStartTime)?.[0]??0),[e.startAt,e.endAt,e.ranges,e.daysDisplay,e.dayStartTime]),s=(0,L.useMemo)(()=>n.filter(t=>(e.blockedSlots??[]).some(e=>Xs(e,t))),[e.blockedSlots,n]),o=qn(Kc),[r,a]=(0,L.useState)(Object.fromEntries(n.map((t,n)=>{const i=Us.IX.fromDateTimes(t,t.plus({day:1}));return[`day${n}`,void 0!==e.currentSlots.find(e=>Ys(e).equals(i))]})));return(0,i.jsx)(i.Fragment,{children:n.map((n,l)=>{const d=s.includes(n);return(0,i.jsxs)(L.Fragment,{children:[0!==l&&(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{disabled:d,state:r[`day${l}`]?"checked":"unchecked",onClick:t=>{a({...r,[`day${l}`]:"checked"===t}),e.change(`${e.prefix}slots`,Zh(e.currentSlots,Us.IX.fromDateTimes(n,n.plus({day:1})),"checked"===t))},children:d?(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(cl,{children:o.toLocaleString(n,Js.DateOnly.WeekdayLongMonthLong)})}),(0,i.jsx)(Cm,{placement:"right",children:t("vous_avez_d_j_92810")})]}):o.toLocaleString(n,Js.DateOnly.WeekdayLongMonthLong)})]},l)})})};var KT=n(3088);const ZT=e=>{const t=Yn();return(0,i.jsx)(Yj,{buttons:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})})}),title:t("disponibilit_n_50484",e.index+1),children:(0,i.jsxs)(Na,{direction:{"@initial":"column","@desktop":"row"},gap:"4",children:[(0,i.jsx)(Lm,{label:t("date_de_d_but_43380"),max:e.max,min:e.min,name:`${e.prefix}startDate`}),(0,i.jsx)(tb,{label:t("heure_de_d_but_27566"),name:`${e.prefix}startTime`}),(0,i.jsx)(Lm,{label:t("date_de_fin_86920"),max:e.max,min:e.min,name:`${e.prefix}endDate`}),(0,i.jsx)(tb,{label:t("heure_de_fin_95071"),name:`${e.prefix}endTime`})]})})},XT=e=>{const t=Yn(),n=qn(fT),s=(0,L.useMemo)(()=>e.max.endOf("day"),[e.max]);return(0,i.jsx)(KT.ED,{name:`${e.prefix}slots`,children:({fields:o})=>(0,i.jsxs)(i.Fragment,{children:[o.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(ZT,{index:n,max:s,min:e.min,prefix:`${t}.`,remove:()=>{o.remove(n)}})]},n)),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(El,{color:"invisible",leftIcon:"plus",onClick:()=>{o.push(n.volunteersRegistrationsSlotInputDefault(e.min))},children:t("ajouter_une_dis_96540")})]})})},JT=e=>{switch(e.slotDisplay){case xt.Display:return(0,i.jsx)(XT,{max:e.event.endAt,min:e.event.startAt,prefix:e.prefix});case xt.DisplayDays:return(0,i.jsx)(YT,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.currentSlots,dayStartTime:e.event.dayStartTime,daysDisplay:e.daysDisplay,endAt:e.event.endAt,prefix:e.prefix,ranges:e.event.ranges,startAt:e.event.startAt});case xt.Calendar:return(0,i.jsx)(VT,{change:e.change,currentSlots:e.currentSlots,dayStartTime:e.event.dayStartTime,daysDisplay:e.daysDisplay,endAt:e.event.endAt,prefix:e.prefix,ranges:e.event.ranges,startAt:e.event.startAt});case xt.Custom:return(0,i.jsx)(qT,{change:e.change,currentSlots:e.currentSlots,customSlotsPeriods:e.customSlotsPeriods,daysDisplay:e.daysDisplay,event:e.event,prefix:e.prefix,userInfoFields:e.userInfoFields});case xt.Hide:return null;default:return rl(e.slotDisplay)}},QT=e=>(0,i.jsxs)(Na,{css:{bd:!0,padding:"$6",background:"$white"},direction:"column",children:[e.title&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{font:"gray800 textMd semiBold",children:e.title}),(0,i.jsx)(qa,{height:"5"})]}),e.children]}),ez=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),o=(0,L.useMemo)(()=>s&&e.form.slotDisplay!==xt.Hide,[e.form,s]),r=(0,L.useMemo)(()=>s&&e.form.positionDisplay!==pt.None,[e.form,s]),a=(0,L.useMemo)(()=>s&&(e.form.accreditationDisplay!==mt.None||no(e.delegationAccreditations)),[e.delegationAccreditations,e.form,s]);return(0,i.jsxs)(i.Fragment,{children:[e.showEmail&&(0,i.jsxs)(QT,{children:[m(e.form.description)&&(0,i.jsx)(xg,{text:e.form.description}),(0,i.jsx)(Ll,{isEmail:!0,label:t("Email"),name:"email"})]}),(0,i.jsx)(QT,{title:m(e.form.informationTitle)?e.form.informationTitle:t("informations_pe_37892"),children:(0,i.jsx)(vT,{change:e.change,elements:e.form.elements,organizationId:n,prefix:"formRegister.userInfo.fields.",values:e.values.formRegister.userInfo.fields})}),o&&e.event&&(0,i.jsxs)(QT,{title:m(e.form.slotTitle)?e.form.slotTitle:t("disponibilit_s_49923"),children:[m(e.form.slotSubtitle)&&(0,i.jsx)(xg,{text:e.form.slotSubtitle}),(0,i.jsx)(JT,{blockedSlots:e.blockedSlots,change:e.change,currentSlots:e.values.formRegister.slots,customSlotsPeriods:e.form.customSlotsPeriods,daysDisplay:e.form.daysDisplay,event:e.event,prefix:"formRegister.",slotDisplay:e.form.slotDisplay,userInfoFields:e.values.formRegister.userInfo.fields})]}),r&&e.event&&(0,i.jsxs)(QT,{title:m(e.form.positionTitle)?e.form.positionTitle:t("missions_souhai_23225"),children:[m(e.form.positionSubtitle)&&(0,i.jsx)(xg,{text:e.form.positionSubtitle}),(0,i.jsx)(BT,{change:e.change,event:e.event,options:e.form,positionsCategoriesIds:e.values.formRegister.positionsCategoriesIds,positionsIds:e.values.formRegister.positionsIds,positionsSlotsIds:e.values.formRegister.positionsSlotsIds,prefix:"formRegister.",slots:e.values.formRegister.slots,userInfoFields:e.values.formRegister.userInfo.fields})]}),a&&e.event&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(QT,{title:m(e.form.accreditationTitle)?e.form.accreditationTitle:t("accr_ditations_74375"),children:[m(e.form.accreditationSubtitle)&&(0,i.jsx)(xg,{text:e.form.accreditationSubtitle}),(0,i.jsx)(wT,{accreditationsSlotsIds:e.values.formRegister.accreditationsSlotsIds,change:e.change,delegationAccreditations:e.delegationAccreditations??[],displayFormCustomFields:!0,event:e.event,options:e.form,prefix:"formRegister.",showAutoAccredit:e.showAutoAccredit,slots:e.values.formRegister.slots,userInfosFields:e.values.formRegister.userInfo.fields})]})})]})},tz=e=>{const t=qn(_T),n=(0,L.useMemo)(()=>(e.organization.form.elements??[]).flatMap(e=>e.elementType===Ge.Field?[e.customField]:[]),[e.organization]);return(0,L.useEffect)(()=>{const i=t.formRegisterInputDefault(qe.Admin,null,n,{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditations:e.organization.delegation?.accreditationsSlots??[],eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:e.organization.form.slotDisplay,team:null});e.setInitialValues({email:e.values.email||"",formRegister:{...i,userInfo:{...i.userInfo,...e.values.formRegister.userInfo}}})},[e.organization]),(0,i.jsx)(Fm,{css:{gap:"$6"},children:(0,i.jsx)(ez,{change:e.change,delegationAccreditations:e.organization.delegation?.accreditationsSlots??[],event:e.organization.event,form:e.organization.form,showAutoAccredit:!0,showEmail:!1,values:e.values})})},nz=e=>{const{translate:t,params:{delegationId:n}}=_l();return(0,i.jsxs)(Na,{direction:"column",gap:"6",width:1,children:[(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(Ll,{isEmail:!0,label:t("Email"),name:"email"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Ll,{label:(0,i.jsx)(Uv,{children:t("pr_nom_66988")}),name:"formRegister.userInfo.fields.firstName"}),(0,i.jsx)(Ll,{label:(0,i.jsx)(Uv,{children:t("Name")}),name:"formRegister.userInfo.fields.lastName"})]})]}),!n&&(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("param_tres_du_m_69378")}),(0,i.jsx)(yr,{color:"gray500",children:t("s_lectionnez_le_16209")})]}),(0,i.jsx)(Um,{isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:t("population_38615")}),name:"formRegister.userInfo.fields.population",children:e.population.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(bc,{isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:t("Delegation")}),values:e.delegationsIds,onChange:e.setDelegationsIds,children:e.delegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(bc,{isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:t("Form")}),state:no(e.delegationsIds)?"disabled":"active",values:e.formsIds,onChange:e.setFormsIds,children:e.forms.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})},iz=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,delegationId:r}}=_l(),a=qn(_T),l=qn(Ba),d=(0,L.useRef)(null),{mutate:c,isLoading:u}=function(e={}){return Xn("mutation UserInfoAdminCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $email: UserEmail!\n $userInfo: UsersInfoInput!\n $sendNotificationEmail: Boolean!\n) {\n userInfoAdminCreate(\n organizationId: $organizationId\n eventId: $eventId\n email: $email\n userInfo: $userInfo\n sendNotificationEmail: $sendNotificationEmail\n ) {\n id\n }\n}\n",e)}(),{mutate:h}=function(e={}){return Xn("mutation FormRegister(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $formId: FormId!\n $email: UserEmail!\n $formRegister: FormRegisterInput!\n) {\n formRegister(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n formId: $formId\n email: $email\n formRegister: $formRegister\n ) {\n teamCode\n }\n}\n",e)}(),[m,g]=(0,L.useState)(null),p=(0,L.useMemo)(()=>m?.form.elements.filter(e=>e.elementType===Ge.Field)??[],[m]),[f,x]=(0,L.useState)({email:"",formRegister:a.formRegisterInputDefault(qe.Admin,null,[],{countryCode:e.organization?.event?.country??e.organization?.country,delegationAccreditations:[],eventStartDate:e.organization?.event?.startAt,forOther:!0,sendNotificationEmail:!1,slotDisplay:xt.Hide,team:null})}),_=(0,L.useCallback)(e=>l.validateForForm(a.formRegisterSchema(p,m?.form.slotDisplay??xt.Hide,m?.event?.startAt??Us.c9.now(),m?.event?.endAt??Us.c9.now(),m?.form.positionRanking??He.Unranked,m?.form.positionDisplay??pt.None,m?.form.accreditationDisplay??mt.None,m?.delegation?.id))(e),[p,a,m,l]),I=(0,L.useCallback)(async n=>{m?await h({organizationId:s,eventId:o,delegationId:m.delegation?.id,formId:m.form.id,email:n.email,formRegister:n.formRegister}):await c({organizationId:s,eventId:o,email:n.email,userInfo:n.formRegister.userInfo,sendNotificationEmail:n.formRegister.sendNotificationEmail}),t.push(e.closePath)},[e.closePath,m]),v=e.organization.delegations.nodes,b=e.organization.forms.nodes,[j,C]=(0,L.useState)(!1),[y,k]=(0,L.useState)([]),[A,w]=(0,L.useState)([]),S=(0,L.useCallback)(async e=>{if(w(e),no(e)){C(!0);const{organization:t}=await ya({organizationId:s,eventId:o,formId:e[0]},await K());g(t),C(!1)}else g(null)},[o,s]),E=(0,L.useCallback)(async e=>{if(k(e),no(e)){const t=v.find(t=>t.id===e[0]);w([t.formId]),C(!0);const{organization:n}=await ya({organizationId:s,delegationId:e[0],eventId:o,formId:t.formId},await K());g(n),C(!1)}else g(null)},[v,s,o]);return Dd(n("cr_ation_d_un_m_98624")),(0,L.useEffect)(()=>{r&&E([r])},[r,E]),(0,i.jsx)(Cl,{customErrorRef:d,height:1,hideDefaultErrors:!0,initialValues:f,render:({form:t,handleSubmit:s,values:r})=>(0,i.jsx)(Pm,{category:n("cr_ation_d_un_m_98624"),color:"dark",fallbackClosePath:e.closePath,heading:n("nouveau_membre_94535"),children:(0,i.jsx)($m,{ref:d,children:(0,i.jsxs)(Na,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(vl,{hideSpacer:!0}),(0,i.jsx)(Mm,{heading:n("informations_su_05921"),hideToggle:!0,initialIsOpen:!0,children:(0,i.jsx)(nz,{delegations:v,delegationsIds:y,forms:b,formsIds:A,population:e.organization.population,setDelegationsIds:E,setFormsIds:S})}),j&&(0,i.jsx)(Fm,{css:{minHeight:"200px"},children:(0,i.jsx)(kl,{})}),!j&&m&&(0,i.jsx)(tz,{change:t.change,organization:m,setInitialValues:x,values:r}),(0,i.jsx)(Fm,{children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[o&&(0,i.jsx)(Nm,{name:"formRegister.sendNotificationEmail",children:n("envoyer_l_email_75574")}),(0,i.jsx)(El,{isLoading:u,textAlign:"center",onClick:s,children:n("ajouter_le_memb_57505")})]})})]})})}),validate:_,width:1,onSubmit:I})},sz=()=>{const{params:{organizationId:e,eventId:t,delegationId:n}}=_l(),{data:s,loader:o}=Zn('query CreateUserInfos(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n country\n\n population: customFieldBySlug(slug: "population") {\n values {\n id\n value\n }\n }\n\n forms(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n delegations(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n formId\n }\n }\n\n event: eventMaybe(id: $eventId) {\n startAt\n endAt\n country\n }\n }\n}\n',{organizationId:e,eventId:t,level:t?it.Event:it.Organization},[]);return o||(0,i.jsx)(iz,{closePath:n?ds.DELEGATION_MEMBERS({organizationId:e,eventId:t,delegationId:n}):t?$s.VOLUNTEERS(e,t):yi.COMMUNITY_USERS({organizationId:e}),organization:s.organization})};let oz=class extends Ul{constructor(e){super(e)}commentInputDefault(){return{content:""}}commentInputSchema(){return d.Ik().shape({content:d.Yj().required(this.t("le_commentaire_33393"))})}createCommentSchema(){return d.Ik().shape({comment:this.commentInputSchema()})}};function rz(e){return e.replace(/\*\*(.+?)\*\*/g,"$1").replace(/\+\+(.+?)\+\+/g,"$1").replace(/_(.+?)_/g,"$1").replace(/~~(.+?)~~/g,"$1")}oz=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],oz);const az=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation CommentDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $commentId: CommentId!\n) {\n commentDelete(organizationId: $organizationId, eventId: $eventId, commentId: $commentId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_55928"),text:t("suppression_d_u_90124"),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,eventId:e.eventId,commentId:e.commentId}),e.onSuccess()}})},lz=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{mutate:o}=function(e={}){return Xn("mutation CommentUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $commentId: CommentId!\n $comment: CommentInput!\n) {\n commentUpdate(\n organizationId: $organizationId\n eventId: $eventId\n commentId: $commentId\n comment: $comment\n ) {\n id\n }\n}\n",e)}(),[r,a]=(0,L.useState)(e.comment.content),[l,d]=(0,L.useState)(!1),c=m(r);return(0,i.jsxs)(Rb,{children:[(0,i.jsx)($b,{children:(0,i.jsx)(yr,{color:"gray500",css:{cursor:"pointer"},children:(0,i.jsx)(el,{icon:"pen"})})}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"message",children:t("mise_jour_du_59845")}),(0,i.jsx)(Tb,{children:(0,i.jsx)(Wm,{label:t("commentaire_08754"),value:r,onChange:a})}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{disabled:!c,isLoading:l,onClick:async()=>{d(!0),await o({organizationId:n,eventId:s,commentId:e.comment.id,comment:{content:r}}),e.reload()},children:t("mettre_jour_85141")})})]})]})},dz=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),o=qn(Kc),{user:r}=si(),[a,l]=(0,L.useState)(!1),d=e.comment.event,c=e.comment.writtenBy;return(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(Jg,{email:c.email,image:c.userInfo.picture?.url,name:c.userInfo.name,size:40}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"2",children:[(0,i.jsxs)(Na,{gap:"2",children:[(0,i.jsx)(yr,{color:"gray800",css:{flex:"1"},fontWeight:"medium",children:c.userInfo.nameOrEmail}),(0,i.jsx)(yr,{color:"gray500",children:o.toLocaleString(e.comment.insertedAt.toLocal(),Js.DateTime)}),e.showEvent&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray500",children:"•"}),(0,i.jsx)(yr,{color:"gray500",children:d?.name??t("communaut_20896")})]}),c.id===r?.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray500",children:"•"}),(0,i.jsx)(lz,{comment:e.comment,reload:e.reload})]}),(0,i.jsxs)(Bb,{permissions:Nb.COMMENT_ADD,children:[(0,i.jsx)(yr,{color:"gray500",children:"•"}),(0,i.jsx)(yr,{color:"gray500",css:{cursor:"pointer"},onClick:()=>{l(!0)},children:(0,i.jsx)(el,{icon:"trash-can"})})]})]}),(0,i.jsx)(yr,{color:"gray800",css:{background:"$gray100",borderRadius:"0 $2 $2 $2",boxShadow:"$sm",padding:"$3",whiteSpace:"pre-line"},dangerouslySetInnerHTML:{__html:rz(e.comment.content)}})]}),a&&(0,i.jsx)(az,{commentId:e.comment.id,eventId:s,organizationId:n,onClose:()=>{l(!1)},onSuccess:e.reload})]})},cz=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=_l(),r=qn(oz),a=qn(Ba),{data:l,loader:d,reload:c}=Aa({organizationId:t,userInfoId:s}),{mutate:u,isLoading:h}=ka(),[m,g]=(0,L.useState)(1),p=(0,L.useCallback)(()=>{g(m+1),c()},[m,g,c]);return(0,i.jsx)(Cl,{direction:"column",hideDefaultErrors:!0,initialValues:{comment:r.commentInputDefault()},render:({handleSubmit:t})=>(0,i.jsxs)(i.Fragment,{children:[d||(l.organization?.userInfo.comments??[]).map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(dz,{comment:t,reload:p,showEvent:e.showEvent})]},n)),(0,i.jsxs)(Bb,{permissions:Nb.COMMENT_ADD,children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(vl,{}),(0,i.jsx)(Gm,{label:o("commentaire_08754"),name:"comment.content"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(El,{isLoading:h,onClick:t,children:(0,i.jsx)(yr,{textAlign:"center",width:1,children:o("ajouter_un_nouv_86295")})})]}),(0,i.jsx)(qa,{height:"8"})]}),validate:a.validateForForm(r.createCommentSchema()),width:1,onSubmit:async e=>{await u({organizationId:t,eventId:n,userInfoId:s,comment:e.comment}),p()}},m)},uz=({canEdit:e,editFormPath:t,editPath:n,formsUsersInfos:s,isEditDisabled:o=!1})=>{const{params:{organizationId:r,eventId:a,userInfoId:l},translate:d}=_l(),c=qn(Kc),u=(0,L.useMemo)(()=>(0,lc.A)(s.filter(e=>no(e.accreditationsSlots)).map(e=>({...e,accreditationsSlots:(0,lc.A)(e.accreditationsSlots,e=>[e.accreditationCategory.name.toLowerCase(),wC(e.accreditation.index),e.accreditation.name.toLowerCase(),e.date?.toMillis()??1,e.name.toLowerCase()])})),e=>e.form.name.toLowerCase()),[s]),h=wc();return(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[o&&(0,i.jsx)(Bk,{message:d("you_are_already_assigned_to_accreditations"),title:d("wished_accreds_can_no_longer_be_changed")}),(0,i.jsx)(Fc,{filters:e&&(0,i.jsx)(El,{color:"white",disabled:o,size:"sm",to:n,children:d("_diter_62574")}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:d("nom_de_l_accr_d_11908")}),!h&&(0,i.jsx)(Vc,{children:d("cr_neau_11117")}),!h&&(0,i.jsx)(Vc,{children:d("Form")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:no(u)?u.flatMap((e,n)=>e.accreditationsSlots.map((s,d)=>(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:s.accreditation.name}),!h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ec,{children:Oh(c,s,"")}),(0,i.jsx)(Ec,{children:(0,i.jsx)(Vk,{editDisabled:o,editPath:t,eventId:a,form:e.form,organizationId:r,userInfoId:l})})]})]},`${n}-${d}`))):(0,i.jsx)(Dc,{css:{height:"200px"},children:(0,i.jsx)(Ec,{children:(0,i.jsx)(Nk,{title:d("aucune_accr_dit_56501")})})})}),setOffset:Ql.A,title:d("accr_ditations_74375"),totalCount:0})]})},hz=e=>{const t=qn(Kc),n=L.useMemo(()=>{const t=ec(e.aui.accreditation.color);return{background:t[50],color:t[700]}},[e.aui]);return(0,i.jsx)(i.Fragment,{children:e.renderAccreditation((0,i.jsxs)(Na,{css:{...n,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Na,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsx)(yr,{children:Oh(t,e.aui.accreditationSlot,"")}),e.aui.isAutoAccredit&&(0,i.jsx)(yr,{fontSize:"textXs",children:(0,i.jsx)(el,{icon:"bolt-auto"})})]}),(0,i.jsx)(yr,{fontSize:"textXs",fontWeight:"medium",children:e.aui.accreditation.name})]}),e.aui.accreditation.id)})},mz=e=>{const t=KA(),n=L.useMemo(()=>(0,lc.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>!e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),wC(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]),s=L.useMemo(()=>(0,lc.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(e=>e.accreditationSlot.date?.isValid),e=>[e.accreditationCategory.name.toLowerCase(),wC(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.name.toLowerCase()]),[e.event]);return(0,i.jsxs)(QA,{css:e.featureFlags?.isV4?{bd:!0,overflow:"auto"}:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:t?"week":"day",maxDate:e.event.endAt,minDate:e.event.startAt,children:[n.map(t=>(0,i.jsx)(JA,{children:(0,i.jsx)(hz,{aui:t,renderAccreditation:e.renderAccreditation})},t.id)),s.map(t=>(0,i.jsx)(JA,{endAt:t.accreditationSlot.date,startAt:t.accreditationSlot.date,children:(0,i.jsx)(hz,{aui:t,renderAccreditation:e.renderAccreditation})},t.id))]})},gz=e=>{const{translate:t,params:{organizationId:n,eventId:s,userInfoId:o}}=_l(),r=qn(Kc),{mutate:a}=jo(),{mutate:l}=function(e={}){return Xn("mutation AccreditationsSlotsUsersInfosCheckIn(\n $eventId: EventId!\n $checkIn: AccreditationSlotCheckInInput!\n) {\n accreditationsSlotsUsersInfosCheckIn(eventId: $eventId, checkIn: $checkIn)\n}\n",e)}(),d=(0,L.useMemo)(()=>Oh(r,e.aui.accreditationSlot,e.aui.accreditation.name),[e.aui]);return(0,i.jsxs)(Dc,{children:[(0,i.jsxs)(Ec,{align:"center",gap:"3",children:[(0,i.jsx)(FC,{color:e.aui.accreditation.color,icon:e.aui.accreditation.icon}),(0,i.jsxs)(Na,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(qc,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:es.ACCREDITATION({organizationId:n,eventId:s,accreditationId:e.aui.accreditation.id}),children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.aui.accreditation.name,width:1,children:e.aui.accreditation.name})}),(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0},title:d,width:1,children:d})]})]}),(0,i.jsxs)(Ec,{align:"start",direction:"column",justify:"center",children:[e.aui.state===me.Waiting&&(0,i.jsxs)(Na,{align:"center",gap:"1",children:[(0,i.jsx)(yr,{color:"warning500",children:(0,i.jsx)(el,{icon:"hourglass-empty",iconStyle:"solid"})}),(0,i.jsx)(yr,{font:"gray800 textXs medium",children:t("pas_encore_scan_88057")})]}),e.aui.state===me.CheckedIn&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",gap:"1",children:[(0,i.jsx)(yr,{color:"success500",children:(0,i.jsx)(el,{icon:"badge-check",iconStyle:"solid"})}),(0,i.jsx)(yr,{font:"gray800 textXs medium",children:t("scann_e_01567")})]}),(0,i.jsx)(yr,{font:"gray500 textXs regular",children:e.aui.checkInAt?.isValid?r.toLocaleString(e.aui.checkInAt.toLocal(),Js.DateTime):""})]})]}),(0,i.jsx)(Ec,{children:e.aui.isAutoAccredit&&(0,i.jsx)(yr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(el,{icon:"check"})})}),(0,i.jsx)(Ec,{children:e.aui.isWorkflow&&(0,i.jsx)(yr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(el,{icon:"check"})})}),(0,i.jsxs)(Ec,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(yr,{children:e.aui.createdBy?.name??"-"}),(0,i.jsx)(yr,{color:"gray500",children:r.toLocaleString(e.aui.insertedAt.toLocal(),Js.DateTime)})]}),(0,i.jsxs)(Yc,{justify:"end",width:200,children:[e.aui.state===me.Waiting&&(0,i.jsx)(El,{color:"white",size:"sm",onClick:async()=>{await l({eventId:e.aui.eventId,checkIn:{strategy:ge.CheckIn,accreditationsSlotsUsersInfosIds:[e.aui.id]}}),e.reload()},children:"Scanner"}),(0,i.jsx)(Hc,{children:(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:async()=>{await a({eventId:s,massAccredit:{accreditationsSlotsIds:[e.aui.accreditationSlot.id],selecteds:{ids:[o]},strategy:tt.Delete}}),e.reload()},children:t("d_saffecter_du_47122")})})]})]})},pz=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(0,lc.A)(e.event.volunteerRegistration.accreditationsUsersInfos.filter(t=>!e.selectedDay?.isValid||!!t.accreditationSlot.date?.isValid&&t.accreditationSlot.date.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()),e=>[e.accreditationCategory.name.toLowerCase(),wC(e.accreditation.index),e.accreditation.name.toLowerCase(),e.accreditationSlot.date?.toMillis()??1,e.accreditationSlot.name.toLowerCase()]),[e.event,e.selectedDay]);return(0,i.jsxs)(kc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:t("Accreditation")}),(0,i.jsx)(Vc,{children:t("scann_e_le_27812")}),(0,i.jsx)(Vc,{children:t("affect_e_automa_74071")}),(0,i.jsx)(Vc,{children:t("ajout_via_une_69544")}),(0,i.jsx)(Vc,{children:t("ajout_e_par_71330")}),(0,i.jsx)(Vc,{width:200})]}),n.map(t=>(0,i.jsx)(gz,{aui:t,reload:e.reload},t.id))]})},fz=e=>{const{translate:t}=_l(),[n,s]=L.useState(L_(e.event.startAt,e.event.endAt)),[o,r]=L.useState(null);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Na,{as:"section",css:{background:"white",bd:!0,overflow:"hidden",padding:e.featureFlags?.isV4?"$6 $7 $7 $7":void 0},direction:"column",gap:e.featureFlags?.isV4?"6":void 0,justify:"center",children:[(0,i.jsxs)(Na,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(yr,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(ul,{textStyle:"heading",children:e.title}),e.subtitle&&(0,i.jsx)(cl,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Na,{as:"nav",gap:"3",children:["calendar"===e.accreditationsDisplay&&(0,i.jsx)(ZA,{max:e.event.endAt,min:e.event.startAt,value:n,onChange:s}),"list"===e.accreditationsDisplay&&!e.hideListView&&(0,i.jsx)(yr,{width:160,children:(0,i.jsx)(Du,{rightIcon:"xmark",value:o,onChange:r,onRightIconClick:()=>r(null)})}),!e.hideListView&&e.setAccreditationsDisplay&&(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{value:e.accreditationsDisplay,onChange:e.setAccreditationsDisplay,children:[(0,i.jsx)("option",{value:"calendar",children:t("Calendar")}),(0,i.jsx)("option",{value:"list",children:t("List")})]})}),e.actions]})]}),"calendar"===e.accreditationsDisplay?(0,i.jsx)(mz,{event:e.event,featureFlags:e.featureFlags,renderAccreditation:e.renderAccreditation,selectedDay:n}):(0,i.jsx)(pz,{event:e.event,reload:e.reload,selectedDay:o})]})})};function xz(e,t,n={}){const{localEvent:i,updateLocalEvent:s}=vb(),[o,r]=L.useState("function"==typeof n.deserialize?n.deserialize(i?.[e])||t:i?.[e]??t);return[o,L.useCallback(async t=>{r(t),await s({[e]:"function"==typeof n.serialize?n.serialize(t):t})},[e,r,s])]}const _z=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=_l(),[r,a]=xz("user.accreditations.display","calendar");return(0,i.jsx)(fz,{...e,accreditationsDisplay:r,actions:(0,i.jsx)(Bb,{rolesTypes:fI,children:(0,i.jsx)(El,{to:$s.EDIT_ACCREDIT(t,n,s),children:o("_diter_les_accr_86042")})}),setAccreditationsDisplay:a})},Iz=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=_l(),{isEventAdmin:r}=vb(),a=(0,L.useMemo)(()=>no(e.organization.userInfo.formsUsersInfos.filter(e=>no(e.accreditationsSlots)))||(e.event?.hasFormWithAccreditationDisplay??!1),[e.organization,e.event]);return(0,i.jsxs)(Na,{direction:"column",gap:"6",width:1,children:[no(e.event.volunteerRegistration.accreditationsUsersInfos)&&(0,i.jsx)(_z,{event:e.event,reload:e.reload,renderAccreditation:(e,s)=>(0,i.jsx)(Ja,{style:{width:"100%"},to:es.ACCREDITATION({organizationId:t,eventId:n,accreditationId:s}),children:e}),subtitle:o("visualisez_tout_53227"),title:o("accr_ditations_33155")}),a&&(0,i.jsx)(uz,{canEdit:r,editPath:$s.EDIT_USER_ACCREDITATIONS(t,n,s),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(qa,{height:"8"})]})},vz=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Jn(),{data:s,loader:o,reload:r}=Zn("query UserProfileAccreditations(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $excludeAccreditations: [AccreditationId!]\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n formsUsersInfos(eventId: $eventId, level: Event) {\n accreditationsSlots {\n name\n date\n\n accreditation {\n id\n name\n index\n }\n\n accreditationCategory {\n name\n }\n }\n\n form {\n id\n name\n }\n }\n }\n }\n\n event(id: $eventId) {\n name\n dayStartTime\n startAt\n endAt\n hasFormWithAccreditationDisplay\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n accreditationsUsersInfos(excludeAccreditations: $excludeAccreditations) {\n ...UserPanelAccreditationSlotUserInfo\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Ls.UserPanelAccreditationSlotUserInfoFragment]);return o||(0,i.jsx)(Iz,{event:s.event,organization:s.organization,reload:r})},bz=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=_l(),{organization:r,hasFeature:a}=yI(),{event:l,isEventAdmin:d}=vb(),{canDocumentRead:c,canMemberAccredit:u,canMemberAssignmentStateEdit:h,canMemberDelete:m}=wS(),{mutate:g,isLoading:p}=qo(),{mutate:f,isLoading:x}=Qo(),{mutate:_,isLoading:I}=Qo(),{mutate:v,isLoading:b}=Qo(),{mutate:j}=Fo(),{mutate:C}=Vo(),{mutate:y,isLoading:k}=Zo(),{mutate:A,isLoading:w}=Zo(),[S,E]=(0,L.useState)(!1),[T,z]=(0,L.useState)(!1),O=(0,L.useMemo)(()=>(0,lc.A)(e.customDocuments.filter(t=>iA(t.populationsIds,e.userInfo.fields.population)),e=>e.name),[e.customDocuments,e.userInfo]),{permissions:[R]}=ck(((...e)=>({name:"canUserInfoAssignFn",args:e}))(e.userInfo.id)),$=c&&(e.links&&(e.state===$t.Assigned||no(r.customBadges))||no(O)),D=d&&l.useDelegations&&a(Ne.Delegation)&&e.delegation,P={lang:e.userInfo.language};return(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[(R||h)&&(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("affectation")}),h&&(e.state===$t.Assigned||e.state===$t.Refused||e.state===$t.NotApplicable||e.state===$t.PreAssigned)&&(0,i.jsx)(El,{color:"white",isLoading:x,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await f({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:$t.WaitingAssignment}}),e.reload()},children:o("changer_le_stat_90266")}),h&&(e.state===$t.Assigned||e.state===$t.WaitingAssignment||e.state===$t.NotApplicable||e.state===$t.PreAssigned)&&(0,i.jsx)(El,{color:"white",isLoading:I,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await _({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:$t.Refused}}),e.reload()},children:o("changer_le_stat_68392")}),h&&(e.state===$t.WaitingAssignment||e.state===$t.Assigned)&&(0,i.jsx)(El,{color:"white",isLoading:b,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await v({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:$t.NotApplicable}}),e.reload()},children:o("changer_le_stat_62507")}),R&&e.state===$t.Assigned&&(0,i.jsx)(El,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:$s.EDIT_ASSIGNMENT(n,s,e.userInfo.id),children:o("_diter_les_affe_42283")}),R&&(e.state===$t.WaitingAssignment||e.state===$t.PreAssigned)&&(0,i.jsx)(El,{color:"white",leftIcon:"wand-magic-sparkles",rightIcon:"arrow-right",to:$s.ASSIGNMENT(n,s,e.userInfo.id),children:o("affecter_94255")}),R&&e.state===$t.Assigned&&(0,i.jsx)(El,{color:"white",isLoading:p,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await g({organizationId:n,eventId:s,userInfoId:e.userInfo.id,emailType:Oe.Assignments})},children:o("r_envoyer_l_e_65315")}),d&&e.state===$t.Refused&&(0,i.jsx)(El,{color:"white",isLoading:p,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await g({organizationId:n,eventId:s,userInfoId:e.userInfo.id,emailType:Oe.Refused})},children:o("r_envoyer_l_e_06733")})]}),u&&(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("Accreditation")}),(e.accreditationState===le.NotApplicable||e.accreditationState===le.Refused||e.accreditationState===le.Accredited||e.accreditationState===le.AutoAccredited)&&(0,i.jsx)(El,{color:"white",isLoading:w,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await A({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:le.WaitingAccreditation}}),e.reload()},children:o("changer_le_stat_20528")}),(e.accreditationState===le.Accredited||e.accreditationState===le.AutoAccredited||e.accreditationState===le.WaitingAccreditation||e.accreditationState===le.NotApplicable)&&(0,i.jsx)(El,{color:"white",isLoading:w,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await A({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:le.Refused}}),e.reload()},children:o("changer_le_stat_68392")}),(e.accreditationState===le.WaitingAccreditation||e.accreditationState===le.Accredited||e.accreditationState===le.AutoAccredited)&&(0,i.jsx)(El,{color:"white",isLoading:k,leftIcon:"arrow-right-arrow-left",rightIcon:"arrow-right",onClick:async()=>{await y({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfo.id]},state:le.NotApplicable}}),e.reload()},children:o("changer_le_stat_62507")}),e.accreditationState===le.Accredited&&(0,i.jsx)(El,{color:"white",leftIcon:"pen",rightIcon:"arrow-right",to:$s.EDIT_ACCREDIT(n,s,e.userInfo.id),children:o("_diter_les_accr_86042")}),(e.accreditationState===le.AutoAccredited||e.accreditationState===le.WaitingAccreditation)&&(0,i.jsx)(El,{color:"white",leftIcon:"badge-check",rightIcon:"arrow-right",to:$s.ACCREDIT(n,s,e.userInfo.id),children:o("accr_diter_70543")}),(e.accreditationState===le.Accredited||e.accreditationState===le.AutoAccredited)&&(0,i.jsx)(El,{color:"white",isLoading:p,leftIcon:"paper-plane",rightIcon:"arrow-right",onClick:async()=>{await g({organizationId:n,eventId:s,userInfoId:e.userInfo.id,emailType:Oe.Accreditations})},children:o("r_envoyer_l_e_24677")})]}),$&&(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("Documents")}),$&&e.state===$t.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(El,{color:"white",download:`${e.userInfo.nameOrEmail}-assignments`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:ug(e.links.userAssignmentsLink,"pdf",P),children:o("t_l_charger_la_82882")}),(0,i.jsx)(El,{color:"white",download:`${e.userInfo.nameOrEmail}-planning`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:ug(e.links.userPlanningLink,"pdf",P),children:o("t_l_charger_le_74660")}),(0,i.jsx)(El,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-days`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:ug(e.links.userPlanningDaysLink,"pdf",P),children:o("t_l_charger_le_43587")}),(0,i.jsx)(El,{color:"white",download:`${e.userInfo.nameOrEmail}-planning-list`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:ug(e.links.userPlanningListLink,"pdf",P),children:o("t_l_charger_le_58518")}),(0,i.jsx)(El,{color:"white",download:`${e.userInfo.nameOrEmail}-user-hours`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:ug(e.links.userHoursLink,"pdf",P),children:o("t_l_charger_les_98537")}),a(Ne.Documents)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(El,{color:"white",download:`${e.userInfo.nameOrEmail}-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:ug(e.links.userBadgeLink,"pdf",P),children:o("t_l_charger_le_53240")}),(0,i.jsx)(El,{color:"white",download:`${e.userInfo.nameOrEmail}-certificate`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:ug(e.links.userCertificateLink,"pdf",P),children:o("t_l_charger_l_a_02386")})]})]}),r.customBadges.map(t=>(0,i.jsx)(El,{color:"white",download:`${e.userInfo.nameOrEmail}-custom-badge`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:ug(e.links.userCustomBadgeLinks[t],"pdf",P),children:o("t_l_charger_1_80752",P_(t))},t)),O.map((t,n)=>(0,i.jsx)(El,{color:"white",download:`${e.userInfo.name}-custom-document`,leftIcon:"arrow-down-to-bracket",rightIcon:"arrow-right",to:ug(e.links.userCustomDocumentLinks[t.slug],"pdf",P),children:o("t_l_charger_1_80752",t.name)},n))]}),m&&(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:o("g_n_ral_64953")}),D&&(0,i.jsx)(El,{color:"white",leftIcon:"minus",rightIcon:"arrow-right",onClick:()=>E(!0),children:o("retirer_de_la_d_64963")}),(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>z(!0),children:o("d_sinscrire_de_06416")})]}),D&&S&&(0,i.jsx)(sA,{buttonText:o("retirer_de_la_d_64963"),subtext:[o("_tes_vous_sur_d_34901",e.delegation.name)],text:o("suppression_de_73669",e.userInfo.name),onClose:()=>E(!1),onDelete:async()=>{await j({organizationId:r.id,eventId:s,delegationId:e.delegation.id,selecteds:{ids:[e.userInfo.id]}}),t.push($s.VOLUNTEERS(n,s))}}),T&&(0,i.jsx)(sA,{buttonText:o("d_sinscrire_27046"),subtext:[o("_tes_vous_s_r_d_29576"),o("_1_sera_toujou_13334",e.userInfo.nameOrEmail)],text:o("d_sinscription_69522",e.userInfo.nameOrEmail),onClose:()=>z(!1),onDelete:async()=>{await C({eventId:s,selecteds:{ids:[e.userInfo.id]}}),t.push($s.VOLUNTEERS(n,s))}}),(0,i.jsx)(qa,{height:"8"})]})},jz=()=>{const{params:{eventId:e,userInfoId:t}}=_l(),{data:n,loader:s,reload:o}=Zn("query UserOverlayActionsEvent($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n customDocuments {\n ...CustomDocumentPopulation\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n accreditationState\n state\n\n delegation {\n id\n name\n }\n\n userInfo {\n ...UserInfoOverlay\n\n links(eventId: $eventId) {\n ...UserInfoLinks\n }\n }\n }\n }\n}\n",{eventId:e,userInfoId:t},[Ls.CustomDocumentPopulationFragment,Ls.UserInfoOverlayFragment,Ls.UserInfoLinksFragment]);if(s)return s;{const e=n.event.volunteerRegistration;return(0,i.jsx)(bz,{accreditationState:e.accreditationState,customDocuments:n.event.customDocuments,delegation:e.delegation,links:e.userInfo.links,reload:o,state:e.state,userInfo:e.userInfo})}},Cz=e=>{const{history:t,params:{organizationId:n},translate:s}=_l(),{mutate:o}=function(e={}){return Xn("mutation UserInfoAdminDelete($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n userInfoAdminDelete(organizationId: $organizationId, userInfoId: $userInfoId) {\n id\n }\n}\n",e)}(),[r,a]=(0,L.useState)(!1);return(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:s("g_n_ral_64953")}),(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",rightIcon:"arrow-right",onClick:()=>a(!0),children:s("supprimer_43083")}),r&&(0,i.jsx)(sA,{buttonText:s("supprimer_43083"),subtext:[s("_tes_vous_s_r_d_53083"),s("cette_action_es_08212")],text:s("suppression_de_04261",e.userInfo.nameOrEmail),onClose:()=>a(!1),onDelete:async()=>{await o({organizationId:n,userInfoId:e.userInfo.id}),t.push(yi.COMMUNITY_USERS({organizationId:n}))}})]})},yz=()=>{const{params:{organizationId:e,userInfoId:t}}=_l(),{data:n,loader:s}=Zn("query UserOverlayActionsOrganization($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n }\n }\n}\n",{organizationId:e,userInfoId:t},[Ls.UserInfoOverlayFragment]);return s||(0,i.jsx)(Cz,{userInfo:n.organization.userInfo})},kz=e=>{const{translate:t,params:{organizationId:n,eventId:s,userInfoId:o}}=_l(),r=qn(Sv),a=qn(Kc),{mutate:l}=Co(),{data:d}=ko({organizationId:n,eventId:s,userInfoId:o}),c=(0,L.useMemo)(()=>{const n=r.createUpdateCampaignValuesDefault(!1,d.organization?.event?.emailSender?.id??d.organization?.emailSenderId,null,null),i=d.organization?.userInfo?.name||"",s=a.toLocaleString(Us.c9.now(),Js.FullDateTime);return{...n,campaign:{...n.campaign,name:e.campaignType===he.Sms?t("sms_1_le_2_25252",i,s):t("e_mail_1_le_21805",i,s),campaignType:e.campaignType,state:ue.InProgress,sendToEveryone:!1,usersInfosIds:[o]}}},[e.campaignType,d.organization]);return(0,i.jsx)(Cl,{initialValues:c,render:n=>(0,i.jsxs)(xu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yj,{children:e.campaignType===he.Sms?t("envoi_d_un_sms_22148"):t("envoi_d_un_emai_99336")}),(0,i.jsx)(_u,{css:{padding:"$6"},children:e.campaignType===he.Email?(0,i.jsx)(ib,{canCustomDocuments:e.canCustomDocuments,customDocuments:d.organization?.event?.customDocuments??[],emailSenderId:d.organization?.event?.emailSender?.id??d.organization?.emailSenderId,emailsSenders:d.organization?.emailsSenders??[],form:n.form,values:n.values}):(0,i.jsx)(ob,{formRenderProps:n})}),(0,i.jsx)(Iu,{children:(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")}),(0,i.jsx)(El,{isLoading:n.submitting,onClick:n.handleSubmit,children:t("envoyer_26609")})]})})]}),onSubmit:async t=>{await l({organizationId:n,eventId:s,campaign:t.campaign}),e.onClose()}})},Az=e=>{const t=Yn(),n=qn(Yl),{mutate:s}=function(e={}){return Xn("mutation EmailUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $userInfoId: UsersInfoId!\n $email: UserEmail!\n) {\n emailUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n userInfoId: $userInfoId\n email: $email\n )\n}\n",e)}();return(0,i.jsx)(Jj,{buttonText:t("modifier_l_adre_94026"),icon:"pen",initialValues:{email:e.email},schema:n.emailSchema(),title:t("modification_de_69462"),onClose:e.onClose,onSubmit:async t=>{await s({email:t.email,eventId:e.eventId,organizationId:e.organizationId,userInfoId:e.userInfoId}),e.onClose(),e.onSuccess()},children:(0,i.jsx)(Ll,{label:t("adresse_e_mail_60930"),name:"email"})})},wz=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{hasFeature:o}=yI(),{event:r}=vb(),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",gap:"4",width:1,children:[(0,i.jsx)(Jg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:88}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(yr,{font:"gray800 textXl medium",children:e.userInfo.name}),(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("Email")}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(ic,{color:"white",cursor:"pointer",leftIcon:"at",rightIcon:"chevron-down",size:"md",children:e.userInfo.email})}),(0,i.jsxs)(qd,{placement:"bottom-start",children:[(0,i.jsx)(Gd,{icon:"copy",onClick:()=>{PS(e.userInfo.email)},children:t("copier_1_59210",e.userInfo.email)}),e.canEditEmail&&(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{l(!0)},children:t("modifier_1_38587",e.userInfo.email)}),(0,i.jsx)(Gd,{icon:"at",onClick:()=>c(!0),children:t("_crire_1_90053",e.userInfo.email)})]})]})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("t_l_phone_31755")}),m(e.userInfo.phone?.internationalFormat)?(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(ic,{color:"white",cursor:"pointer",leftIcon:"phone",rightIcon:"chevron-down",size:"md",children:e.userInfo.phone?.internationalFormat??"-"})}),(0,i.jsxs)(qd,{placement:"bottom-start",children:[(0,i.jsx)(Gd,{color:"default",icon:"copy",onClick:()=>PS(e.userInfo.phone.internationalFormat),children:t("copier_1_59210",e.userInfo.phone?.internationalFormat??"-")}),(0,i.jsx)(Ja,{to:{pathname:`tel:${e.userInfo.phone.internationalFormat.replaceAll(" ","")}`},children:(0,i.jsx)(Gd,{color:"default",icon:"phone",children:t("appeler_1_57163",e.userInfo.phone?.internationalFormat??"-")})}),o(Ne.Sms)&&(0,i.jsx)(Gd,{icon:"phone",onClick:()=>h(!0),children:t("_crire_1_90053",e.userInfo.phone?.internationalFormat??"-")})]})]}):(0,i.jsx)(yr,{color:"gray500",children:"-"})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:e.populationFieldName}),(0,i.jsx)(yr,{color:"gray500",children:m(e.userInfo.population)?e.userInfo.population:"-"})]}),e.assignmentState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("status_d_affect_75769")}),(0,i.jsx)(Na,{children:(0,i.jsx)(ic,{...fj(e.assignmentState),children:t(e.assignmentState)})})]})}),e.accreditationState&&(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("statut_d_accr_d_75527")}),(0,i.jsx)(Na,{children:(0,i.jsx)(ic,{...xj(e.accreditationState),children:t(e.accreditationState)})})]})})]})]})]}),a&&(0,i.jsx)(Az,{email:e.userInfo.email,eventId:s,organizationId:n,userInfoId:e.userInfo.id,onClose:()=>{l(!1)},onSuccess:e.reload}),d&&(0,i.jsx)(kz,{campaignType:he.Email,canCustomDocuments:!!s&&r?.useDocuments,onClose:()=>c(!1)}),u&&(0,i.jsx)(kz,{campaignType:he.Sms,canCustomDocuments:!1,onClose:()=>h(!1)})]})},Sz=()=>(0,i.jsxs)(Na,{gap:"4",width:1,children:[(0,i.jsx)(oc,{size:88,variant:"circular"}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"3",children:[(0,i.jsx)(oc,{borderRadius:"$1",height:28,width:200}),(0,i.jsx)(oc,{borderRadius:"$1",height:48,width:1})]})]}),Ez=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=_l(),a=qn(Kc),{mutate:l}=rr(),d=e.campaign.sentAt?.setZone(Us.c9.local().zone),c=(0,L.useMemo)(()=>e.campaign.campaignType===he.Email&&e.campaign.email?e.campaign.email.state:null,[e.campaign]),u=(0,L.useMemo)(()=>e.campaign.campaignType===he.Sms&&e.campaign.textMessage?e.campaign.textMessage.state:null,[e.campaign]);return(0,i.jsxs)(Dc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{t.push(SI.CAMPAIGN({organizationId:e.campaign.organizationId,eventId:e.campaign.eventId||void 0,campaignId:e.campaign.id}))},children:[(0,i.jsx)(Ec,{children:(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsx)(yr,{color:"gray800",children:e.campaign.name}),d&&(0,i.jsx)(yr,{color:"gray500",children:n("envoy_e_le_1_31494",a.toLocaleString(d,Js.DateOnly.MonthLong),a.toLocaleString(d,Js.TimeOnly))})]})}),(0,i.jsxs)(Ec,{width:150,children:[(0,i.jsx)(yr,{width:22,children:e.campaign.campaignType===he.Email?(0,i.jsx)(el,{icon:"at"}):(0,i.jsx)(el,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsxs)(Ec,{width:200,children:[c&&(0,i.jsx)(ic,{...hj(c),children:n(c)}),u&&(0,i.jsx)(ic,{...Cj(u),children:n(u)})]}),(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{css:{ellipsis:!0},children:e.campaign.event?.name??n("communaut_20896")})}),(0,i.jsx)(Yc,{justify:"end",children:(0,i.jsx)(Hc,{children:(0,i.jsx)(Gd,{icon:"paper-plane",onClick:async()=>{await l({organizationId:s,eventId:o,campaignId:e.campaign.id,selecteds:{ids:[r]}})},children:n("r_envoyer_90741")})})})]})},Tz=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=_l(),{data:s,isLoading:o,reload:r}=Zn("query UserHistoryCampaigns($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n campaigns {\n nodes {\n id\n organizationId\n eventId\n name\n campaignType\n sentAt\n\n event {\n name\n }\n\n email(userInfoId: $userInfoId) {\n state\n }\n\n textMessage(userInfoId: $userInfoId) {\n state\n }\n }\n }\n }\n }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(kc,{hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:e("nom_de_la_campa_45063")}),(0,i.jsx)(Vc,{width:150,children:e("type_35427")}),(0,i.jsx)(Vc,{width:200,children:e("status_06428")}),(0,i.jsx)(Vc,{children:e("_v_nement_22345")}),(0,i.jsx)(Vc,{width:100})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):s.organization.userInfo.campaigns.nodes.map(e=>(0,i.jsx)(Ez,{campaign:e,reload:r},e.id))]})},zz=e=>{const{translate:t}=_l(),n=qn(Kc),s=(0,L.useMemo)(()=>Object.values((0,ac.A)(e.vr.positionsSlotsUsersInfos,e=>e.position.id)).map(e=>{const t=e[0].position;return{id:t.id,text:m(t.acronym)?t.acronym:t.name,color:t.color,count:e.length,icon:t.icon}}),[e.vr]),o=(0,L.useMemo)(()=>Object.values((0,ac.A)(e.vr.accreditationsUsersInfos,e=>e.accreditation.id)).map(e=>{const t=e[0].accreditation;return{id:t.id,text:m(t.acronym)?t.acronym:t.name,color:t.color,count:e.length,icon:t.icon}}),[e.vr]);return(0,i.jsxs)(Dc,{children:[(0,i.jsxs)(Ec,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(yr,{children:e.vr.event.name}),(0,i.jsx)(yr,{color:"gray500",children:t("inscrit_le_1_12018",n.toLocaleString(e.vr.insertedAt.toLocal(),Js.DateTime))})]}),(0,i.jsx)(Ec,{children:(0,i.jsx)(Ty,{badges:s})}),(0,i.jsx)(Ec,{children:(0,i.jsx)(Ty,{badges:o})}),(0,i.jsx)(Ec,{children:e.vr.delegation&&(0,i.jsx)(ic,{ellipsis:!0,children:e.vr.delegation.name})})]})},Oz=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=_l(),{data:s,isLoading:o}=Zn("query UserHistoryEvents($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n volunteersRegistrations {\n id\n insertedAt\n\n delegation {\n name\n }\n\n event {\n id\n name\n }\n\n accreditationsUsersInfos {\n accreditation {\n id\n acronym\n color\n icon\n name\n }\n }\n\n positionsSlotsUsersInfos {\n position {\n id\n acronym\n color\n icon\n name\n }\n }\n }\n }\n }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(kc,{hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Vc,{children:e("missions_63972")}),(0,i.jsx)(Vc,{children:e("accr_ditations_39450")}),(0,i.jsx)(Vc,{children:e("Delegation")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):s.organization.userInfo.volunteersRegistrations.map(e=>(0,i.jsx)(zz,{vr:e},e.id))]})},Rz=e=>{const{translate:t}=_l(),n=qn(Kc);return(0,i.jsxs)(Dc,{children:[(0,i.jsxs)(Ec,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(yr,{children:e.fui.form.name}),(0,i.jsx)(yr,{color:"gray500",children:t("rempli_le_1_29292",n.toLocaleString(e.fui.insertedAt.toLocal(),Js.DateTime))})]}),(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{css:{ellipsis:!0},children:e.fui.event?.name??t("communaut_20896")})})]})},$z=()=>{const{translate:e,params:{organizationId:t,userInfoId:n}}=_l(),{data:s,isLoading:o}=Zn("query UserHistoryForms($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n formsUsersInfos {\n id\n insertedAt\n\n form {\n name\n }\n\n event {\n name\n }\n }\n }\n }\n}\n",{organizationId:t,userInfoId:n},[]);return(0,i.jsxs)(kc,{hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:"Nom du formulaire"}),(0,i.jsx)(Vc,{children:e("_v_nement_22345")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):s.organization.userInfo.formsUsersInfos.map(e=>(0,i.jsx)(Rz,{fui:e},e.id))]})},Dz=e=>{const t=qn(Kc),{organization:n}=yI(),s=(0,L.useMemo)(()=>Us.c9.fromISO(e.weezeventWebhook.data?.values?.validated)?.isValid?Us.c9.fromISO(e.weezeventWebhook.data?.values?.validated):e.weezeventWebhook.insertedAt,[e.weezeventWebhook]),o=e.weezeventWebhook.checklist?hg(n.weezeventOrganizationId,e.weezeventWebhook.checklist.id):"";return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(qc,{to:o,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.weezeventWebhook.checklist?.name??"-",width:1,children:e.weezeventWebhook.checklist?.name??"-"})})}),(0,i.jsx)(Ec,{children:t.toLocaleString(s,{...Js.DateTime,weekday:"long"})}),(0,i.jsx)(Ec,{children:e.weezeventWebhook.data?.values?.partner_name??"-"})]})},Pz=()=>{const{translate:e,params:{eventId:t,userInfoId:n}}=_l(),{data:s,isLoading:o}=Zn('query UserHistoryScans($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n weezeventWebhooks(type: "scan") {\n nodes {\n id\n data\n insertedAt\n\n checklist {\n id\n name\n }\n }\n }\n }\n }\n}\n',{eventId:t,userInfoId:n},[]);return(0,i.jsxs)(kc,{hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:e("liste_de_contr_79815")}),(0,i.jsx)(Vc,{children:e("Date")}),(0,i.jsx)(Vc,{children:e("op_rateur_30804")})]}),o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):s.event.volunteerRegistration.weezeventWebhooks.nodes.map(e=>(0,i.jsx)(Dz,{weezeventWebhook:e},e.id))]})},Fz=e=>{const{translate:t,params:n}=_l(),{event:s}=vb(),o={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"},r=s?.useCampaigns??!0,a=s?.useForms??!0,l=e.isEvent&&e.isWeezeventConnected;return(0,i.jsxs)(Na,{css:{background:"white",bd:!0,overflow:"hidden",paddingTop:"$5"},direction:"column",gap:"5",children:[(0,i.jsx)(yr,{css:{px:"$6"},font:"gray900 textMd semiBold",children:"Historique"}),(0,i.jsxs)(rj,{css:{flex:"1"},children:[(0,i.jsxs)(sj,{css:{px:"$6"},children:[(0,i.jsx)(ij,{path:qI.MEMBER_HISTORY_EVENTS(n),children:t("Event")}),r&&(0,i.jsx)(ij,{path:qI.MEMBER_HISTORY_CAMPAIGNS(n),children:t("Campaigns")}),a&&(0,i.jsx)(ij,{path:qI.MEMBER_HISTORY_FORMS(n),children:t("Form_plural")}),l&&(0,i.jsx)(ij,{path:qI.MEMBER_HISTORY_SCANS(n),children:"Scans"})]}),(0,i.jsx)(oj,{path:qI.MEMBER_HISTORY_EVENTS(o),children:(0,i.jsx)(Oz,{})}),r&&(0,i.jsx)(oj,{path:qI.MEMBER_HISTORY_CAMPAIGNS(o),children:(0,i.jsx)(Tz,{})}),a&&(0,i.jsx)(oj,{path:qI.MEMBER_HISTORY_FORMS(o),children:(0,i.jsx)($z,{})}),l&&(0,i.jsx)(oj,{path:qI.MEMBER_HISTORY_SCANS(o),children:(0,i.jsx)(Pz,{})})]})]})},Mz=e=>(0,i.jsx)(yr,{color:"gray800",css:{overflow:"hidden",textOverflow:"ellipsis",...e.css},fontSize:"textSm",fontWeight:"medium",children:e.children}),Nz=e=>(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(Mz,{children:e.field.name}),(0,i.jsx)(Iw,{field:e.field,fields:e.fields})]});function Lz(e,t){return{name:t("commentaire_r_12290"),slug:`form${e}`,fieldType:Ve.Textarea,values:[]}}const Bz=e=>{const{translate:t}=_l(),n=qn(Kc),[s,o]=(0,L.useState)(!0),r=(0,L.useCallback)(async()=>{const t=!s;o(t),await hI.forms.put({id:e.form.id,isOpenInUserOverlay:t})},[s,o]),a=(0,L.useMemo)(()=>e.form.elements.flatMap(e=>e.elementType===Ge.Field?[e.customField]:e.hasCondition&&e.conditionCustomField?[e.conditionCustomField]:[]),[e.form]),l=(0,L.useMemo)(()=>e.form.elements.filter(t=>t.elementType===Ge.Field?lC(t.customField,e.userInfo.fields,a):t.elementType===Ge.Section&&lC(t,e.userInfo.fields,a)),[a,e.form.elements,e.userInfo.fields]),d=e.canEdit&&!1!==e.form.isEditableInMemberSpace,c="all"!==e.form.id?Lz(e.form.id,t):null;return(0,L.useEffect)(()=>{(async()=>{o((await hI.forms.get(e.form.id))?.isOpenInUserOverlay??!0)})()},[]),(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$xs"},direction:"column",width:1,children:[(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer",padding:"$5 $6",userSelect:"none"},gap:"4",onClick:r,children:[(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:s?"chevron-up":"chevron-down"})}),(0,i.jsxs)(Na,{align:"start",css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{children:e.form.name}),e.showIsFilled?e.filledAt?(0,i.jsx)(ic,{color:"success",size:"sm",children:t("rempli_le_1_29292",n.toLocaleString(e.filledAt.toLocal(),Js.DateTime))}):(0,i.jsx)(ic,{color:"error",size:"sm",children:t("non_rempli_80877")}):null]}),d&&(0,i.jsx)(El,{color:"white",size:"sm",to:e.getEditUserFormPath(e.form.id),children:t("_diter_62574")})]}),s&&(0,i.jsxs)(Na,{css:{borderTop:"1px solid $gray200",padding:"$6"},direction:"column",children:[l.map((t,n)=>{switch(t.elementType){case Ge.Field:return(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Nz,{field:t.customField,fields:e.userInfo.fields}),n!==l.length-1&&(0,i.jsx)(qa,{height:"6"})]},t.id);case Ge.Section:return(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t.section}),n!==l.length-1&&(0,i.jsx)(qa,{height:"4"})]},t.id);case Ge.Text:return null;default:return rl(t.elementType)}}),c&&m(e.userInfo.fields[c.slug])&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t("inscription_en_49989")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Nz,{field:c,fields:e.userInfo.fields})]})]})]})};function Vz(e,t){switch(e){case Ve.Text:case Ve.Textarea:return"text";case Ve.Checkbox:return"square-check";case Ve.Validation:return"check";case Ve.Select:return"population"===t?"users":"list-ul";case Ve.Date:return"calendar";case Ve.Datetime:return"calendar-day";case Ve.Time:return"clock";case Ve.File:return"file";case Ve.Phone:return"phone";case Ve.Language:return"language";case Ve.Number:return"00";case Ve.Sex:return"venus-mars";case Ve.Nationality:case Ve.Country:return"flag";case Ve.Address:return"map-location";default:return rl()}}function Uz(e){return(0,lc.A)(Object.entries((0,ac.A)(e,e=>e.category.name)),([e])=>e).flatMap(([e,t])=>[{id:V(),elementType:Ge.Section,section:e,hasCondition:!1,conditionValue:!1}].concat(t.map(e=>({id:V(),elementType:Ge.Field,customField:e,hasCondition:!1,conditionValue:!1}))))}const Wz=e=>(0,i.jsxs)(Na,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(el,{icon:e.icon}),(0,i.jsx)(yr,{font:"gray900 textMd medium",children:e.title})]}),e.children]}),Gz=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l();return(0,i.jsx)(Wz,{icon:"people-group",title:n("d_l_gations_78318"),children:(0,i.jsx)(Na,{gap:"2",wrap:"wrap",children:e.delegations.map(e=>{const n=o?e.name:e.event?`${e.event.name} : ${e.name}`:e.name;return(0,i.jsx)(ic,{color:"white",cursor:"pointer",ellipsis:!0,size:"md",onClick:()=>{t.push(e.event?ds.DELEGATION({organizationId:s,eventId:e.event.id,delegationId:e.id}):$s.COMMUNITY_DELEGATION(s,e.id))},children:n},e.id)})})})},Hz=e=>{const{history:t,translate:n}=_l(),s=qn(Kc),[o,r]=(0,L.useState)(!1),a=(0,L.useMemo)(()=>e.customFields.filter(e=>e.isPrivate),[e.customFields]),l=(0,L.useMemo)(()=>no(e.profilePrivateFields)?e.profilePrivateFields:a.map(e=>e.slug),[a,e.profilePrivateFields]),d=(0,L.useMemo)(()=>(0,lc.A)(a.filter(t=>l.includes(t.slug)&&lC(t,e.userInfo.fields,e.customFields)),({slug:e})=>l.indexOf(e)),[e.customFields,a,l]),c=(0,L.useCallback)(async t=>{await e.profilePrivateFieldsUpdate(t),e.reload()},[e.profilePrivateFieldsUpdate,e.reload]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Wz,{icon:"lock-keyhole",title:n("informations_pr_15873"),children:[d.map(t=>(0,i.jsx)(Nz,{field:t,fields:e.userInfo.fields},t.slug)),(0,i.jsx)(yr,{css:{textTransform:"uppercase"},font:"gray500 textXs regular",children:n("inscrit_le_1_12018",s.toLocaleString(e.insertedAt.toLocal(),Js.DateTime))}),(0,i.jsx)(Bb,{rolesTypes:fI,children:(0,i.jsx)(KS,{color:"white",menu:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Gd,{icon:"gear",onClick:()=>{r(!0)},children:n("g_rer_les_champ_00431")})}),onClick:()=>t.push(e.getEditUserFormPath("private")),children:n("_diter_62574")})})]}),o&&(0,i.jsx)(Cu,{columns:a,css:{zIndex:"210"},initialSelectedColumns:l,saveButtonText:n("mettre_jour_85141"),searchPlaceholder:n("rechercher_un_c_86475"),subtitle:n("personnaliser_l_69296"),title:n("gestion_des_cha_66775"),onClose:()=>{r(!1)},onSave:c})]})},qz=e=>{const{translate:t}=_l();return(0,i.jsxs)(Na,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"3",children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(el,{icon:"users-viewfinder"}),(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("profils_li_s_03417")})]}),e.usersInfos.map(e=>(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(uj,{size:32,userInfo:e}),no(e.delegations)&&(0,i.jsx)(Na,{css:{paddingLeft:"44px"},gap:"2",wrap:"wrap",children:e.delegations.map(e=>(0,i.jsx)(ic,{color:"white",size:"md",children:e.name},e.id))})]},e.id))]})},Yz=({team:{organizationId:e,eventId:t,formId:n,teamCode:s,teamMembers:o}})=>{const r=Yn(),a=ag({organizationId:e,eventId:t,formId:n,teamCode:s}),{isLoading:l,copy:d}=FS(),c=(0,L.useCallback)(()=>{d(ag({organizationId:e,eventId:t,formId:n,teamCode:s}))},[e,t,n,s]);return(0,i.jsxs)(Wz,{icon:"user-group",title:(0,i.jsxs)(i.Fragment,{children:[r("_quipe_76857")," ",(0,i.jsxs)(Zm,{font:"gray500 textSm regular",children:["(",s,")"]})]}),children:[o.map(e=>(0,i.jsx)(uj,{size:32,userInfo:e},e.id)),(0,i.jsxs)(Na,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(Ja,{to:a,children:r("lien_d_invitati_45319")}),(0,i.jsx)(El,{color:"white",isLoading:l,rightIcon:"copy",size:"sm",onClick:c})]})]})},Kz=e=>{const{translate:t,params:{eventId:n}}=_l(),{isEventAdmin:s}=vb(),o=qn(Kc),{mutate:r}=function(e={}){return Xn("mutation VolunteerRegistrationTicketIdRegenerate(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n) {\n volunteerRegistrationTicketIdRegenerate(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n ) {\n id\n ticketId\n }\n}\n",e)}(),[a,l]=(0,L.useState)(!1),d=(0,L.useMemo)(()=>m(e.volunteerRegistration.weezevent.lastSynchronizedAt)&&Us.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt)?.isValid?o.toLocaleString(Us.c9.fromISO(e.volunteerRegistration.weezevent.lastSynchronizedAt).toLocal(),Js.DateTime):"-",[e.volunteerRegistration]),c=(0,L.useMemo)(()=>e.volunteerRegistration.weezeventPairedAt?.isValid?o.toLocaleString(e.volunteerRegistration.weezeventPairedAt.toLocal(),Js.DateTime):"-",[e.volunteerRegistration]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:"white",bd:!0,padding:"$5 $6"},direction:"column",gap:"4",width:1,children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(el,{icon:"memo-circle-info"}),(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("informations_22954")})]}),(0,i.jsxs)(Na,{align:"center",gap:"5",children:[(0,i.jsx)(Wy,{nameOrEmail:e.nameOrEmail,size:64,ticketId:e.volunteerRegistration.ticketId}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray500",children:t("TicketId")}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(ic,{color:"white",cursor:"pointer",leftIcon:"ticket",rightIcon:"chevron-down",size:"md",children:e.volunteerRegistration.ticketId})}),(0,i.jsxs)(qd,{placement:"bottom-start",children:[(0,i.jsx)(Gd,{icon:"copy",onClick:()=>{PS(e.volunteerRegistration.ticketId)},children:t("copier_75889")}),m(e.volunteerRegistration.weezeventTicketUrl)&&(0,i.jsx)(Ja,{to:e.volunteerRegistration.weezeventTicketUrl,children:(0,i.jsx)(Gd,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_97529")})}),m(e.volunteerRegistration.weezeventPayUrl)&&(0,i.jsx)(Ja,{to:e.volunteerRegistration.weezeventPayUrl,children:(0,i.jsx)(Gd,{icon:"arrow-up-right-from-square",children:t("ouvrir_dans_wee_14636")})}),s&&(0,i.jsx)(Gd,{icon:"repeat",onClick:()=>l(!0),children:t("r_g_n_rer_le_co_81294")})]})]})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray500",children:t("num_ro_de_puce_50039")}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:m(e.volunteerRegistration.shortTag)?e.volunteerRegistration.shortTag:"-"})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray500",children:t("derni_re_synchr_59823")}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:d})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray500",children:t("appair_le_70213")}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:c})]})]})]}),a&&(0,i.jsx)(sA,{buttonText:t("r_g_n_rer_37440"),subtext:[t("_tes_vous_s_r_d_57752"),t("cela_rendra_l_a_42228")],text:t("r_g_n_rer_le_co_81294"),onClose:()=>l(!1),onDelete:async()=>{await r({eventId:n,volunteerRegistrationId:e.volunteerRegistration.id}),e.reload()}})]})},Zz=e=>{const{translate:t,params:{eventId:n,userInfoId:s}}=_l(),{isOrganizationAdmin:o,organization:r}=yI(),{event:a,hasPermission:l}=vb(),d=n?a?.useForms&&l(Nb.MEMBER_EDIT):o,[c,u]=(0,L.useState)(""),[h,g]=(0,L.useState)(e.initialShowNotFilled),p=(0,L.useCallback)(t=>{g(t),e.setShowNotFilled(t)},[e.setShowNotFilled,g]),f=(0,L.useMemo)(()=>Object.fromEntries(e.formsUsersInfos.map(e=>[e.formId,e.insertedAt])),[e.formsUsersInfos]),x=(0,L.useMemo)(()=>(0,lc.A)(e.forms.filter(e=>!(!h&&void 0===f[e.id])&&(!m(c)||e.name.toLowerCase().includes(c.toLowerCase().trim()))),[e=>void 0!==f[e.id]?1:2,e=>e.name]),[e.forms,f,c,h]),_=(0,L.useMemo)(()=>no(e.delegations)&&(!n||a?.useDelegations),[a,n,e.delegations]),I=(0,L.useMemo)(()=>e.formsUsersInfos.filter(e=>m(e.teamCode)),[e.formsUsersInfos]),v=(0,L.useMemo)(()=>!no(I)||!n||a?.useForms,[I,n,a]),b=(0,L.useMemo)(()=>e.usersInfos.filter(e=>e.id!==s),[e.usersInfos,s]),j=(0,L.useMemo)(()=>Fy(e.userPermissions,t),[e.userPermissions,r]);return(0,i.jsxs)(Na,{gap:"6",width:1,children:[(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"4",children:[e.isWeezeventConnected&&e.volunteerRegistration&&(0,i.jsx)(Kz,{nameOrEmail:e.userInfo.nameOrEmail,reload:e.reload,volunteerRegistration:e.volunteerRegistration}),(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$4"},gap:"2",children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_f_28561"),value:c,onChange:u})}),(0,i.jsx)(gc,{state:h?"checked":"unchecked",onClick:e=>{p("checked"===e)},children:t("afficher_les_fo_84832")})]}),(0,i.jsx)(Na,{direction:"column",gap:"3",children:0===x.length?(0,i.jsx)(Na,{css:{background:"white",bd:!0},height:400,children:(0,i.jsx)(Nk,{button:(0,i.jsx)(Bb,{permissions:Nb.MEMBER_EDIT,children:(0,i.jsx)(El,{to:e.getEditUserFormPath("all"),children:t("_diter_les_cham_66020")})}),title:t("aucun_formulair_41857")})}):x.map(t=>(0,i.jsx)(Bz,{canEdit:d,filledAt:f[t.id],form:t,getEditUserFormPath:e.getEditUserFormPath,showIsFilled:"all"!==t.id,userInfo:e.userInfo},t.id))})]}),(0,i.jsxs)(Na,{direction:"column",gap:"4",width:348,children:[no(j)&&(0,i.jsx)(Wz,{icon:"shield",title:"Rôles",children:(0,i.jsx)(Na,{gap:"2",wrap:"wrap",children:j.map(e=>(0,i.jsx)(Sy,{badge:e},e.id))})}),no(b)&&(0,i.jsx)(qz,{usersInfos:b}),_&&(0,i.jsx)(Gz,{delegations:e.delegations}),v&&I.map((e,t)=>(0,i.jsx)(Yz,{team:e},t)),(0,i.jsx)(Hz,{customFields:e.customFields,getEditUserFormPath:e.getEditUserFormPath,insertedAt:e.insertedAt,profilePrivateFields:e.profilePrivateFields,profilePrivateFieldsUpdate:e.profilePrivateFieldsUpdate,reload:e.reload,userInfo:e.userInfo})]})]})},Xz=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Jn(),{localEvent:s,updateLocalEvent:o}=vb(),{mutate:r}=function(e={}){return Xn("mutation EventProfilePrivateFieldsUpdate(\n $eventId: EventId!\n $profilePrivateFields: [CustomFieldSlug!]!\n) {\n eventProfilePrivateFieldsUpdate(\n eventId: $eventId\n profilePrivateFields: $profilePrivateFields\n ) {\n id\n }\n}\n",e)}(),{data:a,loader:l,reload:d}=Zn("query UserInformationsEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n ...UserAllPermissions\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n ...FormUserInfoUserProfile\n }\n\n user {\n usersInfos(organizationId: $organizationId, eventId: $eventId) {\n id\n name\n email\n\n picture {\n url\n }\n\n delegations(level: Event) {\n id\n name\n }\n }\n }\n }\n }\n\n event(id: $eventId) {\n isWeezeventConnected\n profilePrivateFields\n\n forms {\n nodes {\n ...FormUserOverlay\n }\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n insertedAt\n shortTag\n ticketId\n weezevent\n weezeventPairedAt\n weezeventPayUrl\n weezeventTicketUrl\n\n delegation {\n ...DelegationUserProfile\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Ls.CustomFieldWithConditionFragment,Ls.UserInfoOverlayFragment,Ls.UserAllPermissionsFragment,Ls.FormUserInfoUserProfileFragment,Ls.FormUserOverlayFragment,Ls.DelegationUserProfileFragment]),c=(0,L.useMemo)(()=>(0,lc.A)(a.event?.forms.nodes??[],e=>e.name),[a.event]),u=(0,L.useMemo)(()=>(0,Ya.A)([a.event?.volunteerRegistration.delegation]),[a.event]);return l||(0,i.jsx)(Zz,{customFields:a.organization.customFields.nodes,delegations:u,forms:c,formsUsersInfos:a.organization?.userInfo.formsUsersInfos??[],getEditUserFormPath:i=>$s.EDIT_USER_FORM(e,t,n,i),initialShowNotFilled:s?.showNotFilled??!1,insertedAt:a.event.volunteerRegistration.insertedAt,isWeezeventConnected:a.event.isWeezeventConnected,profilePrivateFields:a.event.profilePrivateFields,profilePrivateFieldsUpdate:e=>r({eventId:t,profilePrivateFields:e}),reload:d,setShowNotFilled:e=>{o({showNotFilled:e})},userInfo:a.organization.userInfo,userPermissions:a.organization.userInfo,usersInfos:a.organization.userInfo.user.usersInfos,volunteerRegistration:a.event?.volunteerRegistration})},Jz=()=>{const{params:{organizationId:e,userInfoId:t},translate:n}=_l(),{localOrganization:s,updateLocalOrganization:o}=yI(),{mutate:r}=function(e={}){return Xn("mutation OrganizationProfilePrivateFieldsUpdate(\n $organizationId: OrganizationId!\n $profilePrivateFields: [CustomFieldSlug!]!\n) {\n organizationProfilePrivateFieldsUpdate(\n organizationId: $organizationId\n profilePrivateFields: $profilePrivateFields\n ) {\n id\n }\n}\n",e)}(),{data:a,loader:l,reload:d}=Zn("query UserInformationsOrganization(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n profilePrivateFields\n\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n\n category {\n name\n }\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...FormUserOverlay\n }\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n ...UserAllPermissions\n insertedAt\n\n delegations(level: Both) {\n ...DelegationUserProfile\n }\n\n formsUsersInfos(level: Organization) {\n ...FormUserInfoUserProfile\n }\n\n user {\n usersInfos(organizationId: $organizationId) {\n id\n name\n email\n\n picture {\n url\n }\n }\n }\n }\n }\n}\n",{organizationId:e,userInfoId:t},[Ls.CustomFieldWithConditionFragment,Ls.FormUserOverlayFragment,Ls.UserInfoOverlayFragment,Ls.UserAllPermissionsFragment,Ls.DelegationUserProfileFragment,Ls.FormUserInfoUserProfileFragment]),c=(0,L.useMemo)(()=>{if(a.organization){const e=Uz(a.organization.customFields.nodes),t={id:"all",name:n("tous_les_champs_57939"),elements:e};return(0,lc.A)(a.organization.forms.nodes,e=>e.name).concat([t])}return[]},[a.organization,n]);return l||(0,i.jsx)(Zz,{customFields:a.organization.customFields.nodes,delegations:a.organization.userInfo.delegations,forms:c,formsUsersInfos:a.organization?.userInfo.formsUsersInfos??[],getEditUserFormPath:n=>$s.COMMUNITY_EDIT_USER_FORM(e,t,n),initialShowNotFilled:s?.showNotFilled??!1,insertedAt:a.organization.userInfo.insertedAt,isWeezeventConnected:!1,profilePrivateFields:a.organization.profilePrivateFields,profilePrivateFieldsUpdate:t=>r({organizationId:e,profilePrivateFields:t}),reload:d,setShowNotFilled:e=>{o({showNotFilled:e})},userInfo:a.organization.userInfo,userPermissions:a.organization.userInfo,usersInfos:a.organization.userInfo.user.usersInfos,volunteerRegistration:null})},Qz=e=>{const{translate:t,params:{eventId:n}}=_l(),s=qn(hh),{mutate:o}=No(),r=(0,L.useMemo)(()=>Qs(),[]),[a,l]=(0,L.useState)(e.assignments.map(e=>({...e,checkInAt:e.checkInAt?.toLocal(),checkOutAt:e.checkOutAt?.toLocal()}))),d=(0,L.useMemo)(()=>a.every(e=>e.checkInAt?.isValid&&e.checkOutAt?.isValid&&e.checkOutAt>e.checkInAt||e.checkInAt?.isValid&&!e.checkOutAt?.isValid||!e.checkInAt?.isValid&&!e.checkOutAt?.isValid),[a]),c=(0,L.useCallback)((e,t,n)=>{l((0,pu.jM)(i=>{i.forEach(i=>{i.id===e&&(i[t]=n||void 0)})}))},[a,l]);return(0,i.jsx)(Rb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"sliders",children:t("mettre_jour_d_54198")}),(0,i.jsx)(Tb,{gap:"4",children:a.map(e=>(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsxs)(yr,{font:"gray800 textSm medium",children:[e.position.name," -"," ",(0,i.jsx)(Zm,{fontWeight:"regular",children:vh(s,e.positionSlot,"",{slot:{includeRange:!0}})})]}),(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsx)(Nu,{rightIcon:"xmark",value:e.checkInAt,zone:r,onChange:t=>{c(e.id,"checkInAt",t)},onRightIconClick:()=>{c(e.id,"checkInAt",null)}}),(0,i.jsx)(Nu,{rightIcon:"xmark",value:e.checkOutAt,zone:r,onChange:t=>{c(e.id,"checkOutAt",t)},onRightIconClick:()=>{c(e.id,"checkOutAt",null)}}),(0,i.jsx)(Nl,{shouldParseAsInt:!0,value:e.breakTime,onChange:t=>{c(e.id,"breakTime",t)}})]})]},e.id))}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{disabled:!d,onClick:async()=>{await Promise.all(a.map(e=>o({eventId:n,checkIn:{strategy:ge.CheckInOut,breakTime:e.breakTime,checkInAt:e.checkInAt,checkOutAt:e.checkOutAt,positionsSlotsUsersInfosIds:[e.id]}}))),e.onClose(),e.onSuccess()},children:t("mettre_jour_85141")})})]})})},eO=e=>{const{translate:t}=_l(),n=qn(hh),s=L.useMemo(()=>{const t=ec(e.psui.position.color);return{background:t[50],color:t[700]}},[e.psui]);return(0,i.jsx)(i.Fragment,{children:e.renderPosition((0,i.jsxs)(Na,{css:{...s,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsxs)(Na,{align:"center",css:{fontSize:"10px"},gap:"1",children:[(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[e.psui.positionSlot.name&&(0,i.jsx)(yr,{children:e.psui.positionSlot.name}),(0,i.jsx)(yr,{children:n.toDisplayString(e.psui.positionSlot.range,{hideDate:!0})})]}),e.psui.state===me.CheckedOut&&(0,i.jsx)(el,{icon:"stopwatch",title:t("d_pointer_25328")}),e.psui.state===me.CheckedIn&&(0,i.jsx)(el,{icon:"timer",title:t("pointer_80927")})]}),(0,i.jsx)(yr,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]}),e.psui.position.id)})},tO=e=>{const t=KA(),[n]=Ih(e.dayStartTime),s=L.useMemo(()=>dh(e.assignments.map(e=>({...e,range:e.positionSlot.range})),e.startAt,e.endAt,n),[e.assignments,e.startAt,e.endAt,n]);return(0,i.jsx)(QA,{css:e.featureFlags?.isV4?{bd:!0,overflow:"auto"}:{borderTop:"1px solid $gray200"},date:e.selectedDay,display:t?"week":"day",maxDate:e.endAt,minDate:e.startAt,children:s.map((t,s)=>(0,i.jsx)(JA,{endAt:t.range.start,startAt:t.range.start,startHour:n,children:(0,i.jsx)(eO,{psui:t,renderPosition:e.renderPosition,startHour:n})},s))})},nO=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{hasPermission:o}=fb(),r=qn(Kc),a=qn(ep),l=qn(hh),{mutate:d}=No(),c=(0,L.useMemo)(()=>vh(l,e.psui.positionSlot,"",{slot:{includeRange:!0}}),[e.psui]),u=o(Nb.MEMBER_ASSIGN),h=o(Nb.POSITION_READ,{positionCategoryId:e.psui.positionCategoryId,positionId:e.psui.position.id});return(0,i.jsxs)(Dc,{children:[(0,i.jsxs)(Ec,{align:"center",gap:"3",children:[(0,i.jsx)(FC,{color:e.psui.position.color,icon:e.psui.position.icon}),(0,i.jsxs)(Na,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(qc,{css:{overflow:"hidden",width:"100%","& > a":{width:"100%"}},to:ps.POSITION({organizationId:n,eventId:s,positionId:e.psui.position.id}),children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.psui.position.name,width:1,children:e.psui.position.name})}),(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0},title:c,width:1,children:c})]})]}),(0,i.jsx)(Ec,{children:e.psui.state===me.CheckedOut?(0,i.jsx)(ic,{leftIcon:"clock",children:t("temps_total_79448",a.minutesToHoursMinutesString(e.psui.timeDifferenceMinutes))}):e.psui.state===me.CheckedIn?(0,i.jsx)(ic,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("point_le_1_63576",r.toLocaleString(e.psui.checkInAt.toLocal(),Js.DateTime))}):(0,i.jsx)(ic,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("non_point_42145")})}),(0,i.jsx)(Ec,{children:e.psui.isAutoAssign&&(0,i.jsx)(yr,{color:"success700",fontSize:"textMd",children:(0,i.jsx)(el,{icon:"check"})})}),(0,i.jsxs)(Ec,{align:"start",direction:"column",justify:"center",children:[(0,i.jsx)(yr,{children:e.psui.createdBy?.name??"-"}),(0,i.jsx)(yr,{color:"gray500",children:r.toLocaleString(e.psui.insertedAt.toLocal(),Js.DateTime)})]}),(0,i.jsxs)(Yc,{justify:"end",width:200,children:[h&&(e.psui.state===me.Waiting?(0,i.jsx)(El,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.psui.eventId,checkIn:{strategy:ge.CheckIn,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:t("pointer_80927")}):e.psui.state===me.CheckedIn?(0,i.jsx)(El,{color:"white",size:"sm",onClick:async()=>{await d({eventId:e.psui.eventId,checkIn:{strategy:ge.CheckOut,positionsSlotsUsersInfosIds:[e.psui.id]}}),e.reload()},children:t("d_pointer_25328")}):null),(0,i.jsx)(Rk,{canCheckIn:h,canDelete:u,psui:e.psui,reloadCheckIn:e.reload,onDelete:e.reload})]})]})},iO=e=>{const{translate:t}=_l(),{hasPermission:n}=fb(),s=n(Nb.POSITION_READ),o=(0,L.useMemo)(()=>e.assignments.filter(t=>!e.selectedDay?.isValid||t.positionSlot.range.contains(e.selectedDay)||t.positionSlot.range.start.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()||t.positionSlot.range.end.startOf("day").toMillis()===e.selectedDay.startOf("day").toMillis()),[e.assignments,e.selectedDay]);return(0,i.jsxs)(kc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:t("Position")}),(0,i.jsx)(Vc,{children:t("statut_du_point_52451")}),(0,i.jsx)(Vc,{children:t("affect_e_automa_74071")}),(0,i.jsx)(Vc,{children:t("ajout_e_par_71330")}),s&&(0,i.jsx)(Vc,{width:200})]}),o.map(t=>(0,i.jsx)(nO,{psui:t,reload:e.reload},t.id))]})},sO=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=_l(),{isEventAdmin:r}=fb(),[a,l]=L.useState(L_(e.event.startAt,e.event.endAt)),[d,c]=L.useState(null),[u,h]=L.useState(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{as:"section",css:{background:"white",bd:!0,overflow:"hidden",padding:e.featureFlags?.isV4?"$6 $7 $7 $7":void 0},direction:"column",gap:e.featureFlags?.isV4?"6":void 0,justify:"center",children:[(0,i.jsxs)(Na,{align:"center",as:"header",css:{padding:e.featureFlags?.isV4?void 0:"$5 $6"},gap:"4",children:[(0,i.jsxs)(yr,{as:"hgroup",css:{flex:"1"},children:[(0,i.jsx)(ul,{textStyle:"heading",children:e.title}),e.subtitle&&(0,i.jsx)(cl,{textStyle:"subtitle",children:e.subtitle})]}),(0,i.jsxs)(Na,{as:"nav",gap:"3",children:["calendar"===e.positionsDisplay&&(0,i.jsx)(ZA,{max:e.event.endAt,min:e.event.startAt,value:a,onChange:l}),"list"===e.positionsDisplay&&!e.hideListView&&(0,i.jsx)(yr,{width:160,children:(0,i.jsx)(Du,{rightIcon:"xmark",value:d,onChange:c,onRightIconClick:()=>c(null)})}),!e.hideListView&&e.setPositionsDisplay&&(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{value:e.positionsDisplay,onChange:e.setPositionsDisplay,children:[(0,i.jsx)("option",{value:"calendar",children:o("Calendar")}),(0,i.jsx)("option",{value:"list",children:o("List")})]})}),r&&(0,i.jsx)(El,{to:$s.EDIT_ASSIGNMENT(t,n,s),children:o("_diter_les_affe_42283")}),r&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(qd,{placement:"bottom-end",children:(0,i.jsx)(Gd,{icon:"circle-check",onClick:()=>h(!0),children:o("mettre_jour_d_54198")})})]})]})]}),"calendar"===e.positionsDisplay?(0,i.jsx)(tO,{assignments:e.assignments,dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,featureFlags:e.featureFlags,renderPosition:e.renderPosition,selectedDay:a,startAt:e.event.startAt}):!e.hideListView&&(0,i.jsx)(iO,{assignments:e.assignments,reload:e.reload,selectedDay:d})]}),Qz&&(0,i.jsx)(Qz,{assignments:e.assignments,isOpen:u,onClose:()=>h(!1),onSuccess:()=>e.reload()})]})},oO=e=>{const[t,n]=xz("user.positions.display","calendar");return(0,i.jsx)(sO,{...e,positionsDisplay:t,setPositionsDisplay:n})},rO=e=>{const t=Yn(),n=qn(hh),{mutate:s,isLoading:o}=Xo(),r=m(e.slot.name)?`${e.slot.name} - ${n.toDisplayString(e.slot.range)}`:n.toDisplayString(e.slot.range);return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:e.slot.position.name}),(0,i.jsx)(Ec,{children:r}),(0,i.jsx)(Ec,{justify:"end",width:200,children:(0,i.jsx)(El,{color:"white",isLoading:o,size:"sm",onClick:async()=>{await s({eventId:e.eventId,massAssign:{strategy:tt.Add,selecteds:{ids:[e.userInfoId]},positionsSlotsIds:[e.slot.id]}}),e.reload()},children:t("affecter_94255")})})]})},aO=e=>{const{params:{eventId:t,userInfoId:n},translate:s}=_l(),[o,r,a]=Bc(""),[l,d]=(0,L.useState)(0),[c,u]=(0,L.useState)(null),h=(0,L.useCallback)(e=>{u(e),d(0)},[u,d]),{data:g,isLoading:p}=Zn("query UserPositionsAvailablePositionsSlots(\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $name: String\n $offset: Int\n $sort: PositionsSlotsSort\n) {\n event(id: $eventId) {\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n availablePositionsSlots(name: $name, limit: 25, offset: $offset, sort: $sort) {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n }\n}\n",{eventId:t,userInfoId:n,name:m(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:f,totalCount:x}=ku(g.event?.volunteerRegistration.availablePositionsSlots),_=g.event?.volunteerRegistration.availablePositionsSlots.nodes??[];return(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:s("rechercher_une_69998"),value:o,onChange:a})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{attribute:dt.Position,setSort:h,sort:c,children:s("nom_de_la_missi_64605")}),(0,i.jsx)(_m,{attribute:dt.Range,setSort:h,sort:c,children:s("cr_neau_11117")}),(0,i.jsx)(Vc,{width:200})]}),numberOfPages:f,offset:l,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):no(_)?_.map(n=>(0,i.jsx)(rO,{eventId:t,reload:e.reload,slot:n,userInfoId:e.userInfoId},n.id)):(0,i.jsx)(Dc,{css:{height:"200px"},children:(0,i.jsx)(Nk,{title:s("aucune_mission_03533")})}),setOffset:d,title:s("missions_dispon_68881"),totalCount:x})},lO=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=_l(),r=qn(hh),a=(0,L.useMemo)(()=>{const t=e.volunteerRegistration.preassignPositions.map(e=>({name:e.name,range:e.range?r.toDisplayString(e.range):"-",path:ps.POSITION({organizationId:n,eventId:s,positionId:e.id})})),i=e.volunteerRegistration.preassignPositionsCategories.map(e=>({name:e.name,range:e.range?r.toDisplayString(e.range):"-",path:ps.POSITION_CATEGORY({organizationId:n,eventId:s,positionCategoryId:e.id})}));return t.concat(i)},[e.volunteerRegistration]);return no(a)?(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:o("nom_de_la_missi_64605")}),(0,i.jsx)(Vc,{children:o("Date")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:a.map((e,n)=>(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{color:"gray900",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>{t.push(e.path)},children:e.name})}),(0,i.jsx)(Ec,{children:e.range})]},n))}),setOffset:Ql.A,title:o("pr_affectation_68999"),totalCount:0}):null},dO=e=>{const{translate:t}=_l(),n=qn(ep);return(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsxs)(Na,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(yr,{font:"gray500 textSm medium",children:t("nombre_d_heures_46954")}),(0,i.jsx)(yr,{font:"gray900 displaySm semiBold",children:n.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes)})]}),(0,i.jsxs)(Na,{css:{background:"white",bd:!0,padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(yr,{font:"gray500 textSm medium",children:t("nombre_de_missi_80367")}),(0,i.jsx)(yr,{font:"gray900 displaySm semiBold",children:e.numberOfAssignments})]})]})},cO=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=_l(),r=(0,L.useMemo)(()=>(0,lc.A)(e.event.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.event]);return(0,i.jsxs)(Na,{direction:"column",gap:"6",width:1,children:[no(r)&&(0,i.jsx)(oO,{assignments:r,event:e.event,reload:()=>{e.reload(),r.length<=1&&e.reloadHeader()},renderPosition:(e,s)=>(0,i.jsx)(Ja,{style:{width:"100%"},to:ps.POSITION({organizationId:t,eventId:n,positionId:s}),children:e}),subtitle:o("visualisez_tout_59046"),title:o("missions_affect_97811")}),(0,i.jsx)(lO,{volunteerRegistration:e.event.volunteerRegistration}),e.event.hasFormWithPositionDisplay&&(0,i.jsx)(Uk,{editPath:$s.EDIT_USER_MISSIONS(t,n,s),formsUsersInfos:e.organization.userInfo.formsUsersInfos}),(0,i.jsx)(Bb,{permissions:Nb.MEMBER_ASSIGN,children:(0,i.jsx)(aO,{reload:e.reload,userInfoId:s})}),no(r)&&(0,i.jsx)(dO,{numberOfAssignments:r.length,volunteerRegistration:e.event.volunteerRegistration})]})},uO=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s}}=_l(),{data:o,loader:r,reload:a}=Lo({organizationId:t,eventId:n,userInfoId:s});return r||(0,i.jsx)(cO,{event:o.event,organization:o.organization,reload:a,reloadHeader:e.reload})},hO=()=>{const{params:{organizationId:e,eventId:t,userInfoId:n}}=_l(),{data:s,loader:o}=Yo({organizationId:e,eventId:t,userInfoId:n}),{permissions:[r],isLoading:a}=ck(ok({eventId:t,userInfoId:n}));return o||a?o:(0,i.jsx)(i.Fragment,{children:s.event.hasFormWithSlotDisplay&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(eA,{editPath:$s.EDIT_USER_SLOTS(e,t,n),eventId:t,formsUsersInfos:s.organization.userInfo.formsUsersInfos,organizationId:e,showEditButton:r,userInfoId:n})})})},mO=e=>{const{params:t,translate:n}=_l(),{data:s,isLoading:o,reload:r}=Zn('query UserOverlay($organizationId: OrganizationId!, $eventId: EventId, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n populationField: customFieldBySlug(slug: "population") {\n name\n }\n\n event: eventMaybe(id: $eventId) {\n isWeezeventConnected\n }\n\n userInfo(id: $userInfoId) {\n ...UserInfoOverlay\n numberOfComments\n\n volunteerRegistration(eventId: $eventId) {\n state\n accreditationState\n }\n }\n }\n}\n',t,[Ls.UserInfoOverlayFragment]),a=(0,L.useMemo)(()=>s.organization?.userInfo.numberOfComments??0,[s.organization]),l={organizationId:":organizationId",eventId:e.isEvent?":eventId":void 0,userInfoId:":userInfoId"};Dd(s.organization?.userInfo?.nameOrEmail||"");const{params:{eventId:d,delegationId:c,organizationId:u,userInfoId:h}}=_l(),{permissions:[m,g],isLoading:p}=ck(ik({eventId:d,organizationId:u,userInfoId:h}),((...e)=>({name:"canEmailUpdateFn",args:e}))({delegationId:c,eventId:d,organizationId:u,userInfoId:h})),f=o||p;return(0,i.jsxs)(nj,{children:[(0,i.jsx)(tj,{hideBorder:!0,children:f?(0,i.jsx)(Sz,{}):(0,i.jsx)(wz,{accreditationState:s.organization?.userInfo.volunteerRegistration?.accreditationState,assignmentState:s.organization?.userInfo.volunteerRegistration?.state,canEditEmail:g,populationFieldName:s.organization?.populationField.name||"",reload:r,userInfo:s.organization.userInfo})}),(0,i.jsxs)(rj,{css:{flex:"1"},children:[(0,i.jsxs)(sj,{css:{px:"$7"},children:[(0,i.jsx)(ij,{path:qI.MEMBER_INFORMATION(t),children:n("informations_22954")}),e.showAvailabilities&&(0,i.jsx)(ij,{path:qI.MEMBER_AVAILABILITIES(t),children:n("disponibilit_s_49923")}),e.showPositions&&(0,i.jsx)(ij,{path:qI.MEMBER_POSITIONS(t),children:n("missions_63972")}),e.showAccreditations&&(0,i.jsx)(ij,{path:qI.MEMBER_ACCREDITATIONS(t),children:n("accr_ditations_39450")}),e.showActions&&(0,i.jsx)(ij,{path:qI.MEMBER_ACTIONS(t),children:n("actions_21689")}),m&&(0,i.jsx)(ij,{path:qI.MEMBER_COMMENTS(t),children:n("commentaires_97857",a)}),e.showHistory&&(0,i.jsx)(ij,{basePath:qI.MEMBER_HISTORY(t),path:qI.MEMBER_HISTORY_EVENTS(t),children:n("historique_06296")})]}),(0,i.jsx)(oj,{path:qI.MEMBER_INFORMATION(l),children:e.isEvent?(0,i.jsx)(ej,{children:(0,i.jsx)(Xz,{})}):(0,i.jsx)(ej,{children:(0,i.jsx)(Jz,{})})}),e.showAvailabilities&&(0,i.jsx)(oj,{path:qI.MEMBER_AVAILABILITIES(l),children:(0,i.jsx)(ej,{children:(0,i.jsx)(hO,{})})}),e.showPositions&&(0,i.jsx)(oj,{path:qI.MEMBER_POSITIONS(l),children:(0,i.jsx)(ej,{children:(0,i.jsx)(uO,{reload:r})})}),e.showAccreditations&&(0,i.jsx)(oj,{path:qI.MEMBER_ACCREDITATIONS(l),children:(0,i.jsx)(ej,{children:(0,i.jsx)(vz,{})})}),e.showActions&&(0,i.jsx)(oj,{path:qI.MEMBER_ACTIONS(l),children:e.isEvent?(0,i.jsx)(ej,{children:(0,i.jsx)(jz,{})}):(0,i.jsx)(ej,{children:(0,i.jsx)(yz,{})})}),m&&(0,i.jsx)(oj,{path:qI.MEMBER_COMMENTS(l),children:(0,i.jsx)(ej,{children:(0,i.jsx)(cz,{showEvent:!0})})}),e.showHistory&&(0,i.jsx)(oj,{path:qI.MEMBER_HISTORY(l),children:(0,i.jsx)(ej,{children:(0,i.jsx)(Fz,{isEvent:e.isEvent,isWeezeventConnected:s.organization?.event?.isWeezeventConnected??!1})})})]})]})},gO=()=>{const{isEventReader:e}=vb(),{canAccreditationRead:t,canDocumentRead:n,canMemberAccredit:s,canMemberAssign:o,canMemberAssignmentStateEdit:r,canMemberAvailabilitiesEdit:a,canMemberDelete:l,canPositionRead:d}=wS(),c=n||s||o||r||l,u=t||d||a,h=e;return(0,i.jsx)(mO,{isEvent:!0,showAccreditations:s,showActions:c,showAvailabilities:u,showHistory:h,showPositions:d})},pO=()=>(0,i.jsx)(mO,{isEvent:!1,showAccreditations:!1,showActions:!0,showAvailabilities:!1,showHistory:!0,showPositions:!1});var fO=n(6301);function xO(e=[]){const t=String.fromCharCode(65+(0,fO.A)(25));return!1===e.includes(t)?t:xO(e)}function _O(e=[]){const t=(0,fO.A)(9);return!1===e.includes(t)?t:_O(e)}const IO=["Q","O","I","L"],vO=[0,1];function bO(e=10){const t=(0,Oc.A)(0,e-1).map(()=>{return e=IO,t=vO,0===(0,fO.A)(1)?xO(e):_O(t).toString();var e,t}).join("");return`${xO(IO)}${t}`}const jO=e=>{const t=Yn(),n=`formKeyToTeamCode.f${e.form.id}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{font:"gray900 textLg medium",children:"Équipe"}),(0,i.jsx)(Ku,{height:"4"}),(0,i.jsx)(Ll,{hint:t("d_finissez_votr_19710"),label:t("code_quipe_14296"),name:n,rightIcon:"arrows-rotate",onRightIconClick:()=>{e.change(n,bO())}}),(0,i.jsx)(qa,{height:"9"})]})},CO=e=>{const{history:t,params:{eventId:n},translate:s}=_l(),o=L.useMemo(()=>(0,lc.A)(e.forms,e=>e.name.toLowerCase()),[e.forms]);return(0,i.jsxs)(Na,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsxs)(Na,{align:"center",css:{margin:"auto",overflowY:"auto"},direction:"column",height:1,width:1,children:[e.banner,(0,i.jsxs)(Na,{css:{padding:"$6 $4",width:"100%","@tablet":{padding:"$6 $8"},"@desktop":{padding:"$7",width:n?"100%":"$container"}},direction:"column",children:[(0,i.jsx)(yr,{font:"gray900 displayXs semiBold",children:e.title}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(rj,{children:[(0,i.jsxs)(sj,{children:[o.map(t=>(0,i.jsx)(ij,{path:e.getTabPath(t.id),children:t.name},t.id)),e.extraTabs]}),e.children]})]})]})}),(0,i.jsx)(Na,{css:{boxShadow:"0px 0px 0px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.04), 0px 4px 16px rgba(0, 0, 0, 0.08)",padding:"$4 $7"},justify:"center",children:(0,i.jsxs)(Na,{align:"center",css:{width:"100%","@desktop":{width:n?"100%":"$container"}},gap:"4",children:[(0,i.jsx)(El,{isLoading:e.isLoading,onClick:e.handleSubmit,children:s("mettre_jour_85141")}),(0,i.jsx)(yr,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:()=>t.goBack(e.returnPathFallback),children:s("annuler_48254")})]})})]})},yO=({banner:e,change:t,customFields:n,formIdToInsertedAt:s,forms:o,getEditUserFormPath:r,handleSubmit:a,isLoading:l,returnPathFallback:d,showAllAndPrivate:c,showIsFilled:u,userInfo:h,values:m})=>{const{translate:g,params:{organizationId:p}}=_l(),f=qn(Kc),x=L.useMemo(()=>n.filter(e=>e.isPrivate).map(e=>({id:V(),elementType:Ge.Field,customField:e,hasCondition:!1,conditionValue:!1})),[n]),_=L.useMemo(()=>Uz(n),[n]),I=L.useCallback((e,t)=>(0,i.jsxs)(i.Fragment,{children:[0!==t&&(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",children:e}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Yu,{direction:"horizontal"})]}),[]);return(0,i.jsxs)(CO,{banner:e,extraTabs:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ij,{path:r("all"),children:g("tous_les_champs_57939")}),(0,i.jsx)(ij,{path:r("private"),children:g("champs_priv_s_84670")})]}):void 0,forms:o,getTabPath:r,handleSubmit:a,isLoading:l,returnPathFallback:d,title:g("mise_jour_de_17055",h.nameOrEmail),children:[o.map(e=>{const n=s[e.id];return(0,i.jsxs)(oj,{path:r(e.id),children:[(0,i.jsx)(qa,{height:"7"}),u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"4",children:[(0,i.jsx)(yr,{css:{flex:"1"},font:"gray800 textMd semiBold",children:g("statut_du_formu_08195")}),(0,i.jsx)(yr,{width:320,children:(0,i.jsxs)(zu,{shouldParseAsBoolean:!0,state:n?"disabled":"active",value:m.filledFormsIds.includes(e.id),onChange:n=>{t("filledFormsIds",so(m.filledFormsIds,e.id,n))},children:[(0,i.jsx)("option",{value:"true",children:n?g("rempli_le_1_29292",f.toLocaleString(n,Js.DateTime)):g("rempli_78674")}),(0,i.jsx)("option",{value:"false",children:g("non_rempli_80877")})]})})]}),(0,i.jsx)(qa,{height:"6"}),e.areTeamsAllowed&&(0,i.jsx)(jO,{change:t,form:e})]}),(0,i.jsx)(vT,{change:t,elements:e.elements,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]},e.id)}),c&&(0,i.jsxs)(oj,{path:r("all"),children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(vT,{change:t,elements:_,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]}),c&&(0,i.jsxs)(oj,{path:r("private"),children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(vT,{change:t,elements:x,organizationId:p,prefix:"userInfo.fields.",renderSection:I,values:m.userInfo.fields})]})]})},kO=[Ve.Address,Ve.Text,Ve.Textarea,Ve.Time],AO=({banner:e,customFields:t,country:n,formIdToInsertedAt:s,formIdToTeamCode:o,forms:r,from:a,getEditUserFormPath:l,showAllAndPrivate:d,showIsFilled:c,userInfo:u})=>{const{organizationId:h,eventId:m,delegationId:g}=Jn(),p=Qn(),f=qn(pT),{mutate:x,isLoading:_}=function(e={}){return Xn("mutation UserInfoUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $delegationId: DelegationId\n $userId: UserId!\n $userInfo: UsersInfoInput!\n $filledFormsIds: [FormId!]\n $formKeyToTeamCode: JSON\n) {\n userInfoUpdate(\n organizationId: $organizationId\n eventId: $eventId\n delegationId: $delegationId\n userId: $userId\n userInfo: $userInfo\n filledFormsIds: $filledFormsIds\n formKeyToTeamCode: $formKeyToTeamCode\n ) {\n id\n }\n}\n",e)}(),I=L.useMemo(()=>Object.keys(s).map(e=>parseInt(e,10)),[s]),v=L.useMemo(()=>Object.fromEntries(Object.entries(o).map(([e,t])=>[`f${e}`,t])),[o]);return(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:{filledFormsIds:I,formKeyToTeamCode:v,userInfo:f.userInfoUpdateInputDefault(u,t,{checkboxDefaultEmpty:!0,countryCode:n})},render:({form:n,handleSubmit:o,values:p})=>(0,i.jsx)(yO,{banner:e,change:n.change,customFields:t,formIdToInsertedAt:s,forms:r,getEditUserFormPath:l,handleSubmit:o,isLoading:_,returnPathFallback:"app"===a?m?$s.VOLUNTEERS(h,m):yi.COMMUNITY_USERS({organizationId:h}):g?ds.DELEGATION_MEMBERS({organizationId:h,eventId:m,delegationId:g}):qI.MEMBER({organizationId:h,eventId:m,userInfoId:u.id}),showAllAndPrivate:d,showIsFilled:c,userInfo:u,values:p}),width:1,onSubmit:async e=>{const n=e.userInfo.fields;t.forEach(e=>{kO.includes(e.fieldType)&&!n[e.slug]?n[e.slug]="":e.fieldType!==Ve.File||n[e.slug]||(n[e.slug]=null)}),await x({organizationId:h,eventId:m,userId:u.userId,userInfo:{id:u.id,fields:e.userInfo.fields},filledFormsIds:c?e.filledFormsIds:void 0,formKeyToTeamCode:e.formKeyToTeamCode}),p.goBack("app"===a?$s.VOLUNTEERS(h,m):qI.MEMBER({organizationId:h,eventId:m,userInfoId:u.id}))}})},wO=({country:e,data:t,forms:n,getEditFormPath:s})=>{const{params:{organizationId:o,eventId:r,delegationId:a,userInfoId:l}}=_l(),d=(0,L.useMemo)(()=>t.organization?.userInfo.formsUsersInfos??[],[t.organization]),c=(0,L.useMemo)(()=>d.map(e=>e.formId),[d]),u=(0,L.useMemo)(()=>Object.fromEntries(d.map(e=>[e.formId,e.insertedAt])),[d]),h=(0,L.useMemo)(()=>r?Object.fromEntries(d.map(e=>[e.formId,e.teamCode])):{},[r,d]);return(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:[$s.EDIT_USER_FORM(":organizationId",":eventId",":userInfoId",":formId"),$s.EDIT_USER_DELEGATION_FORM(":organizationId",":eventId",":delegationId",":userInfoId",":formId"),$s.COMMUNITY_EDIT_USER_FORM(":organizationId",":userInfoId",":formId"),$s.COMMUNITY_EDIT_USER_DELEGATION_FORM(":organizationId",":delegationId",":userInfoId",":formId")],children:(0,i.jsx)(AO,{country:e,customFields:t.organization.customFields.nodes,formIdToInsertedAt:u,formIdToTeamCode:h,forms:n,from:"app",getEditUserFormPath:s,showAllAndPrivate:!0,showIsFilled:!0,userInfo:t.organization.userInfo})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:r?a?$s.EDIT_USER_DELEGATION_FORM(o,r,a,l,n.length>0?n[0].id:"all"):$s.EDIT_USER_FORM(o,r,l,c?.[0]??"all"):a?$s.COMMUNITY_EDIT_USER_DELEGATION_FORM(o,a,l,n.length>0?n[0].id:"all"):$s.COMMUNITY_EDIT_USER_FORM(o,l,c?.[0]??"all"),replace:!0})})]})},SO=()=>{const{params:{organizationId:e,eventId:t,delegationId:n,userInfoId:s}}=_l(),o=Qn(),{data:r,loader:a}=Zn("query UpdateUserInfosEvent(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n\n category {\n name\n }\n }\n }\n\n userInfo(id: $userInfoId) {\n id\n isEditable\n userId\n email\n nameOrEmail\n fields\n\n formsUsersInfos(level: Event, eventId: $eventId) {\n formId\n insertedAt\n teamCode\n }\n }\n }\n\n event(id: $eventId) {\n country\n\n forms {\n nodes {\n ...UpdateUserForm\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:s},[Ls.CustomFieldWithConditionFragment,Ls.UpdateUserFormFragment]);return a||(r.organization.userInfo.isEditable??1)||o.push($s.DASHBOARD(e,t)),a||(0,i.jsx)(wO,{country:r.event.country,data:r,forms:n?r.event.forms.nodes.filter(e=>no(e.delegationsIds)&&e.delegationsIds.includes(n)):r.event.forms.nodes,getEditFormPath:i=>n?$s.EDIT_USER_DELEGATION_FORM(e,t,n,s,i):$s.EDIT_USER_FORM(e,t,s,i)})},EO=()=>{const{organizationId:e,delegationId:t,userInfoId:n}=Jn(),{data:s,loader:o}=Zn("query UpdateUserInfosOrganization($organizationId: OrganizationId!, $userInfoId: UsersInfoId!) {\n organization(id: $organizationId) {\n country\n\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n\n category {\n name\n }\n }\n }\n\n forms(level: Organization) {\n nodes {\n ...UpdateUserForm\n }\n }\n\n userInfo(id: $userInfoId) {\n id\n userId\n email\n nameOrEmail\n fields\n\n formsUsersInfos(level: Organization) {\n formId\n insertedAt\n teamCode\n }\n }\n }\n}\n",{organizationId:e,userInfoId:n},[Ls.CustomFieldWithConditionFragment,Ls.UpdateUserFormFragment]);return o||(0,i.jsx)(wO,{country:s.organization.country,data:s,forms:t?s.organization.forms.nodes.filter(e=>no(e.delegationsIds)&&e.delegationsIds.includes(t)):s.organization.forms.nodes,getEditFormPath:i=>t?$s.COMMUNITY_EDIT_USER_DELEGATION_FORM(e,t,n,i):$s.COMMUNITY_EDIT_USER_FORM(e,n,i)})};var TO;let zO=class extends Ul{static{TO=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={Id:"id"};static IMPORT_COLUMNS_REQUIRED=e=>e===Ze.Update?[TO.IMPORT_COLUMNS_DEFAULT.Id]:[];constructor(e,t){super(t),this.csvInputService=e}default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mode:Ze.Upsert}}}schema(){return d.Ik().shape({input:d.Ik().shape({csv:this.csvInputService.schema(),mode:d.Yj().oneOf(fn,this.t("le_mode_d_impor_75706"))})})}};zO=TO=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Ov,Wn])],zO);let OO=class extends zO{csvInputService;default(e){return{input:{csv:this.csvInputService.csvDocumentInputDefault(e),mappings:[],presets:[],mode:Ze.Upsert,tag:""}}}schema(){return d.Ik().shape({input:d.Ik().shape({csv:this.csvInputService.schema(),mappings:d.YO().of(d.Yj().nullable()),presets:d.YO().of(d.Ik().shape({customFieldId:d.ai().positive(this.t("le_choix_du_typ_07079")),value:d.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:d.Yj().oneOf(fn,this.t("le_mode_d_impor_75706")),tag:d.Yj().required("a_tag_must_be_s_23274")})})}settingsStepSchema(){return d.Ik().shape({input:d.Ik().shape({csv:this.csvInputService.schema()})})}mappingStepSchema(){return d.Ik().shape({input:d.Ik().shape({mappings:d.YO().of(d.Yj().nullable()),presets:d.YO().of(d.Ik().shape({customFieldId:d.ai().positive(this.t("le_choix_du_typ_07079")),value:d.gl().when("customFieldId",{is:e=>e>-1,then:e=>e.required(this.t("la_valeur_du_ch_65599"))})})),mode:d.Yj().oneOf(fn,this.t("le_mode_d_impor_75706")),tag:d.Yj().required("a_tag_must_be_s_23274")})})}constructor(e,t){super(e,t),this.csvInputService=e}};OO=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Ov,Wn])],OO);var RO=n(6632);const $O=e=>{const{params:{organizationId:t},translate:n}=_l(),{data:s,loader:o}=Mo({organizationId:t}),r=Ga(),a=(0,L.useMemo)(()=>e.formRenderProps.values.input.csv.file,[e.formRenderProps.values.input.csv]),l=(0,L.useMemo)(()=>{const t=localStorage.getItem(Bl[`${e.localStorageKeyPrefix}_FORMATS`]);return t?JSON.parse(t):t},[e.localStorageKeyPrefix]),d=(0,L.useMemo)(()=>{const t=t=>e.formRenderProps.values.input.csv.formats?.[t]===s.organization?.[t]?(0,i.jsx)(ic,{css:{textTransform:"uppercase"},children:n("from_organisati_25675")}):l?.[t]===e.formRenderProps.values.input.csv.formats?.[t]&&(0,i.jsx)(ic,{css:{textTransform:"uppercase"},children:n("from_saved_22150")});return{datetime:t("datetimeFormat"),date:t("dateFormat"),timeBadge:t("timeFormat")}},[s.organization,l,e.formRenderProps.values.input.csv.formats]),c=Kn(),u="data:text/csv;charset=utf-8,"+[Object.values(e.ImportInputService.IMPORT_COLUMNS_DEFAULT).filter(t=>t!==e.ImportInputService.IMPORT_COLUMNS_DEFAULT.Id),new Array(Object.values(e.ImportInputService.IMPORT_COLUMNS_DEFAULT).length-1)].map(e=>e.join(",")).join("\n");return o||(0,i.jsxs)(Na,{direction:"column",gap:"8",children:[(0,i.jsx)(TE,{css:{"& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},heading:n("choix_du_fichie_30517"),subtitle:[...c(n("s_lectionnez_vo_53506","{1}"),(0,i.jsx)(El,{color:"invisible",css:{padding:0},onClick:()=>{const e=encodeURI(u);window.open(e)},children:n("t_l_charger_un_46976")}))],children:(0,i.jsx)(Vj,{...r,accept:Rv.Csv,acl:"private",organizationId:t,prefix:"input.csv.",withFileField:!0,onChange:t=>e.onChange(t,e.formRenderProps)})}),(0,i.jsxs)(TE,{heading:n("param_tres_du_f_01675"),isOpenToggleLabel:n("afficher_les_pa_96893"),subtitle:n("personnaliser_s_29361"),children:[(0,i.jsxs)(zE,{heading:n("type_de_carat_r_62356"),children:[(0,i.jsx)(Ll,{hint:n("laissez_ce_cham_07837"),label:n("d_limitateur_77701"),name:"input.csv.delimiter",state:a?"disabled":void 0}),(0,i.jsx)(Ll,{hint:n("leave_blank_if_02058"),label:n("caract_re_d_ch_56847"),name:"input.csv.quoteChar",state:a?"disabled":void 0}),(0,i.jsxs)(Hj,{hint:n("leave_blank_if_02058"),label:n("caract_re_de_re_71491"),name:"input.csv.newline",state:a?"disabled":void 0,children:[(0,i.jsx)("option",{value:void 0,children:"Auto-detect"}),(0,i.jsx)("option",{value:"\r",children:"\\r"}),(0,i.jsx)("option",{value:"\n",children:"\\n"}),(0,i.jsx)("option",{value:"\r\n",children:"\\r\\n"})]})]}),(0,i.jsxs)(zE,{heading:n("type_de_format_68432"),children:[(0,i.jsx)(Ll,{label:(0,i.jsxs)(Na,{align:"center",gap:"2",children:[n("format_d_heure_46798"),d.timeBadge]}),name:"input.csv.formats.timeFormat",state:a?"disabled":void 0}),(0,i.jsx)(Ll,{label:(0,i.jsxs)(Na,{align:"center",gap:"2",children:[n("format_de_date_82059"),d.date]}),name:"input.csv.formats.dateFormat",state:a?"disabled":void 0}),(0,i.jsx)(Ll,{label:(0,i.jsxs)(Na,{align:"center",gap:"2",children:[n("format_de_date_24474"),d.datetime]}),name:"input.csv.formats.datetimeFormat",state:a?"disabled":void 0})]})]})]})},DO=pr("input",{blockSize:"fit-content",inlineSize:"fit-content"}),PO=(0,L.forwardRef)((e,t)=>(0,i.jsx)(DO,{ref:t,type:"radio",...e}));PO.displayName="Radio";const FO=({children:e,css:t,icon:n,subtext:s,...o})=>{const{inputId:r,descId:a,labelId:l}=Ga(),d=(0,L.useRef)(null);return(0,i.jsx)(Na,{css:{bd:!0,flexGrow:"1",margin:"-1px",cursor:"pointer",'&:has( input[type="radio"]:checked)':{border:"2px solid $primary500"},...t},onClick:()=>d.current?.click(),children:(0,i.jsx)(Na,{css:{border:"1px solid transparent",padding:"$4",'&:has( input[type="radio"]:checked)':{border:"none"}},children:(0,i.jsxs)(Na,{gap:"1",children:[(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(Na,{css:{bd:!0,border:"1px solid $gray200",inlineSize:"fit-content"},justify:"start",children:(0,i.jsx)(FC,{css:{color:"$gray800",background:"unset"},icon:n})}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(Pl,{htmlFor:r,id:l,children:(0,i.jsx)(cl,{css:{fontSize:"$textSm",fontWeight:"$medium"},children:e})}),s&&(0,i.jsx)(cl,{id:a,children:s})]}),(0,i.jsx)(Na,{css:{flex:"1"}})]}),(0,i.jsx)(PO,{ref:d,"aria-describedby":a,"aria-labelledby":l,id:r,...o})]})})})},MO=({name:e,value:t,...n})=>(0,i.jsx)(Ua.D0,{name:e,render:({input:e})=>(0,i.jsx)(FO,{checked:e.checked,name:e.name,value:t,onChange:e.onChange,...n,children:n.children}),type:"radio",value:t}),NO=e=>{const t=Yn(),n=(0,L.useMemo)(()=>[{id:-1,name:t("default_fields_04920"),fields:Object.entries(e.defaultFields).map(([e,n])=>({name:m(t(e))?t(e):e,slug:n,id:Math.random()}))},...e.categories].map(t=>({...t,fields:(0,lc.A)(t.fields,t=>{const n=t.name.toLowerCase(),i=t.slug.toLowerCase(),s=e.column.name.toLowerCase(),o=Math.min(_(n,s),_(i,s));return o{const s=Object.values(e.defaultFields).find(e=>e===t);return s&&e.requiredFieldSlugs.includes(s)?(0,i.jsx)("strong",{children:n}):n},[e.defaultFields,e.requiredFieldSlugs]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Nl,{state:"disabled",value:e.column.name,onChange:()=>{}}),(0,i.jsx)(el,{icon:"arrow-right"}),(0,i.jsx)(Um,{isSearchVisible:!0,multiple:!1,name:`input.mappings.${e.column.index}`,placeholder:t("s_lectionnez_un_12007"),renderValue:s,children:n.map(t=>(0,i.jsx)("optgroup",{label:t.name,children:t.fields.map(t=>(0,i.jsx)("option",{style:{fontWeight:e.requiredFieldSlugs.includes(t.slug)?"bold":"inherit",opacity:e.values.includes(t.slug)?.5:1},value:t.slug,children:t.name},t.id))},t.id))})]})},LO=pr("div",{display:"grid",gridTemplateColumns:"[column] 1fr auto [field] 1fr",gap:"$4 $5",alignItems:"center"}),BO=pr("div",{color:"$gray800",gridColumn:"column",fontWeight:"$medium"}),VO=pr("div",{color:"$gray800",gridColumn:"field",fontWeight:"$medium"}),UO=({categories:e,columns:t,defaultFields:n,requiredFieldSlugs:s,values:o})=>{const r=Yn();return(0,i.jsxs)(LO,{children:[(0,i.jsx)(BO,{children:r("titres_de_vos_c_31388")}),(0,i.jsx)(VO,{children:r("champs_de_formu_64126")}),t.map((t,r)=>(0,i.jsx)(NO,{categories:e,column:{name:t,index:r},defaultFields:n,requiredFieldSlugs:s,values:o},r))]})},WO=e=>{const{translate:t}=_l(),{formRenderProps:{values:{input:{mappings:n}}}}=(0,L.useContext)(Ha),s=(0,L.useMemo)(()=>Object.entries(e.defaultFields).filter(([t,i])=>e.requiredFieldSlugs.includes(i)&&!n.includes(i)).map(([e,n])=>m(t(e))?t(e):e),[e.defaultFields,e.requiredFieldSlugs,n]),o=Kn();return(0,i.jsxs)(TE,{css:{"& > header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},gap:"5",heading:t("donn_es_de_mapp_98874"),subtitle:t("s_lectionnez_le_13978"),children:[no(s)&&(0,i.jsxs)(hl,{alertStyle:"warning",children:[(0,i.jsx)(ml,{children:t("champ_obligatoi_11498",s.length)}),(0,i.jsx)(gl,{children:[...o(t("to_add_a_1_t_07022",e.itemName?.singular,"{2}"),(0,i.jsx)("ul",{style:{margin:"0",paddingInlineStart:"var(--space-4)"},children:s.map(e=>(0,i.jsx)("li",{children:e},e))}))]})]}),(0,i.jsx)(UO,{...e})]})},GO=({file:e,onToggle:t,...n})=>{const s=Yn();return(0,i.jsx)(TE,{heading:s("attribution_d_u_50979"),isOpen:no(n.values)??!1,isOpenToggleLabel:s("attribuer_autom_74319"),subtitle:s("d_finissez_dire_31742"),children:(0,i.jsx)(zE,{heading:s("liste_des_champ_94862"),children:(0,i.jsx)(Zj,{name:"input.presets",...n})})})},HO=(e,t)=>{switch(t.type){case"LOADING":return{isLoading:!0,columns:void 0,errors:void 0};case"SUCCESS":return{isLoading:!1,columns:t.columns,errors:void 0};case"ERROR":return{isLoading:!1,columns:void 0,errors:t.errors}}};function qO(e){const{translate:t}=_l(),{isLoading:n,columns:s,errors:o}=((e,t)=>{const[n,i]=(0,L.useReducer)(HO,{isLoading:!0,columns:void 0,errors:void 0});return(0,L.useEffect)(()=>{i({type:"LOADING"}),(0,Ev.parse)(e,{preview:1,...t,complete:({data:e,errors:t})=>{t.filter(e=>"UndetectableDelimiter"!==e.code).length?i({type:"ERROR",errors:t}):i({type:"SUCCESS",columns:e[0]})}})},[e]),n})(e.file,{delimiter:e.values.input.csv.delimiter??void 0,quoteChar:e.values.input.csv.quoteChar??void 0,newline:e.values.input.csv.newline??void 0}),r=(0,L.useMemo)(()=>{const t=Object.entries((0,ac.A)(e.customFields,e=>e.customFieldCategoryId)).map(([e,t])=>{const n=t[0];return{id:n.customFieldCategoryId,name:n.customFieldCategoryName,fields:t}});return e.additionalCategories?t.concat(e.additionalCategories):t},[e.additionalCategories,e.customFields]);return n||o?null:(0,i.jsxs)(i.Fragment,{children:[e.additionalOptions&&(0,i.jsx)(TE,{heading:t("param_tres_d_im_18876"),children:e.additionalOptions}),(0,i.jsx)(WO,{categories:r,columns:s,defaultFields:e.defaultFields,itemName:e.itemName,modeSelection:e.modeSelection,requiredFieldSlugs:e.requiredFieldSlugs,values:e.values.input.mappings}),no(e.customFields)&&(0,i.jsx)(GO,{change:e.form.change,customFields:e.customFields,file:e.file,values:e.values.input.presets,onToggle:e.onToggle})]})}const YO=({showModeSelection:e=!0,...t})=>{const{params:{organizationId:n},translate:s}=_l(),o=(0,L.useRef)(null),r=()=>Us.c9.now().toFormat(Hs),a=()=>(t.formRenderProps.form.change("input.tag",`${t.importTagPrefix}-csv-${r()}`),setInterval(()=>t.formRenderProps.form.change("input.tag",`${t.importTagPrefix}-csv-${r()}`),1e3)),l=()=>clearInterval(o.current);return(0,L.useEffect)(()=>(o.current=a(),()=>l()),[o]),(0,i.jsxs)(Na,{direction:"column",gap:"8",children:[e&&(0,i.jsx)(TE,{css:{"& header":{borderBlockEnd:"unset",paddingBlockEnd:"unset"}},gap:"4",heading:s("type_d_action_d_35533"),name:"input.mode",role:"radiogroup",subtitle:s("s_lectionnez_la_32551"),children:(0,i.jsxs)(Na,{gap:"4",justify:"evenly",children:[(0,i.jsx)(Na,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(MO,{icon:"user-plus",name:"input.mode",subtext:s("si_plusieurs_1_76274",t.itemName?.plural,t.createUpdateKey?.name,t.itemName?.plural),value:Ze.Create,children:s("ajoutez_1_36449",t.itemName?.singular)})}),(0,i.jsx)(Na,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(MO,{icon:"user-pen",name:"input.mode",subtext:s("si_plusieurs_1_92471",t.itemName?.plural,t.createUpdateKey?.name),value:Ze.Upsert,children:s("ajouter_et_mett_05008",t.itemName?.singular)})}),(0,i.jsx)(Na,{css:{flex:"1"},direction:"column",children:(0,i.jsx)(MO,{icon:"arrows-rotate",name:"input.mode",subtext:s("aucun_1_sera_42731",t.itemName?.singular,t.itemName?.singular),value:Ze.Update,children:s("mettre_jour_d_10088",t.itemName?.singular)})})]})}),t.formRenderProps.values.input.csv?.file&&ZO(t.formRenderProps.form)&&(0,i.jsx)(qO,{additionalCategories:t.additionalCategories,additionalOptions:t.additionalOptions,customFields:t.customFields,defaultFields:t.ImportInputService.IMPORT_COLUMNS_DEFAULT,file:t.formRenderProps.values.input.csv.file,form:t.formRenderProps.form,itemName:t.itemName,requiredFieldSlugs:t.ImportInputService.IMPORT_COLUMNS_REQUIRED(t.formRenderProps.values.input.mode),values:t.formRenderProps.values,onToggle:e=>{if(!t.formRenderProps.values.input.csv.file)throw new Error("No file in input!");try{e?t.formRenderProps.form.change("input.presets",JSON.parse(localStorage.getItem(Bl[`${t.localStorageKeyPrefix}_PRESETS`](n))??"[]")):t.formRenderProps.form.change("input.presets",[])}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}}),(0,i.jsxs)(TE,{heading:s("identify_your_i_87636"),subtitle:s("by_default_you_75833"),children:[(0,i.jsx)(Ll,{label:s("your_import_tag_41852"),name:"input.tag",state:"disabled"}),!t.isTagInputDisabled&&(0,i.jsx)(Nl,{label:s("specify_an_impo_41868"),onChange:e=>{m(e)?(o.current&&l(),t.formRenderProps.form.change("input.tag",`${t.importTagPrefix}-csv-${e}`)):(t.formRenderProps.form.change("input.tag",`${t.importTagPrefix}-csv-${r()}`),o.current=a())}})]})]})},KO=e=>{const{translate:t}=_l();return(0,i.jsxs)(Na,{align:"center",css:{alignSelf:"center",maxInlineSize:"640px"},direction:"column",gap:"8",children:[(0,i.jsxs)(Na,{align:"center",direction:"column",gap:"4",children:[(0,i.jsx)(Na,{css:{bd:!0,border:"1px solid $gray200",inlineSize:"fit-content"},justify:"start",children:(0,i.jsx)(FC,{css:{color:"$gray800",background:"unset"},icon:"party-horn"})}),(0,i.jsxs)(Na,{css:{textAlign:"center"},direction:"column",gap:"1",children:[(0,i.jsx)(ul,{textStyle:"heading",children:t("l_importation_e_12369")}),(0,i.jsx)(cl,{textStyle:"subtitle",children:t("_la_fin_du_pro_00757")})]})]}),(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(El,{onClick:()=>window.location.reload(),children:t("nouvel_import_48306")}),e.returnLink]})]})},ZO=e=>!!e.getFieldState("input.csv.key")?.valid&&!!e.getFieldState("input.csv.file")?.valid,XO=(0,RO.A)(({ImportInputService:e,columns:t,customFields:n})=>t.map(t=>Object.keys(e.IMPORT_COLUMNS_DEFAULT).map(e=>e.toLowerCase()).includes(t.toLowerCase())?e.IMPORT_COLUMNS_DEFAULT[Object.keys(e.IMPORT_COLUMNS_DEFAULT).find(e=>e.toLowerCase()===t.toLowerCase())]:n.find(e=>e.slug.toLowerCase()===t.toLowerCase()||e.name.toLowerCase()===t.toLowerCase())?.slug??null)),JO=(e,t,n)=>t.formatListValues(e.IMPORT_COLUMNS_REQUIRED(n.mode).filter(e=>!n.mappings.includes(e)),"conjunction"),QO=e=>{const{params:{organizationId:t,eventId:n,delegationId:s},translate:o}=_l();Dd(e.heading);const r=qn(Wn),{data:a,loader:l}=Mo({organizationId:t}),d=ti(),c=qn(e.ImportInputService),u=(0,L.useRef)(null),h=(0,L.useMemo)(()=>{try{const t={dateFormat:a.organization.dateFormat,datetimeFormat:a.organization.datetimeFormat,timeFormat:a.organization.timeFormat},n=JSON.parse(d.getItem(Bl[`${e.localStorageKeyPrefix}_FORMATS`])??"{}");return{...t,...n}}catch{return null}},[a.organization]),g=(0,L.useMemo)(()=>{const t=d.getItem(Bl[`${e.localStorageKeyPrefix}_FORMATS`]);return t?JSON.parse(t):t},[e.localStorageKeyPrefix]),p=qn(OO),f=(0,L.useCallback)((n,i)=>{i.form.change("input.tag",`${e.importTagPrefix}-csv-${Us.c9.now().toFormat(Hs)}`),(0,Ev.parse)(n,{delimiter:i.values.input.csv.delimiter,preview:1,newline:i.values.input.csv.newline,quoteChar:i.values.input.csv.quoteChar,complete:({data:t,errors:n})=>{let s;if(!n.length||1===n.length&&"UndetectableDelimiter"===n[0].code){const n=t[0],o=XO({ImportInputService:e.ImportInputService,columns:n,customFields:e.customFields});try{s=JSON.parse(d.getItem(Bl[`${e.localStorageKeyPrefix}_MAPPINGS`])??"{}")}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}i.form.change("input.mappings",n.map((e,t)=>void 0!==s[e]?s[e]:o[t]))}}});try{i.form.change("input.presets",JSON.parse(d.getItem(Bl[`${e.localStorageKeyPrefix}_PRESETS`](t))??"[]")),e.showModeSelection&&i.form.change("input.mode",d.getItem(Bl[`${e.localStorageKeyPrefix}_MODE`])??Ze.Upsert)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}},[e.customFields]);return(0,i.jsx)(fl.Provider,{value:{designSystem:"new2025"},children:(0,i.jsx)(Pm,{category:o("nouvel_import_48306"),color:"dark",fallbackClosePath:e.closePath,heading:e.heading,children:(0,i.jsx)($m,{ref:u,children:(0,i.jsxs)(mb,{initialValues:{input:c.default(h).input},isEdit:!1,summaryStep:(0,i.jsx)(KO,{returnLink:e.returnLink}),onSubmit:async({input:i})=>{if(!((e,t)=>e.IMPORT_COLUMNS_REQUIRED(t.mode).every(e=>t.mappings.includes(e)))(e.ImportInputService,i))return{[La.Ym]:o("you_have_not_ma_46806",JO(e.ImportInputService,r,i))};(n=>{const i=n.csv.file;if(!i)throw new Error("No file in input!");(0,Ev.parse)(i,{delimiter:n.csv.delimiter,preview:1,newline:n.csv.newline,quoteChar:n.csv.quoteChar,complete:({data:t,errors:i})=>{if(!i.length)try{const i=t[0],s=XO({ImportInputService:e.ImportInputService,columns:i,customFields:e.customFields}),o=JSON.parse(d.getItem(Bl[`${e.localStorageKeyPrefix}_MAPPINGS`])??"{}"),r={};for(const[e,t]of n.mappings.entries()){const n=i[e];t?r[n]=t:delete o[n],m(s[e])&&!r[n]&&(r[n]=null)}d.setItem(Bl[`${e.localStorageKeyPrefix}_MAPPINGS`],JSON.stringify({...o,...r}))}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}}});try{const i=JSON.parse(d.getItem(Bl[`${e.localStorageKeyPrefix}_PRESETS`](t))??"[]");d.setItem(Bl[`${e.localStorageKeyPrefix}_PRESETS`](t),JSON.stringify([...new Map([...i,...n.presets].map(e=>[e.customFieldId,e])).values()])),d.setItem(Bl[`${e.localStorageKeyPrefix}_FORMATS`],JSON.stringify(n.csv.formats?Object.fromEntries(Object.entries(n.csv.formats).filter(([e,t])=>m(t))):{})),e.showModeSelection&&d.setItem(Bl[`${e.localStorageKeyPrefix}_MODE`],n.mode)}catch(e){console.debug(`LocalStorage not available: ${e.toString()}`)}})(i);const a=(e=>{const t={...e.csv};return delete t.file,{...e,csv:t}})(i);try{const{jobId:i}=await e.mutate({organizationId:t,eventId:n,delegationId:s,input:a});e.checkImport(i,t,n)}catch{}},children:[(0,i.jsx)(hb,{actions:t=>(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(El,{disabled:!ZO(t.form),onClick:t.handleSubmit,children:o("suivant_donn_08625")}),g&&(0,i.jsx)(El,{color:"invisible-gray",onClick:()=>{d.removeItem(Bl[`${e.localStorageKeyPrefix}_FORMATS`]),window.location.reload()},children:o("clear_saved_set_61259")})]}),heading:o("choix_du_fichie_30517"),render:t=>(0,i.jsx)($O,{ImportInputService:e.ImportInputService,formRenderProps:t,localStorageKeyPrefix:e.localStorageKeyPrefix,onChange:f}),schema:p.settingsStepSchema()}),(0,i.jsx)(hb,{actions:e=>(0,i.jsx)(El,{type:"submit",onClick:e.handleSubmit,children:o("importer_90688")}),heading:o("donn_es_impor_12371"),render:t=>(0,i.jsx)(YO,{ImportInputService:e.ImportInputService,additionalCategories:e.additionalCategories,additionalOptions:e.additionalOptions,createUpdateKey:e.createUpdateKey,customFields:e.customFields,formRenderProps:t,importTagPrefix:e.importTagPrefix,isTagInputDisabled:e.isTagInputDisabled,itemName:e.itemName,localStorageKeyPrefix:e.localStorageKeyPrefix,showModeSelection:e.showModeSelection}),schema:c.mappingStepSchema()})]})})})})};var eR;let tR=class extends OO{static{eR=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...OO.IMPORT_COLUMNS_DEFAULT,Email:"email",TicketId:"ticketId"};static IMPORT_COLUMNS_REQUIRED=e=>e===Ze.Update?[eR.IMPORT_COLUMNS_DEFAULT.Id]:[eR.IMPORT_COLUMNS_DEFAULT.Email];constructor(e,t){super(e,t),this.csvInputService=e}};tR=eR=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Ov,Wn])],tR);const nR=({accreditations:e,closePath:t,customFields:n})=>{const{params:{organizationId:s,eventId:o},translate:r}=_l(),a=qn(Kc),{mutate:l}=function(e={}){return Xn("mutation VolunteersImport(\n $eventId: EventId\n $organizationId: OrganizationId!\n $delegationId: DelegationId\n $input: MappableImportInput!\n) {\n jobId: volunteersImport(\n eventId: $eventId\n organizationId: $organizationId\n delegationId: $delegationId\n input: $input\n )\n}\n",e)}(),{checkVolunteersImport:d}=kb(),c=(0,L.useMemo)(()=>e.map(e=>({...e,fields:e.slots.map(t=>({id:t.id,slug:`accreditation_slot_${t.id}`,name:Oh(a,t,e.name,{accreditation:{includeNameAtEnd:!0}})}))})),[e]);return(0,i.jsx)(QO,{ImportInputService:tR,additionalCategories:c,checkImport:d,closePath:t,createUpdateKey:{slug:"email",name:r("email_address_53451")},customFields:n,heading:r("import_de_membr_48618"),importTagPrefix:"volunteers",itemName:{singular:r("membre_53723"),plural:r("membres_67337")},localStorageKeyPrefix:"VOLUNTEERS_IMPORT",mutate:l,returnLink:(0,i.jsx)(qc,{to:$s.VOLUNTEERS(s,o),children:r("revenir_aux_mem_33379")})})},iR=()=>{const{params:{organizationId:e}}=_l(),{data:t,loader:n}=Kr({organizationId:e,variety:ve.UserInfo});return n||(0,i.jsx)(nR,{accreditations:[],closePath:yi.COMMUNITY_USERS({organizationId:e}),customFields:t.organization.customFields.nodes})},sR=()=>{const{params:{organizationId:e,eventId:t}}=_l(),{data:n,loader:s}=Zn("query EventVolunteersImportInfos(\n $organizationId: OrganizationId!\n $variety: CustomFieldVariety!\n $eventId: EventId!\n) {\n organization(id: $organizationId) {\n customFields(\n variety: $variety\n fieldTypes: [\n Address\n Checkbox\n Country\n Date\n Datetime\n Language\n Nationality\n Number\n Phone\n Select\n Sex\n Text\n Textarea\n Time\n Validation\n ]\n ) {\n nodes {\n ...CustomFieldImport\n }\n }\n }\n\n event(id: $eventId) {\n accreditations {\n nodes {\n ...AccreditationImport\n }\n }\n }\n}\n",{organizationId:e,variety:ve.UserInfo,eventId:t},[Ls.CustomFieldImportFragment,Ls.AccreditationImportFragment]);return s||(0,i.jsx)(nR,{accreditations:n.event.accreditations.nodes,closePath:$s.VOLUNTEERS(e,t),customFields:n.organization.customFields.nodes})};let oR=class extends Ul{constructor(e){super(e)}workflowInputDefault(e){return{name:e?.name??"",state:e?.state??Bt.Active,frequency:e?.frequency??Mt.Every10Minutes,trigger:e?.trigger??Vt.VolunteersSegment,action:e?.action??Ft.SetCustomField,data:(0,xb.A)({recipients:Nt.View},e?.data??{})}}workflowInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),state:d.Yj().required(this.t("le_statut_est_r_13164")).oneOf(Mn,this.t("le_statut_est_r_13164")),action:d.Yj().required(this.t("l_action_est_re_08934")).oneOf(Pn,this.t("l_action_est_re_08934")),trigger:d.Yj().required(this.t("le_d_clencheur_32555")).oneOf(Nn,this.t("le_d_clencheur_32555")),data:d.gl().required().test("positions-valid",this.t("les_missions_so_67594"),function(){return this.parent.trigger!==Vt.Assigned||no(this.parent.data.positionsCategoriesIds)||no(this.parent.data.positionsIds)||no(this.parent.data.positionsSlotsIds)||no(this.parent.data.positionsSegmentsIds)}).test("volunteers-segment-id-valid",this.t("la_vue_est_requ_65480"),function(){return this.parent.trigger!==Vt.VolunteersSegment||Number.isInteger(this.parent.data.volunteersSegmentId)}).test("form-id-valid",this.t("le_formulaire_e_77404"),function(){return this.parent.trigger!==Vt.FormSubmit||Number.isInteger(this.parent.data.formId)}).test("campaign-id-valid",this.t("la_campagne_est_06708"),function(){return this.parent.trigger!==Vt.VolunteersSegment||this.parent.action!==Ft.SendCampaign||Number.isInteger(this.parent.data.campaignId)}).test("campaign-recipients-valid",this.t(this.t("les_destinatair_82420")),function(){return this.parent.trigger!==Vt.VolunteersSegment||this.parent.action!==Ft.SendCampaign||Fn.includes(this.parent.data.recipients)}).test("campaign-recipients-users-infos",this.t("la_liste_des_me_55886"),function(){return this.parent.trigger!==Vt.VolunteersSegment||this.parent.action!==Ft.SendCampaign||this.parent.data.recipients!==Nt.UsersInfosIds||no(this.parent.data.usersInfosIds)}).test("custom-field-id-valid",this.t("le_champ_person_80074"),function(){return this.parent.trigger===Vt.VolunteersSegment&&this.parent.action===Ft.SetCustomField?Number.isInteger(this.parent.data.customFieldId):this.parent.trigger!==Vt.FormSubmit||this.parent.action!==Ft.CreateDelegation||Number.isInteger(this.parent.data.customFieldId)}).test("accreditations-valid",this.t("les_accr_ditati_27943"),function(){return this.parent.trigger!==Vt.Assigned&&(this.parent.trigger!==Vt.VolunteersSegment||this.parent.action!==Ft.AddAccreditations&&this.parent.action!==Ft.DeleteAccreditations)||no(this.parent.data.accreditationsSlotsIds)}).test("delegation-id-valid",this.t("la_d_l_gation_c_71684"),function(){return this.parent.trigger!==Vt.FormSubmit||this.parent.action!==Ft.CreateDelegation||Number.isInteger(this.parent.data.delegationId)}).test("event-id-valid",this.t("l_v_nement_est_88155"),function(){return this.parent.trigger!==Vt.VolunteersSegment||this.parent.action!==Ft.AddEvent||Number.isInteger(this.parent.data.eventId)})})}};oR=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],oR);const rR=e=>(0,i.jsxs)(Na,{css:{background:"white",bd:!0,padding:"$4",width:"min($container, 100%)"},direction:"column",gap:"5",children:[(0,i.jsxs)(Na,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$3"},gap:"3",width:1,children:[(0,i.jsx)(FC,{color:"gray",icon:e.icon}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:e.category}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:e.title})]})]}),(0,i.jsx)(Na,{direction:"column",gap:"4",width:1,children:e.children})]}),aR=e=>{const{translate:t,params:{eventId:n}}=_l(),{hasFeature:s}=yI(),{event:o}=vb(),r=(!o||o.useCampaigns)&&e.workflow.trigger===Vt.VolunteersSegment,a=e.workflow.trigger===Vt.VolunteersSegment,l=!!n&&s(Ne.Accreditation)&&(o?.useAccreditations??!1)&&(e.workflow.trigger===Vt.Assigned||e.workflow.trigger===Vt.VolunteersSegment),d=!!n&&s(Ne.Accreditation)&&(o?.useAccreditations??!1)&&e.workflow.trigger===Vt.VolunteersSegment,c=s(Ne.Delegation)&&e.workflow.trigger===Vt.FormSubmit,u=!n&&e.workflow.trigger===Vt.VolunteersSegment,h=!!n&&e.workflow.trigger===Vt.VolunteersSegment;return(0,i.jsx)(rR,{category:t("action_s_lectio_18617"),icon:"lasso-sparkles",title:t("alors_automatiq_16268"),children:(0,i.jsxs)(Um,{isSearchVisible:!0,name:"workflow.action",placeholder:t("choisir_une_act_51814"),state:e.isEdit?"disabled":"active",children:[r&&(0,i.jsx)("option",{value:Ft.SendCampaign,children:t("SendCampaign")}),a&&(0,i.jsx)("option",{value:Ft.SetCustomField,children:t("SetCustomField")}),l&&(0,i.jsx)("option",{value:Ft.AddAccreditations,children:t("AddAccreditations")}),d&&(0,i.jsx)("option",{value:Ft.DeleteAccreditations,children:t("DeleteAccreditations")}),c&&(0,i.jsx)("option",{value:Ft.CreateDelegation,children:t("cr_er_une_d_l_g_23035")}),u&&(0,i.jsx)("option",{value:Ft.AddEvent,children:t("ajouter_sur_un_56178")}),h&&(0,i.jsx)("option",{value:Ft.DuplicateMember,children:"Dupliquer le membre"})]})})},lR=()=>{const{translate:e,params:{eventId:t}}=_l(),n=qn(Kc),{data:s}=Zn("query WorkflowAccreditations($eventId: EventId!) {\n event(id: $eventId) {\n accreditations {\n nodes {\n id\n name\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n }\n}\n",{eventId:t},[]),o=(0,L.useMemo)(()=>(s.event?.accreditations.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:Ph(e.slots).map(t=>{const s=Oh(n,t,e.name,{accreditation:{includeNameAtEnd:!0}});return(0,i.jsx)("option",{value:t.id,children:s},t.id)})},e.id)),[s.event]);return(0,i.jsx)(rR,{category:e("liste_des_accr_02647"),icon:"badge-check",title:e("les_accr_ditati_19289"),children:(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"workflow.data.accreditationsSlotsIds",children:o})})},dR=()=>{const{translate:e,params:{organizationId:t}}=_l(),{data:n}=Zn("query WorkflowEvents($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t},[]);return(0,i.jsx)(rR,{category:e("liste_des_v_ne_29929"),icon:"plus",title:e("l_v_nement_sui_45117"),children:(0,i.jsx)(Um,{isSearchVisible:!0,name:"workflow.data.eventId",placeholder:e("choisir_un_v_n_58535"),children:(n.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},cR=e=>{const{translate:t,params:{organizationId:n}}=_l(),[s,o,r]=Bc(""),{usersInfosOptions:a,isLoading:l}=Wb({organizationId:n,eventId:null,hasSelected:no(e.workflow.data.usersInfosIds),nameDebounced:o,userInfoIds:e.workflow.data.usersInfosIds||[]});return(0,i.jsxs)(rR,{category:t("destinataires_19592"),icon:"users",title:t("aux_membres_sui_99877"),children:[(0,i.jsxs)(Um,{name:"workflow.data.recipients",children:[(0,i.jsx)("option",{value:Nt.View,children:t("aux_membres_de_71046")}),(0,i.jsx)("option",{value:Nt.DelegationsLeaders,children:t("aux_responsable_38147")}),(0,i.jsx)("option",{value:Nt.PositionsLeaders,children:t("aux_responsable_85620")}),(0,i.jsx)("option",{value:Nt.UsersInfosIds,children:t("_certains_memb_91094")})]}),e.workflow.data.recipients===Nt.UsersInfosIds&&(0,i.jsx)(Um,{isSearchLoading:l,isSearchVisible:!0,label:t("liste_des_membr_89037"),multiple:!0,name:"workflow.data.usersInfosIds",searchElement:(0,i.jsx)(Nl,{icon:"magnifying-glass",name:s,placeholder:t("rechercher_un_m_05904"),state:"search",onChange:r}),children:a})]})},uR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{data:o}=Zn("query WorkflowsDelegations(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n delegations(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n\n form(id: $formId) {\n elements {\n customField {\n id\n name\n fieldType\n }\n }\n }\n }\n}\n",{organizationId:n,eventId:s,level:s?it.Event:it.Organization,formId:e.workflow.data.formId},[]);const r=(0,L.useMemo)(()=>o.organization?.delegations.nodes??[],[o.organization]),a=(0,L.useMemo)(()=>(o.organization?.form.elements??[]).flatMap(e=>e.customField?.fieldType===Ve.Text?[e.customField]:[]),[o.organization]);return(0,i.jsxs)(rR,{category:t("liste_des_d_l_g_86270"),icon:"users",title:t("la_d_l_gation_s_46776"),children:[(0,i.jsx)(Um,{isSearchVisible:!0,label:t("d_l_gation_ut_74409"),name:"workflow.data.delegationId",placeholder:t("choisir_une_d_l_57897"),children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Um,{isSearchVisible:!0,label:t("champ_utilise_04526"),name:"workflow.data.customFieldId",placeholder:t("choisir_un_cham_05690"),children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})},hR=e=>{const{translate:t,params:{organizationId:n}}=_l(),{data:s}=Oa({organizationId:n});return(0,i.jsx)(rR,{category:t("param_tres_du_n_85818"),icon:"user",title:t("on_duplique_le_59761"),children:(0,i.jsx)(Na,{direction:"column",children:(0,i.jsx)(Zj,{change:e.change,customFields:s.organization?.customFields.nodes??[],name:"workflow.data.customFields",values:e.workflow.data.customFields||[]})})})},mR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{data:o}=Zn("query WorkflowForms(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n forms(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:n,eventId:s,level:s?it.Event:it.Organization},[]);return(0,i.jsx)(rR,{category:t("liste_des_formu_69259"),icon:"file-lines",title:t("un_formulaire_p_61128"),children:(0,i.jsx)(Um,{isSearchVisible:!0,name:"workflow.data.formId",placeholder:t("choisir_un_form_18905"),state:e.isEdit?"disabled":"active",children:(o.organization?.forms.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},gR=e=>{const{translate:t,params:{eventId:n}}=_l(),s=qn(hh),{data:o}=Zn("query WorkflowPositions($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n\n slots {\n id\n name\n range\n }\n }\n }\n\n segmentsFolders(segmentType: Positions) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{eventId:n},[]),r=(0,L.useMemo)(()=>(0,lc.A)(o.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[o.event]),a=(0,L.useMemo)(()=>(0,lc.A)(o.event?.positionsCategories??[],e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,lc.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o.event]),l=(0,L.useMemo)(()=>(o.event?.positionsCategories??[]).flatMap(e=>(0,lc.A)(e.positions,e=>e.name.toLowerCase()).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,lc.A)(e.slots,e=>e.range.start.toMillis()).map(t=>{const n=vh(s,t,e.name,{position:{includeNameAtEnd:!0},slot:{includeRange:!0}});return(0,i.jsx)("option",{value:t.id,children:n},t.id)})},e.id))),[o.event]),d=(0,L.useMemo)(()=>(o.event?.segmentsFolders??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o.event]);return(0,i.jsxs)(rR,{category:t("liste_des_missi_82050"),icon:"sitemap",title:t("une_mission_par_94044"),children:[(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_18005"),multiple:!0,name:"workflow.data.positionsCategoriesIds",placeholder:t("choisir_une_cat_82874"),state:e.isEdit?"disabled":"active",children:r}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_40348"),multiple:!0,name:"workflow.data.positionsIds",placeholder:t("choisir_une_mis_90627"),state:e.isEdit?"disabled":"active",children:a}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_82271"),multiple:!0,name:"workflow.data.positionsSlotsIds",placeholder:t("choisir_un_cr_n_50945"),state:e.isEdit?"disabled":"active",children:l}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,label:t("est_affect_u_31860"),multiple:!0,name:"workflow.data.positionsSegmentsIds",placeholder:t("choisir_une_vue_98781"),state:e.isEdit?"disabled":"active",children:d})]})},pR=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=_l(),{data:s}=Zn("query WorkflowCampaigns(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n campaigns(level: $level, eventId: $eventId, states: [Template]) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,eventId:n,level:n?it.Event:it.Organization},[]);return(0,i.jsx)(rR,{category:e("liste_des_campa_60034"),icon:"paper-plane",title:e("la_campagne_sui_83193"),children:(0,i.jsx)(Um,{isSearchVisible:!0,name:"workflow.data.campaignId",placeholder:e("choisir_une_cam_60181"),children:(s.organization?.campaigns.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})},fR=e=>{const{translate:t,params:{organizationId:n}}=_l(),{data:s}=Oa({organizationId:n}),o=(0,L.useMemo)(()=>s.organization?.customFields.nodes??[],[s.organization]),r=o.find(t=>t.id===e.workflow.data.customFieldId);return(0,i.jsxs)(rR,{category:t("liste_des_champ_94862"),icon:"text",title:t("le_champ_suivan_27303"),children:[(0,i.jsx)(Um,{isSearchVisible:!0,label:t("CustomField"),name:"workflow.data.customFieldId",placeholder:t("choisir_un_cham_67587"),children:o.map(e=>(0,i.jsx)("option",{"data-subtext":e.label,value:e.id,children:e.name},e.id))}),r&&(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",children:t("nouvelle_valeur_39039",r.name)}),(0,i.jsx)(qj,{campaigns:[],categories:[],change:e.change,customDocuments:[],customField:r,forms:[],name:"workflow.data.customFieldValue",slug:r.slug,tags:[],traces:[],value:e.workflow.data?.customFieldValue})]})]})},xR=e=>{const{translate:t,params:{eventId:n}}=_l(),{hasFeature:s}=yI(),{event:o}=vb(),r=!!n&&(o?.usePositions??!1)&&(o?.useAccreditations??!1)&&s(Ne.Accreditation),a=(o?.useForms??!0)&&(o?.useDelegations??!0)&&s(Ne.Delegation);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:"workflow.trigger",children:t=>{t===Vt.Assigned?e.change("workflow.action",Ft.AddAccreditations):t===Vt.FormSubmit?e.change("workflow.action",Ft.CreateDelegation):e.change("workflow.action",Ft.SetCustomField)}}),(0,i.jsx)(rR,{category:t("initialisation_38640"),icon:"hand-sparkles",title:t("quand_le_membre_51578"),children:(0,i.jsxs)(Um,{isSearchVisible:!0,name:"workflow.trigger",placeholder:t("choisir_un_d_cl_85012"),state:e.isEdit?"disabled":"active",children:[r&&(0,i.jsx)("option",{value:Vt.Assigned,children:t("est_affect_93543")}),a&&(0,i.jsx)("option",{value:Vt.FormSubmit,children:t("rempli_un_formu_11513")}),(0,i.jsx)("option",{value:Vt.VolunteersSegment,children:t("VolunteersSegment")})]})})]})},_R=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{data:o}=Zn("query WorkflowVolunteersSegments(\n $organizationId: OrganizationId!\n $eventId: EventId\n $level: OrganizationEventLevel!\n) {\n organization(id: $organizationId) {\n segmentsFolders(level: $level, segmentType: Volunteers, eventId: $eventId) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{organizationId:n,eventId:s,level:s?it.Event:it.Organization},[]);return(0,i.jsx)(rR,{category:t("liste_des_membr_89037"),icon:"user-group",title:t("une_vue_parmi_l_98342"),children:(0,i.jsx)(Um,{isSearchVisible:!0,name:"workflow.data.volunteersSegmentId",placeholder:t("choisir_une_vue_98781"),state:e.isEdit?"disabled":"active",children:(o.organization?.segmentsFolders??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})})},IR=()=>(0,i.jsx)(Na,{height:32,justify:"center",width:1,children:(0,i.jsx)(yr,{css:{borderRight:"1px solid $gray200"},height:1})}),vR=e=>{const{translate:t}=_l(),n=e.workflow.data,s=e.workflow.trigger===Vt.VolunteersSegment,o=e.workflow.trigger===Vt.Assigned,r=e.workflow.trigger===Vt.FormSubmit,a=e.workflow.trigger===Vt.VolunteersSegment&&"number"==typeof n.volunteersSegmentId||e.workflow.trigger===Vt.Assigned&&(no(n.positionsCategoriesIds)||no(n.positionsIds)||no(n.positionsSlotsIds)||no(n.positionsSegmentsIds))||e.workflow.trigger===Vt.FormSubmit&&"number"==typeof n.formId,l=a&&e.workflow.trigger===Vt.VolunteersSegment&&e.workflow.action===Ft.SendCampaign,d=l&&"number"==typeof e.workflow.data.campaignId,c=a&&e.workflow.trigger===Vt.VolunteersSegment&&e.workflow.action===Ft.SetCustomField,u=a&&e.workflow.action===Ft.AddAccreditations,h=a&&e.workflow.action===Ft.DeleteAccreditations,m=a&&e.workflow.action===Ft.CreateDelegation,g=a&&e.workflow.action===Ft.AddEvent,p=a&&e.workflow.action===Ft.DuplicateMember,f=l||c||u||m||g;return(0,i.jsxs)(Na,{align:"center",direction:"column",children:[(0,i.jsx)(vl,{}),e.workflow.state===Bt.Error&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(sl,{color:"warning",leftIcon:"circle-exclamation",width:"min($container, 100%)",children:[(0,i.jsx)(yr,{children:t("une_erreur_est_38715")}),(0,i.jsx)(yr,{fontWeight:"regular",children:e.workflow.data.errorMessage})]}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(Na,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("d_but_41840")})}),(0,i.jsx)(IR,{}),(0,i.jsx)(xR,{change:e.change,isEdit:e.isEdit}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(_R,{hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(gR,{isEdit:e.isEdit})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(mR,{isEdit:e.isEdit})]}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(aR,{isEdit:e.isEdit,workflow:e.workflow})]}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(pR,{})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(cR,{workflow:e.workflow})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(fR,{change:e.change,workflow:e.workflow})]}),(u||h)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(lR,{})]}),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(uR,{workflow:e.workflow})]}),g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(dR,{})]}),p&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(hR,{change:e.change,workflow:e.workflow})]}),f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IR,{}),(0,i.jsx)(Na,{css:{background:"white",bd:!0,borderRadius:"50px",padding:"$2 $4"},children:(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("fin_60104")})})]})]})},bR=L.forwardRef((e,t)=>{const{history:n,translate:s,params:{organizationId:o,eventId:r}}=_l(),{user:a}=si(),l=Mc(),[d,c]=L.useState(!1),u=L.useCallback(()=>{JSON.stringify(e.workflow)===e.initialValuesString?n.goBack(ZI.WORKFLOWS({organizationId:o,eventId:r})):c(!0)},[e.workflow,e.initialValuesString,c]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pm,{button:(0,i.jsx)(Bb,{permissions:Nb.WORKFLOW_EDIT,children:(0,i.jsx)(El,{isLoading:e.submitting,onClick:e.handleSubmit,children:e.isEdit?s("mettre_jour_l_18144"):s("cr_er_l_automat_04638")})}),category:e.category,color:"dark",heading:e.isEdit?e.name:s("nouvelle_automa_77863"),onClose:u,children:(0,i.jsxs)(Na,{height:1,children:[(0,i.jsxs)(Na,{css:{background:"white",padding:"$6"},direction:"column",gap:"7",width:420,children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:s("param_tres_de_l_25166")}),(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(Ll,{label:s("nom_de_l_automa_04883"),name:"workflow.name"}),(0,i.jsx)(Hj,{label:s("status_06428"),name:"workflow.state",children:l(Mn.filter(e=>e!==Bt.Error))}),Wc(a.email)&&r&&(0,i.jsxs)(Hj,{label:s("fr_quence_43547"),name:"workflow.frequency",children:[(0,i.jsx)("option",{value:Mt.Every10Minutes,children:s(Mt.Every10Minutes)}),(0,i.jsx)("option",{value:Mt.Every5Minutes,children:s(Mt.Every5Minutes)}),(0,i.jsx)("option",{value:Mt.Every2Minutes,children:s(Mt.Every2Minutes)}),(0,i.jsx)("option",{value:Mt.EveryMinute,children:s(Mt.EveryMinute)})]})]})]}),(0,i.jsx)(Na,{ref:t,css:{background:"$gray50",flex:"1",overflowY:"auto",padding:"$8"},direction:"column",height:1,children:(0,i.jsx)(vR,{change:e.change,hasBeenExecuted:e.hasBeenExecuted,isEdit:e.isEdit,workflow:e.workflow})})]})}),(0,i.jsx)(qS,{fallbackPath:ZI.WORKFLOWS({organizationId:o,eventId:r}),isOpen:d,onClose:()=>c(!1)})]})});bR.displayName="UpdateWorkflowForm";const jR=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),{showNotification:r}=kb(),a=(0,L.useRef)(null),l=qn(Ba),d=qn(oR),[c,u]=(0,L.useState)(""),h=(0,L.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.name??""):n("cr_ation_d_une_01202"),[e.initialValues]);return Dd(h),(0,L.useEffect)(()=>{u(JSON.stringify(e.initialValues))},[e.initialValues]),(0,i.jsx)(Cl,{customErrorRef:a,height:1,initialValues:{workflow:e.initialValues},render:({form:t,handleSubmit:n,submitting:s,values:o})=>(0,i.jsx)(bR,{ref:a,category:h,change:t.change,handleSubmit:n,hasBeenExecuted:e.hasBeenExecuted,initialValuesString:c,isEdit:e.isEdit,name:e.initialValues.name,submitting:s,workflow:o.workflow}),validate:e=>l.validateForForm(d.workflowInputSchema())(e.workflow),width:1,onSubmit:async i=>{await e.mutate(i.workflow),r(e.isEdit?n("l_automatisatio_62036"):n("l_automatisatio_19124")),t.push(ZI.WORKFLOWS({organizationId:s,eventId:o}))}})},CR=()=>{const{params:{organizationId:e,eventId:t}}=_l(),n=qn(oR),{mutate:s}=function(e={}){return Xn("mutation WorkflowCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $workflow: WorkflowInput!\n) {\n workflowCreate(organizationId: $organizationId, eventId: $eventId, workflow: $workflow) {\n id\n }\n}\n",e)}(),o=(0,L.useMemo)(()=>n.workflowInputDefault(),[]);return(0,i.jsx)(jR,{hasBeenExecuted:!1,initialValues:o,isEdit:!1,mutate:n=>s({organizationId:e,eventId:t,workflow:n})})},yR=()=>{const{params:{organizationId:e,eventId:t,workflowId:n}}=_l(),s=qn(oR),{mutate:o}=function(e={}){return Xn("mutation WorkflowUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $workflowId: WorkflowId!\n $workflow: WorkflowInput!\n) {\n workflowUpdate(\n organizationId: $organizationId\n eventId: $eventId\n workflowId: $workflowId\n workflow: $workflow\n ) {\n id\n }\n}\n",e)}(),{data:r,loader:a}=Zn("query Workflow($organizationId: OrganizationId!, $workflowId: WorkflowId!) {\n organization(id: $organizationId) {\n workflow(id: $workflowId) {\n id\n name\n frequency\n state\n action\n trigger\n hasBeenExecuted\n\n data {\n accreditationsSlotsIds\n campaignId\n customFieldId\n customFieldValue\n customFields\n delegationId\n errorMessage\n eventId\n formId\n positionsCategoriesIds\n positionsIds\n positionsSegmentsIds\n positionsSlotsIds\n recipients\n usersInfosIds\n volunteersSegmentId\n }\n }\n }\n}\n",{organizationId:e,workflowId:n},[]),l=(0,L.useMemo)(()=>s.workflowInputDefault(r.organization?.workflow),[r.organization]);return a||(0,i.jsx)(jR,{hasBeenExecuted:r.organization?.workflow.hasBeenExecuted,initialValues:l,isEdit:!0,mutate:i=>o({organizationId:e,eventId:t,workflowId:n,workflow:i})})};var kR;function AR(e){return{includeAccreditations:e.includes(kR.Accreditations),includeCampaign:e.includes(kR.Campaign),includeCustomField:e.includes(kR.CustomField)}}!function(e){e.Accreditations="accreditations",e.Action="Action",e.Campaign="campaign",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.CustomField="customField",e.ExecutedAt="executedAt",e.Id="id",e.Name="name",e.State="state",e.Trigger="trigger",e.VolunteersSegment="volunteersSegment"}(kR||(kR={}));class wR extends gu{constructor(e,t,n){super(e,t,n)}getWorkflowsFilters(e,t){return[{slug:kR.State,name:this.t("status_06428"),category:this.t("automatisations_60045"),fieldType:We.Select,hideEmpty:!0,values:Mn.map(e=>({id:e,name:this.t(e)}))},{slug:kR.Trigger,name:this.t("d_clencheur_73493"),category:this.t("automatisations_60045"),fieldType:We.Select,hideEmpty:!0,values:Nn.map(e=>({id:e,name:this.t(e)}))},{slug:kR.Action,name:this.t("action_44224"),category:this.t("automatisations_60045"),fieldType:We.Select,hideEmpty:!0,values:Pn.map(e=>({id:e,name:this.t(e)}))},{slug:kR.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("automatisations_60045"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:kR.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("automatisations_60045"),fieldType:We.Datetime,hideEmpty:!0}]}getWorkflowsPossibleColumns(){return[{slug:kR.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,width:100,sortAttribute:Lt.Id},{slug:kR.Name,name:this.t("nom_de_l_automa_04883"),isSearchable:!0,isSortable:!0,sortAttribute:Lt.Name,minWidth:240},{slug:kR.State,name:this.t("status_06428"),minWidth:180},{slug:kR.Trigger,name:this.t("d_clencheur_73493"),minWidth:180},{slug:kR.Action,name:this.t("action_44224"),minWidth:180},{slug:kR.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:kR.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:Lt.CreatedAt,minWidth:180},{slug:kR.VolunteersSegment,name:this.t("vue_s_lectionn_21556"),isSortable:!0,sortAttribute:Lt.VolunteersSegment,minWidth:320},{slug:kR.ExecutedAt,name:this.t("ex_cut_e_le_99019"),isSortable:!0,sortAttribute:Lt.ExecutedAt,minWidth:180},{slug:kR.Accreditations,name:this.t("accr_ditations_39450"),minWidth:320},{slug:kR.Campaign,name:this.t("campagne_97871"),minWidth:240},{slug:kR.CustomField,name:this.t("CustomField"),minWidth:240}]}}const SR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{showNotification:o}=kb(),{mutate:r}=function(e={}){return Xn("mutation WorkflowssMassDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $selecteds: MassActionSelectedsInput!\n) {\n workflowssMassDelete(organizationId: $organizationId, eventId: $eventId, selecteds: $selecteds)\n}\n",e)}();return(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:(0,Ya.A)([t("_tes_vous_s_r_d_94890"),e.workflow.trigger===Vt.Assigned?t("cela_supprimera_60220"):null]),text:t("suppression_de_73669",e.workflow.name),onClose:e.onClose,onDelete:async()=>{await r({organizationId:n,eventId:s,selecteds:{ids:[e.workflow.id]}}),o(t("l_automatisatio_64405",e.workflow.name)),e.onSuccess()}})},ER=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),{mutate:r}=function(e={}){return Xn("mutation WorkflowDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $workflowId: WorkflowId!\n) {\n workflowDuplicate(organizationId: $organizationId, eventId: $eventId, workflowId: $workflowId) {\n id\n }\n}\n",e)}(),{mutate:a}=function(e={}){return Xn("mutation WorkflowExecute(\n $organizationId: OrganizationId!\n $eventId: EventId\n $workflowId: WorkflowId!\n) {\n workflowExecute(organizationId: $organizationId, eventId: $eventId, workflowId: $workflowId)\n}\n",e)}(),[l,d]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"play",isDisabled:e.workflow.state===Bt.Paused,onClick:async()=>{await a({organizationId:s,eventId:o,workflowId:e.workflow.id}),e.reload()},children:n("ex_cuter_54158")}),(0,i.jsx)(Gd,{icon:"pen",to:ZI.UPDATE({organizationId:s,eventId:o,workflowId:e.workflow.id}),children:n("_diter_62574")}),(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>{const{workflowDuplicate:{id:n}}=await r({organizationId:s,eventId:o,workflowId:e.workflow.id});t.push(ZI.UPDATE({organizationId:s,eventId:o,workflowId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:e=>{d(!0),Nd(e.target)},children:n("supprimer_43083")})]}),l&&(0,i.jsx)(SR,{workflow:e.workflow,onClose:()=>{d(!1)},onSuccess:e.reload})]})},TR=e=>{const t=qn(Kc);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:t.toLocaleString(e.insertedAt.toLocal(),Js.DateTime)})},zR=e=>{const t=m(e.createdBy?.name),n=(t?e.createdBy?.name:e.createdBy?.email)||"";return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray900 textSm medium",title:n,width:1,children:n}),t&&(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0},title:e.createdBy?.email||"",width:1,children:e.createdBy?.email||""})]})})};function OR(e){switch(e){case Bt.Active:return{color:"success",leftIcon:"play"};case Bt.Error:return{color:"error",leftIcon:"triangle-exclamation"};case Bt.Paused:return{color:"warning",leftIcon:"pause"};default:return rl()}}const RR=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),o=qn(Kc),r=(0,L.useMemo)(()=>no(e.row.accreditationsSlots)?AC(e.row.accreditationsSlots):[],[e.column]);return e.column.slug===kR.Id?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===kR.Name?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qc,{to:ZI.UPDATE({organizationId:n,eventId:s,workflowId:e.row.id}),children:e.row.name})}):e.column.slug===kR.State?(0,i.jsxs)(Ec,{align:"start",direction:"column",gap:"1",justify:"center",minWidth:e.column.minWidth,width:e.column.width,children:[(0,i.jsx)(ic,{...OR(e.row.state),children:t(e.row.state)}),"Error"===e.row.state&&(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.row.data.errorMessage||"",width:1,children:e.row.data.errorMessage||""})]}):e.column.slug===kR.Trigger?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.trigger)}):e.column.slug===kR.Action?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.action)}):e.column.slug===kR.CreatedBy?(0,i.jsx)(zR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===kR.CreatedAt?(0,i.jsx)(TR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===kR.VolunteersSegment?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.volunteersSegment?(0,i.jsx)(qc,{to:$s.VOLUNTEERS_SEGMENT(n,s,e.row.volunteersSegment.id),children:e.row.volunteersSegment.name}):"-"}):e.column.slug===kR.ExecutedAt?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.executedAt?.isValid?o.toLocaleString(e.row.executedAt.toLocal(),Js.DateTime):"-"}):e.column.slug===kR.Accreditations?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:r,doNotSort:!0})}):e.column.slug===kR.Campaign?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.campaign?(0,i.jsx)(qc,{to:SI.CAMPAIGN({organizationId:n,eventId:s,campaignId:e.row.campaign.id}),children:e.row.campaign.name}):"-"}):e.column.slug===kR.CustomField?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.customField?e.row.customField.name:"-"}):null},$R=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=_l();return(0,i.jsxs)(tj,{justify:"between",children:[(0,i.jsx)(yr,{font:"gray900 displayXs medium",children:t("automatisations_60045")}),(0,i.jsx)(Bb,{permissions:Nb.WORKFLOW_EDIT,children:(0,i.jsx)(El,{onClick:()=>{e.push(ZI.CREATE({organizationId:n,eventId:s}))},children:t("cr_er_une_autom_91246")})})]})},DR=e=>{const{params:{organizationId:t,eventId:n}}=_l(),s=qn(wR),[o,r,a]=cy(t,"workflows.columns",[kR.Name,kR.State,kR.CreatedBy]),[l,d,c]=cy(t,"workflows.limit",Tc),[u,h,m]=cy(t,"workflows.predicates",[]),[g,p,f]=cy(t,"workflows.sort",null),x=(0,L.useMemo)(()=>s.getWorkflowsFilters(t,n),[n,t,s]),_=(0,L.useMemo)(()=>s.getWorkflowsPossibleColumns(),[]),I=a||c||m||f;return(0,i.jsxs)(nj,{children:[(0,i.jsx)($R,{}),(0,i.jsx)(ej,{children:I?(0,i.jsx)(kl,{}):(0,i.jsx)(mm,{columns:o,columnsSearch:[],columnsToIncludes:AR,eventId:n,filters:x,limit:l,loadDataList:Ra,loadDataListParams:{level:n?it.Event:it.Organization},loadRow:$a,organizationId:t,possibleColumns:_,predicates:u,rendering:Nh.List,setColumns:r,setLimit:d,setPredicates:h,setSort:p,showEditColumns:!0,showEditMode:!1,showFilters:!0,showMassActions:!1,showRowDropdown:e.showRowDropdown,showRowEdit:e.showRowEdit,showSearchColumns:!1,sort:g,children:(0,i.jsx)(Am,{getEditPath:e=>ZI.UPDATE({organizationId:t,eventId:n,workflowId:e.id}),renderCell:(e,t)=>(0,i.jsx)(RR,{column:e,row:t}),renderRowDropdown:(e,t)=>(0,i.jsx)(ER,{reload:t,workflow:e})})})})]})},PR=()=>{const{translate:e}=_l(),{event:{name:t}}=vb(),{canWorkflowEdit:n}=wS();return Dd(`${t} ${e("automatisations_60045")}`),(0,i.jsx)(DR,{showRowDropdown:n,showRowEdit:n})},FR=()=>{const{translate:e}=_l(),{organization:t}=yI(),{canWorkflowEdit:n}=SS();return Dd(`${t.name} ${e("automatisations_60045")}`),(0,i.jsx)(DR,{showRowDropdown:n,showRowEdit:n})};let MR=class extends Ul{translationService;constructor(e){super(e),this.translationService=e}segmentFolderInputDefault(e,t){return{name:t?.name??"",segmentType:e}}};MR=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],MR);const NR=e=>{const t=Yn(),{eventId:n,organizationId:s,segmentType:o,reload:r}=gy(),{mutate:a}=function(e={}){return Xn("mutation SegmentFolderCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolder: SegmentsFolderInput!\n) {\n segmentFolderCreate(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolder: $segmentFolder\n ) {\n id\n }\n}\n",e)}(),{mutate:l}=function(e={}){return Xn("mutation SegmentFolderUpdateName(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n $name: String!\n) {\n segmentFolderUpdateName(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n name: $name\n ) {\n id\n }\n}\n",e)}(),d=qn(MR);return(0,i.jsx)(Jj,{buttonText:e.isEdit?t("mettre_jour_l_05529"):t("cr_er_le_dossie_71150"),icon:"text",initialValues:{segmentFolder:d.segmentFolderInputDefault(o,e.segmentFolder)},size:"md",subtitle:t("classez_vos_vue_39895"),title:t("nom_du_dossier_95781"),onClose:e.onClose,onSubmit:async t=>{e.isEdit&&e.segmentFolder?await l({organizationId:s,eventId:n,segmentFolderId:e.segmentFolder.id,name:t.segmentFolder.name}):await a({organizationId:s,eventId:n,segmentFolder:t.segmentFolder}),r(),e.onClose()},children:(0,i.jsx)(Ll,{label:t("nom_du_dossier_95781"),name:"segmentFolder.name"})})},LR=e=>{const[t,n]=L.useState(!1),s=L.useCallback(t=>{e.setSegmentsFolders((0,pu.jM)(n=>{n[e.segmentFolderIndex].segments[e.index].name=t}))},[e.segmentFolderIndex,e.index,e.setSegmentsFolders]),o=L.useCallback(()=>e.setSegmentsFolders(t=>t.map(t=>({...t,segments:t.segments.filter(t=>t.id!==e.segment.id)}))),[e.segment,e.setSegmentsFolders]);return(0,i.jsx)(fu.sx,{draggableId:`s-${e.segment.id}`,index:e.index,children:r=>(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",...r.draggableProps,ref:r.innerRef,align:"center",children:[(0,i.jsx)(yr,{color:"gray300",css:{cursor:"pointer"},...r.dragHandleProps,children:(0,i.jsx)(el,{icon:"grip-vertical",iconStyle:"solid"})}),t?(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Nl,{value:e.segment.name,onChange:s})}):(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 textSm medium",children:e.segment.name}),(0,i.jsx)(El,{color:"white",leftIcon:t?"check":"pen",size:"sm",onClick:()=>n(!t)}),(0,i.jsx)(El,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:o})]})})},BR=e=>{const[t,n]=L.useState(!1),s=L.useCallback(t=>{e.setSegmentsFolders((0,pu.jM)(n=>{n[e.index].name=t}))},[e.index,e.setSegmentsFolders]);return(0,i.jsx)(fu.sx,{draggableId:`sf-${e.segmentFolder.id}`,index:e.index,children:o=>(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",...o.draggableProps,ref:o.innerRef,children:[(0,i.jsxs)(Na,{align:"center",css:{padding:"$4"},gap:"3",children:[(0,i.jsx)(yr,{color:"gray300",css:{cursor:"pointer"},fontSize:"textMd",...o.dragHandleProps,children:(0,i.jsx)(el,{icon:"grip-vertical",iconStyle:"solid"})}),t?(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Nl,{value:e.segmentFolder.name,onChange:s})}):(0,i.jsx)(yr,{css:{flex:"1"},font:"gray800 textMd medium",children:e.segmentFolder.name}),(0,i.jsx)(El,{color:"white",leftIcon:t?"check":"pen",size:"sm",onClick:()=>n(!t)}),(0,i.jsx)(El,{color:"white",disabled:!e.canDelete,leftIcon:"trash-can",size:"sm",onClick:()=>{e.setSegmentsFolders(t=>t.filter(t=>t!==e.segmentFolder))}})]}),(0,i.jsx)(fu.gL,{droppableId:`drop-sf-${e.segmentFolder.id}`,type:"segment",children:t=>(0,i.jsxs)(Na,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",...t.droppableProps,ref:t.innerRef,children:[e.segmentFolder.segments.map((t,n)=>(0,i.jsx)(LR,{canDelete:e.segmentFolder.segments.length>1,index:n,segment:t,segmentFolderIndex:e.index,setSegmentsFolders:e.setSegmentsFolders},t.id)),t.placeholder]})})]})})},VR=e=>{const t=Yn(),{segmentsFolders:n}=gy(),{mutate:s,isLoading:o}=function(e={}){return Xn("mutation SegmentsFoldersReorder(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentType: SegmentType!\n $segmentsFolders: [SegmentFolderReorderInput!]!\n) {\n segmentsFoldersReorder(\n organizationId: $organizationId\n eventId: $eventId\n segmentType: $segmentType\n segmentsFolders: $segmentsFolders\n )\n}\n",e)}(),[r,a]=(0,L.useState)(n.map(e=>({id:e.id,name:e.name,segments:e.segments.map(e=>({id:e.id,name:e.name}))}))),l=(0,L.useCallback)(async()=>{await s({organizationId:e.organizationId,eventId:e.eventId,segmentType:e.segmentType,segmentsFolders:r.map(e=>({...e,id:!e.id||e.id<0?void 0:e.id}))}),e.onClose(),e.onSuccess()},[e.organizationId,e.eventId,e.segmentType,r]),d=(0,L.useCallback)(({reason:e,source:t,destination:n})=>{if("DROP"===e&&n&&t.index!==n.index&&"main"===t.droppableId&&"main"===n.droppableId)a(ro(r,t.index,n.index));else if("DROP"===e&&n&&(t.droppableId!==n.droppableId||t.index!==n.index)&&t.droppableId.startsWith("drop-sf-")&&n.droppableId.startsWith("drop-sf-")){const e=parseInt(t.droppableId.substring(8),10),i=parseInt(n.droppableId.substring(8),10);a(e!==i?(0,pu.jM)(s=>{const o=s.find(t=>t.id===e),r=s.find(e=>e.id===i),a=o.segments.find((e,n)=>n===t.index);o.segments=(0,dc.A)(o.segments,a),r.segments.splice(n.index,0,a)}):(0,pu.jM)(i=>{const s=i.find(t=>t.id===e);s.segments=ro(s.segments,t.index,n.index)}))}},[r,a]);return(0,i.jsx)(Pm,{button:(0,i.jsx)(El,{isLoading:o,onClick:l,children:t("enregistrer_06519")}),category:t("vues_personnali_80652"),heading:t("param_tres_de_v_66378"),onClose:e.onClose,children:(0,i.jsxs)($m,{css:{background:"white"},children:[(0,i.jsxs)(Na,{align:"center",gap:"6",justify:"between",children:[(0,i.jsx)(yr,{font:"gray900 textLg semiBold",children:t("organisation_de_95776")}),(0,i.jsx)(El,{color:"white",leftIcon:"folder-plus",onClick:()=>{const e=Math.min((0,ih.A)(r,e=>e.id)?.id??0,0);a([...r,{id:e-1,name:t("nouveau_dossier_94479"),segments:[]}])},children:t("nouveau_dossier_94479")})]}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsx)(fu.JY,{onDragEnd:d,children:(0,i.jsx)(fu.gL,{droppableId:"main",type:"segmentFolder",children:e=>(0,i.jsxs)(Na,{direction:"column",gap:"6",width:1,...e.droppableProps,ref:e.innerRef,children:[r.map((e,t)=>(0,i.jsx)(BR,{canDelete:r.length>1,index:t,segmentFolder:e,setSegmentsFolders:a},t)),e.placeholder]})})})]})})},UR=pr("div",{alignItems:"center",borderRadius:"$2",cursor:"pointer",display:"flex",gap:"$4",padding:"$4",userSelect:"none","&:hover":{boxShadow:"$xs"},"& .radio-row-text":{flex:1,fontWeight:"$medium"},"& .radio-row-button":{alignItems:"center",borderRadius:"16px",color:"white",display:"flex",fontSize:"10px",height:"16px",justifyContent:"center",width:"16px"},variants:{state:{unchecked:{background:"white",border:"1px solid $gray200","&:hover":{background:"$gray50"},"& .radio-row-text":{color:"$gray700"},"& .radio-row-button":{background:"white",border:"1px solid $gray300"}},checked:{background:"$primary100",border:"1px solid $primary700",boxShadow:"$xs","& .radio-row-text":{color:"$primary800"},"& .radio-row-button":{background:"$primary700",border:"1px solid $primary700"}}}},defaultVariants:{state:"unchecked"}}),WR=e=>(0,i.jsxs)(UR,{state:e.state,onClick:()=>{"unchecked"!==e.state&&e.state?e.onClick("unchecked"):e.onClick("checked")},children:[(0,i.jsx)("div",{className:"radio-row-text",children:e.children}),(0,i.jsx)("div",{"aria-describedby":e.descId,className:"radio-row-button",id:e.inputId,role:"radio",children:"checked"===e.state&&(0,i.jsx)(el,{icon:"check"})})]}),GR=({description:e,label:t,name:n,value:s})=>{const{inputId:o,descId:r}=Ga();return(0,i.jsx)(Ua.D0,{name:n,render:n=>{const a=n.input.checked?"checked":"unchecked";return(0,i.jsx)(WR,{descId:r,inputId:o,state:a,onClick:()=>{n.input.onChange(s)},children:(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(Pl,{htmlFor:o,children:(0,i.jsx)(yr,{children:t})}),e&&(0,i.jsx)(yr,{fontWeight:"regular",id:r,children:e})]})})},type:"radio",value:s})},HR=e=>{const t=Yn(),{eventId:n,organizationId:s,segmentsFolders:o,reload:r}=gy(),{mutate:a}=function(e={}){return Xn("mutation SegmentMoveFolder(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n $segmentFolderId: SegmentsFolderId!\n) {\n segmentMoveFolder(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n segmentFolderId: $segmentFolderId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsxs)(Jj,{buttonText:t("d_placer_la_vue_27440"),icon:"sliders",initialValues:{segmentFolderId:e.segment.segmentFolderId},size:"md",title:t("d_placer_la_vue_55115",e.segment.name),onClose:e.onClose,onSubmit:async t=>{await a({organizationId:s,eventId:n,segmentId:e.segment.id,segmentFolderId:t.segmentFolderId}),r(),e.onClose()},children:[(0,i.jsx)(yr,{color:"gray900",fontWeight:"medium",children:t("vers_quel_dossi_86452")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Na,{css:{overflowY:"auto"},direction:"column",gap:"3",children:o.map(e=>(0,i.jsx)(GR,{label:e.name,name:"segmentFolderId",value:e.id},e.id))})]})},qR=e=>{const{translate:t}=_l(),{eventId:n,organizationId:s,segmentsFolders:o,reload:r}=gy(),{mutate:a,isLoading:l}=function(e={}){return Xn("mutation SegmentUpdateMetadata(\n $organizationId: OrganizationId!\n $eventId: EventId\n $description: String\n $segmentFolderId: SegmentsFolderId!\n $segmentId: SegmentId!\n $name: String!\n) {\n segmentUpdateMetadata(\n organizationId: $organizationId\n eventId: $eventId\n description: $description\n segmentFolderId: $segmentFolderId\n segmentId: $segmentId\n name: $name\n ) {\n id\n }\n}\n",e)}(),[d,c]=(0,L.useState)(e.segment.name),[u,h]=(0,L.useState)(e.segment.segmentFolderId),[g,p]=(0,L.useState)(e.segment.description||void 0),f=m(d);return(0,i.jsx)(Rb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"gear",subtitle:t("mettez_jour_l_55467"),children:t("mise_jour_de_80873")}),(0,i.jsxs)(Tb,{gap:"4",children:[(0,i.jsx)(Nl,{label:t("nom_de_la_vue_66415"),value:d,onChange:c}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("dossier_00726"),shouldParseAsInt:!0,values:[u],onChange:e=>{no(e)&&h(e[0])},children:o.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Wm,{label:t("Description"),value:g,onChange:p})]}),(0,i.jsx)(Eb,{children:()=>(0,i.jsx)(El,{disabled:!f,isLoading:l,onClick:async()=>{await a({organizationId:s,eventId:n,description:g,name:d,segmentFolderId:u,segmentId:e.segment.id}),r()},children:t("mettre_jour_85141")})})]})})},YR=pr("div",{alignItems:"center",color:"$gray700",cursor:"pointer",display:"flex",height:"32px",gap:"$space$2",px:"$3",width:"100%","&:hover":{"& .count":{background:"$primary700",color:"white"}},"& .name":{flex:"1",ellipsis:""},"& .count, & .count-admin":{borderRadius:"16px",fontSize:"$textXs",px:"8px",py:"2px"},"& .ellipsis":{display:"none"},"&:hover .count-admin":{display:"none"},"&:hover .ellipsis":{color:"$gray700",display:"block","& .trigger":{alignItems:"center",display:"flex",height:"32px",justifyContent:"end",px:"8px",width:"32px"}},variants:{selected:{true:{background:"$primary200",borderRadius:"$1",color:"$primary700","& .count":{background:"$primary700",color:"white"},"& .count, & .count-admin":{background:"$primary700",color:"white"}},false:{"&:hover":{background:"$gray100",borderRadius:"$1",color:"$gray800"},"& .count, & .count-admin":{background:"$primary50",color:"$primary700"}}}}}),KR=(0,L.memo)(function(e){const{history:t,translate:n}=_l(),{canEditSegments:s,eventId:o,organizationId:r,segmentId:a,getSegmentPath:l,onSegmentClick:d,reload:c}=gy(),{mutate:u}=function(e={}){return Xn("mutation SegmentDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentDelete(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),{mutate:h}=function(e={}){return Xn("mutation SegmentDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentDuplicate(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),{mutate:m}=function(e={}){return Xn("mutation SegmentMoveDown(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentMoveDown(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),{mutate:g}=function(e={}){return Xn("mutation SegmentMoveUp(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n) {\n segmentMoveUp(organizationId: $organizationId, eventId: $eventId, segmentId: $segmentId) {\n id\n }\n}\n",e)}(),[p,f]=(0,L.useState)(!1),[x,_]=(0,L.useState)(!1),[I,v]=(0,L.useState)(!1);return(0,i.jsxs)(YR,{selected:e.segment.id===a,onClick:()=>{d(e.segment.id),t.push(l(e.segment.id))},onMouseLeave:e=>{Nd(e.target)},children:[(0,i.jsx)("div",{className:"name",title:e.segment.name,children:e.segment.name}),(0,i.jsx)("div",{className:s?"count-admin":"count",children:e.segment.count}),s&&(0,i.jsx)("div",{className:"ellipsis",onClick:Rl,children:(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)("div",{className:"trigger",children:(0,i.jsx)("i",{className:"fa-regular fa-ellipsis-vertical"})})}),(0,i.jsxs)(qd,{offset:0,placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{f(!0)},children:n("mettre_jour_85141")}),e.canMoveUpDown&&(0,i.jsx)(Gd,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await g({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("d_placer_vers_l_49863")}),e.canMoveUpDown&&(0,i.jsx)(Gd,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await m({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("d_placer_vers_l_52432")}),e.canMoveFolder&&(0,i.jsx)(Gd,{icon:"folder",onClick:()=>{_(!0)},children:n("d_placer_de_dos_65513")}),e.canDelete&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>{await h({organizationId:r,eventId:o,segmentId:e.segment.id}),c()},children:n("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{v(!0)},children:n("supprimer_43083")})]})]})]})}),p&&(0,i.jsx)(qR,{segment:e.segment,onClose:()=>{f(!1)}}),x&&(0,i.jsx)(HR,{segment:e.segment,onClose:()=>{_(!1)}}),I&&(0,i.jsx)(sA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_38950"),text:n("suppression_de_73669",e.segment.name),onClose:()=>{v(!1)},onDelete:async()=>{await u({organizationId:r,eventId:o,segmentId:e.segment.id}),c(),await e.onDelete()},children:e.segment.isUsedInWorkflow&&(0,i.jsx)(sl,{color:"warning",leftIcon:"circle-exclamation",children:n("cette_vue_est_u_58409")})})]})}),ZR=e=>{const t=Yn(),{canEditSegments:n,eventId:s,organizationId:o,reload:r,segmentType:a}=gy(),{mutate:l}=function(e={}){return Xn("mutation SegmentFolderDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n) {\n segmentFolderDelete(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n ) {\n id\n }\n}\n",e)}(),{mutate:d}=function(e={}){return Xn("mutation SegmentFolderMoveDown(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n) {\n segmentFolderMoveDown(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n ) {\n id\n }\n}\n",e)}(),{mutate:c}=function(e={}){return Xn("mutation SegmentFolderMoveUp(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n) {\n segmentFolderMoveUp(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n ) {\n id\n }\n}\n",e)}(),[u,h]=(0,L.useState)(!1),[g,p]=(0,L.useState)(!1),[f,x]=(0,L.useState)(!1),[_,I]=(0,L.useState)(!1),v=(0,L.useCallback)(async()=>{const t=!f;x(t),await hI.segmentsFolders.put({id:e.segmentFolder.id,isOpen:t})},[f,e.segmentFolder.id]),b=(0,L.useMemo)(()=>m(e.search)?e.segmentFolder.segments.filter(t=>t.name.toLowerCase().includes(e.search.toLowerCase())):e.segmentFolder.segments,[e.segmentFolder.segments,e.search]);return(0,L.useEffect)(()=>{(async()=>{x((await hI.segmentsFolders.get(e.segmentFolder.id))?.isOpen??!0)})()},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer",userSelect:"none","& .ellipsis":{display:"none"},"&:hover .ellipsis":{display:"block"}},gap:"2",onClick:v,children:[(0,i.jsx)(yr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(el,{icon:f?"chevron-down":"chevron-right"})}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 textXs semiBold",children:e.segmentFolder.name}),n&&(0,i.jsx)(yr,{className:"ellipsis",onClick:Rl,children:(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(Na,{align:"center",css:{color:"$gray500",px:"$2"},justify:"end",width:24,children:(0,i.jsx)(el,{icon:"ellipsis-vertical"})})}),(0,i.jsxs)(qd,{offset:0,placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{h(!0)},children:t("renommer_42135")}),(0,i.jsx)(Gd,{icon:"gear",onClick:()=>{I(!0)},children:t("r_ordonner_41823")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Gd,{color:e.isLast?"disabled":"default",icon:"arrow-down",onClick:async()=>{await d({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),r()},children:t("d_placer_vers_l_52432")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Gd,{color:e.isFirst?"disabled":"default",icon:"arrow-up",onClick:async()=>{await c({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),r()},children:t("d_placer_vers_l_49863")}),e.canDeleteSegmentFolder&&(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:t("supprimer_43083")})]})]})})]}),b.length>0&&f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Na,{direction:"column",gap:"1",children:b.map((t,n)=>(0,i.jsx)(KR,{canDelete:e.canDeleteSegment,canMoveFolder:e.canDeleteSegmentFolder,canMoveUpDown:e.segmentFolder.segments.length>1,isFirst:0===n,isLast:n===e.segmentFolder.segments.length-1,segment:t,onDelete:e.onSegmentDelete},t.id))})]}),(0,i.jsx)(qa,{height:"5"})]}),u&&(0,i.jsx)(NR,{isEdit:!0,segmentFolder:e.segmentFolder,onClose:()=>{h(!1)}}),g&&(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_13885"),text:t("suppression_de_73669",e.segmentFolder.name),onClose:()=>{p(!1)},onDelete:async()=>{await l({organizationId:o,eventId:s,segmentFolderId:e.segmentFolder.id}),r()}}),_&&(0,Ht.createPortal)((0,i.jsx)(yr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(VR,{eventId:s,organizationId:o,segmentType:a,onClose:()=>{I(!1)},onSuccess:()=>(r(),e.onSegmentDelete())})}),document.body)]})},XR=e=>{const t=Yn(),{canEditSegments:n,segmentsFolders:s}=gy(),[o,r]=(0,L.useState)(!1),a=(0,L.useMemo)(()=>s.flatMap(e=>e.segments).length>1,[s]),[l,d]=(0,L.useState)(""),c=(0,L.useMemo)(()=>m(l)?s.filter(e=>e.segments.some(e=>e.name.toLowerCase().includes(l.toLowerCase()))):s,[s,l]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(cd,{css:{background:"white",borderRight:"1px solid $gray200",overflow:"hidden"},gridtemplaterows:"1fr 48px",height:1,width:1,children:[(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7 $4"},direction:"column",width:1,children:[(0,i.jsx)(Na,{align:"center",children:(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},fontSize:"textMd",fontWeight:"semiBold",children:t("vues_personnali_80652")})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:l,onChange:d})}),(0,i.jsx)(qa,{height:"4"}),c.map((t,n)=>(0,i.jsx)(ZR,{canDeleteSegment:a,canDeleteSegmentFolder:s.length>1,isFirst:0===n,isLast:n===s.length-1,search:l,segmentFolder:t,onSegmentDelete:e.onSegmentDelete},t.id))]}),n&&(0,i.jsxs)(Na,{align:"center",css:{borderTop:"1px solid $gray200",cursor:"pointer",padding:"$3 $6"},gap:"4",width:1,onClick:()=>{r(!0)},children:[(0,i.jsx)(el,{icon:"plus"}),(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",children:t("nouveau_dossier_94479")})]})]}),o&&(0,i.jsx)(NR,{isEdit:!1,onClose:()=>{r(!1)}})]})},JR=()=>{const{history:e,translate:t}=_l(),{columns:n,columnsExport:s,columnsSearch:o,eventId:r,getSegmentPath:a,infos:l,organizationId:d,predicates:c,reload:u,rendering:h,segment:g,segmentId:p,segmentType:f,segmentsFolders:x,sort:_,setIsSaveSegmentVisible:I}=gy(),v=(0,L.useCallback)(()=>{I(!1)},[I]),{mutate:b,isLoading:j}=function(e={}){return Xn("mutation SegmentUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n $segmentId: SegmentId!\n $segment: SegmentInput!\n) {\n segmentUpdate(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n segmentId: $segmentId\n segment: $segment\n ) {\n id\n }\n}\n",e)}(),{mutate:C,isLoading:y}=function(e={}){return Xn("mutation SegmentCreate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentFolderId: SegmentsFolderId!\n $segment: SegmentInput!\n) {\n segmentCreate(\n organizationId: $organizationId\n eventId: $eventId\n segmentFolderId: $segmentFolderId\n segment: $segment\n ) {\n id\n }\n}\n",e)}(),[k,A]=(0,L.useState)(!1),[w,S]=(0,L.useState)(""),[E,T]=(0,L.useState)(x.find(e=>e.segments.find(e=>e.id===p))?.id??x[0].id),[z,O]=(0,L.useState)(g.description||void 0),R=!k||m(w);return(0,i.jsx)(Rb,{isOpen:!0,onClose:v,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"floppy-disk",subtitle:t("sauvegarder_vos_15289"),children:t("enregistrer_une_52986")}),(0,i.jsxs)(Tb,{children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_33936")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(xc,{css:{"& label > div > div":{fontWeight:"$regular"}},state:k?"unchecked":"checked",onClick:()=>{A(!1)},children:t("enregistrer_les_31603").split("{1}").map((e,t)=>1===t?(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Zm,{fontWeight:"medium",children:g.name}),e]},t):(0,i.jsx)(L.Fragment,{children:e},t))}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(xc,{css:{"& label > div > div":{fontWeight:"$regular"}},state:k?"checked":"unchecked",onClick:()=>{A(!0)},children:t("cr_er_une_nouve_37002")}),k&&(0,i.jsx)(yr,{css:{marginLeft:"$6"},children:(0,i.jsx)(Nl,{hint:t("cette_vue_sera_83858"),placeholder:t("nom_de_votre_no_21748"),value:w,onChange:S})})]})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("dans_quel_dossi_07643"),shouldParseAsInt:!0,values:[E],onChange:e=>{no(e)&&T(e[0])},children:x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Wm,{label:t("Description"),placeholder:t("entrer_une_desc_74340"),value:z,onChange:O})]}),(0,i.jsx)(Eb,{children:()=>(0,i.jsx)(El,{disabled:!R,isLoading:y||j,onClick:async()=>{const t={segmentType:f,name:w,description:z,predicates:c,columns:n,columnsExport:s,columnsSearch:o,sort:_,rendering:h,infos:l};if(k){const{segmentCreate:{id:n}}=await C({organizationId:d,eventId:r,segmentFolderId:E,segment:t});u(),e.push(a(n))}else await b({organizationId:d,eventId:r,segmentFolderId:E,segmentId:p,segment:t}),u()},children:t("enregistrer_06519")})})]})})},QR=e=>{const t=Yn(),{areColumnsOpen:n,areSegmentsOpen:s,clearNameCursors:o,columns:r,filters:a,hideSegments:l,isFilterOpen:d,isSaveSegmentVisible:c,possibleColumns:u,predicates:h,selectedFilterPredicate:m,setAreColumnsOpen:g,setColumns:p,setIsFilterOpen:f,setPredicates:x}=gy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{height:1,width:1,children:[!0!==l&&s&&(0,i.jsx)(yr,{css:{overflow:"hidden"},height:1,width:260,children:(0,i.jsx)(XR,{onSegmentDelete:e.onSegmentDelete})}),(0,i.jsx)(Na,{css:{flex:"1",overflowY:"auto"},direction:"column",height:1,children:e.children})]}),d&&(0,i.jsx)(sm,{buttonText:e.filtersButtonText,possibleFilters:a,predicates:h,selectedFilterPredicate:m,subtitle:e.filtersSubtitle,onClose:()=>{f(!1)},onFilter:e=>{o(),x(e)}}),n&&(0,i.jsx)(Cu,{columns:u,initialSelectedColumns:r,saveButtonText:t("_diter_les_colo_39630"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_03763"),title:t("_dition_des_col_70300"),onClose:()=>{g(!1)},onSave:p}),c&&(0,i.jsx)(JR,{})]})},e$=e=>{const[t,n]=L.useState(e.segmentsFolders),s=L.useMemo(()=>t.flatMap(e=>e.segments),[t]),o=L.useMemo(()=>s.find(t=>t.id===e.segmentId),[e.segmentId,s]),[r,a]=L.useState(o.predicates),[l,d]=L.useState(o.columns),[c,u]=L.useState(o.columnsExport),[h,m]=L.useState(o.columnsSearch),[g,p]=L.useState(o.rendering),[f,x]=L.useState(o.sort),[_,I]=L.useState(o.infos),v=L.useMemo(()=>JSON.stringify(o.predicates),[o]),b=L.useMemo(()=>JSON.stringify(o.columns),[o]),j=L.useMemo(()=>JSON.stringify(o.columnsExport),[o]),C=L.useMemo(()=>JSON.stringify(o.columnsSearch),[o]),y=L.useMemo(()=>JSON.stringify(o.rendering),[o]),k=L.useMemo(()=>JSON.stringify(o.sort),[o]),A=L.useMemo(()=>JSON.stringify(o.infos),[o]),[w]=L.useMemo(()=>hu(r,e.filters),[r,e.filters]),[S,E]=L.useState(!1),[T,z]=L.useState(!1),[O,R]=L.useState(!1),[$,D]=L.useState(null),[P,F]=L.useState(!1),[M,N]=L.useState(e.initialSegmentsOpen??!0),B=L.useCallback(t=>{e.onSegmentsToggle?.(t),N(t)},[N]),V=L.useMemo(()=>JSON.stringify(r)!==v||JSON.stringify(l)!==b||JSON.stringify(g)!==y||JSON.stringify(c)!==j||JSON.stringify(h)!==C||JSON.stringify(f)!==k||JSON.stringify(_)!==A,[v,r,b,l,y,g,j,c,C,h,k,f,_,A]),[U,W]=L.useState(""),[G,H]=L.useState(""),[q,Y]=L.useState(e.initialLimit),[K,Z]=L.useState(0),X=Lc(e=>{H(e),ee()}),[J,Q]=L.useState(1),ee=L.useCallback(()=>{Z(0)},[Z]),te=L.useCallback(t=>{Y(t),e.setLimit(t),ee()},[Y,ee]),ne=L.useCallback(()=>{W(""),H(""),ee()},[W,H,ee]),ie=yu({}),se=L.useCallback(()=>{ie.toggleSelectAll("unchecked"),Q(J+1)},[ie,J]),oe=L.useMemo(()=>ie.isAllSelected?o.id:null,[ie,o]),re=L.useCallback(e=>{x(e),Z(0)},[x,Z]),ae=L.useCallback((e,i)=>{n((0,pu.jM)(t,t=>{t.forEach(t=>{t.segments.forEach(t=>{t.id===e&&(t.count=i)})})}))},[t,n]);return L.useEffect(()=>{a(o.predicates),d(o.columns),u(o.columnsExport),m(o.columnsSearch),p(o.rendering),x(o.sort),I(o.infos),W(""),H(""),ee(),Q(1)},[o]),L.useEffect(()=>{n(e.segmentsFolders)},[e.segmentsFolders]),(0,i.jsx)(my.Provider,{value:{areColumnsOpen:O,areSegmentsOpen:M,canEditSegments:e.canEditSegments,clearNameCursors:ne,columns:l,columnsExport:c,columnsSearch:h,eventId:e.eventId,filters:e.filters,filtersPredicates:w,getSegmentPath:e.getSegmentPath,hideSegments:e.hideSegments,infos:_,isEditMode:S,isFilterOpen:T,isSaveSegmentVisible:P,isSaveVisible:V,limit:q,massActions:ie,massEditSegmentId:oe,name:U,nameDebounced:G,offset:K,onMassEditSuccess:se,onSegmentClick:e.onSegmentClick,organizationId:e.organizationId,possibleColumns:e.possibleColumns,possibleRenderings:e.possibleRenderings,predicates:r,reload:e.reload,reloadKey:J,rendering:g,segment:o,segmentId:e.segmentId,segmentType:e.segmentType,segmentsFolders:t,selectedFilterPredicate:$,setAreColumnsOpen:R,setAreSegmentsOpen:B,setColumns:d,setColumnsExport:u,setColumnsSearch:m,setInfos:I,setIsEditMode:E,setIsFilterOpen:z,setIsSaveSegmentVisible:F,setLimit:te,setName:W,setNameDebounced:X,setOffset:Z,setPredicates:a,setReloadKey:Q,setRendering:p,setSegmentCount:ae,setSelectedFilterPredicate:D,setSort:re,sort:f},children:(0,i.jsx)(QR,{filtersButtonText:e.filtersButtonText,filtersSubtitle:e.filtersSubtitle,onSegmentDelete:e.onSegmentDelete,children:e.children})})};let t$=class extends gu{constructor(e,t,n){super(e,t,n)}getCampaignsFilters(e){return[{slug:"state",name:this.t("status_06428"),category:this.t("Campaigns"),fieldType:We.Select,values:Xt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"campaign_type",name:this.t("type_35427"),category:this.t("Campaigns"),fieldType:We.Select,values:Jt.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"created_by",name:this.t("cr_e_par_30622"),category:this.t("Campaigns"),fieldType:We.Select,values:e.map(e=>({id:e.userId,name:e.nameOrEmail})),hideEmpty:!0},{slug:"sent_at",name:this.t("envoy_le_60398"),category:this.t("Campaigns"),fieldType:We.Date,hideEmpty:!0}]}};t$=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],t$);const n$=e=>{const{translate:t}=_l(),{columnsSearch:n,setColumnsSearch:s}=gy(),[o,r]=(0,L.useState)(""),a=(0,L.useMemo)(()=>m(o)?e.searchableColumns.filter(e=>e.name.toLowerCase().trim().includes(o.toLowerCase().trim())):e.searchableColumns,[e.searchableColumns,o]);return(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",css:{borderLeft:"none",borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"bars-filter"})}),(0,i.jsx)(qd,{css:{padding:"0"},maxHeight:350,placement:"bottom-end",width:320,children:(0,i.jsxs)(Na,{css:{padding:"$4 $6"},direction:"column",gap:"3",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("rechercher_sur_85243")}),(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("filtrer_78031"),state:"search",value:o,onChange:r}),(0,i.jsx)(Na,{direction:"column",gap:"3",children:a.map(({slug:e,name:t})=>(0,i.jsx)(gc,{state:n.includes(e)?"checked":"unchecked",onClick:t=>{s(so(n,e,"checked"===t))},children:t},e))})]})})]})},i$=e=>{const t=Yn(),{canEditSegments:n,isEditMode:s,isSaveVisible:o,massActions:r,name:a,possibleColumns:l,possibleRenderings:d,rendering:c,setAreColumnsOpen:u,setIsEditMode:h,setIsFilterOpen:m,setIsSaveSegmentVisible:g,setName:p,setNameDebounced:f,setRendering:x,setSelectedFilterPredicate:_}=gy(),I=e.showActions&&e.actions&&r.numberOfSelected>0,v=L.useMemo(()=>(0,lc.A)(l.filter(e=>e.isSearchable),e=>e.name),[l]),b=L.useMemo(()=>e.showSearchColumns?{"& .h-styled-input-container":{borderBottomRightRadius:"0",borderTopRightRadius:"0"}}:{},[e.showSearchColumns]);return dm("e",L.useCallback(()=>{h(!s)},[s,h])),(0,i.jsxs)(Na,{align:"center",gap:"4",children:[(0,i.jsxs)(Na,{width:320,children:[(0,i.jsx)(Nl,{css:b,icon:"magnifying-glass",placeholder:e.searchPlaceholder,value:a,onChange:e=>{p(e),f(e)}}),e.showSearchColumns&&(0,i.jsx)(n$,{searchableColumns:v})]}),n&&(0,i.jsx)(El,{color:"gray",leftIcon:"bars-filter",onClick:()=>{_(null),m(!0)},children:t("filtres_64574")}),(0,i.jsx)(yr,{css:{flex:"1"},children:n&&o&&(0,i.jsx)(El,{color:"invisible",onClick:()=>{g(!0)},children:t("enregistrer_la_22884")})}),!I&&e.showEditColumns&&(0,i.jsx)(El,{color:"invisible",css:{color:"$gray800","&:hover":{color:"$gray800"}},leftIcon:"gear",onClick:()=>{u(!0)},children:t("_diter_les_colo_39630")}),!I&&e.showEditMode&&(0,i.jsx)(ju,{value:s,onChange:h,children:t("mode_dition_93778")}),!I&&no(d)&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:Vh(c),children:Uh(t,c)})}),(0,i.jsx)(qd,{placement:"bottom-end",children:d.map(e=>(0,i.jsx)(Gd,{icon:Vh(e),onClick:()=>x(e),children:Uh(t,e)},e))})]}),I&&e.actions]})},s$=()=>{const e=Yn(),t=qn(gu),{filtersPredicates:n,clearNameCursors:s,setPredicates:o,setIsFilterOpen:r,setSelectedFilterPredicate:a,predicates:l}=gy(),d=(0,L.useCallback)(()=>{s(),o([])},[s,o]),c=(0,L.useCallback)(e=>{a(e),r(!0)},[r,a]),u=(0,L.useCallback)(e=>{s(),o((0,dc.A)(l,e.predicate))},[l,s,o]);return em(n),no(n)?(0,i.jsxs)(Na,{align:"center",gap:"3",width:1,wrap:"wrap",children:[n.map((e,n)=>e.filter.needLoading?(0,i.jsx)(ic,{leftIcon:"loader"},n):(0,i.jsx)(ic,{cursor:"pointer",ellipsis:!0,rightIcon:"xmark",onContentClick:()=>{c(e)},onRightIconClick:()=>{u(e)},children:t.filterPredicateToText(e)},n)),(0,i.jsx)(yr,{color:"gray700",css:{cursor:"pointer"},fontWeight:"medium",onClick:d,children:e("r_initialiser_l_66835")})]}):null},o$=e=>{const{canEditSegments:t,limit:n,massActions:s}=gy(),o=t&&s.numberOfSelected===n;return(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderBottom:"none",borderTopLeftRadius:"$2",borderTopRightRadius:"$2",padding:"$3 $4"},direction:"column",gap:"4",width:1,children:[e.searchRow,(0,i.jsx)(s$,{}),o&&e.selectSegment]})},r$=e=>{const{translate:t,params:{organizationId:n,segmentId:s}}=_l(),{areSegmentsOpen:o,hideSegments:r,segment:a,setAreSegmentsOpen:l,setSegmentCount:d}=gy(),{data:c}=Zn("query SegmentHeader($organizationId: OrganizationId!, $segmentId: SegmentId!) {\n organization(id: $organizationId) {\n segment(id: $segmentId) {\n count(shouldCompute: true)\n }\n }\n}\n",{organizationId:n,segmentId:a.id},[]);return L.useEffect(()=>{a.id===s&&d(a.id,c.organization?.segment.count??a.count)},[s,a,c.organization,d]),(0,i.jsx)(tj,{children:(0,i.jsxs)(Na,{align:"center",gap:"4",width:1,children:[!r&&(0,i.jsx)(Na,{css:{cursor:"pointer",padding:"$2"},onClick:()=>l(!o),children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"sidebar"})})}),(0,i.jsx)(Cm,{placement:"top",children:t(o?"masquer_la_list_94215":"afficher_la_lis_48771")})]})}),e.name||(0,i.jsxs)(yr,{css:{flex:"1"},font:"gray900 displayXs medium",children:[(0,i.jsxs)(Na,{align:"center",gap:"4",children:[(0,i.jsx)(yr,{children:a.name}),a.isUsedInWorkflow&&(0,i.jsx)(ic,{color:"white",leftIcon:"bolt-auto",children:t("utilis_e_dans_u_46582")})]}),a.description&&(0,i.jsx)(yr,{css:{whiteSpace:"pre-wrap"},font:"gray500 textXs medium",children:a.description})]}),e.children]})})},a$=()=>{const{translate:e,history:t,params:{organizationId:n}}=_l();return(0,i.jsx)(r$,{children:(0,i.jsx)(Bb,{permissions:Nb.CAMPAIGN_SEND,children:(0,i.jsx)(KS,{menu:(0,i.jsx)(Gd,{icon:"paper-plane",onClick:()=>{t.push(SI.CREATE_TEMPLATE({organizationId:n}))},children:e("cr_er_un_mod_le_20298")}),onClick:()=>{t.push(SI.CREATE({organizationId:n}))},children:e("cr_er_une_campa_96023")})})})};function l$(e){switch(e){case ue.Draft:return{color:"gray",leftIcon:"pen-ruler"};case ue.Done:return{color:"success",leftIcon:"check"};case ue.InProgress:return{color:"warning",leftIcon:"hourglass-empty"};case ue.Scheduled:return{color:"primary",leftIcon:"calendar"};case ue.Template:return{color:"purple",leftIcon:"paper-plane"};default:return rl()}}const d$=e=>{const{history:t,translate:n}=_l(),{showNotification:s}=kb(),{mutate:o}=function(e={}){return Xn("mutation CampaignDuplicate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaignId: CampaignId!\n) {\n campaignDuplicate(organizationId: $organizationId, eventId: $eventId, campaignId: $campaignId) {\n id\n }\n}\n",e)}(),{mutate:r}=function(e={}){return Xn("mutation CampaignSend(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaignId: CampaignId!\n) {\n campaignSend(organizationId: $organizationId, eventId: $eventId, campaignId: $campaignId) {\n id\n }\n}\n",e)}(),{mutate:a}=function(e={}){return Xn("mutation CampaignDelete(\n $organizationId: OrganizationId!\n $eventId: EventId\n $campaignId: CampaignId!\n) {\n campaignDelete(organizationId: $organizationId, eventId: $eventId, campaignId: $campaignId) {\n id\n }\n}\n",e)}(),[l,d]=(0,L.useState)(!1),c=e.campaign.state===ue.Draft||e.campaign.state===ue.Scheduled;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{t.push(SI.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}))},children:n("_diter_62574")}),c&&(0,i.jsx)(Gd,{icon:"paper-plane",onClick:async()=>{await r({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id}),e.reload()},children:n("envoyer_26609")}),(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>{const{campaignDuplicate:{id:n}}=await o({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id});t.push(SI.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:n}))},children:n("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:e=>{Nd(e.target),d(!0)},children:n("supprimer_43083")})]}),l&&(0,i.jsx)(sA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_58075"),text:n("suppression_de_73669",e.campaign.name),onClose:()=>{d(!1)},onDelete:async()=>{await a({organizationId:e.organizationId,eventId:e.eventId,campaignId:e.campaign.id}),s(n("la_campagne_1_92813",e.campaign.name)),e.reload()}})]})},c$=e=>{const{translate:t}=_l(),n=qn(Kc),s=e.campaign.sentAt?.setZone(Us.c9.local().zone);return(0,i.jsxs)(Dc,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{Nd(e.target)},children:[(0,i.jsx)(Ec,{children:(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsx)(qc,{to:SI.CAMPAIGN_DASHBOARD({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id}),children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.campaign.name,children:e.campaign.name})}),e.campaign.state===ue.Done&&s&&(0,i.jsx)(yr,{color:"gray500",children:t("envoy_e_le_1_90336",n.toLocaleString(s,Js.DateTime),e.campaign.createdBy?.nameOrEmail??"")}),e.campaign.state===ue.Scheduled&&e.campaign.scheduledAt?.isValid&&(0,i.jsx)(yr,{color:"gray500",children:t("programm_e_le_58279",n.toLocaleString(e.campaign.scheduledAt,Js.DateOnly.MonthLong),n.toLocaleString(e.campaign.scheduledAt,Js.TimeOnly))})]})}),(0,i.jsxs)(Ec,{css:{flex:"0 150px"},children:[(0,i.jsx)(yr,{width:22,children:e.campaign.campaignType===he.Email?(0,i.jsx)(el,{icon:"at"}):(0,i.jsx)(el,{icon:"message"})}),e.campaign.campaignType]}),(0,i.jsx)(Ec,{css:{flex:"0 200px",justifyContent:"flex-end"},children:e.campaign.numberOfRecipients}),(0,i.jsx)(Ec,{css:{flex:"0 150px",justifyContent:"flex-end"},children:e.campaign.campaignType===he.Email?t("gratuit_13712"):`${e.campaign.cost} €`}),(0,i.jsx)(Ec,{css:{flex:"0 150px"},children:(0,i.jsx)(ic,{...l$(e.campaign.state),children:t(e.campaign.state)})}),(0,i.jsx)(Yc,{justify:"end",children:e.canSendCampaigns&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",to:SI.UPDATE({organizationId:e.organizationId,eventId:e.eventId||void 0,campaignId:e.campaign.id})})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(d$,{campaign:e.campaign,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})})]})};function u$(e,t){(0,L.useEffect)(()=>{let n=null;return e.some(e=>e.state===ue.InProgress)&&(n=window.setInterval(t,3e4)),()=>{n&&clearInterval(n)}},[e])}const h$=()=>{const{translate:e,params:{organizationId:t}}=_l(),{canCampaignSend:n}=SS(),{limit:s,nameDebounced:o,offset:r,predicates:a,reloadKey:l,setLimit:d,setOffset:c,setSort:u,sort:h}=gy(),{data:g,isLoading:p,reload:f}=Zn("query CommunityCampaigns(\n $organizationId: OrganizationId!\n $predicates: [Predicate!]!\n $name: String\n $limit: Int\n $offset: Int\n $sort: CampaignsSort\n) {\n organization(id: $organizationId) {\n rows: campaigns(\n level: Organization\n predicates: $predicates\n name: $name\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...CampaignList\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,predicates:a,name:m(o)?o:null,limit:s,offset:r,sort:h},[Ls.CampaignListFragment]);const{numberOfPages:x,totalCount:_}=ku(g.organization?.rows);return(0,L.useEffect)(()=>{l>1&&f()},[l]),u$(g.organization?.rows.nodes??[],f),(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":p,headerRow:(0,i.jsxs)(jc,{children:[(0,i.jsx)(_m,{attribute:ce.Name,setSort:u,sort:h,children:e("nom_de_la_campa_45063")}),(0,i.jsx)(_m,{attribute:ce.Type,setSort:u,sort:h,width:150,children:e("type_35427")}),(0,i.jsx)(Vc,{width:200,children:e("nombre_de_desti_21374")}),(0,i.jsx)(Vc,{width:150,children:e("co_t_68998")}),(0,i.jsx)(_m,{attribute:ce.State,css:{flex:"0 150px"},setSort:u,sort:h,children:e("status_06428")}),(0,i.jsx)(Vc,{width:100})]}),paginationRow:(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:s,numberOfPages:x,offset:r,setLimit:d,setOffset:c,showLimits:!0,totalCount:_})}),children:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):g.organization.rows.nodes.map(e=>(0,i.jsx)(c$,{campaign:e,canSendCampaigns:n,eventId:null,organizationId:t,reload:f},e.id))})})},m$=()=>{const e=Yn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a$,{}),(0,i.jsxs)(ej,{children:[(0,i.jsx)(o$,{searchRow:(0,i.jsx)(i$,{searchPlaceholder:e("rechercher_une_69554"),showActions:!1,showEditColumns:!1,showEditMode:!1,showSearchColumns:!1})}),(0,i.jsx)(h$,{})]})]})},g$=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=_l(),{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=yI(),d=qn(t$);return(0,i.jsx)(e$,{canEditSegments:r,filters:d.getCampaignsFilters(e.organization.campaignsCreators),filtersButtonText:n("filtrer_les_cam_97457"),filtersSubtitle:n("appliquer_des_f_57442"),getSegmentPath:e=>SI.CAMPAIGNS_SEGMENT({organizationId:s,segmentId:e}),initialLimit:a?.campaignsLimit??Tc,initialSegmentsOpen:a?.areCampaignsSegmentsOpen??!0,organizationId:s,possibleColumns:[],possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:vt.Campaigns,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({campaignsLimit:e})},onSegmentClick:e=>{l({campaignsSegmentId:e})},onSegmentDelete:async()=>{await l({campaignsSegmentId:null}),t.replace(SI.CAMPAIGNS({organizationId:s}))},onSegmentsToggle:async e=>{await l({areCampaignsSegmentsOpen:e})},children:(0,i.jsx)(m$,{})})},p$=()=>{const{params:{organizationId:e},translate:t}=_l();Dd(`${t("communaut_20896")} ${t("Campaigns")}`);const{localOrganization:n}=yI(),{data:s,loader:o,reload:r}=Zn("query CampaignsSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n campaignsCreators {\n userId\n nameOrEmail\n }\n\n segmentsFolders(level: Organization, segmentType: Campaigns) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e},[Ls.SegmentsFoldersSegmentsFragment]),a=(0,L.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:SI.CAMPAIGNS_SEGMENT({organizationId:":organizationId",segmentId:":segmentId"}),children:(0,i.jsx)(g$,{organization:s.organization,reload:r})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:SI.CAMPAIGNS_SEGMENT({organizationId:e,segmentId:n?.campaignsSegmentId&&a.includes(n.campaignsSegmentId)?n?.campaignsSegmentId:a[0]}),replace:!0})})]})},f$=()=>{const{translate:e,params:{organizationId:t}}=_l(),{updateLocalOrganization:n}=yI(),{canCampaignRead:s,canFormRead:o,canDelegationRead:r,canWorkflowRead:a}=SS();return(0,i.jsxs)(VS,{"aria-label":e("menu_communauta_47274"),children:[(0,i.jsx)(BS,{replace:!1,to:yi.COMMUNITY_DASHBOARD({organizationId:t}),children:e("tableau_de_bord_24627")}),(0,i.jsx)(BS,{isActive:e=>e.endsWith("/users")||null!==e.match(/\/users\/\d+/)||null!==e.match(/\/member\/\d+/),replace:!1,to:yi.COMMUNITY_USERS({organizationId:t}),onClick:()=>n({usersSegmentId:null}),children:e("vos_membres_38104")}),s&&(0,i.jsx)(BS,{isActive:e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/community\/campaigns\/\d+/)||null!==e.match(/\/community\/campaign\/\d+/),replace:!1,to:SI.CAMPAIGNS({organizationId:t}),onClick:()=>n({campaignsSegmentId:null}),children:e("Campaigns")}),o&&(0,i.jsx)(BS,{isActive:e=>e.endsWith("/forms")||e.endsWith("/forms/create"),replace:!1,to:Ni.FORMS({organizationId:t}),children:e("Form_plural")}),r&&(0,i.jsx)(BS,{isActive:e=>e.endsWith("/delegations")||null!==e.match(/\/community\/delegations\/\d+/)||null!==e.match(/\/community\/delegation\/\d+/)||null!==e.match(/\/community\/delegation-category\/\d+/),replace:!1,to:$s.COMMUNITY_DELEGATIONS(t),children:e("d_l_gations_78318")}),a&&(0,i.jsx)(BS,{replace:!1,to:ZI.WORKFLOWS({organizationId:t}),children:e("automatisations_60045")})]})},x$=e=>(0,i.jsx)(gT,{children:(0,i.jsxs)(cd,{gridtemplatecolumns:"auto",gridtemplaterows:"55px 1fr",height:1,width:1,children:[(0,i.jsx)(f$,{}),(0,i.jsx)(yr,{css:{overflowY:"auto"},children:e.children})]})}),_$=()=>{const e=Yn(),{organizationId:t}=Jn(),n=Qn(),{data:s,loader:o}=Zn("query CommunityDashboard($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n range\n assignedResources\n resources\n numberOfPositions\n }\n }\n\n numberOfUsersInfos\n }\n}\n",{organizationId:t},[]),r=qn(hh);return o||(0,i.jsxs)(Na,{css:{margin:"auto"},direction:"column",height:1,width:"$container",children:[(0,i.jsx)(qa,{height:"9"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("tableau_de_bord_24627")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:e("en_un_coup_d_oe_57288")}),(0,i.jsx)(qa,{height:"9"}),(0,i.jsxs)(Na,{gap:"6",width:1,children:[(0,i.jsx)(sS,{icon:"megaphone",iconColor:"primary",text:e("nombre_d_v_nem_14214"),value:s.organization.events.nodes.length}),(0,i.jsx)(sS,{icon:"user-group",iconColor:"purple",text:e("nombre_de_membr_08851"),value:s.organization.numberOfUsersInfos})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("nom_de_l_v_nem_08711")}),(0,i.jsx)(Vc,{children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(Vc,{width:200,children:e("nombre_de_missi_67304_plural")}),(0,i.jsx)(Vc,{children:e("taux_de_remplis_11913")})]}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:s.organization.events.nodes.map(e=>{const s=(0,Db.A)(e.assignedResources/e.resources*100);return(0,i.jsxs)(Dc,{css:{cursor:"pointer","&:hover":{background:"$gray100"}},onClick:()=>{n.push(Ui.EVENT({organizationId:t,eventId:e.id}))},children:[(0,i.jsx)(Ec,{children:e.name}),(0,i.jsx)(Ec,{children:e.range?r.toDisplayString(e.range):"-"}),(0,i.jsx)(Ec,{width:200,children:e.numberOfPositions}),(0,i.jsx)(Ec,{children:e.resources>0?(0,i.jsxs)(Na,{align:"center",gap:"3",height:1,width:1,children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Aw,{percent:e.assignedResources/e.resources})}),(0,i.jsxs)(yr,{color:"gray700",width:40,children:[s," %"]})]}):"-"})]},e.id)})}),setOffset:Ql.A,title:e("liste_des_v_ne_29929"),totalCount:0}),(0,i.jsx)(qa,{height:"9"})]})};var I$;function v$(e,t){return t===Mh.AccreditationsMatrix?{includeAccreditationsSlots:!0,includeCampaigns:!1,includeChildren:!1,includeCreatedBy:!1,includeDocuments:!1,includeLeaders:!1,includeResources:!1,includeTags:!1,includeUsedCustomFieldsFilled:!1}:{includeAccreditationsSlots:!1,includeCampaigns:e.includes(I$.Campaigns),includeChildren:e.includes(I$.Events),includeCreatedBy:e.includes(I$.CreatedBy),includeDocuments:e.includes(I$.Documents),includeLeaders:e.includes(I$.Leaders),includeResources:e.includes(I$.FillingRate)||e.includes(I$.AssignedResources),includeTags:e.includes(I$.Tags),includeUsedCustomFieldsFilled:e.includes(I$.UsedCustomFieldsFilled)}}!function(e){e.AssignedResources="resources",e.Campaigns="campaigns",e.CanLeadersAddMembers="canLeadersAddMembers",e.CanLeadersDeleteMembers="canLeadersDeleteMembers",e.CanLeadersEditColumns="canLeadersEditColumns",e.CanLeadersEditCustomFields="canLeadersEditCustomFields",e.CanLeadersEditMembers="canLeadersEditMembers",e.CanLeadersImportMembers="canLeadersImportMembers",e.CanLeadersSeeHiddenAccreditationsSlots="canLeadersSeeHiddenAccreditationsSlots",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.DeadlineDate="deadlineDate",e.DelegationCategory="delegationCategory",e.DelegationSpaceLink="delegationSpaceLink",e.Description="description",e.Documents="documents",e.Events="events",e.FillingRate="fillingRate",e.Form="form",e.FormLink="formLink",e.Id="id",e.IsLocked="isLocked",e.Leaders="leaders",e.MaxResources="maxResources",e.Name="name",e.PrivateNote="privateNote",e.ShowFormLinkInDelegationSpace="showFormLinkInDelegationSpace",e.ShowInDelegation="showInDelegation",e.State="delegationState",e.UsedCustomFieldsFilled="usedCustomFieldsFilled",e.Tags="tags"}(I$||(I$={}));let b$=class extends gu{constructor(e,t,n){super(e,t,n)}getDelegationsFilters(e,t,n,i){return(0,Ya.A)([{slug:I$.Name,name:this.t("nom_de_la_d_l_g_28087"),category:this.t("d_l_gations_78318"),fieldType:We.Text,hideEmpty:!0},{slug:I$.Description,name:this.t("Description"),category:this.t("d_l_gations_78318"),fieldType:We.Text},{slug:I$.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("d_l_gations_78318"),fieldType:We.Text},no(i)?{slug:I$.DelegationCategory,name:this.t("cat_gorie_00291"),category:this.t("d_l_gations_78318"),fieldType:We.Select,values:i,hideEmpty:!0}:null,{slug:"delegationState",name:this.t("status_06428"),category:this.t("d_l_gations_78318"),fieldType:We.Select,values:on.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:I$.Leaders,name:this.t("reponsable_82458_plural"),category:this.t("d_l_gations_78318"),fieldType:We.Select,needLoading:!0,organizationId:e,eventId:t},{slug:"form",name:this.t("Form"),category:this.t("d_l_gations_78318"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:"deadlineDate",name:this.t("date_limite_d_i_79779"),category:this.t("d_l_gations_78318"),fieldType:We.Date},{slug:"tag",name:this.t("Tag"),category:this.t("d_l_gations_78318"),fieldType:We.Select,needLoading:!0,organizationId:e,eventId:t,tagContext:kt.Delegations},{slug:"resources",name:this.t("nombre_de_membr_08851"),category:this.t("d_l_gations_78318"),fieldType:We.Number,hideEmpty:!0},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("d_l_gations_78318"),fieldType:We.Number,hideEmpty:!0},{slug:I$.ShowInDelegation,name:this.t("ShowInDelegationSpace"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,hideEmpty:!0},{slug:I$.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,hideEmpty:!0},{slug:I$.CanLeadersDeleteMembers,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,hideEmpty:!0},{slug:I$.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,hideEmpty:!0},{slug:I$.CanLeadersEditColumns,name:this.t("CanLeadersAddMembers"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,hideEmpty:!0},{slug:I$.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,hideEmpty:!0},{slug:I$.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,hideEmpty:!0},{slug:I$.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,hideEmpty:!0},{slug:I$.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,hideEmpty:!0},t?{slug:"accreditation",name:this.t("accr_ditations_39450"),category:this.t("d_l_gations_78318"),fieldType:We.Select,needLoading:!0,eventId:t}:null,{slug:I$.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("d_l_gations_78318"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e,eventId:t},{slug:I$.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("d_l_gations_78318"),fieldType:We.Datetime,hideEmpty:!0},t?null:{slug:"event",name:this.t("_v_nement_22345"),category:this.t("d_l_gations_78318"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:I$.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),category:this.t("d_l_gations_78318"),fieldType:We.Checkbox,hideEmpty:!0},...this.customFieldsToFilters(n)])}getDelegationsPossibleColumns(e){return[{slug:I$.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:ye.Id,width:100},{slug:I$.Name,name:this.t("nom_de_la_d_l_g_28087"),isSearchable:!0,isSortable:!0,sortAttribute:ye.Name,minWidth:240},{slug:I$.DelegationCategory,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:ye.Category,minWidth:240},{slug:I$.State,name:this.t("status_06428"),minWidth:180},{slug:I$.Leaders,name:this.t("reponsable_82458_plural"),isSearchable:!0,minWidth:320},{slug:I$.Form,name:this.t("Form"),isSearchable:!0,minWidth:180},{slug:I$.FormLink,name:this.t("FormLink"),minWidth:240},{slug:I$.DelegationSpaceLink,name:this.t("DelegationSpaceLink"),minWidth:240},{slug:I$.DeadlineDate,name:this.t("date_limite_d_i_79779"),minWidth:180},{slug:I$.MaxResources,name:this.t("MaxResources"),minWidth:180},{slug:I$.AssignedResources,name:this.t("membres_11310"),minWidth:240},{slug:I$.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:I$.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:I$.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:I$.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:ye.CreatedAt,minWidth:180},{slug:I$.ShowInDelegation,name:this.t("ShowInDelegationSpace"),minWidth:180},{slug:I$.CanLeadersAddMembers,name:this.t("CanLeadersAddMembers"),minWidth:180},{slug:I$.CanLeadersEditMembers,name:this.t("CanLeadersEditMembers"),minWidth:180},{slug:I$.CanLeadersDeleteMembers,name:this.t("CanLeadersDeleteMembers"),minWidth:180},{slug:I$.CanLeadersEditColumns,name:this.t("CanLeadersEditColumns"),minWidth:180},{slug:I$.CanLeadersEditCustomFields,name:this.t("CanLeadersEditCustomFields"),minWidth:180},{slug:I$.CanLeadersImportMembers,name:this.t("CanLeadersImportMembers"),minWidth:180},{slug:I$.CanLeadersSeeHiddenAccreditationsSlots,name:this.t("CanLeadersSeeHiddenAccreditationsSlots"),minWidth:180},{slug:I$.ShowFormLinkInDelegationSpace,name:this.t("afficher_le_lie_05841"),minWidth:180},{slug:I$.IsLocked,name:this.t("IsLocked"),minWidth:180},{slug:I$.Events,name:this.t("_v_nements_53672"),minWidth:320},{slug:I$.Campaigns,name:this.t("campagnes_que_l_81468"),minWidth:320},{slug:I$.Documents,name:this.t("documents_que_l_18755"),minWidth:320},{slug:I$.UsedCustomFieldsFilled,name:this.t("champs_personna_27238"),minWidth:180},...this.customFieldsToPossibleColumns(e)]}};function j$(e,t,n){const[i,s]=(0,L.useState)(null);return(0,L.useCallback)(async()=>{if(i)return i;{const i=await e(t,await K()),o=n(i);return s(o),o}},[i,e,t])}b$=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],b$);const C$=L.createContext({}),y$=e=>{const t=j$(zo,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?it.Event:it.Organization},e=>e.organization.campaigns.nodes),n=j$(zo,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?it.Event:it.Organization},e=>e.organization.event?.customDocuments??[]),s=j$(zo,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?it.Event:it.Organization},e=>e.organization.delegationsCategories.nodes),o=j$(zo,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?it.Event:it.Organization},e=>e.organization.forms.nodes),r=j$(zo,{organizationId:e.organizationId,eventId:e.eventId,level:e.eventId?it.Event:it.Organization},e=>e.organization.tags.nodes);return(0,i.jsx)(C$.Provider,{value:{getCampaigns:t,getCustomDocuments:n,getDelegationsCategories:s,getEditPath:e.getEditPath,getShowPath:e.getShowPath,getForms:o,getTags:r},children:e.children})};function k$(){return L.useContext(C$)}const A$=e=>{const t=Yn(),{massActions:n,segment:s}=gy(),o=(0,L.useCallback)(()=>{n.toggleSelectAll("unchecked"),n.setIsAllSelected(!1)},[n]),r=(0,L.useCallback)(()=>{n.setIsAllSelected(!0)},[n]);return(0,i.jsxs)(Na,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$3 $4"},gap:"3",children:[(0,i.jsx)(yr,{fontSize:"textMd",fontWeight:"medium",children:(0,i.jsx)(el,{icon:"circle-exclamation"})}),n.isAllSelected?(0,i.jsx)(yr,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:e.segmentSelectedText}):(0,i.jsx)(yr,{color:"gray700",css:{flex:"1"},fontWeight:"medium",children:e.pageSelectedText}),n.isAllSelected?(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:o,children:t("effacer_la_s_le_85095")}):(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",onClick:r,children:t("s_lectionner_le_71777",s.count,s.name)})]})},w$=e=>{const{translate:t,params:{organizationId:n}}=_l(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(tt.Add),[l,d]=(0,L.useState)([]),[c,u]=(0,L.useState)(e.roles[0]?.id??null),[h,m,g]=Bc(""),{usersInfosOptions:p,isLoading:f}=Wb({organizationId:n,eventId:null,hasSelected:no(l),nameDebounced:m,userInfoIds:l}),x=no(l);return(0,i.jsx)(Rb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"user-gear",children:t("_diter_les_resp_29588")}),(0,i.jsxs)(Tb,{gap:"6",children:[(0,i.jsxs)(zu,{label:t("que_souhaitez_v_87607"),value:r,onChange:a,children:[(0,i.jsx)("option",{value:tt.Add,children:t("ajouter_des_res_84773")}),(0,i.jsx)("option",{value:tt.Replace,children:t("remplacer_les_r_60774")}),(0,i.jsx)("option",{value:tt.Delete,children:t("supprimer_des_r_69379")})]}),(0,i.jsx)(bc,{isSearchLoading:f,isSearchVisible:!0,label:t("reponsable_82458_plural"),multiple:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),state:"search",value:h,onChange:g}),values:l,onChange:d,children:p}),e.showRoleSelect&&r!==tt.Delete&&(0,i.jsx)(zu,{label:t("r_le_59302"),shouldParseAsInt:!0,value:c,onChange:u,children:e.roles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{disabled:!x,isLoading:s,onClick:async()=>{o(!0),await e.onSuccess(r,l.map(e=>({userInfoId:e,roleId:c}))),e.onClose(),o(!1)},children:t("_diter_62574")})})]})})},S$=e=>(0,i.jsx)(fu.JY,{onDragEnd:({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.setSelectedColumns(ro(e.selectedColumns,n.index,i.index))},children:(0,i.jsx)(fu.gL,{droppableId:"1",children:t=>(0,i.jsxs)(Na,{css:{background:"$gray50",bd:"gray200 1",padding:"$4"},direction:"column",...t.droppableProps,ref:t.innerRef,children:[e.selectedColumns.map((e,t)=>(0,i.jsx)(fu.sx,{draggableId:e.slug,index:t,children:t=>(0,i.jsxs)(Na,{align:"center",css:{background:"white",border:"1px solid $gray200",borderTop:"none",px:"$4","&:first-child":{borderTop:"1px solid $gray200",borderTopLeftRadius:"$1",borderTopRightRadius:"$1"},"&:last-child":{borderBottomLeftRadius:"$1",borderBottomRightRadius:"$1"}},gap:"3",height:40,...t.draggableProps,ref:t.innerRef,children:[(0,i.jsx)(yr,{color:"gray300",css:{cursor:"grab"},...t.dragHandleProps,children:(0,i.jsx)(el,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(yr,{color:"gray800",children:e.name})]})},e.slug)),t.placeholder]})})}),E$=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),o=qn(Hh),{data:r}=Zn("query MassColumnsCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...OrganizationCustomFields\n }\n}\n",{organizationId:n},[Ls.OrganizationCustomFieldsFragment]),{mutate:a,isLoading:l}=To(),d=(0,L.useMemo)(()=>o.getDelegationMembersPossibleColumns(r.organization?.customFields.nodes??[],{isWeezeventConnected:!0,positionDisplay:pt.Position,slotDisplay:xt.Custom}),[o,r.organization]),[c,u]=(0,L.useState)(""),h=(0,L.useMemo)(()=>d.filter(e=>!m(c)||e.name.trim().toLowerCase().includes(c.trim().toLowerCase())),[d,c]),[g,p]=(0,L.useState)([]);return(0,i.jsx)(Rb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"line-columns",children:t("_diter_les_colo_38837")}),(0,i.jsxs)(Tb,{gap:"2",children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("quelles_colonne_05047")}),no(g)&&(0,i.jsx)(S$,{selectedColumns:g,setSelectedColumns:p}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"invisible",leftIcon:"plus",children:t("ajouter_des_col_04043")})}),(0,i.jsx)(qd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:400,children:(0,i.jsxs)(Na,{css:{py:"$3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(yr,{css:{px:"$3"},children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_c_86475"),state:"search",value:c,onChange:u})}),(0,i.jsx)(yr,{css:{maxHeight:"300px",overflowY:"auto",px:"$3"},children:h.map(e=>(0,i.jsx)(_c,{isCheckbox:!0,isRadio:!1,isSelected:g.includes(e),value:e.slug,onClick:()=>{p(t=>so(t,e,!t.includes(e)))},children:e.name},e.slug))})]})})]})]}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{isLoading:l,onClick:async()=>{const i=(await a({organizationId:n,eventId:s,massEdit:{reset:!1,selecteds:e.selecteds,slug:be.Columns,strategy:tt.Replace,value:g.map(e=>e.slug)}})).numberOfEdited;e.onSuccess(t("les_colonnes_de_83023",i)),e.onClose()},children:t("mettre_jour_85141")})})]})})},T$=e=>{const{translate:t}=_l(),{mutate:n,isLoading:s}=function(e={}){return Xn("mutation DelegationsMassMove(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massMove: MassDelegationsMove!\n) {\n numberOfDelegations: delegationsMassMove(\n organizationId: $organizationId\n eventId: $eventId\n massMove: $massMove\n )\n}\n",e)}(),[o,r]=(0,L.useState)([]),[a,l]=(0,L.useState)([]),{data:d}=Zn("query DelegationsMassMoveInfos(\n $organizationId: OrganizationId!\n $level: OrganizationEventLevel!\n $eventId: EventId\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n forms(level: $level, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:e.organizationId,level:e.eventId?it.Organization:it.Event,eventId:o[0]},[]);const c=(!!e.eventId||no(o))&&no(a);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"clone"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",textAlign:"center",children:t("copier_les_d_l_43406")}),e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("cela_liera_vos_60643")})]}),(0,i.jsx)(qa,{height:"7"}),!e.eventId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bc,{isSearchVisible:!0,label:t("_v_nement_22345"),values:o,onChange:r,children:(d.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(qa,{height:"4"})]}),(e.eventId||no(o))&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(bc,{isSearchVisible:!0,label:t("formulaire_ut_59771"),values:a,onChange:l,children:(d.organization?.forms.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{disabled:!c,isLoading:s,onClick:async()=>{const i=(await n({organizationId:e.organizationId,eventId:e.eventId,massMove:{eventId:e.eventId?null:o[0],formId:a[0],selecteds:e.selecteds}})).numberOfDelegations;e.onSuccess(t("_1_d_l_gations_15078",i)),e.onClose()},children:t("copier_75889")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},z$=()=>{const e=Yn(),{isOrganizationAdmin:t}=yI(),{isEventAdmin:n}=vb(),{eventId:s,massActions:o,onMassEditSuccess:r,organizationId:a,predicates:l,segment:d}=gy(),{showNotification:c}=kb(),{mutate:u}=To(),{mutate:h}=function(e={}){return Xn("mutation DelegationsMassLeadersEdit(\n $organizationId: OrganizationId!\n $eventId: EventId\n $massLeaders: MassLeadersInput!\n) {\n numberOfDelegations: delegationsMassLeadersEdit(\n organizationId: $organizationId\n eventId: $eventId\n massLeaders: $massLeaders\n )\n}\n",e)}(),{mutate:g}=na(),[p,f]=(0,L.useState)(!1),[x,_]=(0,L.useState)(!1),[I,v]=(0,L.useState)(!1),[b,j]=(0,L.useState)(!1),[C,y]=(0,L.useState)(!1),k=t||n,A=o.getSelectedsInput(l,null),w=o.isAllSelected?d.count:o.numberOfSelected,S=(0,L.useCallback)(e=>{m(e)&&c(e),r()},[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(El,{onClick:()=>{f(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[k&&(0,i.jsx)(Gd,{icon:"clone",onClick:()=>{_(!0)},children:e(s?"copier_dans_la_91936":"copier_dans_un_20230")}),k&&(0,i.jsx)(Gd,{icon:"user-gear",onClick:()=>v(!0),children:e("_diter_les_resp_29588")}),k&&(0,i.jsx)(Gd,{icon:"line-columns",onClick:()=>j(!0),children:e("_diter_les_colo_38837")}),k&&(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{y(!0)},children:e("supprimer_43083")})]})]}),p&&(0,i.jsx)(mA,{eventId:s,mutate:e=>u({organizationId:a,eventId:s,massEdit:e}),organizationId:a,selecteds:A,onClose:()=>{f(!1)},onSuccess:t=>{S(e("_1_d_l_gations_08105",t))}}),x&&(0,i.jsx)(T$,{eventId:s,organizationId:a,selecteds:A,onClose:()=>{_(!1)},onSuccess:r}),I&&(0,i.jsx)(w$,{roles:[],showRoleSelect:!1,onClose:()=>v(!1),onSuccess:async(t,n)=>{const i=(await h({organizationId:a,eventId:s,massLeaders:{leaders:n,strategy:t,selecteds:A}})).numberOfDelegations;S(e("les_responsable_32087",i))}}),b&&(0,i.jsx)(E$,{selecteds:A,onClose:()=>j(!1),onSuccess:S}),C&&(0,i.jsx)(sA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_34990")],text:e("suppression_de_99024",w),onClose:()=>{y(!1)},onDelete:async()=>{const t=(await g({organizationId:a,eventId:s,selecteds:A})).numberOfDelegations;S(e("_1_d_l_gations_40887",t))}})]})},O$=e=>{const t=Yn(),n=qn(xv);return(0,i.jsxs)(Na,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(yr,{children:t("_1_2_membres_04485",e.assignedResources,n.toNumberOrInfinity(e.resources))}),(0,i.jsx)(Aw,{percent:e.assignedResources/(e.resources||e.assignedResources)})]})},R$=e=>{const t=(0,L.useMemo)(()=>(e.delegation.children||[]).flatMap(e=>e.event?[{id:e.event.id,color:"gray",icon:null,text:e.event.name}]:[]),[e.delegation]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},$$=(0,i.jsx)(kl,{});function D$(e){const[t,n]=(0,L.useState)(!0),[i,s]=(0,L.useState)(null);return(0,L.useEffect)(()=>{e().then(e=>{s(e),n(!1)},()=>{n(!1)})},[]),{isLoading:t,loader:t?$$:null,result:i}}const P$=e=>{const{translate:t}=_l(),{getCampaigns:n}=k$(),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("tags_79499")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(bc,{isSearchVisible:!0,label:t("Campaigns"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},F$=e=>{const{eventId:t,organizationId:n}=gy(),{mutate:s}=To();return(0,i.jsx)(_y,{column:e.column,initialValue:e.initialValue,mutate:async i=>s({organizationId:n,eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.delegation.id]},slug:e.property,strategy:tt.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},M$=e=>{const t=(0,L.useMemo)(()=>e.delegation.campaigns||[],[e.delegation]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(F$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.id),property:be.Campaigns,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(P$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Ty,{badges:n})})},N$=({children:e,isEditMode:t,title:n,updatable:s})=>t&&s?(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray900 textSm medium",title:n,width:1,children:n}):(0,i.jsx)(i.Fragment,{children:e}),L$=e=>{const{translate:t}=_l(),{getDelegationsCategories:n}=k$(),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("Category")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(zu,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},B$=e=>{const{params:{organizationId:t,eventId:n}}=_l(),{isEditMode:s}=gy();return(0,i.jsx)(F$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.delegationCategory.id,property:be.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(L$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(N$,{isEditMode:s,title:e.delegation.delegationCategory.name,updatable:!0,children:(0,i.jsx)(qc,{to:ds.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:e.delegation.delegationCategory.id}),children:e.delegation.delegationCategory.name})})})},V$=e=>{const t=Yn(),n=qn(Kc);return(0,i.jsx)(F$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.deadlineDate,property:be.DeadlineDate,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Du,{label:t("date_limite_d_i_79779"),value:e,onChange:n}),renderValue:e.delegation.deadlineDate?n.toLocaleString(e.delegation.deadlineDate,Js.DateOnly.MonthLong):"-"})},U$=e=>{const{translate:t}=_l(),{getCustomDocuments:n}=k$(),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("tags_79499")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(bc,{isSearchVisible:!0,label:t("Documents"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug))})},W$=e=>{const t=(0,L.useMemo)(()=>e.delegation.customDocuments||[],[e.delegation]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.slug,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(F$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.slug),property:be.Documents,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(U$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Ty,{badges:n})})},G$=e=>{const t=Yn(),{getForms:n}=k$(),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("Form")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(zu,{label:t("Form"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},H$=e=>(0,i.jsx)(F$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.form.id,property:be.Form,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(G$,{setValue:t,value:e}),renderValue:e.delegation.form.name}),q$=e=>{const t=Yn();return(0,i.jsx)(F$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.lockedAt?.isValid??!1,property:be.IsLocked,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(zu,{label:t("IsLocked"),shouldParseAsBoolean:!0,value:e,onChange:n,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]}),renderValue:e.delegation.lockedAt?.isValid?t("oui_54361"):t("non_33516")})},Y$=e=>{const t=(0,L.useMemo)(()=>(0,lc.A)(e.delegation.leaders,e=>e.nameOrEmail.toLowerCase()).map(e=>({id:e.id,color:"gray",icon:null,text:e.nameOrEmail})),[e.delegation]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},K$=e=>{const t=Yn(),n=qn(xv);return(0,i.jsx)(F$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.maxResources||"",property:be.MaxResources,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{label:t("MaxResources"),shouldParseAsInt:!0,value:e,onChange:n}),renderValue:n.toNumberOrInfinity(e.delegation.maxResources)})},Z$=e=>{const{translate:t}=_l(),{isEditMode:n}=gy(),{getShowPath:s}=k$();return(0,i.jsx)(F$,{column:e.column,delegation:e.delegation,initialValue:e.delegation.name,property:be.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{label:t("nom_de_la_d_l_g_28087"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(N$,{isEditMode:n,title:e.delegation.name,updatable:!0,children:(0,i.jsx)(qc,{to:s(e.delegation.id),children:e.delegation.name})})})},X$=e=>{const t=Yn();return(0,i.jsx)(F$,{column:e.column,delegation:e.delegation,initialValue:e.value,property:e.property,reload:e.reload,renderInput:(n,s)=>(0,i.jsxs)(zu,{label:e.label,shouldParseAsBoolean:!0,value:n,onChange:s,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]}),renderValue:e.value?t("oui_54361"):t("non_33516")})},J$=e=>{const{translate:t}=_l(),{getTags:n}=k$(),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("tags_79499")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(bc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},Q$=e=>{const t=(0,L.useMemo)(()=>e.delegation.tags||[],[e.delegation]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(F$,{column:e.column,delegation:e.delegation,initialValue:t.map(e=>e.id),property:be.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(J$,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Ty,{badges:n})})},eD=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{mutate:o}=To(),r=(0,L.useCallback)((t,n)=>o({organizationId:e.organizationId,eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:n,strategy:tt.Replace,value:t}}),[e.row,o]),a=(0,L.useMemo)(()=>ag({organizationId:n,eventId:s,delegationId:e.row.id,formId:e.row.form.id}),[e.row]),l=(0,L.useMemo)(()=>rg(n,ds.DELEGATION({organizationId:n,eventId:s,delegationId:e.row.id})),[e.row]);return e.column.slug===I$.Id?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===I$.Name?(0,i.jsx)(Z$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===I$.DelegationCategory?(0,i.jsx)(B$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===I$.State?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ic,{...$j(e.row.state),children:t(e.row.state)})}):e.column.slug===I$.Leaders?(0,i.jsx)(Y$,{column:e.column,delegation:e.row}):e.column.slug===I$.Form?(0,i.jsx)(H$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===I$.FormLink?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qc,{to:a,children:a})}):e.column.slug===I$.DelegationSpaceLink?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qc,{to:l,children:l})}):e.column.slug===I$.DeadlineDate?(0,i.jsx)(V$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===I$.MaxResources?(0,i.jsx)(K$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===I$.AssignedResources?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(O$,{assignedResources:e.row.numberOfResources,resources:e.row.maxResources})}):e.column.slug===I$.Tags?(0,i.jsx)(Q$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===I$.FillingRate?(0,i.jsxs)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===I$.CreatedBy?(0,i.jsx)(zR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===I$.ShowInDelegation?(0,i.jsx)(X$,{column:e.column,delegation:e.row,label:t("ShowInDelegationSpace"),property:be.ShowInDelegationSpace,reload:e.reloadRow,value:e.row.showInDelegationSpace}):e.column.slug===I$.CanLeadersAddMembers?(0,i.jsx)(X$,{column:e.column,delegation:e.row,label:t("CanLeadersAddMembers"),property:be.CanLeadersAddMembers,reload:e.reloadRow,value:e.row.canLeadersAddMembers}):e.column.slug===I$.CanLeadersDeleteMembers?(0,i.jsx)(X$,{column:e.column,delegation:e.row,label:t("CanLeadersDeleteMembers"),property:be.CanLeadersDeleteMembers,reload:e.reloadRow,value:e.row.canLeadersDeleteMembers}):e.column.slug===I$.CanLeadersEditColumns?(0,i.jsx)(X$,{column:e.column,delegation:e.row,label:t("CanLeadersEditColumns"),property:be.CanLeadersEditColumns,reload:e.reloadRow,value:e.row.canLeadersEditColumns}):e.column.slug===I$.CanLeadersEditMembers?(0,i.jsx)(X$,{column:e.column,delegation:e.row,label:t("CanLeadersEditMembers"),property:be.CanLeadersEditMembers,reload:e.reloadRow,value:e.row.canLeadersEditMembers}):e.column.slug===I$.CanLeadersEditCustomFields?(0,i.jsx)(X$,{column:e.column,delegation:e.row,label:t("CanLeadersEditCustomFields"),property:be.CanLeadersEditCustomFields,reload:e.reloadRow,value:e.row.canLeadersEditCustomFields}):e.column.slug===I$.CanLeadersImportMembers?(0,i.jsx)(X$,{column:e.column,delegation:e.row,label:t("CanLeadersImportMembers"),property:be.CanLeadersImportMembers,reload:e.reloadRow,value:e.row.canLeadersImportMembers}):e.column.slug===I$.CanLeadersSeeHiddenAccreditationsSlots?(0,i.jsx)(X$,{column:e.column,delegation:e.row,label:t("CanLeadersSeeHiddenAccreditationsSlots"),property:be.CanLeadersSeeHiddenAccreditationsSlots,reload:e.reloadRow,value:e.row.canLeadersSeeHiddenAccreditationsSlots}):e.column.slug===I$.ShowFormLinkInDelegationSpace?(0,i.jsx)(X$,{column:e.column,delegation:e.row,label:t("afficher_le_lie_05841"),property:be.ShowFormLinkInDelegationSpace,reload:e.reloadRow,value:e.row.showFormLinkInDelegationSpace}):e.column.slug===I$.IsLocked?(0,i.jsx)(q$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===I$.CreatedAt?(0,i.jsx)(TR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===I$.Campaigns?(0,i.jsx)(M$,{column:e.column,delegation:e.row,reload:e.reloadRow}):e.column.slug===I$.Documents?(0,i.jsx)(W$,{column:e.column,delegation:e.row,reload:e.reloadRow}):"events"===e.column.slug?(0,i.jsx)(R$,{column:e.column,delegation:e.row}):e.column.slug===I$.UsedCustomFieldsFilled?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:t(e.row.usedCustomFieldsFilled?.toString()||"-")}):(0,i.jsx)(Dy,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:r,reload:e.reloadRow,updatable:!0})},tD=e=>{const{history:t,translate:n}=_l(),{getEditPath:s}=k$(),{mutate:o}=ea(),[r,a]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"pen",to:s(e.delegation.id),children:n("_diter_62574")}),(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>{const{delegationDuplicate:n}=await o({organizationId:e.organizationId,eventId:e.eventId,delegationId:e.delegation.id});t.push(s(n.id))},children:n("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:async()=>{a(!0)},children:n("supprimer_43083")})]}),r&&(0,i.jsx)(Hw,{delegation:e.delegation,onClose:()=>{a(!1)},onSuccess:e.reload})]})},nD=({columns:e,customFields:t,delegation:n,eventId:s,organizationId:o,state:r,reload:a,reloadDelegation:l,toggleRow:d})=>{const{canDelegationEdit:c}=wS(),{getEditPath:u}=k$(),h=uy(t),m=(0,L.useCallback)(()=>{l(n.id)},[n,l]);return(0,i.jsxs)(Dc,{css:{background:"checked"===r?"$primary100":"white","&:hover":{background:"checked"===r?"$primary100":"$gray100"}},onMouseLeave:e=>{Nd(e.target)},children:[c&&(0,i.jsx)(Ec,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:r,onClick:(e,t)=>{Rl(t),d(`d${n.id}`,e)}})}),e.map(e=>{const t=h.get(e.slug);return(0,i.jsx)(eD,{column:e,customField:t,eventId:s,organizationId:o,reloadRow:m,row:n},e.slug)}),c&&(0,i.jsxs)(Yc,{justify:"center",children:[(0,i.jsx)(bm,{children:(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",to:u(n.id)})})})}),(0,i.jsx)(tD,{delegation:n,eventId:s,organizationId:o,reload:a})]})]})},iD=e=>{const{canDelegationEdit:t}=wS(),{columns:n,columnsSearch:s,limit:o,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,rendering:h,setLimit:g,setOffset:p,setSort:f,sort:x}=gy(),_=(0,L.useMemo)(()=>v$(n,h),[n,h]),{data:I,isLoading:v,reload:b}=ta({..._,organizationId:e.organizationId,level:e.level,eventId:e.eventId,name:m(a)?a:null,columnsSearch:no(s)?s:null,predicates:c,limit:o,offset:l,sort:x}),j=(0,L.useMemo)(()=>n.flatMap(e=>(0,Ya.A)([d.find(t=>t.slug===e)])),[d,n]),{numberOfPages:C,totalCount:y}=ku(I.data?.rows),[k,A]=(0,L.useState)([]),[w,S]=(0,L.useState)({}),E=(0,L.useCallback)(async t=>{S(e=>({...e,[t]:!0}));const{data:{row:n}}=await(i={..._,organizationId:e.organizationId,id:t},s=await K(),ho("query DelegationsDelegation(\n $organizationId: OrganizationId!\n $id: DelegationId!\n $includeAccreditationsSlots: Boolean!\n $includeCampaigns: Boolean!\n $includeChildren: Boolean!\n $includeCreatedBy: Boolean!\n $includeDocuments: Boolean!\n $includeLeaders: Boolean!\n $includeResources: Boolean!\n $includeTags: Boolean!\n $includeUsedCustomFieldsFilled: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: delegation(id: $id) {\n ...DelegationsDelegation\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[Ls.DelegationsDelegationFragment]}));var i,s;A(e=>e.map(e=>e.id===t?n:e)),S(e=>({...e,[t]:!1}))},[_,S,A]);return(0,L.useEffect)(()=>{A(I.data?.rows.nodes??[])},[I.data]),(0,L.useEffect)(()=>{u>1&&b()},[u]),(0,L.useEffect)(()=>{r.setStates(Object.fromEntries((I.data?.rows.nodes??[]).map(e=>[`d${e.id}`,{id:e.id,state:"unchecked"}])))},[I.data,r.setStates]),(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":v,headerRow:(0,i.jsxs)(jc,{children:[t&&(0,i.jsx)(Vc,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:r.selectAllState,onClick:r.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)(_m,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:f,sort:x,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Vc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),t&&(0,i.jsx)(Vc,{width:100})]}),paginationRow:(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:o,numberOfPages:C,offset:l,setLimit:g,setOffset:p,showLimits:!0,totalCount:y})}),children:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):k.map(t=>w[t.id]?(0,i.jsx)(Uc,{},t.id):(0,i.jsx)(nD,{columns:j,customFields:e.customFields,delegation:t,eventId:e.eventId,organizationId:e.organizationId,reload:b,reloadDelegation:E,state:r.states[`d${t.id}`]?.state??"unchecked",toggleRow:r.toggleRow},t.id))})})},sD=()=>{const{history:e,translate:t,params:{organizationId:n}}=_l();return(0,i.jsx)(r$,{children:(0,i.jsx)(Bb,{permissions:Nb.DELEGATION_EDIT,children:(0,i.jsx)(El,{onClick:()=>{e.push($s.COMMUNITY_CREATE_DELEGATION(n))},children:t("cr_er_une_d_l_g_23035")})})})},oD=e=>{const{translate:t,params:{organizationId:n}}=_l(),{canDelegationEdit:s,canSegmentEdit:o}=SS(),{limit:r,segment:a}=gy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sD,{}),0===e.numberOfDelegations?(0,i.jsx)(ej,{css:{overflow:"hidden"},children:(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Nk,{title:t("vous_n_avez_pas_32103")})})}):(0,i.jsxs)(ej,{children:[(0,i.jsx)(o$,{searchRow:(0,i.jsx)(i$,{actions:(0,i.jsx)(z$,{}),searchPlaceholder:t("rechercher_une_31213"),showActions:s,showEditColumns:o,showEditMode:s,showSearchColumns:o}),selectSegment:(0,i.jsx)(A$,{pageSelectedText:t("les_1_d_l_gat_27248",r),segmentSelectedText:t("les_1_d_l_gat_04594",a.count,a.name)})}),(0,i.jsx)(iD,{customFields:e.customFields,eventId:null,level:it.Organization,organizationId:n})]})]})},rD=e=>{const{history:t,params:{organizationId:n,segmentId:s},translate:o}=_l();Dd(`${o("communaut_20896")} ${o("d_l_gations_78318")}`);const{localOrganization:r,updateLocalOrganization:a}=yI(),{canSegmentEdit:l}=SS(),d=qn(b$),c=(0,L.useMemo)(()=>d.getDelegationsFilters(n,null,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.organization,n]),u=(0,L.useMemo)(()=>d.getDelegationsPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(y$,{eventId:null,getEditPath:e=>gi(ds.DELEGATION({organizationId:n,delegationId:e})),getShowPath:e=>ds.DELEGATION({organizationId:n,delegationId:e}),organizationId:n,children:(0,i.jsx)(e$,{canEditSegments:l,filters:c,filtersButtonText:o("filtrer_les_d_l_04628"),filtersSubtitle:o("appliquer_des_f_65318"),getSegmentPath:e=>$s.COMMUNITY_DELEGATIONS_SEGMENT(n,e),hideSegments:0===e.organization.numberOfDelegations,initialLimit:r?.delegationsLimit??Tc,initialSegmentsOpen:r?.areDelegationsSegmentsOpen??!0,organizationId:n,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:s,segmentType:vt.Delegations,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{a({delegationsLimit:e})},onSegmentClick:e=>{a({delegationsSegmentId:e})},onSegmentDelete:async()=>{await a({delegationsSegmentId:null}),t.replace($s.COMMUNITY_DELEGATIONS(n))},onSegmentsToggle:async e=>{await a({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(oD,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.organization.numberOfDelegations})})})},aD=()=>{const{history:e,params:{organizationId:t}}=_l(),{localOrganization:n}=yI(),{data:s,loader:o,reload:r}=Zn("query CommunityDelegationsSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n numberOfDelegations\n\n customFields(variety: Delegation) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n delegationsCategories(level: Organization) {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(level: Organization, segmentType: Delegations) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:t},[Ls.SegmentCustomFieldFragment,Ls.SegmentsFoldersSegmentsFragment]),a=(0,L.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.COMMUNITY_DELEGATIONS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(rD,{organization:s.organization,reload:r})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{onLoad:()=>{const i=n?.delegationsSegmentId&&a.includes(n.delegationsSegmentId)?n?.delegationsSegmentId:a[0];e.replace($s.COMMUNITY_DELEGATIONS_SEGMENT(t,i))}})})]})},lD=()=>{const{hasFeature:e}=yI();return e(Ne.Delegation)?(0,i.jsx)(aD,{}):(0,i.jsx)(Na,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(kI,{icon:"people-group"})})},dD=e=>{const t=Yn(),{isLoading:n,copy:s}=FS();return(0,i.jsxs)(yr,{children:[(0,i.jsx)(yr,{color:"gray700",css:e.css,children:e.title}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{gap:"2",children:[(0,i.jsx)(Nl,{css:{"& .h-styled-input-container":{background:"white"}},hint:e.hint,state:"disabled",value:e.link,onChange:Ql.A}),(0,i.jsx)(El,{color:e.buttonColor,isLoading:n,leftIcon:"copy",onClick:()=>s(e.link),children:t("copier_75889")})]})]})},cD=pr("dl",{margin:0,code:{border:"1px solid color-mix(in srgb, $warning50, $warning400 60%)",backgroundColor:"color-mix(in srgb, $warning50, $warning400 10%)",borderRadius:"$1",fontFamily:"inherit",padding:"1px 3px"},dd:{display:"list-item",listStyleType:"disc"},"dd ~ dt":{marginTop:"$3"}}),uD=({isOpen:e,onClose:t,link:n})=>{const s=Yn(),o=Kn();return(0,i.jsx)(Rb,{isOpen:e,onClose:t,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"plug-circle-bolt",subtitle:s("exporter_votre_81734"),onClose:t,children:s("export_de_votre_02014")}),(0,i.jsx)(Tb,{children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(yr,{css:{marginBottom:"$5"},children:(0,i.jsx)(ol.Root,{color:"warning",children:(0,i.jsxs)(ol.Titled,{children:[(0,i.jsx)(ol.Title,{icon:"circle-info",children:s("limites_des_exp_03687")}),(0,i.jsx)(ol.Text,{children:(0,i.jsxs)(cD,{children:[(0,i.jsx)("dt",{children:s("limite_du_nombr_21498")}),(0,i.jsx)("dd",{children:[...o(s("au_del_de_1_41204",10,15,"{4}","{5}"),(0,i.jsx)("code",{children:"Too many requests, please try again later."}))]}),(0,i.jsx)("dt",{children:s("dans_google_she_53260")}),(0,i.jsx)("dd",{children:[...o(s("la_limite_de_1_47408",10,15,"{3}"),(0,i.jsx)("code",{children:"#N/A"}))]}),(0,i.jsx)("dd",{children:[...o(s("_1_appelle_le_11127"),(0,i.jsx)("code",{children:"IMPORTDATA"}))]}),(0,i.jsx)("dd",{children:[...o(s("_1_ne_fonction_68410"),(0,i.jsx)("code",{children:"IMPORTDATA"}),(0,i.jsx)("code",{children:"#N/A"}))]}),(0,i.jsx)("dd",{children:[...o(s("si_l_export_est_28345"),(0,i.jsx)("code",{children:"#N/A"}))]})]})})]})})}),(0,i.jsx)(dD,{buttonColor:"primary",css:{fontWeight:500},link:n,title:s("lien_d_api_pour_98778")}),(0,i.jsx)(dD,{buttonColor:"primary",css:{fontWeight:500},link:`=IMPORTDATA("${n}")`,title:s("import_de_la_vu_17175")})]})})]})})},hD=e=>{const t=Yn(),[n,s]=(0,L.useState)(Fe.Excel),[o,r]=(0,L.useState)("unchecked");return(0,i.jsx)(Rb,{isOpen:e.isOpen,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"file-xls",subtitle:t("exporter_votre_28801"),children:t("exporter_vos_me_10045")}),(0,i.jsxs)(Tb,{gap:"3",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("parameters_de_votre_export")}),(0,i.jsxs)(Na,{direction:"column",gap:"5",children:[(0,i.jsxs)(zu,{label:t("format_de_lexport"),value:n,onChange:s,children:[(0,i.jsx)("option",{value:Fe.Excel,children:"Excel (.xslx)"}),(0,i.jsx)("option",{value:Fe.Csv,children:"CSV (.csv)"})]}),e.showIncludeFiles&&(0,i.jsx)(gc,{state:o,onClick:r,children:t("inclure_dans_l_65554")})]})]}),(0,i.jsx)(Eb,{children:()=>(0,i.jsx)(El,{onClick:()=>{e.requestExport(n,"checked"===o),e.onClose()},children:t("recevoir_l_expo_53392")})})]})})},mD=({organizationKey:e})=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=_l(),{user:r}=si(),{segment:a,columns:l}=gy(),{mutate:d}=function(e={}){return Xn("mutation UsersInfosExport(\n $organizationId: OrganizationId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $includeFiles: Boolean!\n $columns: [String!]!\n) {\n jobId: usersInfosExport(\n organizationId: $organizationId\n segmentId: $segmentId\n format: $format\n includeFiles: $includeFiles\n columns: $columns\n )\n}\n",e)}(),[c,u]=(0,L.useState)(!1),[h,m]=(0,L.useState)(!1),{checkExport:g}=kb();return(0,i.jsxs)(r$,{children:[(0,i.jsx)(Bb,{permissions:Nb.MEMBER_CREATE,children:(0,i.jsx)(KS,{menu:(0,i.jsx)(Gd,{icon:"file-import",onClick:()=>{t.push($s.COMMUNITY_VOLUNTEERS_IMPORT(s))},children:n("importer_via_un_61623")}),path:qI.CREATE({organizationId:s}),children:n("ajouter_un_memb_33261")})}),(0,i.jsx)(Bb,{rolesTypes:pI,children:(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"merge",onClick:()=>{t.push($s.COMMUNITY_USERS_DUPLICATES(s))},children:n("g_rer_les_doubl_39469")}),(0,i.jsx)(Gd,{icon:"plug-circle-bolt",onClick:e=>{Nd(e.target),u(!0)},children:n("exporter_via_l_09843")}),(0,i.jsx)(Gd,{icon:"file-xls",onClick:e=>{Nd(e.target),m(!0)},children:n("exporter_en_exc_51862")}),(0,i.jsx)(Gd,{icon:"file-import",onClick:()=>{t.push($s.COMMUNITY_FILES_IMPORT(s))},children:n("importer_des_do_55420")})]})]})}),(0,i.jsx)(uD,{isOpen:c,link:cg({organizationId:s,eventId:void 0,lang:r?.language,pathComponent:`members/${o}`,key:e}),onClose:()=>{u(!1)}}),(0,i.jsx)(hD,{isOpen:h,requestExport:async(e,t)=>{const{jobId:n}=await d({organizationId:s,segmentId:a.id,format:e,includeFiles:t,columns:l});g(n,s)},showIncludeFiles:!0,onClose:()=>{m(!1)}})]})},gD=e=>{const{translate:t,params:{organizationId:n}}=_l(),{isOrganizationAdmin:s}=yI(),{canMemberEdit:o}=SS(),r=(0,L.useMemo)(()=>new Map(e.customFields.map(e=>[e.slug,e])),[e.customFields]),a=(0,L.useCallback)(()=>{e.reloadUserInfo(e.userInfo.id)},[e.userInfo,e.reloadUserInfo]);return(0,i.jsxs)(Dc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},children:[s&&(0,i.jsx)(Ec,{css:{paddingRight:0},width:48,children:(0,i.jsx)(mc,{state:e.state,onClick:(t,n)=>{Rl(n),e.toggleRow(`ui${e.userInfo.id}`,t)}})}),e.columns.map(t=>{const n=r.get(t.slug);return(0,i.jsx)(qA,{canClickMemberName:!0,column:t,customField:n,reloadRow:a,row:e.userInfo,updatable:!0},t.slug)}),o&&(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",to:$s.COMMUNITY_EDIT_USER(n,e.userInfo.id)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]})})]})},pD=e=>{const{organizationId:t}=Jn(),{isOrganizationAdmin:n}=yI(),{canMemberEdit:s}=SS(),{columns:o,columnsSearch:r,massActions:a,nameDebounced:l,limit:d,offset:c,possibleColumns:u,predicates:h,reloadKey:g,setLimit:p,setOffset:f,setSort:x,sort:_}=gy(),I=(0,L.useMemo)(()=>WA(o),[o]),{data:v,isLoading:b,reload:j}=(C={...I,organizationId:t,predicates:h,name:m(l)?l:null,columnsSearch:no(r)?r:null,limit:d,offset:c,sort:_},Zn(_o,C,[Ls.UserInfoCommunityFragment]));var C;const{numberOfPages:y,totalCount:k}=ku(v.data?.rows);(0,L.useEffect)(()=>{g>1&&j()},[g]);const A=(0,L.useMemo)(()=>o.flatMap(e=>(0,Ya.A)([u.find(t=>t.slug===e)])),[u,o]),[w,S]=(0,L.useState)([]),[E,T]=(0,L.useState)({}),z=(0,L.useCallback)(async e=>{T(t=>({...t,[e]:!0}));const{data:{row:n}}=await Uo({...I,organizationId:t,id:e},await K());S(t=>t.map(t=>t.id===e?n:t)),T(t=>({...t,[e]:!1}))},[I,T,S]);return(0,L.useEffect)(()=>{S(v.data?.rows.nodes??[])},[v.data]),(0,L.useEffect)(()=>{a.setStates(Object.fromEntries((v.data?.rows.nodes??[]).map(({id:e})=>[`ui${e}`,{id:e,state:"unchecked"}])))},[v.data,a.setStates]),(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":b,headerRow:(0,i.jsxs)(jc,{children:[n&&(0,i.jsx)(Vc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(mc,{state:a.selectAllState,onClick:a.toggleSelectAll})}),A.map(e=>e.isSortable?(0,i.jsx)(_m,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:x,sort:_,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Vc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),s&&(0,i.jsx)(Vc,{width:100})]}),paginationRow:(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:d,numberOfPages:y,offset:c,setLimit:p,setOffset:f,showLimits:!0,totalCount:k})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):w.map(t=>E[t.id]?(0,i.jsx)(Uc,{},t.id):(0,i.jsx)(gD,{columns:A,customFields:e.customFields,reloadUserInfo:z,state:a.states[`ui${t.id}`]?.state??"unchecked",toggleRow:a.toggleRow,userInfo:t},t.id))})})},fD=e=>(0,i.jsx)(yr,{css:{padding:"$2 $3"},font:"gray500 textXs semiBold",children:e.children}),xD=e=>{const t=Yn(),{mutate:n,isLoading:s}=Jo(),{mutate:o,isLoading:r}=Ta(),[a,l]=(0,L.useState)([]),[d,c]=(0,L.useState)([]);return(0,L.useEffect)(()=>{(async()=>{if(e.eventId){const t=await tr({eventId:e.eventId},await K());l(t.event.delegations.nodes)}else{const i=await(t={organizationId:e.organizationId},n=await K(),ho("query MassDelegationAddOrganizationDelegations($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Organization) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{variables:t,token:n||void 0,fragments:[]}));l(i.organization.delegations.nodes)}var t,n})()},[e.organizationId,e.eventId]),(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"people-group"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_des_mem_60880")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("Delegation"),values:d,onChange:c,children:a.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{isLoading:s||r,onClick:async()=>{if(no(d)){let i=0;const s=a.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,delegationId:d[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,delegationId:d[0]})).numberOfMembers,e.onSuccess(t("_1_membres_ont_51715",i,s.name)),e.onClose()}},children:t("ajouter_97327")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},_D=e=>{const t=Yn(),{mutate:n,isLoading:s}=function(e={}){return Xn("mutation VolunteersRegistrationsMassFormAdd(\n $eventId: EventId!\n $formId: FormId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassFormAdd(\n eventId: $eventId\n formId: $formId\n selecteds: $selecteds\n )\n}\n",e)}(),{mutate:o,isLoading:r}=function(e={}){return Xn("mutation UsersInfosMassFormAdd(\n $organizationId: OrganizationId!\n $formId: FormId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassFormAdd(\n organizationId: $organizationId\n formId: $formId\n selecteds: $selecteds\n )\n}\n",e)}(),{data:a}=ra({organizationId:e.organizationId,level:e.eventId?it.Event:it.Organization,eventId:e.eventId}),l=(0,L.useMemo)(()=>a.organization?.forms.nodes??[],[a.organization]),[d,c]=(0,L.useState)([]),u=no(d);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"people-group"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",textAlign:"center",children:t("ajouter_des_mem_81812")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("Form"),values:d,onChange:c,children:l.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{disabled:!u,isLoading:s||r,onClick:async()=>{if(no(d)){let i=0;const s=l.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers,e.onSuccess(t("le_formulaire_11679",s.name,i)),e.onClose()}},children:t("ajouter_97327")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},ID=e=>{const t=Yn(),{mutate:n,isLoading:s}=function(e={}){return Xn("mutation VolunteersRegistrationsMassFormRemove(\n $eventId: EventId!\n $formId: FormId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: volunteersRegistrationsMassFormRemove(\n eventId: $eventId\n formId: $formId\n selecteds: $selecteds\n )\n}\n",e)}(),{mutate:o,isLoading:r}=function(e={}){return Xn("mutation UsersInfosMassFormRemove(\n $organizationId: OrganizationId!\n $formId: FormId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassFormRemove(\n organizationId: $organizationId\n formId: $formId\n selecteds: $selecteds\n )\n}\n",e)}(),{data:a}=ra({organizationId:e.organizationId,level:e.eventId?it.Event:it.Organization,eventId:e.eventId}),l=(0,L.useMemo)(()=>a.organization?.forms.nodes??[],[a.organization]),[d,c]=(0,L.useState)([]),u=no(d);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"file-lines"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",textAlign:"center",children:t("marquer_un_form_10633")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("Form"),values:d,onChange:c,children:l.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(sl,{color:"error",leftIcon:"triangle-exclamation",children:e.eventId?t("cette_action_su_82938"):t("cette_action_su_88097")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{color:"error",disabled:!u,isLoading:s||r,onClick:async()=>{if(no(d)){let i=0;const s=l.find(e=>e.id===d[0]);i=e.eventId?(await n({eventId:e.eventId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers:(await o({organizationId:e.organizationId,selecteds:e.selecteds,formId:d[0]})).numberOfMembers,e.onSuccess(t("le_formulaire_87510",s.name,i)),e.onClose()}},children:t("marquer_comme_n_20227")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let vD=class extends Ul{constructor(e){super(e)}massAddEventInputSchema(){return d.Ik().shape({massAddEvent:d.Ik().shape({eventId:d.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})})}massAddEventSchema(){return d.Ik().shape({eventId:d.ai().required(this.t("l_v_nement_est_88155")).typeError(this.t("l_v_nement_est_88155"))})}};vD=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],vD);const bD=e=>{const t=Yn(),n=qn(vD),{mutate:s}=function(e={}){return Xn("mutation UsersInfosMassAddEvent(\n $organizationId: OrganizationId!\n $massAddEvent: MassAddEventInput!\n) {\n numberOfMembers: usersInfosMassAddEvent(\n organizationId: $organizationId\n massAddEvent: $massAddEvent\n )\n}\n",e)}(),{data:o,isLoading:r}=ia({organizationId:e.organizationId}),[a,l]=(0,L.useState)(""),d=(0,L.useMemo)(()=>m(a)?(o.organization?.events.nodes??[]).filter(e=>e.name.trim().toLowerCase().includes(a.trim().toLowerCase())):o.organization?.events.nodes??[],[o.organization,a]);return(0,i.jsxs)(Jj,{buttonText:t("ajouter_le_memb_03343",e.numberOfSelected),icon:"sliders",initialValues:{massAddEvent:{eventId:null,selecteds:e.selecteds}},schema:n.massAddEventInputSchema(),size:"md",title:t("ajouter_les_mem_13940"),onClose:e.onClose,onSubmit:async n=>{const i=d.find(e=>e.id===n.massAddEvent.eventId),o=(await s({organizationId:e.organizationId,massAddEvent:n.massAddEvent})).numberOfMembers;e.onSuccess(t("_1_membres_ont_83814",o,i.name)),e.onClose()},children:[(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_40024"),value:a,onChange:l}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray900",fontWeight:"medium",children:t("sur_quel_v_nem_31606")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Na,{css:{overflowY:"auto"},direction:"column",gap:"3",children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oc,{borderRadius:"$2",height:54}),(0,i.jsx)(oc,{borderRadius:"$2",height:54})]}):d.map(e=>(0,i.jsx)(GR,{label:e.name,name:"massAddEvent.eventId",value:e.id},e.id))})]})},jD=e=>{const t=Yn(),{data:n,loader:s}=Zn("query MergeMembers($organizationId: OrganizationId!, $usersInfosIds: [UsersInfoId!]!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n usersInfos(ids: $usersInfosIds) {\n nodes {\n id\n name\n email\n picture {\n url\n }\n\n volunteersRegistrations {\n eventId\n event {\n name\n }\n\n accreditationsUsersInfos {\n id\n }\n\n positionsSlotsUsersInfos {\n id\n }\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,usersInfosIds:e.usersInfosIds},[]);const{mutate:o}=Zr(),[r,a]=(0,L.useState)(null);return(0,i.jsxs)(Jj,{buttonText:t("fusionner_les_92573",e.numbersOfSelected),icon:"sliders",initialValues:{},size:"md",title:t("fusion_de_membr_34256"),onClose:e.onClose,onSubmit:async()=>{null!==r&&(await o({organizationId:e.organizationId,mainUserInfoId:r,toMergeUsersInfosIds:e.usersInfosIds.filter(e=>e!==r)}),e.onSuccess(t("_1_membres_ont_74574",e.usersInfosIds.length)),e.onClose())},children:[(0,i.jsx)(sl,{color:"gray",leftIcon:"circle-exclamation",children:t("toutes_les_info_39932",e.numbersOfSelected)}),"number"==typeof n.organization?.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(sl,{color:"warning",leftIcon:"circle-exclamation",children:t("if_you_merge_me_62641")})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{font:"gray700 textSm medium",children:t("quel_membre_sou_80665")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:s||n.organization.usersInfos.nodes.map((e,n)=>{const s=e.volunteersRegistrations.flatMap(e=>e.accreditationsUsersInfos.length>0||e.positionsSlotsUsersInfos.length>0?{eventId:e.eventId,eventName:e.event.name,numberOfAccreditations:e.accreditationsUsersInfos.length,numberOfAssignments:e.positionsSlotsUsersInfos.length}:[]);return(0,i.jsxs)(L.Fragment,{children:[0!==n&&(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{a(e.id)},children:[(0,i.jsx)(fc,{shouldPreventDefault:!1,state:r===e.id?"checked":"unchecked",onClick:Ql.A}),(0,i.jsx)(Jg,{email:e.email,image:e.picture?.url,name:e.name,size:48}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:m(e.name)?e.name:"-"}),(0,i.jsx)(yr,{color:"gray500",children:e.email}),(0,i.jsx)(Na,{gap:"2",children:s.map(e=>(0,i.jsxs)(L.Fragment,{children:[e.numberOfAccreditations>0&&(0,i.jsx)(ic,{css:{height:"fit-content"},leftIcon:"badge-check",children:t("_1_2_accred_26410",e.eventName,e.numberOfAccreditations)}),e.numberOfAssignments>0&&(0,i.jsx)(ic,{css:{height:"fit-content"},leftIcon:"location-dot",children:t("_1_2_assign_03225",e.eventName,e.numberOfAssignments)})]},e.eventId))})]})]})]},e.id)})})]})},CD=e=>{const{translate:t,params:{organizationId:n}}=_l(),{showNotification:s}=kb(),{mutate:o}=$o(),{mutate:r}=function(e={}){return Xn("mutation UsersInfosMassDelete(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n numberOfMembers: usersInfosMassDelete(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{hasFeature:a}=yI(),{data:l}=Zn("query UsersActions($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hasDelegations\n hasEvents\n hasForms\n }\n}\n",{organizationId:n},[]),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1),[g,p]=(0,L.useState)(!1),[f,x]=(0,L.useState)(!1),[_,I]=(0,L.useState)(!1),[v,b]=(0,L.useState)(!1),[j,C]=(0,L.useState)(!1),[y,k]=(0,L.useState)(!1),A=e.massActions.getSelectedsInput(e.predicates,null),w=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,S=(0,L.useCallback)(t=>{m(t)&&s(t),e.onMassEditSuccess()},[e.onMassEditSuccess]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(El,{onClick:()=>{c(!0)},children:t("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(fD,{children:t("gestion_des_mem_51660")}),(0,i.jsx)(Gd,{icon:"plus",isDisabled:!l.organization?.hasEvents,onClick:()=>{h(!0)},children:t("ajouter_1_membr_25541",w)}),(0,i.jsx)(Gd,{icon:"merge",onClick:()=>{p(!0)},children:t("fusionner_les_m_37150")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(fD,{children:t("accr_ditations_39450")}),a(Ne.Delegation)&&(0,i.jsx)(Gd,{icon:"people-group",isDisabled:!l.organization?.hasDelegations,onClick:()=>{I(!0)},children:l.organization?.hasDelegations?t("ajouter_1_mem_86218",w):t("cette_organisat_48937")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(fD,{children:t("communication_05277")}),(0,i.jsx)(Gd,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>{b(!0)},children:t("ajouter_1_mem_52947",w)}),(0,i.jsx)(Gd,{icon:"file-lines",isDisabled:!l.organization?.hasForms,onClick:()=>{C(!0)},children:t("marquer_un_form_10633")}),(0,i.jsx)(Gd,{icon:"paper-plane",onClick:()=>{k(!0)},children:t("SendCampaign")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{x(!0)},children:t("supprimer_43083")})]})]}),d&&(0,i.jsx)(gA,{mutate:e=>o({organizationId:n,massEdit:e}),organizationId:n,selecteds:A,onClose:()=>{c(!1)},onSuccess:e=>{S(t("_1_membres_ont_07596",e))}}),u&&(0,i.jsx)(bD,{numberOfSelected:w,organizationId:n,selecteds:A,onClose:()=>{h(!1)},onSuccess:S}),g&&(0,i.jsx)(jD,{numbersOfSelected:w,organizationId:n,usersInfosIds:e.massActions.selectedsIds,onClose:()=>{p(!1)},onSuccess:S}),f&&(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_65177"),t("cette_action_es_45424")],text:t("suppression_de_57689",w),onClose:()=>{x(!1)},onDelete:async()=>{const e=(await r({organizationId:n,selecteds:A})).numberOfMembers;S(t("_1_membres_ont_13170",e))}}),v&&(0,i.jsx)(_D,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{b(!1)},onSuccess:S}),j&&(0,i.jsx)(ID,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{C(!1)},onSuccess:S}),_&&(0,i.jsx)(xD,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{I(!1)},onSuccess:S}),y&&(0,i.jsx)(RA,{eventId:null,organizationId:n,selecteds:A,onClose:()=>{k(!1)},onSuccess:S})]})},yD=({customFields:e,organizationKey:t})=>{const n=Yn(),{isOrganizationAdmin:s}=yI(),{limit:o,massActions:r,onMassEditSuccess:a,predicates:l,reloadKey:d,segment:c,setReloadKey:u}=gy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(mD,{organizationKey:t,reload:()=>{u(d+1)}}),(0,i.jsxs)(ej,{children:[(0,i.jsx)(o$,{searchRow:(0,i.jsx)(i$,{actions:(0,i.jsx)(CD,{massActions:r,predicates:l,showOnlyMassEdit:!1,totalNumberOfMembers:c.count,onMassEditSuccess:a}),searchPlaceholder:n("rechercher_un_m_05904"),showActions:s,showEditColumns:s,showEditMode:s,showSearchColumns:s}),selectSegment:(0,i.jsx)(A$,{pageSelectedText:n("les_1_membres_00895",o),segmentSelectedText:n("les_1_membres_56748",c.count,c.name)})}),(0,i.jsx)(pD,{customFields:e})]})]})},kD=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=_l(),{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=yI(),d=qn(GA),c=(0,L.useMemo)(()=>d.getOrganizationUsersFilters(s,o,e.organization),[e.organization]),u=(0,L.useMemo)(()=>d.getOrganizationUsersPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(e$,{canEditSegments:r,filters:c,filtersButtonText:n("filtrer_les_mem_49255"),filtersSubtitle:n("appliquer_des_f_48814"),getSegmentPath:e=>$s.COMMUNITY_USERS_SEGMENT(s,e),initialLimit:a?.usersLimit??Tc,initialSegmentsOpen:a?.areUsersSegmentsOpen??!0,organizationId:s,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:vt.Volunteers,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({usersLimit:e})},onSegmentClick:e=>{l({usersSegmentId:e})},onSegmentDelete:async()=>{await l({usersSegmentId:null}),t.replace(yi.COMMUNITY_USERS({organizationId:s}))},onSegmentsToggle:async e=>{await l({areUsersSegmentsOpen:e})},children:(0,i.jsx)(yD,{customFields:e.organization.customFields.nodes,organizationKey:e.organization.key})})},AD=()=>{const{params:{organizationId:e},translate:t}=_l();Dd(`${t("communaut_20896")} ${t("membres_11310")}`);const{localOrganization:n}=yI(),{data:s,loader:o,reload:r}=Zn("query UsersSegments($organizationId: OrganizationId!, $privacy: CustomFieldPrivacy!) {\n organization(id: $organizationId) {\n key\n\n customFields(variety: UserInfo, privacy: $privacy) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n segmentsFolders(level: Organization, segmentType: Volunteers) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,privacy:xe.All},[Ls.SegmentCustomFieldFragment,Ls.SegmentsFoldersSegmentsFragment]);const a=(0,L.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.COMMUNITY_USERS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(kD,{organization:s.organization,reload:r})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.COMMUNITY_USERS_SEGMENT(e,n?.usersSegmentId&&a.includes(n.usersSegmentId)?n?.usersSegmentId:a[0]),replace:!0})})]})},wD=e=>{const{translate:t,params:{organizationId:n}}=_l(),s=qn(rC),{mutate:o,isLoading:r}=Zr(),a=(0,L.useMemo)(()=>Object.fromEntries(e.displayColumns.flatMap(t=>{const n=e.customFields.find(e=>e.slug===t);return n?[[t,n]]:[]})),[e.customFields,e.displayColumns]);return(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(El,{color:"primary",isLoading:r,size:"sm",onClick:async()=>{await o({organizationId:n,mainUserInfoId:e.selectedId,toMergeUsersInfosIds:e.usersInfos.map(({id:e})=>e).filter(t=>t!==e.selectedId)}),e.onSuccess()},children:t("fusionner_04498")})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:t("nom_du_membre_69353")}),e.displayColumns.map(e=>{const n=a[e];return"delegations"===e?(0,i.jsx)(Vc,{children:t("d_l_gations_78318")},e):n?(0,i.jsx)(Vc,{children:n.name},e):null}),(0,i.jsx)(Vc,{children:t("membre_principa_09597")})]}),numberOfPages:0,offset:0,rows:e.usersInfos.map(t=>(0,i.jsxs)(Dc,{css:{cursor:"pointer"},onClick:()=>{e.onSelect(t.id)},children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(uj,{userInfo:t})}),e.displayColumns.map(e=>{const n=a[e];return"delegations"===e?(0,i.jsx)(Ec,{gap:"2",wrap:"wrap",children:t.delegations.map(e=>{const t=e.event?`${e.event.name}`:e.name;return(0,i.jsx)(ic,{children:t},e.id)})},e):n?(0,i.jsx)(Ec,{children:s.getValueString(n,t.fields,{fileReturnValue:"name"})},e):null}),(0,i.jsx)(Ec,{children:(0,i.jsx)(fc,{shouldPreventDefault:!1,state:e.selectedId===t.id?"checked":"unchecked",onClick:Ql.A})})]},t.id)),setOffset:Ql.A,title:e.usersInfos[0].name,totalCount:0})},SD=e=>{const{translate:t,params:{organizationId:n}}=_l(),{localOrganization:s,updateLocalOrganization:o}=yI(),r=e.organization.customFields.nodes,[a,l]=(0,L.useState)(e.organization.possibleDuplicates),[d,c]=(0,L.useState)(Object.fromEntries(a.map(({id:e,usersInfos:t})=>[e,t[0].id]))),[u,h]=(0,L.useState)(!1),g=a.length??0,[p,f]=(0,L.useState)(s?.duplicatesColumns||[]),x=(0,L.useMemo)(()=>(0,lc.A)(r.map(e=>({name:e.name,slug:e.slug})).concat([{name:t("d_l_gations_78318"),slug:"delegations"}]),e=>e.name),[r]),_=(0,L.useCallback)(async e=>{f(e),await o({duplicatesColumns:e})},[f]),[I,v]=(0,L.useState)(""),b=(0,L.useMemo)(()=>m(I)?a.filter(e=>e.usersInfos.some(e=>e.name.toLowerCase().includes(I.toLowerCase()))):a,[a,I]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pm,{fallbackClosePath:yi.COMMUNITY_USERS({organizationId:n}),heading:t("gestion_des_mem_14016"),children:(0,i.jsxs)($m,{children:[(0,i.jsx)(Na,{align:"center",justify:"between",children:(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("liste_des_membr_20115")}),g>0&&(0,i.jsx)(ic,{color:"warning",size:"sm",children:t("_1_doublon_pot_74382",g)})]}),(0,i.jsx)(yr,{color:"gray500",children:t("s_lectionner_le_91896")})]})}),(0,i.jsx)(qa,{height:"6"}),0===g?(0,i.jsxs)(kc,{children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:t("nom_du_membre_69353")}),(0,i.jsx)(Vc,{children:t("membre_principa_09597")})]}),(0,i.jsx)(Dc,{css:{height:"400px"},children:(0,i.jsx)(Ec,{css:{height:"100%"},children:(0,i.jsx)(Nk,{subtitle:"",title:t("il_n_y_a_pas_de_78722")})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",justify:"between",children:[(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{placeholder:t("rechercher_un_m_05904"),value:I,onChange:v})}),(0,i.jsx)(El,{color:"white",leftIcon:"gear",onClick:()=>{h(!0)},children:t("_diter_les_colo_39630")})]}),(0,i.jsx)(qa,{height:"6"}),b.map(({id:e,usersInfos:t})=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(wD,{customFields:r,displayColumns:p,selectedId:d[e],usersInfos:t,onSelect:t=>{c(n=>({...n,[e]:t}))},onSuccess:()=>{l(t=>t.filter(t=>t.id!==e))}}),(0,i.jsx)(qa,{height:"4"})]},e))]})]})}),u&&(0,i.jsx)(Cu,{columns:x,initialSelectedColumns:p,saveButtonText:t("_diter_62574"),searchPlaceholder:t("rechercher_un_c_86475"),subtitle:t("personnaliser_l_96096"),title:t("_dition_des_col_70300"),onClose:()=>{h(!1)},onSave:_})]})},ED=()=>{const{params:{organizationId:e}}=_l(),{data:t,loader:n}=Zn("query PossibleDuplicates($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n\n possibleDuplicates {\n id\n\n usersInfos {\n id\n email\n name\n fields\n\n picture {\n url\n }\n\n delegations(level: Both) {\n id\n name\n\n event {\n name\n }\n }\n }\n }\n }\n}\n",{organizationId:e},[Ls.CustomFieldWithConditionFragment]);return n||(0,i.jsx)(SD,{organization:t.organization})},TD=()=>{const{translate:e,params:{organizationId:t}}=_l();Dd(e("communaut_20896"));const{hasFeature:n}=yI(),{canDelegationEdit:s,canDelegationRead:o,canFormRead:r,canWorkflowEdit:a,canWorkflowRead:l}=SS();return n(Ne.Community)?(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:yi.COMMUNITY_DASHBOARD({organizationId:":organizationId"}),children:(0,i.jsx)(x$,{children:(0,i.jsx)(_$,{})})}),(0,i.jsx)(Ar.qh,{path:$s.COMMUNITY_USERS_DUPLICATES(":organizationId"),children:(0,i.jsx)(ED,{})}),(0,i.jsx)(Ar.qh,{path:[qI.CREATE({organizationId:":organizationId",delegationId:":delegationId"}),qI.CREATE({organizationId:":organizationId"})],children:(0,i.jsx)(sz,{})}),(0,i.jsx)(Ar.qh,{path:yi.COMMUNITY_USERS({organizationId:":organizationId"}),children:(0,i.jsx)(x$,{children:(0,i.jsx)(AD,{})})}),(0,i.jsx)(Ar.qh,{path:[$s.COMMUNITY_EDIT_USER(":organizationId",":userInfoId"),$s.COMMUNITY_EDIT_USER_DELEGATION(":organizationId",":delegationId",":userInfoId")],children:(0,i.jsx)(gT,{children:(0,i.jsx)(EO,{})})}),(0,i.jsx)(Ar.qh,{exact:!0,path:SI.CREATE_TEMPLATE({organizationId:":organizationId"}),children:(0,i.jsx)(Xb,{isTemplate:!0})}),(0,i.jsx)(Ar.qh,{exact:!0,path:SI.CREATE({organizationId:":organizationId",options:":options?"}),children:(0,i.jsx)(Xb,{isTemplate:!1})}),(0,i.jsx)(Ar.qh,{path:SI.UPDATE({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(Qb,{})}),(0,i.jsx)(Ar.qh,{path:SI.CAMPAIGNS({organizationId:":organizationId"}),children:(0,i.jsx)(x$,{children:(0,i.jsx)(p$,{})})}),(0,i.jsx)(Ar.qh,{path:SI.CAMPAIGN({organizationId:":organizationId",campaignId:":campaignId"}),children:(0,i.jsx)(x$,{children:(0,i.jsx)(Rj,{})})}),r&&(0,i.jsx)(Ar.qh,{path:Ni.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(x$,{children:(0,i.jsx)(DS,{isCreateOpen:!0})})}),r&&(0,i.jsx)(Ar.qh,{path:Ni.FORMS({organizationId:":organizationId"}),children:(0,i.jsx)(x$,{children:(0,i.jsx)(DS,{isCreateOpen:!1})})}),r&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_ELEMENTS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(mE,{})}),r&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(NE,{})}),r&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(DE,{})}),r&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(kE,{})}),r&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_STATE({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(VE,{})}),r&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_INTEGRATION({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(GS,{})}),r&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_EMAILS({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(xE,{})}),r&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PREVIEW({organizationId:":organizationId",formId:":formId"}),children:(0,i.jsx)(HS,{})}),(0,i.jsx)(Ar.qh,{path:$s.COMMUNITY_VOLUNTEERS_IMPORT(":organizationId"),children:(0,i.jsx)(iR,{})}),(0,i.jsx)(Ar.qh,{path:$s.COMMUNITY_FILES_IMPORT(":organizationId"),children:(0,i.jsx)(yS,{})}),(0,i.jsx)(Ar.qh,{path:qI.MEMBER({organizationId:":organizationId",userInfoId:":userInfoId"}),children:(0,i.jsx)(x$,{children:(0,i.jsx)(pO,{})})}),s&&(0,i.jsx)(Ar.qh,{path:$s.COMMUNITY_CREATE_DELEGATION(":organizationId",":options?"),children:(0,i.jsx)(ay,{})}),s&&(0,i.jsx)(Ar.qh,{path:$s.COMMUNITY_EDIT_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(dy,{})}),o&&(0,i.jsx)(Ar.qh,{path:$s.COMMUNITY_DELEGATIONS(":organizationId"),children:(0,i.jsx)(x$,{children:(0,i.jsx)(lD,{})})}),o&&(0,i.jsx)(Ar.qh,{path:ds.DELEGATION_CATEGORY({organizationId:":organizationId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(x$,{children:(0,i.jsx)(xS,{isEvent:!1})})}),o&&(0,i.jsx)(Ar.qh,{path:$s.COMMUNITY_DELEGATION(":organizationId",":delegationId"),children:(0,i.jsx)(x$,{children:(0,i.jsx)(iS,{})})}),a&&(0,i.jsx)(Ar.qh,{path:ZI.CREATE({organizationId:":organizationId"}),children:(0,i.jsx)(CR,{})}),l&&(0,i.jsx)(Ar.qh,{path:ZI.UPDATE({organizationId:":organizationId",workflowId:":workflowId"}),children:(0,i.jsx)(yR,{})}),l&&(0,i.jsx)(Ar.qh,{path:ZI.WORKFLOWS({organizationId:":organizationId"}),children:(0,i.jsx)(x$,{children:(0,i.jsx)(FR,{})})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:yi.COMMUNITY_USERS({organizationId:t}),replace:!0})})]}):(0,i.jsx)(x$,{children:(0,i.jsx)(Na,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(kI,{icon:"crown",subtitle:e("contactez_nous_69860"),title:e("pour_en_profite_62789")})})})};let zD=class extends gu{constructor(e,t,n){super(e,t,n)}getCustomFieldsFilters(e,t){return[{slug:"name",name:this.t("nom_du_champ_48329"),category:this.t("champs_de_formu_64126"),fieldType:We.Text,hideEmpty:!0},{slug:"label",name:this.t("label_08243"),category:this.t("champs_de_formu_64126"),fieldType:We.Text},{slug:"customFieldCategory",name:this.t("cat_gorie_00291"),category:this.t("champs_de_formu_64126"),fieldType:We.Select,values:t.customFieldsCategories.nodes,hideEmpty:!0},{slug:"fieldType",name:this.t("type_35427"),category:this.t("champs_de_formu_64126"),fieldType:We.Select,values:hn.map(e=>({id:e,name:e})),hideEmpty:!0},{slug:"variety",name:this.t("typologie_34041"),category:this.t("champs_de_formu_64126"),fieldType:We.Select,values:(0,lc.A)(nn.map(e=>({id:e,name:rA(this.t.bind(this),e)})),({name:e})=>e),hideEmpty:!0},{slug:"privacy",name:this.t("Privacy"),category:this.t("champs_de_formu_64126"),fieldType:We.Checkbox,hideEmpty:!0},{slug:"condition",name:this.t("condition_61066"),category:this.t("champs_de_formu_64126"),fieldType:We.Select,values:t.customFields.nodes},{slug:"isEncrypted",name:this.t("est_chiffr_99072"),category:this.t("champs_de_formu_64126"),fieldType:We.Checkbox,hideEmpty:!0},{slug:"createdBy",name:this.t("cr_e_par_30622"),category:this.t("champs_de_formu_64126"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:"createdAt",name:this.t("cr_e_le_02658"),category:this.t("champs_de_formu_64126"),fieldType:We.Datetime,hideEmpty:!0}]}getCustomFieldsPossibleColumns(){return[{slug:"id",name:this.t("id_51738"),isSortable:!0,sortAttribute:Ie.Id,width:100},{slug:"name",name:this.t("nom_du_champ_48329"),isSortable:!0,sortAttribute:Ie.Name,minWidth:240},{slug:"label",name:this.t("label_08243"),isSortable:!0,sortAttribute:Ie.Label,minWidth:180},{slug:"category",name:this.t("Category"),isSortable:!0,sortAttribute:Ie.Category,minWidth:240},{slug:"variety",name:this.t("typologie_34041"),minWidth:180},{slug:"fieldType",name:this.t("type_35427"),isSortable:!0,sortAttribute:Ie.Type,width:250},{slug:"numberOfTimesUsed",name:this.t("nombre_d_utilis_58389"),width:200},{slug:"state",name:this.t("Privacy"),isSortable:!0,sortAttribute:Ie.Status,width:200},{slug:"values",name:this.t("valeurs_34314"),minWidth:240},{slug:"variable",name:this.t("variable_pour_l_45711"),minWidth:180},{slug:"isEncrypted",name:this.t("est_chiffr_99072"),width:200},{slug:"createdBy",name:this.t("cr_par_41994"),minWidth:180},{slug:"createdAt",name:this.t("cr_le_85046"),isSortable:!0,sortAttribute:Ie.CreatedAt,minWidth:180}]}};zD=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],zD);const OD=()=>{const{translate:e}=_l(),{massActions:t,onMassEditSuccess:n,organizationId:s,predicates:o,segment:r}=gy(),{showNotification:a}=kb(),{mutate:l}=So(),{mutate:d}=Xr(),[c,u]=(0,L.useState)(!1),[h,g]=(0,L.useState)(!1),p=t.getSelectedsInput(o,null),f=t.isAllSelected?r.count:t.numberOfSelected,x=(0,L.useCallback)(e=>{m(e)&&a(e),n()},[n]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(El,{onClick:()=>{u(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(qd,{placement:"bottom-end",children:(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{g(!0)},children:e("supprimer_43083")})})]}),c&&(0,i.jsx)(hA,{mutate:e=>l({organizationId:s,massEdit:e}),organizationId:s,selecteds:p,onClose:()=>{u(!1)},onSuccess:t=>{x(e("_1_champs_pers_55120",t))}}),h&&(0,i.jsx)(sA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_63402")],text:e("suppression_de_98457",f),onClose:()=>{g(!1)},onDelete:async()=>{const t=(await d({organizationId:s,selecteds:p})).numberOfCustomFields;x(e("_1_champs_pers_68086",t))}})]})},RD=()=>{const{history:e,translate:t,params:{organizationId:n}}=_l(),{segment:s}=gy();return(0,i.jsx)(r$,{children:(0,i.jsx)(Bb,{permissions:Nb.CUSTOM_FIELD_EDIT,children:(0,i.jsx)(El,{onClick:()=>{e.push($s.CREATE_CUSTOM_FIELD(n,s.id))},children:t("cr_er_un_champ_31226")})})})},$D=L.createContext({}),DD=e=>{const t=j$(Eo,{organizationId:e.organizationId},e=>e.organization.customFieldsCategories.nodes);return(0,i.jsx)($D.Provider,{value:{getCustomFieldsCategories:t},children:e.children})},PD=e=>{const{translate:t}=_l(),{getCustomFieldsCategories:n}=L.useContext($D),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("Category")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(zu,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},FD=e=>{const{params:{organizationId:t}}=_l(),{mutate:n}=So();return(0,i.jsx)(_y,{column:e.column,initialValue:e.initialValue,mutate:async i=>n({organizationId:t,massEdit:{reset:!1,selecteds:{ids:[e.customFieldId]},slug:e.property,strategy:tt.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},MD=e=>(0,i.jsx)(FD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.category.id,property:_e.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(PD,{setValue:t,value:e}),renderValue:e.customField.category.name}),ND=e=>{const{translate:t}=_l();return(0,i.jsx)(FD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.label||"",property:_e.Label,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{name:t("label_08243"),value:e,onChange:n}),renderValue:e.customField.label||""})},LD=e=>{const{translate:t}=_l();return(0,i.jsx)(FD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.name,property:_e.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{name:t("nom_du_champ_48329"),value:e,onChange:n}),renderValue:()=>(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsx)(yr,{color:"gray800",css:{ellipsis:!0,width:"100%"},title:e.customField.name,children:e.customField.name}),e.customField.conditionCustomField&&(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0,width:"100%"},title:e.customField.conditionCustomField.name,children:t("d_pend_de_1_52961",e.customField.conditionCustomField.name)})]})})},BD=e=>{const{translate:t}=_l();return(0,i.jsx)(FD,{column:e.column,customFieldId:e.customField.id,initialValue:e.customField.isPrivate,property:_e.Privacy,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(zu,{label:t("Privacy"),shouldParseAsBoolean:!0,value:e,onChange:n,children:[(0,i.jsx)("option",{value:"true",children:t("Private")}),(0,i.jsx)("option",{value:"false",children:t("Public")})]}),renderValue:()=>e.customField.isPrivate?(0,i.jsx)(ic,{color:"gray",leftIcon:"lock",children:t("Private")}):(0,i.jsx)(ic,{color:"primary",leftIcon:"globe",children:t("Public")})})},VD=e=>{const{history:t,translate:n}=_l();return"id"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):"name"===e.column.slug?(0,i.jsx)(LD,{column:e.column,customField:e.row,reload:e.reloadRow}):"label"===e.column.slug?(0,i.jsx)(ND,{column:e.column,customField:e.row,reload:e.reloadRow}):"category"===e.column.slug?(0,i.jsx)(MD,{column:e.column,customField:e.row,reload:e.reloadRow}):"fieldType"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Na,{children:[(0,i.jsx)(yr,{color:"gray800",css:{width:"18px"},children:(0,i.jsx)(el,{icon:Vz(e.row.fieldType,e.row.fieldProperty)})}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsx)(yr,{color:"gray800",children:n(e.row.fieldType)})]})}):"numberOfTimesUsed"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:0===e.row.numberOfTimesUsed?e.row.numberOfTimesUsed:(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{t.push($s.CUSTOM_FIELD_USAGE(e.organizationId,e.segmentId,e.row.id))},children:e.row.numberOfTimesUsed})}):"state"===e.column.slug?(0,i.jsx)(BD,{column:e.column,customField:e.row,reload:e.reloadRow}):"values"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.values.map(({value:e})=>e).join(", ")}):"variable"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.variety===ve.UserInfo?`{user.${e.row.slug}}`:""}):"variety"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:rA(n,e.row.variety)}):"isEncrypted"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.isEncrypted?n("oui_54361"):n("non_33516")}):"createdBy"===e.column.slug?(0,i.jsx)(zR,{column:e.column,createdBy:e.row.createdBy}):"createdAt"===e.column.slug?(0,i.jsx)(TR,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)(Ec,{})},UD=e=>{const{history:t,translate:n}=_l(),{showNotification:s}=kb(),[o,r]=(0,L.useState)(!1),{mutate:a}=function(e={}){return Xn("mutation CustomFieldDuplicate($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n customFieldDuplicate(organizationId: $organizationId, customFieldId: $customFieldId) {\n id\n }\n}\n",e)}(),{mutate:l}=Xr(),[d,c]=(0,L.useState)(!1),u=e.customField.canDelete&&(e.customField.fieldType!==Ve.Select||e.customField.isSelectV2);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{isOpen:o,onStateChange:r,children:[(0,i.jsx)(Wd,{onClick:n=>{Nd(n.target),t.push($s.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,e.customField.id))},children:(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(el,{icon:"pen"}),n("_diter_62574")]})}),u&&(0,i.jsx)(Wd,{onClick:async n=>{Nd(n.target);const{customFieldDuplicate:{id:i}}=await a({organizationId:e.organizationId,customFieldId:e.customField.id});e.reload(),t.push($s.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,i))},children:(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(el,{icon:"clone"}),n("dupliquer_28256")]})}),e.customField.canDelete&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Wd,{color:"red",onClick:()=>{r(!1),c(!0)},children:(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(el,{icon:"trash-can"}),n("supprimer_43083")]})})]})]}),d&&(0,i.jsx)(sA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_96670"),text:n("suppression_de_73669",e.customField.name),onClose:()=>{c(!1)},onDelete:async()=>{await l({organizationId:e.organizationId,selecteds:{ids:[e.customField.id]}}),s(n("le_champ_1_43589",e.customField.name)),e.reload()}})]})},WD=e=>{const{history:t,translate:n}=_l(),{canCustomFieldEdit:s}=SS(),o=(0,L.useCallback)(()=>{e.reloadCustomField(e.customField.id)},[e.customField,e.reloadCustomField]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(Dc,{css:{"&:hover":{background:"$gray100"}},onMouseLeave:e=>{Nd(e.target)},children:[s&&(0,i.jsx)(Ec,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:e.state,onClick:(t,n)=>{Rl(n),e.toggleRow(`cf${e.customField.id}`,t)}})}),e.columns.map(t=>(0,i.jsx)(VD,{column:t,organizationId:e.organizationId,reloadRow:o,row:e.customField,segmentId:e.segmentId},t.slug)),s&&(0,i.jsxs)(Yc,{justify:"end",children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",onClick:()=>{t.push($s.EDIT_CUSTOM_FIELD(e.organizationId,e.segmentId,e.customField.id))}})})}),(0,i.jsx)(Cm,{placement:"top",children:n("_diter_62574")})]}),(0,i.jsx)(UD,{customField:e.customField,organizationId:e.organizationId,reload:e.reload,segmentId:e.segmentId})]})]})})},GD=()=>{const{params:{organizationId:e}}=_l(),{canCustomFieldEdit:t}=SS(),{columns:n,limit:s,massActions:o,nameDebounced:r,offset:a,possibleColumns:l,predicates:d,reloadKey:c,segmentId:u,setLimit:h,setOffset:g,setSort:p,sort:f}=gy(),{data:x,isLoading:_,reload:I}=Zn("query CustomFields(\n $organizationId: OrganizationId!\n $name: String\n $predicates: [Predicate!]!\n $limit: Int\n $offset: Int\n $sort: CustomFieldsSort\n) {\n data: organization(id: $organizationId) {\n rows: customFields(\n predicates: $predicates\n name: $name\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...CustomField\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:e,predicates:d,name:m(r)?r:null,limit:s,offset:a,sort:f},[Ls.CustomFieldFragment]);const{numberOfPages:v,totalCount:b}=ku(x.data?.rows),j=(0,L.useMemo)(()=>n.flatMap(e=>(0,Ya.A)([l.find(t=>t.slug===e)])),[l,n]),[C,y]=(0,L.useState)([]),[k,A]=(0,L.useState)({}),w=(0,L.useCallback)(async t=>{A(e=>({...e,[t]:!0}));const{data:{row:n}}=await function(e,t){return ho("query CustomField($organizationId: OrganizationId!, $id: CustomFieldId!) {\n data: organization(id: $organizationId) {\n row: customField(id: $id) {\n ...CustomField\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.CustomFieldFragment]})}({organizationId:e,id:t},await K());y(e=>e.map(e=>e.id===t?n:e)),A(e=>({...e,[t]:!1}))},[A,y]);return(0,L.useEffect)(()=>{y(x.data?.rows.nodes??[])},[x.data]),(0,L.useEffect)(()=>{c>1&&I()},[c]),(0,L.useEffect)(()=>{o.setStates(Object.fromEntries((x.data?.rows.nodes??[]).map(e=>[`cf${e.id}`,{id:e.id,state:"unchecked"}])))},[x.data,o.setStates]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":_,headerRow:(0,i.jsxs)(jc,{children:[t&&(0,i.jsx)(Vc,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:o.selectAllState,onClick:o.toggleSelectAll})}),j.map(e=>e.isSortable?(0,i.jsx)(_m,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:p,sort:f,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Vc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),t&&(0,i.jsx)(Vc,{width:100})]}),paginationRow:(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:s,numberOfPages:v,offset:a,setLimit:h,setOffset:g,showLimits:!0,totalCount:b})}),children:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(Uc,{},t.id):(0,i.jsx)(WD,{columns:j,customField:t,organizationId:e,reload:I,reloadCustomField:w,segmentId:u,state:o.states[`cf${t.id}`]?.state??"unchecked",toggleRow:o.toggleRow},t.id))})})})},HD=()=>{const{history:e,translate:t,params:{organizationId:n,customFieldId:s}}=_l(),{data:o,loader:r}=Zn("query CustomFieldUsage($organizationId: OrganizationId!, $customFieldId: CustomFieldId!) {\n organization(id: $organizationId) {\n customField(id: $customFieldId) {\n name\n fieldProperty\n fieldType\n\n positions {\n id\n name\n\n event {\n id\n name\n }\n }\n\n forms {\n id\n name\n\n event {\n id\n name\n }\n\n organization {\n id\n name\n }\n }\n }\n }\n}\n",{organizationId:n,customFieldId:s},[]),a=o.organization?.customField;return(0,i.jsx)(xu,{returnToFallback:$s.CUSTOM_FIELDS(n),size:"sm",children:r?(0,i.jsx)(_u,{children:r}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yj,{children:t("nombre_d_utilis_58389")}),(0,i.jsxs)(_u,{children:[(0,i.jsx)(qa,{height:"9"}),(0,i.jsxs)(Na,{align:"center",direction:"column",children:[(0,i.jsx)(Na,{align:"center",css:{background:"$purple100",borderRadius:"24px",color:"$purple700",fontSize:"$textXl"},height:64,justify:"center",width:64,children:(0,i.jsx)(el,{icon:Vz(a.fieldType,a.fieldProperty)})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:a.name})]}),(0,i.jsx)(qa,{height:"9"}),a.positions.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_de_missio_27210",a.positions.length)}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Na,{direction:"column",gap:"6",children:a.positions.map(t=>(0,i.jsxs)(yr,{css:{cursor:"pointer"},onClick:()=>{e.push(ps.POSITION({organizationId:n,eventId:t.event.id,positionId:t.id}))},children:[(0,i.jsx)(yr,{color:"gray800",children:t.event.name}),(0,i.jsx)(yr,{color:"gray500",children:t.name})]},t.id))}),(0,i.jsx)(yr,{css:{borderTop:"1px solid $gray200",height:"1px",marginBottom:"$6",marginTop:"$6",width:"100%"}})]}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("liste_des_formu_84836",a.forms.length)}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Na,{direction:"column",gap:"6",children:a.forms.map(n=>{const s=n.event?n.event.name:t("communaut_20896");return(0,i.jsxs)(yr,{css:{cursor:"pointer"},onClick:()=>{e.push(Ni.FORM({organizationId:n.organization.id,eventId:n.event?.id,formId:n.id}))},children:[(0,i.jsx)(yr,{color:"gray800",children:s}),(0,i.jsx)(yr,{color:"gray500",children:n.name})]},n.id)})}),(0,i.jsx)(qa,{height:"9"})]})]})})},qD=()=>{const{history:e,translate:t,params:{organizationId:n}}=_l(),{canCustomFieldEdit:s,canSegmentEdit:o}=SS(),{reloadKey:r,segmentId:a,setReloadKey:l}=gy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(RD,{}),(0,i.jsxs)(ej,{children:[(0,i.jsx)(o$,{searchRow:(0,i.jsx)(i$,{actions:(0,i.jsx)(OD,{}),searchPlaceholder:t("rechercher_un_c_49598"),showActions:s,showEditColumns:o,showEditMode:s,showSearchColumns:!1})}),(0,i.jsx)(GD,{}),(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.CUSTOM_FIELD_USAGE(":organizationId",":segmentId",":customFieldId"),children:(0,i.jsx)(HD,{})}),(0,i.jsx)(Ar.qh,{path:$s.CREATE_CUSTOM_FIELD(":organizationId",":segmentId"),children:(0,i.jsx)(eE,{organizationId:n,onClose:()=>{e.goBack($s.CUSTOM_FIELDS_SEGMENT(n,a))},onSuccess:()=>{l(r+1)}})}),(0,i.jsx)(Ar.qh,{path:$s.EDIT_CUSTOM_FIELD(":organizationId",":segmentId",":customFieldId"),children:(0,i.jsx)(nE,{onClose:()=>{e.goBack($s.CUSTOM_FIELDS_SEGMENT(n,a))},onSuccess:()=>{l(r+1)}})})]})]})]})},YD=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=_l();Dd(n("champs_de_formu_64126"));const{isOrganizationAdmin:r,localOrganization:a,updateLocalOrganization:l}=yI(),d=qn(zD),c=(0,L.useMemo)(()=>d.getCustomFieldsFilters(s,e.organization),[e.organization,s]),u=(0,L.useMemo)(()=>d.getCustomFieldsPossibleColumns(),[]);return(0,i.jsx)(DD,{organizationId:s,children:(0,i.jsx)(e$,{canEditSegments:r,filters:c,filtersButtonText:n("filtrer_les_cha_91574"),filtersSubtitle:n("appliquer_des_f_27562"),getSegmentPath:e=>$s.CUSTOM_FIELDS_SEGMENT(s,e),initialLimit:a?.customFieldsLimit??Tc,initialSegmentsOpen:a?.areCustomFieldsSegmentsOpen??!0,organizationId:s,possibleColumns:u,possibleRenderings:[],reload:e.reload,segmentId:o,segmentType:vt.CustomFields,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{l({customFieldsLimit:e})},onSegmentClick:e=>{l({customFieldsSegmentId:e})},onSegmentDelete:async()=>{await l({customFieldsSegmentId:null}),t.replace($s.CUSTOM_FIELDS(s))},onSegmentsToggle:async e=>{await l({areCustomFieldsSegmentsOpen:e})},children:(0,i.jsx)(qD,{})})})},KD=()=>{const{params:{organizationId:e}}=_l(),{localOrganization:t}=yI(),{data:n,loader:s,reload:o}=Zn("query CustomFieldsSegments($organizationId: OrganizationId!, $predicates: [Predicate!]!) {\n organization(id: $organizationId) {\n customFields(predicates: $predicates) {\n nodes {\n id\n name\n }\n }\n\n customFieldsCategories {\n nodes {\n id\n name\n }\n }\n\n segmentsFolders(level: Organization, segmentType: CustomFields) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,predicates:[{operator:ht.Is,slug:"condition",value:[]}]},[Ls.SegmentsFoldersSegmentsFragment]);const r=(0,L.useMemo)(()=>(n.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[n.organization]);return s||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.CUSTOM_FIELDS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(YD,{organization:n.organization,reload:o})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.CUSTOM_FIELDS_SEGMENT(e,t?.customFieldsSegmentId&&r.includes(t.customFieldsSegmentId)?t.customFieldsSegmentId:r[0]),replace:!0})})]})},ZD=e=>{const{translate:t}=_l();return(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"invisible",leftIcon:"plus",children:t("lier_un_champ_p_01331")})}),(0,i.jsx)(qd,{css:{padding:"0"},placement:"top-start",width:400,children:(0,i.jsx)(_C,{customFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})})]})},XD=e=>{const{translate:t}=_l();return(0,i.jsxs)(Na,{align:"center",css:{background:"$gray50",bd:"gray200 2",padding:"$6"},direction:"column",gap:"2",width:1,children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("aucun_champ_per_72101")}),(0,i.jsx)(ZD,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:e.selectedCustomFieldsIds,toggle:e.toggle})]})},JD=e=>{const t=(0,L.useMemo)(()=>Object.fromEntries(e.formCustomFields.map(e=>[e.id,e])),[e.formCustomFields]);return(0,i.jsx)(fu.JY,{onDragEnd:e.onDragEnd,children:(0,i.jsx)(fu.gL,{droppableId:"1",children:n=>(0,i.jsxs)(Na,{css:{bd:!0},direction:"column",width:1,...n.droppableProps,ref:n.innerRef,children:[e.formCustomFieldsValues.map((n,s)=>(0,i.jsx)(oE,{css:{border:"none",borderBottom:"1px solid $gray200",borderRadius:"0",boxShadow:"none","&:last-child":{borderBottom:"none"}},elementId:n.id,field:t[n.customFieldId],index:s,isMandatory:n.isMandatory,showEdit:!1,toggleIsMandatory:e.toggleMandatory,updateCustomField:Ql.A,onDelete:e.onDelete},n.id)),n.placeholder]})})})},QD=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>new Set(e.formCustomFieldsValues.map(({customFieldId:e})=>e)),[e.formCustomFieldsValues]),s=(0,L.useCallback)(t=>{e.change(`${e.prefix}formCustomFields`,t)},[e.prefix,e.change]),o=(0,L.useCallback)(t=>{n.has(t.id)?s(e.formCustomFieldsValues.filter(({customFieldId:e})=>e!==t.id)):s([...e.formCustomFieldsValues,{id:V(),customFieldId:t.id,isMandatory:!0}])},[e.formCustomFieldsValues,n,s]),r=(0,L.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&s(ro(e.formCustomFieldsValues,n.index,i.index))},[e.formCustomFieldsValues,s]),a=(0,L.useCallback)((t,n)=>{s((0,pu.jM)(e.formCustomFieldsValues,e=>{e[t].isMandatory=n}))},[e.formCustomFieldsValues,s]),l=(0,L.useCallback)(t=>{s((0,pu.jM)(e.formCustomFieldsValues,e=>{e.splice(t,1)}))},[e.formCustomFieldsValues,s]);return(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsx)(Na,{width:280,children:(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("champs_personna_17489")})}),(0,i.jsx)(Na,{css:{flex:"1"},children:no(e.formCustomFieldsValues)?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(JD,{formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,toggleMandatory:a,onDelete:l,onDragEnd:r}),(0,i.jsx)(ZD,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:n,toggle:o})]}):(0,i.jsx)(XD,{formCustomFields:e.formCustomFields,selectedCustomFieldsIds:n,toggle:o})})]})},eP=e=>{const{params:{organizationId:t}}=_l(),n=(0,L.useMemo)(()=>(0,lc.A)((0,ph.A)(e.customFields.map(e=>e.category),e=>e.id),e=>e.name.toLowerCase()),[e.customFields]),s=(0,L.useMemo)(()=>(0,ac.A)(e.customFields,e=>e.category.id),[e.customFields]);return(0,i.jsxs)(Na,{direction:"column",children:[n.map((n,o)=>{const r=s[n.id];return(0,i.jsxs)(L.Fragment,{children:[0!==o&&(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsx)(Na,{width:280,children:(0,i.jsx)(yr,{font:"gray800 textSm medium",children:n.name})}),(0,i.jsx)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:r.map(n=>(0,i.jsx)(xC,{change:e.change,display:!0,field:n,fileAcl:"public-read",isMandatory:!1,organizationId:t,prefix:`${e.prefix}fields.`},n.id))})]})]},n.id)}),no(e.customFields)&&e.showFormCustomFields&&(0,i.jsx)(Ku,{height:"5"}),e.showFormCustomFields&&(0,i.jsx)(QD,{change:e.change,formCustomFields:e.formCustomFields,formCustomFieldsValues:e.formCustomFieldsValues,prefix:e.prefix})]})},tP=e=>{const{history:t,translate:n,params:{organizationId:s}}=_l(),o=qn(du),r=(0,L.useMemo)(()=>Y_.map((e,t)=>(0,i.jsx)("option",{value:e,children:e},t)),[]);return(0,i.jsxs)(i.Fragment,{children:[e.showEmailSender&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Um,{isCreateVisible:!0,isSearchVisible:!0,label:n("_metteur_des_e_27849"),name:"event.emailSenderId",onCreateClick:()=>{t.push($s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(qa,{height:"4"})]}),(0,i.jsx)(Fr.Yr,{name:"event.languages",children:t=>{!e.hasLanguagesFeature&&t.length>1&&e.change("event.languages",[(0,ou.A)(t)])}}),(0,i.jsx)(Um,{label:n("langues_de_l_v_94191"),multiple:!0,name:"event.languages",children:xd.map(e=>(0,i.jsx)("option",{value:e,children:n(e)},e))}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Um,{isSearchVisible:!0,label:n("fuseau_horaire_14654"),name:"event.timeZone",children:r}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(tb,{label:n("heure_laquell_13491"),name:"event.dayStartTime"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Um,{isSearchVisible:!0,label:n("Country"),name:"event.country",children:o.getCountriesIdName().map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Hj,{label:n("fond_de_carte_43822"),name:"event.layer",children:[(0,i.jsx)("option",{value:et.Google,children:n("plan_24242")}),(0,i.jsx)("option",{value:et.GoogleSatellite,children:n("satellite_64364")}),(0,i.jsx)("option",{value:et.IgnPlan,children:n("plan_ign_03240")})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsx)(Vm,{label:(0,i.jsx)(Uv,{children:n("latitude_par_d_01620")}),name:"event.latitude"}),(0,i.jsx)(Vm,{label:(0,i.jsx)(Uv,{children:n("longitude_par_d_28326")}),name:"event.longitude"})]}),e.weezeventOrganizationId&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Hm,{name:"event.isWeezeventSynchronized",children:n("synchroniser_av_82451")})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:n("modules_activ_s_07626")}),(0,i.jsx)(Hm,{name:"event.usePositions",children:n("missions_63972")}),(0,i.jsx)(Hm,{name:"event.useAccreditations",children:n("accr_ditations_39450")}),(0,i.jsx)(Hm,{name:"event.useDelegations",children:n("d_l_gations_78318")}),(0,i.jsx)(Hm,{name:"event.useForms",children:n("Form_plural")}),(0,i.jsx)(Hm,{name:"event.useCampaigns",children:n("Campaigns")}),(0,i.jsx)(Hm,{name:"event.useDocuments",children:n("Documents")}),(0,i.jsx)(Hm,{name:"event.useWorkflows",children:n("automatisations_60045")})]})]})},nP=e=>{const{history:t,translate:n,params:{organizationId:s}}=_l(),o=qn(Q_),r=qn(Ba),{hasFeature:a,reload:l}=yI(),d=(0,L.useRef)(null),c=(0,L.useMemo)(()=>({event:e.initialValues}),[e.initialValues]),u=(0,L.useMemo)(()=>!(!(e.initialValues.languages.length>1||"number"==typeof e.initialValues.emailSenderId)&&e.initialValues.dayStartTime.startsWith("00:00")&&e.initialValues.usePositions&&e.initialValues.useAccreditations&&e.initialValues.useDelegations&&e.initialValues.useForms&&e.initialValues.useCampaigns&&e.initialValues.useDocuments&&e.initialValues.useWorkflows),[e.initialValues]),h=(0,L.useMemo)(()=>e.isEdit&&no(Object.keys(e.initialValues.fields)),[e.isEdit,e.initialValues]),g=(0,L.useMemo)(()=>m(e.initialValues.description),[e.initialValues]),p=(0,L.useMemo)(()=>!!e.isEdit&&no(e.initialValues.tagsIds),[e.isEdit,e.initialValues]);return(0,i.jsx)(Cl,{customErrorRef:d,height:1,initialValues:c,initialValuesEqual:()=>!0,render:({form:t,handleSubmit:o,values:r})=>(0,i.jsx)(Pm,{button:e.isEdit&&(0,i.jsx)(El,{isLoading:e.isMutateLoading,onClick:o,children:n("mettre_jour_l_28846")}),category:e.organization.name,color:"dark",fallbackClosePath:Ui.EVENTS({organizationId:s}),heading:e.isEdit?n("mise_jour_de_17055",e.initialValues.name):n("cr_ation_d_un_94106"),children:(0,i.jsxs)($m,{ref:d,children:[(0,i.jsx)(vl,{}),(0,i.jsx)(Mm,{hideToggle:!0,initialIsOpen:!0,subtitle:n("param_trer_votr_94121"),heading:n("dites_en_nous_u_13238"),children:(0,i.jsx)(oI,{form:t,values:r})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Mm,{initialIsOpen:u,subtitle:n("param_trer_l_m_66748"),heading:n("options_avanc_e_12396"),children:(0,i.jsx)(tP,{change:t.change,emailsSenders:e.organization.emailsSenders,hasLanguagesFeature:a(Ne.Languages),showEmailSender:!0,weezeventOrganizationId:e.organization.weezeventOrganizationId})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Mm,{initialIsOpen:h,subtitle:n("ajouter_des_inf_87361"),heading:n("champs_de_formu_64126"),onToggle:e=>{e||t.change("event.fields",{})},children:(0,i.jsx)(eP,{change:t.change,customFields:e.eventCustomFields,formCustomFields:[],formCustomFieldsValues:[],prefix:"event.",showFormCustomFields:!1})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Mm,{initialIsOpen:g,subtitle:n("ajouter_une_des_44242"),heading:n("Description"),onToggle:e=>{e||t.change("event.description","")},children:(0,i.jsx)(Qv,{label:(0,i.jsx)(Uv,{children:n("description_58935")}),name:"event.description"})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Mm,{initialIsOpen:p,subtitle:n("ajouter_des_tag_23887"),heading:n("tags_79499"),onToggle:e=>{e||t.change("event.tagsIds",[])},children:(0,i.jsx)(eC,{change:t.change,name:"event.",organizationId:s,tags:e.organization.tags.nodes,tagsIds:r.event.tagsIds})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Fm,{children:(0,i.jsx)(El,{isLoading:e.isMutateLoading,textAlign:"center",onClick:o,children:e.isEdit?n("mettre_jour_l_28846"):n("cr_er_l_v_neme_16731")})})]})}),validate:r.validateForForm(o.createUpdateEventSchema()),width:1,onSubmit:async n=>{const i=await e.mutate({organizationId:s,event:n.event});l(),e.isEdit?t.goBack(Ui.EVENT({organizationId:s,eventId:i})):t.replace(Ui.EVENT({organizationId:s,eventId:i}))}})},iP=()=>{const e=qn(Q_),{params:{organizationId:t},translate:n}=_l();Dd(n("cr_er_l_v_neme_16731"));const{data:s,loader:o}=Zn("query EventCreateInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...CreateUpdateEventInfos\n }\n}\n",{organizationId:t},[Ls.CreateUpdateEventInfosFragment]),{mutate:r,isLoading:a}=function(e={}){return Xn("mutation CreateEvent($organizationId: OrganizationId!, $event: EventInput!) {\n eventCreate(organizationId: $organizationId, event: $event) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0});return o||(0,i.jsx)(nP,{eventCustomFields:s.organization?.eventCustomFields.nodes??[],initialValues:e.eventInputDefault(),isEdit:!1,isMutateLoading:a,mutate:async e=>{const{eventCreate:{id:t}}=await r(e);return t},organization:s.organization})},sP=()=>{const e=qn(Q_),{params:{organizationId:t,eventId:n},translate:s}=_l(),{data:o,loader:r}=Zn("query EventUpdateInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...CreateUpdateEventInfos\n }\n\n event(id: $eventId) {\n name\n description\n languages\n startAt\n endAt\n timeZone\n country\n layer\n latitude\n longitude\n emailSenderId\n dayStartTime\n tagsIds\n fields\n isWeezeventSynchronized\n usePositions\n useAccreditations\n useDelegations\n useForms\n useCampaigns\n useDocuments\n useWorkflows\n }\n}\n",{organizationId:t,eventId:n},[Ls.CreateUpdateEventInfosFragment]);Dd(`${s("mettre_jour_l_28846")}: ${o.event?.name}`);const{mutate:a,isLoading:l}=function(e={}){return Xn("mutation EventUpdate($organizationId: OrganizationId!, $eventId: EventId!, $event: EventInput!) {\n eventUpdate(organizationId: $organizationId, eventId: $eventId, event: $event) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0});return r||(0,i.jsx)(nP,{eventCustomFields:o.organization?.eventCustomFields.nodes??[],initialValues:e.eventInputDefault(o.event),isEdit:!0,isMutateLoading:l,mutate:async e=>{const{eventUpdate:{id:t}}=await a({...e,eventId:n});return t},organization:o.organization})};var oP;let rP=class extends OO{static{oP=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...OO.IMPORT_COLUMNS_DEFAULT,Name:"name",StartAt:"startAt",EndAt:"endAt",Country:"country",DayStartTime:"dayStartTime",Description:"description",Languages:"languages",Latitude:"latitude",Layer:"layer",Longitude:"longitude",Tags:"tags",TimeZone:"timeZone",IsWeezeventSynchronized:"isWeezeventSynchronized",UseAccreditations:"useAccreditations",UseCampaigns:"useCampaigns",UseDelegations:"useDelegations",UseDocuments:"useDocuments",UseForms:"useForms",UsePositions:"usePositions",UseWorkflows:"useWorkflows"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===Ze.Update?[oP.IMPORT_COLUMNS_DEFAULT.Id]:[],oP.IMPORT_COLUMNS_DEFAULT.Name,oP.IMPORT_COLUMNS_DEFAULT.StartAt,oP.IMPORT_COLUMNS_DEFAULT.EndAt];constructor(e,t){super(e,t),this.csvInputService=e}};rP=oP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Ov,Wn])],rP);const aP=()=>{const{params:{organizationId:e},translate:t}=_l(),{mutate:n}=function(e={}){return Xn("mutation EventsImport($organizationId: OrganizationId!, $input: MappableImportInput!) {\n jobId: eventsImport(organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkEventsImport:s}=kb(),o=(0,L.useCallback)((e,t)=>s(e,t),[s]),{data:r,loader:a}=Kr({organizationId:e,variety:ve.Event});return a||(0,i.jsx)(QO,{ImportInputService:rP,checkImport:o,closePath:Ui.EVENTS({organizationId:e}),customFields:r.organization.customFields.nodes,heading:t("import_events_60816"),importTagPrefix:"events",itemName:{singular:t("_v_nement_22345"),plural:t("_v_nements_53672")},localStorageKeyPrefix:"EVENTS_IMPORT",mutate:n,returnLink:(0,i.jsx)(qc,{to:Ui.EVENTS({organizationId:e}),children:t("revenir_aux_v_65215")}),showModeSelection:!1})};var lP;!function(e){e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.EndAt="endAt",e.Id="id",e.Name="name",e.NumberOfMembers="numberOfMembers",e.NumberOfMembersAccredited="numberOfMembersAccredited",e.NumberOfMembersAssigned="numberOfMembersAssigned",e.StartAt="startAt",e.State="state",e.Tags="tags"}(lP||(lP={}));let dP=class extends gu{constructor(e,t,n){super(e,t,n)}getEventsFilters(e,t){return[{slug:"name",name:this.t("nom_de_l_v_nem_08711"),category:this.t("Event"),fieldType:We.Text,hideEmpty:!0},{slug:lP.Description,name:this.t("Description"),category:this.t("Event"),fieldType:We.Text},{slug:"startAt",name:this.t("date_de_d_but_43380"),category:this.t("Event"),fieldType:We.Date,hideEmpty:!0},{slug:"endAt",name:this.t("date_de_fin_86920"),category:this.t("Event"),fieldType:We.Date,hideEmpty:!0},{slug:"state",name:this.t("status_06428"),category:this.t("Event"),fieldType:We.Select,values:[{id:Pe.Ongoing,name:this.t(Pe.Ongoing)},{id:Pe.Upcoming,name:this.t(Pe.Upcoming)},{id:Pe.Done,name:this.t(Pe.Done)}],hideEmpty:!0},{slug:"tag",name:this.t("Tag"),category:this.t("Event"),fieldType:We.Select,needLoading:!0,organizationId:e,tagContext:kt.Events},{slug:lP.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("Event"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e},{slug:lP.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("Event"),fieldType:We.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)]}getEventPossibleColumns(e){return[{slug:lP.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:De.Id,width:100},{slug:lP.Name,name:this.t("nom_de_l_v_nem_08711"),isSearchable:!0,isSortable:!0,sortAttribute:De.Name,minWidth:240},{slug:lP.StartAt,name:this.t("date_de_d_but_43380"),isSortable:!0,sortAttribute:De.StartAt,minWidth:180},{slug:lP.EndAt,name:this.t("date_de_fin_86920"),isSortable:!0,sortAttribute:De.EndAt,minWidth:180},{slug:lP.State,name:this.t("status_06428"),minWidth:180},{slug:lP.Tags,name:this.t("tags_79499"),minWidth:320},{slug:lP.NumberOfMembers,name:this.t("nombre_de_membr_08851"),minWidth:180},{slug:lP.NumberOfMembersAssigned,name:this.t("nombre_de_membr_87779_plural"),minWidth:180},{slug:lP.NumberOfMembersAccredited,name:this.t("nombre_de_membr_25913"),minWidth:180},{slug:lP.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:lP.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:De.CreatedAt,minWidth:180}].concat(this.customFieldsToPossibleColumns(e))}};dP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],dP);const cP=e=>{const t=Yn(),n=qn(Kc);return(0,i.jsxs)(Na,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:t("date_de_l_v_ne_69973")}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:M_(n,e.event.startAt,e.event.endAt)})]})},uP=e=>{const t=Yn();return(0,i.jsxs)(Na,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:t("status_06428")}),(0,i.jsx)(Na,{children:(0,i.jsx)(ic,{color:N_(e.event.state),children:t(e.event.state)})})]})},hP=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation EventsMassArchive(\n $organizationId: OrganizationId!\n $selecteds: MassActionSelectedsInput!\n) {\n eventsMassArchive(organizationId: $organizationId, selecteds: $selecteds)\n}\n",e)}(),{reload:s}=yI();return(0,i.jsx)(sA,{buttonText:t("archiver_26131"),subtext:t("_tes_vous_s_r_d_76724"),text:t("archivage_de_31255",e.event.name),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,selecteds:{ids:[e.event.id]}}),s(),e.onSuccess()}})};let mP=class extends Ul{constructor(e){super(e)}eventDuplicateInputDefault(e){return{name:this.t("copie_de_1_62900",e.name),startAt:e.startAt,endAt:e.endAt,eventId:null,includeAccreditations:!0,includeCustomDocuments:!0,includeDelegations:!0,includeForms:!0,includePositions:!0,includeSegments:!0,includeTemplates:!0,includeWorkflows:!0}}eventDuplicateSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),startAt:qm.required(this.t("la_date_d_but_d_30022")).typeError(this.t("la_date_d_but_d_30022")),endAt:qm.required(this.t("la_date_de_fin_45068")).typeError(this.t("la_date_de_fin_45068")).test("after-start-at",this.t("la_date_de_fin_00429"),function(){return Us.c9.isDateTime(this.parent.startAt)&&this.parent.startAt.isValid&&Us.c9.isDateTime(this.parent.endAt)&&this.parent.endAt.isValid&&this.parent.endAt>=this.parent.startAt}),includeAccreditations:d.zM(),includeCustomDocuments:d.zM(),includeDelegations:d.zM(),includeForms:d.zM(),includePositions:d.zM(),includeSegments:d.zM(),includeTemplates:d.zM(),includeWorkflows:d.zM()})}};mP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],mP);const gP=e=>{const t=Yn(),n=qn(mP),s=qn(Ba),{mutate:o,isLoading:r}=function(e={}){return Xn("mutation EventDuplicate($eventId: EventId!, $options: EventDuplicateInput!) {\n eventDuplicate(eventId: $eventId, options: $options) {\n id\n }\n}\n",e)}(),{organization:a,reload:l}=yI(),[d,c]=(0,L.useState)(!1),u=(0,L.useMemo)(()=>a.events.nodes.filter(t=>t.id!==e.event.id),[a.events.nodes]),h=e.event.endAt.diff(e.event.startAt,"days").days;return(0,i.jsx)(Ua.lV,{initialValues:{options:n.eventDuplicateInputDefault(e.event)},initialValuesEqual:Pr.A,render:({form:n,handleSubmit:s,invalid:o,values:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:"options.startAt",children:e=>{const t=e.plus({days:h});t.equals(a.options.endAt)||n.change("options.endAt",t)}}),(0,i.jsx)(Fr.Yr,{name:"options.endAt",children:e=>{const t=e.minus({days:h});t.equals(a.options.startAt)||n.change("options.startAt",t)}}),(0,i.jsx)(zb,{icon:"clone",children:t("dupliquer_l_v_72541",e.event.name)}),(0,i.jsxs)(Tb,{css:{overflowY:"auto"},gap:"5",children:[(0,i.jsx)(ju,{value:d,onChange:e=>{c(e),e||n.change("options.eventId",null)},children:t("dupliquer_les_d_77458")}),d?(0,i.jsx)(Um,{isSearchVisible:!0,label:t("_v_nement_22345"),name:"options.eventId",children:u.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ll,{label:t("nom_du_nouvel_66511"),name:"options.name"}),(0,i.jsxs)(Na,{gap:"5",children:[(0,i.jsx)(Lm,{label:t("nouvelle_date_d_75723"),min:Us.c9.utc(),name:"options.startAt"}),(0,i.jsx)(Lm,{label:t("nouvelle_date_d_93958"),min:Us.c9.utc(),name:"options.endAt"})]})]}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",children:t("que_souhaitez_v_40297")}),(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsxs)(Na,{gap:"5",children:[(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Nm,{name:"options.includePositions",children:t("missions_63972")})}),(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Nm,{name:"options.includeAccreditations",children:t("accr_ditations_39450")})})]}),(0,i.jsxs)(Na,{gap:"5",children:[(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Nm,{name:"options.includeForms",children:t("Form_plural")})}),(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Nm,{name:"options.includeDelegations",children:t("d_l_gations_78318")})})]}),(0,i.jsxs)(Na,{gap:"5",children:[(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Nm,{name:"options.includeSegments",children:t("vues_personnali_80652")})}),(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Nm,{name:"options.includeCustomDocuments",children:t("documents_perso_87374")})})]}),(0,i.jsxs)(Na,{gap:"5",children:[(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Nm,{name:"options.includeTemplates",children:t("mod_les_de_camp_58182")})}),(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Nm,{name:"options.includeWorkflows",children:t("automatisations_60045")})})]})]})]})]}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{disabled:o,isLoading:r,onClick:s,children:t("dupliquer_28256")})})]}),validate:e=>s.validateForForm(n.eventDuplicateSchema())(e.options),onSubmit:async t=>{await o({eventId:e.event.id,options:t.options}),l(),e.reload(),e.onClose()}})},pP=e=>{const{params:{organizationId:t},translate:n}=_l(),{canEventEdit:s}=SS(),[o,r]=(0,L.useState)(!1),[a,l]=(0,L.useState)(!1),d=(0,L.useMemo)(()=>e.event.tags.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[e.event.tags]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Na,{css:{flex:"1"},children:(0,i.jsx)(qc,{to:$s.VOLUNTEERS(t,e.event.id),children:e.event.name})}),(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},gap:"8",children:[(0,i.jsx)(cP,{event:e.event}),(0,i.jsx)(uP,{event:e.event}),(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:n("tags_79499")}),(0,i.jsx)(Ty,{badges:d})]})]}),(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(El,{to:$s.VOLUNTEERS(t,e.event.id),children:n("voir_l_v_nemen_72358")}),s&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"pen",to:$s.EDIT_EVENT(t,e.event.id),children:n("_diter_62574")}),(0,i.jsx)(Gd,{icon:"clone",onClick:e=>{Nd(e.target),r(!0)},children:n("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:e=>{Nd(e.target),l(!0)},children:n("archiver_26131")})]})]})]})]}),(0,i.jsx)(Rb,{isOpen:o,onClose:()=>{r(!1)},children:(0,i.jsx)(Ob,{children:(0,i.jsx)(gP,{event:e.event,reload:e.reload,onClose:()=>{r(!1)}})})}),a&&(0,i.jsx)(hP,{event:e.event,organizationId:t,onClose:()=>l(!1),onSuccess:e.reload})]})},fP=()=>{const{translate:e}=_l();return(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,minHeight:"75px",padding:"$4 $6"},gap:"4",children:[(0,i.jsx)(Na,{css:{flex:"1"},children:(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1})}),(0,i.jsxs)(Na,{css:{flex:"1"},gap:"8",children:[(0,i.jsxs)(Na,{direction:"column",gap:"1",width:200,children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:e("date_de_l_v_ne_69973")}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",width:70,children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:e("status_06428")}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:e("tags_79499")}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1})]})]}),(0,i.jsx)(Na,{width:200})]})},xP=()=>{const{params:{organizationId:e}}=_l(),{nameDebounced:t,predicates:n,limit:s,offset:o,setLimit:r,setOffset:a}=gy(),{data:l,isLoading:d,reload:c}=sa({organizationId:e,name:m(t)?t:null,predicates:n,limit:s,offset:o,sort:{attribute:De.StartAt,direction:jt.Desc},includeCreatedBy:!1,includeNumberOfMembers:!1}),{numberOfPages:u,totalCount:h}=ku(l.data?.rows);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Na,{css:{background:"$gray100",borderLeft:"1px solid $gray200",borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",flex:"1",overflowX:"hidden",overflowY:"auto",padding:"$4"},direction:"column",gap:"3",width:1,children:d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fP,{}),(0,i.jsx)(fP,{}),(0,i.jsx)(fP,{})]}):(l.data?.rows.nodes??[]).map(e=>(0,i.jsx)(pP,{event:e,reload:c},e.id))}),(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:s,numberOfPages:u,offset:o,setLimit:r,setOffset:a,showLimits:!0,totalCount:h})})]})},_P=()=>{const{translate:e,params:{organizationId:t}}=_l(),{canEventEdit:n}=SS();return(0,i.jsx)(r$,{children:n&&(0,i.jsx)(KS,{menu:(0,i.jsx)(Gd,{icon:"file-import",to:Ui.EVENTS_IMPORT({organizationId:t}),onClick:e=>Nd(e.target),children:e("importer_via_un_61623")}),path:$s.CREATE_EVENT(t),children:e("cr_er_un_v_nem_28126")})})},IP=e=>{const{params:{organizationId:t}}=_l(),{mutate:n}=Oo();return(0,i.jsx)(_y,{column:e.column,initialValue:e.initialValue,mutate:i=>n({organizationId:t,massEdit:{reset:!1,selecteds:{ids:[e.eventId]},slug:e.property,strategy:tt.Replace,value:i}}),reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},vP=e=>{const{translate:t}=_l(),n=qn(Kc);return(0,i.jsx)(IP,{column:e.column,eventId:e.event.id,initialValue:e.event.endAt,property:Re.EndAt,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Du,{label:t("date_de_fin_86920"),value:e,onChange:n}),renderValue:n.toLocaleString(e.event.endAt,Js.DateOnly.WeekdayLongMonthLong),updatable:!0})},bP=e=>{const{translate:t,params:{organizationId:n}}=_l(),{isEditMode:s}=gy();return(0,i.jsx)(IP,{column:e.column,eventId:e.event.id,initialValue:e.event.name,property:Re.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{label:t("nom_de_l_v_nem_08711"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(N$,{isEditMode:s,title:e.event.name,updatable:!0,children:(0,i.jsx)(qc,{to:Ui.EVENT({organizationId:n,eventId:e.event.id}),children:e.event.name})}),updatable:!0})},jP=e=>{const{translate:t}=_l(),n=qn(Kc);return(0,i.jsx)(IP,{column:e.column,eventId:e.event.id,initialValue:e.event.startAt,property:Re.StartAt,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Du,{label:t("date_de_d_but_43380"),value:e,onChange:n}),renderValue:n.toLocaleString(e.event.startAt,Js.DateOnly.WeekdayLongMonthLong),updatable:!0})},CP=L.createContext({}),yP=e=>{const t=j$(Bo,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(CP.Provider,{value:{getTags:t},children:e.children})},kP=e=>{const{translate:t}=_l(),{getTags:n}=L.useContext(CP),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("tags_79499")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(bc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},AP=e=>{const t=(0,L.useMemo)(()=>e.event.tags||[],[e.event]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(IP,{column:e.column,eventId:e.event.id,initialValue:t.map(e=>e.id),property:Re.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(kP,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Ty,{badges:n}),updatable:!0})},wP=e=>{const{translate:t}=_l(),{mutate:n}=Oo(),s=(0,L.useCallback)((t,i)=>n({organizationId:e.organizationId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:tt.Replace,value:t}}),[e.row,n]);return e.column.slug===lP.Id?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===lP.Name?(0,i.jsx)(bP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===lP.StartAt?(0,i.jsx)(jP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===lP.EndAt?(0,i.jsx)(vP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===lP.Tags?(0,i.jsx)(AP,{column:e.column,event:e.row,reload:e.reloadRow}):e.column.slug===lP.State?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(ic,{color:N_(e.row.state),children:t(e.row.state)})}):e.column.slug===lP.NumberOfMembers?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembers}):e.column.slug===lP.NumberOfMembersAccredited?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAccredited}):e.column.slug===lP.NumberOfMembersAssigned?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.numberOfMembersAssigned}):e.column.slug===lP.CreatedBy?(0,i.jsx)(zR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===lP.CreatedAt?(0,i.jsx)(TR,{column:e.column,insertedAt:e.row.insertedAt}):(0,i.jsx)(Dy,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:s,reload:e.reloadRow,updatable:!0})},SP=e=>{const{translate:t,params:{organizationId:n}}=_l(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"clone",onClick:e=>{Nd(e.target),o(!0)},children:t("dupliquer_28256")}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:e=>{Nd(e.target),a(!0)},children:t("archiver_26131")})]}),(0,i.jsx)(Rb,{isOpen:s,onClose:()=>{o(!1)},children:(0,i.jsx)(Ob,{children:(0,i.jsx)(gP,{event:e.event,reload:e.reload,onClose:()=>{o(!1)}})})}),r&&(0,i.jsx)(hP,{event:e.event,organizationId:n,onClose:()=>a(!1),onSuccess:e.reload})]})},EP=e=>{const{translate:t,params:{organizationId:n}}=_l(),{canEventEdit:s}=SS(),o=uy(e.customFields),r=(0,L.useCallback)(()=>{e.reloadEvent(e.event.id)},[e.event,e.reloadEvent]);return(0,i.jsxs)(Dc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{Nd(e.target)},children:[e.columns.map(t=>{const s=o.get(t.slug);return(0,i.jsx)(wP,{column:t,customField:s,organizationId:n,reloadRow:r,row:e.event},t.slug)}),s&&(0,i.jsxs)(Yc,{justify:"center",children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",to:$s.EDIT_EVENT(n,e.event.id)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(SP,{event:e.event,reload:e.reload})]})]})},TP=e=>{const{params:{organizationId:t}}=_l(),{canEventEdit:n}=SS(),{columns:s,limit:o,massActions:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,setLimit:u,setOffset:h,setSort:g,sort:p}=gy(),f=(0,L.useMemo)(()=>function(e){return{includeCreatedBy:e.includes(lP.CreatedBy),includeNumberOfMembers:e.includes(lP.NumberOfMembers)||e.includes(lP.NumberOfMembersAccredited)||e.includes(lP.NumberOfMembersAssigned)}}(s),[s]),{data:x,isLoading:_,reload:I}=sa({...f,organizationId:t,name:m(a)?a:null,predicates:c,limit:o,offset:l,sort:p}),v=(0,L.useMemo)(()=>s.flatMap(e=>(0,Ya.A)([d.find(t=>t.slug===e)])),[d,s]),{numberOfPages:b,totalCount:j}=ku(x.data?.rows),[C,y]=(0,L.useState)([]),[k,A]=(0,L.useState)({}),w=(0,L.useCallback)(async e=>{A(t=>({...t,[e]:!0}));const{data:{row:n}}=await(i={...f,organizationId:t,id:e},s=await K(),ho("query EventsEvent(\n $organizationId: OrganizationId!\n $id: EventId!\n $includeCreatedBy: Boolean!\n $includeNumberOfMembers: Boolean!\n) {\n data: organization(id: $organizationId) {\n row: event(id: $id) {\n ...EventsEvent\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[Ls.EventsEventFragment]}));var i,s;y(t=>t.map(t=>t.id===e?n:t)),A(t=>({...t,[e]:!1}))},[f,A,y]);return(0,L.useEffect)(()=>{y(x.data?.rows.nodes??[])},[x.data]),(0,L.useEffect)(()=>{r.setStates(Object.fromEntries((x.data?.rows.nodes??[]).map(e=>[`e${e.id}`,{id:e.id,state:"unchecked"}])))},[x.data,r.setStates]),(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":_,headerRow:(0,i.jsxs)(jc,{children:[v.map(e=>e.isSortable?(0,i.jsx)(_m,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:g,sort:p,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Vc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(Vc,{width:100})]}),paginationRow:(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:o,numberOfPages:b,offset:l,setLimit:u,setOffset:h,showLimits:!0,totalCount:j})}),children:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(Uc,{},t.id):(0,i.jsx)(EP,{columns:v,customFields:e.customFields,event:t,reload:I,reloadEvent:w,state:r.states[`e${t.id}`]?.state??"unchecked"},t.id))})})},zP=e=>{const{translate:t}=_l(),{canEventEdit:n}=SS(),{rendering:s}=gy(),o=n&&s===Nh.List,r=n&&s===Nh.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_P,{}),(0,i.jsxs)(ej,{children:[(0,i.jsx)(o$,{searchRow:(0,i.jsx)(i$,{searchPlaceholder:t("rechercher_un_40024"),showActions:n,showEditColumns:o,showEditMode:r,showSearchColumns:!1})}),s===Nh.List?(0,i.jsx)(TP,{customFields:e.customFields}):(0,i.jsx)(xP,{})]})]})},OP=e=>{const{history:t,translate:n,params:{organizationId:s,segmentId:o}}=_l(),{localOrganization:r,updateLocalOrganization:a}=yI(),{canSegmentEdit:l}=SS(),d=qn(dP),c=(0,L.useMemo)(()=>e.organization.customFields.nodes,[e.organization]),u=(0,L.useMemo)(()=>d.getEventsFilters(s,c),[s,c]),h=(0,L.useMemo)(()=>d.getEventPossibleColumns(c),[c]);return(0,i.jsx)(yP,{organizationId:s,children:(0,i.jsx)(e$,{canEditSegments:l,filters:u,filtersButtonText:n("filtrer_les_v_48869"),filtersSubtitle:n("appliquer_des_f_84816"),getSegmentPath:e=>$s.EVENTS_SEGMENT(s,e),initialLimit:r?.eventsLimit??Tc,initialSegmentsOpen:r?.areEventsSegmentsOpen??!0,organizationId:s,possibleColumns:h,possibleRenderings:[Nh.Card,Nh.List],reload:e.reload,segmentId:o,segmentType:vt.Events,segmentsFolders:e.organization.segmentsFolders,setLimit:e=>{a({eventsLimit:e})},onSegmentClick:e=>{a({eventsSegmentId:e})},onSegmentDelete:async()=>{await a({eventsSegmentId:null}),t.replace(Ui.EVENTS({organizationId:s}))},onSegmentsToggle:async e=>{await a({areEventsSegmentsOpen:e})},children:(0,i.jsx)(zP,{customFields:c})})})},RP=()=>{const{params:{organizationId:e},translate:t}=_l();Dd(t("events_23531"));const{localOrganization:n}=yI(),{data:s,loader:o,reload:r}=Zn("query EventsSegments($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customFields(variety: Event) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n segmentsFolders(level: Organization, segmentType: Events) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e},[Ls.SegmentCustomFieldFragment,Ls.SegmentsFoldersSegmentsFragment]),a=(0,L.useMemo)(()=>(s.organization?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[s.organization]);return o||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.EVENTS_SEGMENT(":organizationId",":segmentId"),children:(0,i.jsx)(OP,{organization:s.organization,reload:r})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.EVENTS_SEGMENT(e,n?.eventsSegmentId&&a.includes(n.eventsSegmentId)?n.eventsSegmentId:a[0]),replace:!0})})]})},$P=()=>{const{params:{organizationId:e},translate:t}=_l(),{loader:n,data:s}=Zn("query EventsMobile($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n }\n }\n }\n}\n",{organizationId:e},[]);return n||(no(s.organization.events.nodes)?(0,i.jsx)(ni,{path:$s.DASHBOARD_EVENT_SWITCH(e,s.organization.events.nodes[0].id)}):(0,i.jsx)(yr,{children:t("no_events_found_69870")}))};let DP=class extends Ul{constructor(e){super(e)}accreditationsCustomFieldInputSchema(){return d.Ik().shape({customFieldId:d.ai().required(this.t("le_champ_person_80074")),conditionValue:d.gl().required(this.t("la_condition_es_66568"))})}};DP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],DP);let PP=class extends Ul{constructor(e){super(e)}accreditationsSlotInputDefault(){return{name:""}}createAccreditationSlotSchema(){return d.Ik().shape({slot:this.accreditationsSlotInputSchema()})}accreditationsSlotInputSchema(){return d.Ik().shape({name:d.Yj(),maxResources:d.ai().nullable(),date:qm.typeError(this.t("la_date_est_inv_22002")).nullable()})}};PP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],PP);let FP=class extends Ul{accreditationsCustomFieldInput;accreditationsSlotInput;constructor(e,t,n){super(e),this.accreditationsCustomFieldInput=t,this.accreditationsSlotInput=n}createUpdateAccreditationValuesDefault(e,t,n){const i=this.accreditationInputDefault(e,t,n);return{accreditation:i,hasNumberOfDaysLimit:"number"==typeof i.numberOfDaysLimit}}accreditationInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_l_acc_82676")),accreditationCategoryId:d.ai().required(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")).min(1,this.t("la_cat_gorie_es_14008")),description:d.Yj(),privateNote:d.Yj(),acronym:d.Yj(),color:d.Yj().required(this.t("la_couleur_est_95740")),icon:d.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(pn,this.t("l_ic_ne_est_req_15843")),weezeventIsSynchronized:d.zM().required(),address:d.Yj().nullable(),latitude:d.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:d.ai().nullable().typeError(this.t("la_longitude_do_35170")),zoom:d.ai().required(this.t("le_niveau_de_zo_52687")).min(0,this.t("le_niveau_de_zo_38516")).max(23,this.t("le_niveau_de_zo_38516")),layer:d.Yj().required(this.t("le_fond_de_cart_48524")).oneOf(In,this.t("le_fond_de_cart_48524")),slots:d.YO().of(this.accreditationsSlotInput.accreditationsSlotInputSchema()),accreditationDisplay:d.Yj().required(this.t("le_type_d_affic_60154")).oneOf(Yt,this.t("le_type_d_affic_60154")).test("calendar-slots",this.t("tous_les_cr_nea_42033"),(e,t)=>e!==ie.Calendar||no(t.parent.slots)&&t.parent.slots.every(e=>e.date?.isValid)),numberOfDaysLimit:d.ai().notRequired(),accreditationsCustomFields:d.YO().of(this.accreditationsCustomFieldInput.accreditationsCustomFieldInputSchema()),formCustomFields:d.YO(),tagsIds:d.YO().of(d.ai())})}createUpdateAccreditationSchema(){return d.Ik().shape({accreditation:this.accreditationInputSchema()})}accreditationInputDefault(e,t,n){let i=t?.accreditationCategoryId??n;return Number.isInteger(i)||(i=null),{accreditationCategoryId:i,name:t?.name??"",description:t?.description??"",privateNote:t?.privateNote??"",acronym:t?.acronym??"",color:t?.color??fr.colors.primary700.value,icon:t?.icon??Ke.BadgeCheck,weezeventIsSynchronized:t?.weezeventIsSynchronized??!0,willAutoAccredit:t?.willAutoAccredit??!1,address:t?.address??null,latitude:t?.latitude??null,longitude:t?.longitude??null,zoom:t?.zoom??Or,layer:t?.layer??e,accreditationDisplay:t?.accreditationDisplay??ie.List,numberOfDaysLimit:t?.numberOfDaysLimit??null,slots:(0,lc.A)(t?.slots??[],e=>(0,Ya.A)([e.date?.toMillis(),e.name])),conditionsOperator:t?.conditionsOperator??pe.And,accreditationsCustomFields:t?.accreditationsCustomFields??[],tagsIds:t?.tagsIds??[],fields:t?.fields??{},formCustomFields:t?.formCustomFields??[]}}};FP=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn,DP,PP])],FP);const MP=e=>{const t=Yn(),n=e.customFields.find(t=>t.id===e.customFieldValue.customFieldId);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:`${e.field}customFieldId`,children:t=>{const n=e.customFields.find(e=>e.id===t);e.change(`${e.field}conditionValue`,n?.fieldType===Ve.Select?[]:"")}}),(0,i.jsxs)(Na,{css:{background:"white",bd:!0,padding:"$3 $4"},direction:"column",gap:"4",children:[(0,i.jsx)(yr,{css:{textTransform:"uppercase"},font:"gray800 textXs semiBold",children:t("condition_n_1_11603",e.index+1)}),(0,i.jsxs)(Na,{align:"center",gap:"4",children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsxs)(Um,{isSearchVisible:!0,label:t("CustomField"),name:`${e.field}customFieldId`,children:[(0,i.jsx)("option",{value:"-1",children:t("s_lectionnez_un_62064")}),e.customFields.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(yr,{color:"gray500",css:{paddingTop:"$6"},fontSize:"textMd",children:(0,i.jsx)(el,{icon:"arrow-right"})}),(0,i.jsxs)(yr,{css:{flex:"1"},children:[n?.fieldType===Ve.Checkbox&&(0,i.jsxs)(Hj,{label:t("accessible_seul_31434"),name:`${e.field}conditionValue`,shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"",children:t("s_lectionnez_un_44130")}),(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]}),n?.fieldType===Ve.Select&&(0,i.jsx)(Um,{isSearchVisible:!0,label:t("accessible_seul_31434"),multiple:!0,name:`${e.field}conditionValue`,children:n.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),(0,i.jsx)(yr,{css:{paddingTop:"$6"},children:(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.onRemove})})]})]})]})},NP=e=>{const{history:t,translate:n,params:{organizationId:s}}=_l();return 0===e.customFields.length?(0,i.jsxs)(Na,{align:"center",css:{background:"$gray50",borderRadius:"$1",padding:"$7"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:n("vous_n_avez_pas_62142")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:n("pour_ajouter_de_74432")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(El,{color:"white",onClick:()=>{t.push($s.CUSTOM_FIELDS(s))},children:n("cr_eer_un_champ_08883")})]}):(0,i.jsxs)(Na,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$6 $4"},direction:"column",gap:"3",width:1,children:[e.customFieldsValues.map((t,s)=>{const o=s===e.customFieldsValues.length-1,r=`${e.name}[${s}].`;return(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(MP,{change:e.change,customFieldValue:t,customFields:e.customFields,field:r,index:s,onRemove:()=>{e.change(e.name,e.customFieldsValues.filter((e,t)=>t!==s))}}),e.customFieldsValues.length>1&&!o?0===s?(0,i.jsx)(yr,{css:{width:"fit-content"},children:(0,i.jsxs)(Hj,{name:`${e.prefix}conditionsOperator`,children:[(0,i.jsx)("option",{value:pe.And,children:n(pe.And)}),(0,i.jsx)("option",{value:pe.Or,children:n(pe.Or)})]})}):(0,i.jsx)(yr,{font:"gray800 textSm medium",children:n(e.conditionsOperator)}):null]},s)}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{color:"invisible",leftIcon:"plus",onClick:()=>{e.change(e.name,[...e.customFieldsValues,{customFieldId:-1,conditionValue:""}])},children:n("ajouter_une_con_66324")})})]})},LP=()=>{const{translate:e}=_l();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Hm,{name:"accreditation.willAutoAccredit",subtext:e("si_la_case_est_44018"),children:e("autoriser_l_acc_50624")})})},BP=e=>{const{mutate:t}=function(e={}){return Xn("mutation AccreditationCategoryCreate(\n $eventId: EventId!\n $accreditationCategory: AccreditationsCategoryInput!\n) {\n accreditationCategoryCreate(eventId: $eventId, accreditationCategory: $accreditationCategory) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(KC,{initialName:"",isEdit:!1,mutate:async n=>(await t({eventId:e.eventId,accreditationCategory:{name:n}})).accreditationCategoryCreate,onClose:e.onClose,onSuccess:e.onSuccess})},VP=e=>{const{mutate:t}=function(e={}){return Xn("mutation AccreditationCategoryUpdate(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n $accreditationCategory: AccreditationsCategoryInput!\n) {\n accreditationCategoryUpdate(\n eventId: $eventId\n accreditationCategoryId: $accreditationCategoryId\n accreditationCategory: $accreditationCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(KC,{initialName:e.accreditationCategory.name,isEdit:!0,mutate:async n=>(await t({eventId:e.eventId,accreditationCategoryId:e.accreditationCategory.id,accreditationCategory:{name:n}})).accreditationCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},UP=e=>{const{translate:t,params:{eventId:n}}=_l(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(YC(e.event.accreditationsCategories));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ll,{label:t("nom_de_votre_ac_85997"),name:"accreditation.name"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Um,{isCreateVisible:!0,isSearchVisible:!0,label:t("cat_gorie_00291"),name:"accreditation.accreditationCategoryId",onCreateClick:()=>{o(!0)},children:r.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Ll,{label:(0,i.jsx)(Uv,{children:t("Acronym")}),name:"accreditation.acronym"})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Lj,{label:t("Color"),name:"accreditation.color"}),(0,i.jsx)(Gj,{label:t("ic_ne_55554"),name:"accreditation.icon"})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Qv,{label:(0,i.jsx)(Uv,{children:t("description_58935")}),name:"accreditation.description"}),e.event.isWeezeventConnected&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Hm,{name:"accreditation.weezeventIsSynchronized",children:t("WeezeventIsSynchronized")})]}),s&&(0,i.jsx)(BP,{eventId:n,onClose:()=>{o(!1)},onSuccess:t=>{a(YC([...r,t])),e.change("accreditation.accreditationCategoryId",t.id)}})]})},WP=e=>{const t=Yn(),[n,s]=L.useState(Us.c9.invalid("Invalid")),[o,r]=L.useState(0),a=L.useMemo(()=>e.slots.map((e,t)=>({...e,index:t})),[e.slots]),l=L.useMemo(()=>{const t=Us.IX.fromDateTimes(n.startOf("day"),n.endOf("day"));return n.isValid?a.filter(i=>e.matchDateFilter(i,n,t)):a},[n,a,e.matchDateFilter]),d=L.useMemo(()=>l.slice(o,10+o),[o,l]),c=L.useMemo(()=>Math.ceil(l.length/10),[l]),u=L.useMemo(()=>l.length,[l]);return(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsxs)(Na,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(yr,{css:{flex:"1"},font:"gray800 textMd medium",children:t("liste_de_vos_cr_37612")}),(0,i.jsx)(yr,{width:200,children:(0,i.jsx)(Du,{max:e.event.endAt,min:e.event.startAt,value:n,onChange:e=>{s(e),r(0)}})})]}),(0,i.jsxs)(Na,{css:{background:"$gray100",bd:!0,padding:"$6"},direction:"column",gap:"3",children:[d.map(t=>e.renderSlot(t)),(0,i.jsx)($c,{limit:10,numberOfPages:c,offset:o,setOffset:r,totalCount:u})]}),(0,i.jsxs)(yr,{css:{cursor:"pointer"},font:"primary700 textSm medium",onClick:e.onNewSlot,children:["+ ",t("ajouter_un_cr_n_63607")]})]})},GP=e=>{const t=Yn(),{user:n}=si();return(0,i.jsx)(Jj,{buttonText:t("r_p_ter_28960"),icon:"sliders",initialValues:{value:1,unit:e.showHours?"hour":"day"},size:"md",title:t("r_p_ter_le_cr_n_68038"),onClose:e.onClose,onSubmit:async t=>{e.onSubmit(t.value,t.unit),e.onClose()},children:(0,i.jsxs)(Na,{align:"center",gap:"3",wrap:"wrap",children:[(0,i.jsxs)(yr,{children:[t("r_p_ter_pour_le_06048"),yt.Fr!==n?.language&&" "+t("prochain_e_s_04262")]}),(0,i.jsx)(yr,{width:100,children:(0,i.jsx)(Hj,{name:"value",shouldParseAsInt:!0,children:(0,Oc.A)(1,31).map(e=>(0,i.jsx)("option",{value:e,children:e},e))})}),yt.Fr===n?.language&&(0,i.jsx)(yr,{children:t("prochain_e_s_04262")}),(0,i.jsx)(yr,{width:120,children:(0,i.jsxs)(Hj,{name:"unit",children:[e.showHours&&(0,i.jsx)("option",{value:"hour",children:t("heures_17899")}),(0,i.jsx)("option",{value:"day",children:t("jours_43822")}),(0,i.jsx)("option",{value:"week",children:t("semaines_53228")})]})})]})})},HP=e=>{const t=Yn(),n=qn(PP);return(0,i.jsx)(Jj,{buttonText:t("mettre_jour_l_76289"),icon:"sliders",initialValues:{slot:e.slot},schema:n.createAccreditationSlotSchema(),size:"md",subtitle:t(""),title:t("mise_jour_d_u_86656"),onClose:e.onClose,onSubmit:async t=>{await e.onSuccess((0,wr.A)(t.slot,["id","name","date","maxResources"])),e.onClose()},children:({form:n})=>(0,i.jsxs)(Na,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(Ll,{label:t("nom_du_cr_neau_54351"),name:"slot.name"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{label:t("MaxResources"),name:"slot.maxResources",shouldParseAsInt:!0}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Lm,{label:t("Date"),max:e.event.endAt,min:e.event.startAt,name:"slot.date",rightIcon:"xmark",onRightIconClick:()=>{n.change("slot.date",null)}})]})})},qP=e=>{const t=Yn(),n=qn(Kc),s=(0,L.useMemo)(()=>m(e.slot.name)?e.slot.name:t("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),o=(0,L.useMemo)(()=>{const i=e.slot.date?.isValid?n.toLocaleString(e.slot.date,Js.DateOnly.WeekdayLongMonthLong):"",s=e.slot.maxResources?t("_1_membre_maxi_51489",e.slot.maxResources):"";return(0,Ya.A)([s,i]).join(" - ")||"-"},[e.slot.maxResources,e.slot.date]),[r,a]=(0,L.useState)(e.initialIsEditOpen),[l,d]=(0,L.useState)(!1),c=!e.slot.date?.isValid,u=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(yr,{color:"gray500",children:o})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"clone",size:"sm",onClick:()=>{e.onDuplicate(e.slot)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("dupliquer_28256")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",disabled:c,leftIcon:"arrows-repeat",size:"sm",onClick:()=>{d(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",disabled:u,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t(u?"des_membres_son_92320":"supprimer_43083")})]})]}),r&&(0,i.jsx)(HP,{event:e.event,slot:e.slot,onClose:()=>{a(!1)},onSuccess:async t=>{e.updateSlots(t,e.index)}}),l&&(0,i.jsx)(GP,{showHours:!1,onClose:()=>{d(!1)},onSubmit:(t,n)=>{e.onRepeat(e.slot,t,n)}})]})},YP=e=>{const t=Yn(),n=qn(PP),[s,o]=(0,L.useState)(-1),r=(0,L.useMemo)(()=>e.values.accreditation.slots.some(e=>e.date?.isValid),[e.values.accreditation]),a=(0,L.useCallback)((t,n)=>{const i=[...e.values.accreditation.slots];i[n]=t,e.change("accreditation.slots",i)},[e.values.accreditation.slots,e.change]),l=(0,L.useCallback)((e,t)=>!!e.date?.isValid&&e.date.startOf("day")===t.startOf("day"),[]),d=(0,L.useCallback)(()=>{e.change("accreditation.slots",e.values.accreditation.slots.concat([n.accreditationsSlotInputDefault()])),o(e.values.accreditation.slots.length)},[e.values.accreditation.slots,e.change]),c=(0,L.useCallback)(t=>{e.change("accreditation.slots",[...e.values.accreditation.slots,{name:t.name,date:t.date,maxResources:t.maxResources}])},[e.values.accreditation.slots,e.change]),u=(0,L.useCallback)((t,n,i)=>{const s=function(e,t,n){if(e.date?.isValid)return(0,Oc.A)(1,t+1).map(t=>{if("day"===n){const n=e.date.plus({day:t});return{name:e.name,date:n,maxResources:e.maxResources}}if("week"===n){const n=e.date.plus({week:t});return{name:e.name,date:n,maxResources:e.maxResources}}throw new Error("Wrong unit")});throw new Error("Can not repeat slot with wrong date")}(t,n,i);e.change("accreditation.slots",e.values.accreditation.slots.concat(s))},[e.values.accreditation.slots,e.change]),h=(0,L.useCallback)(t=>{e.change("accreditation.slots",ao(e.values.accreditation.slots,t))},[e.values.accreditation.slots,e.change]);return(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(WP,{event:e.event,matchDateFilter:l,renderSlot:t=>(0,i.jsx)(qP,{event:e.event,index:t.index,initialIsEditOpen:t.index===s,remove:h,slot:t,updateSlots:a,onDuplicate:c,onRepeat:u},t.index),slots:e.values.accreditation.slots,onNewSlot:d}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("type_d_affichag_09962")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("comment_souhait_62602")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(sb,{name:"accreditation.accreditationDisplay",value:ie.List,children:t("afficher_sous_f_71276")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(sb,{name:"accreditation.accreditationDisplay",value:ie.Radio,children:t("afficher_sous_f_61997")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(sb,{name:"accreditation.accreditationDisplay",value:ie.Calendar,children:t("afficher_sous_f_15380")})]}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("blocage_de_l_ac_17590")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("est_ce_qu_il_y_67585")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(xc,{state:e.values.hasNumberOfDaysLimit?"unchecked":"checked",onClick:t=>{e.change("hasNumberOfDaysLimit","checked"!==t),e.change("accreditation.numberOfDaysLimit",null)},children:t("non_33516")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(xc,{state:e.values.hasNumberOfDaysLimit?"checked":"unchecked",onClick:t=>{e.change("hasNumberOfDaysLimit","checked"===t)},children:t("oui_54361")}),e.values.hasNumberOfDaysLimit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(Na,{align:"center",css:{paddingLeft:"$6"},gap:"2",children:[(0,i.jsx)(yr,{width:80,children:(0,i.jsx)(Ll,{min:0,name:"accreditation.numberOfDaysLimit",shouldParseAsInt:!0})}),(0,i.jsx)(yr,{children:t("jours_avant_la_74918")})]})]})]})]})]})},KP=e=>(0,i.jsx)(eI,{names:[`${e.prefix}latitude`,`${e.prefix}longitude`,`${e.prefix}zoom`],render:t=>(0,i.jsx)(Nr,{center:e.center,coordinatesFieldsProps:{latitudeProps:t[`${e.prefix}latitude`],longitudeProps:t[`${e.prefix}longitude`],zoomProps:t[`${e.prefix}zoom`]},layer:e.layer,point:e.point,traces:e.traces})}),ZP=e=>{const t=Yn();return(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t("apparence_75510")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsxs)(Hj,{label:t("fond_de_carte_43822"),name:`${e.name}layer`,children:[(0,i.jsx)("option",{value:et.Google,children:"Plan"}),(0,i.jsx)("option",{value:et.GoogleSatellite,children:"Satellite"}),(0,i.jsx)("option",{value:et.IgnPlan,children:"IGN Plan"})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Hj,{label:(0,i.jsx)(Uv,{children:t("niveau_de_zoom_39369")}),name:`${e.name}zoom`,shouldParseAsInt:!0,children:(0,Oc.A)(0,23).map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),e.traces.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Um,{isSearchVisible:!0,label:(0,i.jsx)(Uv,{children:t("trac_s_41454")}),multiple:!0,name:`${e.name}tracesIds`,children:e.traces.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t("localisation_38416")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(hC,{addressName:`${e.name}address`,label:(0,i.jsx)(Uv,{children:t("Address")}),latitudeName:`${e.name}latitude`,longitudeName:`${e.name}longitude`}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Vm,{label:(0,i.jsx)(Uv,{children:t("latitude_46176")}),name:`${e.name}latitude`}),(0,i.jsx)(Vm,{label:(0,i.jsx)(Uv,{children:t("longitude_01695")}),name:`${e.name}longitude`})]})]}),(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(KP,{center:(n=e.center,"number"==typeof n?.latitude&&"number"==typeof n?.longitude?{latitude:n.latitude,longitude:n.longitude}:void 0),layer:e.layer,point:$r(e.point),prefix:e.name,traces:e.traces.filter(t=>e.tracesIds.includes(t.id))})})]});var n},XP=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=_l(),{showNotification:r}=kb(),a=qn(FP),l=qn(Ba),d=(0,L.useRef)(null),c=(0,L.useMemo)(()=>e.isEdit?o("mise_jour_de_17055",e.initialValues.accreditation.name):o("cr_ation_d_une_01473"),[e.isEdit,e.initialValues]);Dd(c);const{areSlotsOpen:u,isLocalisationOpen:h,areConditionsOpen:g,areCustomFieldsOpen:p,isPrivateNoteOpen:f,areTagsOpen:x}=(0,L.useMemo)(()=>{const t=e.initialValues.accreditation;return{areSlotsOpen:e.isEdit&&no(t.slots),isLocalisationOpen:e.isEdit&&(m(t.address)||"number"==typeof t.latitude||"number"==typeof t.longitude),areConditionsOpen:e.isEdit&&no(t.accreditationsCustomFields),areCustomFieldsOpen:e.isEdit&&(no(Object.keys(t.fields))||no(t.formCustomFields)),isPrivateNoteOpen:e.isEdit&&m(t.privateNote),areTagsOpen:e.isEdit&&no(t.tagsIds)}},[e.initialValues,e.isEdit]);return(0,i.jsx)(Cl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(Pm,{button:e.isEdit?(0,i.jsx)(El,{isLoading:a,onClick:r,children:o("mettre_jour_l_92576")}):null,category:c,color:"dark",fallbackClosePath:es.ACCREDITATIONS({organizationId:n,eventId:s}),heading:e.isEdit?e.initialValues.accreditation.name:o("nouvelle_accr_d_32707"),children:(0,i.jsxs)($m,{ref:d,children:[(0,i.jsx)(vl,{}),(0,i.jsx)(Mm,{heading:o("informations_su_35382"),hideToggle:!0,initialIsOpen:!0,children:(0,i.jsx)(UP,{change:t.change,event:e.event})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{heading:o("automatisation_47772"),hideToggle:!0,initialIsOpen:!0,subtitle:o("attribuer_autom_55909"),children:(0,i.jsx)(LP,{})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{heading:o("cr_neaux_33401"),initialIsOpen:u,subtitle:o("ajouter_les_dif_76832"),onToggle:e=>{e||t.change("accreditation.slots",[])},children:(0,i.jsx)(YP,{change:t.change,event:e.event,values:l})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{heading:o("localisation_38416"),initialIsOpen:h,subtitle:o("indiquez_la_loc_61935"),onToggle:n=>{n||(t.change("accreditation.layer",e.event.layer),t.change("accreditation.zoom",Or),t.change("accreditation.address",null),t.change("accreditation.latitude",null),t.change("accreditation.longitude",null))},children:(0,i.jsx)(ZP,{center:null,layer:l.accreditation.layer,name:"accreditation.",point:l.accreditation,traces:[],tracesIds:[]})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{heading:o("conditions_77756"),initialIsOpen:g,subtitle:o("ajoutez_des_con_94296"),onToggle:e=>{e||t.change("accreditation.accreditationsCustomFields",[])},children:(0,i.jsx)(NP,{change:t.change,conditionsOperator:l.accreditation.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:l.accreditation.accreditationsCustomFields,name:"accreditation.accreditationsCustomFields",prefix:"accreditation."})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{heading:o("champs_de_formu_64126"),initialIsOpen:p,subtitle:o("ajouter_des_inf_14221"),onToggle:e=>{e||(t.change("accreditation.formCustomFields",[]),t.change("accreditation.fields",{}))},children:(0,i.jsx)(eP,{change:t.change,customFields:e.accreditationCustomFields,formCustomFields:e.formCustomFields,formCustomFieldsValues:l.accreditation.formCustomFields,prefix:"accreditation.",showFormCustomFields:!0})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{heading:o("note_priv_e_06303"),initialIsOpen:f,subtitle:o("ajoutez_une_not_89122"),onToggle:e=>{e||t.change("accreditation.privateNote","")},children:(0,i.jsx)(Qv,{label:(0,i.jsx)(Uv,{children:o("note_priv_e_06303")}),name:"accreditation.privateNote"})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{heading:o("tags_79499"),initialIsOpen:x,subtitle:o("ajouter_des_tag_77298"),onToggle:e=>{e||t.change("accreditation.tagsIds",[])},children:(0,i.jsx)(eC,{change:t.change,name:"accreditation.",organizationId:n,tags:e.tags,tagsIds:l.accreditation.tagsIds})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Fm,{children:(0,i.jsx)(El,{isLoading:a,onClick:r,children:(0,i.jsx)(yr,{textAlign:"center",children:e.isEdit?o("mettre_jour_l_92576"):o("cr_er_l_accr_di_16123")})})})]})}),validate:l.validateForForm(a.createUpdateAccreditationSchema()),width:1,onSubmit:async i=>{const a=await e.mutate({eventId:s,accreditation:{...i.accreditation,slots:i.accreditation.slots.map(e=>(0,dr.A)(e,["index"]))}});r(e.isEdit?o("l_accr_ditation_24401"):o("l_accr_ditation_25694")),e.isEdit?t.goBack(es.ACCREDITATION({organizationId:n,eventId:s,accreditationId:a})):t.replace(es.ACCREDITATION({organizationId:n,eventId:s,accreditationId:a}))}})},JP=()=>{const{organizationId:e,eventId:t,options:n}=Jn(),s=qn(FP),{data:o,loader:r}=Zn("query AccreditationEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...FormCustomFields\n ...CreatePositionTags\n\n accreditationCustomFields: customFields(variety: Accreditation, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateAccreditationEvent\n }\n}\n",{organizationId:e,eventId:t},[Ls.ConditionsCustomFieldsFragment,Ls.FormCustomFieldsFragment,Ls.CreatePositionTagsFragment,Ls.AttachCustomFieldFragment,Ls.CreateAccreditationEventFragment]),{mutate:a}=function(e={}){return Xn("mutation AccreditationCreate($eventId: EventId!, $accreditation: AccreditationInput!) {\n accreditationCreate(eventId: $eventId, accreditation: $accreditation) {\n id\n }\n}\n",e)}(),l=m(n)?parseInt(n,10):null;return r||(0,i.jsx)(XP,{accreditationCustomFields:o.organization.accreditationCustomFields.nodes,conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,formCustomFields:o.organization.formCustomFields.nodes,initialValues:s.createUpdateAccreditationValuesDefault(o.event.layer,null,l),isEdit:!1,mutate:async e=>(await a(e)).accreditationCreate.id,tags:o.organization.tags.nodes})},QP=()=>{const{organizationId:e,eventId:t,accreditationId:n}=Jn(),s=qn(FP),{data:o,loader:r}=Zn("query AccreditationToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...FormCustomFields\n ...CreatePositionTags\n\n accreditationCustomFields: customFields(variety: Accreditation, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreateAccreditationEvent\n\n accreditation(id: $accreditationId) {\n name\n accreditationCategoryId\n description\n privateNote\n acronym\n color\n icon\n weezeventIsSynchronized\n willAutoAccredit\n address\n latitude\n longitude\n zoom\n layer\n tagsIds\n accreditationDisplay\n numberOfDaysLimit\n conditionsOperator\n fields\n\n accreditationsCustomFields {\n customFieldId\n conditionValue\n }\n\n formCustomFields {\n id\n customFieldId\n isMandatory\n }\n\n slots {\n id\n name\n date\n maxResources\n assignedResources\n }\n }\n }\n}\n",{organizationId:e,eventId:t,accreditationId:n},[Ls.ConditionsCustomFieldsFragment,Ls.FormCustomFieldsFragment,Ls.CreatePositionTagsFragment,Ls.AttachCustomFieldFragment,Ls.CreateAccreditationEventFragment]),{mutate:a}=function(e={}){return Xn("mutation AccreditationUpdate(\n $eventId: EventId!\n $accreditationId: AccreditationId!\n $accreditation: AccreditationInput!\n) {\n accreditationUpdate(\n eventId: $eventId\n accreditationId: $accreditationId\n accreditation: $accreditation\n ) {\n id\n }\n}\n",e)}();return r||(0,i.jsx)(XP,{accreditationCustomFields:o.organization.accreditationCustomFields.nodes,conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,formCustomFields:o.organization.formCustomFields.nodes,initialValues:s.createUpdateAccreditationValuesDefault(o.event.layer,o.event.accreditation,null),isEdit:!0,mutate:async e=>(await a({...e,accreditationId:n})).accreditationUpdate.id,tags:o.organization.tags.nodes})};var eF;!function(e){e.Acronym="acronym",e.Address="address",e.AutoAccredit="autoAccredit",e.Category="category",e.Color="color",e.Conditions="conditions",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.FillingRate="fillingRate",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Index="index",e.Latitude="latitude",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.Resources="resources",e.SlotDate="slotDate",e.SlotName="slotName",e.Tags="tags",e.WeezeventChecklistId="weezeventChecklistId",e.WeezeventIsSynchronized="weezeventIsSynchronized"}(eF||(eF={}));let tF=class extends gu{constructor(e,t,n){super(e,t,n)}getAccreditationsFilters(e,t){return(0,Ya.A)([{slug:"name",name:this.t("nom_de_l_accr_d_11908"),category:this.t("accr_ditations_39450"),fieldType:We.Text,hideEmpty:!0},{slug:"accreditation",name:this.t("Accreditation"),category:this.t("accr_ditations_39450"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:eF.Description,name:this.t("Description"),category:this.t("accr_ditations_39450"),fieldType:We.Text},{slug:eF.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("accr_ditations_39450"),fieldType:We.Text},no(e.accreditationsCategories)?{slug:"accreditationCategory",name:this.t("cat_gorie_00291"),category:this.t("accr_ditations_39450"),fieldType:We.Select,values:e.accreditationsCategories,hideEmpty:!0}:null,{slug:"slotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("accr_ditations_39450"),fieldType:We.Text},{slug:"slotDate",name:this.t("Date"),category:this.t("accr_ditations_39450"),fieldType:We.Date},{slug:"tag",name:"Tag",category:this.t("accr_ditations_39450"),fieldType:We.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:kt.Accreditations},{slug:"accreditationCustomField",name:this.t("condition_61066"),category:this.t("accr_ditations_39450"),fieldType:We.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("accr_ditations_39450"),fieldType:We.Text},{slug:"color",name:this.t("Color"),category:this.t("accr_ditations_39450"),fieldType:We.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("accr_ditations_39450"),fieldType:We.Select,values:pn.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("accr_ditations_39450"),fieldType:We.Text},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("accr_ditations_39450"),fieldType:We.Number,hideEmpty:!0},{slug:eF.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("accr_ditations_39450"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:eF.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("accr_ditations_39450"),fieldType:We.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)])}getAccreditationsPossibleColumns(e,t){const n=[{slug:eF.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:ae.Id,width:100},{slug:eF.Name,name:this.t("nom_de_l_accr_d_11908"),isSearchable:!0,isSortable:!0,sortAttribute:ae.Name,minWidth:240},{slug:eF.Category,name:this.t("nom_de_la_cat_g_03860"),isSearchable:!0,isSortable:!0,sortAttribute:ae.Category,minWidth:240},{slug:eF.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:240},{slug:eF.SlotDate,name:this.t("Date"),minWidth:180,isSortable:!0,sortAttribute:re.Date},{slug:eF.Resources,name:this.t("membres_11310"),minWidth:320},{slug:eF.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:240},{slug:eF.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:eF.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:eF.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:eF.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:eF.Acronym,name:this.t("Acronym"),isSearchable:!0,isSortable:!0,sortAttribute:ae.Acronym,minWidth:180},{slug:eF.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:eF.Icon,name:this.t("ic_ne_55554"),width:80},{slug:eF.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:eF.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:eF.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:eF.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:ae.CreatedAt,minWidth:180},{slug:eF.AutoAccredit,name:this.t("AutoAccredit"),minWidth:180},{slug:eF.Index,name:this.t("Index"),isSortable:!0,sortAttribute:ae.Index,width:200}];return e&&n.push({slug:eF.WeezeventIsSynchronized,name:this.t("WeezeventIsSynchronized"),minWidth:180},{slug:eF.WeezeventChecklistId,name:this.t("WeezeventChecklistId"),minWidth:180}),n.concat(this.customFieldsToPossibleColumns(t))}};tF=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],tF);const nF=e=>{const{params:{eventId:t}}=_l(),{mutate:n}=wo(),s=L.useCallback(async i=>{const s=to(e.property);for(const o of s){const r=1===s.length?i:i[o];await n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.accreditationId]},slug:o,strategy:tt.Replace,value:r}})}return!0},[e.accreditationId,e.property,n]);return(0,i.jsx)(_y,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:!0})},iF=e=>{const{translate:t}=_l();return(0,i.jsx)(nF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.acronym||"",property:se.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.accreditation.acronym||""})},sF=L.createContext({}),oF=e=>{const t=j$(Vr,{eventId:e.eventId},e=>e.event.accreditationsCategories),n=j$(Bo,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(sF.Provider,{value:{getAccreditationsCategories:t,getTags:n},children:e.children})};function rF(){return L.useContext(sF)}const aF=e=>{const t=Yn(),{getAccreditationsCategories:n}=rF(),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("Category")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(zu,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},lF=e=>{const{organizationId:t,eventId:n}=Jn(),{isEditMode:s}=gy(),o=e.accreditationCategory.name;return(0,i.jsx)(nF,{accreditationId:e.accreditationId,column:e.column,initialValue:e.accreditationCategory.id,property:se.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(aF,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(N$,{isEditMode:s,title:o,updatable:!0,children:(0,i.jsx)(qc,{to:es.ACCREDITATION_CATEGORY({organizationId:t,eventId:n,accreditationCategoryId:e.accreditationCategory.id}),children:o})})})},dF=e=>{const{translate:t}=_l();return(0,i.jsx)(nF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.color,property:se.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Na,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{css:{background:e.accreditation.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{PS(e.accreditation.color)}})}),(0,i.jsx)(Cm,{placement:"top",children:e.accreditation.color})]})})})};function cF(e,t,n){return t.fieldType===Ve.Select?no(n)?(0,Ya.A)(n.map(e=>t.values.find(t=>t.id===e)?.value)).join(", "):"":e(!0===n?"true":"false")}const uF=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>e.accreditation.accreditationsCustomFields||[],[e.accreditation]),s=(0,L.useMemo)(()=>n.map((e,n)=>({id:n,color:"gray",icon:null,text:`${e.customField.name} : ${cF(t,e.customField,e.conditionValue)}`})),[n]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:s})})},hF=e=>{const{translate:t}=_l();return(0,i.jsx)(nF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.icon,property:se.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Wj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(el,{icon:Qa(e.accreditation.icon)})})},mF=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>({[se.Color]:e.accreditation.color,[se.Icon]:e.accreditation.icon}),[e.accreditation]);return(0,i.jsx)(nF,{accreditationId:e.accreditation.id,column:e.column,initialValue:n,property:[se.Color,se.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Na,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Nj,{label:t("Color"),value:e[se.Color],onChange:t=>{n({...e,[se.Color]:t})}}),(0,i.jsx)(Wj,{label:t("Icon"),renderOnPortal:!0,value:e[se.Icon],onChange:t=>{n({...e,[se.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(FC,{color:e.accreditation.color,icon:e.accreditation.icon})})},gF=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{isEditMode:o}=gy(),r=e.accreditation.name;return(0,i.jsx)(nF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.name,property:se.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{label:t("nom_de_l_accr_d_11908"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(N$,{isEditMode:o,title:r,updatable:!0,children:(0,i.jsx)(qc,{to:es.ACCREDITATION({organizationId:n,eventId:s,accreditationId:e.accreditation.id}),children:r})})})},pF=e=>{const{translate:t}=_l(),{getTags:n}=rF(),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("tags_79499")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(bc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},fF=e=>{const t=(0,L.useMemo)(()=>e.accreditation.tags||[],[e.accreditation]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(nF,{accreditationId:e.accreditation.id,column:e.column,initialValue:t.map(e=>e.id),property:se.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(pF,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Ty,{badges:n})})},xF=e=>{const{translate:t,params:{eventId:n}}=_l(),s=qn(Kc),{mutate:o}=Wr(),r=(0,L.useMemo)(()=>e.accreditationSlot.date?s.toLocaleString(e.accreditationSlot.date,Js.DateOnly.WeekdayLongMonthLong):"-",[e.accreditationSlot]),a=(0,L.useMemo)(()=>e.accreditationSlot.date?.isValid?e.accreditationSlot.date:Us.c9.invalid("Invalid"),[e.accreditationSlot]);return(0,i.jsx)(_y,{column:e.column,initialValue:a,mutate:async t=>o({eventId:n,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,wr.A)(e.accreditationSlot,["id","name","maxResources"]),date:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Du,{label:t("Date"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(yr,{color:"gray900",css:{ellipsis:!0,textTransform:"capitalize"},title:r,width:1,children:r}),updatable:!0})},_F=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{isEditMode:o}=gy(),{mutate:r}=Wr(),a=(0,L.useMemo)(()=>m(e.accreditationSlot.name)?e.accreditationSlot.name:"-",[e.accreditationSlot]);return(0,i.jsx)(_y,{column:e.column,initialValue:e.accreditationSlot.name,mutate:async t=>r({eventId:s,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:{...(0,wr.A)(e.accreditationSlot,["id","date","maxResources"]),name:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{label:t("nom_du_cr_neau_54351"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(N$,{isEditMode:o,title:a,updatable:!0,children:(0,i.jsx)(qc,{to:es.ACCREDITATION_SLOT({organizationId:n,eventId:s,accreditationId:e.accreditationSlot.accreditation.id,accreditationSlotId:e.accreditationSlot.id}),children:a})}),updatable:!0})},IF=e=>{if("number"==typeof e.weezeventOrganizationId&&"number"==typeof e.accreditationSlot.weezeventChecklistId){const t=hg(e.weezeventOrganizationId,e.accreditationSlot.weezeventChecklistId);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(qc,{to:t,children:e.accreditationSlot.weezeventChecklistId})})}return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:"-"})},vF=e=>{const{translate:t,params:{eventId:n}}=_l(),{isEventAdmin:s}=vb(),{mutate:o}=Wr(),r=qn(rC),a=uy(e.customFields),l=(0,L.useCallback)(()=>{e.reloadAccreditationSlot(e.accreditationSlot.id)},[e.accreditationSlot,e.reloadAccreditationSlot]),[d,c]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Dc,{css:{"&:hover":{background:"$gray100"}},children:[e.columns.map(t=>{const n=a.get(t.slug);return t.slug===eF.Id?(0,i.jsx)(Ec,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.id},t.slug):t.slug===eF.Category?(0,i.jsx)(lF,{accreditationCategory:e.accreditationSlot.accreditationCategory,accreditationId:e.accreditationSlot.accreditation.id,column:t,reload:l},t.slug):t.slug===eF.Name?(0,i.jsx)(gF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===eF.SlotName?e.accreditationSlot.isHidden?(0,i.jsx)(Ec,{minWidth:t.minWidth,width:t.width,children:"-"},t.slug):(0,i.jsx)(_F,{accreditationSlot:e.accreditationSlot,column:t,reload:l},t.slug):t.slug===eF.SlotDate?e.accreditationSlot.isHidden?(0,i.jsx)(Ec,{minWidth:t.minWidth,width:t.width,children:"-"},t.slug):(0,i.jsx)(xF,{accreditationSlot:e.accreditationSlot,column:t,reload:l},t.slug):t.slug===eF.Resources?(0,i.jsx)(Ec,{minWidth:t.minWidth,width:t.width,children:(0,i.jsx)(O$,{assignedResources:e.accreditationSlot.assignedResources,resources:e.accreditationSlot.maxResources})},t.slug):t.slug===eF.Tags?(0,i.jsx)(fF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===eF.Conditions?(0,i.jsx)(uF,{accreditation:e.accreditationSlot.accreditation,column:t},t.slug):t.slug===eF.Address?(0,i.jsx)(Ec,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.address},t.slug):t.slug===eF.Latitude?(0,i.jsx)(Ec,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.latitude},t.slug):t.slug===eF.Longitude?(0,i.jsx)(Ec,{minWidth:t.minWidth,width:t.width,children:e.accreditationSlot.accreditation.longitude},t.slug):t.slug===eF.Acronym?(0,i.jsx)(iF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===eF.Color?(0,i.jsx)(dF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===eF.Icon?(0,i.jsx)(hF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l},t.slug):t.slug===eF.IconColor?(0,i.jsx)(mF,{accreditation:e.accreditationSlot.accreditation,column:t,reload:l}):t.slug===eF.FillingRate?(0,i.jsxs)(Ec,{minWidth:t.minWidth,width:t.width,children:[e.accreditationSlot.fillingRate,"%"]},t.slug):t.slug===eF.CreatedBy?(0,i.jsx)(zR,{column:t,createdBy:e.accreditationSlot.accreditation.createdBy},t.slug):t.slug===eF.CreatedAt?(0,i.jsx)(TR,{column:t,insertedAt:e.accreditationSlot.insertedAt},t.slug):t.slug===eF.WeezeventChecklistId?(0,i.jsx)(IF,{accreditationSlot:e.accreditationSlot,column:t,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(Ec,{minWidth:t.minWidth,width:t.width,children:n?r.getValueString(n,e.accreditationSlot.accreditation.fields,{fileReturnValue:"name"}):""},t.slug)}),s?e.accreditationSlot.isHidden?(0,i.jsx)(Ec,{width:100}):(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",onClick:()=>{c(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]})}):null]}),d&&(0,i.jsx)(HP,{event:e.event,slot:e.accreditationSlot,onClose:()=>{c(!1)},onSuccess:async t=>{await o({eventId:n,accreditationSlotId:e.accreditationSlot.id,accreditationSlot:t}),l()}})]})},bF=e=>{const{params:{eventId:t}}=_l(),{isEventAdmin:n}=vb(),{columns:s,columnsSearch:o,limit:r,nameDebounced:a,offset:l,possibleColumns:d,predicates:c,reloadKey:u,setLimit:h,setOffset:g,setSort:p,sort:f}=gy(),x=(0,L.useMemo)(()=>({includeConditions:s.includes(eF.Conditions),includeCreatedBy:s.includes(eF.CreatedBy),includeTags:s.includes(eF.Tags)}),[s]),{data:_,isLoading:I,reload:v}=Zn("query AccreditationsSlotsList(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: AccreditationsSlotsSort\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n accreditationsSlots(\n name: $name\n predicates: $predicates\n includeHidden: true\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...AccreditationsAccreditationSlot\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...x,eventId:t,name:m(a)?a:null,columnsSearch:no(o)?o:null,predicates:c,limit:r,offset:l,sort:f},[Ls.AccreditationsAccreditationSlotFragment]);const b=(0,L.useMemo)(()=>s.flatMap(e=>(0,Ya.A)([d.find(t=>t.slug===e)])),[d,s]),{numberOfPages:j,totalCount:C}=ku(_.event?.accreditationsSlots),[y,k]=(0,L.useState)([]),[A,w]=(0,L.useState)({}),S=(0,L.useCallback)(async e=>{w(t=>({...t,[e]:!0}));const{event:{accreditationSlot:n}}=await function(e,t){return ho("query AccreditationsAccreditationSlot(\n $eventId: EventId!\n $id: AccreditationsSlotId!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n accreditationSlot(id: $id) {\n ...AccreditationsAccreditationSlot\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.AccreditationsAccreditationSlotFragment]})}({...x,eventId:t,id:e},await K());k(t=>t.map(t=>t.id===e?n:t)),w(t=>({...t,[e]:!1}))},[x,w,k]);return(0,L.useEffect)(()=>{k(_.event?.accreditationsSlots.nodes??[])},[_.event]),(0,L.useEffect)(()=>{u>1&&v()},[u]),(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":I,headerRow:(0,i.jsxs)(jc,{children:[b.map(e=>e.isSortable?(0,i.jsx)(_m,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:p,sort:f,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Vc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),n&&(0,i.jsx)(Vc,{width:100})]}),paginationRow:(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:r,numberOfPages:j,offset:l,setLimit:h,setOffset:g,showLimits:!0,totalCount:C})}),children:I?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):y.map(t=>A[t.id]?(0,i.jsx)(Uc,{},t.id):(0,i.jsx)(vF,{accreditationSlot:t,columns:b,customFields:e.customFields,event:_.event,reloadAccreditationSlot:S,weezeventOrganizationId:e.weezeventOrganizationId},t.id))})})},jF=()=>{const e=Yn(),{eventId:t,massActions:n,onMassEditSuccess:s,organizationId:o,predicates:r,segment:a}=gy(),{showNotification:l}=kb(),{mutate:d}=wo(),{mutate:c}=Ur(),[u,h]=(0,L.useState)(!1),[g,p]=(0,L.useState)(!1),f=n.getSelectedsInput(r,null),x=n.isAllSelected?a.count:n.numberOfSelected,_=(0,L.useCallback)(e=>{m(e)&&l(e),s()},[s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(El,{onClick:()=>{h(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsx)(qd,{placement:"bottom-end",children:(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{p(!0)},children:e("supprimer_43083")})})]}),u&&(0,i.jsx)(uA,{eventId:t,mutate:e=>d({eventId:t,massEdit:e}),organizationId:o,selecteds:f,onClose:()=>{h(!1)},onSuccess:t=>{_(e("_1_accr_ditati_22872",t))}}),g&&(0,i.jsx)(sA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_31111")],text:e("suppression_de_42723",x),onClose:()=>{p(!1)},onDelete:async()=>{const n=(await c({eventId:t,selecteds:f})).numberOfAccreditations;_(e("_1_accr_ditati_88237",n))}})]})},CF=e=>{const{params:{organizationId:t,eventId:n},translate:s}=_l(),{user:o}=si(),{data:r,isLoading:a}=Zn("query AccreditationsHeader($eventId: EventId!) {\n event(id: $eventId) {\n key\n }\n}\n",{eventId:n},[]),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1),[h,m]=(0,L.useState)(!1);return(0,i.jsxs)(r$,{children:[(0,i.jsx)(Bb,{permissions:Nb.ACCREDITATION_EDIT,children:(0,i.jsx)(El,{to:$s.CREATE_ACCREDITATION(t,n),children:s("cr_er_une_accr_33475")})}),(0,i.jsx)(Bb,{permissions:Nb.ACCREDITATION_EDIT,children:(0,i.jsxs)(Bd,{isOpen:l,onStateChange:d,children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"plus",onClick:()=>{d(!1),m(!0)},children:s("cr_er_une_cat_g_20051")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{icon:"plug-circle-bolt",onClick:e=>{Nd(e.target),u(!0)},children:s("exporter_via_l_09843")})]})]})}),h&&(0,i.jsx)(BP,{eventId:n,onClose:()=>{m(!1)},onSuccess:e.reload}),!a&&(0,i.jsx)(uD,{isOpen:c,link:cg({organizationId:t,eventId:n,lang:o?.language,pathComponent:"accreditations",key:r.event.key}),onClose:()=>{u(!1)}})]})};function yF(){const{history:e,params:{organizationId:t,eventId:n}}=_l(),{mutate:i}=function(e={}){return Xn("mutation AccreditationDuplicate($eventId: EventId!, $accreditationId: AccreditationId!) {\n accreditationDuplicate(eventId: $eventId, accreditationId: $accreditationId) {\n id\n }\n}\n",e)}();return(0,L.useCallback)(async s=>{const{accreditationDuplicate:o}=await i({eventId:n,accreditationId:s});e.push($s.EDIT_ACCREDITATION(t,n,o.id))},[t,n,i])}const kF=e=>{const{translate:t,params:{eventId:n}}=_l(),{showNotification:s}=kb(),{mutate:o}=Ur();return(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:(0,Ya.A)([t("_tes_vous_s_r_d_79068"),e.accreditation.assignedResources>0?t("_1_membre_est_95699",e.accreditation.assignedResources):null]),text:t("suppression_de_73669",e.accreditation.name),onClose:e.onClose,onDelete:async()=>{await o({eventId:n,selecteds:{ids:[e.accreditation.id]}}),s(t("l_accr_ditation_25253",e.accreditation.name)),e.onSuccess()}})},AF=e=>{const t=Yn(),n=yF(),[s,o]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"pen",to:$s.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id),children:t("_diter_62574")}),(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>{await n(e.accreditation.id)},children:t("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:e=>{o(!0),Nd(e.target)},children:t("supprimer_43083")})]}),s&&(0,i.jsx)(kF,{accreditation:e.accreditation,onClose:()=>{o(!1)},onSuccess:e.reload})]})},wF=e=>{const{translate:t}=_l();return(0,i.jsx)(nF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.willAutoAccredit,property:se.AutoAccredit,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(gc,{state:e?"checked":"unchecked",onClick:e=>{n("checked"===e)},children:t("AutoAccredit")}),renderValue:e.accreditation.willAutoAccredit?t("oui_54361"):t("non_33516")})},SF=e=>(0,i.jsx)(nF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.index??0,property:se.Index,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(Nl,{min:1,shouldParseAsInt:!0,value:e,onChange:t}),renderValue:e.accreditation.index?.toString(10)??"-"}),EF=e=>{const{translate:t}=_l();return(0,i.jsx)(nF,{accreditationId:e.accreditation.id,column:e.column,initialValue:e.accreditation.weezeventIsSynchronized,property:se.WeezeventIsSynchronized,reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(zu,{label:t("WeezeventIsSynchronized"),shouldParseAsBoolean:!0,value:e,onChange:n,children:[(0,i.jsx)("option",{value:"true",children:t("oui_54361")}),(0,i.jsx)("option",{value:"false",children:t("non_33516")})]}),renderValue:e.accreditation.weezeventIsSynchronized?t("oui_54361"):t("non_33516")})},TF=e=>{const{mutate:t}=wo(),n=(0,L.useCallback)((n,i)=>t({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:i,strategy:tt.Replace,value:n}}),[e.row,t]);return e.column.slug===eF.Id?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===eF.Category?(0,i.jsx)(lF,{accreditationCategory:e.row.accreditationCategory,accreditationId:e.row.id,column:e.column,reload:e.reloadRow}):e.column.slug===eF.Name?(0,i.jsx)(gF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===eF.SlotName||e.column.slug===eF.SlotDate?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===eF.Resources?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(O$,{assignedResources:e.row.assignedResources,resources:e.row.maxResources})}):e.column.slug===eF.Tags?(0,i.jsx)(fF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===eF.Conditions?(0,i.jsx)(uF,{accreditation:e.row,column:e.column}):e.column.slug===eF.Address?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===eF.Latitude?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===eF.Longitude?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):e.column.slug===eF.Acronym?(0,i.jsx)(iF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===eF.Color?(0,i.jsx)(dF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===eF.Icon?(0,i.jsx)(hF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===eF.IconColor?(0,i.jsx)(mF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===eF.FillingRate?(0,i.jsxs)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===eF.CreatedBy?(0,i.jsx)(zR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===eF.AutoAccredit?(0,i.jsx)(wF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===eF.WeezeventIsSynchronized?(0,i.jsx)(EF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):e.column.slug===eF.WeezeventChecklistId?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===eF.CreatedAt?(0,i.jsx)(TR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===eF.Index?(0,i.jsx)(SF,{accreditation:e.row,column:e.column,reload:e.reloadRow}):(0,i.jsx)(Dy,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:n,reload:e.reloadRow,updatable:!0})},zF=e=>{const t=Yn(),{canAccreditationEdit:n}=wS(),s=uy(e.customFields),o=(0,L.useCallback)(()=>{e.reloadAccreditation(e.accreditation.id)},[e.accreditation,e.reloadAccreditation]);return(0,i.jsxs)(Dc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{Nd(e.target)},children:[n&&(0,i.jsx)(Ec,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:e.state,onClick:t=>e.toggleRow(`a${e.accreditation.id}`,t)})}),e.columns.map(t=>{const n=s.get(t.slug);return(0,i.jsx)(TF,{column:t,customField:n,eventId:e.eventId,reloadRow:o,row:e.accreditation},t.slug)}),n&&(0,i.jsxs)(Yc,{justify:"center",children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",to:$s.EDIT_ACCREDITATION(e.organizationId,e.eventId,e.accreditation.id)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsx)(AF,{accreditation:e.accreditation,eventId:e.eventId,organizationId:e.organizationId,reload:e.reload})]})]})},OF=e=>{const{params:{organizationId:t,eventId:n}}=_l(),{canAccreditationEdit:s}=wS(),{columns:o,columnsSearch:r,limit:a,massActions:l,nameDebounced:d,offset:c,possibleColumns:u,predicates:h,reloadKey:g,setLimit:p,setOffset:f,setSort:x,sort:_}=gy(),I=(0,L.useMemo)(()=>({includeConditions:o.includes(eF.Conditions),includeCreatedBy:o.includes(eF.CreatedBy),includeTags:o.includes(eF.Tags)}),[o]),{data:v,isLoading:b,reload:j}=Zn("query Accreditations(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n $sort: AccreditationsSort\n $columnsSearch: [String!]\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n rows: accreditations(\n name: $name\n predicates: $predicates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...AccreditationsAccreditation\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...I,eventId:n,name:m(d)?d:void 0,columnsSearch:no(r)?r:void 0,predicates:h,limit:a,offset:c,sort:_},[Ls.AccreditationsAccreditationFragment]);const C=(0,L.useMemo)(()=>o.flatMap(e=>(0,Ya.A)([u.find(t=>t.slug===e)])),[u,o]),{numberOfPages:y,totalCount:k}=ku(v.data?.rows),[A,w]=(0,L.useState)([]),[S,E]=(0,L.useState)({}),T=(0,L.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{data:{row:t}}=await function(e,t){return ho("query AccreditationsAccreditation(\n $eventId: EventId!\n $id: AccreditationId!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n row: accreditation(id: $id) {\n ...AccreditationsAccreditation\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.AccreditationsAccreditationFragment]})}({...I,eventId:n,id:e},await K());w(n=>n.map(n=>n.id===e?t:n)),E(t=>({...t,[e]:!1}))},[I,E,w]);return(0,L.useEffect)(()=>{w(v.data?.rows.nodes??[])},[v.data]),(0,L.useEffect)(()=>{g>1&&j()},[g]),(0,L.useEffect)(()=>{l.setStates(Object.fromEntries((v.data?.rows.nodes??[]).map(e=>[`a${e.id}`,{id:e.id,state:"unchecked"}])))},[v.data,l.setStates]),(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":b,headerRow:(0,i.jsxs)(jc,{children:[s&&(0,i.jsx)(Vc,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:l.selectAllState,onClick:l.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(_m,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:x,sort:_,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Vc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),s&&(0,i.jsx)(Vc,{width:100})]}),paginationRow:(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:a,numberOfPages:y,offset:c,setLimit:p,setOffset:f,showLimits:!0,totalCount:k})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):A.map(s=>S[s.id]?(0,i.jsx)(Uc,{},s.id):(0,i.jsx)(zF,{accreditation:s,columns:C,customFields:e.customFields,eventId:n,organizationId:t,reload:j,reloadAccreditation:T,state:l.states[`a${s.id}`]?.state??"unchecked",toggleRow:l.toggleRow},s.id))})})})},RF=e=>{const t=Yn(),{canAccreditationEdit:n,canSegmentEdit:s}=wS(),{limit:o,reloadKey:r,rendering:a,segment:l,setReloadKey:d}=gy();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(CF,{reload:()=>{d(r+1)}}),0===e.numberOfAccreditations?(0,i.jsx)(ej,{css:{overflow:"hidden"},children:(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Nk,{subtitle:"",title:t("vous_n_avez_pas_53408")})})}):(0,i.jsxs)(ej,{children:[(0,i.jsx)(o$,{searchRow:(0,i.jsx)(i$,{actions:(0,i.jsx)(jF,{}),searchPlaceholder:t("rechercher_une_65646"),showActions:n,showEditColumns:s,showEditMode:n,showSearchColumns:s}),selectSegment:(0,i.jsx)(A$,{pageSelectedText:t("les_1_accr_di_60244",o),segmentSelectedText:t("les_1_accr_di_20650",l.count,l.name)})}),a===Fh.SlotsList?(0,i.jsx)(bF,{customFields:e.customFields,weezeventOrganizationId:e.weezeventOrganizationId}):(0,i.jsx)(OF,{customFields:e.customFields})]})]})},$F=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=_l(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=vb(),c=qn(tF),u=(0,L.useMemo)(()=>e.organization?.customFields.nodes??[],[e.organization]),h=(0,L.useMemo)(()=>c.getAccreditationsFilters(e.event,u),[u,e.event]),m=(0,L.useMemo)(()=>c.getAccreditationsPossibleColumns(e.event.isWeezeventConnected,u),[u,e.event]);return(0,i.jsx)(oF,{eventId:o,organizationId:s,children:(0,i.jsx)(e$,{canEditSegments:a(Nb.SEGMENT_EDIT),eventId:o,filters:h,filtersButtonText:n("filtrer_les_acc_57840"),filtersSubtitle:n("appliquer_des_f_18351"),getSegmentPath:e=>$s.ACCREDITATIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfAccreditations,initialLimit:l?.accreditationsLimit??Tc,initialSegmentsOpen:l?.areAccreditationsSegmentsOpen??!0,organizationId:s,possibleColumns:m,possibleRenderings:[Fh.List,Fh.SlotsList],reload:e.reload,segmentId:r,segmentType:vt.Accreditations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({accreditationsLimit:e})},onSegmentClick:e=>{d({accreditationsSegmentId:e})},onSegmentDelete:async()=>{await d({accreditationsSegmentId:null}),t.replace(es.ACCREDITATIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await d({areAccreditationsSegmentsOpen:e})},children:(0,i.jsx)(RF,{customFields:u,numberOfAccreditations:e.event.numberOfAccreditations,weezeventOrganizationId:e.organization.weezeventOrganizationId})})})},DF=()=>{const{params:{organizationId:e,eventId:t},translate:n}=_l(),{event:{name:s},localEvent:o}=vb();Dd(`${s} ${n("accr_ditations_39450")}`);const{data:r,loader:a,reload:l}=Zn("query AccreditationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n weezeventOrganizationId\n\n customFields(variety: Accreditation) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n id\n organizationId\n numberOfAccreditations\n isWeezeventConnected\n\n accreditationsCategories {\n id\n name\n }\n\n segmentsFolders(segmentType: Accreditations) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:t},[Ls.SegmentCustomFieldFragment,Ls.SegmentsFoldersSegmentsFragment]),d=(0,L.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.ACCREDITATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)($F,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.ACCREDITATIONS_SEGMENT(e,t,o?.accreditationsSegmentId&&d.includes(o.accreditationsSegmentId)?o?.accreditationsSegmentId:d[0]),replace:!0})})]})},PF=()=>{const{hasFeature:e}=yI();return e(Ne.Accreditation)?(0,i.jsx)(DF,{}):(0,i.jsx)(Na,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(kI,{icon:"badge-check"})})},FF=({accreditation:e})=>{const{history:t,params:{organizationId:n,eventId:s,accreditationId:o},translate:r}=_l(),a=yF(),[l,d]=(0,L.useState)(!1);return(0,i.jsxs)(tj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(bj,{returnPathFallback:es.ACCREDITATIONS({organizationId:n,eventId:s})}),(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:CC(e)}),(0,i.jsx)(Bb,{permissions:Nb.ACCREDITATION_EDIT,children:(0,i.jsx)(El,{to:$s.EDIT_ACCREDITATION(n,s,o),children:r("_diter_l_accr_d_26424")})}),(0,i.jsx)(Bb,{permissions:Nb.ACCREDITATION_EDIT,children:(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>await a(e.id),children:r("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:e=>{Nd(e.target),d(!0)},children:r("supprimer_43083")})]})]})}),l&&(0,i.jsx)(kF,{accreditation:e,onClose:()=>d(!1),onSuccess:()=>t.replace(es.ACCREDITATIONS({organizationId:n,eventId:s}))})]})},MF=e=>(0,i.jsx)(Yu,{color:e.color,css:{display:"none","@tablet":{display:"block"},...e.css},direction:e.direction}),NF=pr("dt",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular",gridColumn:1}}),LF=({children:e,...t})=>(0,i.jsx)(NF,{...t,children:e}),BF=pr("dd",{color:"$gray500",marginInline:0,"@tablet":{color:"$gray800",gridColumn:2}}),VF=({children:e,...t})=>(0,i.jsx)(BF,{...t,children:e}),UF=pr("div",{display:"grid",gridTemplateColumns:"auto",rowGap:"$1","@tablet":{columnGap:"$3",gridTemplateColumns:"auto auto",justifyContent:"space-between"}}),WF=({children:e,...t})=>(0,i.jsx)(UF,{...t,children:e}),GF=pr("dl",{display:"flex",flexDirection:"column",gap:"$4",marginBlock:0,marginInline:0}),HF=({children:e,...t})=>(0,i.jsx)(GF,{...t,children:e}),qF=({accreditationCategoryId:e,accreditationCategoryName:t,accreditationName:n,color:s,customFields:o,fields:r,icon:a})=>{const{params:{organizationId:l,eventId:d,accreditationId:c},translate:u}=_l();return(0,i.jsx)(jw,{css:{flex:"2 1"},title:u("param_tres_78420"),children:(0,i.jsx)(Na,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(HF,{children:[(0,i.jsxs)(WF,{children:[(0,i.jsx)(LF,{children:u("cat_gorie_00291")}),(0,i.jsx)(VF,{children:(0,i.jsx)(qc,{to:es.ACCREDITATION_CATEGORY({organizationId:l,eventId:d,accreditationCategoryId:e}),children:t})})]}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(MF,{direction:"horizontal"}),(0,i.jsxs)(WF,{children:[(0,i.jsx)(LF,{children:u("Accreditation")}),(0,i.jsx)(VF,{children:(0,i.jsx)(qc,{to:es.ACCREDITATION({organizationId:l,eventId:d,accreditationId:c}),children:n})})]})]}),(0,i.jsx)(MF,{direction:"horizontal"}),(0,i.jsxs)(WF,{children:[(0,i.jsx)(LF,{children:u("Color")}),(0,i.jsx)(VF,{children:(0,i.jsx)(yr,{css:{background:s,borderRadius:"20px",height:"20px",width:"20px"}})})]}),(0,i.jsx)(MF,{direction:"horizontal"}),(0,i.jsxs)(WF,{children:[(0,i.jsx)(LF,{children:u("ic_ne_55554")}),(0,i.jsx)(VF,{children:(0,i.jsx)(el,{icon:Qa(a)})})]}),o.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsxs)(Na,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(yr,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(Na,{justify:"end",width:300,children:(0,i.jsx)(Iw,{field:e,fields:r})})]})]},e.slug))]})})})},YF=pr("div",{color:"$gray800",fontSize:"$textSm",fontWeight:"$medium","@tablet":{color:"$gray500",fontWeight:"$regular"}}),KF=pr("div",{color:"$gray500","@tablet":{color:"$gray800",fontWeight:"$medium"}}),ZF=({customFields:e})=>{const t=wc(),n=Yn();return(0,i.jsx)(jw,{title:n("conditions_77756"),children:no(e)?e.map(({customField:e,conditionValue:s},o)=>(0,i.jsxs)(L.Fragment,{children:[0!==o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),!t&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(qa,{height:"4"})]})]}),(0,i.jsx)(YF,{children:e.name}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(KF,{children:cF(n,e,s)})]},o)):(0,i.jsx)(yr,{color:"gray500",textAlign:"center",width:1,children:n("aucune_conditio_36491")})})},XF=({assignedResources:e,maxResources:t})=>{const n=Yn();return(0,i.jsx)(jw,{css:{flex:"1 1"},title:n("limite_de_membr_42978"),children:(0,i.jsx)(Na,{css:{justifyContent:"space-between"},direction:"column",height:"100%",children:(0,i.jsx)(yr,{css:{margin:"auto"},children:(0,i.jsx)(ww,{count:e,total:t??1/0})})})})},JF=({location:e,location:{zoom:t,layer:n,traces:s,address:o}})=>{const r=Yn(),a=Th(e);return(0,i.jsx)(jw,{css:{border:a&&!Sh?"none":"1px solid $gray200",overflow:"hidden",padding:a?0:"$4","@tablet":{border:"1px solid $gray200",padding:0,"& .h-detail-box-content":{padding:a?"0":"$6"}}},title:r("localisation_38416"),children:a?(0,i.jsxs)(i.Fragment,{children:[Eh(e)&&(0,i.jsx)(yr,{height:380,width:1,children:(0,i.jsx)(Nr,{initialZoom:t,layer:n,point:$r(e),traces:s})}),Sh(e)&&(0,i.jsx)(yr,{color:"gray800",css:{padding:"$4","@tablet":{padding:"$7"}},children:o})]}):(0,i.jsx)(yr,{color:"gray500",textAlign:"center",width:1,children:r("aucune_localisa_78216")})})},QF=()=>{const{params:{eventId:e,accreditationId:t}}=_l(),{data:n,loader:s}=Zn("query AccreditationChart($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n ...AccreditationChart\n }\n }\n}\n",{eventId:e,accreditationId:t},[Ls.AccreditationChartFragment]);return s||(0,i.jsx)(jw,{title:"Reporting",children:(0,i.jsx)(yr,{height:380,width:1,children:(0,i.jsx)(Jw,{accreditation:n.event.accreditation,slots:n.event.accreditation.slots})})})},eM="both",tM="delegationAccreditation",nM="slot",iM=({limitSource:e})=>{const t=Yn();return e===tM?(0,i.jsx)(el,{icon:"people-group",title:t("limite_fix_e_po_87265")}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(el,{icon:"badge-check",title:t("limite_fix_e_po_40573")}),e===eM&&(0,i.jsxs)(i.Fragment,{children:[" + ",(0,i.jsx)(iM,{limitSource:tM})]})]})},sM=(e,t)=>{const n=t?.assignedResources??0,s=t?.wishedResources??0,o=t?.maxResources??1/0,r=e?.assignedResources??0,a=e?.wishedResources??0,l=e?.maxResources??1/0,d=r>=l||n>=o,c=o-n,u=o-s,h=l-r,m=l-a,g=c===h?eM:c{const{history:s,params:{organizationId:o,eventId:r,accreditationId:a},translate:l}=_l(),d=qn(Kc),c=qn(xv),{assignedResources:u,maxResources:h,percent:g}=sM(void 0,t),{mutate:p}=Wr(),{mutate:f}=function(e={}){return Xn("mutation AccreditationSlotDelete($eventId: EventId!, $accreditationSlotId: AccreditationsSlotId!) {\n accreditationSlotDelete(eventId: $eventId, accreditationSlotId: $accreditationSlotId) {\n id\n }\n}\n",e)}(),[x,_]=(0,L.useState)(!1),[I,v]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Dc,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>s.push(es.ACCREDITATION_SLOT({organizationId:o,eventId:r,accreditationId:a,accreditationSlotId:t.id})),children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{font:"gray900 textSm medium",children:m(t.name)?t.name:"-"})}),(0,i.jsx)(Ec,{children:t.date?d.toLocaleString(t.date,Js.DateOnly.WeekdayLongMonthLong):"-"}),(0,i.jsx)(Ec,{children:(0,i.jsxs)(Na,{align:"center",css:{"& > div":{width:"100%"}},gap:"2",width:1,children:[(0,i.jsx)(yr,{children:l("_1_2_membres_04485",u,c.toNumberOrInfinity(h))}),h&&(0,i.jsx)(Aw,{percent:g})]})}),(0,i.jsx)(Yc,{justify:"end",children:(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{_(!0)},children:l("_diter_62574")}),(0,i.jsx)(Gd,{color:t.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{v(!0)},children:l("supprimer_43083")})]})})]}),x&&(0,i.jsx)(HP,{event:e,slot:t,onClose:()=>{_(!1)},onSuccess:async e=>{await p({eventId:r,accreditationSlotId:t.id,accreditationSlot:e}),n()}}),I&&(0,i.jsx)(sA,{buttonText:l("supprimer_43083"),subtext:[l("_tes_vous_s_r_d_48876")],text:l("suppression_de_73669",Oh(d,t,"")),onClose:()=>{v(!1)},onDelete:async()=>{await f({eventId:r,accreditationSlotId:t.id}),n()}})]})},rM=()=>{const{translate:e,params:{eventId:t,accreditationId:n}}=_l(),[s,o,r]=Bc(""),[a,l]=xz("accreditation.slots.date",Us.c9.invalid("Invalid"),fm),[d,c]=(0,L.useState)(0),[u,h]=xz("accreditation.slots.sort",null),{data:g,isLoading:p,reload:f}=Zn("query AccreditationSlots(\n $eventId: EventId!\n $accreditationId: AccreditationId!\n $name: String\n $date: Date\n $offset: Int\n $sort: AccreditationsSlotsSort\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n accreditationsSlots(\n accreditationsIds: [$accreditationId]\n name: $name\n date: $date\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n name\n isHidden\n date\n maxResources\n assignedResources\n wishedResources\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,accreditationId:n,name:m(o)?o:void 0,date:a?.isValid?a:void 0,offset:d,sort:u},[]);const{numberOfPages:x,totalCount:_}=ku(g.event?.accreditationsSlots),I=(0,L.useCallback)(e=>{h(e),c(0)},[h,c]);return(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:r})}),(0,i.jsx)(yr,{width:200,children:(0,i.jsx)(Du,{max:g.event?.endAt,min:g.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{attribute:re.Name,setSort:I,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(_m,{attribute:re.Date,setSort:I,sort:u,children:e("Date")}),(0,i.jsx)(Vc,{children:e("remplissage_75916")}),(0,i.jsx)(Vc,{width:100})]}),numberOfPages:x,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):g.event.accreditationsSlots.nodes.map(e=>(0,i.jsx)(oM,{event:g.event,reload:f,slot:e},e.id)),setOffset:c,title:e("liste_des_cr_ne_66393"),totalCount:_})},aM=()=>{const{organizationId:e,eventId:t,accreditationId:n}=Jn(),{isEventAdmin:s}=vb(),{data:o,loader:r,reload:a}=Zn("query AccreditationDashboard(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationId: AccreditationId!\n) {\n organization(id: $organizationId) {\n customFields(variety: Accreditation) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n id\n name\n description\n privateNote\n acronym\n icon\n color\n address\n latitude\n longitude\n layer\n zoom\n assignedResources\n maxResources\n hasSlots\n hiddenSlotId\n fields\n\n accreditationCategory {\n id\n name\n }\n\n accreditationsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n tags {\n id\n name\n }\n }\n }\n}\n",{organizationId:e,eventId:t,accreditationId:n},[Ls.CustomFieldWithConditionFragment]),{mutate:l}=wo();return r||(0,i.jsx)(ej,{children:(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[(0,i.jsx)(QF,{}),o.event.accreditation.hasSlots&&(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(rM,{})}),(0,i.jsxs)(Na,{gap:"6",width:1,children:[!o.event.accreditation.hasSlots&&(0,i.jsx)(XF,{assignedResources:o.event.accreditation.assignedResources,maxResources:o.event.accreditation.maxResources}),(0,i.jsx)(qF,{accreditationCategoryId:o.event.accreditation.accreditationCategory.id,accreditationCategoryName:o.event.accreditation.accreditationCategory.name,color:o.event.accreditation.color,customFields:o.organization.customFields.nodes,fields:o.event.accreditation.fields,icon:o.event.accreditation.icon})]}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(ZF,{customFields:o.event.accreditation.accreditationsCustomFields}),(0,i.jsx)(Pw,{...s?{associateTags:e=>l({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:se.Tag,strategy:tt.Replace,value:e}}),reload:a}:{},tags:o.event.accreditation.tags}),(0,i.jsx)(Ow,{privateNote:o.event.accreditation.privateNote})]}),(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(zw,{description:o.event.accreditation.description}),(0,i.jsx)(JF,{location:o.event.accreditation})]})]})]})})},lM=e=>{const{translate:t}=_l(),n=qn(hh),{data:s}=Zn("query MassCheckInPositionsSlots($eventId: EventId!) {\n event(id: $eventId) {\n positions {\n nodes {\n id\n name\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const o=(0,L.useMemo)(()=>(s.event?.positions.nodes??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.slots.map(t=>(0,i.jsx)("option",{value:t.id,children:vh(n,t,e.name,{position:{includeNameAtEnd:!0}})},t.id))},e.id)),[s.event]),{mutate:r}=No(),[a,l]=(0,L.useState)([]),[d,c]=(0,L.useState)(ge.CheckInOut),[u,h]=(0,L.useState)(null),[m,g]=(0,L.useState)(null),[p,f]=(0,L.useState)(0),[x,_]=(0,L.useState)(!1),I=(0,L.useMemo)(()=>Qs(),[]),v=no(a)&&(d===ge.Reset||u?.isValid&&m?.isValid&&m>u||u?.isValid&&!m?.isValid);return(0,i.jsx)(Rb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"sliders",children:t("mise_jour_du_76261")}),(0,i.jsxs)(Tb,{gap:"5",children:[(0,i.jsx)(bc,{isSearchVisible:!0,label:t("pour_quel_cr_ne_94965"),multiple:!0,values:a,onChange:l,children:o}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(xc,{state:d===ge.CheckInOut?"checked":"unchecked",onClick:()=>{c(ge.CheckInOut)},children:t("mettre_jour_l_00128")}),d===ge.CheckInOut&&(0,i.jsxs)(Na,{css:{paddingBottom:"$3",paddingLeft:"$6"},gap:"6",children:[(0,i.jsx)(Nu,{hint:t("date_et_heure_d_93417"),rightIcon:"xmark",value:u,zone:I,onChange:h,onRightIconClick:()=>h(null)}),(0,i.jsx)(Nu,{hint:t("date_et_heure_d_65738"),rightIcon:"xmark",value:m,zone:I,onChange:g,onRightIconClick:()=>g(null)}),(0,i.jsx)(Nl,{css:{visibility:2723===e.organizationId?"hidden":"visible"},hint:t("temps_de_pause_00051"),shouldParseAsInt:!0,value:p,onChange:f})]}),(0,i.jsx)(xc,{state:d===ge.Reset?"checked":"unchecked",onClick:()=>{c(ge.Reset)},children:t("remettre_z_ro_11572")})]})]}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{disabled:!v,isLoading:x,onClick:async()=>{_(!0);const n=(await r({eventId:e.eventId,checkIn:{breakTime:p,checkInAt:u?.toUTC(),checkOutAt:m?.toUTC(),strategy:d,positionsSlotsIds:a,selecteds:e.selecteds}})).numberOfMembers;e.onSuccess(t("le_pointage_de_04632",n)),e.onClose()},children:t("mettre_jour_85141")})})]})})},dM=e=>{const{params:{organizationId:t,eventId:n},translate:s}=_l(),{user:o}=si(),{data:r}=Zn("query MassDocumentExportCustomDocuments($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n name\n slug\n }\n }\n}\n",{eventId:n},[]),{mutate:a}=Po(),[l,d]=(0,L.useState)(Ee.Assignments),[c,u]=(0,L.useState)(Us.c9.invalid("Invalid")),[h,m]=(0,L.useState)(!1),[g,p]=(0,L.useState)(!1),f=(0,L.useMemo)(()=>(0,ph.A)(r.event?.customDocuments??[],e=>e.slug),[r.event]),x=l===Ee.Assignments||l===Ee.UserHours||l===Ee.UserPlanning||l===Ee.UserPlanningList;return(0,i.jsx)(Rb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"file",children:s("exporter_un_doc_23130")}),(0,i.jsxs)(Tb,{gap:"5",children:[(0,i.jsx)(sl,{color:"gray",leftIcon:"circle-exclamation",children:s("l_e_mail_peut_m_13253")}),(0,i.jsxs)(bc,{isSearchVisible:!0,label:s("quel_document_v_81798"),renderOnPortal:!0,values:[l],onChange:e=>{no(e)&&d(e[0])},children:[f.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),(0,i.jsx)("option",{value:Ee.Assignments,children:s("fiche_d_affecta_91461")}),(0,i.jsx)("option",{value:Ee.UserPlanning,children:s("UserPlanning")}),(0,i.jsx)("option",{value:Ee.UserPlanningList,children:s("UserPlanningList")}),(0,i.jsx)("option",{value:Ee.UserPlanningDays,children:s("UserPlanningDays")}),(0,i.jsx)("option",{value:Ee.Certificate,children:s("Certificate")}),(0,i.jsx)("option",{value:Ee.UserHours,children:s("UserHours")})]}),x&&(0,i.jsx)(Du,{label:s("exportez_vos_do_87332"),value:c,onChange:u}),(0,i.jsx)(gc,{state:h?"checked":"unchecked",onClick:e=>{m("checked"===e)},children:s("fusionner_les_d_64130")})]}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{isLoading:g,onClick:async()=>{p(!0);const i=f.map(e=>e.slug),s=i.includes(l)?Ee.UserCustomDocument:l,r=i.includes(l)?l:void 0;await a({organizationId:t,eventId:n,documentsExport:{documentType:s,customDocumentSlug:r,segmentsIds:e.selecteds.segmentId?[e.selecteds.segmentId]:[],ids:e.selecteds.ids,language:o.language,oneFile:h,date:c}}),e.onSuccess(),e.onClose()},children:s("exporter_59120")})})]})})},cM=e=>{const t=Yn(),{mutate:n,isLoading:s}=Zo(),[o,r]=(0,L.useState)(le.WaitingAccreditation);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",textAlign:"center",children:t("mettre_jour_l_44471")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(zu,{label:t("nouveau_statut_57871"),value:o,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:le.NotApplicable,children:t(le.NotApplicable)}),(0,i.jsx)("option",{value:le.Refused,children:t(le.Refused)}),(0,i.jsx)("option",{value:le.WaitingAccreditation,children:t(le.WaitingAccreditation)})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{isLoading:s,onClick:async()=>{const i=(await n({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:o}})).numberOfMembers;e.onSuccess(t("le_statut_d_acc_85658",i,t(o))),e.onClose()},children:t("modifier_le_sta_94473")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})};let uM=class extends Ul{translationService;constructor(e){super(e),this.translationService=e}massAssignStep1Schema(){return d.Ik().shape({massAssign:d.Ik().shape({...this.massAssignStep1Fields()})})}massAssignStep2Schema(){return d.Ik().shape({massAssign:d.Ik().shape({...this.massAssignStep2Fields()})})}massAssignSchema(){return d.Ik().shape({...this.massAssignStep1Fields(),...this.massAssignStep2Fields()})}massAssignStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(vn,this.t("la_strat_gie_es_82287"))}}massAssignStep2Fields(){return{positionsSlotsIds:d.YO().of(d.ai()).required(this.t("vous_devez_s_le_28976")).min(1,this.t("vous_devez_s_le_28976"))}}};uM=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],uM);const hM=e=>{const t=Yn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"massAssign.strategy",value:tt.Add,children:t("ajouter_des_aff_57793")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"massAssign.strategy",value:tt.Replace,children:t("remplacer_les_a_43030")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"massAssign.strategy",value:tt.Delete,children:t("supprimer_des_a_59880")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:e.handleSubmit,children:t("suivant_affec_68075")})})]})},mM=e=>{const t=Yn(),n=qn(hh),s=e.positionsSlotsIds.includes(e.slot.id)?"checked":"unchecked";return(0,i.jsxs)(Dc,{css:{cursor:"pointer"},onClick:()=>{e.change("massAssign.positionsSlotsIds",so(e.positionsSlotsIds,e.slot.id,"unchecked"===s))},children:[(0,i.jsx)(Ec,{justify:"center",width:48,children:(0,i.jsx)(mc,{shouldPreventDefault:!1,state:s,onClick:Ql.A})}),(0,i.jsx)(Ec,{css:{textTransform:"capitalize"},children:n.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})}),(0,i.jsx)(Ec,{children:m(e.slot.name)?e.slot.name:"-"}),(0,i.jsx)(Ec,{children:(0,i.jsx)(ic,{color:e.slot.assignedResources>=e.slot.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.slot.assignedResources,e.slot.resources)})})]})},gM=e=>{const t=Yn(),n=(0,L.useMemo)(()=>(0,lc.A)(e.slots.filter(t=>t.position.id===e.position.id),e=>e.range.start.toMillis()),[e.slots,e.position]),s=(0,L.useMemo)(()=>n.map(e=>e.id),[n]),o=(0,L.useMemo)(()=>{const t=(0,mh.A)(e.positionsSlotsIds,s);return t.length===s.length?"checked":0===t.length?"unchecked":"indeterminate"},[s,e.positionsSlotsIds]);return(0,i.jsx)(MC,{accreditation:e.position,displayNumberOfSlots:!0,displaySlots:!0,numberOfSlots:n.length,children:(0,i.jsxs)(kc,{hideBorder:!0,children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:o,onClick:t=>{"checked"===t?e.change("massAssign.positionsSlotsIds",(0,Ns.A)(e.positionsSlotsIds.concat(s))):e.change("massAssign.positionsSlotsIds",(0,cc.A)(e.positionsSlotsIds,s))}})}),(0,i.jsx)(Vc,{children:t("date_du_cr_neau_82295")}),(0,i.jsx)(Vc,{children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(Vc,{})]}),n.map(t=>(0,i.jsx)(mM,{change:e.change,positionsSlotsIds:e.positionsSlotsIds,slot:t},t.id))]})})},pM=e=>{const t=(0,L.useMemo)(()=>(0,lc.A)(e.positions.filter(t=>t.positionCategoryId===e.category.id),e=>e.name.toLowerCase()),[e.category,e.positions]);return(0,i.jsx)(DC,{category:e.category,children:t.map(t=>(0,i.jsx)(gM,{change:e.change,position:t,positionsSlotsIds:e.positionsSlotsIds,slots:e.slots},t.id))})},fM=e=>{const t=Yn(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(e.segmentId),[a,l]=(0,L.useState)(e.excludeFull?"checked":"unchecked"),[d,c]=(0,L.useState)(e.excludePast?"checked":"unchecked"),[u,h]=(0,L.useState)(e.filterAvailabilities?"checked":"unchecked"),[m,g]=(0,L.useState)(e.filterWished?"checked":"unchecked"),p=(e.excludeFull?1:0)+(e.excludePast?1:0)+(e.filterAvailabilities?1:0)+(e.filterWished?1:0)+(-1===e.segmentId?0:1);return(0,i.jsxs)(Na,{css:{background:"$gray100",borderRadius:"$2",padding:"$4"},gap:"3",children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),value:e.name,onChange:t=>{e.setName(t)}})}),(0,i.jsxs)(jC,{apply:()=>{e.setExcludeFull("checked"===a),e.setExcludePast("checked"===d),e.setFilterAvailabilities("checked"===u),e.setFilterWished("checked"===m),e.setSegmentId(o),s(!1)},color:"white",isOpen:n,numberOfAppliedFilters:p,reinit:()=>{e.setExcludeFull(!1),l("unchecked"),e.setExcludePast(!1),c("unchecked"),e.setFilterAvailabilities(!1),h("unchecked"),e.setFilterWished(!1),g("unchecked"),e.setSegmentId(-1),r(-1),e.setName(""),s(!1)},showButtons:!0,onStateChange:s,children:[(0,i.jsxs)(zu,{label:"Vues personnalisées",shouldParseAsInt:!0,value:o,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:-1,children:t("vue_personnalis_97654")}),e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,i.jsx)(gc,{state:a,onClick:l,children:t("masquer_les_cr_14425")}),(0,i.jsx)(gc,{state:d,onClick:c,children:t("masquer_les_cr_05336")}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(yr,{font:"gray900 textSm medium",children:t("filtres_sur_les_73833")}),(0,i.jsx)(gc,{state:u,onClick:h,children:t("filtrer_selon_l_74774")}),(0,i.jsx)(gc,{state:m,onClick:g,children:t("filtrer_selon_l_76350")})]})]})},xM=e=>{const t=Yn(),[n,s,o]=Bc(""),[r,a]=xz("massAssign.filters.segmentId",-1),[l,d]=xz("massAssign.filters.excludeFull",!1),[c,u]=xz("massAssign.filters.excludePast",!1),[h,g]=xz("massAssign.filters.filterAvailabilities",!1),[p,f]=xz("massAssign.filters.filterWished",!1),{data:x,loader:_}=Zn("query MassAssignSlots(\n $eventId: EventId!\n $positionName: String\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n $filterAvailabilities: Boolean\n $filterWished: Boolean\n $selecteds: MassActionSelectedsInput\n) {\n event(id: $eventId) {\n segments(segmentType: Positions) {\n id\n name\n }\n\n positionsSlots(\n positionName: $positionName\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n filterAvailabilities: $filterAvailabilities\n filterWished: $filterWished\n selecteds: $selecteds\n ) {\n nodes {\n id\n name\n range\n assignedResources\n resources\n\n position {\n id\n positionCategoryId\n name\n color\n icon\n }\n\n positionCategory {\n id\n name\n }\n }\n }\n }\n}\n",{eventId:e.eventId,positionName:m(s)?s:void 0,segmentId:-1===r?void 0:r,excludeFull:l,excludePast:c,selecteds:e.selecteds,filterAvailabilities:h,filterWished:p},[]);const I=(0,L.useMemo)(()=>(0,lc.A)((0,ph.A)((x.event?.positionsSlots.nodes??[]).map(e=>e.positionCategory),e=>e.id),e=>e.name.toLowerCase()),[x.event]),v=(0,L.useMemo)(()=>(0,ph.A)((x.event?.positionsSlots.nodes??[]).map(e=>e.position),e=>e.id),[x.event]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fM,{excludeFull:l,excludePast:c,filterAvailabilities:h,filterWished:p,name:n,segmentId:r,segments:x.event?.segments??[],setExcludeFull:e=>{d(e)},setExcludePast:u,setFilterAvailabilities:g,setFilterWished:f,setName:o,setSegmentId:e=>{a(e)}}),(0,i.jsx)(qa,{height:"6"}),_||(0,i.jsx)($C,{css:{border:"1px solid $gray100",borderRadius:"$1"},children:I.map(t=>(0,i.jsx)(pM,{category:t,change:e.change,positions:v,positionsSlotsIds:e.values.massAssign.positionsSlotsIds,slots:x.event?.positionsSlots.nodes??[]},t.id))}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:e.submitting,onClick:e.handleSubmit,children:t("affecter_les_1_56142",e.numberOfSelected)})})]})},_M=e=>{const t=Yn(),n=qn(uM),{mutate:s}=Xo();return(0,i.jsx)(xA,{children:(0,i.jsx)(Pm,{category:t("affectation"),heading:t("affecter_les_me_77160"),onClose:e.onClose,children:(0,i.jsx)($m,{children:(0,i.jsxs)(mb,{initialValues:{massAssign:{selecteds:e.selecteds,strategy:tt.Add,positionsSlotsIds:[]}},isEdit:!1,onSubmit:async n=>{const i=(await s({eventId:e.eventId,massAssign:n.massAssign})).numberOfMembers;e.onSuccess(t("_1_membres_ont_14333",i)),e.onClose()},children:[(0,i.jsx)(hb,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(hM,{handleSubmit:e}),schema:n.massAssignStep1Schema()}),(0,i.jsx)(hb,{heading:t("affectation_plural"),render:t=>(0,i.jsx)(xM,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,selecteds:e.selecteds,submitting:t.submitting,values:t.values}),schema:n.massAssignStep2Schema()})]})})})})};let IM=class extends Ul{translationService;constructor(e){super(e),this.translationService=e}massPreAssignStep1Schema(){return d.Ik().shape({massPreAssign:d.Ik().shape({...this.massPreAssignStep1Fields()})})}massPreAssignStep2Schema(){return d.Ik().shape({massPreAssign:d.Ik().shape({...this.massPreAssignStep2Fields()})})}massPreAssignSchema(){return d.Ik().shape({...this.massPreAssignStep1Fields(),...this.massPreAssignStep2Fields()})}massPreAssignStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(vn,this.t("la_strat_gie_es_82287")),level:d.Yj().required(this.t("le_niveau_est_r_81100")).oneOf(bn,this.t("le_niveau_est_r_81100"))}}massPreAssignStep2Fields(){return{positionsCategoriesIds:d.YO().of(d.ai()).test("non-empty-categories",this.t("vous_devez_s_le_32044"),function(){return this.parent.level!==nt.Categories||this.parent.positionsCategoriesIds.length>0}),positionsIds:d.YO().of(d.ai()).test("non-empty-positions",this.t("vous_devez_s_le_89603"),function(){return this.parent.level!==nt.Positions||this.parent.positionsIds.length>0})}}};IM=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],IM);const vM=e=>{const t=Yn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{font:"gray900 textSm medium",children:t("que_souhaitez_v_87607")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"massPreAssign.strategy",value:tt.Add,children:t("ajouter_des_pr_46968")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"massPreAssign.strategy",value:tt.Replace,children:t("remplacer_les_p_59777")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{font:"gray900 textSm medium",children:t("_quel_niveau_s_87878")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"massPreAssign.level",value:nt.Categories,children:t("pr_affecter_su_68204")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"massPreAssign.level",value:nt.Positions,children:t("pr_affecter_su_38603")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:e.handleSubmit,children:t("suivant_pr_a_99182")})})]})},bM=e=>{const t=Yn();return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{css:{paddingRight:0},width:48,children:(0,i.jsx)(mc,{state:e.positionsCategoriesIds.includes(e.category.id)?"checked":"unchecked",onClick:t=>{e.change("massPreAssign.positionsCategoriesIds",so(e.positionsCategoriesIds,e.category.id,"checked"===t))}})}),(0,i.jsx)(Ec,{children:e.category.name}),(0,i.jsx)(Ec,{children:(0,i.jsx)(ic,{color:e.category.assignedResources>=e.category.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.category.assignedResources,e.category.resources)})})]})},jM=e=>{const t=Yn(),[n,s,o]=Bc(""),{data:r,isLoading:a}=Zn("query MassPreAssignCategories($eventId: EventId!) {\n event(id: $eventId) {\n positionsCategories {\n id\n name\n assignedResources\n resources\n }\n }\n}\n",{eventId:e.eventId},[]);const l=(0,L.useMemo)(()=>m(s)?(r.event?.positionsCategories??[]).filter(e=>e.name.trim().toLowerCase().includes(s.trim().toLowerCase())):r.event?.positionsCategories??[],[r.event?.positionsCategories,s]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_une_66722"),value:n,onChange:o})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{css:{paddingRight:0},width:48}),(0,i.jsx)(Vc,{children:t("nom_de_la_cat_g_03860")}),(0,i.jsx)(Vc,{})]}),numberOfPages:1,offset:0,rows:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):l.map(t=>(0,i.jsx)(bM,{category:t,change:e.change,positionsCategoriesIds:e.values.massPreAssign.positionsCategoriesIds},t.id)),setOffset:Ql.A,title:(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{children:t("s_lectionner_le_58635")}),(0,i.jsx)(yr,{font:"gray500 textSm regular",children:t("les_membres_s_l_66443")})]}),totalCount:l.length??0}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:e.handleSubmit,children:t("pr_affecter_le_81533",e.numberOfSelected)})})]})},CM=e=>{const t=Yn();return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{css:{paddingRight:0},width:48,children:(0,i.jsx)(mc,{state:e.positionsIds.includes(e.position.id)?"checked":"unchecked",onClick:t=>{e.change("massPreAssign.positionsIds",so(e.positionsIds,e.position.id,"checked"===t))}})}),(0,i.jsxs)(Ec,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(yr,{font:"gray900 textSm medium",children:e.position.name}),(0,i.jsx)(yr,{color:"gray500",children:e.position.positionCategoryName})]}),(0,i.jsx)(Ec,{children:(0,i.jsx)(ic,{color:e.position.assignedResources>=e.position.resources?"success":"warning",leftIcon:"user-group",children:t("_1_2_membres_04485",e.position.assignedResources,e.position.resources)})})]})},yM=e=>{const t=Yn(),[n,s,o]=Bc(""),[r,a]=(0,L.useState)(0),[l,d]=(0,L.useState)(null),{data:c,isLoading:u}=Zn("query MassPreAssignPositions(\n $eventId: EventId!\n $name: String\n $offset: Int\n $sort: PositionsSort\n) {\n event(id: $eventId) {\n positions(name: $name, limit: 25, offset: $offset, sort: $sort) {\n nodes {\n id\n name\n positionCategoryName\n assignedResources\n resources\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:e.eventId,name:m(s)?s:void 0,offset:r,sort:l},[]);const{numberOfPages:h,totalCount:g}=ku(c.event?.positions);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_une_69998"),value:n,onChange:e=>{a(0),o(e)}})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{css:{paddingRight:0},width:48}),(0,i.jsx)(_m,{attribute:ct.Name,setSort:e=>{d(e),a(0)},sort:l,children:t("nom_de_la_missi_64605")}),(0,i.jsx)(Vc,{})]}),numberOfPages:h,offset:r,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):c.event.positions.nodes.map(t=>(0,i.jsx)(CM,{change:e.change,position:t,positionsIds:e.values.massPreAssign.positionsIds},t.id)),setOffset:a,title:(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{children:t("s_lectionner_le_26300")}),(0,i.jsx)(yr,{font:"gray500 textSm regular",children:t("les_membres_s_l_63510")})]}),totalCount:g}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{onClick:e.handleSubmit,children:t("pr_affecter_le_81533",e.numberOfSelected)})})]})},kM=e=>{const t=Yn(),n=qn(IM),{mutate:s}=Ea();return(0,i.jsx)(xA,{children:(0,i.jsx)(Pm,{category:t("pr_affectation_12256"),heading:t("pr_affecter_le_71377"),onClose:e.onClose,children:(0,i.jsx)($m,{children:(0,i.jsxs)(mb,{initialValues:{massPreAssign:{level:nt.Categories,selecteds:e.selecteds,strategy:tt.Add,positionsIds:[],positionsCategoriesIds:[]}},isEdit:!1,onSubmit:async n=>{const i=(await s({eventId:e.eventId,massPreAssign:n.massPreAssign})).numberOfMembers;e.onSuccess(t("_1_membres_ont_49355",i)),e.onClose()},children:[(0,i.jsx)(hb,{heading:t("initialisation_38640"),render:({handleSubmit:e})=>(0,i.jsx)(vM,{handleSubmit:e}),schema:n.massPreAssignStep1Schema()}),(0,i.jsx)(hb,{heading:t("pr_affectation_68999"),render:t=>t.values.massPreAssign.level===nt.Categories?(0,i.jsx)(jM,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,values:t.values}):(0,i.jsx)(yM,{change:t.form.change,eventId:e.eventId,handleSubmit:t.handleSubmit,numberOfSelected:e.numberOfSelected,values:t.values}),schema:n.massPreAssignStep2Schema()})]})})})})},AM=e=>{const t=Yn(),{mutate:n,isLoading:s}=Qo(),[o,r]=(0,L.useState)($t.WaitingAssignment);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"sliders"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("mettre_jour_l_82143")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(zu,{label:t("nouveau_statut_57871"),value:o,onChange:e=>{r(e)},children:[(0,i.jsx)("option",{value:$t.NotApplicable,children:t($t.NotApplicable)}),(0,i.jsx)("option",{value:$t.Refused,children:t($t.Refused)}),(0,i.jsx)("option",{value:$t.WaitingAssignment,children:t($t.WaitingAssignment)})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{isLoading:s,onClick:async()=>{const i=(await n({eventId:e.eventId,massStateUpdate:{selecteds:e.selecteds,state:o}})).numberOfMembers;e.onSuccess(t("le_statut_d_aff_39000",i,t(o))),e.onClose()},children:t("modifier_le_sta_94473")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},wM=e=>{const{translate:t,params:{eventId:n}}=_l(),{organization:s,hasFeature:o}=yI(),{event:r,isEventAdmin:a}=vb(),{canMemberEdit:l,canMemberAccredit:d,canMemberAssign:c}=wS(),{showNotification:u}=kb(),{mutate:h}=$o(),{mutate:g}=Vo(),{data:p}=Zn("query VolunteerActions($eventId: EventId!) {\n event(id: $eventId) {\n hasDelegations\n hasForms\n }\n}\n",{eventId:n},[]),[f,x]=(0,L.useState)(!1),[_,I]=(0,L.useState)(!1),[v,b]=(0,L.useState)(!1),[j,C]=(0,L.useState)(!1),[y,k]=(0,L.useState)(!1),[A,w]=(0,L.useState)(!1),[S,E]=(0,L.useState)(!1),[T,z]=(0,L.useState)(!1),[O,R]=(0,L.useState)(!1),[$,D]=(0,L.useState)(!1),[P,F]=(0,L.useState)(!1),[M,N]=(0,L.useState)(!1),[B,V]=(0,L.useState)(!1),[U,W]=(0,L.useState)(!1),G=e.massActions.getSelectedsInput(e.predicates,null),H=e.massActions.isAllSelected?e.totalNumberOfMembers:e.massActions.numberOfSelected,q=(0,L.useCallback)(t=>{m(t)&&u(t),e.onMassEditSuccess()},[e.onMassEditSuccess]),Y=r.usePositions,K=r.useAccreditations&&o(Ne.Accreditation),Z=r.useDelegations&&o(Ne.Delegation),X=r.useCampaigns,J=r.useDocuments;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{flex:"1"}}),l&&(0,i.jsx)(El,{onClick:()=>{x(!0)},children:t("_diter_un_champ_64621")}),!e.showOnlyMassEdit&&Y&&c&&(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"wand-magic-sparkles",onClick:()=>{C(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("affecter_1_me_24704",H)})]}),!e.showOnlyMassEdit&&K&&d&&(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"badge-check",onClick:()=>{k(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("accr_diter_1_13773",H)})]}),!e.showOnlyMassEdit&&a&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{maxHeight:400,placement:"bottom-end",children:[(0,i.jsx)(fD,{children:t("gestion_des_mem_51660")}),(0,i.jsx)(Gd,{icon:"merge",onClick:()=>{I(!0)},children:t("fusionner_les_m_37150")}),Y&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(fD,{children:t("affectation_plural")}),(0,i.jsx)(Gd,{icon:"wand-magic-sparkles",onClick:()=>b(!0),children:t("changer_le_stat_39694")}),(0,i.jsx)(Gd,{icon:"wand-magic-sparkles",onClick:()=>E(!0),children:t("pr_affecter_1_62649",H)}),(0,i.jsx)(Gd,{icon:"circle-check",onClick:()=>z(!0),children:t("mettre_jour_l_00128")})]}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(K||Z)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(fD,{children:t("accr_ditations_39450")}),K&&(0,i.jsx)(Gd,{icon:"badge-check",onClick:()=>R(!0),children:t("changer_le_stat_27596")}),Z&&(0,i.jsx)(Gd,{icon:"people-group",isDisabled:!p.event?.hasDelegations,onClick:()=>D(!0),children:t("ajouter_1_mem_86218",H)}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"})]}),(0,i.jsx)(fD,{children:t("communication_05277")}),(0,i.jsx)(Gd,{icon:"file-lines",isDisabled:!p.event?.hasForms,onClick:()=>F(!0),children:t("ajouter_1_mem_52947",H)}),(0,i.jsx)(Gd,{icon:"file-lines",isDisabled:!p.event?.hasForms,onClick:()=>N(!0),children:t("marquer_un_form_10633")}),X&&(0,i.jsx)(Gd,{icon:"paper-plane",onClick:()=>V(!0),children:t("SendCampaign")}),J&&(0,i.jsx)(Gd,{icon:"file",onClick:()=>W(!0),children:t("exporter_un_doc_23130")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>w(!0),children:t("d_sinscrire_de_06416")})]})]}),f&&(0,i.jsx)(gA,{mutate:e=>h({organizationId:s.id,eventId:n,massEdit:e}),organizationId:s.id,selecteds:G,onClose:()=>x(!1),onSuccess:e=>{q(t("_1_membres_ont_07596",e))}}),_&&(0,i.jsx)(jD,{numbersOfSelected:H,organizationId:s.id,usersInfosIds:G.ids||[],onClose:()=>I(!1),onSuccess:q}),v&&(0,i.jsx)(AM,{eventId:n,selecteds:G,onClose:()=>b(!1),onSuccess:q}),j&&(0,i.jsx)(_M,{eventId:n,numberOfSelected:H,selecteds:G,onClose:()=>C(!1),onSuccess:q}),y&&(0,i.jsx)(zA,{eventId:n,numberOfSelected:H,selecteds:G,onClose:()=>k(!1),onSuccess:q}),S&&(0,i.jsx)(kM,{eventId:n,numberOfSelected:H,selecteds:G,onClose:()=>E(!1),onSuccess:q}),T&&(0,i.jsx)(lM,{eventId:n,organizationId:s.id,selecteds:G,onClose:()=>z(!1),onSuccess:q}),A&&(0,i.jsx)(sA,{buttonText:t("d_sinscrire_27046"),subtext:[t("_tes_vous_s_r_d_46029")],text:t("d_sinscription_66971",H),onClose:()=>w(!1),onDelete:async()=>{const e=(await g({eventId:n,selecteds:G})).numberOfMembers;q(t("_1_membres_ont_85190",e))}}),O&&(0,i.jsx)(cM,{eventId:n,selecteds:G,onClose:()=>R(!1),onSuccess:q}),P&&(0,i.jsx)(_D,{eventId:n,organizationId:s.id,selecteds:G,onClose:()=>F(!1),onSuccess:q}),M&&(0,i.jsx)(ID,{eventId:n,organizationId:s.id,selecteds:G,onClose:()=>N(!1),onSuccess:q}),$&&(0,i.jsx)(xD,{eventId:n,organizationId:s.id,selecteds:G,onClose:()=>D(!1),onSuccess:q}),B&&(0,i.jsx)(RA,{eventId:n,organizationId:s.id,selecteds:G,onClose:()=>V(!1),onSuccess:q}),U&&(0,i.jsx)(dM,{selecteds:G,onClose:()=>W(!1),onSuccess:e.onMassEditSuccess})]})},SM=e=>{const{params:{organizationId:t,eventId:n}}=_l(),{hasFeature:s}=yI(),o=qn(Hh),{isEventAdmin:r}=vb(),[a,l]=xz("accreditationMembers.columns",[Wh.Name,Wh.Accreditations]),[d,c]=xz("accreditationMembers.limit",Tc),[u,h]=xz("accreditationMembers.predicates",[]),[m,g]=xz("accreditationMembers.sort",null),{data:p}=er({organizationId:t,eventId:n,privacy:xe.All,loadForms:!1,loadSegments:!1}),f=(0,L.useMemo)(()=>p.organization?.customFields.nodes??[],[p.organization]),x=uy(f),_=(0,L.useMemo)(()=>p.event?o.getAccreditationMembersFilters(t,n,f,p.event,{hasDelegations:s(Ne.Delegation)}):[],[n,f,p.event]),I=(0,L.useMemo)(()=>o.getAccreditationMembersPossibleColumns(f),[f]);return(0,i.jsx)(ej,{children:(0,i.jsx)(mm,{columns:a,columnsSearch:[],columnsToIncludes:Gh,eventId:n,filters:_,getMassActionId:e=>e.userInfo.id,limit:d,loadDataList:or,loadDataListParams:{accreditationCategoryId:e.accreditationCategoryId,accreditationId:e.accreditationId,accreditationSlotId:e.accreditationSlotId,includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},loadRow:ir,loadRowParams:{includeCanRegistrationStateUpdate:!1,includeIsEditable:!1},organizationId:t,possibleColumns:I,predicates:u,renderActions:(e,t,n)=>(0,i.jsx)(wM,{massActions:e,predicates:null,showOnlyMassEdit:!0,totalNumberOfMembers:t,onMassEditSuccess:n}),rendering:Bh.List,setColumns:l,setLimit:c,setPredicates:h,setSort:g,showEditColumns:!0,showEditMode:r,showFilters:!0,showMassActions:r,showRowDropdown:r,showRowEdit:r,showSearchColumns:!1,sort:m,children:(0,i.jsx)(Am,{renderCell:(e,t,s)=>(0,i.jsx)(bk,{canAccredit:!0,canAssign:!0,canChangeDelegation:!0,canClickMemberName:!0,column:e,customField:x.get(e.slug),eventId:n,reloadRow:s,row:t})})})})},EM=e=>{const{params:{organizationId:t,eventId:n,accreditationId:s},translate:o}=_l();Dd(e.event.accreditation.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,accreditationId:e?":accreditationId":s});return(0,i.jsxs)(nj,{children:[(0,i.jsx)(FF,{accreditation:e.event.accreditation}),(0,i.jsxs)(rj,{css:{flex:"1"},children:[(0,i.jsxs)(sj,{css:{px:"$7"},children:[(0,i.jsx)(ij,{path:es.ACCREDITATION_DASHBOARD(r(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(ij,{path:es.ACCREDITATION_MEMBERS(r(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(oj,{path:es.ACCREDITATION_DASHBOARD(r(!0)),children:(0,i.jsx)(aM,{})}),(0,i.jsx)(oj,{path:es.ACCREDITATION_MEMBERS(r(!0)),children:(0,i.jsx)(SM,{accreditationId:s})})]})]})},TM=()=>{const{params:{organizationId:e,eventId:t,accreditationId:n}}=_l(),{data:s,loader:o}=Zn("query Accreditation($eventId: EventId!, $accreditationId: AccreditationId!) {\n event(id: $eventId) {\n accreditation(id: $accreditationId) {\n id\n name\n assignedResources\n hasSlots\n acronym\n }\n\n volunteersRegistrations(accreditationId: $accreditationId) {\n totalCount\n }\n }\n}\n",{eventId:t,accreditationId:n},[]);return o||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:es.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(ni,{path:es.ACCREDITATION_DASHBOARD({organizationId:e,eventId:t,accreditationId:n}),replace:!0})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(EM,{event:s.event})})]})},zM=e=>{const t=Yn(),n=e.isEdit?"0px":e.isLeftPanelOpen?"280px":"68px",s=e.isRightPanelOpen?"360px":"68px";return(0,i.jsxs)(cd,{css:{overflow:"hidden"},gridtemplatecolumns:`${n} 1fr ${s}`,gridtemplaterows:"88px 1fr 72px",height:1,width:1,children:[!e.isEdit&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{borderRight:"1px solid $gray200",gridColumn:"1 / 2",gridRow:"1 / 3"},children:e.isLeftPanelOpen&&e.leftPanel}),(0,i.jsx)(Na,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",gridColumn:"1 / 2",gridRow:"3 / 4",padding:e.isLeftPanelOpen?"$4":"0"},justify:e.isLeftPanelOpen?"end":"center",children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"sidebar",onClick:()=>{e.setIsLeftPanelOpen(!e.isLeftPanelOpen)}})})}),(0,i.jsx)(Cm,{placement:"top",children:e.isLeftPanelOpen?t("cacher_la_liste_66205"):t("afficher_la_lis_14277")})]})})]}),(0,i.jsx)(yr,{css:{gridColumn:"2 / 4",gridRow:"1 / 2"},children:e.header}),(0,i.jsx)(yr,{css:{borderTop:"1px solid $gray200",gridColumn:"2 / 3",gridRow:"2 / 3",overflowY:"auto"},children:e.children}),(0,i.jsx)(yr,{css:{gridColumn:"2 / 3",gridRow:"3 / 4"},children:e.buttons}),(0,i.jsx)(yr,{css:{borderLeft:"1px solid $gray200",borderTop:"1px solid $gray200",gridColumn:"3 / 4",gridRow:"2 / 4",overflowY:"auto"},children:e.isRightPanelOpen?e.rightPanel:(0,i.jsx)(Na,{css:{paddingTop:"$6"},height:1,justify:"center",width:1,children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:()=>{e.setIsRightPanelOpen(!0)},children:(0,i.jsx)(el,{icon:"sidebar"})})}),(0,i.jsx)(Cm,{placement:"top",children:t("afficher_les_in_82197")})]})})})]})},OM=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=_l(),a=qn(Kc),l=(0,L.useMemo)(()=>e.teams.find(t=>t.leaderUserInfoId===e.userInfo.id),[e.teams,e.userInfo]),d=(0,L.useMemo)(()=>e.teams.flatMap(e=>e.members.flatMap(e=>e.userInfo.id===r?[]:[e.userInfo])),[e.teams]);return(0,i.jsxs)(Na,{align:"center",css:{padding:"$5 $6"},gap:"4",children:[(0,i.jsxs)(yr,{css:{position:"relative"},children:[(0,i.jsx)(Jg,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:32}),(0,i.jsx)(Na,{align:"center",css:{background:fr.colors[`${e.badgeColorIcon.color}100`].value,border:"2px solid white",borderRadius:"16px",bottom:"-6px",color:fr.colors[`${e.badgeColorIcon.color}700`].value,fontSize:"8px",position:"absolute",right:"-6px"},height:16,justify:"center",width:16,children:(0,i.jsx)(el,{icon:e.badgeColorIcon.leftIcon})})]}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(Ja,{to:qI.MEMBER_INFORMATION({organizationId:s,eventId:o,userInfoId:r}),children:(0,i.jsx)(yr,{css:{cursor:"pointer","&:hover":{textDecoration:"underline"}},font:"gray900 textXl medium",children:e.userInfo.name})}),(0,i.jsxs)(yr,{color:"gray500",children:["(",e.userInfo.email,")"]}),e.showTeam&&l&&(0,i.jsx)(ic,{leftIcon:"shield",children:n("chef_d_quipe_20641")})]}),(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{color:"gray500",children:a.toLocaleString(e.insertedAt,Js.DateOnly.MonthLong)}),e.showTeam&&no(e.teams)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray500",children:"•"}),(0,i.jsx)(yr,{color:"gray500",children:n("_quipe_1_07445",e.teams[0].teamCode)}),(0,i.jsx)(yr,{color:"gray500",children:"•"}),(0,i.jsx)(fk,{teamMembers:d})]})]})]}),e.showTabs&&(0,i.jsx)(yr,{width:320,children:(0,i.jsxs)(qv,{selectedItem:e.isPreAssign?"preassign":"affect",onChange:n=>{"preassign"!==n||e.isPreAssign?"affect"===n&&e.isPreAssign&&t.replace($s.ASSIGNMENT(s,o,r)):t.replace($s.PRE_ASSIGNMENT(s,o,r))},children:[(0,i.jsx)(Yv,{item:"affect",children:n("affecter_94255")}),(0,i.jsx)(Yv,{item:"preassign",children:n("pr_affecter_17434")})]})})]})},RM=e=>{const t=Yn(),n=qn(Kc);return(0,i.jsxs)(Na,{align:"center",css:{background:e.isSelected?"$primary100":"white",borderBottom:e.displayBorder?"1px solid $gray200":"none",cursor:"pointer",padding:"$4","&:hover":{background:"$primary100"}},gap:"3",onClick:e.onClick,children:[(0,i.jsx)(Jg,{email:e.vr.userInfo.email,image:e.vr.userInfo.picture?.url,name:e.vr.userInfo.name,size:40}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:e.vr.userInfo.name}),(0,i.jsx)(yr,{children:t("inscrit_le_1_12018",n.toLocaleString(e.vr.insertedAt,Js.DateOnly.MonthLong))})]})]})},$M=()=>(0,i.jsxs)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4"},gap:"3",children:[(0,i.jsx)(oc,{size:40,variant:"circular"}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1})]})]}),DM=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=_l(),r=e.event?.delegations?.nodes??[],a=e.event?.segmentsFolders??[],l=e.event?.volunteersRegistrations.totalCount??0,d=e.event?.volunteersRegistrations.nodes??[];return(0,i.jsxs)(Na,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Na,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(bj,{color:"primary",returnPathFallback:es.ACCREDITATIONS({organizationId:n,eventId:s}),children:o("retour_92202")}),(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{font:"gray900 textLg medium",children:o("affectation_plural")}),(0,i.jsx)(ic,{color:"error",size:"sm",children:o("profil_restant",l)})]})]}),(0,i.jsxs)(Na,{css:{px:"$4"},gap:"4",children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:o("rechercher_50038"),value:e.name,onChange:e.setName})}),(0,i.jsxs)(Bd,{doNotCloseOnOtherOpen:!0,children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"bars-filter"})}),(0,i.jsx)(qd,{css:{padding:"0"},placement:"bottom",children:(0,i.jsxs)(Na,{css:{padding:"$4 $6"},direction:"column",gap:"4",width:320,children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:o("liste_des_filtr_75605")}),(0,i.jsxs)(zu,{label:o("date_d_inscript_31369"),value:e.direction,onChange:e.setDirection,children:[(0,i.jsx)("option",{value:jt.Desc,children:o("du_plus_r_cent_76468")}),(0,i.jsx)("option",{value:jt.Asc,children:o("du_plus_ancien_08999")})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:o("vue_personnalis_97654")}),e.isLoading?(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:[e.segmentId],onChange:t=>{no(t)?e.setSegmentId((0,ou.A)(t)):e.setSegmentId(-1)},children:a.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})]}),e.showStates&&(0,i.jsxs)(bc,{isSelectAllVisible:!0,label:o("status_d_affect_75769"),multiple:!0,values:e.states,onChange:e.setStates,children:[(0,i.jsx)("option",{value:$t.WaitingAssignment,children:o($t.WaitingAssignment)}),(0,i.jsx)("option",{value:$t.PreAssigned,children:o($t.PreAssigned)}),(0,i.jsx)("option",{value:$t.Assigned,children:o($t.Assigned)})]}),e.showAccreditationStates&&(0,i.jsxs)(bc,{isSelectAllVisible:!0,label:o("statut_d_accr_d_75527"),multiple:!0,values:e.accreditationStates,onChange:e.setAccreditationStates,children:[(0,i.jsx)("option",{value:le.WaitingAccreditation,children:o(le.WaitingAccreditation)}),(0,i.jsx)("option",{value:le.AutoAccredited,children:o(le.AutoAccredited)}),(0,i.jsx)("option",{value:le.Accredited,children:o(le.Accredited)})]}),e.loadDelegations&&(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:o("Delegation")}),e.isLoading?(0,i.jsx)(oc,{borderRadius:"$1",height:40,width:1}):(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!1,renderOnPortal:!0,values:e.delegationId?[e.delegationId]:[],onChange:t=>{no(t)?e.setDelegationId((0,ou.A)(t)):e.setDelegationId(null)},children:r.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})]})})]})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Na,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($M,{}),(0,i.jsx)($M,{}),(0,i.jsx)($M,{})]}):d.map(n=>(0,i.jsx)(RM,{displayBorder:!0,isSelected:n.userInfo.id===e.userInfoId,vr:n,onClick:()=>{t.push(e.getPath(n.userInfo.id))}},n.userInfo.id))})]})},PM=e=>{const[t,n]=L.useState(e.isOpen??!0),s=L.useCallback(t=>{e.setIsOpen?.(t),n(t)},[e.setIsOpen,n]);return L.useEffect(()=>{"boolean"==typeof e.isOpen&&n(e.isOpen)},[e.isOpen]),(0,i.jsxs)(Na,{css:{borderTop:"1px solid $gray200",padding:"$6",...e.css},direction:"column",gap:"4",children:[(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer",userSelect:"none",...e.titleCss},gap:"4",onClick:()=>{s(!t)},children:[(0,i.jsx)(yr,{color:"gray500",fontSize:"textXs",children:(0,i.jsx)(el,{icon:t?"chevron-down":"chevron-right"})}),(0,i.jsx)(Na,{css:{color:"$gray800",flex:"1",fontWeight:"$semiBold"},children:e.title})]}),t&&e.children]})},FM=e=>{const t=Yn(),n=qn(Kc),[s,o]=xz("assignment.rightPanel.areAccreditationsOpen",!0),r=(0,L.useMemo)(()=>function(e,t,n,i){return e.flatMap(e=>e.accreditationsSlots.map(e=>{const s=Oh(t,e,e.accreditation.name,{defaultName:"-"});return{name:e.accreditation.name,subtitle:s,path:es.ACCREDITATION({organizationId:n,eventId:i,accreditationId:e.accreditation.id})}}))}(e.formsUsersInfos,n,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(PM,{isOpen:s,setIsOpen:o,title:t("accr_ditations_74375"),children:(0,i.jsxs)(kc,{children:[(0,i.jsx)(jc,{children:(0,i.jsx)(Vc,{children:t("accr_ditation_s_00595")})}),r.map((e,t)=>(0,i.jsx)(Dc,{children:(0,i.jsxs)(Ec,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsx)(yr,{color:"gray900",fontWeight:"medium",children:e.name}),(0,i.jsx)(yr,{color:"gray500",children:e.subtitle})]})},t))]})})},MM=e=>{const t=qn(Kc);return(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsxs)(Na,{justify:"between",children:[(0,i.jsx)(yr,{font:"gray800 textXs medium",children:e.comment.writtenBy.userInfo.name}),(0,i.jsx)(yr,{font:"gray500 textXs regular",children:t.toLocaleString(e.comment.insertedAt,{...Js.DateTime,month:"numeric"})})]}),(0,i.jsx)(Na,{css:{background:"$gray100",bd:!0,borderTopLeftRadius:"0",padding:"$2 $3",whiteSpace:"pre-wrap"},children:e.comment.content})]})},NM=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=_l(),{data:o,isLoading:r,reload:a}=Aa({organizationId:t,userInfoId:s}),{mutate:l,isLoading:d}=ka(),[c,u]=(0,L.useState)(""),{permissions:[h]}=ck(ik({organizationId:t,eventId:n,userInfoId:s}));return(0,i.jsxs)(Na,{css:{padding:"0 $6 $4 $6"},direction:"column",gap:"3",children:[r?(0,i.jsx)(oc,{borderRadius:"$1",height:40,variant:"rectangular",width:1}):o.organization.userInfo.comments.map(e=>(0,i.jsx)(MM,{comment:e},e.id)),h&&(0,i.jsxs)(Rb,{children:[(0,i.jsx)($b,{children:(0,i.jsx)(El,{color:"invisible",leftIcon:"plus",children:e("ajouter_un_comm_27671")})}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"message",children:e("ajouter_un_comm_27671")}),(0,i.jsx)(Tb,{children:(0,i.jsx)(Wm,{label:e("commentaire_08754"),value:c,onChange:u})}),(0,i.jsx)(Eb,{children:o=>(0,i.jsx)(El,{disabled:g(c),isLoading:d,onClick:async()=>{await l({organizationId:t,eventId:n,userInfoId:s,comment:{content:c}}),a(),o()},children:e("ajouter_97327")})})]})]})]})},LM=e=>{const t=Yn(),[n,s]=xz("assignment.rightPanel.areInformationsOpen",!0);return(0,i.jsxs)(PM,{isOpen:n,setIsOpen:s,title:e.title,children:[(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(Mz,{children:t("Email")}),(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0,fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.userInfo.email})]}),e.customFields.map(t=>(0,i.jsx)(Nz,{field:t,fields:e.userInfo.fields},t.id)),e.formsIds.map(n=>{const s=Lz(n,t);return m(e.userInfo.fields[s.slug])?(0,i.jsx)(Nz,{field:s,fields:e.userInfo.fields},s.slug):null})]})},BM=e=>{const t=Yn(),n=qn(hh),[s,o]=xz("assignment.rightPanel.arePositionsOpen",!0),r=(0,L.useMemo)(()=>Lk(e.formsUsersInfos,n,e.organizationId,e.eventId),[e.formsUsersInfos,e.organizationId,e.eventId]);return(0,i.jsx)(PM,{isOpen:s,setIsOpen:o,title:t("missions_souhai_23225"),children:(0,i.jsxs)(kc,{children:[(0,i.jsx)(jc,{children:(0,i.jsx)(Vc,{children:t("mission_souhait_49168")})}),r.map((e,n)=>(0,i.jsx)(Dc,{children:(0,i.jsxs)(Ec,{align:"start",direction:"column",gap:"1",justify:"center",children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{color:"gray900",fontWeight:"medium",children:e.name}),e.form.positionRanking===He.Ranked&&(0,i.jsx)(ic,{children:t("choix_n_1_00613",e.rank)})]}),(0,i.jsx)(yr,{color:"gray500",children:e.range})]})},n))]})})},VM=e=>{const t=Yn(),n=qn(Kc),s=qn(hh),[o,r]=xz("assignment.rightPanel.areAvailabilitiesOpen",!0),a=(0,L.useMemo)(()=>(0,lc.A)(e.formsUsersInfos.flatMap(e=>e.slots.map(t=>({display:e.form.slotDisplay,slot:t}))),({slot:e})=>e.range.start.toMillis()).map(({display:e,slot:t})=>e===xt.Calendar||e===xt.DisplayDays?n.toLocaleString(t.range.start,Js.DateOnly.MonthLong):s.toDisplayString(t.range)),[n,s,e.formsUsersInfos]);return(0,i.jsx)(PM,{isOpen:o,setIsOpen:r,title:t("disponibilit_s_49923"),children:(0,i.jsxs)(kc,{children:[(0,i.jsx)(jc,{children:(0,i.jsx)(Vc,{children:t("disponibilit_92461")})}),a.map((e,t)=>(0,i.jsx)(Dc,{children:(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{color:"gray900",fontWeight:"medium",children:e})})},t))]})})},UM=e=>{const t=Yn(),n=(0,L.useMemo)(()=>e.formsUsersInfos.map(e=>e.form.id),[e.formsUsersInfos]);return(0,i.jsxs)(Na,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Na,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(el,{icon:"sidebar"})})}),(0,i.jsx)(Cm,{placement:"top",children:t("cacher_les_info_51832")})]}),(0,i.jsx)(yr,{font:"gray900 textMd semiBold",children:t("_propos_de_1_50761",e.userInfo.name)})]}),(0,i.jsx)(NM,{}),(0,i.jsx)(LM,{customFields:e.customFields,formsIds:n,title:t("informations_22954"),userInfo:e.userInfo}),(0,i.jsx)(VM,{formsUsersInfos:e.formsUsersInfos}),e.showWishedPositions&&(0,i.jsx)(BM,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId}),e.showWishedAccreditations&&(0,i.jsx)(FM,{eventId:e.eventId,formsUsersInfos:e.formsUsersInfos,organizationId:e.organizationId})]})},WM=L.createContext({}),GM=e=>{const[t,n]=L.useState(e.accreditationsSlotsIds);return(0,i.jsx)(WM.Provider,{value:{accreditationsSlotsIds:t,isEdit:e.isEdit,showNextMember:e.showNextMember,setAccreditationsSlotsIds:n},children:e.children})};function HM(){return L.useContext(WM)}const qM=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=_l(),{accreditationsSlotsIds:r,showNextMember:a}=HM(),{mutate:l,isLoading:d}=Zo(),{mutate:c,isLoading:u}=jo(),h=(0,L.useCallback)(()=>{e.isEdit?t.goBack($s.VOLUNTEERS(n,s)):a()},[e.isEdit,a]);return(0,i.jsxs)(Na,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,justify:"end",width:1,children:[(0,i.jsx)(yr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{u||d||(await l({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:le.Refused}}),h())},children:o("refuser_92819")}),(0,i.jsx)(yr,{css:{flex:"1"}}),(0,i.jsx)(El,{color:"primary",isLoading:u,onClick:async()=>{u||d||(no(r)?await c({eventId:s,massAccredit:{accreditationsSlotsIds:r,selecteds:{ids:[e.userInfoId]},strategy:tt.Replace}}):await l({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:le.WaitingAccreditation}}),h())},children:e.isEdit?o("mettre_jour_l_11622"):o("accr_diter_70543")}),(0,i.jsx)(El,{color:"white",onClick:h,children:e.isEdit?o("annuler_48254"):o("accr_diter_plus_19053")})]})},YM=({slots:e})=>{const{accreditationsSlotsIds:t,setAccreditationsSlotsIds:n}=HM(),{minDate:s,maxDate:o,numberOfMonths:r}=(0,L.useMemo)(()=>$h(e),[e]),a=(0,L.useMemo)(()=>e.flatMap(e=>e.date?.isValid&&t.includes(e.id)?[e.date]:[]),[e,t]),l=(0,L.useMemo)(()=>e.flatMap(e=>e.isBlocked?[e.date]:[]),[e]);return(0,i.jsx)(Na,{css:{background:"$gray50",borderTop:"1px solid $gray200",padding:"$4"},gap:"4",wrap:"wrap",children:(0,Oc.A)(0,r).map(d=>{const c=s.plus({month:d}).startOf("month"),u=0===d?s:c,h=d===r-1?o:c.endOf("month"),m=a.filter(e=>e.startOf("month").equals(c));return(0,i.jsx)(jA,{disabledDates:l,firstDayOfMonth:c,max:h,min:u,values:m,onChange:i=>{n(Dh(t,e,c,i))}},d)})})},KM=e=>{const t=qn(Kc),n=qn(xv),{accreditationsSlotsIds:s,setAccreditationsSlotsIds:o}=HM(),r=(0,L.useMemo)(()=>Ph(e.slots),[e.slots]),a=(0,L.useCallback)(t=>{e.isRadio?o([...(0,dc.A)(s,...r.map(e=>e.id)),t]):o(oo(s,t))},[e.isRadio,r,s,o]);return(0,i.jsx)(Na,{direction:"column",children:r.map(o=>{const r=s.includes(o.id)?"checked":"unchecked",l=e.delegationAccreditations?.find(e=>e.accreditationSlotId===o.id),{assignedResources:d,isMaxedOut:c,limitIcon:u,maxResources:h,percent:m}=sM(l,o),g=void 0!==m?(d+(s.includes(o.id)?1:0))/h:void 0;return(0,i.jsxs)(Na,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},children:[(0,i.jsx)(yr,{css:{flex:"1"},children:e.isRadio?(0,i.jsx)(xc,{disabled:c&&"unchecked"===r,state:r,onClick:()=>{a(o.id)},children:(0,i.jsx)(yr,{css:{textTransform:"capitalize"},children:Oh(t,o,"",{date:{localeFormat:Js.DateOnly.WeekdayLongMonthLong}})})}):(0,i.jsx)(gc,{disabled:o.isBlocked||c&&"unchecked"===r,state:r,onClick:()=>{a(o.id)},children:(0,i.jsx)(yr,{css:{textTransform:"capitalize"},children:Oh(t,o,"",{date:{localeFormat:Js.DateOnly.WeekdayLongMonthLong}})})})}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsx)(yr,{color:"gray700",css:{marginBlockStart:"2px"},fontSize:"textXs",children:(0,i.jsx)(el,{icon:"user-group"})}),(0,i.jsx)(qa,{width:"1"}),(0,i.jsxs)(yr,{color:"gray700",children:[d+(s.includes(o.id)?1:0),"/",n.toNumberOrInfinity(h)]}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsx)(yr,{color:"gray400",textAlign:"center",children:h!==1/0&&(0,i.jsxs)(i.Fragment,{children:["[",u,"]"]})}),(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(yr,{css:{marginTop:"auto",marginBottom:"auto"},width:120,children:void 0!==m&&(0,i.jsx)(Aw,{percent:m,prospectivePercent:g})}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsx)(yr,{color:"gray700",textAlign:"end",width:36,children:void 0!==(g??m)&&(0,i.jsxs)(i.Fragment,{children:[Math.min(100,Math.round(100*(g??m))),"%"]})})]},o.id)})})},ZM=({accreditation:e,delegationAccreditations:t,slots:n})=>{const{translate:s}=_l(),o=qn(xv),{accreditationsSlotsIds:r,setAccreditationsSlotsIds:a}=HM(),[l,d]=L.useState(!0),c=L.useMemo(()=>n.map(e=>e.id),[n]),u=L.useMemo(()=>n.every(e=>r.includes(e.id)),[n,r]),h=e.accreditationDisplay,m=e.hasSlots,g=n[0],p=L.useMemo(()=>t?.find(e=>e.accreditationSlotId===g.id),[e,t,g]),{assignedResources:f,isMaxedOut:x,limitIcon:_,maxResources:I,percent:v}=sM(p,g),b=I!==1/0?r.length/I:void 0,j=r.includes(g.id)?"checked":"unchecked",C=L.useCallback(e=>{Rl(e),a(u?(0,cc.A)(r,c):(0,Ns.A)(r.concat(c)))},[c,r,u,a]),y=L.useCallback(e=>{Rl(e),a((0,cc.A)(r,c))},[c,r,a]);return(0,i.jsxs)(Na,{css:{background:"white",bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer",padding:"$4 $6",userSelect:"none"},width:1,onClick:()=>{x||(m?d(!l):a(oo(r,g.id)))},children:[m?(0,i.jsx)(el,{icon:l?"chevron-down":"chevron-right"}):(0,i.jsx)(mc,{disabled:x,shouldPreventDefault:!1,state:j,onClick:Ql.A}),(0,i.jsx)(qa,{width:"4"}),(0,i.jsx)(FC,{color:e.color,icon:e.icon}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:e.name}),m&&(0,i.jsx)(yr,{color:"gray500",children:s("creneau",n.length)})]}),m?h===ie.List?(0,i.jsx)(El,{color:"invisible",onClick:C,children:s(u?"tout_d_s_lectio_37372":"tout_s_lectionn_48027")}):h===ie.Radio?(0,i.jsx)(El,{color:"invisible",onClick:y,children:s("r_initialiser_77538")}):null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{width:"2"}),(0,i.jsx)(yr,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(el,{icon:"user-group"})}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsxs)(yr,{color:"gray700",children:[f+(r.includes(n[0].id)?1:0),"/",o.toNumberOrInfinity(I)]}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsx)(yr,{color:"gray400",textAlign:"center",children:I!==1/0&&(0,i.jsxs)(i.Fragment,{children:["[",_,"]"]})}),(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(yr,{css:{marginBlock:"auto"},width:120,children:void 0!==v&&(0,i.jsx)(Aw,{percent:v||0,prospectivePercent:b})}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsx)(yr,{color:"gray700",textAlign:"end",width:36,children:void 0!==v&&(0,i.jsxs)(i.Fragment,{children:[Math.min(100,Math.round(100*v)),"%"]})})]})]}),m&&l?e.accreditationDisplay===ie.Calendar?(0,i.jsx)(YM,{slots:n}):(0,i.jsx)(KM,{delegationAccreditations:t?.filter(t=>t.accreditationId===e.id),isRadio:h===ie.Radio,slots:n}):null]})},XM=({delegation:e,slots:t})=>{const n=(0,L.useMemo)(()=>(0,lc.A)(Object.values((0,ac.A)(t,e=>e.accreditation.id)),e=>[wC(e[0].accreditation.index),e[0].accreditation.name.toLowerCase()]),[t]);return(0,i.jsx)(Na,{css:{background:"$gray100",borderTop:"1px solid ^$gray200",padding:"$4"},direction:"column",gap:"2",children:n.map(t=>{const n=t[0].accreditation,s=e?.accreditationsSlots.filter(e=>e.accreditationSlot.accreditation.id===n.id&&void 0!==e.maxResources);return(0,i.jsx)(ZM,{accreditation:n,delegationAccreditations:no(s)?s:void 0,slots:t},n.id)})})},JM=({category:e,delegation:t,slots:n})=>{const[s,o]=(0,L.useState)(!0);return(0,i.jsxs)(Na,{css:{bd:!0,overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Na,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"1",onClick:()=>{o(!s)},children:[(0,i.jsx)(Na,{align:"center",css:{fontSize:"$textXs"},height:32,justify:"center",width:32,children:(0,i.jsx)(el,{icon:s?"chevron-down":"chevron-right"})}),(0,i.jsx)(yr,{font:"gray800 textMd medium",children:e.name})]}),s&&(0,i.jsx)(XM,{delegation:t,slots:n})]})},QM=({accreditationsSlots:e,delegation:t})=>{const n=(0,L.useMemo)(()=>(0,lc.A)(Object.values((0,ac.A)(e,e=>e.accreditationCategory.id)),e=>e[0].accreditationCategory.name.toLowerCase()),[e]);return(0,i.jsx)(Na,{direction:"column",gap:"4",width:1,children:n.map(e=>{const n=e[0].accreditationCategory;return(0,i.jsx)(JM,{category:n,delegation:t,slots:e},n.id)})})},eN=e=>{const t=Yn(),n=qn(Kc),s=(0,L.useMemo)(()=>(e.accreditationsCategoriesIds||[]).map(t=>e.event.accreditationsCategories.find(e=>e.id===t).name).join(", "),[e.accreditationsCategoriesIds,e.event]),o=(0,L.useMemo)(()=>(e.accreditationsIds||[]).map(t=>e.event.accreditations.nodes.find(e=>e.id===t).name).join(", "),[e.accreditationsIds,e.event]),r=(0,L.useMemo)(()=>e.date?n.toLocaleString(e.date,Js.DateOnly.MonthLong):"",[e.date]),a=(0,L.useMemo)(()=>e.segmentId?e.event.segments.find(t=>t.id===e.segmentId).name:"",[e.segmentId,e.event]),l=(0,L.useMemo)(()=>(e.tagsIds||[]).map(t=>e.organization.tags.nodes.find(e=>e.id===t).name).join(", "),[e.tagsIds,e.organization]);return m(s)||m(o)||m(r)||m(a)||m(l)||e.excludeFull||e.excludePast?(0,i.jsxs)(Na,{align:"center",gap:"3",wrap:"wrap",children:[m(s)&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setAccreditationsCategoriesIds([])},children:t("cat_gories_1_42029",s)}),m(o)&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setAccreditationsIds([])},children:t("accr_ditations_30765",o)}),m(r)&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:t("date_1_17337",r)}),m(a)&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:t("vue_1_29260",a)}),m(l)&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds([])},children:t("tags_1_43158",l)}),e.excludeFull&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:t("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:t("cr_neaux_dans_l_92999")}),(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:t("r_initialiser_l_66835")})]}):null},tN=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.accreditationsCategoriesIds),[o,r]=(0,L.useState)(e.accreditationsIds),[a,l]=(0,L.useState)(e.date),[d,c]=(0,L.useState)(e.tagsIds),[u,h]=(0,L.useState)(e.segmentId?[e.segmentId]:[]),[m,g]=(0,L.useState)(e.excludeFull?"checked":"unchecked"),[p,f]=(0,L.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(Na,{direction:"column",onChange:e=>{e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,i.jsxs)(Na,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_97056"),renderOnPortal:!0,values:n||[],onChange:s,children:e.event.accreditationsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_92029"),renderOnPortal:!0,values:o||[],onChange:r,children:e.event.accreditations.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Du,{max:e.event.endAt,min:e.event.startAt,placeholder:t("date_du_cr_neau_82295"),value:a,onChange:l}),(0,i.jsx)(bc,{isSearchVisible:!0,placeholder:t("s_lectionnez_un_19794"),renderOnPortal:!0,values:u,onChange:e=>{no(e)?h([(0,ou.A)(e)]):h([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_73255"),renderOnPortal:!0,values:d||[],onChange:c,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(gc,{state:m,onClick:g,children:t("masquer_les_cr_14425")}),(0,i.jsx)(gc,{state:p,onClick:f,children:t("masquer_les_cr_05336")})]}),(0,i.jsxs)(Na,{align:"center",css:{brderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(El,{size:"sm",onClick:()=>{e.setAccreditationsCategoriesIds(n),e.setAccreditationsIds(o),e.setDate(a),e.setExcludeFull("checked"===m),e.setExcludePast("checked"===p),e.setSegmentId(no(u)?u[0]:null),e.setTagsIds(d),e.close()},children:t("appliquer_05753")})]})]})},nN=e=>{const t=Yn(),[n,s]=(0,L.useState)(!1),o=(0,L.useCallback)(()=>{e.setAccreditationsCategoriesIds([]),e.setAccreditationsIds([]),e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setSegmentId(null),e.setTagsIds([])},[e.setAccreditationsCategoriesIds,e.setAccreditationsIds,e.setDate,e.setExcludeFull,e.setExcludePast,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(Na,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_une_65646"),value:e.name,onChange:e.setName}),(0,i.jsxs)(Bd,{doNotCloseOnOtherOpen:!0,isOpen:n,onStateChange:s,children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"bars-filter",children:t("filtres_64574")})})}),(0,i.jsx)(qd,{placement:"bottom-end",width:385,children:(0,i.jsx)(tN,{...e,close:()=>{s(!1)},reset:o})})]})]}),(0,i.jsx)(eN,{...e,reset:o})]})},iN=({event:e,organization:t})=>{const{eventId:n}=Jn(),[s,o,r]=Bc(""),[a,l]=xz("accredit.filters.accreditationsCategoriesIds",null),[d,c]=xz("accredit.filters.accreditationsIds",null),[u,h]=xz("accredit.filters.date",null),[g,p]=xz("accredit.filters.tagsIds",null),[f,x]=xz("accredit.filters.segmentId",null),[_,I]=xz("accredit.filters.excludeFull",!1),[v,b]=xz("accredit.filters.excludePast",!1),{data:j,loader:C}=Zn("query AccreditSlots(\n $eventId: EventId!\n $name: String\n $accreditationCategoriesIds: [AccreditationsCategoryId!]\n $accreditationsIds: [AccreditationId!]\n $date: Date\n $tagsIds: [TagId!]\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n accreditationsSlots(\n includeHidden: true\n accreditationName: $name\n accreditationsCategoriesIds: $accreditationCategoriesIds\n accreditationsIds: $accreditationsIds\n date: $date\n tagsIds: $tagsIds\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n ) {\n nodes {\n ...AccreditationsSlot\n }\n }\n }\n}\n",{eventId:n,name:m(o)?o:void 0,accreditationCategoriesIds:no(a)?a:void 0,accreditationsIds:no(d)?d:void 0,date:u,tagsIds:no(g)?g:void 0,segmentId:f,excludeFull:_,excludePast:v},[Ls.AccreditationsSlotFragment]);return(0,i.jsxs)(Na,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(nN,{accreditationsCategoriesIds:a,accreditationsIds:d,date:u,event:e,excludeFull:_,excludePast:v,name:s,organization:t,segmentId:f,setAccreditationsCategoriesIds:l,setAccreditationsIds:c,setDate:h,setExcludeFull:I,setExcludePast:b,setName:r,setSegmentId:x,setTagsIds:p,tagsIds:g}),(0,i.jsx)(qa,{height:"7"}),C||(0,i.jsx)(QM,{accreditationsSlots:j.event.accreditationsSlots.nodes,delegation:e.volunteerRegistration.delegation})]})},sN=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=_l();Dd(n("accr_ditations_79986",e.event.volunteerRegistration.userInfo.name));const[a,l]=xz("accredit.isLeftPanelOpen",!0),[d,c]=xz("accredit.isRightPanelOpen",!0),[u,h,g]=Bc(""),[p,f]=xz("accredit.leftPanelDirection",jt.Desc),[x,_]=xz("accredit.leftPanelSegmentId",-1),[I,v]=xz("accredit.leftPanelDelegationId",null),[b,j]=xz("accredit.leftPanelStates",[le.AutoAccredited,le.WaitingAccreditation]),{data:C,isLoading:y}=bo({eventId:o,accreditationStates:b,name:m(h)?h:void 0,segmentId:-1===x?void 0:x,delegationId:I||void 0,direction:p,loadDelegations:!0}),k=(0,L.useCallback)(()=>{const e=C.event?.volunteersRegistrations.nodes??[],n=e.findIndex(e=>e.userInfo.id===r),i=e[n+1]?.userInfo.id??e[0].userInfo.id;i===r?t.goBack($s.ACCREDIT(s,o,r)):t.replace($s.ACCREDIT(s,o,i))},[s,o,r,C.event]),A=e.event.volunteerRegistration,w=(0,L.useMemo)(()=>[...A.accreditationsUsersInfos.map(({accreditationSlotId:e})=>e),...e.isEdit?[]:A.accreditationsSlots.flatMap(e=>{const t=A.delegation?.accreditationsSlots.find(t=>t.accreditationSlotId===e.id),n=t?.maxResources&&t?.assignedResources>=t?.maxResources;return e?.maxResources&&e?.assignedResources>=e?.maxResources||n?[]:[e.id]})],[A,e.isEdit]);return(0,i.jsx)(GM,{accreditationsSlotsIds:w,isEdit:e.isEdit,showNextMember:k,children:(0,i.jsx)(zM,{buttons:(0,i.jsx)(qM,{isEdit:e.isEdit,userInfoId:A.userInfo.id}),header:(0,i.jsx)(OM,{badgeColorIcon:xj(A.accreditationState),insertedAt:A.insertedAt,isPreAssign:!1,showTabs:!1,showTeam:!1,teams:[],userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:a,isRightPanelOpen:d,leftPanel:(0,i.jsx)(DM,{accreditationStates:b,delegationId:I,direction:p,event:C.event,getPath:e=>$s.ACCREDIT(s,o,e),isLoading:y,loadDelegations:!0,name:u,segmentId:x,setAccreditationStates:j,setDelegationId:v,setDirection:f,setName:g,setSegmentId:_,setStates:Ql.A,showAccreditationStates:!0,showStates:!1,states:[],userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(UM,{customFields:e.event.formsCustomsFields,eventId:o,formsUsersInfos:e.organization.userInfo.formsUsersInfos,organizationId:s,showWishedAccreditations:!0,showWishedPositions:!1,userInfo:e.event.volunteerRegistration.userInfo,onCollapse:()=>{c(!1)}}),setIsLeftPanelOpen:l,setIsRightPanelOpen:c,children:(0,i.jsx)(iN,{event:e.event,organization:e.organization})})})},oN=e=>{const{organizationId:t,eventId:n,userInfoId:s}=Jn(),{data:o,loader:r}=Zn("query AccreditInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n accreditationsCategories {\n id\n name\n }\n\n accreditations {\n nodes {\n id\n name\n }\n }\n\n segments(segmentType: Accreditations) {\n id\n name\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n userInfoId\n accreditationState\n insertedAt\n\n accreditationsSlots {\n id\n maxResources\n assignedResources\n }\n\n accreditationsUsersInfos {\n accreditationSlotId\n }\n\n delegation {\n ...DelegationAccreditationsSlots\n }\n\n userInfo {\n id\n name\n email\n fields\n picture {\n url\n }\n }\n }\n }\n}\n",{organizationId:t,eventId:n,userInfoId:s},[Ls.FormsUsersInfosWishedFragment,Ls.CustomFieldWithConditionFragment,Ls.DelegationAccreditationsSlotsFragment]);return r||(0,i.jsx)(sN,{event:o.event,isEdit:e.isEdit,organization:o.organization})},rN=e=>(0,i.jsxs)(Na,{css:{background:"white",bd:!0,flex:"1",...e.css},direction:"column",children:[(0,i.jsx)(Na,{css:{flex:"1",padding:"$6"},direction:"column",gap:"2",children:e.children}),e.button&&(0,i.jsx)(Na,{css:{borderTop:"1px solid $gray200",padding:"$4 $6"},justify:"end",children:e.button})]}),aN=()=>{const{translate:e,params:{eventId:t}}=_l(),[n,s,o]=Bc(""),[r,a]=(0,L.useState)(""),[l,d]=(0,L.useState)(0),{data:c,isLoading:u,reload:h}=Zn("query AccreditationsAssignmentsEmails(\n $eventId: EventId!\n $name: String\n $state: EmailState\n $offset: Int\n) {\n event(id: $eventId) {\n emails(\n emailTypes: [Accreditations, AccreditationsRefused]\n name: $name\n state: $state\n limit: 25\n offset: $offset\n ) {\n nodes {\n ...EmailRecipient\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,name:m(s)?s:void 0,state:""!==r?r:void 0,offset:l},[Ls.EmailRecipientFragment]);const g=Mc(),{numberOfPages:p,totalCount:f}=ku(c.event?.emails);return(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{value:r,onChange:e=>{a(e),d(0)},children:[(0,i.jsx)("option",{value:"",children:e("tous_les_status_67644")}),g(an.filter(e=>e!==Te.Queued))]})}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e("rechercher_un_d_02329"),value:n,onChange:e=>{o(e),d(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("nom_du_membre_69353")}),(0,i.jsx)(Vc,{children:e("date_d_envoi_74668")}),(0,i.jsx)(Vc,{children:e("status_06428")}),(0,i.jsx)(Vc,{width:100})]}),numberOfPages:p,offset:l,rows:u?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):c.event.emails.nodes.map(e=>(0,i.jsx)(mj,{email:e,emailType:Oe.Accreditations,reload:h},e.id)),setOffset:d,title:e("liste_des_envoi_14764"),totalCount:f})},lN=e=>{const t=Yn(),{mutate:n,isLoading:s}=function(e={}){return Xn("mutation SendAccreditationsEmails(\n $eventId: EventId!\n $sendAccreditationsEmails: SendAccreditationsEmailsInput!\n) {\n eventAccreditationsEmailsSend(\n eventId: $eventId\n sendAccreditationsEmails: $sendAccreditationsEmails\n )\n}\n",e)}();return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xj,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",textAlign:"center",children:t("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("les_membres_pr_09143")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{isLoading:s,onClick:async()=>{await n({eventId:e.eventId,sendAccreditationsEmails:e.sendAccreditationsEmails}),e.reload(),e.onClose()},children:t("confirmer_l_env_08749")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},dN=e=>{const t=Yn(),[n,s,o]=Bc(""),[r,a]=(0,L.useState)([]),{data:l}=Gr({eventId:e.eventId,usersInfosIds:r,name:m(s)?s:void 0}),d=(0,L.useMemo)(()=>(0,ph.A)((l.event?.volunteersRegistrations.nodes??[]).concat(l.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[l.event]),{mutate:c,isLoading:u}=function(e={}){return Xn("mutation AccreditationsEmailsEstimate(\n $eventId: EventId!\n $sendAccreditationsEmails: SendAccreditationsEmailsInput!\n) {\n eventAccreditationsEmailsEstimate(\n eventId: $eventId\n sendAccreditationsEmails: $sendAccreditationsEmails\n )\n}\n",e)}(),[h,g]=(0,L.useState)(oe.Everyone),[p,f]=(0,L.useState)([]),x=h===oe.Everyone||h===oe.Accredited||h===oe.Refused||h===oe.Members&&no(r)||h===oe.Segments&&no(p),_=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xj,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("envoi_des_e_mai_83224")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("personnaliser_v_78340")}),(0,i.jsx)(qa,{height:"7"}),_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sl,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_69435")}),(0,i.jsx)(qa,{height:"4"})]}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_01732")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(xc,{state:h===oe.Everyone?"checked":"unchecked",onClick:()=>{g(oe.Everyone)},children:t("tous_les_e_mail_50843")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:h===oe.Accredited?"checked":"unchecked",onClick:()=>{g(oe.Accredited)},children:t("tous_les_e_mail_02185")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:h===oe.Refused?"checked":"unchecked",onClick:()=>{g(oe.Refused)},children:t("tous_les_e_mail_41162")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:h===oe.Members?"checked":"unchecked",onClick:()=>{g(oe.Members)},children:t("_certains_memb_91094")}),h===oe.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:n,onChange:o}),values:r,onChange:a,children:d.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:h===oe.Segments?"checked":"unchecked",onClick:()=>{g(oe.Segments)},children:t("uniquement_ce_54026")}),h===oe.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,values:p,onChange:f,children:(l.event?.segments??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{disabled:_,isLoading:u,onClick:async()=>{if(x){const t={recipients:h,segmentsIds:p,usersInfosIds:r},{eventAccreditationsEmailsEstimate:n}=await c({eventId:e.eventId,sendAccreditationsEmails:t});e.onSuccess(n,t),e.onClose()}},children:t("envoyer_les_e_m_37846")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},cN=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=_l(),{setNumberOfWaitingAccreditations:r}=vb(),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(null),[u,h]=(0,L.useState)(0),[m,g]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{r(e.event.waitingAccreditation.totalCount)},[e.event]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ej,{children:[(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsxs)(rN,{button:(0,i.jsx)(El,{disabled:0===e.event.waitingAccreditation.totalCount,onClick:()=>{e.event.waitingAccreditation.totalCount>0&&t.push($s.ACCREDIT(n,s,e.event.waitingAccreditation.nodes[0].userInfoId))},children:o("accr_diter_les_48281")}),children:[(0,i.jsx)(yr,{color:"gray500",fontWeight:"medium",children:o("membres_en_atte_52995")}),(0,i.jsx)(yr,{font:"gray900 displayMd medium",children:e.event.waitingAccreditation.totalCount})]}),(0,i.jsxs)(rN,{button:(0,i.jsx)(El,{onClick:()=>{l(!0)},children:o("param_trer_et_e_31095")}),children:[(0,i.jsx)(yr,{color:"gray500",fontWeight:"medium",children:o("e_mail_de_confi_84099_plural")}),(0,i.jsx)(yr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfWaiting})]})]}),(0,i.jsx)(qa,{height:"9"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",children:o("historique_des_71419")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsxs)(rN,{children:[(0,i.jsx)(yr,{color:"gray500",fontWeight:"medium",children:o("nombre_d_envois_95106")}),(0,i.jsx)(yr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfSent})]}),(0,i.jsxs)(rN,{children:[(0,i.jsx)(yr,{color:"gray500",fontWeight:"medium",children:o("nombre_d_ouvert_84187")}),(0,i.jsx)(yr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfOpen})]}),(0,i.jsxs)(rN,{children:[(0,i.jsx)(yr,{color:"gray500",fontWeight:"medium",children:o("nombre_de_clics_64232")}),(0,i.jsx)(yr,{font:"gray900 displayMd medium",children:e.event.emailsStats.numberOfClick})]})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(aN,{})]}),a&&(0,i.jsx)(dN,{emailSender:e.organization.emailTemplate?.emailSender,eventId:s,onClose:()=>{l(!1)},onSuccess:(e,t)=>{h(e),c(t),g(!0)}}),m&&(0,i.jsx)(lN,{eventId:s,numberOfEmails:u,reload:e.reload,sendAccreditationsEmails:d,onClose:()=>{g(!1)}})]})},uN=()=>{const e=Yn();return(0,i.jsxs)(tj,{direction:"column",children:[(0,i.jsx)(yr,{font:"blueGray900 textXl medium",children:e("accr_ditations_39450")}),(0,i.jsx)(yr,{color:"gray500",children:e("accr_diter_vos_35773")})]})},hN=()=>{const{params:{organizationId:e,eventId:t},translate:n}=_l(),{event:{name:s},localEvent:o,updateLocalEvent:r}=vb();Dd(`${s} ${n("accr_ditations_39450")}`);const{data:a,loader:l,reload:d}=Zn('query AccreditationsAssignmentsKpis(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $direction: SortDirection!\n) {\n organization(id: $organizationId) {\n emailTemplate(emailType: Accreditations, eventId: $eventId) {\n emailSender {\n isValidToSendEmail\n }\n }\n }\n\n event(id: $eventId) {\n emailsStats(emailTypes: [Accreditations, AccreditationsRefused]) {\n numberOfOpen\n numberOfClick\n numberOfSent\n numberOfWaiting\n }\n\n waitingAccreditation: volunteersRegistrations(\n accreditationStates: [AutoAccredited, WaitingAccreditation]\n limit: 1\n sort: { attribute: "InsertedAt", direction: $direction }\n ) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n }\n}\n',{organizationId:e,eventId:t,direction:o?.["accredit.leftPanelDirection"]??jt.Desc},[]);return(0,L.useEffect)(()=>{(async()=>{await Promise.all([r({"accredit.filters.accreditationsCategoriesIds":null}),r({"accredit.filters.accreditationsIds":null}),r({"accredit.filters.date":null}),r({"accredit.filters.tagsIds":null}),r({"accredit.filters.segmentId":null}),r({"accredit.filters.excludeFull":!1})])})()},[]),l||(0,i.jsxs)(nj,{children:[(0,i.jsx)(uN,{}),(0,i.jsx)(cN,{event:a.event,organization:a.organization,reload:d})]})},mN=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation AccreditationCategoryDelete(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n accreditationCategoryDelete(\n eventId: $eventId\n accreditationCategoryId: $accreditationCategoryId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954"),t("cela_supprimera_56396")],text:t("suppression_de_73669",e.accreditationCategory.name),onClose:e.onClose,onDelete:async()=>{await n({eventId:e.eventId,accreditationCategoryId:e.accreditationCategory.id}),e.onSuccess()}})},gN=({category:e,reload:t})=>{const{history:n,params:{organizationId:s,eventId:o},translate:r}=_l(),{mutate:a}=function(e={}){return Xn("mutation AccreditationCategoryDuplicate(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n accreditationCategoryDuplicate(\n eventId: $eventId\n accreditationCategoryId: $accreditationCategoryId\n ) {\n id\n }\n}\n",e)}(),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1);return(0,i.jsxs)(tj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(bj,{returnPathFallback:es.ACCREDITATIONS({organizationId:s,eventId:o})}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.name}),(0,i.jsx)(Bb,{permissions:Nb.ACCREDITATION_EDIT,children:(0,i.jsx)(El,{color:"white",onClick:()=>u(!0),children:r("_diter_62574")})}),(0,i.jsx)(Bb,{permissions:Nb.ACCREDITATION_EDIT,children:(0,i.jsx)(El,{onClick:()=>{n.push($s.CREATE_ACCREDITATION(s,o,e.id))},children:r("add_accreditation")})}),(0,i.jsx)(Bb,{permissions:Nb.ACCREDITATION_EDIT,children:(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"copy",onClick:async()=>{const{accreditationCategoryDuplicate:{id:t}}=await a({eventId:o,accreditationCategoryId:e.id});n.push(es.ACCREDITATION_CATEGORY({organizationId:s,eventId:o,accreditationCategoryId:t}))},children:r("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{d(!0)},children:r("supprimer_43083")})]})]})}),c&&(0,i.jsx)(VP,{accreditationCategory:e,eventId:o,onClose:()=>{u(!1)},onSuccess:t}),l&&(0,i.jsx)(mN,{accreditationCategory:e,eventId:o,onClose:()=>{d(!1)},onSuccess:()=>{n.replace(es.ACCREDITATIONS({organizationId:s,eventId:o}))}})]})},pN=e=>{const{translate:t,params:{eventId:n,accreditationCategoryId:s}}=_l(),{data:o,loader:r}=Zn("query AccreditationsCategoryAccreditationsReorder(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n event(id: $eventId) {\n accreditationCategory(id: $accreditationCategoryId) {\n name\n\n accreditations {\n id\n name\n index\n }\n }\n }\n}\n",{eventId:n,accreditationCategoryId:s},[]),{mutate:a}=wo(),[l,d]=(0,L.useState)([]),[c,u]=(0,L.useState)(!1),h=(0,L.useCallback)(async()=>{u(!0),await Promise.all(l.map((e,t)=>a({eventId:n,massEdit:{reset:!1,selecteds:{ids:[e.id]},slug:se.Index,strategy:tt.Replace,value:t}}))),e.onClose(),e.onSuccess(),u(!1)},[n,l,u,a,e.onClose,e.onSuccess]),m=(0,L.useCallback)(({reason:e,source:t,destination:n})=>{"DROP"===e&&n&&t.index!==n.index&&d(ro(l,t.index,n.index))},[l,d]);return(0,L.useEffect)(()=>{d(SC(o.event?.accreditationCategory.accreditations??[]))},[o.event,d]),(0,i.jsx)(Pm,{button:(0,i.jsx)(El,{isLoading:c,onClick:h,children:t("enregistrer_06519")}),category:t("liste_des_accr_02647"),heading:t("changer_l_ordre_11550"),onClose:e.onClose,children:r||(0,i.jsxs)($m,{css:{background:"white "},children:[(0,i.jsx)(yr,{font:"gray900 textLg semiBold",children:t("organisation_de_45058")}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsx)(fu.JY,{onDragEnd:m,children:(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$2",boxShadow:"$sm",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(Na,{align:"center",css:{padding:"$4"},gap:"3",children:(0,i.jsx)(yr,{css:{flex:"1"},font:"gray800 textMd medium",children:o.event.accreditationCategory.name})}),(0,i.jsx)(fu.gL,{droppableId:"main",type:"accreditation",children:e=>(0,i.jsxs)(Na,{css:{background:"$gray100",padding:"$4"},direction:"column",gap:"2",...e.droppableProps,ref:e.innerRef,children:[l.map((e,t)=>(0,i.jsx)(fu.sx,{draggableId:`a-${e.id}`,index:t,children:t=>(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",padding:"$3"},gap:"3",...t.draggableProps,ref:t.innerRef,align:"center",children:[(0,i.jsx)(yr,{color:"gray300",css:{cursor:"pointer"},...t.dragHandleProps,children:(0,i.jsx)(el,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 textSm medium",children:e.name})]})},e.id)),e.placeholder]})})]})})]})})},fN=()=>{const{params:{organizationId:e,eventId:t,accreditationCategoryId:n},translate:s}=_l(),[o,r,a]=Bc(""),[l,d]=(0,L.useState)(0),[c,u]=(0,L.useState)({direction:jt.Asc,attribute:ae.Index}),{data:h,isLoading:g,reload:p}=Zn("query AccreditationsCategoryAccreditations(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId\n $name: String\n $offset: Int\n $sort: AccreditationsSort\n) {\n event(id: $eventId) {\n accreditations(\n accreditationCategoryId: $accreditationCategoryId\n name: $name\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n name\n accreditationDisplay\n numberOfSlots\n index\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,accreditationCategoryId:n,name:m(r)?r:void 0,offset:l,sort:c},[]);const{numberOfPages:f,totalCount:x}=ku(h.event?.accreditations),[_,I]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fc,{filters:(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:s("rechercher_une_65646"),value:o,onChange:a})}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:"white",leftIcon:"gear",onClick:()=>I(!0)})}),(0,i.jsx)(Cm,{placement:"top",children:s("changer_l_ordre_11550")})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{attribute:ae.Name,setSort:u,sort:c,children:s("nom_de_l_accr_d_11908")}),(0,i.jsx)(_m,{attribute:ae.Index,setSort:u,sort:c,children:s("Index")}),(0,i.jsx)(Vc,{children:s("number_of_slots_92461")}),(0,i.jsx)(Vc,{children:s("type_d_affichag_55093")})]}),numberOfPages:f,offset:l,rows:g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):0===h.event.accreditations.totalCount?(0,i.jsxs)(Na,{align:"center",css:{border:"1px solid $gray200",borderTop:"none",py:"$8"},direction:"column",gap:"4",children:[(0,i.jsx)(Xj,{color:"primary",icon:"user-group"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:s("no_accreditations")})]}):h.event.accreditations.nodes.map(n=>(0,i.jsxs)(Dc,{css:{userSelect:"none"},children:[(0,i.jsx)(Ec,{css:{fontWeight:"$medium"},children:(0,i.jsx)(qc,{to:es.ACCREDITATION({organizationId:e,eventId:t,accreditationId:n.id}),children:CC(n)})}),(0,i.jsx)(Ec,{children:n.index??"-"}),(0,i.jsx)(Ec,{children:n.numberOfSlots}),(0,i.jsx)(Ec,{children:s(n.accreditationDisplay)})]},n.id)),setOffset:d,title:s("liste_des_accr_02647"),totalCount:x}),_&&(0,Ht.createPortal)((0,i.jsx)(yr,{css:{background:"white",left:"0",position:"absolute",top:"0",zIndex:"200"},height:1,width:1,children:(0,i.jsx)(pN,{onClose:()=>I(!1),onSuccess:p})}),document.body)]})},xN=()=>{const{translate:e,params:{eventId:t,accreditationCategoryId:n}}=_l(),{data:s,loader:o}=Zn("query AccreditationsCategoryChart(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n event(id: $eventId) {\n accreditations(accreditationCategoryId: $accreditationCategoryId) {\n nodes {\n ...AccreditationChart\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,accreditationCategoryId:n},[Ls.AccreditationChartFragment]),[r,a]=(0,L.useState)(),l=(0,L.useMemo)(()=>s.event?.accreditations?.nodes.find(e=>e.id==r),[r]);return o||(0,i.jsx)(jw,{select:(0,i.jsx)(Na,{width:.5,children:(0,i.jsxs)(zu,{value:r??-1,onChange:e=>{a(e)},children:[(0,i.jsx)("option",{disabled:!0,value:-1,children:e("s_lectionner_un_96571")}),s.event.accreditations.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:CC(e)},e.id))]})}),title:e("r_partition_du_55091"),children:(0,i.jsx)(Na,{gap:"4",width:1,children:(0,i.jsx)(yr,{height:380,width:1,children:r&&l?(0,i.jsx)(Jw,{accreditation:l,slots:l.slots}):(0,i.jsx)(Nk,{title:e("vous_allez_retr_26787")})})})})},_N=()=>(0,i.jsx)(ej,{children:(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[(0,i.jsx)(Na,{width:1,children:(0,i.jsx)(xN,{})}),(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(fN,{})})]})}),IN=({event:e,reload:t})=>{const{params:{organizationId:n,eventId:s,accreditationCategoryId:o},translate:r}=_l();Dd(e.accreditationCategory.name);const a=e=>({organizationId:e?":organizationId":n,eventId:e?":eventId":s,accreditationCategoryId:e?":accreditationCategoryId":o});return(0,i.jsxs)(nj,{children:[(0,i.jsx)(gN,{category:e.accreditationCategory,reload:t}),(0,i.jsxs)(rj,{css:{flex:"1"},children:[(0,i.jsxs)(sj,{css:{px:"$7"},children:[(0,i.jsx)(ij,{path:es.ACCREDITATION_CATEGORY_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(ij,{path:es.ACCREDITATION_CATEGORY_MEMBERS(a(!1)),children:r("membres_125561",e.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(oj,{path:es.ACCREDITATION_CATEGORY_DASHBOARD(a(!0)),children:(0,i.jsx)(_N,{})}),(0,i.jsx)(oj,{path:es.ACCREDITATION_CATEGORY_MEMBERS(a(!0)),children:(0,i.jsx)(SM,{accreditationCategoryId:o})})]})]})},vN=()=>{const{params:{organizationId:e,eventId:t,accreditationCategoryId:n}}=_l(),{data:s,loader:o,reload:r}=Zn("query AccreditationsCategory(\n $eventId: EventId!\n $accreditationCategoryId: AccreditationsCategoryId!\n) {\n event(id: $eventId) {\n accreditationCategory(id: $accreditationCategoryId) {\n id\n name\n assignedResources\n }\n\n volunteersRegistrations(accreditationCategoryId: $accreditationCategoryId) {\n totalCount\n }\n }\n}\n",{eventId:t,accreditationCategoryId:n},[]);return o||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:es.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(ni,{path:es.ACCREDITATION_CATEGORY_DASHBOARD({organizationId:e,eventId:t,accreditationCategoryId:n}),replace:!0})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(IN,{event:s.event,reload:r})})]})},bN=e=>{const{params:{organizationId:t,eventId:n,accreditationId:s},translate:o}=_l(),r=qn(Kc),a=(0,L.useMemo)(()=>Oh(r,e.slot,e.slot.accreditation.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:Js.DateOnly.WeekdayLongMonthLong}}),[e.slot]);return(0,i.jsxs)(tj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(bj,{returnPathFallback:es.ACCREDITATIONS({organizationId:t,eventId:n})}),(0,i.jsxs)(yr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:[a,m(e.slot.accreditation.acronym)&&` (${e.slot.accreditation.acronym})`]}),(0,i.jsx)(El,{to:$s.EDIT_ACCREDITATION(t,n,s),children:o("_diter_62574")})]})},jN=e=>{const{params:{organizationId:t,eventId:n,accreditationId:s,accreditationSlotId:o},translate:r}=_l();Dd(Oh(qn(Kc),e.event.accreditationSlot,e.event.accreditationSlot.name));const a=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,accreditationId:e?":accreditationId":s,accreditationSlotId:e?":accreditationSlotId":o});return(0,i.jsxs)(nj,{children:[(0,i.jsx)(bN,{slot:e.event.accreditationSlot}),(0,i.jsxs)(rj,{css:{flex:"1"},children:[(0,i.jsxs)(sj,{css:{px:"$7"},children:[(0,i.jsx)(ij,{path:es.ACCREDITATION_SLOT_DASHBOARD(a(!1)),children:r("tableau_de_bord_24627")}),(0,i.jsx)(ij,{path:es.ACCREDITATION_SLOT_MEMBERS(a(!1)),children:r("membres_125561",e.event.volunteersRegistrations.totalCount)})]}),(0,i.jsx)(oj,{path:es.ACCREDITATION_SLOT_DASHBOARD(a(!0)),children:(0,i.jsx)(ej,{children:(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[(0,i.jsxs)(Na,{gap:"6",width:1,children:[(0,i.jsx)(XF,{assignedResources:e.event.accreditationSlot.assignedResources,maxResources:e.event.accreditationSlot.maxResources}),(0,i.jsx)(qF,{accreditationCategoryId:e.event.accreditationSlot.accreditation.accreditationCategoryId,accreditationCategoryName:e.event.accreditationSlot.accreditation.accreditationCategoryName,accreditationName:e.event.accreditationSlot.accreditation.name,color:e.event.accreditationSlot.accreditation.color,customFields:e.organization.customFields.nodes,fields:e.event.accreditationSlot.accreditation.fields,icon:e.event.accreditationSlot.accreditation.icon})]}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(ZF,{customFields:e.event.accreditationSlot.accreditation.accreditationsCustomFields}),(0,i.jsx)(Pw,{tags:e.event.accreditationSlot.accreditation.tags}),(0,i.jsx)(Ow,{privateNote:e.event.accreditationSlot.accreditation.privateNote})]}),(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(zw,{description:e.event.accreditationSlot.accreditation.description}),(0,i.jsx)(JF,{location:e.event.accreditationSlot.accreditation})]})]})]})})}),(0,i.jsx)(oj,{path:es.ACCREDITATION_SLOT_MEMBERS(a(!0)),children:(0,i.jsx)(SM,{accreditationSlotId:o})})]})]})},CN=()=>{const{params:{organizationId:e,eventId:t,accreditationId:n,accreditationSlotId:s}}=_l(),{data:o,loader:r}=Zn("query AccreditationsSlot(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $accreditationSlotId: AccreditationsSlotId!\n) {\n organization(id: $organizationId) {\n customFields(variety: Accreditation) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n accreditationSlot(id: $accreditationSlotId) {\n id\n name\n date\n assignedResources\n maxResources\n\n accreditation {\n name\n description\n privateNote\n acronym\n icon\n color\n address\n latitude\n longitude\n layer\n zoom\n accreditationCategoryId\n accreditationCategoryName\n fields\n\n accreditationsCustomFields {\n customField {\n name\n fieldType\n\n values {\n id\n value\n }\n }\n\n conditionValue\n }\n\n tags {\n id\n name\n }\n }\n }\n\n volunteersRegistrations(accreditationSlotId: $accreditationSlotId) {\n totalCount\n }\n }\n}\n",{organizationId:e,eventId:t,accreditationSlotId:s},[Ls.CustomFieldWithConditionFragment]);return r||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:es.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(ni,{path:es.ACCREDITATION_SLOT_DASHBOARD({organizationId:e,eventId:t,accreditationId:n,accreditationSlotId:s}),replace:!0})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(jN,{event:o.event,organization:o.organization})})]})},yN=L.createContext({}),kN=e=>{const t=ei(),[n,s]=L.useState(e.positionsIds),[o,r]=L.useState(e.positionsCategoriesIds),[a,l]=L.useState(e.positionsSlotsIds);return(0,i.jsx)(yN.Provider,{value:{isEdit:e.isEdit,isPreAssign:t.pathname.includes("pre-assignment"),positionsIds:n,positionsCategoriesIds:o,positionsSlotsIds:a,showNextVolunteer:e.showNextVolunteer,setPositionsIds:s,setPositionsCategoriesIds:r,setPositionsSlotsIds:l,teams:e.teams},children:e.children})};function AN(){return L.useContext(yN)}const wN=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=_l(),{isPreAssign:r,positionsIds:a,positionsCategoriesIds:l,positionsSlotsIds:d,showNextVolunteer:c}=AN(),{mutate:u,isLoading:h}=Xo(),{mutate:m,isLoading:g}=Ea(),{mutate:p,isLoading:f}=function(e={}){return Xn("mutation VolunteerRegistrationAssignmentRefuse(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n) {\n volunteerRegistrationAssignmentRefuse(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n ) {\n id\n }\n}\n",e)}(),{mutate:x,isLoading:_}=Qo(),I=(0,L.useCallback)(()=>{e.isEdit?t.goBack($s.ASSIGNMENTS(n,s)):c()},[e.isEdit,c]);return(0,i.jsxs)(Na,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(yr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{h||g||f||_||(await p({eventId:s,volunteerRegistrationId:e.volunteerRegistrationId}),I())},children:o("refuser_92819")}),(0,i.jsx)(yr,{css:{flex:"1"}}),(0,i.jsx)(El,{color:"primary",isLoading:h||g,onClick:async()=>{r?(!no(a)||h||g||f||_||(await m({eventId:s,massPreAssign:{level:nt.Positions,positionsIds:a,positionsCategoriesIds:[],selecteds:{ids:[e.userInfoId]},strategy:tt.Replace}}),I()),!no(l)||h||g||f||_||(await m({eventId:s,massPreAssign:{level:nt.Categories,positionsIds:[],positionsCategoriesIds:l,selecteds:{ids:[e.userInfoId]},strategy:tt.Replace}}),I())):h||g||f||_||(no(d)?await u({eventId:s,massAssign:{positionsSlotsIds:d,selecteds:{ids:[e.userInfoId]},strategy:tt.Replace}}):await x({eventId:s,massStateUpdate:{selecteds:{ids:[e.userInfoId]},state:$t.WaitingAssignment}}),I())},children:e.isEdit?o("mettre_jour_l_30423"):o(r?"pr_affecter_17434":"affecter_94255")}),(0,i.jsx)(El,{color:"white",onClick:I,children:e.isEdit?o("annuler_48254"):o("affecter_plus_t_97778")})]})},SN=e=>{const[t,n]=L.useState(e.initialIsOpen);return(0,i.jsxs)(Na,{css:{bd:!0,userSelect:"none",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Na,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsx)(yr,{css:{flex:"1"},children:e.header}),(0,i.jsx)(El,{color:"white",leftIcon:t?"chevron-up":"chevron-down",size:"sm",onClick:()=>{n(!t)}})]}),t&&(0,i.jsx)(Na,{css:{background:"$gray100",padding:"$6"},direction:"column",children:e.children})]})},EN=e=>{const t=Yn(),n=e.assignedResources/e.neededResources;return(0,i.jsxs)(Na,{css:{background:"white",bd:!0,cursor:"pointer",userSelect:"none"},direction:"column",width:1,onClick:e.onClick,children:[(0,i.jsxs)(Na,{align:"center",css:{padding:"$3 $5"},width:1,children:[(0,i.jsx)(mc,{shouldPreventDefault:!1,state:e.isSelected?"checked":"unchecked",onClick:Ql.A}),(0,i.jsx)(qa,{width:"4"}),(0,i.jsx)(FC,{color:e.color,icon:e.icon}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[m(e.category)&&(0,i.jsx)(yr,{color:"gray500",css:{fontSize:"11px",textTransform:"uppercase"},fontWeight:"medium",children:e.category}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(yr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsx)(yr,{color:"gray700",fontSize:"textXs",children:(0,i.jsx)(el,{icon:"user-group"})}),(0,i.jsx)(qa,{width:"2"}),(0,i.jsxs)(yr,{color:"gray700",children:[e.assignedResources,"/",e.neededResources]}),(0,i.jsx)(qa,{width:"6"}),(0,i.jsx)(yr,{width:120,children:(0,i.jsx)(Aw,{percent:n})}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsxs)(yr,{color:"gray700",textAlign:"end",width:36,children:[Math.min(100,Math.round(100*n)),"%"]})]}),(0,i.jsxs)(Na,{css:{borderTop:"1px solid $gray200",padding:"$3 $6","&:empty":{display:"none"}},children:[e.overlaps&&(0,i.jsx)(ic,{color:"warning",leftIcon:"triangle-exclamation",children:t("ce_cr_neau_en_c_55775")}),e.teamMembers]})]})},TN=e=>{const t=Yn(),n=qn(hh),{positionsIds:s,positionsCategoriesIds:o,setPositionsIds:r,setPositionsCategoriesIds:a}=AN(),l=()=>{a(oo(o,e.category.id))};return(0,i.jsx)(SN,{css:{background:"white"},header:(0,i.jsxs)(Na,{align:"center",children:[(0,i.jsx)(mc,{state:o.includes(e.category.id)?"checked":"unchecked",onClick:l}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsx)(yr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textMd",fontWeight:"medium",onClick:l,children:e.category.name}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsx)(ic,{color:"warning",size:"md",children:t("_1_membre_manq_31014",e.category.resources)}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsx)(yr,{css:{flex:"1"}})]}),initialIsOpen:!0,children:(0,i.jsx)(Na,{css:{background:"$gray100"},direction:"column",gap:"2",children:e.category.positions.map(e=>(0,i.jsx)(EN,{assignedResources:e.assignedResources,color:e.color,icon:e.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:!1,subtitle:e.range?n.toDisplayString(e.range):"-",title:e.name,onClick:()=>{r(oo(s,e.id))}},e.id))})})},zN=e=>{const t=Yn(),n=(0,L.useMemo)(()=>function(e,t,n,i,s,o){const{wishedPositionsSlots:r,possiblePositionsSlots:a,otherPositionsSlots:l}=yh(e,t,n,i,s,o),d=new Set,c=e=>Object.values((0,ac.A)(e,e=>e.positionCategory.id)).flatMap(e=>{const t=Object.values((0,ac.A)(e,e=>e.position.id)).flatMap(e=>{const t=e[0].position;return d.has(t.id)?[]:(d.add(t.id),t)});return 0===t.length?[]:[{...e[0].positionCategory,positions:t}]});return{wishedPositionsCategories:c(r),possiblePositionsCategories:c(a),otherPositionsCategories:c(l)}}(e.positionsSlots,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges,e.userInfo.fields),[e.positionsSlots,e.userInfo,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("cat_gorie_mis_36044",n.wishedPositionsCategories.length)}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("cat_gories_ou_m_71206")}),(0,i.jsx)(qa,{height:"3"}),n.wishedPositionsCategories.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(TN,{category:e}),(0,i.jsx)(qa,{height:"3"})]},e.id)),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("autre_cat_gorie_21569",n.possiblePositionsCategories.length)}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("cat_gories_ou_m_50063")}),(0,i.jsx)(qa,{height:"3"}),n.possiblePositionsCategories.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(TN,{category:e}),(0,i.jsx)(qa,{height:"3"})]},e.id)),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("autre_cat_gorie_64824",n.otherPositionsCategories.length)}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("cat_gories_ou_m_74482")}),(0,i.jsx)(qa,{height:"3"}),n.otherPositionsCategories.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(TN,{category:e}),(0,i.jsx)(qa,{height:"3"})]},e.id))]})},ON=e=>{const{translate:t}=_l(),{isPreAssign:n,teams:s}=AN(),o=(0,L.useMemo)(()=>!n&&no(s)?s.flatMap(t=>t.members.flatMap(t=>t.positionsSlotsUsersInfos.map(e=>e.positionSlotId).includes(e.positionSlotId)?[t.userInfo]:[])):[],[n,s,e.positionSlotId]);return no(o)?(0,i.jsxs)(Na,{align:"center",css:{marginLeft:"auto"},gap:"1",children:[(0,i.jsx)(fk,{teamMembers:o}),(0,i.jsx)(yr,{font:"gray800 textXs regular",children:t("_1_quipier_es_00024",o.length)})]}):null},RN=(e,t)=>{const n={weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"};return m(t.name)?`${t.name} - ${e.toLocaleString(t.range,void 0,n)}`:e.toLocaleString(t.range,void 0,n)},$N=e=>{const t=Yn(),n=qn(hh),{positionsSlotsIds:s,setPositionsSlotsIds:o}=AN(),r=(0,L.useMemo)(()=>e.positionsSlots.filter(t=>e.state===$t.Assigned&&s.includes(t.id)),[e.state]),{wishedPositionsSlots:a,possiblePositionsSlots:l,otherPositionsSlots:d}=(0,L.useMemo)(()=>{const t=yh(e.positionsSlots,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges,e.userInfo.fields),n=r.map(e=>e.id);return{wishedPositionsSlots:t.wishedPositionsSlots.filter(e=>!n.includes(e.id)),possiblePositionsSlots:t.possiblePositionsSlots.filter(e=>!n.includes(e.id)),otherPositionsSlots:t.otherPositionsSlots.filter(e=>!n.includes(e.id))}},[e.positionsSlots,e.userInfo,e.wishedPositionsCategoriesIds,e.wishedPositionsIds,e.wishedPositionsSlotsIds,e.wishedRanges]),c=(0,L.useMemo)(()=>{const e=a.concat(l).concat(d);return s.flatMap(t=>{const n=e.find(e=>e.id===t);return n?[n]:[]})},[a,l,d,s]);return(0,i.jsxs)(i.Fragment,{children:[e.state===$t.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("cr_neau_affect_50400",r.length)}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("cr_neaux_sur_le_05515",e.userInfo.name)}),(0,i.jsx)(qa,{height:"3"}),r.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(EN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:bh(e,c),subtitle:RN(n,e),teamMembers:(0,i.jsx)(ON,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(oo(s,e.id))}}),(0,i.jsx)(qa,{height:"3"})]},e.id)),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("creneau_souhaite",a.length)}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("cr_neaux_dont_l_10130")}),(0,i.jsx)(qa,{height:"3"}),a.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(EN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:bh(e,c),subtitle:RN(n,e),teamMembers:(0,i.jsx)(ON,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(oo(s,e.id))}}),(0,i.jsx)(qa,{height:"3"})]},e.id)),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("autre_creneau_possible",l.length)}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("cr_neaux_dont_l_99850")}),(0,i.jsx)(qa,{height:"3"}),l.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(EN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:bh(e,c),subtitle:RN(n,e),teamMembers:(0,i.jsx)(ON,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(oo(s,e.id))}}),(0,i.jsx)(qa,{height:"3"})]},e.id)),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{font:"gray900 textMd medium",children:t("autre_creneau",d.length)}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("cr_neaux_dont_l_25685")}),(0,i.jsx)(qa,{height:"3"}),d.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(EN,{assignedResources:e.assignedResources,category:e.positionCategory.name,color:e.position.color,icon:e.position.icon,isSelected:s.includes(e.id),neededResources:e.resources,overlaps:bh(e,c),subtitle:RN(n,e),teamMembers:(0,i.jsx)(ON,{positionSlotId:e.id}),title:e.position.name,onClick:()=>{o(oo(s,e.id))}}),(0,i.jsx)(qa,{height:"3"})]},e.id))]})},DN=e=>{const t=Yn(),n=qn(Kc),s=(0,L.useMemo)(()=>(e.positionsCategoriesIds||[]).map(t=>e.event.positionsCategories.find(e=>e.id===t).name).join(", "),[e.positionsCategoriesIds,e.event]),o=(0,L.useMemo)(()=>(e.positionsIds||[]).map(t=>e.event.positions.nodes.find(e=>e.id===t).name).join(", "),[e.positionsIds,e.event]),r=(0,L.useMemo)(()=>e.date?n.toLocaleString(e.date,Js.DateOnly.MonthLong):"",[e.date]),a=(0,L.useMemo)(()=>e.segmentId?e.event.segments.find(t=>t.id===e.segmentId).name:"",[e.segmentId,e.event]),l=(0,L.useMemo)(()=>(e.tagsIds||[]).map(t=>e.organization.tags.nodes.find(e=>e.id===t).name).join(", "),[e.tagsIds,e.organization]);return m(s)||m(o)||m(r)||m(a)||m(l)||e.excludeFull||e.excludePast?(0,i.jsxs)(Na,{align:"center",gap:"3",wrap:"wrap",children:[m(s)&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsCategoriesIds(null)},children:t("cat_gories_1_42029",s)}),m(o)&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setPositionsIds(null)},children:t("missions_1_62834",o)}),m(r)&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setDate(null)},children:t("date_1_17337",r)}),m(a)&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setSegmentId(null)},children:t("vue_1_29260",a)}),m(l)&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setTagsIds(null)},children:t("tags_1_43158",l)}),e.excludeFull&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludeFull(!1)},children:t("cr_neaux_comple_77561")}),e.excludePast&&(0,i.jsx)(ic,{color:"white",rightIcon:"xmark",onRightIconClick:()=>{e.setExcludePast(!1)},children:t("cr_neaux_dans_l_92999")}),(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textXs medium",onClick:e.reset,children:t("r_initialiser_l_66835")})]}):null},PN=e=>{const t=Yn(),[n,s]=(0,L.useState)(e.positionsCategoriesIds),[o,r]=(0,L.useState)(e.positionsIds),[a,l]=(0,L.useState)(e.date),[d,c]=(0,L.useState)(e.segmentId?[e.segmentId]:[]),[u,h]=(0,L.useState)(e.tagsIds),[m,g]=(0,L.useState)(e.excludeFull?"checked":"unchecked"),[p,f]=(0,L.useState)(e.excludePast?"checked":"unchecked");return(0,i.jsxs)(Na,{direction:"column",onChange:Rl,children:[(0,i.jsxs)(Na,{css:{padding:"$2 $6 $4 $6"},direction:"column",gap:"4",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_97056"),renderOnPortal:!0,values:n||[],onChange:s,children:e.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_71859"),renderOnPortal:!0,values:o||[],onChange:r,children:e.event.positions.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(Du,{max:e.event.endAt,min:e.event.startAt,placeholder:t("date_du_cr_neau_82295"),value:a,onChange:l}),(0,i.jsx)(bc,{isSearchVisible:!0,placeholder:t("s_lectionnez_un_19794"),renderOnPortal:!0,values:d,onChange:e=>{no(e)?c([(0,ou.A)(e)]):c([])},children:e.event.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,placeholder:t("s_lectionnez_de_73255"),renderOnPortal:!0,values:u||[],onChange:h,children:e.organization.tags.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(gc,{state:m,onClick:g,children:t("masquer_les_cr_14425")}),(0,i.jsx)(gc,{state:p,onClick:f,children:t("masquer_les_cr_05336")})]}),(0,i.jsxs)(Na,{align:"center",css:{borderTop:"1px solid $gray200",padding:"$4 $6 $2 $6"},gap:"4",justify:"end",children:[(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{e.reset(),e.close()},children:t("r_initialiser_77538")}),(0,i.jsx)(El,{size:"sm",onClick:()=>{e.setDate(a),e.setExcludeFull("checked"===m),e.setExcludePast("checked"===p),e.setPositionsCategoriesIds(n),e.setPositionsIds(o),e.setSegmentId(no(d)?d[0]:null),e.setTagsIds(u),e.close()},children:t("appliquer_05753")})]})]})},FN=e=>{const t=Yn(),[n,s]=(0,L.useState)(!1),o=(0,L.useCallback)(()=>{e.setDate(null),e.setExcludeFull(!1),e.setExcludePast(!1),e.setPositionsCategoriesIds(null),e.setPositionsIds(null),e.setSegmentId(null),e.setTagsIds(null)},[e.setDate,e.setExcludeFull,e.setExcludePast,e.setPositionsCategoriesIds,e.setPositionsIds,e.setSegmentId,e.setTagsIds]);return(0,i.jsxs)(Na,{direction:"column",gap:"3",width:1,children:[(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_p_70410"),value:e.name,onChange:e.setName}),(0,i.jsxs)(Bd,{doNotCloseOnOtherOpen:!0,isOpen:n,onStateChange:s,children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"bars-filter",children:t("filtres_64574")})})}),(0,i.jsx)(qd,{placement:"bottom-end",width:385,children:(0,i.jsx)(PN,{...e,close:()=>{s(!1)},reset:o})})]})]}),(0,i.jsx)(DN,{...e,reset:o})]})},MN=e=>{const{eventId:t}=Jn(),{isPreAssign:n}=AN(),[s,o,r]=Bc(""),[a,l]=xz("assignment.filters.positionsCategoriesIds",null),[d,c]=xz("assignment.filters.positionsIds",null),[u,h]=xz("assignment.filters.date",null),[g,p]=xz("assignment.filters.tagsIds",null),[f,x]=xz("assignment.filters.segmentId",null),[_,I]=xz("assignment.filters.excludeFull",!1),[v,b]=xz("assignment.filters.excludePast",!1),{data:j,loader:C}=Zn("query AssignmentSlots(\n $eventId: EventId!\n $name: String\n $positionsCategoriesIds: [PositionsCategoryId!]\n $positionsIds: [PositionId!]\n $date: Date\n $tagsIds: [TagId!]\n $segmentId: SegmentId\n $excludeFull: Boolean\n $excludePast: Boolean\n) {\n event(id: $eventId) {\n positionsSlots(\n positionName: $name\n positionsCategoriesIds: $positionsCategoriesIds\n positionsIds: $positionsIds\n date: $date\n tagsIds: $tagsIds\n segmentId: $segmentId\n excludeFull: $excludeFull\n excludePast: $excludePast\n ) {\n nodes {\n id\n name\n range\n assignedResources\n resources\n\n positionCategory {\n id\n name\n resources\n }\n\n position {\n id\n name\n color\n icon\n assignedResources\n resources\n range\n\n ...PositionPositionsCustomFields\n }\n }\n }\n }\n}\n",{eventId:t,name:m(o)?o:void 0,positionsCategoriesIds:no(a)?a:void 0,positionsIds:no(d)?d:void 0,date:u,tagsIds:no(g)?g:void 0,segmentId:f,excludeFull:_,excludePast:v},[Ls.PositionPositionsCustomFieldsFragment]);return(0,i.jsxs)(Na,{css:{background:"$gray50",minHeight:"100%",padding:"$6 $7"},direction:"column",width:1,children:[(0,i.jsx)(FN,{date:u,event:e.event,excludeFull:_,excludePast:v,name:s,organization:e.organization,positionsCategoriesIds:a,positionsIds:d,segmentId:f,setDate:h,setExcludeFull:I,setExcludePast:b,setName:r,setPositionsCategoriesIds:l,setPositionsIds:c,setSegmentId:x,setTagsIds:p,tagsIds:g}),(0,i.jsx)(qa,{height:"7"}),C||(n?(0,i.jsx)(zN,{positionsSlots:j.event?.positionsSlots.nodes??[],userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}):(0,i.jsx)($N,{positionsSlots:j.event?.positionsSlots.nodes??[],state:e.state,userInfo:e.userInfo,wishedPositionsCategoriesIds:e.wishedPositionsCategoriesIds,wishedPositionsIds:e.wishedPositionsIds,wishedPositionsSlotsIds:e.wishedPositionsSlotsIds,wishedRanges:e.wishedRanges}))]})},NN=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,userInfoId:r}}=_l(),a=ei().pathname.includes("pre-assignment"),{isEventAdmin:l}=vb();Dd(n("affectations_1_71402",e.event.volunteerRegistration.userInfo.name));const[d,c]=xz("assignment.isLeftPanelOpen",!0),[u,h]=xz("assignment.isRightPanelOpen",!0),[g,p,f]=Bc(""),[x,_]=xz("assignment.leftPanelDirection",jt.Desc),[I,v]=xz("assignment.leftPanelSegmentId",-1),[b,j]=xz("assignment.leftPanelStates",[$t.WaitingAssignment,$t.PreAssigned]),{data:C,isLoading:y}=bo({eventId:o,states:b,name:m(p)?p:void 0,segmentId:-1===I?void 0:I,direction:x,loadDelegations:!1}),k=(0,L.useCallback)(()=>{const e=C.event?.volunteersRegistrations.nodes??[],n=e.findIndex(e=>e.userInfo.id===r),i=e[n+1]?.userInfo.id??e[0].userInfo.id;i===r?t.goBack($s.ASSIGNMENTS(s,o)):a?t.replace($s.PRE_ASSIGNMENT(s,o,i)):t.replace($s.ASSIGNMENT(s,o,i))},[a,s,o,r,C.event]),A=e.event.volunteerRegistration,w=(0,L.useMemo)(()=>A.positionsSlotsUsersInfos.map(({positionSlotId:e})=>e),[A]),S=(0,L.useMemo)(()=>({wishedPositionsCategoriesIds:A.positionsCategories.map(({id:e})=>e),wishedPositionsIds:A.positions.map(({id:e})=>e),wishedPositionsSlotsIds:A.positionsSlots.map(({id:e})=>e),wishedRanges:A.slots.map(({range:e})=>e)}),[A]);return(0,i.jsx)(kN,{isEdit:e.isEdit,positionsCategoriesIds:A.preassignPositionsCategoriesIds,positionsIds:A.preassignPositionsIds,positionsSlotsIds:w,showNextVolunteer:k,teams:A.teams,children:(0,i.jsx)(zM,{buttons:(0,i.jsx)(wN,{isEdit:e.isEdit,userInfoId:A.userInfo.id,volunteerRegistrationId:A.id}),header:(0,i.jsx)(OM,{badgeColorIcon:fj(A.state),insertedAt:A.insertedAt,isPreAssign:a,showTabs:l,showTeam:!0,teams:A.teams,userInfo:A.userInfo}),isEdit:e.isEdit,isLeftPanelOpen:d,isRightPanelOpen:u,leftPanel:(0,i.jsx)(DM,{accreditationStates:[],delegationId:null,direction:x,event:C.event,getPath:e=>a?$s.PRE_ASSIGNMENT(s,o,e):$s.ASSIGNMENT(s,o,e),isLoading:y,loadDelegations:!1,name:g,segmentId:I,setAccreditationStates:Ql.A,setDelegationId:Ql.A,setDirection:_,setName:f,setSegmentId:v,setStates:j,showAccreditationStates:!1,showStates:!0,states:b,userInfoId:A.userInfoId}),rightPanel:(0,i.jsx)(UM,{customFields:e.event.formsCustomsFields,eventId:o,formsUsersInfos:e.organization.userInfo.formsUsersInfos,organizationId:s,showWishedAccreditations:!1,showWishedPositions:!0,userInfo:e.event.volunteerRegistration.userInfo,onCollapse:()=>{h(!1)}}),setIsLeftPanelOpen:c,setIsRightPanelOpen:h,children:(0,i.jsx)(MN,{event:e.event,organization:e.organization,state:A.state,userInfo:A.userInfo,...S})})})},LN=e=>{const{organizationId:t,eventId:n,userInfoId:s}=Jn(),{data:o,loader:r}=Zn("query AssignmentInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n\n userInfo(id: $userInfoId) {\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n positionsCategories {\n id\n name\n }\n\n positions {\n nodes {\n id\n name\n }\n }\n\n segments(segmentType: Positions) {\n id\n name\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n userInfoId\n state\n preassignPositionsIds\n preassignPositionsCategoriesIds\n isTeamMember\n insertedAt\n\n teams {\n leaderUserInfoId\n teamCode\n\n members {\n positionsSlotsUsersInfos {\n positionSlotId\n }\n\n userInfo {\n ...UserInfoTeamMember\n }\n }\n }\n\n userInfo {\n id\n name\n email\n fields\n picture {\n url\n }\n }\n\n positionsCategories {\n id\n }\n\n positions {\n id\n }\n\n positionsSlots {\n id\n }\n\n slots: slotsMerged {\n range\n }\n\n positionsSlotsUsersInfos {\n positionSlotId\n }\n }\n }\n}\n",{organizationId:t,eventId:n,userInfoId:s},[Ls.FormsUsersInfosWishedFragment,Ls.CustomFieldWithConditionFragment,Ls.UserInfoTeamMemberFragment]);return r||(0,i.jsx)(NN,{event:o.event,isEdit:e.isEdit,organization:o.organization})},BN=e=>{const t=Yn(),{mutate:n,isLoading:s}=function(e={}){return Xn("mutation SendAssignmentsEmails(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsSend(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}();return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xj,{color:"warning",css:{margin:"auto"},icon:"triangle-exclamation"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",textAlign:"center",children:t("_tes_vous_sur_d_58206",e.numberOfEmails)}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("les_membres_pr_53976")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{isLoading:s,onClick:async()=>{await n({eventId:e.eventId,sendAssignmentsEmails:e.sendAssignmentsEmails}),e.reload(),e.onClose()},children:t("confirmer_l_env_08749")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},VN=e=>{const t=Yn(),[n,s,o]=Bc(""),[r,a]=(0,L.useState)([]),{data:l}=Gr({eventId:e.eventId,usersInfosIds:r,name:m(s)?s:void 0}),{mutate:d,isLoading:c}=function(e={}){return Xn("mutation AssignmentsEmailsEstimate(\n $eventId: EventId!\n $sendAssignmentsEmails: SendAssignmentsEmailsInput!\n) {\n eventAssignmentsEmailsEstimate(eventId: $eventId, sendAssignmentsEmails: $sendAssignmentsEmails)\n}\n",e)}(),[u,h]=(0,L.useState)(de.Everyone),g=(0,L.useMemo)(()=>(0,ph.A)((l.event?.volunteersRegistrations.nodes??[]).concat(l.event?.selectedVolunteersRegistrations.nodes??[]),e=>e.id),[l.event]),[p,f]=(0,L.useState)([]),x=u===de.Everyone||u===de.Assigned||u===de.Refused||u===de.Members&&no(r)||u===de.Segments&&no(p),_=!(!e.emailSender||e.emailSender.isValidToSendEmail);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Xj,{color:"purple",css:{margin:"auto"},icon:"paper-plane"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("envoi_des_e_mai_81363")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("personnaliser_v_78340")}),(0,i.jsx)(qa,{height:"7"}),_&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sl,{color:"error",leftIcon:"circle-exclamation",children:t("vous_ne_pouvez_69435")}),(0,i.jsx)(qa,{height:"4"})]}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("que_souhaitez_v_01732")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(xc,{state:u===de.Everyone?"checked":"unchecked",onClick:()=>{h(de.Everyone)},children:t("tous_les_e_mail_39319")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:u===de.Assigned?"checked":"unchecked",onClick:()=>{h(de.Assigned)},children:t("tous_les_e_mail_42685")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:u===de.Refused?"checked":"unchecked",onClick:()=>{h(de.Refused)},children:t("tous_les_e_mail_41162")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:u===de.Members?"checked":"unchecked",onClick:()=>{h(de.Members)},children:t("_certains_memb_91094")}),u===de.Members&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,searchElement:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:n,onChange:o}),values:r,onChange:a,children:g.map(e=>(0,i.jsx)("option",{value:e.userInfo.id,children:e.userInfo.nameOrEmail},e.userInfo.id))})})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:u===de.Segments?"checked":"unchecked",onClick:()=>{h(de.Segments)},children:t("uniquement_ce_54026")}),u===de.Segments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(yr,{css:{paddingLeft:"$6"},children:(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,values:p,onChange:f,children:(l.event?.segments??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{disabled:_,isLoading:c,onClick:async()=>{if(x){const t={recipients:u,segmentsIds:p,usersInfosIds:r},{eventAssignmentsEmailsEstimate:n}=await d({eventId:e.eventId,sendAssignmentsEmails:t});e.onSuccess(n,t),e.onClose()}},children:t("envoyer_les_e_m_37846")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},UN=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=_l(),{localEvent:o,setNumberOfWaitingAssigments:r}=vb(),{data:a,loader:l,reload:d}=Zn('query AssignmentsKpis(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $direction: SortDirection!\n) {\n organization(id: $organizationId) {\n emailTemplate(emailType: Assignments, eventId: $eventId) {\n emailSender {\n isValidToSendEmail\n }\n }\n }\n\n event(id: $eventId) {\n hasFormWithTeamsAllowed\n\n emailsStats(emailTypes: [Assignments, Refused]) {\n numberOfClick\n numberOfOpen\n numberOfSent\n numberOfWaiting\n }\n\n waitingAssignment: volunteersRegistrations(\n states: [PreAssigned, WaitingAssignment]\n limit: 1\n sort: { attribute: "InsertedAt", direction: $direction }\n ) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n\n assigned: volunteersRegistrations(\n states: [Assigned]\n limit: 1\n sort: { attribute: "InsertedAt", direction: $direction }\n ) {\n totalCount\n }\n\n waitingTeams: teams(state: WaitingAssignment, limit: 1) {\n nodes {\n teamCode\n }\n\n totalCount\n }\n }\n}\n',{organizationId:n,eventId:s,direction:o?.["assignment.leftPanelDirection"]??jt.Desc},[]);const c=Mc(),[u,h,g]=Bc(""),[p,f]=(0,L.useState)(""),[x,_]=(0,L.useState)(0),{data:I,isLoading:v,reload:b}=function(e){return Zn("query AssignmentsEmails($eventId: EventId!, $name: String, $state: EmailState, $offset: Int) {\n event(id: $eventId) {\n emails(\n emailTypes: [Assignments, Refused]\n name: $name\n state: $state\n limit: 25\n offset: $offset\n ) {\n nodes {\n ...EmailRecipient\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",e,[Ls.EmailRecipientFragment])}({eventId:s,name:m(h)?h:void 0,state:""!==p?p:void 0,offset:x}),[j,C]=(0,L.useState)(!1),[y,k]=(0,L.useState)(null),[A,w]=(0,L.useState)(0),[S,E]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{a.event?.waitingAssignment&&r(a.event.waitingAssignment.totalCount)},[a]),l||(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("mes_affectation_73224")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsx)(sS,{button:(0,i.jsxs)(i.Fragment,{children:[a.event.hasFormWithTeamsAllowed&&(0,i.jsx)(El,{color:"invisible",disabled:0===a.event.waitingTeams.totalCount,onClick:()=>{e.push($s.TEAM_ASSIGNMENT(n,s,a.event.waitingTeams.nodes[0].teamCode))},children:t("affecter_les_q_17322")}),(0,i.jsx)(El,{disabled:0===a.event.waitingAssignment.totalCount,onClick:()=>{e.push($s.ASSIGNMENT(n,s,a.event.waitingAssignment.nodes[0].userInfoId))},children:t("affecter_les_me_77160")})]}),icon:"arrow-trend-up",iconColor:"success",text:t("membre_en_atten_84228",a.event.waitingAssignment.totalCount),value:a.event.waitingAssignment.totalCount}),(0,i.jsx)(sS,{button:(0,i.jsx)(El,{onClick:()=>{C(!0)},children:t("param_trer_et_e_31095")}),icon:"at",iconColor:"success",text:t("e_mail_de_confi_84099",a.event.emailsStats.numberOfWaiting),value:a.event.emailsStats.numberOfWaiting}),(0,i.jsx)(sS,{button:(0,i.jsx)(El,{onClick:()=>{e.push($s.VOLUNTEERS(n,s))},children:t("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:t("membre_affect_05484",a.event.assigned.totalCount),value:a.event.assigned.totalCount})]}),(0,i.jsx)(qa,{height:"9"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("historique_des_68195")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsx)(sS,{icon:"paper-plane",iconColor:"purple",text:t("nombre_d_envois_95106"),value:a.event.emailsStats.numberOfSent??0}),(0,i.jsx)(sS,{icon:"eye",iconColor:"success",text:t("nombre_d_ouvert_84187"),value:a.event.emailsStats.numberOfOpen??0}),(0,i.jsx)(sS,{icon:"hand-pointer",iconColor:"primary",text:t("nombre_de_clics_64232"),value:a.event.emailsStats.numberOfClick??0})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{value:p,onChange:e=>{f(e),_(0)},children:[(0,i.jsx)("option",{value:"",children:t("tous_les_status_67644")}),c(an.filter(e=>e!==Te.Queued))]})}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_d_02329"),value:u,onChange:e=>{g(e),_(0)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:t("nom_du_membre_69353")}),(0,i.jsx)(Vc,{children:t("date_d_envoi_74668")}),(0,i.jsx)(Vc,{children:t("status_06428")}),(0,i.jsx)(Vc,{width:100})]}),numberOfPages:I.event?.emails.numberOfPages??0,offset:x,rows:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):no(I.event.emails.nodes)?(0,i.jsx)(i.Fragment,{children:I.event.emails.nodes.map(e=>(0,i.jsx)(mj,{email:e,emailType:Oe.Assignments,reload:b},e.id))}):(0,i.jsx)(jk,{subtitle:t("vous_n_avez_pas_92612"),title:t("aucun_courriel_12121")}),setOffset:_,title:t("liste_des_envoi_52697"),totalCount:I.event?.emails.totalCount??0}),j&&(0,i.jsx)(VN,{emailSender:a.organization.emailTemplate?.emailSender,eventId:s,onClose:()=>{C(!1)},onSuccess:(e,t)=>{w(e),k(t),E(!0)}}),S&&(0,i.jsx)(BN,{eventId:s,numberOfEmails:A,reload:d,sendAssignmentsEmails:y,onClose:()=>{E(!1)}})]})},WN=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=_l(),{localEvent:o}=vb(),{data:r,loader:a}=Zn('query PreAssignmentsKpis($eventId: EventId!, $direction: SortDirection!) {\n event(id: $eventId) {\n preAssigneds: volunteersRegistrations(\n states: [PreAssigned]\n limit: 1\n sort: { attribute: "InsertedAt", direction: $direction }\n ) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n }\n}\n',{eventId:s,direction:o?.["assignment.leftPanelDirection"]??jt.Desc},[]);return a||(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:t("mes_affectation_73224")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{gap:"6",children:(0,i.jsx)(sS,{button:(0,i.jsx)(El,{disabled:0===r.event.preAssigneds.totalCount,onClick:()=>{e.push($s.ASSIGNMENT(n,s,r.event.preAssigneds.nodes[0].userInfoId))},children:t("affecter_les_me_77160")}),icon:"arrow-trend-up",iconColor:"success",text:t("membre_en_atten_84228",r.event.preAssigneds.totalCount),value:r.event.preAssigneds.totalCount})})]})},GN=()=>{const{translate:e,params:{eventId:t}}=_l(),{event:{name:n},hasPermission:s,updateLocalEvent:o}=vb(),r=s(Nb.MEMBER_ASSIGN,{eventId:t});return Dd(`${n} ${e("mes_affectation_73224")}`),(0,L.useEffect)(()=>{(async()=>{await Promise.all([o({"assignment.filters.positionsCategoriesIds":null}),o({"assignment.filters.positionsIds":null}),o({"assignment.filters.date":null}),o({"assignment.filters.tagsIds":null}),o({"assignment.filters.segmentId":null}),o({"assignment.filters.excludeFull":!1})])})()},[]),r?(0,i.jsx)(UN,{}):(0,i.jsx)(WN,{})},HN=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,teamCode:r}}=_l(),a=r===e.team.teamCode,[l,d]=(0,L.useState)(a);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{background:a?"$primary100":"white",borderBottom:l?"none":"1px solid $gray200",cursor:"pointer",padding:"$4","&:hover":{background:"$primary100"}},gap:"4",onClick:()=>{t.push($s.TEAM_ASSIGNMENT(s,o,e.team.teamCode))},children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:e.team.teamCode}),(0,i.jsx)(yr,{color:"gray500",children:n("_1_membre_49737",e.team.members.length)})]}),(0,i.jsx)(yr,{color:"gray900",css:{cursor:"pointer",padding:"$2"},fontSize:"textMd",onClick:e=>{Rl(e),d(!l)},children:(0,i.jsx)(el,{icon:l?"chevron-down":"chevron-right"})})]}),l&&e.team.members.map((n,r)=>(0,i.jsx)(RM,{displayBorder:r===e.team.members.length-1,isSelected:a,vr:n,onClick:()=>{t.push($s.TEAM_ASSIGNMENT(s,o,e.team.teamCode))}},n.userInfo.id))]})},qN=e=>{const{params:{organizationId:t,eventId:n,teamCode:s},translate:o}=_l(),r=e.event?.teams.totalCount??0,a=e.event?.teams.nodes??[];return(0,i.jsxs)(Na,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Na,{css:{padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(bj,{color:"primary",returnPathFallback:$s.TEAM_ASSIGNMENT(t,n,s),children:o("retour_92202")}),(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{font:"gray900 textLg medium",children:o("affectation_plural")}),(0,i.jsx)(ic,{color:"error",size:"sm",children:o("_1_quipe_rest_49090",r)})]})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Na,{css:{flex:"1",overflowY:"auto"},direction:"column",children:e.isLoading?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($M,{}),(0,i.jsx)($M,{}),(0,i.jsx)($M,{})]}):a.map(e=>(0,i.jsx)(HN,{team:e},e.teamCode))})]})},YN=()=>{const{translate:e,params:{eventId:t,teamCode:n}}=_l(),{positionsSlotsIds:s,showNextVolunteer:o}=AN(),{mutate:r,isLoading:a}=function(e={}){return Xn("mutation TeamAssignmentRefuse($eventId: EventId!, $teamCode: TeamCode!) {\n teamAssignmentRefuse(eventId: $eventId, teamCode: $teamCode)\n}\n",e)}(),{mutate:l,isLoading:d}=function(e={}){return Xn("mutation TeamAssign($eventId: EventId!, $teamCode: TeamCode!, $assignment: AssignmentInput!) {\n teamAssign(eventId: $eventId, teamCode: $teamCode, assignment: $assignment)\n}\n",e)}();return(0,i.jsxs)(Na,{align:"center",css:{borderTop:"1px solid $gray200",px:"$7"},gap:"4",height:1,width:1,children:[(0,i.jsx)(yr,{color:"error700",css:{cursor:"pointer"},onClick:async()=>{d||a||(await r({eventId:t,teamCode:n}),o())},children:e("refuser_l_quip_29246")}),(0,i.jsx)(yr,{css:{flex:"1"}}),(0,i.jsx)(El,{color:"primary",isLoading:d,onClick:async()=>{d||a||(await l({eventId:t,teamCode:n,assignment:{positionsSlotsIds:s}}),o())},children:e("affecter_l_qui_23291")}),(0,i.jsx)(El,{color:"white",onClick:o,children:e("affecter_l_qui_37763")})]})},KN=e=>{const t=Yn();return(0,i.jsx)(Na,{align:"center",css:{padding:"$5 $6"},gap:"4",children:(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(yr,{font:"gray900 textXl medium",children:e.team.teamCode}),(0,i.jsx)(yr,{color:"gray500",children:t("_1_membre_49737",e.team.members.length)})]})})},ZN=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),o=(0,L.useMemo)(()=>e.team.leaderUserInfo.formsUsersInfos.filter(t=>t.form.id===e.team.formId),[e.team]);return(0,i.jsxs)(Na,{direction:"column",height:1,width:1,children:[(0,i.jsxs)(Na,{align:"center",css:{padding:"$6"},gap:"3",children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"gray800",css:{cursor:"pointer"},fontSize:"textLg",onClick:e.onCollapse,children:(0,i.jsx)(el,{icon:"sidebar"})})}),(0,i.jsx)(Cm,{placement:"top",children:t("cacher_les_info_67266")})]}),(0,i.jsx)(yr,{font:"gray900 textMd semiBold",children:t("_propos_de_l_47506")})]}),e.team.members.map(n=>(0,i.jsx)(LM,{customFields:e.customFields,formsIds:[e.team.formId],title:t("informations_de_63884",n.userInfo.nameOrEmail),userInfo:n.userInfo},n.id)),(0,i.jsx)(BM,{eventId:s,formsUsersInfos:o,organizationId:n}),(0,i.jsx)(VM,{formsUsersInfos:o})]})},XN=e=>{const{history:t,params:{organizationId:n,eventId:s,teamCode:o}}=_l(),[r,a]=xz("assignment.isLeftPanelOpen",!0),[l,d]=xz("assignment.isRightPanelOpen",!0),{data:c,isLoading:u}=Zn("query TeamAssignmentWaitingTeams($eventId: EventId!) {\n event(id: $eventId) {\n teams(state: WaitingAssignment) {\n nodes {\n teamCode\n\n members {\n ...VolunteerRegistrationWaitingAssignment\n }\n }\n\n totalCount\n }\n }\n}\n",{eventId:s},[Ls.VolunteerRegistrationWaitingAssignmentFragment]),h=(0,L.useCallback)(()=>{const e=c.event?.teams.nodes??[],i=e.findIndex(e=>e.teamCode===o),r=e[i+1]?.teamCode??e[0].teamCode;r===o?t.goBack($s.ASSIGNMENTS(n,s)):t.replace($s.TEAM_ASSIGNMENT(n,s,r))},[n,s,o,c.event]),m=e.event.team,g=(0,L.useMemo)(()=>({wishedPositionsCategoriesIds:m.positionsCategoriesIds,wishedPositionsIds:m.positionsIds,wishedPositionsSlotsIds:m.positionsSlotsIds,wishedRanges:m.slots.map(({range:e})=>e)}),[m]);return(0,i.jsx)(kN,{isEdit:!1,positionsCategoriesIds:[],positionsIds:[],positionsSlotsIds:[],showNextVolunteer:h,teams:[],children:(0,i.jsx)(zM,{buttons:(0,i.jsx)(YN,{}),header:(0,i.jsx)(KN,{team:m}),isEdit:!1,isLeftPanelOpen:r,isRightPanelOpen:l,leftPanel:(0,i.jsx)(qN,{event:c.event,isLoading:u}),rightPanel:(0,i.jsx)(ZN,{customFields:e.event.formsCustomsFields,team:m,onCollapse:()=>{d(!1)}}),setIsLeftPanelOpen:a,setIsRightPanelOpen:d,children:(0,i.jsx)(MN,{event:e.event,organization:e.organization,state:$t.NotApplicable,userInfo:m.leaderUserInfo,...g})})})},JN=()=>{const{params:{organizationId:e,eventId:t,teamCode:n}}=_l(),{data:s,loader:o}=Zn("query TeamAssignmentInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $teamCode: TeamCode!\n) {\n organization(id: $organizationId) {\n tags {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n positionsCategories {\n id\n name\n }\n\n positions {\n nodes {\n id\n name\n }\n }\n\n segments(segmentType: Positions) {\n id\n name\n }\n\n team(teamCode: $teamCode) {\n teamCode\n formId\n\n leaderUserInfo {\n name\n fields\n\n ...FormsUsersInfosWished\n }\n\n members {\n id\n\n userInfo {\n email\n nameOrEmail\n fields\n }\n }\n\n positionsCategoriesIds\n positionsIds\n positionsSlotsIds\n\n slots: slotsMerged {\n range\n }\n }\n }\n}\n",{organizationId:e,eventId:t,teamCode:n},[Ls.CustomFieldWithConditionFragment,Ls.FormsUsersInfosWishedFragment]);return o||(0,i.jsx)(XN,{event:s.event,organization:s.organization})},QN=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:s}=_l(),{event:{name:o},isEventAdmin:r}=vb(),{canCampaignSend:a}=wS();Dd(`${o} ${s("Campaigns")}`);const l=Mc(),[d,c]=(0,L.useState)(""),[u,h]=(0,L.useState)(""),g=Lc(e=>{h(e),b()}),[p,f]=(0,L.useState)(""),[x,_]=(0,L.useState)(""),[I,v]=(0,L.useState)(0),b=()=>{v(0)},[j,C]=(0,L.useState)(null),{data:y,isLoading:k,reload:A}=Zn("query Campaigns(\n $eventId: EventId!\n $name: String\n $states: [CampaignState!]\n $campaignType: CampaignType\n $offset: Int\n $sort: CampaignsSort\n) {\n event(id: $eventId) {\n campaignsCost\n\n campaigns(\n name: $name\n states: $states\n campaignType: $campaignType\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...CampaignList\n }\n\n numberOfPages\n totalCount\n }\n\n doneCampaigns: campaigns(states: [Done]) {\n totalCount\n }\n }\n}\n",{eventId:n,name:m(u)?u:void 0,states:""!==p?[p]:void 0,campaignType:""!==x?x:void 0,offset:I,sort:j},[Ls.CampaignListFragment]);return u$(y.event?.campaigns.nodes??[],A),(0,i.jsxs)(nj,{children:[(0,i.jsxs)(tj,{children:[(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 displayXs semiBold",children:s("Campaigns")}),r?(0,i.jsx)(KS,{menu:(0,i.jsx)(Gd,{icon:"paper-plane",onClick:()=>{e.push(SI.CREATE_TEMPLATE({organizationId:t,eventId:n}))},children:s("cr_er_un_mod_le_20298")}),onClick:()=>{e.push(SI.CREATE({organizationId:t,eventId:n}))},children:s("cr_er_une_campa_96023")}):a?(0,i.jsx)(El,{to:SI.CREATE({organizationId:t,eventId:n}),children:s("cr_er_une_campa_96023")}):null]}),(0,i.jsxs)(ej,{children:[(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(dj,{content:y.event?.doneCampaigns.totalCount??"-",title:s("nombre_de_campa_52133")}),(0,i.jsx)(dj,{content:y.event?.campaignsCost??"-",title:s("co_t_des_campag_08459")})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Na,{css:{boxShadow:"$xs"},direction:"column",children:(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{value:p,onChange:e=>{f(e),b()},children:[(0,i.jsx)("option",{value:"",children:s("toutes_les_camp_81617")}),l(Xt)]})}),(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{value:x,onChange:e=>{_(e),b()},children:[(0,i.jsx)("option",{value:"",children:s("sms_et_e_mail_94587")}),l(Jt)]})}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:s("rechercher_une_69554"),value:d,onChange:e=>{c(e),g(e)}})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{attribute:ce.Name,setSort:C,sort:j,children:s("nom_de_la_campa_45063")}),(0,i.jsx)(_m,{attribute:ce.Type,css:{flex:"0 150px"},setSort:C,sort:j,children:s("type_35427")}),(0,i.jsx)(Vc,{css:{flex:"0 200px"},children:s("nombre_de_desti_21374")}),(0,i.jsx)(Vc,{css:{flex:"0 150px"},children:s("co_t_68998")}),(0,i.jsx)(_m,{attribute:ce.State,css:{flex:"0 150px"},setSort:C,sort:j,children:s("status_06428")}),(0,i.jsx)(Vc,{css:{flex:"0 100px"}})]}),numberOfPages:y.event?.campaigns.numberOfPages??0,offset:I,rows:k?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:no(y.event.campaigns.nodes)?(0,i.jsx)(i.Fragment,{children:y.event.campaigns.nodes.map(e=>(0,i.jsx)(c$,{campaign:e,canSendCampaigns:a,eventId:n,organizationId:t,reload:A},e.id))}):(0,i.jsx)(jk,{title:s("no_campaigns")})}),setOffset:v,title:s("liste_des_campa_60034"),totalCount:y.event?.campaigns.totalCount??0})})]})]})},eL=({organizationId:e,eventId:t,category:n,clickable:s})=>{const o=Yn();return(0,i.jsx)(Dc,{children:(0,i.jsx)(Ec,{children:(0,i.jsxs)(Na,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Na,{gap:"3",justify:"between",children:[s?(0,i.jsx)(qc,{to:ps.POSITION_CATEGORY({organizationId:e,eventId:t,positionCategoryId:n.id}),children:n.name}):(0,i.jsx)(yr,{color:"gray700",children:n.name}),(0,i.jsx)(yr,{color:"gray700",children:o("_1_2_membres_04485",n.assignedResources,n.resources)})]}),(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Aw,{percent:n.assignedResources/n.resources})})]})})},n.id)},tL=e=>(0,i.jsx)(Na,{align:"center",css:{background:"white",bd:!0,cursor:"pointer",padding:"$3 $4"},gap:"3",width:1,children:(0,i.jsxs)(Ja,{to:e.path,width:1,children:[(0,i.jsx)(Na,{align:"center",css:{background:e.isDone?"$success100":"",border:e.isDone?"":"1px solid $gray300",borderRadius:"20px",color:"$success700",fontSize:"10px"},height:20,justify:"center",width:20,children:e.isDone&&(0,i.jsx)(el,{icon:"check"})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray800",css:{textDecoration:e.isDone?"line-through":""},fontWeight:"medium",children:e.title}),(0,i.jsx)(yr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(yr,{color:"gray900",css:{cursor:"pointer"},children:(0,i.jsx)(el,{icon:"arrow-right"})})]})}),nL=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=_l(),o=qn(ep),{isEventAdmin:r}=vb(),{data:a,loader:l}=Zn("query Dashboard($eventId: EventId!) {\n event(id: $eventId) {\n assignedResources\n numberOfPositions\n resources\n volunteerMinutesAssigned\n volunteerMinutesNeeded\n\n assignmentsStats {\n numberOfAssigned\n numberOfWaitingAssignment\n }\n\n onboarding {\n isFirstCampaignCreated\n isFirstFormCreated\n isFirstPositionCreated\n }\n\n positionsCategories {\n id\n name\n resources\n assignedResources\n }\n }\n}\n",{eventId:s},[]),d=(0,L.useMemo)(()=>a.event?(0,lc.A)(a.event.positionsCategories,e=>e.name.toLowerCase()):[],[a.event]),c=!(!r||!a.event||a.event.onboarding.isFirstCampaignCreated&&a.event.onboarding.isFirstFormCreated&&a.event.onboarding.isFirstPositionCreated);return l||(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:t("tableau_de_bord_24627")}),(0,i.jsx)(qa,{height:"7"}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(SN,{header:(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:t("vos_premiers_pa_81169")}),(0,i.jsx)(yr,{color:"gray500",children:t("pour_bien_d_mar_03933")})]}),initialIsOpen:!0,children:(0,i.jsxs)(Na,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(tL,{isDone:a.event.onboarding.isFirstPositionCreated,path:$s.CREATE_POSITION(n,s),subtitle:t("cr_er_une_nouve_43436"),title:t("cr_er_votre_pre_70209")}),(0,i.jsx)(tL,{isDone:a.event.onboarding.isFirstFormCreated,path:Ni.FORMS({organizationId:n,eventId:s}),subtitle:t("cr_er_un_formul_31199"),title:t("cr_er_votre_pre_76199")}),(0,i.jsx)(tL,{isDone:a.event.onboarding.isFirstCampaignCreated,path:SI.CREATE({organizationId:n,eventId:s}),subtitle:t("communiquer_fac_26569"),title:t("envoyer_votre_p_47899")})]})}),(0,i.jsx)(qa,{height:"8"})]}),(0,i.jsxs)(cd,{gap:"6",gridtemplatecolumns:"1fr 1fr 350px",gridtemplaterows:"1fr 1fr",children:[(0,i.jsx)(yr,{css:{gridColumn:"1 / 2",gridRow:"1 / 2"},children:(0,i.jsx)(sS,{button:(0,i.jsx)(El,{to:ps.POSITIONS({organizationId:n,eventId:s}),children:t("voir_les_missio_71964")}),icon:"user-group",iconColor:"primary",text:t("nombre_de_membr_60320",a.event.resources),value:a.event.resources})}),(0,i.jsx)(yr,{css:{gridColumn:"2 / 3",gridRow:"1 / 2"},children:(0,i.jsx)(sS,{button:(0,i.jsx)(El,{to:ps.POSITIONS({organizationId:n,eventId:s}),children:t("voir_les_missio_71964")}),icon:"sitemap",iconColor:"purple",text:t("nombre_de_missi_67304",a.event.numberOfPositions),value:a.event.numberOfPositions})}),(0,i.jsx)(yr,{css:{gridColumn:"1 / 2",gridRow:"2 / 3"},children:(0,i.jsx)(sS,{button:(0,i.jsx)(El,{onClick:()=>{e.push($s.VOLUNTEERS(n,s))},children:t("voir_les_membre_27923")}),icon:"user-check",iconColor:"success",text:t("nombre_de_membr_87779",a.event.assignmentsStats.numberOfAssigned),value:a.event.assignmentsStats.numberOfAssigned})}),(0,i.jsx)(yr,{css:{gridColumn:"2 / 3",gridRow:"2 / 3"},children:(0,i.jsx)(sS,{button:(0,i.jsx)(El,{onClick:()=>{e.push($s.ASSIGNMENTS(n,s))},children:t("voir_mes_affect_10965")}),icon:"wand-magic-sparkles",iconColor:"warning",text:t("nombre_de_membr_63555",a.event.assignmentsStats.numberOfWaitingAssignment),value:a.event.assignmentsStats.numberOfWaitingAssignment})}),(0,i.jsxs)(Na,{css:{bd:!0,gridColumn:"3 / 4",gridRow:"1 / 3",padding:"$6"},direction:"column",justify:"between",children:[(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{color:"gray500",children:t("taux_de_remplis_11913")}),(0,i.jsxs)(yr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:[0===a.event.resources?"0":Math.round(a.event.assignedResources/a.event.resources*100),"%"]})]}),(0,i.jsx)(yr,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{color:"gray500",children:t("temps_de_b_n_vo_87924")}),(0,i.jsx)(yr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:o.minutesToHoursMinutesString(a.event.volunteerMinutesNeeded)})]}),(0,i.jsx)(yr,{css:{borderBottom:"1px solid $gray200"},width:1}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{color:"gray500",children:t("temps_de_b_n_vo_60725")}),(0,i.jsx)(yr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:o.minutesToHoursMinutesString(a.event.volunteerMinutesAssigned)})]})]})]}),(0,i.jsx)(qa,{height:"8"}),r&&(0,i.jsx)(yr,{css:{boxShadow:"$xs"},children:(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Vc,{children:t("cat_gories_24533")})}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:d.length>0?d.map(e=>(0,i.jsx)(eL,{category:e,clickable:!0,eventId:s,organizationId:n},e.id)):(0,i.jsx)(jk,{subtitle:t("vous_n_avez_pas_59681"),title:t("aucune_cat_gori_21347")})}),setOffset:Ql.A,title:t("liste_des_membr_59735"),totalCount:0})})]})};var iL;let sL=class extends OO{static{iL=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...OO.IMPORT_COLUMNS_DEFAULT,Name:"name",FormId:"formId",Deadline:"deadline",MaxResources:"maxResources",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===Ze.Update?[iL.IMPORT_COLUMNS_DEFAULT.Id]:[],iL.IMPORT_COLUMNS_DEFAULT.Name,iL.IMPORT_COLUMNS_DEFAULT.FormId];default(e){const t=super.default(e);return t.input={...t.input,notifyLeaders:!1},t}constructor(e,t){super(e,t),this.csvInputService=e}};sL=iL=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Ov,Wn])],sL);const oL=()=>{const{params:{organizationId:e,eventId:t},translate:n}=_l(),{mutate:s}=function(e={}){return Xn("mutation DelegationsImport(\n $eventId: EventId!\n $organizationId: OrganizationId!\n $input: DelegationImportInput!\n) {\n jobId: delegationsImport(eventId: $eventId, organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkDelegationsImport:o}=kb(),r=(0,L.useCallback)((e,t,n)=>o(e,t,n),[o,t]),{data:a,loader:l}=Kr({organizationId:e,variety:ve.Delegation});return l||(0,i.jsx)(QO,{ImportInputService:sL,additionalOptions:(0,i.jsx)(Hm,{name:"input.notifyLeaders",children:n("informer_les_re_38743")}),checkImport:r,closePath:ds.DELEGATIONS({organizationId:e,eventId:t}),customFields:a.organization.customFields.nodes,heading:n("import_de_d_l_g_69356"),importTagPrefix:"delegations",itemName:{singular:n("team_33516"),plural:n("teams_75559")},localStorageKeyPrefix:"DELEGATIONS_IMPORT",mutate:s,returnLink:(0,i.jsx)(qc,{to:ds.DELEGATIONS({organizationId:e,eventId:t}),children:n("revenir_aux_d_l_15915")}),showModeSelection:!1})},rL=e=>{const{translate:t,params:{eventId:n}}=_l(),{isEventAdmin:s}=vb(),[o,r]=(0,L.useState)(e.delegationAccreditationSlot),a=(0,L.useMemo)(()=>ec(e.accreditationSlot.accreditation.color),[e.accreditationSlot]),l=(0,L.useMemo)(()=>({background:a[50],border:`1px solid ${a[500]}`,color:a[700]}),[a]),d=(0,L.useCallback)(async()=>{const{event:{delegation:t}}=await Do({eventId:n,delegationId:e.delegationId,accreditationSlotId:e.accreditationSlot.id},await K());r(t.accreditationSlot)},[e.accreditationSlot,e.delegationId,r]),[c,u]=(0,L.useState)(!1),h=o.maxResources?`/${o.maxResources}`:"",m=`${o.assignedResources}${h}`;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{...l,borderRadius:"$1",cursor:s?"pointer":"default",padding:"$2"},direction:"column",gap:"2",height:1,width:1,onClick:()=>{s&&u(!0)},children:[(0,i.jsx)(sw,{background:a[100],count:m,icon:"badge-check",text:t("attribu_es_48167")}),(0,i.jsx)(sw,{background:a[100],count:o.wishedResources,icon:"hand-holding-heart",text:t("souhait_es_78101")}),(0,i.jsx)(sw,{background:a[100],count:o.scannedResources,icon:"scanner-gun",text:t("scann_es_13169")})]}),s&&c&&(0,i.jsx)(iw,{accreditationSlotId:e.accreditationSlot.id,delegationId:e.delegationId,eventId:n,onClose:()=>(u(!1),d())})]})},aL=e=>{const t=(0,L.useMemo)(()=>(e.delegation.accreditationsSlots||[]).find(t=>t.accreditationSlotId===e.accreditationSlot.id),[e.delegation,e.accreditationSlot]);return t?(0,i.jsx)(rL,{accreditationSlot:e.accreditationSlot,delegationAccreditationSlot:t,delegationId:e.delegation.id}):null},lL=e=>(0,i.jsx)(Na,{css:{borderTop:"1px solid $gray200",height:"$cellHeightXl"},children:e.accreditationsSlots.map(t=>(0,i.jsx)(Na,{align:"center",css:{borderRight:"1px solid $gray200",padding:"$3 $4"},height:1,width:200,children:(0,i.jsx)(aL,{accreditationSlot:t,delegation:e.delegation})},t.id))}),dL=e=>{const{params:{organizationId:t,eventId:n}}=_l(),s=(0,L.useMemo)(()=>PA(e.allAccreditationsSlots),[e.allAccreditationsSlots]),o=(0,L.useMemo)(()=>FA(s,e.selectedSlotsIds),[s,e.selectedSlotsIds]),r=(0,L.useMemo)(()=>MA(o,e.selectedSlotsIds),[o,e.selectedSlotsIds]),a=(0,L.useMemo)(()=>r.map(e=>e.id),[r]),l=(0,L.useCallback)(e=>(0,i.jsx)(Na,{align:"center",css:{borderRight:"1px solid $gray200",borderTop:"1px solid $gray200",height:"$cellHeightXl",px:"$4"},width:1,children:(0,i.jsx)(qc,{to:ds.DELEGATION({organizationId:t,eventId:n,delegationId:e.id}),children:e.name})},e.id),[t,n]),d=(0,L.useCallback)(e=>(0,i.jsx)(lL,{accreditationsSlots:r,delegation:e},e.id),[r,a]);return(0,i.jsx)(Na,{direction:"column",width:1,children:e.isLoading?(0,i.jsx)(kl,{}):(0,i.jsx)(NA,{allAccreditations:s,cellWidth:200,data:e.delegations,filteredAccreditations:o,limit:e.limit,numberOfPages:e.numberOfPages,offset:e.offset,renderLeftColumn:l,renderRow:d,selectedSlotsIds:e.selectedSlotsIds,setLimit:e.setLimit,setOffset:e.setOffset,setSelectedSlotsIds:e.setSelectedSlotsIds,slots:r,totalCount:e.totalCount})})},cL=()=>{const{params:{organizationId:e,eventId:t}}=_l(),{columns:n,infos:s,limit:o,nameDebounced:r,offset:a,predicates:l,rendering:d,setInfos:c,setLimit:u,setOffset:h}=gy(),g=(0,L.useMemo)(()=>v$(n,d),[n,d]),{data:p,isLoading:f}=Zn("query DelegationsAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true, usedInDelegations: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:t},[Ls.AccreditationSlotMatrixFragment]),{data:x,isLoading:_}=ta({...g,organizationId:e,eventId:t,level:it.Event,predicates:l,name:m(r)?r:null,limit:o,offset:a}),{numberOfPages:I,totalCount:v}=ku(x.data?.rows),b=(0,L.useMemo)(()=>s.delegationsMatrixSelectedSlotsIds||[],[s]),j=(0,L.useCallback)(e=>c({...s,delegationsMatrixSelectedSlotsIds:e}),[s,c]);return(0,i.jsx)(dL,{allAccreditationsSlots:p.event?.accreditationsSlots.nodes??[],delegations:x.data?.rows.nodes??[],isLoading:_||f,limit:o,numberOfPages:I,offset:a,selectedSlotsIds:b,setLimit:u,setOffset:h,setSelectedSlotsIds:j,totalCount:v})},uL=e=>{const{history:t,params:{organizationId:n,eventId:s},translate:r}=_l(),{mutate:a,isLoading:l}=Sa(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)([]),[m,g]=(0,L.useState)(!0),p=!d||no(u);return(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"user-group",subtitle:r("ajoutez_une_d_l_54234"),children:r("cr_ation_d_une_07120")}),(0,i.jsxs)(Tb,{children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:r("que_souhaitez_v_87607")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(WR,{state:d?"unchecked":"checked",onClick:()=>c(!1),children:r("cr_er_une_nouve_45377")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(WR,{state:d?"checked":"unchecked",onClick:()=>c(!0),children:r("cr_er_une_d_l_g_37657")}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(bc,{isSearchVisible:!0,label:r("_quelle_d_l_ga_55758"),multiple:!1,renderOnPortal:!0,values:u,onChange:h,children:e.parentDelegations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(ju,{value:m,onChange:g,children:r("je_souhaite_app_69393")})]})]}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{disabled:!p,isLoading:l,onClick:async()=>{let i;if(d&&no(u)){const t=u[0],n=e.parentDelegations.find(e=>e.id===t);no(n.leadersIds)&&await a({eventId:s,usersInfosIds:n.leadersIds,sendVolunteerRegistrationEmail:!1}),i=o(JSON.stringify({parentId:t,applyParentSettings:m}))}t.push($s.CREATE_DELEGATION(n,s,i))},children:r("suivant_62774")})})]})},hL=()=>{const{history:e,params:{organizationId:t,eventId:n},translate:s}=_l(),{segment:o,columns:r}=gy(),{data:a}=Zn("query ParentDelegations($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Organization) {\n nodes {\n id\n name\n leadersIds\n }\n }\n }\n}\n",{organizationId:t},[]),{mutate:l}=function(e={}){return Xn("mutation DelegationsExport(\n $organizationId: OrganizationId!\n $eventId: EventId\n $segmentId: SegmentId!\n $format: ExportFormat!\n $columns: [String!]!\n) {\n jobId: delegationsExport(\n organizationId: $organizationId\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n columns: $columns\n )\n}\n",e)}(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1),m=no(a.organization?.delegations.nodes),{checkExport:g}=kb();return(0,i.jsxs)(r$,{children:[(0,i.jsx)(Bb,{permissions:Nb.DELEGATION_EDIT,children:m?(0,i.jsxs)(Rb,{children:[(0,i.jsx)($b,{children:(0,i.jsx)(KS,{menu:(0,i.jsx)(Gd,{icon:"file-import",to:$s.EVENT_DELEGATIONS_IMPORT(t,n),onClick:e=>Nd(e.target),children:s("importer_des_d_05454")}),children:s("cr_er_une_d_l_g_23035")})}),(0,i.jsx)(uL,{parentDelegations:a.organization.delegations.nodes})]}):(0,i.jsx)(KS,{menu:(0,i.jsx)(Gd,{icon:"file-import",to:$s.EVENT_DELEGATIONS_IMPORT(t,n),onClick:e=>Nd(e.target),children:s("importer_des_d_05454")}),path:$s.CREATE_DELEGATION(t,n),children:s("cr_er_une_d_l_g_23035")})}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsxs)(Bb,{permissions:Nb.DELEGATION_EDIT,children:[(0,i.jsx)(Gd,{icon:"plus",onClick:()=>{c(!0)},children:s("cr_er_une_cat_g_20051")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"})]}),(0,i.jsx)(Gd,{icon:"file-xls",onClick:e=>{Nd(e.target),h(!0)},children:s("exporter_en_exc_51862")})]})]}),(0,i.jsx)(hD,{isOpen:u,requestExport:async e=>{const{jobId:i}=await l({organizationId:t,eventId:n,segmentId:o.id,format:e,columns:r});g(i,t,n)},showIncludeFiles:!1,onClose:()=>{h(!1)}}),d&&(0,i.jsx)(ZC,{eventId:n,organizationId:t,onClose:()=>c(!1),onSuccess:i=>{e.push(ds.DELEGATION_CATEGORY({organizationId:t,eventId:n,delegationCategoryId:i.id}))}})]})},mL=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{canDelegationEdit:o,canSegmentEdit:r}=wS(),{limit:a,rendering:l,segment:d}=gy(),c=r&&l===Mh.List,u=o&&l===Mh.List;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(hL,{}),0===e.numberOfDelegations?(0,i.jsx)(ej,{css:{overflow:"hidden"},children:(0,i.jsx)(yr,{css:{overflow:"hidden"},width:1,children:(0,i.jsx)(Nk,{title:t("vous_n_avez_pas_58215")})})}):(0,i.jsxs)(ej,{children:[(0,i.jsx)(o$,{searchRow:(0,i.jsx)(i$,{actions:(0,i.jsx)(z$,{}),searchPlaceholder:t("rechercher_une_31213"),showActions:o,showEditColumns:c,showEditMode:u,showSearchColumns:r}),selectSegment:(0,i.jsx)(A$,{pageSelectedText:t("les_1_d_l_gat_27248",a),segmentSelectedText:t("les_1_d_l_gat_04594",d.count,d.name)})}),l===Mh.AccreditationsMatrix?(0,i.jsx)(cL,{}):(0,i.jsx)(iD,{customFields:e.customFields,eventId:s,level:it.Event,organizationId:n})]})]})},gL=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=_l(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=vb(),c=qn(b$),u=(0,L.useMemo)(()=>c.getDelegationsFilters(e.event.organizationId,o,e.organization.customFields.nodes,e.organization.delegationsCategories.nodes),[e.event,e.organization,o]),h=(0,L.useMemo)(()=>c.getDelegationsPossibleColumns(e.organization.customFields.nodes),[e.organization]);return(0,i.jsx)(y$,{eventId:o,getEditPath:e=>gi(ds.DELEGATION({organizationId:s,eventId:o,delegationId:e})),getShowPath:e=>ds.DELEGATION({organizationId:s,eventId:o,delegationId:e}),organizationId:s,children:(0,i.jsx)(e$,{canEditSegments:a(Nb.SEGMENT_EDIT),eventId:o,filters:u,filtersButtonText:n("filtrer_les_d_l_04628"),filtersSubtitle:n("appliquer_des_f_65318"),getSegmentPath:e=>$s.DELEGATIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfDelegations,initialLimit:l?.delegationsLimit??Tc,initialSegmentsOpen:l?.areDelegationsSegmentsOpen??!0,organizationId:s,possibleColumns:h,possibleRenderings:[Mh.List,Mh.AccreditationsMatrix],reload:e.reload,segmentId:r,segmentType:vt.Delegations,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({delegationsLimit:e})},onSegmentClick:e=>{d({delegationsSegmentId:e})},onSegmentDelete:async()=>{await d({delegationsSegmentId:null}),t.replace(ds.DELEGATIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await d({areDelegationsSegmentsOpen:e})},children:(0,i.jsx)(mL,{customFields:e.organization.customFields.nodes,numberOfDelegations:e.event.numberOfDelegations})})})},pL=()=>{const{params:{organizationId:e,eventId:t},translate:n}=_l(),{event:{name:s},localEvent:o}=vb();Dd(`${s} ${n("d_l_gations_78318")}`);const{data:r,loader:a,reload:l}=Zn("query DelegationsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Delegation) {\n nodes {\n ...SegmentCustomField\n }\n }\n\n delegationsCategories(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n organizationId\n numberOfDelegations\n\n segmentsFolders(segmentType: Delegations) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:t},[Ls.SegmentCustomFieldFragment,Ls.SegmentsFoldersSegmentsFragment]),d=(0,L.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.DELEGATIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(gL,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.DELEGATIONS_SEGMENT(e,t,o?.delegationsSegmentId&&d.includes(o.delegationsSegmentId)?o.delegationsSegmentId:d[0]),replace:!0})})]})},fL=()=>{const{hasFeature:e}=yI();return e(Ne.Delegation)?(0,i.jsx)(pL,{}):(0,i.jsx)(Na,{align:"center",height:1,justify:"center",width:1,children:(0,i.jsx)(kI,{icon:"people-group"})})};let xL=class extends Ul{constructor(e){super(e)}customDocumentInputDefault(e){return{name:e?.name??"",slug:e?.slug??"",populationsIds:e?.populationsIds??[],configuration:e?.configuration??this.getConfigurationDefault()}}customDocumentInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),slug:d.Yj().required(this.t("le_nom_de_la_va_15472")).test("is-valid",this.t("le_nom_de_la_va_15472"),e=>null!==e.match(/^[a-z][a-z0-9]*$/))})}getConfigurationDefault(){return{bleed:!1,height:Xm,pages:[this.getPageDefault()],width:Jm}}getPageDefault(){return{id:V(),accreditationsSlotsIds:[],accreditationAcronym:"",conditionsCustomFields:[],elements:[],hasConditions:!1,positionsSlotsIds:[]}}getContainerElementDefault(e,t,n){return{type:"container",id:e,inContainer:t,backgroundColor:"",accreditationsSlotsIds:[],accreditationAcronym:"",align:"start",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],direction:"row",elements:[],gap:0,hasBackground:!1,hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,justify:"start",left:0,name:this.t("conteneur_1_03989",n+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,top:0,width:100,zIndex:1}}getImageElementDefault(e,t,n){return{type:"image",id:e,inContainer:t,accreditationsSlotsIds:[],accreditationAcronym:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],hasConditions:!1,hasRotate:!1,height:100,isRatioLocked:!1,left:0,name:this.t("image_1_30956",n+1),positionsSlotsIds:[],px:0,py:0,rotateDegree:0,top:0,width:100,zIndex:1}}getTextElementDefault(e,t,n){return{type:"text",id:e,inContainer:t,accreditationsSlotsIds:[],accreditationAcronym:"",align:"start",hasBackground:!1,backgroundColor:"",borderColor:"#e4e7ec",borderRadius:0,borderSize:0,conditionsCustomFields:[],hasConditions:!1,hasRotate:!1,height:20,isRatioLocked:!1,left:0,name:this.t("texte_1_59540",n+1),text:"",color:"#1d2939",fontFamily:"Open Sans",fontSize:14,fontWeight:400,justify:"start",lineHeight:1.4,positionsSlotsIds:[],px:0,py:0,rotateDegree:0,textTransform:"none",top:0,width:100,zIndex:1}}};function _L(e){const t=e=>e.flatMap(e=>"container"===e.type?[e].concat(t(e.elements)):[e]);return e.configuration.pages.flatMap(e=>t(e.elements))}function IL(e,t,n){const i={...e,id:t,name:n};if("container"===i.type){const e=i.elements.map(e=>IL(e,V(),e.name));return{...i,elements:e}}return i}function vL(e,t){return e===Xm&&t===Jm?"a4":e===Qm&&t===eg?"a6":e===ig&&t===sg?"cb":"custom"}function bL(e,t,n,i,s){return!e.hasConditions||(no(e.accreditationsSlotsIds)?no((0,mh.A)(e.accreditationsSlotsIds,t)):m(e.accreditationAcronym)?n.some(t=>e.accreditationAcronym===t):no(e.positionsSlotsIds)?no((0,mh.A)(e.positionsSlotsIds,i)):!no(e.conditionsCustomFields)||e.conditionsCustomFields.every(({slug:e,value:t})=>"isEmpty"===t?g(s[e]?.rawValue):"isNotEmpty"===t?m(s[e]?.rawValue):"boolean"==typeof t?s[e]?.rawValue===t:!!Array.isArray(t)&&no((0,mh.A)(to(s[e]?.rawValue),t))))}xL=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],xL);const jL=L.createContext({}),CL=e=>{const{translate:t,params:{eventId:n}}=_l(),s=qn(Kc),o=qn(hh),r=qn(xL),[a,d]=L.useState(e.initialCustomDocument),[c,u]=L.useState(null),[g,p]=L.useState(null),[f,x]=L.useState("parameters"),_=L.useCallback(e=>{d((0,pu.jM)(t=>{t.name=e}))},[a,d]),I=L.useCallback((e,t)=>{d((0,pu.jM)(n=>{n.configuration.pages.forEach(n=>{n.id===g&&(n[e]=t)})}))},[g,d]),v=L.useCallback(e=>{d((0,pu.jM)(t=>{t.populationsIds=e}))},[d]),b=L.useCallback(e=>{d((0,pu.jM)(t=>{t.slug=h(e,{replacer:l.Empty})}))},[d]),j=L.useCallback(e=>{d((0,pu.jM)(t=>{t.configuration.bleed=e}))},[a,d]),C=L.useCallback((e,t)=>{d((0,pu.jM)(n=>{n.configuration.height=e,n.configuration.width=t}))},[a,d]),y=L.useCallback(()=>{u(null),p(null)},[u,p]),k=L.useCallback(()=>_L(a).find(e=>e.id===c)||null,[a,c]),A=L.useCallback(()=>a.configuration.pages.find(e=>e.id===g)||null,[a,g]),w=L.useCallback(()=>{d((0,pu.jM)(e=>{e.configuration.pages.push(r.getPageDefault())}))},[d]),S=L.useCallback(e=>{d((0,pu.jM)(t=>{t.configuration.pages=t.configuration.pages.filter(t=>t.id!==e)}))},[d]),E=L.useCallback(e=>{const t=V();d((0,pu.jM)(n=>{e?_L(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getContainerElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getContainerElementDefault(t,!1,e.elements.length))})})),u(t)},[a,g,d]),T=L.useCallback(e=>{const t=V();d((0,pu.jM)(n=>{e?_L(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getTextElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getTextElementDefault(t,!1,e.elements.length))})})),u(t)},[a,g,d]),z=L.useCallback(e=>{const t=V();d((0,pu.jM)(n=>{e?_L(n).forEach(n=>{"container"===n.type&&n.id===e.id&&n.elements.push(r.getImageElementDefault(t,!0,n.elements.length))}):n.configuration.pages.forEach(e=>{e.id===g&&e.elements.push(r.getImageElementDefault(t,!1,e.elements.length))})})),u(t)},[a,g,d,u]),O=L.useCallback(e=>{d((0,pu.jM)(t=>{t.configuration.pages.forEach(t=>{t.elements=t.elements.filter(t=>t.id!==e)}),_L(t).forEach(t=>{"container"===t.type&&(t.elements=t.elements.filter(t=>t.id!==e))})})),u(null)},[a,d,u]),R=L.useCallback(e=>{const n=V();d((0,pu.jM)(i=>{_L(i).forEach(i=>{if("container"===i.type){const s=i.elements.find(t=>t.id===e);s&&i.elements.push(IL(s,n,t("copie_de_1_62900",s.name)))}}),i.configuration.pages.forEach(i=>{const s=i.elements.find(t=>t.id===e);s&&i.elements.push(IL(s,n,t("copie_de_1_62900",s.name)))})})),u(n)},[a,d,u]),$=L.useCallback(e=>{const n=V();d((0,pu.jM)(i=>{const s=i.configuration.pages.find(t=>t.id===e);s&&i.configuration.pages.push(function(e,t,n){return{...e,id:t,name:n,elements:e.elements.map(e=>IL(e,V(),e.name))}}(s,n,m(s.name)?t("copie_de_1_62900",s.name):""))}))},[]),D=L.useCallback((e,t)=>{u(e),p(t)},[a,u,p]),P=L.useCallback(e=>{p(e),u(null),x("design")},[u,p,x]),F=L.useCallback((e,t,n)=>{d((0,pu.jM)(i=>{const s=_L(i).find(t=>t.id===e);s&&(s[t]=n)}))},[a]),{data:M}=Zn("query CustomDocumentConditions($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true) {\n nodes {\n id\n name\n date\n\n accreditation {\n name\n }\n }\n }\n\n positionsSlots {\n nodes {\n id\n name\n range\n\n position {\n name\n }\n }\n }\n }\n}\n",{eventId:n},[]),N=L.useMemo(()=>Jh(s,M.event?.accreditationsSlots.nodes??[]).map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},n)),[M.event]),B=L.useMemo(()=>Xh(o,M.event?.positionsSlots.nodes??[]).map(({name:e,values:t},n)=>(0,i.jsx)("optgroup",{label:e,children:t.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},n)),[M.event]);return(0,i.jsx)(jL.Provider,{value:{accreditationsOptions:N,addContainerElement:E,addImageElement:z,addPage:w,addTextElement:T,cleanSelecteds:y,customDocument:a,customFields:e.customFields,deleteElement:O,duplicateElement:R,duplicatePage:$,getSelectedElement:k,getSelectedPage:A,population:e.population,positionsOptions:B,removePage:S,selectElement:D,selectPage:P,selectedElementId:c,selectedPageId:g,setBleed:j,setDimensions:C,setName:_,setPopulations:v,setSlug:b,setTab:x,tab:f,updateElementProperty:F,updatePageProperty:I},children:e.children})};function yL(){return L.useContext(jL)}const kL=e=>{const{translate:t}=_l(),{addContainerElement:n,addImageElement:s,addTextElement:o}=yL();return(0,i.jsxs)(Na,{css:{bd:!0},direction:"column",children:[(0,i.jsxs)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{o(e.container)},children:[(0,i.jsx)(Na,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(el,{icon:"text"})}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray800 textSm medium",children:t("Text")}),(0,i.jsx)(El,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{s(e.container)},children:[(0,i.jsx)(Na,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(el,{icon:"image"})}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray800 textSm medium",children:t("image_40624")}),(0,i.jsx)(El,{color:"white",leftIcon:"plus",size:"sm"})]}),(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer",padding:"$4 $6"},gap:"3",onClick:()=>{n(e.container)},children:[(0,i.jsx)(Na,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(el,{icon:"chart-simple"})}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray800 textSm medium",children:t("conteneur_33078")}),(0,i.jsx)(El,{color:"white",leftIcon:"plus",size:"sm"})]})]})},AL=e=>{const{translate:t}=_l(),{accreditationsOptions:n,customFields:s,positionsOptions:o}=yL(),r=(0,L.useMemo)(()=>s.filter(e=>e.fieldType===Ve.Checkbox||e.fieldType===Ve.Select||e.fieldType===Ve.Text||e.fieldType===Ve.Validation).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[s]),a=e.element.conditionsCustomFields||[],l=a.map(e=>e.slug),d=(t,n)=>{const i=(0,pu.jM)(a,e=>{e[n].value=t});e.updateProperty(e.elementId,"conditionsCustomFields",i)},c=s.filter(e=>l.includes(e.slug));return(0,i.jsx)(PM,{css:{padding:"$4 $6"},title:t("condition_d_aff_68185"),children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(ju,{value:e.element.hasConditions,onChange:t=>{t||(e.updateProperty(e.elementId,"accreditationsSlotsIds",[]),e.updateProperty(e.elementId,"accreditationAcronym",""),e.updateProperty(e.elementId,"positionsSlotsIds",[]),e.updateProperty(e.elementId,"conditionsCustomFields",[])),e.updateProperty(e.elementId,"hasConditions",t)},children:t("afficher_en_fon_47208")}),e.element.hasConditions&&(0,i.jsxs)(Na,{css:{background:"$gray100",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$3 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(bc,{isSearchVisible:!0,label:t("afficher_en_fon_89756"),multiple:!0,values:e.element.accreditationsSlotsIds||[],onChange:t=>{e.updateProperty(e.elementId,"accreditationsSlotsIds",t)},children:n}),(0,i.jsx)(Nl,{label:t("afficher_en_fon_78748"),value:e.element.accreditationAcronym||"",onChange:t=>{e.updateProperty(e.elementId,"accreditationAcronym",t)}}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("afficher_en_fon_19925"),multiple:!0,values:e.element.positionsSlotsIds||[],onChange:t=>{e.updateProperty(e.elementId,"positionsSlotsIds",t)},children:o}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("afficher_en_fon_56078"),multiple:!0,values:l,onChange:t=>{const n=(0,cc.A)(t,l),i=s.filter(e=>n.includes(e.slug)),o=(0,cc.A)(l,t),r=a.filter(e=>!o.includes(e.slug)).concat(i.map(e=>({slug:e.slug,value:e.fieldType===Ve.Checkbox||e.fieldType===Ve.Validation||(e.fieldType===Ve.Text?"isNotEmpty":[])})));e.updateProperty(e.elementId,"conditionsCustomFields",r)},children:r}),c.map((e,n)=>e.fieldType===Ve.Checkbox||e.fieldType===Ve.Validation?(0,i.jsxs)(zu,{label:t("afficher_si_la_42654",e.name),shouldParseAsBoolean:!0,value:a[n].value,onChange:e=>{d(e,n)},children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]},e.id):e.fieldType===Ve.Text?(0,i.jsxs)(zu,{label:t("afficher_si_la_42654",e.name),value:a[n].value,onChange:e=>{d(e,n)},children:[(0,i.jsx)("option",{value:"isEmpty",children:t("est_vide_96759")}),(0,i.jsx)("option",{value:"isNotEmpty",children:t("n_est_pas_vide_45804")})]},e.id):(0,i.jsx)(bc,{isSearchVisible:!0,label:t("afficher_si_la_42654",e.name),multiple:!0,values:a[n].value||[],onChange:e=>{d(e,n)},children:e.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))},e.id))]})]})})},wL=e=>{const{translate:t}=_l(),{updateElementProperty:n}=yL();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(PM,{css:{padding:"$4 $6"},title:t("apparence_75510"),children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Nl,{label:t("largeur_54184"),rightText:e.element.width<=1?"%":"px",shouldParseAsInt:!0,value:e.element.width,onChange:t=>{e.element.isRatioLocked&&n(e.element.id,"height",Math.round(e.element.height*t/e.element.width)),n(e.element.id,"width",t)}}),(0,i.jsx)(Nl,{label:t("hauteur_56576"),rightText:e.element.height<=1?"%":"px",shouldParseAsInt:!0,value:e.element.height,onChange:t=>{e.element.isRatioLocked&&n(e.element.id,"width",Math.round(e.element.width*t/e.element.height)),n(e.element.id,"height",t)}}),(0,i.jsx)(yr,{css:{alignSelf:"end"},width:40,children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:e.element.isRatioLocked?"primary":"white",leftIcon:e.element.isRatioLocked?"lock-keyhole":"lock-keyhole-open",onClick:()=>{n(e.element.id,"isRatioLocked",!e.element.isRatioLocked)}})}),(0,i.jsx)(Cm,{placement:"top",children:e.element.isRatioLocked?t("ne_pas_pr_serve_68003"):t("pr_server_le_ra_39750")})]})})]}),!e.element.inContainer&&(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Nl,{label:"X",rightText:"px",shouldParseAsInt:!0,value:e.element.left,onChange:t=>{n(e.element.id,"left",t)}}),(0,i.jsx)(Nl,{label:"Y",rightText:"px",shouldParseAsInt:!0,value:e.element.top,onChange:t=>{n(e.element.id,"top",t)}})]}),!e.element.inContainer&&(0,i.jsx)(Nl,{hint:t("la_position_z_d_29473"),label:t("position_z_du_c_46647"),shouldParseAsInt:!0,value:e.element.zIndex,onChange:t=>{n(e.element.id,"zIndex",t)}}),("image"===e.element.type||"text"===e.element.type)&&!e.element.inContainer&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{value:e.element.hasRotate,onChange:t=>{n(e.element.id,"hasRotate",t)},children:t("faire_pivoter_06431")}),e.element.hasRotate&&(0,i.jsx)(Nl,{label:t("degr_79492"),rightText:"deg",shouldParseAsInt:!0,value:e.element.rotateDegree,onChange:t=>{n(e.element.id,"rotateDegree",t)}})]}),("container"===e.element.type||"text"===e.element.type)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{value:e.element.hasBackground,onChange:t=>{n(e.element.id,"hasBackground",t)},children:t("afficher_un_arr_96006")}),e.element.hasBackground&&(0,i.jsx)(Nj,{label:t("couleur_de_fond_75677"),value:e.element.backgroundColor,onChange:t=>{n(e.element.id,"backgroundColor",t)}})]}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Nl,{label:t("taille_de_la_bo_84060"),rightText:"px",shouldParseAsInt:!0,value:e.element.borderSize,onChange:t=>{n(e.element.id,"borderSize",t)}}),(0,i.jsx)(Nj,{label:t("couleur_de_la_b_84227"),value:e.element.borderColor,onChange:t=>{n(e.element.id,"borderColor",t)}})]}),(0,i.jsx)(Nl,{label:t("rayon_de_la_bor_26070"),rightText:"px",shouldParseAsInt:!0,value:e.element.borderRadius,onChange:t=>{n(e.element.id,"borderRadius",t)}}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Nl,{label:t("padding_horizon_14268"),rightText:"px",shouldParseAsInt:!0,value:e.element.px,onChange:t=>{n(e.element.id,"px",t)}}),(0,i.jsx)(Nl,{label:t("padding_vertica_78457"),rightText:"px",shouldParseAsInt:!0,value:e.element.py,onChange:t=>{n(e.element.id,"py",t)}})]})]})}),(0,i.jsx)(AL,{element:e.element,elementId:e.element.id,updateProperty:n})]})},SL=e=>{const{translate:t}=_l(),{getSelectedPage:n,selectPage:s,updateElementProperty:o}=yL();return(0,i.jsxs)(Na,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Na,{css:{padding:"$2 $6"},children:(0,i.jsx)(El,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{s(n().id)},children:t("retour_92202")})}),(0,i.jsxs)(PM,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(Nl,{label:t("nom_08311"),value:e.container.name,onChange:t=>{o(e.container.id,"name",t)}}),(0,i.jsx)(kL,{container:e.container})]}),(0,i.jsxs)(PM,{css:{padding:"$4 $6"},title:t("conteneur_33078"),children:[(0,i.jsxs)(zu,{label:t("direction_39738"),value:e.container.direction,onChange:t=>{o(e.container.id,"direction",t)},children:[(0,i.jsx)("option",{value:"column",children:t("de_haut_en_bas_72752")}),(0,i.jsx)("option",{value:"row",children:t("de_gauche_dro_21330")})]}),(0,i.jsx)(Nl,{label:t("_cart_entre_les_62547"),rightText:"px",shouldParseAsInt:!0,value:e.container.gap,onChange:t=>{o(e.container.id,"gap",t)}}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",children:t("alignement_54247")}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsxs)(Na,{children:[(0,i.jsx)(El,{color:"start"===e.container.justify?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"align-left",onClick:()=>{o(e.container.id,"justify","start")}}),(0,i.jsx)(El,{color:"center"===e.container.justify?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"align-center",onClick:()=>{o(e.container.id,"justify","center")}}),(0,i.jsx)(El,{color:"end"===e.container.justify?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"align-right",onClick:()=>{o(e.container.id,"justify","end")}})]}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(El,{color:"start"===e.container.align?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"objects-align-top",onClick:()=>{o(e.container.id,"align","start")}}),(0,i.jsx)(El,{color:"center"===e.container.align?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"objects-align-center-vertical",onClick:()=>{o(e.container.id,"align","center")}}),(0,i.jsx)(El,{color:"end"===e.container.align?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"objects-align-bottom",onClick:()=>{o(e.container.id,"align","end")}})]})]})]})]}),(0,i.jsx)(wL,{element:e.container})]})},EL=()=>{const{translate:e}=_l(),{getSelectedPage:t,updatePageProperty:n}=yL(),s=t();return(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsxs)(PM,{css:{padding:"$4 $6"},title:e("initialisation_38640"),children:[(0,i.jsx)(Nl,{label:e("nom_de_la_page_82146"),value:s.name||"",onChange:e=>{n("name",e)}}),(0,i.jsx)(kL,{container:null})]}),(0,i.jsx)(AL,{element:s,elementId:s.id,updateProperty:(e,t,i)=>{n(t,i)}})]})},TL=()=>{const{translate:e}=_l(),{getSelectedPage:t}=yL();return t()?(0,i.jsx)(EL,{}):(0,i.jsx)(Na,{css:{px:"$4"},height:1,width:1,children:(0,i.jsxs)(Na,{align:"center",css:{bd:!0,px:"$9"},direction:"column",gap:"4",height:1,justify:"center",width:1,children:[(0,i.jsx)(Na,{css:{border:"1px solid $gray200",borderRadius:"10px",padding:"$3"},children:(0,i.jsx)(el,{icon:"hand-pointer"})}),(0,i.jsx)(yr,{font:"gray800 textMd medium",textAlign:"center",children:e("pour_ajouter_de_11528")})]})})},zL=e=>{const{translate:t,params:{organizationId:n}}=_l(),{getSelectedPage:s,selectPage:o,updateElementProperty:r}=yL();return(0,i.jsxs)(Na,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Na,{css:{padding:"$2 $6"},children:(0,i.jsx)(El,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{o(s().id)},children:t("retour_92202")})}),(0,i.jsxs)(PM,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:[(0,i.jsx)(Nl,{label:t("nom_08311"),value:e.image.name,onChange:t=>{r(e.image.id,"name",t)}}),(0,i.jsx)(Nl,{hint:t("utilisez_user_81685"),label:t("source_16397"),value:e.image.source||"",onChange:t=>{r(e.image.id,"source",t)}}),(0,i.jsx)(Vv,{accept:Rv.Images,acl:"public-read",label:t("File"),organizationId:n,value:null,onChange:t=>{if(t){const n=`https://${P.HEAVENT_AWS_UPLOADS_BUCKET}.s3.eu-west-1.amazonaws.com/${t.key}`;r(e.image.id,"source",n)}}}),(0,i.jsx)(Nl,{label:t("lien_68557"),value:e.image.link||"",onChange:t=>{r(e.image.id,"link",t)}})]}),(0,i.jsx)(wL,{element:e.image})]})},OL=()=>{const{translate:e}=_l(),{customDocument:t,population:n,setBleed:s,setDimensions:o,setName:r,setPopulations:a,setSlug:l}=yL(),d=t.configuration.height,c=t.configuration.width,u=vL(d,c),h=(0,L.useMemo)(()=>(0,lc.A)(n.values,e=>e.value.toLowerCase()),[n]);return(0,i.jsxs)(Na,{css:{px:"$4"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Nl,{label:e("nom_du_document_73868"),value:t.name,onChange:r}),(0,i.jsxs)(zu,{label:e("format_du_docum_28991"),value:u,onChange:e=>{"a4"===e?o(Xm,Jm):"a6"===e?o(Qm,eg):"cb"===e?o(ig,sg):o(0,0)},children:[(0,i.jsx)("option",{value:"a4",children:"A4 (794 * 1123 px) (210 * 297 mm)"}),(0,i.jsx)("option",{value:"a6",children:"A6 (397 * 561 px) (105 * 148 mm)"}),(0,i.jsx)("option",{value:"cb",children:"CB (204 * 325 px) (54 * 86 mm)"}),(0,i.jsx)("option",{value:"custom",children:e("personnalis_40360")})]}),"custom"===u&&(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Nl,{hint:`${Er(t.configuration.width)}mm`,label:e("largeur_54184"),rightText:"px",shouldParseAsInt:!0,value:t.configuration.width,onChange:e=>{o(d,e)}}),(0,i.jsx)(Nl,{hint:`${Er(t.configuration.height)}mm`,label:e("hauteur_56576"),rightText:"px",shouldParseAsInt:!0,value:t.configuration.height,onChange:e=>{o(e,c)}})]}),(0,i.jsx)(gc,{state:t.configuration.bleed?"checked":"unchecked",onClick:e=>{s("checked"===e)},children:e("ajouter_des_fon_73494")}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(Nl,{hint:e("ne_doit_conteni_53122"),label:e("nom_de_la_varia_81999"),value:t.slug,onChange:l}),(0,i.jsx)(bc,{isSearchVisible:!0,label:e("lier_ce_documen_79055"),multiple:!0,values:t.populationsIds,onChange:a,children:h.map(e=>(0,i.jsx)("option",{value:e.id,children:e.value},e.id))})]})},RL=["Anton","Archivo","Arial","Arimo","Asap","Barlow","Be Vietnam Pro","Bebas Neue","Bricolage Grotesque","Chivo","Fira Sans","Georgia","IBM Plex Sans","Inter","Lato","League Gothic","Merriweather","Montserrat","Noto Sans","Nunito","Open Sans","Oswald","Oxanium","PT Sans","Playfair Display","Poppins","Raleway","Roboto","Rubik","Ubuntu"];function $L(){return(0,L.useMemo)(()=>RL.map(e=>(0,i.jsx)("option",{value:e,children:e},e)),[])}const DL=e=>{const{translate:t}=_l(),{customFields:n,getSelectedPage:s,selectPage:o,updateElementProperty:r}=yL(),a=$L(),l=(0,L.useMemo)(()=>(0,lc.A)(n.concat([{slug:"id",name:t("id_51738")},{slug:"localId",name:t("id_sur_l_v_nem_01171")},{slug:"email",name:t("Email")},{slug:"delegation.name",name:t("nom_de_la_d_l_g_28087")},{slug:"delegation.leader.firstName",name:t("pr_nom_du_respo_22241")},{slug:"delegation.leader.lastName",name:t("nom_du_responsa_44761")},{slug:"delegation.leader.phone",name:t("t_l_hpone_du_re_85143")},{slug:"name",name:t("full_name")},{slug:"ticketId",name:t("TicketId")}]),e=>e.name.toLowerCase()).map(e=>{const t=`{user.${e.slug}}`,n=`${e.name} {user.${e.slug}}`;return(0,i.jsx)("option",{value:t,children:n},e.slug)}),[n]),d=e.text.lineHeight||1.4,c=(0,Db.A)(e.text.fontSize*d,2);return(0,i.jsxs)(Na,{css:{boxShadow:"$sm",overflow:"hidden auto",paddingBottom:"$11"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Na,{css:{padding:"$2 $6"},children:(0,i.jsx)(El,{color:"invisible",leftIcon:"arrow-left",onClick:()=>{o(s().id)},children:t("retour_92202")})}),(0,i.jsx)(PM,{css:{padding:"$4 $6"},title:t("initialisation_38640"),children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(Nl,{label:t("nom_du_calque_77484"),value:e.text.name,onChange:t=>{r(e.text.id,"name",t)}}),(0,i.jsx)(Wm,{label:t("contenu_29668"),value:e.text.text,onChange:t=>{r(e.text.id,"text",t)}}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("ajouter_une_var_79098"),values:[],onChange:t=>{no(t)&&r(e.text.id,"text",`${e.text.text} ${t[0]}`.trim())},children:l})]})}),(0,i.jsx)(PM,{css:{padding:"$4 $6"},title:t("typographie_11343"),children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(bc,{isSearchVisible:!0,label:"Police",values:[e.text.fontFamily],onChange:t=>{r(e.text.id,"fontFamily",t[0]||"Open Sans")},children:a}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Nl,{label:t("taille_de_la_po_58427"),shouldParseAsInt:!0,value:e.text.fontSize,onChange:t=>{r(e.text.id,"fontSize",t)}}),(0,i.jsx)(Bm,{hint:t("soit_1_px_73099",c),label:t("hauteur_de_lign_08120"),value:d,onChange:t=>{r(e.text.id,"lineHeight",t)}})]}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Nj,{label:t("couleur_du_text_32021"),value:e.text.color,onChange:t=>{r(e.text.id,"color",t)}}),(0,i.jsxs)(zu,{label:t("graisse_de_la_p_41139"),shouldParseAsInt:!0,value:e.text.fontWeight,onChange:t=>{r(e.text.id,"fontWeight",t)},children:[(0,i.jsx)("option",{value:"400",children:"400"}),(0,i.jsx)("option",{value:"500",children:"500"}),(0,i.jsx)("option",{value:"600",children:"600"}),(0,i.jsx)("option",{value:"700",children:"700"}),(0,i.jsx)("option",{value:"800",children:"800"}),(0,i.jsx)("option",{value:"900",children:"900"})]})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",children:t("alignement_54247")}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsxs)(Na,{children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:"start"===e.text.justify?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"align-left",onClick:()=>{r(e.text.id,"justify","start")}})}),(0,i.jsx)(Cm,{placement:"top",children:t("aligner_gauch_04681")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:"center"===e.text.justify?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"align-center",onClick:()=>{r(e.text.id,"justify","center")}})}),(0,i.jsx)(Cm,{placement:"top",children:t("centrer_39779")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:"end"===e.text.justify?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"align-right",onClick:()=>{r(e.text.id,"justify","end")}})}),(0,i.jsx)(Cm,{placement:"top",children:t("aligner_droit_73883")})]})]}),(0,i.jsxs)(Na,{children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:"start"===e.text.align?"primary":"white",css:{borderBottomRightRadius:"0",borderTopRightRadius:"0"},leftIcon:"objects-align-top",onClick:()=>{r(e.text.id,"align","start")}})}),(0,i.jsx)(Cm,{placement:"top",children:t("aligner_en_haut_69916")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:"center"===e.text.align?"primary":"white",css:{borderLeft:"none",borderRadius:"0",borderRight:"none"},leftIcon:"objects-align-center-vertical",onClick:()=>{r(e.text.id,"align","center")}})}),(0,i.jsx)(Cm,{placement:"top",children:t("centrer_39779")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:"end"===e.text.align?"primary":"white",css:{borderBottomLeftRadius:"0",borderTopLeftRadius:"0"},leftIcon:"objects-align-bottom",onClick:()=>{r(e.text.id,"align","end")}})}),(0,i.jsx)(Cm,{placement:"top",children:t("aligner_en_bas_42956")})]})]})]})]}),(0,i.jsxs)(zu,{label:t("transformation_09363"),value:e.text.textTransform,onChange:t=>{r(e.text.id,"textTransform",t)},children:[(0,i.jsx)("option",{value:"none",children:t("aucune_76773")}),(0,i.jsx)("option",{value:"capitalize",children:t("capitaliser_76627")}),(0,i.jsx)("option",{value:"uppercase",children:t("majuscules_64521")}),(0,i.jsx)("option",{value:"lowercase",children:t("minuscules_02420")})]})]})}),(0,i.jsx)(wL,{element:e.text})]})},PL=()=>{const{translate:e}=_l(),{getSelectedElement:t,tab:n,setTab:s}=yL(),o=t();return"container"===o?.type?(0,i.jsx)(SL,{container:o}):"image"===o?.type?(0,i.jsx)(zL,{image:o}):"text"===o?.type?(0,i.jsx)(DL,{text:o}):(0,i.jsxs)(Na,{css:{boxShadow:"$sm",overflow:"hidden auto",py:"$6",paddingBottom:"$11"},direction:"column",gap:"6",height:1,width:1,children:[(0,i.jsx)(Na,{css:{px:"$4"},children:(0,i.jsxs)(qv,{selectedItem:n,onChange:s,children:[(0,i.jsx)(Yv,{item:"parameters",children:e("param_tres_78420")}),(0,i.jsx)(Yv,{item:"design",children:e("design_15043")})]})}),"parameters"===n&&(0,i.jsx)(OL,{}),"design"===n&&(0,i.jsx)(TL,{})]})},FL=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{borderTop:"1px solid black",height:"1px",left:"0",position:"absolute",top:"19px",width:"11px"}}),(0,i.jsx)(yr,{css:{borderRight:"1px solid black",height:"11px",left:"19px",position:"absolute",top:"0",width:"1px"}}),(0,i.jsx)(yr,{css:{borderTop:"1px solid black",height:"1px",position:"absolute",right:"0",top:"19px",width:"11px"}}),(0,i.jsx)(yr,{css:{borderRight:"1px solid black",height:"11px",position:"absolute",right:"19px",top:"0",width:"1px"}}),(0,i.jsx)(yr,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",left:"0",position:"absolute",width:"11px"}}),(0,i.jsx)(yr,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",left:"19px",position:"absolute",width:"1px"}}),(0,i.jsx)(yr,{css:{borderTop:"1px solid black",bottom:"19px",height:"1px",position:"absolute",right:"0",width:"11px"}}),(0,i.jsx)(yr,{css:{borderRight:"1px solid black",bottom:"0",height:"11px",position:"absolute",right:"19px",width:"1px"}})]}),ML=e=>{const{selectedElementId:t,selectElement:n}=yL();return(0,i.jsx)(Na,{align:e.container.align,css:{backgroundColor:e.container.hasBackground?e.container.backgroundColor:"none",border:e.container.borderSize>0?`${e.container.borderSize}px solid ${e.container.borderColor}`:"",borderRadius:e.container.borderRadius>0?`${e.container.borderRadius}px`:"0",gap:`${e.container.gap}px`,left:`${e.container.left}px`,outline:t===e.container.id?"2px solid $primary700":"",overflow:"hidden",paddingBottom:`${e.container.py||0}px`,paddingLeft:`${e.container.px||0}px`,paddingRight:`${e.container.px||0}px`,paddingTop:`${e.container.py||0}px`,position:e.container.inContainer?"static":"absolute",top:`${e.container.top}px`,zIndex:e.container.zIndex},direction:e.container.direction,height:e.container.height,justify:e.container.justify,width:e.container.width,onClick:t=>{Rl(t),n(e.container.id,e.pageId)},children:e.container.elements.map(t=>(0,i.jsx)(BL,{element:t,pageId:e.pageId},t.id))})},NL=e=>{const{selectedElementId:t,selectElement:n}=yL();return(0,i.jsx)(yr,{css:{border:e.image.borderSize>0?`${e.image.borderSize}px solid ${e.image.borderColor}`:"",borderRadius:e.image.borderRadius>0?`${e.image.borderRadius}px`:"0",left:`${e.image.left}px`,outline:t===e.image.id?"2px solid $primary700":"",overflow:"hidden",paddingBottom:`${e.image.py||0}px`,paddingLeft:`${e.image.px||0}px`,paddingRight:`${e.image.px||0}px`,paddingTop:`${e.image.py||0}px`,position:e.image.inContainer?"static":"absolute",top:`${e.image.top}px`,transform:e.image.hasRotate?`rotate(${e.image.rotateDegree}deg)`:void 0,transformOrigin:e.image.hasRotate?"top left":void 0,zIndex:e.image.zIndex},height:e.image.height,width:e.image.width,onClick:t=>{Rl(t),n(e.image.id,e.pageId)},children:m(e.image.source)&&(0,i.jsx)("img",{height:"100%",src:(s=e.image.source,"{user.picture}"===s?`${P.HEAVENT_ASSETS_URL}/badges/profile.jpg`:"{user.qrcode}"===s||"{user.skidata}"===s?dg("https://weezevent.com",{height:360,width:360}):"{user.code39}"===s?dg("12345678",{barcodeType:lg.Code39,height:28,width:234}):s),width:"100%"})});var s},LL=e=>{const{selectedElementId:t,selectElement:n}=yL(),s=rz(e.text.text);return(0,i.jsx)(Na,{align:e.text.align,css:{backgroundColor:e.text.hasBackground?e.text.backgroundColor:"none",border:e.text.borderSize>0?`${e.text.borderSize}px solid ${e.text.borderColor}`:"",borderRadius:e.text.borderRadius>0?`${e.text.borderRadius}px`:"0",color:e.text.color,fontFamily:e.text.fontFamily,fontSize:`${e.text.fontSize}px`,fontWeight:e.text.fontWeight,left:`${e.text.left}px`,lineHeight:e.text.lineHeight||1.4,outline:t===e.text.id?"2px solid $primary700":"",overflow:"hidden",paddingBottom:`${e.text.py||0}px`,paddingLeft:`${e.text.px||0}px`,paddingRight:`${e.text.px||0}px`,paddingTop:`${e.text.py||0}px`,position:e.text.inContainer?"static":"absolute",textAlign:e.text.justify,textTransform:e.text.textTransform,top:`${e.text.top}px`,transform:e.text.hasRotate?`rotate(${e.text.rotateDegree}deg)`:void 0,transformOrigin:e.text.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.text.zIndex,"& em":{fontStyle:"italic"},"& s":{textDecoration:"line-through"},"& strong":{fontWeight:700},"& u":{textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:s},height:e.text.height,justify:e.text.justify,width:e.text.width,onClick:t=>{Rl(t),n(e.text.id,e.pageId)}})},BL=e=>"container"===e.element.type?(0,i.jsx)(ML,{container:e.element,pageId:e.pageId}):"image"===e.element.type?(0,i.jsx)(NL,{image:e.element,pageId:e.pageId}):"text"===e.element.type?(0,i.jsx)(LL,{pageId:e.pageId,text:e.element}):null,VL=e=>{const{translate:t}=_l(),{customDocument:n,addPage:s,removePage:o,selectedPageId:r,selectPage:a}=yL(),l=n.configuration.pages.length>1,d=n.configuration.bleed?19:0;return(0,i.jsxs)(Na,{css:{height:"fit-content",width:"fit-content"},direction:"column",gap:"2",children:[(0,i.jsxs)(Na,{align:"center",children:[(0,i.jsx)(yr,{css:{cursor:"pointer",flex:"1"},fontWeight:"semiBold",onClick:t=>{Rl(t),a(e.page.id)},children:m(e.page.name)?e.page.name:t("page_1_33637",e.index+1)}),(0,i.jsxs)(Na,{gap:"2",children:[(0,i.jsx)(El,{color:"white",leftIcon:"plus",size:"sm",onClick:s}),(0,i.jsx)(El,{color:"white",disabled:!l,leftIcon:"trash-can",size:"sm",onClick:()=>{o(e.page.id)}})]})]}),(0,i.jsxs)(Na,{css:{background:"white",padding:`${d}px`,position:"relative"},height:2*d+n.configuration.height,width:2*d+n.configuration.width,children:[n.configuration.bleed&&(0,i.jsx)(FL,{}),(0,i.jsx)(Na,{css:{background:"white",outline:r===e.page.id?"2px solid $primary700":"",position:"relative"},height:n.configuration.height,width:n.configuration.width,onClick:t=>{Rl(t),a(e.page.id)},children:e.page.elements.map(t=>(0,i.jsx)(BL,{element:t,pageId:e.page.id},t.id))})]})]})},UL=()=>{const{customDocument:e,cleanSelecteds:t}=yL(),[n,s]=(0,L.useState)(100);return(0,i.jsxs)(yr,{css:{background:"$gray100",position:"relative"},height:1,width:1,children:[(0,i.jsx)(Na,{align:"center",css:{overflow:"auto",padding:"$9",zoom:`${n}%`},direction:"column",gap:"7",height:1,width:1,onClick:t,children:e.configuration.pages.map((e,t)=>(0,i.jsx)(VL,{index:t,page:e},e.id))}),(0,i.jsx)(yr,{css:{bottom:"24px",position:"absolute",right:"24px",zIndex:1e3},width:140,children:(0,i.jsxs)(zu,{shouldParseAsInt:!0,value:n,onChange:s,children:[(0,i.jsx)("option",{value:"50",children:"Zoom (50%)"}),(0,i.jsx)("option",{value:"66",children:"Zoom (66%)"}),(0,i.jsx)("option",{value:"80",children:"Zoom (80%)"}),(0,i.jsx)("option",{value:"100",children:"Zoom (100%)"}),(0,i.jsx)("option",{value:"120",children:"Zoom (120%)"}),(0,i.jsx)("option",{value:"150",children:"Zoom (150%)"}),(0,i.jsx)("option",{value:"200",children:"Zoom (200%)"})]})})]})},WL=e=>{const{deleteElement:t,duplicateElement:n,selectedElementId:s,selectElement:o}=yL();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{background:s===e.element.id?"$primary300":"none",borderRadius:"$1",color:s===e.element.id?"$primary700":"$gray800",cursor:"pointer",padding:"$2","& .h-duplicate, & .h-delete":{display:"none"},"&:hover":{background:"$primary300",color:"$primary700","& .h-duplicate, & .h-delete":{display:"block"}}},gap:"3",width:250,onClick:()=>{o(e.element.id,e.pageId)},children:[(0,i.jsx)(yr,{fontSize:"textMd",children:(0,i.jsx)(el,{icon:(r=e.element,"container"===r.type?"column"===r.direction?"chart-simple-horizontal":"chart-simple":"image"===r.type?"image":"text")})}),(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(yr,{css:{ellipsis:!0},fontSize:"textSm",fontWeight:"medium",title:e.element.name,width:1,children:e.element.name})}),(0,i.jsx)(yr,{className:"h-duplicate",onClick:t=>{Rl(t),n(e.element.id)},children:(0,i.jsx)(el,{icon:"copy"})}),(0,i.jsx)(yr,{className:"h-delete",onClick:n=>{Rl(n),t(e.element.id)},children:(0,i.jsx)(el,{icon:"trash-can"})})]}),"container"===e.element.type&&(0,i.jsx)(Na,{css:{paddingLeft:"$8"},direction:"column",children:e.element.elements.map(t=>(0,i.jsx)(WL,{element:t,pageId:e.pageId},t.id))})]});var r},GL=e=>{const{translate:t}=_l(),{duplicatePage:n,selectedPageId:s,selectPage:o}=yL(),r=m(e.page.name)?e.page.name:t("page_1_33637",e.index+1);return(0,i.jsx)(PM,{css:{gap:"0",width:"fit-content"},title:(0,i.jsxs)(Na,{align:"center",css:{background:s===e.page.id?"$primary300":"",borderRadius:"$1",color:"$gray800",fontWeight:"$medium",padding:"$2","& .h-duplicate":{display:"none"},"&:hover":{background:"$primary300","& .h-duplicate":{display:"block"}}},gap:"3",width:250,onClick:t=>{Rl(t),o(e.page.id)},children:[(0,i.jsx)(yr,{fontSize:"textMd",children:(0,i.jsx)(el,{icon:"frame"})}),(0,i.jsx)(yr,{css:{flex:"1"},children:r}),(0,i.jsx)(yr,{className:"h-duplicate",onClick:t=>{Rl(t),n(e.page.id)},children:(0,i.jsx)(el,{icon:"copy"})})]}),titleCss:{gap:"$2"},children:(0,i.jsx)(Na,{css:{paddingLeft:"$8"},direction:"column",children:e.page.elements.map(t=>(0,i.jsx)(WL,{element:t,pageId:e.page.id},t.id))})})},HL=()=>{const{customDocument:e}=yL();return(0,i.jsx)(Na,{css:{overflowY:"auto"},direction:"column",height:1,width:1,children:e.configuration.pages.map((e,t)=>(0,i.jsx)(GL,{index:t,page:e},e.id))})},qL=()=>{const{history:e,params:{organizationId:t,eventId:n,customDocumentId:s},translate:o}=_l(),{mutate:r,isLoading:a}=function(e={}){return Xn("mutation CustomDocumentUpdate(\n $eventId: EventId!\n $customDocumentId: CustomDocumentId!\n $customDocument: CustomDocumentInput!\n) {\n customDocumentUpdate(\n eventId: $eventId\n customDocumentId: $customDocumentId\n customDocument: $customDocument\n ) {\n id\n }\n}\n",e)}(),{customDocument:l}=yL(),d=(0,L.useMemo)(()=>JSON.stringify(l),[a]),[c,u]=(0,L.useState)(!1),h=(0,L.useCallback)(()=>{JSON.stringify(l)===d?e.goBack($s.DOCUMENTS(t,n)):u(!0)},[l,d]);return Dd(o("mise_jour_de_17055",l.name)),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Pm,{button:(0,i.jsx)(El,{isLoading:a,onClick:async()=>{await r({eventId:n,customDocumentId:s,customDocument:l})},children:o("enregistrer_06519")}),category:o("document_person_69340"),color:"dark",heading:l.name,onClose:h,children:(0,i.jsxs)(Na,{height:1,width:1,children:[(0,i.jsx)(yr,{height:1,width:420,children:(0,i.jsx)(PL,{})}),(0,i.jsx)(yr,{css:{flex:"1"},height:1,children:(0,i.jsx)(UL,{})}),(0,i.jsx)(yr,{height:1,width:340,children:(0,i.jsx)(HL,{})})]})}),(0,i.jsx)(qS,{fallbackPath:$s.DOCUMENTS(t,n),isOpen:c,onClose:()=>u(!1)})]})},YL=()=>{const{history:e,params:{organizationId:t,eventId:n,customDocumentId:s}}=_l(),{data:o,loader:r}=Zn('query CustomDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $customDocumentId: CustomDocumentId!\n) {\n organization(id: $organizationId) {\n population: customFieldBySlug(slug: "population") {\n values {\n id\n value\n }\n }\n\n customFields(variety: UserInfo, privacy: All, sort: { attribute: Name, direction: Asc }) {\n nodes {\n ...ConditionCustomField\n }\n }\n }\n\n event(id: $eventId) {\n customDocument(customDocumentId: $customDocumentId) {\n name\n slug\n populationsIds\n configuration\n }\n }\n}\n',{organizationId:t,eventId:n,customDocumentId:s},[Ls.ConditionCustomFieldFragment]),a=qn(xL);return r||o.event?.customDocument||e.replace($s.DOCUMENTS(t,n)),r||(0,i.jsx)(CL,{customFields:o.organization.customFields.nodes,initialCustomDocument:a.customDocumentInputDefault(o.event.customDocument),population:o.organization.population,children:(0,i.jsx)(qL,{})})},KL=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=_l(),{mutate:o}=function(e={}){return Xn("mutation CustomDocumentCreate($eventId :EventId!, $customDocument: CustomDocumentInput!){\n customDocumentCreate(eventId: $eventId, customDocument: $customDocument){\n id\n }\n}\n",e)}(),r=qn(xL),[a,d]=(0,L.useState)(""),[c,u]=(0,L.useState)(""),[g,p]=(0,L.useState)(!1),f=(0,L.useCallback)(e=>{d(e),g||u(h(e,{replacer:l.Empty}))},[g,d,u]),x=(0,L.useCallback)(e=>{m(e)?(u(h(e,{replacer:l.Empty})),p(!0)):(u(""),p(!1))},[u,p]);return(0,i.jsxs)(Rb,{children:[(0,i.jsx)($b,{children:(0,i.jsx)(El,{children:t("cr_er_un_docume_92512")})}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"file",children:t("nouveau_documen_36722")}),(0,i.jsxs)(Tb,{gap:"5",children:[(0,i.jsx)(Nl,{label:t("nom_du_document_22604"),value:a,onChange:f}),(0,i.jsx)(Nl,{hint:t("ne_doit_conteni_53122"),label:t("nom_de_la_varia_81999"),value:c,onChange:x})]}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{onClick:async()=>{const{customDocumentCreate:t}=await o({eventId:s,customDocument:{name:a,slug:c,populationsIds:[],configuration:r.getConfigurationDefault()}});e.push($s.EDIT_CUSTOM_DOCUMENT(n,s,t.id))},children:t("cr_er_le_docume_02657")})})]})]})},ZL=e=>(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{font:"gray900 textLg medium",children:e.title}),(0,i.jsx)(Na,{css:{background:"white",bd:!0,"& > div:last-child":{borderBottom:"none"}},direction:"column",children:e.children})]}),XL=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),{showNotification:r}=kb(),{mutate:a}=function(e={}){return Xn("mutation CustomDocumentDuplicate($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDuplicate(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),{mutate:l}=function(e={}){return Xn("mutation CustomDocumentDelete($eventId: EventId!, $customDocumentId: CustomDocumentId!) {\n customDocumentDelete(eventId: $eventId, customDocumentId: $customDocumentId) {\n id\n }\n}\n",e)}(),[d,c]=(0,L.useState)(!1),u=vL(e.customDocument.configuration.height,e.customDocument.configuration.width),h=e.customDocument.populations.join(", ");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Na,{align:"center",css:{background:"$success100",borderRadius:"$3",color:"$success700",fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(el,{icon:"pen-ruler"})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[e.disabled?(0,i.jsx)(yr,{font:"gray800 textMd medium",children:e.customDocument.name}):(0,i.jsx)(qc,{css:{fontSize:"$textMd"},to:$s.DOCUMENTS_USER_CUSTOM_DOCUMENT(s,o,e.userInfoId,e.customDocument.id),children:e.customDocument.name}),(0,i.jsx)(yr,{color:"gray500",children:n("cr_par_1_69201",e.customDocument.createdBy.nameOrEmail)})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",width:100,children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:n("populations_48141")}),(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:h,width:1,children:m(h)?h:"-"})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",width:85,children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:n("format_54368")}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:"custom"===u?n("personnalis_40360"):u.toUpperCase()})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:n("nom_de_la_varia_81999")}),(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:`{user.documents.${e.customDocument.slug}}`,width:1,children:`{user.documents.${e.customDocument.slug}}`})]}),(0,i.jsx)(Bb,{permissions:Nb.DOCUMENT_EDIT,children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{t.push($s.EDIT_CUSTOM_DOCUMENT(s,o,e.customDocument.id))}})}),(0,i.jsx)(Cm,{placement:"top",children:n("_diter_62574")})]})}),(0,i.jsx)(Bb,{permissions:Nb.DOCUMENT_EDIT,children:(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical",size:"sm"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>{await a({eventId:o,customDocumentId:e.customDocument.id}),e.reload()},children:n("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:n("supprimer_43083")})]})]})})]}),d&&(0,i.jsx)(sA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_81333"),text:n("suppression_de_73669",e.customDocument.name),onClose:()=>{c(!1)},onDelete:async()=>{await l({eventId:o,customDocumentId:e.customDocument.id}),r(n("le_document_1_14516",e.customDocument.name)),e.reload()}})]})},JL=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>(0,lc.A)(e.customDocuments,e=>e.name.toLowerCase()),[e.customDocuments]);return(0,i.jsx)(ZL,{title:t("documents_perso_87374"),children:n.map(t=>(0,i.jsx)(XL,{customDocument:t,disabled:0===e.numberOfVolunteersRegistrations,reload:e.reload,userInfoId:e.userInfoId},t.id))})},QL=e=>{const{translate:t}=_l();return(0,i.jsxs)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",px:"$6"},gap:"4",height:74,width:1,children:[(0,i.jsx)(Na,{align:"center",css:{background:fr.colors[`${e.color}100`],borderRadius:"$3",color:fr.colors[`${e.color}700`],fontSize:"$textMd"},height:40,justify:"center",width:40,children:(0,i.jsx)(el,{icon:e.icon})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[e.disabled?(0,i.jsx)(yr,{font:"gray800 textMd medium",children:e.title}):(0,i.jsx)(qc,{css:{fontSize:"$textMd"},to:e.path,children:e.title}),e.disabled&&(0,i.jsx)(ic,{color:"warning",size:"sm",children:t("le_document_n_e_47973")})]}),(0,i.jsx)(yr,{color:"gray500",children:t("cr_par_1_69201","WeezCrew")})]}),m(e.variable)&&(0,i.jsxs)(Na,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:t("nom_de_la_varia_81999")}),(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray800 textSm medium",title:"",width:1,children:`{user.documents.${e.variable}}`})]}),void 0!==e.count&&!e.disabled&&(0,i.jsxs)(Na,{direction:"column",gap:"1",width:150,children:[(0,i.jsx)(yr,{font:"gray500 textXs regular",children:e.text}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:e.count})]})]})},eB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l();return(0,i.jsxs)(ZL,{title:t("_v_nement_22345"),children:[(0,i.jsx)(QL,{color:"pink",icon:"list-ul",path:$s.DOCUMENTS_VOLUNTEERS_LISTING(n,s,e.volunteersSegmentId),text:t("nombre_de_membr_87049"),title:t("liste_des_membr_89037")}),(0,i.jsx)(QL,{color:"purple",icon:"calendar-day",path:$s.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(n,s,e.positionsSegmentId),text:t("nombre_de_missi_56719"),title:t("planning_d_un_g_23684")}),(0,i.jsx)(QL,{color:"purple",icon:"calendar-day",path:$s.DOCUMENTS_PLANNING(n,s,e.positionsSegmentId),text:t("nombre_de_missi_56719"),title:t("planning_de_l_96909")}),(0,i.jsx)(QL,{color:"purple",icon:"image",path:$s.DOCUMENTS_USERS_PICTURES(n,s,e.volunteersSegmentId),text:"",title:t("trombinoscope_11316")})]})},tB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{organization:o}=yI();return(0,i.jsxs)(ZL,{title:t("membres_11310"),children:[(0,i.jsx)(QL,{color:"pink",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"user",path:$s.DOCUMENTS_ASSIGNMENTS(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("fiche_d_affecta_91461"),variable:"assignments"}),(0,i.jsx)(QL,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:$s.DOCUMENTS_USER_PLANNING(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanning"),variable:"planning"}),(0,i.jsx)(QL,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:$s.DOCUMENTS_USER_PLANNING_LIST(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanningList"),variable:"planningList"}),(0,i.jsx)(QL,{color:"purple",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"calendar-day",path:$s.DOCUMENTS_USER_PLANNING_DAYS(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserPlanningDays"),variable:"planningDays"}),(0,i.jsx)(QL,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"certificate",path:$s.DOCUMENTS_CERTIFICATE(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("Certificate"),variable:"certificate"}),(0,i.jsx)(QL,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"id-card",path:$s.DOCUMENTS_BADGE(n,s,e.assignedUserInfoId,"generic"),text:t("nombre_de_membr_87049"),title:t("BadgeCheck"),variable:"badge"}),(0,i.jsx)(QL,{color:"success",count:e.numberOfAssignedVolunteersRegistrations,disabled:0===e.numberOfAssignedVolunteersRegistrations,icon:"clock",path:$s.DOCUMENTS_HOURS(n,s,e.assignedUserInfoId),text:t("nombre_de_membr_87049"),title:t("UserHours"),variable:"hours"}),o.customBadges.map(o=>(0,i.jsx)(QL,{color:"success",count:e.numberOfVolunteersRegistrations,disabled:!1,icon:"id-card",path:$s.DOCUMENTS_BADGE(n,s,e.userInfoId,o),text:t("nombre_de_membr_87049"),title:P_(o),variable:o.toLowerCase()},o))]})},nB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l();return(0,i.jsxs)(ZL,{title:t("missions_63972"),children:[(0,i.jsx)(QL,{color:"blueGray",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"sitemap",path:$s.DOCUMENTS_POSITION(n,s,e.positionId),text:t("nombre_de_fiche_03009"),title:t("fiche_de_missio_00324")}),(0,i.jsx)(QL,{color:"purple",count:e.numberOfPositions,disabled:0===e.numberOfPositions,icon:"calendar-day",path:$s.DOCUMENTS_POSITION_PLANNING(n,s,e.positionId),text:t("nombre_de_missi_56719"),title:t("planning_d_une_64581")})]})},iB=e=>{const{hasFeature:t}=yI(),n=e.event.volunteersRegistrations.nodes[0]?.userInfoId??-1;return(0,i.jsxs)(Na,{direction:"column",gap:"7",children:[t(Ne.CustomDocument)&&no(e.event.customDocuments)&&(0,i.jsx)(JL,{customDocuments:e.event.customDocuments,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,reload:e.reload,userInfoId:n}),(0,i.jsx)(tB,{assignedUserInfoId:e.event.assignedVolunteersRegistrations.nodes[0]?.userInfoId??-1,numberOfAssignedVolunteersRegistrations:e.event.assignedVolunteersRegistrations.totalCount,numberOfVolunteersRegistrations:e.event.volunteersRegistrations.totalCount,userInfoId:n}),(0,i.jsx)(nB,{numberOfPositions:e.event.positions.totalCount,positionId:e.event.positions.nodes[0]?.id??-1}),(0,i.jsx)(eB,{positionsSegmentId:e.event.positionsSegments[0].id,volunteersSegmentId:e.event.volunteersSegments[0].id})]})},sB=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(oc,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(oc,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(oc,{borderRadius:"$2",height:74,width:1})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(oc,{borderRadius:"$1",height:25,width:1}),(0,i.jsx)(oc,{borderRadius:"$2",height:74,width:1}),(0,i.jsx)(oc,{borderRadius:"$2",height:74,width:1})]})]}),oB=()=>{const{translate:e,params:{eventId:t}}=_l(),{hasFeature:n}=yI(),{event:{name:s}}=vb(),{canDocumentEdit:o}=wS();Dd(`${s} ${e("Documents")}`);const{data:r,isLoading:a,reload:l}=Zn('query Documents($eventId: EventId!) {\n event(id: $eventId) {\n customDocuments {\n id\n name\n slug\n configuration\n populations\n\n createdBy {\n nameOrEmail\n }\n }\n\n positions(limit: 1) {\n nodes {\n id\n }\n\n totalCount\n }\n\n volunteersRegistrations(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n\n assignedVolunteersRegistrations: volunteersRegistrations(\n states: [Assigned]\n limit: 1\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n userInfoId\n }\n\n totalCount\n }\n\n volunteersSegments: segments(segmentType: Volunteers) {\n id\n }\n\n positionsSegments: segments(segmentType: Positions) {\n id\n }\n }\n}\n',{eventId:t},[]);return(0,i.jsxs)(nj,{children:[(0,i.jsxs)(tj,{gap:"3",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray900 displayXs semiBold",children:e("Documents")}),(0,i.jsx)(yr,{color:"gray500",children:e("retrouver_et_pe_99652")})]}),n(Ne.CustomDocument)&&o&&(0,i.jsx)(KL,{})]}),(0,i.jsx)(ej,{children:n(Ne.Documents)?a?(0,i.jsx)(sB,{}):(0,i.jsx)(iB,{event:r.event,reload:l}):(0,i.jsx)(Na,{align:"center",css:{flex:"1"},direction:"column",justify:"center",children:(0,i.jsx)(kI,{icon:"folders"})})})]})};var rB;function aB(){return aB=Object.assign?Object.assign.bind():function(e){for(var t=1;t div":{alignItems:"center",background:"$success400",borderRadius:"$1",display:"flex",height:"100%",justifyContent:"center",width:"100%","& svg":{height:"50%"}}}),mB=pr(yr,{background:`url(${dB}) no-repeat`,borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray700",height:"48px",width:"100px"}),gB=pr(yr,{alignItems:"center",borderBottom:"1px solid $gray100",borderRight:"1px solid $gray100",color:"$gray800",display:"flex",height:"48px",padding:"$2",width:"100px","& > div":{alignItems:"center",border:"1px dashed $gray300",borderRadius:"$1",display:"flex",fontSize:"$textXs",height:"100%",justifyContent:"center",width:"100%"}}),pB=e=>{const t=Yn(),n=qn(Kc),s=(0,L.useMemo)(()=>ah(e.slots.map(({range:e})=>e).reduce((e,t)=>e.union(t),e.slots[0].range)),[e.slots]),o=e.slots[0].range.start;return(0,i.jsxs)(Na,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(Na,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(yr,{font:"gray900 textXl medium",children:t("planning_1_14391",e.position.name)})}),(0,i.jsxs)(Na,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(Na,{children:[(0,i.jsx)(cB,{width:200,children:t("jours_88317")}),(0,Oc.A)(0,s).map(t=>{const s=o.plus({days:t}),r=jh(s,e.slots);return(0,i.jsx)(cB,{width:100*(r.length||1),children:n.toLocaleString(s,Js.DateOnly.MonthShort)},t)})]}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(cB,{width:200,children:t("cr_neaux_33401")}),(0,Oc.A)(0,s).map(t=>{const n=jh(o.plus({days:t}),e.slots);return 0===n.length||n[0].isAddedSlot?(0,i.jsx)(mB,{},`${t}`):n.map(e=>(0,i.jsx)(cB,{width:100,children:e.range.toFormat("HH:mm",{separator:"-"})},`${t}-${e.id}`))})]}),e.volunteersRegistrations.map(n=>{const r=n.userInfo;return(0,i.jsxs)(Na,{children:[(0,i.jsxs)(uB,{children:[(0,i.jsx)(Jg,{email:r.email,image:r.picture?.url,name:r.name,size:24}),(0,i.jsx)(yr,{css:{flex:"1",ellipsis:""},title:r.name,children:r.name})]}),(0,Oc.A)(0,s).map(s=>{const r=jh(o.plus({days:s}),e.slots);return 0===r.length||r[0].isAddedSlot?(0,i.jsx)(mB,{},`${s}`):r.map(e=>{const o=`${s}-${e.id}`,r=void 0!==n.positionsSlotsUsersInfos.find(({positionSlotId:t})=>t===e.id),a=n.positionsSlotsUsersInfos.some(({positionSlot:t})=>t.range.overlaps(e.range)),l=n.slots.some(t=>t.range.engulfs(e.range));return r?(0,i.jsx)(hB,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(lB,{})})},o):l&&!a?(0,i.jsx)(gB,{children:(0,i.jsx)(yr,{children:t("disponible_69523")})},o):(0,i.jsx)(mB,{},o)})})]},n.id)})]})]})},fB=e=>{const t=Yn(),n=(0,L.useMemo)(()=>(0,lc.A)(lh(e.event.position.slots),e=>e.range.start).filter(t=>{if(e.date?.isValid&&e.endDate?.isValid){const n=Us.IX.fromDateTimes(e.date.startOf("day"),e.endDate.endOf("day"));return t.range.overlaps(n)}return!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day"))}),[e.event,e.date,e.endDate]),s=(0,L.useMemo)(()=>{if(no(n)){const e=ah(n.map(({range:e})=>e).reduce((e,t)=>e.union(t),n[0].range)),t=n[0].range.start;return(0,Oc.A)(0,e).flatMap(e=>{const i=t.plus({days:e}),s=jh(i,n);return no(s)?s:[{id:i.toMillis(),range:Us.IX.fromDateTimes(i.startOf("day"),i.endOf("day")),isAddedSlot:!0}]})}return[]},[n]);return no(s)?(0,i.jsx)(i.Fragment,{children:(0,Yg.A)(s,8).map((t,n)=>(0,Yg.A)(e.event.volunteersRegistrations.nodes,11).map((s,o)=>(0,i.jsx)(pB,{position:e.event.position,slots:t,volunteersRegistrations:s},`${n}-${o}`)))}):(0,i.jsx)(Na,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:(0,i.jsx)(Na,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(yr,{font:"gray900 textXl medium",children:t("planning_1_14391",e.event.position.name)})})})},xB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{user:o}=si(),{checkDocumentsExport:r}=kb(),[a,l]=(0,L.useState)([e.segmentsFolders[0].segments[0].id]),[d,c]=(0,L.useState)(e.languages[0]),[u,h]=(0,L.useState)(Us.c9.invalid("Invalid")),[m,g]=(0,L.useState)(we.OnePerPage),[p,f]=(0,L.useState)(!1),x=(0,L.useMemo)(()=>e.showStrategy&&(!e.badgeType||function(e){try{return function(e,t){switch(e){case fe.Animajeconvention:case fe.Asoassignment:case fe.Cerclestaff:case fe.Cerclelivraison:case fe.Cerclepressandpartenaire:case fe.Cercleopcom:case fe.Delta:case fe.Dfcoa4:case fe.Dfcosmall:throw new Error("Not implemented");case fe.Eurockeennes:return(0,i.jsx)(ip,{event:t});case fe.Fcg:return(0,i.jsx)(ap,{event:t});case fe.Garorockplanning:case fe.Goldencoast:case fe.Hbcldc:case fe.Hbclnh:case fe.Lnh:case fe.Moorea:case fe.Nuitssecretes:case fe.Openbrest:case fe.P2nassignment:case fe.P2nassignmentmontagedemontage:case fe.P2nbadge:case fe.Paris20km:case fe.Paris20kmassignment:case fe.Paris20kmcontremarque:case fe.Pastourelle:case fe.Pastourelleexposant:case fe.Pec:case fe.Playground:case fe.Roiarthur:case fe.Rose:case fe.Roseparking:throw new Error("Not implemented");case fe.Salamandre:return(0,i.jsx)(Jx,{event:t});case fe.T24assignment:case fe.Triathlonlarochellebadge:case fe.Utopialesimprimeur:case fe.Utopialesa4:case fe.Vandbcontremarque:case fe.Vannes:case fe.Vannesassignment:case fe.Vendanges:case fe.Vendeeglobebadge:case fe.Vendeeglobecontremarque:throw new Error("Not implemented");default:rl()}}(e,{}),!0}catch(e){return"Not implemented"!==e.message}}(e.badgeType)),[e.badgeType,e.showStrategy]);return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Na,{align:"center",css:{background:"$primary50",borderRadius:"48px",color:"$primary700",height:"48px",fontSize:"20px",width:"48px"},justify:"center",children:(0,i.jsx)(el,{icon:"envelope"})})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:e.title}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",dangerouslySetInnerHTML:{__html:t("en_2_clics_rec_97175")},textAlign:"center"}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(sl,{color:"gray",leftIcon:"circle-exclamation",children:t("l_e_mail_peut_m_13253")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{css:{flex:"1",overflowY:"auto"},direction:"column",gap:"4",children:[(0,i.jsx)(bc,{isSearchVisible:!0,label:t("vue_s_personna_35768"),multiple:!0,placeholder:t("s_lectionnez_un_53633"),values:a,onChange:l,children:e.segmentsFolders.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))},e.id))}),e.languages.length>1&&(0,i.jsx)(zu,{label:t("Language"),placeholder:t("Language"),value:d,onChange:e=>{c(e)},children:e.languages.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),e.showDate&&(0,i.jsx)(Du,{label:t("exportez_vos_do_87332"),max:e.endAt,min:e.startAt,value:u,onChange:h}),x&&(0,i.jsx)(zu,{label:t("strat_gie_44389"),value:m,onChange:e=>g(e),children:rn.map(e=>(0,i.jsx)("option",{value:e,children:t(e)},e))}),(0,i.jsx)(gc,{state:p?"checked":"unchecked",onClick:e=>{f("checked"===e)},children:t("fusionner_les_d_64130")}),(0,i.jsx)(Nl,{label:t("Email"),state:"disabled",value:o?.email??"",onChange:Ql.A})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{isLoading:e.isSendLoading,onClick:async()=>{const t=await e.onSend(a,d,p,m,u.isValid?u:void 0);r(t,n,s),e.onClose()},children:t("envoyer_26609")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},_B=e=>{const t=Yn(),{mutate:n,isLoading:s}=Po(),[o,r]=L.useState(!1);return(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(bj,{returnPathFallback:$s.DOCUMENTS(e.organizationId,e.eventId)}),(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"medium",children:e.title}),(0,i.jsx)(Bb,{rolesTypes:fI,children:e.extraButton}),(0,i.jsx)(Bb,{rolesTypes:fI,children:(0,i.jsx)(El,{isLoading:s,onClick:()=>{r(!0)},children:t("param_trer_l_ex_83342")})}),o&&(0,i.jsx)(xB,{badgeType:e.badgeType,endAt:e.endAt,isSendLoading:s,languages:e.languages,segmentsFolders:e.segmentsFolders,showDate:e.showDate,showStrategy:e.showStrategy,startAt:e.startAt,title:t("envoi_de_vos_do_32953"),onClose:()=>{r(!1)},onSend:async(t,i,s,o,r)=>{const{eventDocumentsExport:a}=await n({organizationId:e.organizationId,eventId:e.eventId,documentsExport:{documentType:e.documentType,badgeType:e.badgeType,customDocumentSlug:e.customDocumentSlug,segmentsIds:t,language:i,oneFile:s,strategy:o,date:r}});return a}})]})},IB=e=>(0,i.jsx)(Na,{css:{background:"$gray50",border:"1px solid $gray200",flex:"1",padding:"$7",overflowX:"hidden",overflowY:"auto"},height:1,justify:"center",children:(0,i.jsx)(Na,{css:{boxShadow:"$md",borderRadius:"$2",height:"fit-content",overflow:"hidden"},direction:"column",width:e.width,children:e.children})});const vB=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,positionId:r}}=_l(),[a,l,d]=Bc(""),{positionsOptions:c,isLoading:u}=function({eventId:e,hasSelected:t,nameDebounced:n,organizationId:s,positionsIds:o}){const{data:r,isLoading:a}=(l={organizationId:s,eventId:e,hasSelected:t,name:m(n)?n:void 0,ids:o},Zn(fo,l,[]));var l;const d=L.useMemo(()=>(0,lc.A)((0,ph.A)((r.organization?.list.nodes??[]).concat(r.organization?.selected.nodes??[]),e=>e.id),e=>e.name.toLowerCase()),[r.organization]);return{positionsOptions:L.useMemo(()=>d.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[d]),isLoading:a}}({organizationId:s,eventId:o,hasSelected:!0,positionsIds:[r],nameDebounced:l});return(0,i.jsxs)(Na,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(yr,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_94895")}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(bc,{isSearchLoading:u,isSearchVisible:!0,searchElement:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:n("rechercher_une_69998"),state:"search",value:a,onChange:d}),values:[r],onChange:n=>{no(n)&&t.replace(e.getPath(n[0]))},children:c})})]})},bB=()=>{const{translate:e,params:{organizationId:t,eventId:n,positionId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query PositionPlanningDocument($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n ...DocumentPositionPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,positionId:s},[Ls.DocumentPositionPlanningFragment,Ls.EventPositionsExportFragment]);return Dd(`${o.name} ${e("planning_d_une_64581")}`),(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.PositionPlanning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,title:e("planning_d_une_64581")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(vB,{getPath:e=>$s.DOCUMENTS_POSITION_PLANNING(t,n,e)}),(0,i.jsx)(IB,{children:(0,i.jsx)(fB,{event:r.event})})]})]})},jB=e=>{const t=Yn(),n=m(e.acronym)?`${e.name} (${e.acronym})`:e.name;return(0,i.jsxs)(Na,{css:{background:"$gray100",padding:"$7 56px"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"displayXs",fontWeight:"medium",children:n}),(0,i.jsx)(yr,{color:"gray800",children:t("fiche_de_missio_00324")})]})},CB=e=>{const t=Yn(),n=qn(rC),s=(0,L.useMemo)(()=>e.slugsToDisplay||[],[e.slugsToDisplay]),o=(0,L.useMemo)(()=>Object.fromEntries(s.flatMap(t=>{const n=e.customFields.find(e=>e.slug===t);return n?[[t,n]]:[]})),[s,e.customFields]),r=(0,L.useMemo)(()=>(0,lc.A)(e.volunteers,e=>e.userInfo.name),[e.volunteers]);return(0,i.jsxs)(kc,{children:[(0,i.jsx)(jc,{css:{height:"32px"},children:s.map(e=>{const n=o[e];return"email"===e?(0,i.jsx)(Vc,{children:t("Email")},e):"fullName"===e?(0,i.jsx)(Vc,{children:t("full_name")},e):"picture"===e&&n?(0,i.jsx)(Vc,{width:80,children:n.name},e):"teamCode"===e?(0,i.jsx)(Vc,{children:t("code_quipe_14296")},e):n?(0,i.jsx)(Vc,{children:n.name},e):(0,i.jsx)(Vc,{},e)})}),r.map(e=>{const t=e.userInfo;return(0,i.jsx)(Dc,{css:{height:"28px"},children:s.map(s=>{const r=o[s];return"email"===s?(0,i.jsx)(Ec,{children:t.email},s):"fullName"===s?(0,i.jsx)(Vc,{css:{color:"$gray800"},children:t.name},s):"picture"===s&&r?(0,i.jsx)(Ec,{width:80,children:(0,i.jsx)(Jg,{email:t.email,image:t.picture?.url,name:t.name,size:32})},s):"teamCode"===s?(0,i.jsx)(Ec,{children:e.teams.map(e=>e.teamCode).join(", ")},s):r?(0,i.jsx)(Ec,{children:n.getValueString(r,t.fields)},s):(0,i.jsx)(Ec,{},s)})},t.id)})]})},yB=e=>{const t=Yn(),{isRenamed:n,finalName:s,rangeString:o}=PT(e.slot);return(0,i.jsx)(i.Fragment,{children:(0,Yg.A)(e.volunteers,30).map((r,a)=>(0,i.jsxs)(Na,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(jB,{acronym:e.positionAcronym,name:e.positionName}),(0,i.jsxs)(Na,{css:{padding:"$7 56px"},direction:"column",gap:"3",children:[(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsxs)(yr,{font:"gray800 textSm medium",children:[t("membres_pour_le_20317",s)," (",e.volunteers.length,")"]}),n&&(0,i.jsx)(yr,{font:"gray800 textXs medium",children:o})]}),(0,i.jsx)(CB,{customFields:e.customFields,slugsToDisplay:e.slugsToDisplay,volunteers:r})]})]},a))})};function kB(e,t){const n=[];return"both"!==t&&"email"!==t||n.push(e.userInfo.email),m(e.userInfo.name)&&n.unshift(e.userInfo.name),!e.userInfo.phone||"both"!==t&&"phone"!==t||n.push(`${e.userInfo.phone.internationalFormat}`),n.join("
")}const AB=e=>{const t=Yn(),n=qn(hh),s=(0,L.useMemo)(()=>(0,lc.A)(e.ranges,e=>e.range.start.toMillis()).map(({name:e,range:t})=>(0,Ya.A)([m(e)?e:null,n.toDisplayString(t,{formats:{displayWeekday:!0}})]).join(" - ")),[e.ranges]),o=(0,ph.A)(e.position.leaders.concat(e.position.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Na,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"6",children:[e.displayPositionName&&(0,i.jsxs)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"medium",children:[e.position.category.name," | ",e.position.name]}),(0,i.jsxs)(Na,{gap:"9",children:[(0,i.jsx)(yr,{color:"gray500",width:150,children:t("date_de_la_miss_70346")}),(0,i.jsx)(Na,{css:{flex:"1"},direction:"column",children:s.map((e,t)=>(0,i.jsx)(yr,{color:"gray800",css:{textTransform:"capitalize"},children:e},t))})]}),o.map((n,s)=>(0,i.jsxs)(Na,{gap:"9",children:[(0,i.jsx)(yr,{color:"gray500",width:150,children:t("reponsable_82458")}),(0,i.jsx)(yr,{color:"gray800",css:{flex:"1"},dangerouslySetInnerHTML:{__html:kB(n,e.leadersData)}})]},s)),m(e.position.description)&&(0,i.jsxs)(Na,{gap:"9",children:[(0,i.jsx)(yr,{color:"gray500",width:150,children:t("description_58935")}),(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(xg,{text:e.position.description})})]}),Th(e.position)&&(0,i.jsxs)(Na,{gap:"9",children:[(0,i.jsx)(yr,{color:"gray500",width:150,children:t("localisation_38416")}),(0,i.jsxs)(yr,{color:"gray800",css:{flex:"1"},children:[Sh(e.position)&&e.position.address,Eh(e.position)&&(0,i.jsx)("a",{href:_g(e.position.latitude,e.position.longitude),children:(0,i.jsx)("img",{alt:"Position map",src:`${P.HEAVENT_API_URL}/image/event/${e.position.eventId}/position/${e.position.id}.png`,width:"100%"})})]})]}),e.showResourcesInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{gap:"9",children:[(0,i.jsx)(yr,{color:"gray500",width:150,children:t("nombre_de_cr_ne_40593")}),(0,i.jsx)(yr,{color:"gray800",css:{flex:"1"},children:e.position.numberOfSlots})]}),(0,i.jsxs)(Na,{gap:"9",children:[(0,i.jsx)(yr,{color:"gray500",width:150,children:t("nombre_de_membr_08851")}),(0,i.jsx)(yr,{color:"gray800",css:{flex:"1"},children:e.position.assignedResources})]})]})]})},wB=e=>{const{organization:t,event:n}=e.positionDocumentFragment,s=n.position,o=(0,L.useMemo)(()=>s.slots.filter(t=>!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day"))),[s,e.date]);return(0,i.jsxs)(yr,{css:{background:"white"},width:1,children:[e.options.showPositionData&&(0,i.jsxs)(Na,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(jB,{acronym:s.acronym,name:s.name}),(0,i.jsx)(AB,{displayPositionName:!1,leadersData:"both",position:s,ranges:s.range?[{name:null,range:s.range}]:[],showResourcesInfos:!0})]}),e.options.showVolunteersLists&&o.map(o=>{const r=(0,lc.A)(n.volunteersRegistrations.nodes.filter(({positionsSlotsUsersInfos:e})=>e.map(({positionSlotId:e})=>e).includes(o.id)),e=>e.userInfo.name);return(0,i.jsx)(yB,{customFields:t.customFields.nodes,positionAcronym:s.acronym,positionName:s.name,slot:o,slugsToDisplay:e.options.slugsToDisplay,volunteers:r},o.id)})]})},SB=e=>{const t=Yn();return(0,i.jsx)(Bb,{permissions:Nb.DOCUMENT_EDIT,children:(0,i.jsxs)(Na,{css:{border:"1px solid $gray200",borderRadius:"$2",padding:"$6",overflowY:"auto",minWidth:"320px"},direction:"column",width:420,children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textMd",fontWeight:"medium",children:t("param_tres_de_l_11729")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("s_lectionnez_le_59909")}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Na,{direction:"column",gap:"3",width:1,children:e.children})]})})};function EB(e,t,n,i){const{canDocumentEdit:s}=wS(),{mutate:o}=function(e={}){return Xn("mutation EventDocumentUpdate(\n $eventId: EventId!\n $id: EventsDocumentId!\n $eventDocument: EventsDocumentInput!\n) {\n eventDocumentUpdate(eventId: $eventId, id: $id, eventDocument: $eventDocument) {\n id\n }\n}\n",e)}(),[r,a]=L.useState({...t,...e}),[l,d]=L.useState(i.informations2Content||""),[c,u]=L.useState(i.informations2Title||""),[h,m]=L.useState(i.informationsContent||""),[g,p]=L.useState(i.informationsTitle||""),[f,x]=L.useState(i.signature||""),[_,I]=L.useState(i.title||""),v=L.useCallback((0,Nc.A)(async(e,t,r,a,l,d,c)=>{s&&await o({eventId:n,id:i.id,eventDocument:{options:e,informations2Content:t,informations2Title:r,informationsContent:a,informationsTitle:l,signature:d,title:c}})},200),[n,i.id,s]);return{eventDocument:{options:e,informations2Content:l,informations2Title:c,informationsContent:h,informationsTitle:g,signature:f,title:_},informations2Content:l,informations2Title:c,informationsContent:h,informationsTitle:g,options:r,signature:f,title:_,setInformations2Content:async t=>{d(t),await v(e,t,c,h,g,f,_)},setInformations2Title:async t=>{u(t),await v(e,l,t,h,g,f,_)},setInformationsContent:async t=>{m(t),await v(e,l,c,t,g,f,_)},setInformationsTitle:async t=>{p(t),await v(e,l,c,h,t,f,_)},setOptions:async e=>{const t={...r,...e};a(t),await v(t,l,c,h,g,f,_)},setSignature:async t=>{x(t),await v(e,l,c,h,g,t,_)},setTitle:async t=>{I(t),await v(e,l,c,h,g,f,t)}}}const TB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{event:o}=vb(),{options:r,setOptions:a}=EB(e.data.event.document.options,{format:ot.A4Portrait,showPositionData:!0,showVolunteersLists:!0,slugsToDisplay:["fullName","phone"]},s,{id:e.data.event.document.id});return Dd(`${o.name} ${t("fiche_de_missio_00324")}`),(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SB,{children:[(0,i.jsxs)(zu,{value:r.format,onChange:e=>{a({format:e})},children:[(0,i.jsx)("option",{value:ot.A4Portrait,children:t("a4_portrait_92125")}),(0,i.jsx)("option",{value:ot.A4Landscape,children:t("a4_paysage_24039")})]}),(0,i.jsx)(gc,{state:r.showPositionData?"checked":"unchecked",onClick:e=>{a({showPositionData:"checked"===e})},children:t("afficher_les_do_85282")}),(0,i.jsx)(gc,{state:r.showVolunteersLists?"checked":"unchecked",onClick:e=>{a({showVolunteersLists:"checked"===e})},children:t("afficher_les_li_18523")}),(0,i.jsxs)(bc,{isSearchVisible:!0,multiple:!0,placeholder:t("champs_affich_17945"),values:r.slugsToDisplay,onChange:e=>{a({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:t("Email")}),(0,i.jsx)("option",{value:"fullName",children:t("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:t("code_quipe_14296")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(vB,{getPath:e=>$s.DOCUMENTS_POSITION(n,s,e)}),(0,i.jsx)(IB,{width:1,children:(0,i.jsx)(wB,{options:r,positionDocumentFragment:e.data})})]})]})},zB=()=>{const{translate:e,params:{organizationId:t,eventId:n,positionId:s}}=_l(),{data:o,loader:r}=Zn("query PositionSheetDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n ...DocumentPositionSheet\n\n event(id: $eventId) {\n ...EventPositionsExport\n }\n}\n",{organizationId:t,eventId:n,positionId:s},[Ls.DocumentPositionSheetFragment,Ls.EventPositionsExportFragment]);return(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.Position,eventId:n,languages:o.event?.languages??[],organizationId:t,segmentsFolders:o.event?.segmentsFolders??[],showDate:!0,title:e("fiche_de_missio_61604")}),(0,i.jsx)(qa,{height:"7"}),r||(0,i.jsx)(TB,{data:o})]})},OB=e=>{const t=Yn();return(0,i.jsx)(Na,{css:{background:"$gray100",padding:"$6"},direction:"column",children:(0,i.jsx)(yr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:t("planning_1_14391",`${e.eventName} - ${e.segmentName}`)})})},RB=e=>{const t=Yn(),n=qn(Kc),s=(0,ac.A)(e.slots,e=>e.positionId);return(0,i.jsxs)(Na,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[!0!==e.hideHeader&&(0,i.jsx)(OB,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Na,{css:{background:"white",padding:"$6",position:"relative"},direction:"column",width:1,children:[(0,i.jsxs)(Na,{children:[(0,i.jsx)(cB,{width:240,children:t("jour_87026")}),(0,i.jsx)(cB,{width:720,children:n.toLocaleString(e.startDate,Js.DateOnly.WeekdayLongMonthLong)})]}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(cB,{width:240,children:t("cr_neaux_33401")}),(0,Oc.A)(0,6).map(t=>{const n=e.startDate.plus({hour:2*t}),s=n.plus({hour:2}),o=Us.IX.fromDateTimes(n,s);return(0,i.jsx)(cB,{width:120,children:o.toFormat("HH:mm")},t)})]}),e.positions.map((t,n)=>{const o=s[t.id];return(0,i.jsxs)(L.Fragment,{children:[(0,i.jsxs)(Na,{children:[(0,i.jsx)(cB,{css:{color:"$gray700",height:"48px"},width:240,children:(0,i.jsx)(yr,{css:{ellipsis:!0},textAlign:"start",width:1,children:t.name})}),(0,Oc.A)(0,6).map(e=>(0,i.jsx)(cB,{css:{height:"48px"},width:120},e))]}),o.map(t=>{const s=t.range.start.diff(e.startDate).shiftTo("hours","minutes"),o=t.range.end.diff(t.range.start).shiftTo("hours","minutes"),r=264+60*s.hours+s.minutes,a=112+48*n,l=60*o.hours+o.minutes,d=`${m(t.name)?`${t.name} - `:""}${t.range.toFormat("HH:mm")}`;return(0,i.jsx)(Na,{align:"center",css:{background:t.position.color,borderRadius:"$1",color:Zd(t.position.color),fontSize:"$textXs",height:"32px",left:`${r}px`,position:"absolute",top:`${a}px`,width:`${l}px`},children:(0,i.jsx)(yr,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:d,width:1,children:d})},t.id)})]},t.id)})]})]})},$B=e=>{const t=(0,L.useMemo)(()=>{const t=lh(e.event.positionsSlots.nodes);if(no(t)){const n=uh(t.map(e=>e.range));let i;return i=8!==n.startHour||20!==n.endHour?t.flatMap(e=>{const t=e.range;return t.start.hour<12&&t.end.hour>=12?[{...e,range:Us.IX.fromDateTimes(t.start,t.start.set({hour:12,minute:0}))},{...e,range:Us.IX.fromDateTimes(t.end.set({hour:12,minute:0}),t.end)}]:[e]}):t,i.filter(t=>!e.date?.isValid||t.range.start.startOf("day").equals(e.date.startOf("day")))}return[]},[e.event,e.date]),n=(0,L.useMemo)(()=>no(t)?uh(t.map(e=>e.range)):null,[t]),s=n&&(8!==n.startHour||20!==n.endHour);return(0,i.jsx)(i.Fragment,{children:n?(0,Oc.A)(0,n.numberOfDays).map((o,r)=>(0,Oc.A)(0,s?2:1).map((a,l)=>{const d=n.startDate.plus({day:o}).set({hour:s?0===l?0:12:8}),c=s?0===l?d.set({hour:12}):d.plus({day:1}).startOf("day"):d.set({hour:20}),u=Us.IX.fromDateTimes(d,c),h=t.filter(e=>e.range.overlaps(u)),m=(0,lc.A)((0,ph.A)(h.map(e=>e.position),e=>e.id),e=>e.name);return no(h)?(0,Yg.A)(m,11).map((t,n)=>(0,i.jsx)(RB,{eventName:e.event.name,hideHeader:e.hideHeader,positions:t,segmentName:e.event.segment.name,slots:h,startDate:d},`${r}-${l}-${n}`)):null})):!0!==e.hideHeader?(0,i.jsx)(OB,{eventName:e.event.name,segmentName:e.event.segment.name}):null})},DB=e=>{const{history:t,translate:n,params:{segmentId:s}}=_l();return(0,i.jsxs)(Na,{align:"center",css:{background:"$gray100",border:"1px solid $gray200",borderBottom:"none",padding:"$3 $7"},gap:"4",children:[(0,i.jsx)(yr,{font:"gray900 textMd semiBold",children:n("aper_u_pour_la_43833")}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(bc,{isSearchVisible:!0,values:[s],onChange:n=>{no(n)&&t.replace(e.getPath(n[0]))},children:e.segmentsFolders.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})}),m(e.downloadPath)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{flex:"1"}}),(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",to:e.downloadPath,children:n("t_l_charger_03283")})})]})]})},PB=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query PlanningDocument($eventId: EventId!, $segmentId: SegmentId!, $date: Date) {\n event(id: $eventId) {\n ...DocumentPositionsPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,segmentId:s},[Ls.DocumentPositionsPlanningFragment,Ls.EventPositionsExportFragment]);return Dd(`${o.name} ${e("planning_de_l_96909")}`),(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.Planning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("planning_de_l_96909")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(DB,{getPath:e=>$s.DOCUMENTS_PLANNING(t,n,e),segmentsFolders:r.event.segmentsFolders}),(0,i.jsx)(IB,{width:1,children:(0,i.jsx)(yr,{css:{overflow:"auto"},width:1,children:(0,i.jsx)($B,{event:r.event})})})]})]})},FB=100,MB=e=>{const t=Yn(),n=qn(Kc),s=(0,L.useMemo)(()=>ah(e.slots.map(({range:e})=>e).reduce((e,t)=>e.union(t),e.slots[0].range)),[e.slots]),o=e.slots[0].range.start,r=t=>(0,lc.A)(jh(t,e.slots),[e=>e.position.name.toLowerCase(),e=>e.range.start.toMillis()]);return(0,i.jsxs)(Na,{css:{background:"white",fontSize:"12px",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(OB,{eventName:e.eventName,segmentName:e.segmentName}),(0,i.jsxs)(Na,{css:{background:"white",padding:"$6"},direction:"column",width:1,children:[(0,i.jsxs)(Na,{children:[(0,i.jsx)(cB,{width:200,children:t("jours_88317")}),(0,Oc.A)(0,s).map(t=>{const s=o.plus({days:t}),r=jh(s,e.slots);return(0,i.jsx)(cB,{width:(r.length||1)*FB,children:n.toLocaleString(s,Js.DateOnly.MonthShort)},t)})]}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(cB,{width:200,children:t("missions_63972")}),(0,Oc.A)(0,s).map(t=>{const n=o.plus({days:t}),s=(0,lc.A)(Object.values((0,ac.A)(jh(n,e.slots),e=>e.position.id)).map(e=>({position:e[0].position,numberOfSlots:e.length})),({position:e})=>e.name.toLowerCase());return 0===s.length?(0,i.jsx)(mB,{css:{height:"40px"},width:FB},t):s.map(({position:e,numberOfSlots:n})=>{const s=m(e.acronym)?e.acronym:e.name;return(0,i.jsx)(cB,{width:n*FB,children:(0,i.jsx)(yr,{css:{ellipsis:!0,px:"$1"},textAlign:"center",title:s,width:1,children:s})},`${t}-${e.id}`)})})]}),(0,i.jsxs)(Na,{children:[(0,i.jsx)(cB,{width:200,children:t("cr_neaux_33401")}),(0,Oc.A)(0,s).map(e=>{const t=o.plus({days:e}),n=r(t);return 0===n.length?(0,i.jsx)(mB,{css:{height:"40px"},width:FB},e):n.map(t=>(0,i.jsx)(cB,{width:FB,children:t.range.toFormat("HH:mm",{separator:"-"})},`${e}-${t.id}`))})]}),e.volunteersRegistrations.map(e=>{const t=e.userInfo;return(0,i.jsxs)(Na,{children:[(0,i.jsxs)(uB,{width:200,children:[(0,i.jsx)(Jg,{email:t.email,image:t.picture?.url,name:t.name,size:24}),(0,i.jsx)(yr,{css:{flex:"1",ellipsis:""},title:t.name,children:t.name})]}),(0,Oc.A)(0,s).map(t=>{const n=o.plus({days:t}),s=r(n);return 0===s.length?(0,i.jsx)(mB,{width:FB},t):s.map(n=>{const s=`${t}-${n.id}`;return void 0!==e.positionsSlotsUsersInfos.find(({positionSlotId:e})=>e===n.id)?(0,i.jsx)(hB,{width:FB,children:(0,i.jsx)(yr,{children:(0,i.jsx)(lB,{})})},s):(0,i.jsx)(mB,{width:FB},s)})})]},e.id)})]})]})},NB=e=>{const t=(0,lc.A)(lh(e.event.positionsSlots.nodes),e=>e.range.start),n=e.event.volunteersRegistrations.nodes;return(0,i.jsx)(i.Fragment,{children:(0,Yg.A)(t,8).map((t,s)=>{const o=t.map(e=>e.id),r=n.filter(e=>{const t=e.positionsSlotsUsersInfos.map(e=>e.positionSlotId);return(0,mh.A)(o,t).length>0});return(0,Yg.A)(r,10).map((n,o)=>(0,i.jsx)(MB,{eventName:e.event.name,segmentName:e.event.segment.name,slots:t,volunteersRegistrations:n},`${s}-${o}`))})})},LB=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query PositionsVolunteersPlanningDocument($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n ...DocumentPositionsVolunteersPlanning\n ...EventPositionsExport\n }\n}\n",{eventId:n,segmentId:s},[Ls.DocumentPositionsVolunteersPlanningFragment,Ls.EventPositionsExportFragment]);return Dd(`${o.name} ${e("planning_d_un_g_23684")}`),(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.PositionsVolunteersPlanning,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("planning_d_un_g_23684")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(DB,{getPath:e=>$s.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(t,n,e),segmentsFolders:r.event.segmentsFolders}),(0,i.jsx)(IB,{children:(0,i.jsx)(yr,{css:{overflow:"auto"},width:1,children:(0,i.jsx)(NB,{event:r.event})})})]})]})};var BB=n(8962),VB=n.n(BB);const UB=(e,t)=>"base64"===t?new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{t(i.result?.toString()??"")},i.onerror=n,i.readAsDataURL(e)}):new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const e=new Uint8Array(i.result);t(VB().detect(e)||"UTF-8")},i.onerror=n,i.readAsArrayBuffer(e)}).then(t=>new Promise((n,i)=>{const s=new FileReader;s.onload=()=>n(s.result?.toString()??""),s.onerror=i,s.readAsText(e,t)})),WB=({css:e,label:t,description:n,icon:s,hint:o,state:r,value:a,placeholder:l,accept:d,format:c,onChange:u,...h})=>{const g=(0,L.useRef)(null),{inputId:p,descId:f,errorId:x}=Ga();return(0,i.jsxs)(Na,{css:e,direction:"column",width:1,children:[(0,i.jsx)(Pl,{htmlFor:p,isClickable:!1,children:t}),(0,i.jsx)($l,{id:f,children:n}),(t||n)&&(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Ml,{cursor:"pointer",icon:s,rightIcon:"file",state:r,onClick:()=>{g.current?.click()},children:(0,i.jsxs)(yr,{color:m(a?.name)?"gray800":"gray500",css:{flex:"1","& input":{display:"none"}},children:[m(a?.name)?a.name:l,(0,i.jsx)("input",{ref:g,accept:Dv(d),"aria-describedby":n?f:void 0,"aria-errormessage":"error"===r?x:void 0,"aria-invalid":"error"===r,id:p,type:"file",onChange:async e=>{const t=e.target.files?.[0];t&&u({name:t.name,content:await UB(t,c)})},...h})]})}),(0,i.jsx)(Dl,{id:x,state:r,children:o})]})};function GB(e){return{color:tc(e.subtitleColor)?e.subtitleColor:"$gray800",fontFamily:e.titleFontFamily||"Open Sans",fontSize:"14px",fontWeight:"700",textTransform:"uppercase"}}const HB=e=>{const t=Yn();return e.options.showInformations?(0,i.jsxs)(Na,{css:{background:e.isAso?void 0:"white",borderRadius:"$2",px:e.isAso?"0":"$3",py:"$4"},direction:"column",gap:e.isAso?"1":"3",width:1,children:[(0,i.jsx)(yr,{css:{...GB(e.options),textAlign:"center"},width:1,children:m(e.informationsTitle)?e.informationsTitle:t("informations_22954")}),m(e.informationsContent)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(xg,{text:e.renderText(e.informationsContent)})})})]}):null},qB=e=>(0,i.jsx)(Na,{css:{paddingTop:e.isAso?"180px":"73px",position:"relative"},direction:"column",gap:"5",width:e.isAso?157:178,children:e.children}),YB=e=>e.options.showQrCode?(0,i.jsxs)(Na,{align:"center",css:{background:e.isAso?"transparent":"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(yr,{css:{...GB(e.options),textAlign:"center"},width:1,children:e.isAso?"QR Code pour valider ma présence":"QR Code"}),(0,i.jsx)(Na,{align:"center",css:{background:e.isAso?"white":"transparent",borderRadius:e.isAso?"$1":"none"},height:112,justify:"center",width:112,children:(0,i.jsx)(yr,{height:104,width:104,children:(0,i.jsx)("img",{height:"100%",src:dg(e.ticketId,{height:90,width:90}),width:"100%"})})})]}):null,KB=e=>{const t=Yn(),n=e.psuis[0].position,s=e.userInfo,o=168===e.organizationId,r=573===e.organizationId,a=858===e.organizationId,l=306===e.organizationId,d=tc(e.options.headerColor)?e.options.headerColor:"white",c={color:tc(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:o?"$moonstruck":e.options.titleFontFamily||"Open Sans",fontSize:o?"64px":"24px",fontWeight:o?"500":"800",lineHeight:o?"48px":void 0,textAlign:"center"},u=GB(e.options),h=e.options.showInformations||e.options.showInformations2||e.options.showQrCode,g=(0,ph.A)(n.leaders.concat(n.category.leaders),e=>e.userInfo.id);return(0,i.jsxs)(Na,{css:{color:tc(e.options.textColor)?e.options.textColor:"$gray800",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px","@media print":{breakBefore:"page"},"@media screen":{backgroundColor:n.color,backgroundImage:m(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"repeat-y",backgroundSize:"100% auto",height:`calc-size(auto, round(up, size, ${Xm}px))`,width:`${Jm}px`},"@page":{size:"A4 portrait"}},direction:"column",children:[(0,i.jsx)(yr,{css:{backgroundAttachment:"fixed",backgroundColor:n.color,backgroundImage:m(e.options.background?.content)?`url(${e.options.background?.content})`:void 0,backgroundRepeat:"no-repeat",backgroundSize:"cover",position:"fixed",height:"100%",width:"100%",zIndex:"-1","@media screen":{display:"none"}}}),(0,i.jsxs)(Na,{align:"center",css:{marginLeft:"210px",marginTop:"51px"},gap:"4",justify:l?"end":"center",width:568,children:[(0,i.jsxs)(Na,{align:l?"end":"center",css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(yr,{css:{color:d,fontSize:"14px",fontWeight:"700",lineHeight:"18px"},children:m(e.document.title)?e.document.title:t("Assignments")}),(0,i.jsx)(yr,{css:{color:d,fontSize:"28px",fontWeight:"700",lineHeight:"38px"},children:s.name})]}),l&&(0,i.jsx)(yr,{css:{background:`url(${e.userInfo.picture?.url}) no-repeat`,backgroundSize:"contain",borderRadius:"$1",overflowX:"hidden"},height:74,width:74})]}),(0,i.jsx)(qa,{height:l?"4":"7"}),(0,i.jsxs)(Na,{css:{paddingLeft:a?"46px":"$4",paddingRight:"$4"},gap:"4",width:1,children:[h&&(0,i.jsxs)(qB,{isAso:a,children:[(0,i.jsx)(HB,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,isAso:a,options:e.options,renderText:e.renderText}),e.options.showInformations2&&(0,i.jsxs)(Na,{css:{background:"white",borderRadius:"$2",padding:"$4 $3"},direction:"column",gap:"3",width:1,children:[(0,i.jsx)(yr,{css:{...u,textAlign:"center"},width:1,children:m(e.document.informations2Title)?e.document.informations2Title:t("informations_se_69499")}),m(e.document.informations2Content)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{css:{wordBreak:"break-word","& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(xg,{text:e.renderText(e.document.informations2Content)})})})]}),(0,i.jsx)(YB,{isAso:a,options:e.options,ticketId:e.volunteerRegistration.ticketId}),a&&e.options.showLeaders&&g[0]&&(0,i.jsxs)(yr,{css:{position:"absolute",textAlign:"center",top:"710px"},width:1,children:[(0,i.jsx)(yr,{css:{...GB(e.options),marginBottom:"$1",textAlign:"center"},width:1,children:"TON RESPONSABLE"}),g[0].userInfo.name,(0,i.jsx)("br",{}),g[0].userInfo.phone?.internationalFormat]})]}),(0,i.jsxs)(Na,{css:{alignSelf:"start",border:"2px solid transparent",background:a?void 0:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"32px 40px"},direction:"column",children:[r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{...c,fontSize:"12px",fontWeight:"700"},children:n.category.name}),(0,i.jsx)(qa,{height:"1"})]}),(0,i.jsx)(yr,{css:c,width:1,children:n.name}),e.children]})]})]})},ZB=e=>{const t=Yn(),n=qn(rC),s=qn(Tw),o=qn(Wn),r=e.psuis[0].position,a=(0,lc.A)(e.psuis.map(({positionSlot:e})=>e),e=>e.range.start.toMillis()),l=168===e.organizationId,d=573===e.organizationId,c=858===e.organizationId,u=2695===e.organizationId,h=426===e.organizationId,g=GB(e.options),p=(0,ph.A)(r.leaders.concat(r.category.leaders),e=>e.userInfo.id),f="both"===e.options.leadersData||"email"===e.options.leadersData,x="both"===e.options.leadersData||"phone"===e.options.leadersData,_=t=>s.renderText(t,{userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(KB,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:_,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[e.options.showLeaders&&!d&&!c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(yr,{css:{color:tc(e.options.subtitleColor)?e.options.subtitleColor:"$gray800",fontSize:"14px",fontWeight:"700"},textAlign:"center",width:1,children:[t("ton_responsable_16222")," ",p.map(e=>(0,Ya.A)([e.userInfo.name,f?e.userInfo.email:"",x?e.userInfo.phone?.internationalFormat??"":""]).join(" ")).join(", ")]})]}),(0,i.jsx)(qa,{height:"7"}),!c&&(0,i.jsxs)(Na,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(yr,{css:g,children:u?"Horaire":t("date_de_ta_miss_18706")}),(0,i.jsx)(Na,{direction:"column",gap:"1",children:a.map((e,t)=>{const n=e.range.start,s=e.range.end,r=n.startOf("day").toMillis()===s.startOf("day").toMillis();return(0,i.jsxs)(yr,{children:[m(e.name)?`${e.name} | `:"",(0,i.jsx)(Zm,{css:{textTransform:"capitalize"},children:n.toFormat("cccc d MMMM yyyy HH:mm",{locale:o.language.toString().toLowerCase()})})," ","-"," ",(0,i.jsx)(Zm,{css:{textTransform:"capitalize"},children:r?s.toFormat("HH:mm"):s.toFormat("cccc d MMMM yyyy HH:mm",{locale:o.language.toString().toLowerCase()})})]},t)})})]}),c&&(0,i.jsxs)(Na,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(yr,{css:g,children:"Rendez-vous"}),(0,i.jsx)(Na,{direction:"column",gap:"1",children:a.map((e,t)=>(0,i.jsxs)(yr,{children:[(0,i.jsx)(Zm,{css:{textTransform:"capitalize"},fontWeight:"bold",children:e.range.start.toFormat("cccc d MMMM yyyy à H'h'mm",{locale:"fr"})})," ","(fin de mission estimée à ",e.range.end.toFormat("H'h'mm"),")"]},t))})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(yr,{css:g,children:u?"Consignes du poste":t("description_de_15187")}),(0,i.jsxs)(Na,{direction:"column",children:[m(r.description)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{"& .h-rich-text > p":{margin:"0"},"& .h-rich-text figure, & .h-rich-text img":{maxWidth:"100%"}},children:(0,i.jsx)(xg,{text:r.description})}),(0,i.jsx)(qa,{height:"1"})]}),Th(r)&&(0,i.jsxs)(Na,{css:{"@media print":{breakInside:"avoid",display:"block",overflow:"visible"}},direction:"column",children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{css:g,children:d?"Point de rendez-vous":h?"Lieu du poste":t("lieu_de_rendez_30016")}),Sh(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{children:r.address})]}),Eh(r)&&(d||u)&&(0,i.jsxs)(yr,{children:["Point GPS : ",r.latitude,", ",r.longitude]}),Eh(r)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{gap:"3",width:1,children:[(0,i.jsx)(yr,{css:{width:"100%"},height:u?270:180,children:(0,i.jsx)("a",{href:_g(r.latitude,r.longitude),style:{background:`url(${P.HEAVENT_API_URL}/image/event/${e.eventId}/position/${r.id}.png)`,backgroundPosition:"center",backgroundSize:"cover",display:"block",height:"100%",width:"100%"}})}),l&&m(r.fields?.cf44697?.url)&&(0,i.jsx)(yr,{css:{background:`url(${r.fields.cf44697.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204}),d&&m(r.fields?.cf46814?.url)&&(0,i.jsx)(yr,{css:{background:`url(${r.fields.cf46814.url}) no-repeat`,backgroundSize:"contain"},height:180,width:1}),c&&m(r.fields?.cf45815?.url)&&(0,i.jsx)(yr,{css:{background:`url(${r.fields.cf45815.url}) no-repeat`,backgroundSize:"contain"},height:180,width:204})]})]}),d&&m(r.fields?.cf46813)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{children:r.fields.cf46813})]})]})]})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(yr,{css:g,children:"UNE QUESTION OU UN PROBLÈME ?"}),(0,i.jsxs)(yr,{children:["Nous sommes là pour vous aider. Contactez votre responsable de secteur :"," ",(0,i.jsxs)(Zm,{fontWeight:"bold",children:[p[0]?.userInfo.name," :"," ",p[0]?.userInfo.phone?.internationalFormat]})]})]})]}),e.customFields.map(t=>{const s=n.getValueString(t,r.fields,{fileReturnValue:"url"});return e.options.positionCustomFields?.includes(t.id)&&m(s)?(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{css:{gap:"2px"},direction:"column",children:[(0,i.jsx)(yr,{css:g,children:t.name}),t.fieldType===Ve.File?function(e){const{extension:t}=QI(e);return ev.includes(t)}(n.getValueString(t,r.fields,{fileReturnValue:"name"}))?(0,i.jsx)(yr,{css:{background:`url(${s}) no-repeat`,backgroundPosition:"center",backgroundSize:"cover"},height:180,width:1}):(0,i.jsx)(yr,{css:{wordBreak:"break-word","& > a":{color:"inherit"}},children:(0,i.jsx)("a",{href:s,rel:"noreferrer",target:"_blank",children:s})}):(0,i.jsx)(yr,{dangerouslySetInnerHTML:{__html:s.replace(/\n/g,"
")}})]})]},t.id):null}),m(e.options.signature)&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{css:{"& .h-rich-text > p":{margin:"0"}},children:(0,i.jsx)(xg,{text:_(e.options.signature)})})})]}),c&&m(r.fields?.cf24781?.url)&&(0,i.jsxs)(KB,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:_,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{css:{color:tc(e.options.titleColor)?e.options.titleColor:"$gray800",fontFamily:e.options.titleFontFamily||"Open Sans",fontSize:"16px",fontWeight:"700",textAlign:"center"},children:"(Annexe)"}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{css:{background:`url(${r.fields.cf24781.url}) no-repeat`,backgroundSize:"contain"},height:1,width:1})]}),u&&(0,i.jsx)(KB,{document:e.document,options:e.options,organizationId:e.organizationId,psuis:e.psuis,renderText:_,userInfo:e.userInfo,volunteerRegistration:e.volunteerRegistration,children:(0,i.jsx)(yr,{css:{background:`url(${P.HEAVENT_ASSETS_URL}/badges/velotour/condition.png) no-repeat`,backgroundSize:"cover"},height:601,width:533})})]})},XB=e=>{const t=e.assignmentsInfos.event.volunteerRegistration,n=(0,L.useMemo)(()=>gg(t.positionsSlotsUsersInfos,e.date,e.endDate).filter(e=>!e.position.tags.find(e=>"mission privée"===e.name.trim().toLowerCase()||"document-assignments-excluded"===e.name.trim().toLowerCase())),[t,e.date,e.endDate]),s=(0,L.useMemo)(()=>(0,lc.A)(Object.entries((0,ac.A)(n,e=>e.position.id)),([e,t])=>(0,gh.A)(t.map(e=>e.positionSlot.range.start.toMillis()))),[n]);return(0,i.jsx)(i.Fragment,{children:s.map(([n,s],o)=>(0,i.jsx)(ZB,{customFields:e.assignmentsInfos.organization.customFields.nodes,document:e.eventDocument,eventId:e.assignmentsInfos.event.id,options:e.options,organizationId:e.assignmentsInfos.organization.id,psuis:s,userInfo:e.assignmentsInfos.organization.userInfo,volunteerRegistration:t},o))})},JB=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{eventDocument:o,informations2Content:r,informations2Title:a,informationsContent:l,informationsTitle:d,options:c,signature:u,title:h,setInformations2Content:g,setInformations2Title:p,setInformationsContent:f,setInformationsTitle:x,setOptions:_,setSignature:I,setTitle:v}=EB(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",informationsContent:"",informationsTitle:"",informationsContent2:"",informationsTitle2:"",leadersData:"phone",positionCustomFields:[],showInformations:!1,showInformations2:!1,showLeaders:!1,showQrCode:!1,signature:"",subtitleColor:"#1d2939",textColor:"#1d2939",title:"",titleColor:"#1d2939",titleFontFamily:"Open Sans"},s,{id:e.data.event.document.id,title:e.data.event.document.title,signature:e.data.event.document.signature,informationsTitle:e.data.event.document.informationsTitle,informationsContent:e.data.event.document.informationsContent,informations2Title:e.data.event.document.informations2Title,informations2Content:e.data.event.document.informations2Content}),b=$L(),j=(0,L.useMemo)(()=>(0,lc.A)(e.data.organization.customFields.nodes,e=>e.name.toLowerCase()),[e.data]),C=e.data.organization.userInfo;return(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SB,{children:[(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:c.background,onChange:e=>{_({background:e})}}),m(c.background?.name)&&(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{_({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Nl,{label:t("titre_du_docume_33508"),value:h,onChange:e=>{v(e)}}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(zu,{label:"Police",value:c.fontFamily,onChange:e=>{_({fontFamily:e})},children:b}),(0,i.jsx)(zu,{label:t("police_des_titr_37497"),value:c.titleFontFamily,onChange:e=>{_({titleFontFamily:e})},children:b}),(0,i.jsx)(Nj,{label:t("couleur_du_titr_08509"),value:c.titleColor,onChange:e=>{_({titleColor:e})}}),(0,i.jsx)(Nj,{label:t("couleur_des_sou_18968"),value:c.subtitleColor,onChange:e=>{_({subtitleColor:e})}}),(0,i.jsx)(Nj,{label:t("couleur_du_text_32021"),value:c.textColor,onChange:e=>{_({textColor:e})}}),(0,i.jsx)(Nj,{label:t("couleur_du_cont_17150"),value:c.headerColor,onChange:e=>{_({headerColor:e})}}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(ju,{value:c.showInformations,onChange:e=>{_({showInformations:e})},children:t("afficher_la_sec_84744")}),c.showInformations&&(0,i.jsxs)(Na,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Nl,{label:t("titre_de_la_sec_41575"),value:d,onChange:e=>{x(e)}}),(0,i.jsx)(Jv,{initialValue:l,label:t("contenu_de_la_s_43102"),onChange:e=>{f(e)}})]}),(0,i.jsx)(ju,{value:c.showInformations2,onChange:e=>{_({showInformations2:e})},children:t("afficher_la_sec_67554")}),c.showInformations2&&(0,i.jsxs)(Na,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Nl,{label:t("titre_de_la_sec_41575"),value:a,onChange:e=>{p(e)}}),(0,i.jsx)(Jv,{initialValue:r,label:t("contenu_de_la_s_43102"),onChange:e=>{g(e)}})]}),(0,i.jsx)(ju,{value:c.showQrCode,onChange:e=>{_({showQrCode:e})},children:t("afficher_le_qr_15635")}),(0,i.jsx)(ju,{value:c.showLeaders,onChange:e=>{_({showLeaders:e})},children:t("afficher_les_re_08705")}),c.showLeaders&&(0,i.jsx)(Na,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:(0,i.jsxs)(zu,{label:t("donn_es_des_res_45809"),value:c.leadersData,onChange:e=>{_({leadersData:e})},children:[(0,i.jsx)("option",{value:"both",children:t("afficher_le_num_37296")}),(0,i.jsx)("option",{value:"phone",children:t("afficher_unique_41829")}),(0,i.jsx)("option",{value:"email",children:t("afficher_unique_97964")}),(0,i.jsx)("option",{value:"none",children:t("afficher_aucune_38167")})]})}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(Jv,{initialValue:u,label:t("signature_67521"),onChange:e=>{I(e)}}),no(j)&&(0,i.jsx)(bc,{label:t("liste_des_champ_40847"),multiple:!0,values:c.positionCustomFields,onChange:e=>{_({positionCustomFields:e})},children:j.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pj,{downloadPath:ug(C.links?.userAssignmentsLink??"","pdf",{lang:C.language}),getPath:e=>$s.DOCUMENTS_ASSIGNMENTS(n,s,e)}),(0,i.jsx)(IB,{children:(0,i.jsx)(XB,{assignmentsInfos:e.data,eventDocument:o,options:c})})]})]})},QB=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query UserAssignmentsDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n ...DocumentUserAssignments\n\n event(id: $eventId) {\n startAt\n endAt\n\n ...EventVolunteersExport\n }\n}\n",{organizationId:t,eventId:n,userInfoId:s},[Ls.DocumentUserAssignmentsFragment,Ls.EventVolunteersExportFragment]);return Dd(`${o.name} ${e("fiche_d_affecta_91461")}`),(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.Assignments,endAt:r.event?.endAt,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,startAt:r.event?.startAt,title:e("fiches_d_affect_98583")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsx)(JB,{data:r})]})},eV=e=>{const t=Yn(),n=qn(hh),s=e.options.format===ot.A4Portrait?og.A4:e.options.format===ot.A5Portrait?og.A5:og.A6,o=e.badgeDocumentFragment.volunteerRegistration;return(0,i.jsxs)(yr,{width:s.width,children:[(0,i.jsxs)(Na,{css:{background:`linear-gradient(190deg, ${e.options.color} 40%, white 40%)`},direction:"column",height:s.height,width:1,children:[(0,i.jsx)(yr,{css:{height:"calc(40% - 40px)"}}),(0,i.jsxs)(Na,{align:"center",direction:"column",width:1,children:[(0,i.jsx)(Jg,{email:o.userInfo.email,image:o.userInfo.picture?.url,name:o.userInfo.name,size:96}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textXl",fontWeight:"medium",children:o.userInfo.nameOrEmail}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textLg",children:m(e.options.name)?e.options.name:t("membre_45658")})]}),(0,i.jsx)(yr,{css:{flex:"1"}}),m(e.options.logo?.content)&&(0,i.jsx)(Na,{height:96,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(qa,{height:"6"})]}),e.showPageSeparator&&(0,i.jsx)(yr,{css:{background:"transparent",height:"$space$6"}}),(0,i.jsxs)(Na,{css:{background:"white",pageBreakBefore:"always",padding:"$4 $6"},direction:"column",height:s.height,width:1,children:[m(e.options.logo?.content)&&(0,i.jsx)(Na,{height:32,justify:"center",children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content})}),(0,i.jsx)(qa,{height:"6"}),!1!==e.options.showAssignments&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray900",fontWeight:"medium",children:t("affectation_plural")}),(0,i.jsx)(qa,{height:"2"}),o.positionsSlotsUsersInfos.map(({position:e,positionSlot:s},o)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(yr,{color:"gray500",fontSize:"textXs",children:t("affectation_n_78121",o+1)}),(0,i.jsxs)(yr,{color:"gray800",children:[e.name," :"," ",n.toDisplayString(s.range)]}),(0,i.jsx)(qa,{height:"2"})]},o))]}),m(e.options.infos)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray500",fontSize:"textXs",children:t("renseigements_c_00093")}),(0,i.jsx)(yr,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]})]})]})},tV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{options:o,setOptions:r}=EB(e.data.event.document.options,{format:ot.A6Portrait,logo:{name:"",content:""},color:fr.colors.gray900.value,name:"",infos:"",showAssignments:!0},s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SB,{children:[(0,i.jsxs)(zu,{label:"Format",value:o.format,onChange:e=>{r({format:e})},children:[(0,i.jsx)("option",{value:ot.A4Portrait,children:"A4"}),(0,i.jsx)("option",{value:ot.A5Portrait,children:"A5"}),(0,i.jsx)("option",{value:ot.A6Portrait,children:"A6"})]}),(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:o.logo,onChange:e=>{r({logo:e})}}),m(o.logo?.name)&&(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({logo:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Nj,{label:t("couleur_de_fond_75677"),value:o.color,onChange:e=>{r({color:e})}}),(0,i.jsx)(Nl,{hint:t("ce_nom_sera_sit_11616"),label:t("nom_du_badge_36141"),placeholder:t("membre_45658"),value:o.name,onChange:e=>{r({name:e})}}),(0,i.jsx)(Wm,{label:t("renseigements_c_00093"),placeholder:t("ex_contact_d_11070"),value:o.infos,onChange:e=>{r({infos:e})}}),(0,i.jsx)(gc,{state:o.showAssignments?"checked":"unchecked",onClick:e=>{r({showAssignments:"checked"===e})},children:t("afficher_les_af_46643")})]}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pj,{downloadPath:ug(a.links?.userBadgeLink??"","pdf",{lang:a.language}),getPath:e=>$s.DOCUMENTS_BADGE(n,s,e,"generic")}),(0,i.jsx)(IB,{children:(0,i.jsx)(eV,{badgeDocumentFragment:e.data.event,options:o,showPageSeparator:!0})})]})]})},nV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query UserBadgeDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserBadge\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s},[Ls.DocumentUserBadgeFragment,Ls.EventVolunteersExportFragment]);return Dd(`${o.name} ${e("BadgeCheck")}`),(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.Badge,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("badges_37586")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsx)(tV,{data:r})]})},iV=e=>{const t=Yn(),n=qn(Kc),s=qn(hh),o=(0,L.useMemo)(()=>(0,lc.A)(e.certificateDocumentFragment.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),[e.certificateDocumentFragment.volunteerRegistration]),r=Us.c9.local(),a=e.certificateDocumentFragment.volunteerRegistration.userInfo;return(0,i.jsxs)(Na,{css:{background:"white",padding:"$7 56px"},direction:"column",gap:"5",width:1,children:[m(e.options.header.content)&&(0,i.jsx)(yr,{css:{borderRadius:"$1",boxShadow:"$xs",overflow:"hidden"},height:260,children:(0,i.jsx)("img",{height:"100%",src:e.options.header.content,width:"100%"})}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textXl",fontWeight:"semiBold",textAlign:"center",children:t("attestation_de_92734")}),(0,i.jsxs)(Na,{css:{bd:!0,padding:"$4"},direction:"column",gap:"6",children:[(0,i.jsxs)(yr,{color:"gray800",fontWeight:"semiBold",children:[t("je_soussign_e_04371",e.options.name)," ",(0,i.jsx)("br",{}),e.options.title]}),(0,i.jsxs)(yr,{css:{"& > span":{fontWeight:"$semiBold"}},children:[t("certifie_que_13123")," ",(0,i.jsx)("span",{children:a.name}),(0,i.jsx)("br",{}),t("n_e_le_14393")," ",(0,i.jsx)("span",{children:m(a.dateOfBirth)?n.toLocaleString(Us.c9.fromISO(a.dateOfBirth),Js.DateOnly.MonthLong):""}),(0,i.jsx)("br",{}),t("demeurant_78485")," ",(0,i.jsx)("span",{children:m(a.street)?a.street:""}),(0,i.jsx)("br",{}),t("commune_48881")," ",(0,i.jsx)("span",{children:m(a.city)?a.city:""}),(0,i.jsx)("br",{}),t("code_postal_74563")," ",(0,i.jsx)("span",{children:m(a.postalCode)?a.postalCode:""})]}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"semiBold",children:t("a_t_b_n_vole_58773")}),(0,i.jsx)(yr,{dangerouslySetInnerHTML:{__html:o.map(({position:e,positionSlot:t})=>`${e.name} : ${s.toDisplayString(t.range)}`).join("
")}}),(0,i.jsxs)(yr,{color:"gray800",css:{whiteSpace:"pre-wrap","& > span":{fontWeight:"$semiBold"}},children:[(0,i.jsx)("span",{children:t("nom_et_adresse_96441")}),(0,i.jsx)("br",{}),e.options.address]}),m(e.options.infos)&&(0,i.jsx)(yr,{color:"gray800",css:{whiteSpace:"pre-wrap"},children:e.options.infos})]}),(0,i.jsx)(yr,{color:"gray800",children:t("atteste_sur_l_h_37408")}),(0,i.jsxs)(cd,{gap:"6",gridtemplatecolumns:"repeat(3, 1fr)",children:[(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(yr,{color:"gray800",children:t("signature_67521")}),m(e.options.signature.content)&&(0,i.jsx)(yr,{width:1,children:(0,i.jsx)("img",{src:e.options.signature.content,width:"100%"})})]}),(0,i.jsx)(yr,{color:"gray800",children:t("fait_1_39349",e.options.place)}),(0,i.jsx)(yr,{color:"gray800",children:n.toLocaleString(r,Js.DateOnly.MonthLong)})]})]})},sV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{options:o,setOptions:r}=EB(e.data.event.document.options,function(e){return{address:`${e.name}\n${e.street||""}\n${e.postalCode||""}\n${e.city||""}`.trim(),header:{name:"",content:""},infos:"",name:e.adminName||"",place:"Montpellier",signature:{name:"",content:""},title:`Président de ${e.name}`}}(e.data.organization),s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SB,{children:[(0,i.jsx)(Nl,{label:t("full_name"),placeholder:"Antoine Dupont",value:o.name,onChange:e=>{r({name:e})}}),(0,i.jsx)(Nl,{label:t("fonction_68322"),placeholder:t("pr_sident_30600"),value:o.title,onChange:e=>{r({title:e})}}),(0,i.jsx)(Wm,{label:t("nom_et_adresse_81953"),value:o.address,onChange:e=>{r({address:e})}}),(0,i.jsx)(Wm,{label:t("informations_su_09057"),value:o.infos,onChange:e=>{r({infos:e})}}),(0,i.jsx)(Nl,{label:t("lieu_de_l_attes_84804"),placeholder:"Montpellier",value:o.place,onChange:e=>{r({place:e})}}),(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",hint:t("taille_de_l_ima_12660","682x260px"),label:t("en_t_te_11987"),placeholder:t("en_t_te_11987"),value:o.header,onChange:e=>{r({header:e})}}),m(o.header?.name)&&(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({header:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",label:t("signature_67521"),placeholder:t("signature_67521"),value:o.signature,onChange:e=>{r({signature:e})}}),m(o.signature?.name)&&(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{r({signature:{name:"",content:""}})},children:t("r_initialiser_77538")})]})]}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pj,{downloadPath:ug(a.links?.userCertificateLink??"","pdf",{lang:a.language}),getPath:e=>$s.DOCUMENTS_CERTIFICATE(n,s,e)}),(0,i.jsx)(IB,{children:(0,i.jsx)(iV,{certificateDocumentFragment:e.data.event,options:o})})]})]})},oV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query UserCertificateDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n ...OrganizationCertificateDefault\n }\n\n event(id: $eventId) {\n ...DocumentUserCertificate\n ...EventVolunteersExport\n }\n}\n",{organizationId:t,eventId:n,userInfoId:s},[Ls.OrganizationCertificateDefaultFragment,Ls.DocumentUserCertificateFragment,Ls.EventVolunteersExportFragment]);return Dd(`${o.name} ${e("Certificate")}`),(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.Certificate,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("attestations_98371")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsx)(sV,{data:r})]})},rV=e=>{const{translate:t,params:{organizationId:n,eventId:s,badgeType:o}}=_l(),{options:r,setOptions:a}=EB(e.event.document.options,o===fe.Pec?{header:{name:"",content:""}}:o===fe.T24assignment?{logo:{name:"",content:""}}:{habits:""},s,{id:e.event.document.id}),l=e.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[o===fe.Asoassignment&&(0,i.jsx)(SB,{children:(0,i.jsx)(Jv,{initialValue:r.habits,label:"Habitudes",onChange:e=>{a({habits:e})}})}),o===fe.Pec&&(0,i.jsx)(SB,{children:(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",label:t("banni_re_86634"),placeholder:t("banni_re_86634"),value:r.header,onChange:e=>{a({header:e})}})}),o===fe.T24assignment&&(0,i.jsx)(SB,{children:(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:r.logo,onChange:e=>{a({logo:e})}})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pj,{downloadPath:ug(l.links?.userCustomBadgeLinks?.[o]||"","pdf",{lang:l.fields?.language?.rawValue}),getPath:e=>$s.DOCUMENTS_BADGE(n,s,e,o)}),(0,i.jsx)(IB,{children:D_(o,e.event,r,null)})]})]})},aV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s,badgeType:o}}=_l(),{data:r,loader:a}=Zn("query UserCustomBadgeDocument(\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $customBadge: CustomBadge!\n) {\n event(id: $eventId) {\n ...DocumentUserCustomBadge\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s,customBadge:o},[Ls.DocumentUserCustomBadgeFragment,Ls.EventVolunteersExportFragment]);return(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{badgeType:o,documentType:Ee.CustomBadge,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:o===fe.Paris20kmassignment,showStrategy:!0,title:e("badge_1_89709",P_(o))}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsx)(rV,{event:r.event})]})},lV=(e,t)=>{if("{user.picture}"===e)return t.userInfo.fields?.picture?.url||"";if("{user.skidata}"===e){const e=t.utid||"";return dg(e,{height:100,width:100})}if("{user.qrcode}"===e){const e=t.ticketId;return dg(e,{height:100,width:100})}if("{user.code39}"===e){const e=t.ticketId;return dg(e,{barcodeType:lg.Code39,height:28,width:234})}return e},dV=e=>{const t=m(e.element.source)&&m(lV(e.element.source,e.vr))?(0,i.jsx)("img",{height:"100%",src:lV(e.element.source,e.vr),width:"100%"}):null;return(0,i.jsx)(yr,{css:{border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,zIndex:e.element.zIndex},height:e.element.height,width:e.element.width,children:m(e.element.link)?(0,i.jsx)("a",{href:e.element.link,rel:"noreferrer",target:"_blank",children:t}):t})};var cV=n(1184);const uV=e=>{const t=qn(Kc),n=qn(Tw),s=rz((0,cV.A)(n.renderText(e.element.text,{userInfo:e.vr.userInfo,event:e.event,customFields:e.customFields,volunteerRegistration:e.vr,extraInfos:{...pg(t,e.vr.positionsSlotsUsersInfos)}}),{target:"_blank"}));return(0,i.jsx)(Na,{align:e.element.align,css:{backgroundColor:e.element.hasBackground?e.element.backgroundColor:"none",border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",color:e.element.color,fontFamily:e.element.fontFamily,fontSize:`${e.element.fontSize}px`,fontWeight:e.element.fontWeight,left:`${e.element.left}px`,lineHeight:e.element.lineHeight||1.4,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",textAlign:e.element.justify,textTransform:e.element.textTransform,top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.element.zIndex,"& a":{color:"inherit"},"& em":{fontStyle:"italic"},"& s":{textDecoration:"line-through"},"& strong":{fontWeight:700},"& u":{textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:s},height:e.element.height,justify:e.element.justify,width:e.element.width})},hV=e=>bL(e.element,e.accreditationsSlotsIds,e.accreditationsAcronyms,e.positionsSlotsIds,e.vr.userInfo.fields)?"container"===e.element.type?(0,i.jsx)(Na,{align:e.element.align,css:{backgroundColor:e.element.hasBackground?e.element.backgroundColor:"none",border:e.element.borderSize>0?`${e.element.borderSize}px solid ${e.element.borderColor}`:"",borderRadius:e.element.borderRadius>0?`${e.element.borderRadius}px`:"0",gap:`${e.element.gap}px`,left:`${e.element.left}px`,overflow:"hidden",paddingBottom:`${e.element.py||0}px`,paddingLeft:`${e.element.px||0}px`,paddingRight:`${e.element.px||0}px`,paddingTop:`${e.element.py||0}px`,position:e.element.inContainer?"static":"absolute",top:`${e.element.top}px`,transform:e.element.hasRotate?`rotate(${e.element.rotateDegree}deg)`:void 0,transformOrigin:e.element.hasRotate?"top left":void 0,whiteSpace:"pre-wrap",zIndex:e.element.zIndex},direction:e.element.direction,height:e.element.height,justify:e.element.justify,width:e.element.width,children:e.element.elements.map(t=>(0,i.jsx)(hV,{accreditationsAcronyms:e.accreditationsAcronyms,accreditationsSlotsIds:e.accreditationsSlotsIds,customFields:e.customFields,element:t,event:e.event,positionsSlotsIds:e.positionsSlotsIds,vr:e.vr},t.id))}):"image"===e.element.type?(0,i.jsx)(dV,{element:e.element,vr:e.vr}):"text"===e.element.type?(0,i.jsx)(uV,{customFields:e.customFields,element:e.element,event:e.event,vr:e.vr}):null:null,mV=e=>{const t=e.customDocument.configuration,n=e.volunteerRegistration.accreditationsUsersInfos.map(e=>e.accreditationSlot.id),s=e.volunteerRegistration.accreditationsUsersInfos.flatMap(e=>m(e.accreditation.acronym)?[e.accreditation.acronym]:[]),o=e.volunteerRegistration.positionsSlotsUsersInfos.map(e=>e.positionSlot.id),r=t.bleed?19:0;return(0,i.jsx)(i.Fragment,{children:t.pages.map(a=>bL(a,n,s,o,e.volunteerRegistration.userInfo.fields)?(0,i.jsxs)(Na,{css:{background:"white",padding:`${r}px`,position:"relative"},height:2*r+t.height,width:2*r+t.width,children:[t.bleed&&(0,i.jsx)(FL,{}),(0,i.jsx)(Na,{css:{background:"white",pageBreakBefore:"always",position:"relative"},height:t.height,width:t.width,children:a.elements.map(t=>(0,i.jsx)(hV,{accreditationsAcronyms:s,accreditationsSlotsIds:n,customFields:e.customFields,element:t,event:e.event,positionsSlotsIds:o,vr:e.volunteerRegistration},t.id))})]},a.id):null)})},gV=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,userInfoId:o,customDocumentId:r}}=_l(),{event:a}=vb(),{data:l,loader:d}=Zn("query UserCustomDocumentExport(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $customDocumentId: CustomDocumentId!\n) {\n organization(id: $organizationId) {\n customFields {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n ...EventVolunteersExport\n\n id\n name\n organizationId\n startAt\n endAt\n\n customDocument(customDocumentId: $customDocumentId) {\n name\n slug\n configuration\n populationsIds\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n ...CustomBadgeVolunteerRegistration\n }\n }\n}\n",{organizationId:n,eventId:s,userInfoId:o,customDocumentId:r},[Ls.CustomFieldWithConditionFragment,Ls.EventVolunteersExportFragment,Ls.CustomBadgeVolunteerRegistrationFragment]),c=(0,L.useMemo)(()=>{if(l.event){const e=l.event.customDocument,t=l.event.volunteerRegistration.userInfo.links;return ug(t?.userCustomDocumentLinks[e?.slug||""]||"","pdf",{lang:l.event.volunteerRegistration.userInfo.fields?.language?.rawValue})}return""},[l.event]);return Dd(`${a.name} ${l.event?.customDocument?.name??""}`),(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{customDocumentSlug:l.event?.customDocument?.slug,documentType:Ee.UserCustomDocument,eventId:s,extraButton:(0,i.jsx)(El,{color:"white",onClick:()=>{e.push($s.EDIT_CUSTOM_DOCUMENT(n,s,r))},children:t("_diter_le_docum_83590")}),languages:l.event?.languages??[],organizationId:n,segmentsFolders:l.event?.segmentsFolders??[],title:l.event?.customDocument?.name??""}),(0,i.jsx)(qa,{height:"7"}),d||(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},direction:"column",children:[(0,i.jsx)(pj,{downloadPath:c,getPath:e=>$s.DOCUMENTS_USER_CUSTOM_DOCUMENT(n,s,e,r),populationsIds:no(l.event?.customDocument?.populationsIds)?l.event.customDocument.populationsIds:void 0}),(0,i.jsx)(IB,{children:(0,i.jsx)(mV,{customDocument:l.event.customDocument,customFields:l.organization.customFields.nodes,event:l.event,volunteerRegistration:l.event.volunteerRegistration})})]})]})},pV=e=>{const t=tc(e.options.headerColor)?e.options.headerColor:"white";return(0,i.jsxs)(Na,{css:{color:tc(e.options.textColor)?e.options.textColor:"$gray800",background:m(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",minHeight:`${Xm}px`,pageBreakBefore:"always"},direction:"column",width:Jm,children:[(0,i.jsxs)(Na,{align:"end",css:{marginTop:"51px",px:"16px"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{css:{color:t,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:e.headerTitle1}),(0,i.jsx)(yr,{css:{color:t,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:e.headerTitle2})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{css:{minHeight:"971px",paddingBottom:"$6",paddingLeft:"$4",paddingRight:"$4"},gap:"4",width:1,children:(0,i.jsx)(Na,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",overflowX:"hidden",padding:"$4"},direction:"column",children:e.children})})]})},fV=e=>{const t=Yn(),n=qn(Kc),s=qn(ep),o=(0,L.useMemo)(()=>e.psuis.filter(t=>t.positionSlot.range.start.startOf("day").toMillis()===e.day.toMillis()),[e.day,e.psuis]),r=(0,L.useMemo)(()=>(0,vv.A)(o,e=>e.timeDifferenceMinutes),[o]);return(0,i.jsxs)(Na,{css:{bd:!0,overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(yr,{css:{padding:"$3 $4",textTransform:"capitalize"},font:"gray800 textSm semiBold",children:n.toLocaleString(e.day,Js.DateOnly.WeekdayLongMonthLong)}),(0,i.jsxs)(kc,{css:{borderTop:"1px solid $gray200"},hideBorder:!0,children:[(0,i.jsxs)(jc,{css:{height:"32px"},children:[(0,i.jsx)(Vc,{children:t("nom_de_la_missi_64605")}),(0,i.jsxs)(Vc,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(yr,{children:t("d_but_41840")}),(0,i.jsx)(yr,{css:{fontSize:"8px"},children:t("_point_missi_66864")})]}),(0,i.jsxs)(Vc,{align:"start",direction:"column",width:120,children:[(0,i.jsx)(yr,{children:t("fin_60104")}),(0,i.jsx)(yr,{css:{fontSize:"8px"},children:t("_point_missi_66864")})]}),(0,i.jsx)(Vc,{width:120,children:t("pause_46709")}),(0,i.jsx)(Vc,{width:120,children:t("total_07173")})]}),o.map((t,o)=>(0,i.jsxs)(Dc,{css:{height:"32px"},children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{font:"gray800 textXs medium",children:t.position.name})}),(0,i.jsxs)(Ec,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(yr,{children:t.checkInAt?.isValid?n.toLocaleString(t.checkInAt.setZone(e.timeZone),Js.TimeOnly):"-"}),(0,i.jsx)(yr,{css:{fontSize:"8px"},children:n.toLocaleString(t.positionSlot.range.start,Js.TimeOnly)})]}),(0,i.jsxs)(Ec,{align:"start",css:{color:"$gray500"},direction:"column",width:120,children:[(0,i.jsx)(yr,{children:t.checkOutAt?.isValid?n.toLocaleString(t.checkOutAt.setZone(e.timeZone),Js.TimeOnly):"-"}),(0,i.jsx)(yr,{css:{fontSize:"8px"},children:n.toLocaleString(t.positionSlot.range.end,Js.TimeOnly)})]}),(0,i.jsx)(Ec,{css:{color:"$gray500"},width:120,children:t.breakTime>0?s.minutesToHoursMinutesString(t.breakTime):"-"}),(0,i.jsx)(Ec,{css:{color:"$gray500"},justify:"end",width:120,children:s.minutesToHoursMinutesString(t.timeDifferenceMinutes)})]},o)),(0,i.jsxs)(jc,{css:{borderBottom:"none",height:"32px"},children:[(0,i.jsx)(Vc,{children:(0,i.jsx)(yr,{font:"gray800 textXs semiBold",children:t("total_de_la_jou_73634")})}),(0,i.jsx)(Vc,{justify:"end",width:120,children:(0,i.jsx)(yr,{font:"gray800 textXs semiBold",children:s.minutesToHoursMinutesString(r)})})]})]})]})},xV=e=>{const t=Yn(),n=qn(ep),s=e.event.volunteerRegistration,o=s.userInfo,r=(0,L.useMemo)(()=>gg(s.positionsSlotsUsersInfos,e.date,null),[s.positionsSlotsUsersInfos]),a=(0,L.useMemo)(()=>(0,lc.A)((0,ph.A)(r.map(e=>e.positionSlot.range.start.startOf("day")),e=>e.toMillis()),e=>e.toMillis()),[r]),l=(0,L.useMemo)(()=>(0,vv.A)(r,e=>e.timeDifferenceMinutes),[r]);return(0,i.jsx)(pV,{headerTitle1:`${m(e.eventDocument.title)?e.eventDocument.title:t("UserHours")} ${o.name}`,headerTitle2:t("total_d_heures_11826",n.minutesToHoursMinutesString(l)),options:e.options,children:(0,i.jsx)(Na,{direction:"column",gap:"4",width:1,children:a.map(t=>(0,i.jsx)(fV,{day:t,psuis:r,timeZone:e.event.timeZone},t.toMillis()))})})},_V=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{eventDocument:o,options:r,title:a,setOptions:l,setTitle:d}=EB(e.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",textColor:"#1d2939",title:""},s,{id:e.event.document.id}),c=$L(),u=e.event.volunteerRegistration.userInfo,h=u.links?.userHoursLink??"";return(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SB,{children:[(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:r.background,onChange:e=>{l({background:e})}}),m(r.background?.name)&&(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{l({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Nl,{label:t("titre_du_docume_33508"),value:a,onChange:e=>{d(e)}}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(zu,{label:"Police",value:r.fontFamily,onChange:e=>{l({fontFamily:e})},children:c}),(0,i.jsx)(Nj,{label:t("couleur_du_cont_17150"),value:r.headerColor,onChange:e=>{l({headerColor:e})}})]}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pj,{downloadPath:ug(h,"pdf",{lang:u.language}),getPath:e=>$s.DOCUMENTS_HOURS(n,s,e)}),(0,i.jsx)(IB,{children:(0,i.jsx)(xV,{event:e.event,eventDocument:o,options:r})})]})]})},IV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query UserHoursDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUsersHours\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s},[Ls.DocumentUsersHoursFragment,Ls.EventVolunteersExportFragment]);return Dd(`${o.name} ${e("UserHours")}`),(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.UserHours,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,title:e("UserHours")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsx)(_V,{event:r.event})]})},vV=e=>{const t=Yn(),n=qn(Kc),s=e.event.volunteerRegistration,o=s.userInfo,r=(0,L.useMemo)(()=>(0,ih.A)(s.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.start)),[s.positionsSlotsUsersInfos]),a=(0,L.useMemo)(()=>(0,sh.A)(s.positionsSlotsUsersInfos.map(e=>e.positionSlot.range.end)),[s.positionsSlotsUsersInfos]),l=(0,L.useMemo)(()=>(0,lc.A)(Object.entries((0,ac.A)(s.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.startOf("day").toMillis())),([e,t])=>t[0].positionSlot.range.start.startOf("day").toMillis()).map(([e,t])=>{const i=t[0],s=(0,lc.A)(Object.values((0,ac.A)(t,e=>e.position.id)),e=>(0,gh.A)(e.map(e=>e.positionSlot.range.start.toMillis()))).map(e=>{const t=e[0].position,n=(0,lc.A)(e.map(({positionSlot:e})=>e.range),e=>e.start.toMillis()).map(e=>`${e.start.toFormat("H'h'mm")}-${e.end.toFormat("H'h'mm")}`).join(" | "),i=1504===t.organizationId&&m(t.address)?` (${t.address})`:"";return`${t.name} : ${n}${i}`});return[n.toLocaleString(i.positionSlot.range.start.startOf("day"),Js.DateOnly.WeekdayLongMonthLong),s]}),[s.positionsSlotsUsersInfos]);return(0,i.jsxs)(Na,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[m(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(qa,{height:"7"})]}),(0,i.jsxs)(Na,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(yr,{font:"primary800 displayXs semiBold",children:o.nameOrEmail}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray800",children:t("p_riode_du_1_89633",n.toLocaleString(r,Js.DateTime),n.toLocaleString(a,Js.DateTime))}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Na,{direction:"column",gap:"4",children:l.map(([e,t],n)=>(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{css:{textTransform:"capitalize"},font:"gray800 textSm bold",children:e}),(0,i.jsx)(Na,{direction:"column",children:t.map((e,t)=>(0,i.jsx)(yr,{children:e},t))})]},n))})]})]})},bV=e=>{const t=Yn(),n=e.event.volunteerRegistration,s=n.userInfo;return no(n.positionsSlotsUsersInfos)?(0,i.jsx)(vV,{...e}):(0,i.jsxs)(Na,{css:{background:"$gray100",padding:"32px 45px 50px 45px"},direction:"column",width:1,children:[m(e.options.logo?.content)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{height:56,textAlign:"center",width:1,children:(0,i.jsx)("img",{height:"100%",src:e.options.logo.content,width:"auto"})}),(0,i.jsx)(qa,{height:"7"})]}),(0,i.jsxs)(Na,{css:{background:"white",borderRadius:"16px",padding:"32px"},direction:"column",height:1,width:1,children:[(0,i.jsx)(yr,{font:"primary800 displayXs semiBold",children:s.nameOrEmail}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray800",children:t("aucune_affectat_04761")})]})]})},jV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{options:o,setOptions:r}=EB(e.data.event.document.options,{logo:{name:"",content:""}},s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(SB,{children:(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",label:t("logo_18191"),placeholder:t("logo_18191"),value:o.logo,onChange:e=>{r({logo:e})}})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pj,{downloadPath:ug(a.links?.userPlanningDaysLink??"","pdf",{lang:a.language}),getPath:e=>$s.DOCUMENTS_USER_PLANNING_DAYS(n,s,e)}),(0,i.jsx)(IB,{children:(0,i.jsx)(bV,{event:e.data.event,options:o})})]})]})},CV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query UserPlanningDaysDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanningDays\n ...EventVolunteersExport\n }\n}\n",{eventId:n,userInfoId:s},[Ls.DocumentUserPlanningDaysFragment,Ls.EventVolunteersExportFragment]);return Dd(`${o.name} ${e("UserPlanningDays")}`),(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.UserPlanningDays,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("plannings_indiv_39650")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsx)(jV,{data:r})]})};var yV=n(3514);const kV=e=>{const t=Yn(),n=qn(Kc),s=e.event.volunteerRegistration,o=s.userInfo,r=e.startDate?Us.c9.max(e.startDate,e.event.startAt):e.event.startAt,a=e.startDate?Us.c9.min(e.startDate.plus({week:1}).minus({day:1}),e.event.endAt):e.event.endAt,l=tc(e.options.headerColor)?e.options.headerColor:"white",d=e.options.showInformations||e.options.showQrCode;return(0,i.jsxs)(Na,{css:{color:tc(e.options.textColor)?e.options.textColor:"$gray800",background:m(e.options.background?.content)?`url(${e.options.background?.content})`:"#5230a1",backgroundRepeat:"no-repeat",backgroundSize:"cover",fontFamily:e.options.fontFamily||"Open Sans",fontSize:"12px",pageBreakBefore:"always",position:"relative"},height:Jm,width:Xm,children:[(0,i.jsxs)(Na,{align:"end",css:{position:"absolute",right:"16px",top:"69px"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{css:{color:l,fontSize:"13px",fontWeight:"700",lineHeight:"18px"},children:t("planning_indivi_05075",o.nameOrEmail)}),(0,i.jsx)(yr,{css:{color:l,fontSize:"24px",fontWeight:"700",textTransform:"uppercase"},children:t("du_1_au_2_12974",n.toLocaleString(r,Js.DateOnly.MonthLong),n.toLocaleString(a,Js.DateOnly.MonthLong))})]}),(0,i.jsxs)(Na,{css:{px:"$4",position:"absolute",top:"140px"},gap:"5",height:635,width:1,children:[d&&(0,i.jsxs)(qB,{children:[(0,i.jsx)(HB,{informationsContent:e.document.informationsContent,informationsTitle:e.document.informationsTitle,options:e.options,renderText:e.renderText}),(0,i.jsx)(YB,{isAso:!1,options:e.options,ticketId:s.ticketId})]}),(0,i.jsx)(Na,{css:{background:"white",borderRadius:"$3",flex:"1",fontSize:"12px",padding:"$6 $5"},height:1,children:(0,i.jsx)(yr,{width:1,children:e.children})})]})]})},AV=e=>{const t=Yn(),n=qn(hh),s=(0,L.useMemo)(()=>{const t=ec(e.psui.position.color);return{background:t[50],color:t[700]}},[e.psui]),o=(0,L.useMemo)(()=>"number"==typeof e.startHour&&e.startHour>0&&e.psui.positionSlot.range.start.hour{const i=e.psui.positionSlot.range.start.day===e.psui.positionSlot.range.end.day,s=vh(n,e.psui.positionSlot,"",{interval:{options:i?{hideDate:!0}:{formats:{localeFormat:{day:"numeric",month:"numeric"}}}},slot:{includeRange:!0}});return o?`${s} ${t("j_1_51317")}`:s},[e.psui,o]);return(0,i.jsxs)(Na,{css:{...s,borderRadius:"$1",padding:"$1 $2"},direction:"column",gap:"1",justify:"center",width:1,children:[(0,i.jsx)(yr,{css:{fontSize:"10px"},children:r}),(0,i.jsx)(yr,{fontSize:"textXs",fontWeight:"medium",children:e.psui.position.name})]})},wV=e=>(0,i.jsx)(kV,{document:e.document,event:e.event,options:e.options,renderText:e.renderText,startDate:e.startDate,children:(0,i.jsx)(QA,{css:{border:"1px solid $gray200",borderRadius:"$2",height:"100%",overflow:"hidden","& .h-calendar-events-container":{height:"100% !important"}},date:e.startDate,display:"week",maxDate:e.event.endAt,minDate:e.event.startAt,children:e.assignments.map(t=>(0,i.jsx)(JA,{endAt:t.range.start,startAt:t.range.start,startHour:e.startHour,children:(0,i.jsx)(AV,{psui:t,startHour:e.startHour})},t.id))})}),SV=e=>{const{minDate:t,numberOfWeeks:n}=(0,L.useMemo)(()=>{const t=(0,gh.A)(e.assignments.map(e=>e.positionSlot.range.start)).startOf("week"),n=(0,yV.A)(e.assignments.map(e=>e.positionSlot.range.end)).endOf("week");return{minDate:t,numberOfWeeks:Math.ceil(n.diff(t,"weeks").weeks)}},[e.assignments]);return(0,i.jsx)(i.Fragment,{children:(0,Oc.A)(0,n).map(n=>(0,i.jsx)(wV,{assignments:e.assignments,document:e.eventDocument,event:e.event,options:e.options,renderText:e.renderText,startDate:t.plus({week:n}),startHour:e.startHour},n))})},EV=e=>{const t=qn(Tw),[n]=(0,L.useMemo)(()=>Ih(e.event.dayStartTime),[e.event.dayStartTime]),s=(0,L.useMemo)(()=>{const t=dh(e.event.volunteerRegistration.positionsSlotsUsersInfos.map(e=>({...e,range:e.positionSlot.range})),e.event.startAt,e.event.endAt,n);return(0,lc.A)(gg(t,e.date,e.endDate),e=>e.positionSlot.range.start.toMillis())},[e.event,n]),o=n=>t.renderText(n,{userInfo:e.event.volunteerRegistration.userInfo,volunteerRegistration:e.event.volunteerRegistration});return io(s)?(0,i.jsx)(kV,{document:e.eventDocument,event:e.event,options:e.options,renderText:o}):(0,i.jsx)(SV,{assignments:s,event:e.event,eventDocument:e.eventDocument,options:e.options,renderText:o,startHour:n})},TV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{eventDocument:o,informationsTitle:r,informationsContent:a,options:l,setOptions:d,setInformationsTitle:c,setInformationsContent:u}=EB(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",informationsContent:"",informationsTitle:"",showInformations:!1,showQrCode:!1,subtitleColor:"#1d2939",textColor:"#1d2939",titleFontFamily:"Open Sans"},s,{id:e.data.event.document.id,informationsTitle:e.data.event.document.informationsTitle,informationsContent:e.data.event.document.informationsContent}),h=$L(),g=e.data.event?.volunteerRegistration.userInfo,p=g.links?.userPlanningLink??"";return(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SB,{children:[(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:l.background,onChange:e=>{d({background:e})}}),m(l.background?.name)&&(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(zu,{label:"Police",value:l.fontFamily,onChange:e=>{d({fontFamily:e})},children:h}),(0,i.jsx)(zu,{label:t("police_des_titr_37497"),value:l.titleFontFamily,onChange:e=>{d({titleFontFamily:e})},children:h}),(0,i.jsx)(Nj,{label:t("couleur_des_sou_18968"),value:l.subtitleColor,onChange:e=>{d({subtitleColor:e})}}),(0,i.jsx)(Nj,{label:t("couleur_du_text_32021"),value:l.textColor,onChange:e=>{d({textColor:e})}}),(0,i.jsx)(Nj,{label:t("couleur_du_cont_17150"),value:l.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(ju,{value:l.showInformations,onChange:e=>{d({showInformations:e})},children:t("afficher_la_sec_84744")}),l.showInformations&&(0,i.jsxs)(Na,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",padding:"$4"},direction:"column",gap:"3",children:[(0,i.jsx)(Nl,{label:t("titre_de_la_sec_41575"),value:r,onChange:e=>{c(e)}}),(0,i.jsx)(Jv,{initialValue:a,label:t("contenu_de_la_s_43102"),onChange:e=>{u(e)}})]}),(0,i.jsx)(ju,{value:l.showQrCode,onChange:e=>{d({showQrCode:e})},children:t("afficher_le_qr_15635")})]}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pj,{downloadPath:ug(p,"pdf",{lang:g?.language}),getPath:e=>$s.DOCUMENTS_USER_PLANNING(n,s,e)}),(0,i.jsx)(IB,{children:(0,i.jsx)(EV,{event:e.data.event,eventDocument:o,options:l})})]})]})},zV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query UserPlanningDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanning\n ...EventVolunteersExport\n\n startAt\n endAt\n }\n}\n",{eventId:n,userInfoId:s},[Ls.DocumentUserPlanningFragment,Ls.EventVolunteersExportFragment]);return Dd(`${o.name} ${e("UserPlanning")}`),(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.UserPlanning,endAt:r.event?.endAt,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,startAt:r.event?.startAt,title:e("plannings_indiv_80073")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsx)(TV,{data:r})]})},OV=e=>{const t=Yn(),n=qn(hh);return(0,i.jsxs)(Na,{css:{background:"$gray100",padding:"$4 56px"},direction:"column",gap:"2",children:[(0,i.jsx)(yr,{font:"gray900 textXl semiBold",children:t("planning_1_14391",e.nameOrEmail)}),e.interval&&(0,i.jsxs)(Na,{gap:"1",children:[(0,i.jsx)(yr,{color:"gray800",children:t("plage_de_dates_08875")}),(0,i.jsx)(yr,{color:"gray500",children:n.toDisplayString(e.interval,{formats:{displayWeekday:!0},hideTime:!0})})]}),(0,i.jsxs)(Na,{gap:"1",children:[(0,i.jsx)(yr,{color:"gray800",children:t("nombre_d_affect_01587")}),(0,i.jsx)(yr,{color:"gray500",children:e.numberOfAssignments})]})]})},RV=e=>{const t=Yn(),n=qn(Kc),s=qn(ep);return(0,i.jsx)(Na,{css:{padding:"$6 $8"},children:(0,i.jsxs)(kc,{children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{css:{px:"$3"},children:t("nom_de_la_missi_64605")}),(0,i.jsx)(Vc,{css:{px:"$3"},width:380,children:t("Date")}),e.showHours&&(0,i.jsx)(Vc,{css:{px:"$3"},width:120,children:t("total_07173")})]}),e.assignments.map((t,o)=>{const r=no(t.slotsNames),a=(0,Zg.A)(t.ranges.map(e=>e.toDuration("minutes").minutes));return(0,i.jsxs)(Dc,{css:{height:r?"54px":"44px"},children:[(0,i.jsx)(Ec,{align:"center",css:{px:"$3"},children:(0,i.jsx)(yr,{css:{clamp:"2"},font:"gray900 textSm medium",title:t.name,width:1,children:t.name})}),(0,i.jsxs)(Ec,{css:{px:"$3"},direction:"column",gap:"1",justify:"center",width:380,children:[r&&(0,i.jsx)(yr,{color:"gray900",width:1,children:t.slotsNames.join(", ")}),(0,i.jsxs)(yr,{width:1,children:[(0,fd.A)(n.toLocaleString(t.ranges[0].start,Js.DateOnly.WeekdayShortMonthLong))," ",t.ranges.map(e=>`${e.start.toFormat("HH:mm")}-${e.end.toFormat("HH:mm")}`).join(" | ")]})]}),e.showHours&&(0,i.jsx)(Ec,{css:{px:"$3"},width:120,children:s.minutesToHoursMinutesString(a)})]},o)})]})})},$V=e=>{const t=(0,L.useMemo)(()=>Kg(gg(e.event.volunteerRegistration.positionsSlotsUsersInfos,e.date,e.endDate)),[e.event.volunteerRegistration,e.date]);return(0,i.jsx)(i.Fragment,{children:(0,Yg.A)(t,20).map((t,n)=>{const s=t.flatMap(e=>e.ranges),o=(0,ih.A)(s.map(e=>e.start),e=>e.toMillis()),r=(0,sh.A)(s.map(e=>e.end),e=>e.toMillis()),a=Us.IX.fromDateTimes(o,r);return(0,i.jsxs)(Na,{css:{background:"white",pageBreakBefore:"always"},direction:"column",width:1,children:[(0,i.jsx)(OV,{interval:a,nameOrEmail:e.event.volunteerRegistration.userInfo.nameOrEmail,numberOfAssignments:t.flatMap(e=>e.ranges).length}),(0,i.jsx)(RV,{assignments:t,showHours:e.options.showHours})]},n)})})},DV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{options:o,setOptions:r}=EB(e.data.event.document.options,{showHours:!0},s,{id:e.data.event.document.id}),a=e.data.event.volunteerRegistration.userInfo;return(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsx)(SB,{children:(0,i.jsx)(gc,{state:o.showHours?"checked":"unchecked",onClick:e=>{r({showHours:"checked"===e})},children:t("afficher_le_tot_23855")})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(pj,{downloadPath:ug(a.links?.userPlanningListLink??"","pdf",{lang:a.language}),getPath:e=>$s.DOCUMENTS_USER_PLANNING_LIST(n,s,e)}),(0,i.jsx)(IB,{width:1,children:(0,i.jsx)($V,{event:e.data.event,options:o})})]})]})},PV=()=>{const{translate:e,params:{organizationId:t,eventId:n,userInfoId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query UserPlanningListDocument($eventId: EventId!, $userInfoId: UsersInfoId!) {\n event(id: $eventId) {\n ...DocumentUserPlanningList\n ...EventVolunteersExport\n\n startAt\n endAt\n }\n}\n",{eventId:n,userInfoId:s},[Ls.DocumentUserPlanningListFragment,Ls.EventVolunteersExportFragment]);return Dd(`${o.name} ${e("UserPlanningList")}`),(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.UserPlanningList,endAt:r.event?.endAt,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],showDate:!0,startAt:r.event?.startAt,title:e("plannings_indiv_97766")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsx)(DV,{data:r})]})},FV=e=>{const t=Yn(),n=e.documentUsersListing.organization.customFields.nodes,s=(0,L.useMemo)(()=>(0,lc.A)(e.documentUsersListing.event.volunteersRegistrations.nodes,e=>e.userInfo.name),[e.documentUsersListing.event.volunteersRegistrations.nodes]),o=(0,L.useMemo)(()=>(0,Yg.A)(s,30),[s]),r=e.documentUsersListing.event.segment;return no(s)?(0,i.jsx)(i.Fragment,{children:o.map((o,a)=>(0,i.jsx)(pV,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("liste_des_membr_89037"),headerTitle2:`${r.name} (${s.length})`,options:e.options,children:(0,i.jsx)(Na,{css:{background:"white"},direction:"column",width:1,children:(0,i.jsx)(CB,{customFields:n,slugsToDisplay:e.options.slugsToDisplay,volunteers:o})})},a))}):(0,i.jsx)(pV,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("liste_des_membr_89037"),headerTitle2:r.name,options:e.options})},MV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{user:o}=si(),{eventDocument:r,options:a,title:l,setOptions:d,setTitle:c}=EB(e.data.event.document.options,{background:{name:"",content:""},fontFamily:"Open Sans",headerColor:"#ffffff",slugsToDisplay:["fullName","phone"],textColor:"#1d2939",title:""},e.eventId,{id:e.data.event.document.id}),u=$L();return(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SB,{children:[(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),m(a.background?.name)&&(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Nl,{label:t("titre_du_docume_33508"),value:l,onChange:e=>{c(e)}}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(zu,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:u}),(0,i.jsx)(Nj,{label:t("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsxs)(bc,{isSearchVisible:!0,label:t("champs_affich_17945"),multiple:!0,placeholder:t("champs_affich_17945"),values:a.slugsToDisplay,onChange:e=>{d({slugsToDisplay:e})},children:[(0,i.jsx)("option",{value:"email",children:t("Email")}),(0,i.jsx)("option",{value:"fullName",children:t("nom_complet_05907")}),(0,i.jsx)("option",{value:"teamCode",children:t("code_quipe_14296")}),e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))]})]}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(DB,{downloadPath:ug(e.data.event.segment.links.usersListingLink,"pdf",{lang:o?.language}),getPath:e=>$s.DOCUMENTS_VOLUNTEERS_LISTING(n,s,e),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(IB,{width:1,children:(0,i.jsx)(FV,{documentUsersListing:e.data,eventDocument:r,options:a})})]})]})},NV=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query UsersListingDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n) {\n ...DocumentUsersListing\n\n event(id: $eventId) {\n ...EventVolunteersExport\n }\n}\n",{organizationId:t,eventId:n,segmentId:s},[Ls.DocumentUsersListingFragment,Ls.EventVolunteersExportFragment]);return Dd(`${o.name} ${e("liste_des_membr_89037")}`),(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.VolunteersListing,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("liste_des_membr_89037")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsx)(MV,{data:r,eventId:n})]})},LV=e=>{const t=qn(rC),n=(0,L.useMemo)(()=>e.customFields.find(t=>t.slug===e.options.customFieldSlug),[e.customFields,e.options.customFieldSlug]);return(0,i.jsx)(Na,{css:{columnGap:"$2",rowGap:"$3"},wrap:"wrap",children:e.vrs.map(s=>{const o=s.userInfo,r=Eg(o.name,o.email);return(0,i.jsxs)(Na,{direction:"column",gap:"2",width:84,children:[(0,i.jsx)(yr,{css:{borderRadius:"$1",overflow:"hidden"},height:84,width:84,children:m(o.picture?.url)?(0,i.jsx)("img",{height:"100%",src:o.picture.url,width:"100%"}):(0,i.jsx)(Na,{align:"center",css:{background:zg(r)},height:1,justify:"center",width:1,children:(0,i.jsx)(yr,{font:"white displaySm medium",children:r})})}),(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray900 textXs medium",title:o.lastName,children:(o.lastName||"-").toUpperCase()}),(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray900 textXs medium",title:o.firstName,children:o.firstName||"-"}),n&&(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0,fontSize:"10px"},title:"",children:t.getValueString(n,o.fields)||"-"}),e.options.showPhone&&(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0,fontSize:"10px"},title:o.phone?.internationalFormat||"-",children:o.phone?.internationalFormat||"-"})]})]},o.id)})})},BV=e=>{const t=Yn(),n=e.documentUsersPictures.event.volunteersRegistrations.nodes,s=(0,L.useMemo)(()=>(0,Yg.A)(n,48),[n]),o=e.documentUsersPictures.event.segment;return no(n)?(0,i.jsx)(i.Fragment,{children:s.map((s,r)=>(0,i.jsx)(pV,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("trombinoscope_11316"),headerTitle2:`${o.name} (${n.length})`,options:e.options,children:(0,i.jsx)(LV,{customFields:e.documentUsersPictures.organization.customFields.nodes,options:e.options,vrs:s})},r))}):(0,i.jsx)(pV,{headerTitle1:m(e.eventDocument.title)?e.eventDocument.title:t("trombinoscope_11316"),headerTitle2:o.name,options:e.options})},VV=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{user:o}=si(),{eventDocument:r,options:a,title:l,setOptions:d,setTitle:c}=EB(e.data.event.document.options,{background:{name:"",content:""},customFieldSlug:null,fontFamily:"Open Sans",headerColor:"#ffffff",showPhone:!0,textColor:"#1d2939",title:""},s,{id:e.data.event.document.id,title:e.data.event.document.title}),u=$L();return(0,i.jsxs)(Na,{css:{flex:"1",overflow:"auto"},gap:"7",width:1,children:[(0,i.jsxs)(SB,{children:[(0,i.jsxs)(Na,{align:"center",gap:"3",children:[(0,i.jsx)(WB,{accept:Rv.Images,format:"base64",label:t("fond_du_documen_51758"),placeholder:t("fond_du_documen_51758"),value:a.background,onChange:e=>{d({background:e})}}),m(a.background?.name)&&(0,i.jsx)(yr,{css:{cursor:"pointer"},font:"gray700 textSm medium",onClick:()=>{d({background:{name:"",content:""}})},children:t("r_initialiser_77538")})]}),(0,i.jsx)(Nl,{label:t("titre_du_docume_33508"),value:l,onChange:e=>{c(e)}}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(zu,{label:"Police",value:a.fontFamily,onChange:e=>{d({fontFamily:e})},children:u}),(0,i.jsx)(Nj,{label:t("couleur_du_cont_17150"),value:a.headerColor,onChange:e=>{d({headerColor:e})}}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("champ_suppl_men_12652"),placeholder:t("champ_suppl_men_12652"),values:a.customFieldSlug?[a.customFieldSlug]:[],onChange:e=>{no(e)?d({customFieldSlug:e[0]}):d({customFieldSlug:null})},children:e.data.organization.customFields.nodes.map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.id))}),a.showPhone&&(0,i.jsx)(ju,{value:a.showPhone,onChange:e=>{d({showPhone:e})},children:t("afficher_le_num_37843")})]}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(DB,{downloadPath:ug(e.data.event.segment.links.usersPicturesLink,"pdf",{lang:o?.language}),getPath:e=>$s.DOCUMENTS_USERS_PICTURES(n,s,e),segmentsFolders:e.data.event.segmentsFolders}),(0,i.jsx)(IB,{children:(0,i.jsx)(BV,{documentUsersPictures:e.data,eventDocument:r,options:a})})]})]})},UV=()=>{const{translate:e,params:{organizationId:t,eventId:n,segmentId:s}}=_l(),{event:o}=vb(),{data:r,loader:a}=Zn("query UsersPicturesDocument(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $segmentId: SegmentId!\n) {\n ...DocumentUsersPictures\n\n event(id: $eventId) {\n ...EventVolunteersExport\n }\n}\n",{organizationId:t,eventId:n,segmentId:s},[Ls.DocumentUsersPicturesFragment,Ls.EventVolunteersExportFragment]);return Dd(`${o.name} ${e("trombinoscope_11316")}`),(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(_B,{documentType:Ee.UsersPictures,eventId:n,languages:r.event?.languages??[],organizationId:t,segmentsFolders:r.event?.segmentsFolders??[],title:e("trombinoscope_11316")}),(0,i.jsx)(qa,{height:"7"}),a||(0,i.jsx)(VV,{data:r})]})},WV=e=>{const{history:t,translate:n}=_l(),{data:s,loader:o}=Zn("query EmailsTemplates($eventId: EventId!) {\n event(id: $eventId) {\n emailSender {\n ... on EmailsSender {\n domainStatus\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const[r,a]=(0,L.useState)(Oe.Assignments);return o||(0,i.jsxs)(i.Fragment,{children:[(!s.event.emailSender||s.event.emailSender.domainStatus!==Ae.Success)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{gap:"4",width:1,children:[s.event.emailSender&&s.event.emailSender.domainStatus!==Ae.Success&&(0,i.jsx)(sl,{color:"error",leftIcon:"circle-exclamation",width:1,children:(0,i.jsxs)(Na,{css:{fontWeight:"$medium"},direction:"column",gap:"3",children:[(0,i.jsx)(yr,{children:n("vos_entr_es_dns_68834")}),(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{t.push($s.ORGANIZATION_PARAMETERS_EMAILS_DNS(e.organizationId))},children:[(0,i.jsx)(yr,{children:n("configurer_les_65453")}),(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"arrow-right"})})]})]})}),!s.event.emailSender&&(0,i.jsx)(sl,{color:"warning",leftIcon:"triangle-exclamation",width:1,children:(0,i.jsxs)(Na,{css:{fontWeight:"$medium"},direction:"column",gap:"3",children:[(0,i.jsx)(yr,{children:n("aucun_metteur_26635",P.EMAIL_FROM)}),(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer"},gap:"3",onClick:()=>{t.push($s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:[(0,i.jsx)(yr,{children:n("configurer_les_56837")}),(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"arrow-right"})})]})]})})]}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsxs)(Na,{css:{flex:"1",py:"$3"},direction:"column",children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:n("liste_des_e_mai_73508")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(kc,{children:[(0,i.jsx)(jc,{children:(0,i.jsx)(Vc,{children:n("type_d_e_mail_06577")})}),(0,i.jsx)(gE,{isSelected:r===Oe.VolunteerRegistration,subtitle:n("cet_e_mail_est_75023"),title:n("UserInfoAdminCreate"),onClick:()=>a(Oe.VolunteerRegistration)}),(0,i.jsx)(gE,{isSelected:r===Oe.Assignments,subtitle:n("cet_e_mail_cont_98777"),title:n("affectation_u_11128"),onClick:()=>a(Oe.Assignments)}),(0,i.jsx)(gE,{isSelected:r===Oe.Refused,subtitle:n("cet_e_mail_est_69069"),title:n("refus_d_affecta_71455"),onClick:()=>a(Oe.Refused)}),(0,i.jsx)(gE,{isSelected:r===Oe.Accreditations,subtitle:n("cet_e_mail_cont_75798"),title:n("affectation_u_39802"),onClick:()=>a(Oe.Accreditations)}),(0,i.jsx)(gE,{isSelected:r===Oe.AccreditationsRefused,subtitle:n("cet_e_mail_est_69069"),title:n("refus_d_accr_di_89997"),onClick:()=>a(Oe.AccreditationsRefused)}),(0,i.jsx)(gE,{isSelected:r===Oe.DelegationCategoryLeaderAssign,subtitle:n("cet_e_mail_est_67392"),title:n("nomination_en_t_77654"),onClick:()=>a(Oe.DelegationCategoryLeaderAssign)}),(0,i.jsx)(gE,{isSelected:r===Oe.DelegationLeaderAssign,subtitle:n("email_sent_when_appointing_team_manager"),title:n("appointment_as_team_manager"),onClick:()=>a(Oe.DelegationLeaderAssign)}),(0,i.jsx)(gE,{isSelected:r===Oe.DelegationFormInvite,subtitle:n("cet_e_mail_est_19547"),title:n("envoi_du_formul_09434"),onClick:()=>a(Oe.DelegationFormInvite)}),(0,i.jsx)(gE,{isSelected:r===Oe.PositionLeaderAssign,subtitle:n("cet_e_mail_est_82173"),title:n("nomination_en_t_06971"),onClick:()=>a(Oe.PositionLeaderAssign)}),(0,i.jsx)(gE,{isSelected:r===Oe.PositionCategoryLeaderAssign,subtitle:n("cet_e_mail_est_70420"),title:n("nomination_en_t_02948"),onClick:()=>a(Oe.PositionCategoryLeaderAssign)}),(0,i.jsx)(gE,{isSelected:r===Oe.NotifyLeaders,subtitle:n("cet_e_mail_est_90425"),title:n("un_responsable_88525"),onClick:()=>a(Oe.NotifyLeaders)}),(0,i.jsx)(gE,{isSelected:r===Oe.Code,subtitle:n("cet_e_mail_est_49663"),title:n("code_20843"),onClick:()=>a(Oe.Code)})]})]}),(0,i.jsx)(yr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Na,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(fE,{emailType:r,eventId:e.eventId,formId:null,organizationId:e.organizationId,source:null})})]})]})},GV=()=>{const e=Yn(),{event:{name:t}}=vb();Dd(`${t} ${e("e_mails_09850")}`);const{organizationId:n,eventId:s}=Jn();return(0,i.jsxs)(Na,{css:{padding:"$7"},direction:"column",width:1,children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mod_les_e_mail_91257")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(WV,{eventId:s,organizationId:n})]})};let HV=class extends Ul{constructor(e){super(e)}formParametersAccreditationsInputDefault(e){return{accreditationDisplay:e?.accreditationDisplay||mt.None,accreditationFilter:e?.accreditationFilter||ft.None,hiddenAccreditationsCategoriesIds:e?.hiddenAccreditationsCategoriesIds||[],hiddenAccreditationsIds:e?.hiddenAccreditationsIds||[],hiddenAccreditationsSlotsIds:e?.hiddenAccreditationsSlotsIds||[],displayedAccreditationsCategoriesIds:e?.displayedAccreditationsCategoriesIds||[],displayedAccreditationsIds:e?.displayedAccreditationsIds||[],displayedAccreditationsSlotsIds:e?.displayedAccreditationsSlotsIds||[],showFullAccreditation:e?.showFullAccreditation??!0,showAccreditationDescription:e?.showAccreditationDescription??!1,accreditationTitle:e?.accreditationTitle||"",accreditationSubtitle:e?.accreditationSubtitle||""}}formParametersAccreditationsInputSchema(){return d.Ik().shape({accreditationDisplay:d.Yj().required(this.t("la_strat_gie_d_70458")).oneOf(yn,this.t("la_strat_gie_d_70458")),accreditationFilter:d.Yj().required(this.t("la_strat_gie_de_28051")).oneOf(wn,this.t("la_strat_gie_de_28051")),hiddenAccreditationsIds:d.YO().of(d.ai()),showFullAccreditation:d.zM().required(),showAccreditationDescription:d.zM().required(),accreditationTitle:d.Yj(),accreditationSubtitle:d.Yj()})}updateFormParametersAccreditationsSchema(){return d.Ik().shape({form:this.formParametersAccreditationsInputSchema()})}};HV=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],HV);const qV=e=>{const t=Yn(),{data:n,loader:s}=Zn("query FormParametersAccreditationsHiddenDisplayed($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n index\n\n slots(includeHidden: true) {\n id\n name\n date\n }\n }\n }\n }\n}\n",{eventId:e.eventId},[]);const o=qn(Kc),[r,a]=(0,L.useState)(no(e.values.form.hiddenAccreditationsCategoriesIds)||no(e.values.form.hiddenAccreditationsIds)||no(e.values.form.hiddenAccreditationsSlotsIds)?"hidden":"displayed"),[l,d]=(0,L.useState)(no(e.values.form.hiddenAccreditationsCategoriesIds)?"checked":"unchecked"),[c,u]=(0,L.useState)(no(e.values.form.hiddenAccreditationsIds)?"checked":"unchecked"),[h,m]=(0,L.useState)(no(e.values.form.hiddenAccreditationsSlotsIds)?"checked":"unchecked"),[g,p]=(0,L.useState)(no(e.values.form.displayedAccreditationsCategoriesIds)?"checked":"unchecked"),[f,x]=(0,L.useState)(no(e.values.form.displayedAccreditationsIds)?"checked":"unchecked"),[_,I]=(0,L.useState)(no(e.values.form.displayedAccreditationsSlotsIds)?"checked":"unchecked"),v=(0,L.useMemo)(()=>(0,lc.A)(n.event?.accreditationsCategories??[],e=>e.name.toLowerCase()),[n.event]),b=(0,L.useMemo)(()=>v.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[v]),j=(0,L.useMemo)(()=>v.map(e=>{const t=SC(e.accreditations);return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)}),[n.event]),C=(0,L.useMemo)(()=>v.flatMap(e=>SC(e.accreditations).map(e=>{const t=Ph(e.slots).map(t=>({id:t.id,name:Oh(o,t,e.name,{accreditation:{includeNameAtEnd:!0},date:{localeFormat:Js.DateOnly.MonthLong}})}));return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)})),[v]);return(0,i.jsx)(Na,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:t("pr_f_rences_d_a_19371")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"hidden"===r?"checked":"unchecked",onClick:t=>{"checked"===t&&(a("hidden"),e.change("form.displayedAccreditationsCategoriesIds",[]),e.change("form.displayedAccreditationsIds",[]),e.change("form.displayedAccreditationsSlotsIds",[]))},children:t("cacher_des_cat_43848")}),(0,i.jsx)(qa,{height:"3"}),"hidden"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(gc,{state:l,onClick:t=>{d(t),"unchecked"===t&&e.change("form.hiddenAccreditationsCategoriesIds",[])},children:t("cacher_certaine_12220")}),"checked"===l&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsCategoriesIds",children:b})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{state:c,onClick:t=>{u(t),"unchecked"===t&&e.change("form.hiddenAccreditationsIds",[])},children:t("cacher_certaine_08734")}),"checked"===c&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsIds",children:j})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{state:h,onClick:t=>{m(t),"unchecked"===t&&e.change("form.hiddenAccreditationsSlotsIds",[])},children:t("cacher_certains_02997")}),"checked"===h&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenAccreditationsSlotsIds",children:C})]})]}),(0,i.jsx)(qa,{height:"5"})]}),(0,i.jsx)(xc,{state:"displayed"===r?"checked":"unchecked",onClick:t=>{a("displayed"),"checked"===t&&(e.change("form.hiddenAccreditationsCategoriesIds",[]),e.change("form.hiddenAccreditationsIds",[]),e.change("form.hiddenAccreditationsSlotsIds",[]))},children:t("afficher_des_ca_68243")}),(0,i.jsx)(qa,{height:"3"}),"displayed"===r&&(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(gc,{state:g,onClick:t=>{p(t),"unchecked"===t&&e.change("form.displayedAccreditationsCategoriesIds",[])},children:t("afficher_certai_88457")}),"checked"===g&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsCategoriesIds",children:b})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{state:f,onClick:t=>{x(t),"unchecked"===t&&e.change("form.displayedAccreditationsIds",[])},children:t("afficher_certai_29161")}),"checked"===f&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsIds",children:j})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{state:_,onClick:t=>{I(t),"unchecked"===t&&e.change("form.displayedAccreditationsSlotsIds",[])},children:t("afficher_certai_38724")}),"checked"===_&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedAccreditationsSlotsIds",children:C})]})]})]})})},YV=e=>{const t=Yn(),[n,s]=(0,L.useState)(no(e.values.form.hiddenAccreditationsCategoriesIds)||no(e.values.form.hiddenAccreditationsIds)||no(e.values.form.hiddenAccreditationsSlotsIds)||no(e.values.form.displayedAccreditationsCategoriesIds)||no(e.values.form.displayedAccreditationsIds)||no(e.values.form.displayedAccreditationsSlotsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{value:n,onChange:t=>{s(t),t||(e.change("form.hiddenAccreditationsCategoriesIds",[]),e.change("form.hiddenAccreditationsIds",[]),e.change("form.hiddenAccreditationsSlotsIds",[]),e.change("form.displayedAccreditationsCategoriesIds",[]),e.change("form.displayedAccreditationsIds",[]),e.change("form.displayedAccreditationsSlotsIds",[]))},children:t("afficher_masq_37398")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(qV,{change:e.change,eventId:e.eventId,values:e.values})]})]})},KV=e=>{const t=Yn(),{isNotSavedModalOpen:n,onClose:s,onNotSavedClose:o,onSave:r}=jE(e.initialValues,e.values,e.handleSubmit),a=e.slotDisplay!==xt.Hide;return(0,i.jsx)(WS,{button:(0,i.jsx)(El,{isLoading:e.isMutateLoading,onClick:r,children:t("enregistrer_06519")}),title:e.name,onClose:s,children:(0,i.jsx)(bE,{isNotSavedOpen:n,onNotSavedClose:o,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{font:"gray800 textMd semiBold",children:t("param_tres_des_90955")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("comment_souhait_18471")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(sb,{name:"form.accreditationDisplay",value:mt.Accreditation,children:t("afficher_les_ac_56952")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"form.accreditationDisplay",value:mt.None,children:t("ne_rien_affiche_81467")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("personnalisatio_86385")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Hm,{name:"form.showFullAccreditation",children:t("afficher_les_ac_56062")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(YV,{change:e.change,eventId:e.eventId,values:e.values}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("affichage_des_d_57491")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Nm,{name:"form.showAccreditationDescription",children:t("afficher_la_des_94587")}),a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"7"}),(0,i.jsx)(yr,{font:"gray800 textMd semiBold",children:t("filtrer_les_acc_57840")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("d_cider_si_le_c_31187")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(sb,{name:"form.accreditationFilter",value:ft.FilterWithSlots,children:t("filtrer_les_acc_66152")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"form.accreditationFilter",value:ft.None,children:t("ne_pas_filtrer_97321")})]}),(0,i.jsx)(Ku,{height:"7"}),(0,i.jsx)(yr,{font:"gray800 textMd semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{label:t("nom_de_l_tape_85862"),name:"form.accreditationTitle"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Qv,{label:t("description_58935"),name:"form.accreditationSubtitle"})]})})})},ZV=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=_l(),{data:s,loader:o}=Zn("query FormParametersAccreditations($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n slotDisplay\n accreditationDisplay\n hiddenAccreditationsCategoriesIds\n hiddenAccreditationsIds\n hiddenAccreditationsSlotsIds\n displayedAccreditationsCategoriesIds\n displayedAccreditationsIds\n displayedAccreditationsSlotsIds\n showFullAccreditation\n showAccreditationDescription\n accreditationTitle\n accreditationSubtitle\n accreditationFilter\n }\n }\n}\n",{organizationId:e,formId:n},[]);Dd(s.organization?.form.name??"");const r=qn(Ba),a=qn(HV),{mutate:l,isLoading:d}=function(e={}){return Xn("mutation FormParametersAccreditationsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersAccreditationsInput!\n) {\n formParametersAccreditationsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=L.useMemo(()=>({form:a.formParametersAccreditationsInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:n,values:r})=>(0,i.jsx)(KV,{change:e.change,eventId:t,handleSubmit:n,initialValues:c,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",slotDisplay:s.organization?.form.slotDisplay||xt.Hide,values:r}),validate:r.validateForForm(a.updateFormParametersAccreditationsSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})};class XV extends Ul{constructor(e){super(e)}customSlotInputDefault(){return{name:"",startTime:"",endTime:""}}customSlotInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_cr_ne_97703")),startTime:d.Yj().required(this.t("le_d_but_du_cr_40745")),endTime:d.Yj().required(this.t("la_fin_du_cr_ne_90351"))})}}let JV=class extends Ul{customSlotInputService;constructor(e,t){super(e),this.customSlotInputService=t}customSlotPeriodInputDefault(){return{name:"",customSlots:[this.customSlotInputService.customSlotInputDefault()],hideNameDates:!1,displayAsCalendar:!1,hasCondition:!1,conditionCustomFieldId:null,conditionValue:!1}}};JV=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn,XV])],JV);let QV=class extends Ul{constructor(e){super(e)}formParametersAvailabilitiesInputDefault(e){return{slotDisplay:e?.slotDisplay||xt.Hide,daysDisplay:e?.daysDisplay||gt.AllDays,customSlotsPeriods:(e?.customSlotsPeriods??[]).map(e=>(0,dr.A)(e,["id","conditionCustomField"])),slotTitle:e?.slotTitle||"",slotSubtitle:e?.slotSubtitle||""}}formParametersAvailabilitiesInputSchema(){return d.Ik().shape({slotDisplay:d.Yj().required(this.t("la_strat_gie_d_34961")).oneOf(Sn,this.t("la_strat_gie_d_34961")),daysDisplay:d.Yj().required(this.t("la_strat_gie_de_56435")).oneOf(kn,this.t("la_strat_gie_de_56435"))})}updateFormParametersAvailabilitiesSchema(){return d.Ik().shape({form:this.formParametersAvailabilitiesInputSchema()})}};QV=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],QV);const eU=e=>{const t=Yn(),n=qn(XV);return(0,i.jsx)(Rb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsx)(Ob,{children:(0,i.jsx)(Ua.lV,{initialValues:{customSlotPeriod:e.customSlotPeriod},render:({form:s,handleSubmit:o,submitting:r,values:a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zb,{icon:"sliders-up",subtitle:t("param_trer_les_33935"),children:t("mise_jour_de_14984")}),(0,i.jsxs)(Tb,{css:{overflowY:"auto"},gap:"7",children:[(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(Ll,{hint:t("le_nom_de_la_p_49293"),label:(0,i.jsx)(Uv,{children:t("nom_de_la_p_rio_89140")}),name:"customSlotPeriod.name"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Lm,{label:(0,i.jsx)(Uv,{children:t("date_de_d_but_43380")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.startDate"}),(0,i.jsx)(Lm,{label:(0,i.jsx)(Uv,{children:t("date_de_fin_86920")}),max:e.event.endAt,min:e.event.startAt,name:"customSlotPeriod.endDate"})]}),(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(Hm,{name:"customSlotPeriod.hasCondition",children:t("conditionner_l_33629")}),a.customSlotPeriod.hasCondition&&(0,i.jsx)(Na,{css:{background:"$gray50",bd:!0,padding:"$4"},direction:"column",gap:"4",children:(0,i.jsx)(rE,{conditionCustomFieldId:a.customSlotPeriod.conditionCustomFieldId,conditionCustomFields:e.conditionCustomFields,conditionValue:a.customSlotPeriod.conditionValue,setConditionCustomFieldId:t=>{const n=e.conditionCustomFields.find(e=>e.id===t);n&&(s.change("customSlotPeriod.conditionValue",n.fieldType===Ve.Checkbox||[]),s.change("customSlotPeriod.conditionCustomFieldId",t))},setConditionValue:e=>{s.change("customSlotPeriod.conditionValue",e)}})})]})]}),(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("cr_neaux_person_16330")}),a.customSlotPeriod.customSlots.map((e,n)=>{const o=`customSlotPeriod.customSlots[${n}].`;return(0,i.jsxs)(Na,{align:"end",gap:"4",children:[(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(Ll,{label:t("nom_du_cr_neau_54351"),name:`${o}name`})}),(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(tb,{label:t("SlotStart"),name:`${o}startTime`})}),(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(tb,{label:t("SlotEnd"),name:`${o}endTime`})}),(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",onClick:()=>{s.change("customSlotPeriod.customSlots",ao(a.customSlotPeriod.customSlots,n))}})]},n)}),(0,i.jsx)(El,{color:"invisible",leftIcon:"plus",onClick:()=>{s.change("customSlotPeriod.customSlots",[...a.customSlotPeriod.customSlots,n.customSlotInputDefault()])},children:t("ajouter_un_cr_n_63607")})]}),a.customSlotPeriod.customSlots.length<2&&(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("options_d_affic_10797")}),(0,i.jsx)(Hm,{name:"customSlotPeriod.hideNameDates",children:t("masquer_les_inf_78021")}),(0,i.jsx)(Hm,{name:"customSlotPeriod.displayAsCalendar",children:t("afficher_les_di_90328")})]})]}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{isLoading:r,onClick:o,children:t("mettre_jour_l_81276")})})]}),onSubmit:async t=>{await e.onSuccess(t.customSlotPeriod),e.onClose()}})})})},tU=e=>{const t=Yn(),n=qn(Kc),[s,o]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray900 textSm semiBold",children:m(e.customSlotPeriod.name)?e.customSlotPeriod.name:t("p_riode_de_l_v_78032")}),(0,i.jsxs)(yr,{color:"gray500",children:[e.customSlotPeriod.startDate?n.toLocaleString(e.customSlotPeriod.startDate,Js.DateOnly.WeekdayLongMonthLong):t("d_but_le_l_v_n_58366")," ","-"," ",e.customSlotPeriod.endDate?n.toLocaleString(e.customSlotPeriod.endDate,Js.DateOnly.WeekdayLongMonthLong):t("fin_de_l_v_nem_88380")," ","- ",t("creneau",e.customSlotPeriod.customSlots.length)]})]}),(0,i.jsx)(El,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>o(!0)}),(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",size:"sm",onClick:e.remove})]}),s&&(0,i.jsx)(eU,{conditionCustomFields:e.conditionCustomFields,customSlotPeriod:e.customSlotPeriod,event:e.event,onClose:()=>o(!1),onSuccess:async t=>{e.updateCustomSlotPeriod(t,e.index)}})]})},nU=e=>{const t=Yn();return(0,i.jsxs)(Na,{css:{background:"$gray50",borderRadius:"$1",marginLeft:"$6",padding:"$6"},direction:"column",gap:"3",width:1,children:[e.customSlotsPeriods.map((t,n)=>(0,i.jsx)(tU,{conditionCustomFields:e.conditionCustomFields,customSlotPeriod:t,event:e.event,index:n,remove:()=>{e.remove(n)},updateCustomSlotPeriod:e.updateCustomSlotPeriod},n)),(0,i.jsxs)(Na,{align:"center",css:{color:"$primary700",cursor:"pointer"},gap:"3",onClick:e.add,children:[(0,i.jsx)(el,{icon:"plus"}),(0,i.jsx)(yr,{children:t("ajouter_une_p_r_04249")})]})]})},iU=e=>{const t=Yn(),n=qn(JV),{isNotSavedModalOpen:s,onClose:o,onNotSavedClose:r,onSave:a}=jE(e.initialValues,e.values,e.handleSubmit),l=(0,L.useCallback)(()=>{e.form.change("form.customSlotsPeriods",[...e.values.form.customSlotsPeriods,n.customSlotPeriodInputDefault()])},[e.values.form.customSlotsPeriods,e.form.change]),d=(0,L.useCallback)(t=>{e.form.change("form.customSlotsPeriods",ao(e.values.form.customSlotsPeriods,t))},[e.values.form.customSlotsPeriods,e.form.change]),c=(0,L.useCallback)((t,n)=>{const i=[...e.values.form.customSlotsPeriods];i[n]=t,e.form.change("form.customSlotsPeriods",i)},[e.values.form.customSlotsPeriods,e.form.change]),u=e.values.form.slotDisplay===xt.Custom,h=e.values.form.slotDisplay===xt.DisplayDays||e.values.form.slotDisplay===xt.Calendar||e.values.form.slotDisplay===xt.Custom;return(0,i.jsx)(WS,{button:(0,i.jsx)(El,{isLoading:e.isMutateLoading,onClick:a,children:t("enregistrer_06519")}),title:e.name,onClose:o,children:(0,i.jsx)(bE,{isNotSavedOpen:s,onNotSavedClose:r,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(TE,{heading:t("affichage_des_d_20852"),role:"radiogroup",subtitle:t("personnaliser_l_64536"),children:[(0,i.jsx)(sb,{name:"form.slotDisplay",value:xt.Display,children:t("demander_au_mem_07520")}),(0,i.jsx)(sb,{name:"form.slotDisplay",value:xt.DisplayDays,children:t("demander_au_mem_50067")}),(0,i.jsx)(sb,{name:"form.slotDisplay",value:xt.Calendar,children:t("demander_au_mem_60083")}),(0,i.jsx)(sb,{name:"form.slotDisplay",value:xt.Custom,children:t("demander_au_mem_31132")}),u&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(nU,{add:l,conditionCustomFields:e.conditionCustomFields,customSlotsPeriods:e.values.form.customSlotsPeriods,event:e.event,remove:d,updateCustomSlotPeriod:c})}),(0,i.jsx)(sb,{name:"form.slotDisplay",value:xt.Hide,children:t("ne_pas_demander_46686")})]}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"7"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("filtrer_les_dis_80634")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("d_cider_de_filt_81078")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(sb,{name:"form.daysDisplay",value:gt.AllDays,children:t("afficher_l_ense_11531")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"form.daysDisplay",value:gt.DaysWithSlots,children:t("filtrer_les_jou_51154")})]}),e.values.form.slotDisplay!==xt.Hide&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"7"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{label:t("nom_de_l_tape_85862"),name:"form.slotTitle"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Qv,{label:t("description_58935"),name:"form.slotSubtitle"})]})]})})})},sU=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=_l(),{data:s,loader:o}=Zn("query FormParametersAvailabilities(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $formId: FormId!\n) {\n organization(id: $organizationId) {\n ...FormCustomFields\n\n form(id: $formId) {\n name\n ...FormSlotsOptions\n\n customSlotsPeriods {\n ...FormRegisterCustomSlotPeriod\n }\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n }\n}\n",{organizationId:e,eventId:t,formId:n},[Ls.FormCustomFieldsFragment,Ls.FormSlotsOptionsFragment,Ls.FormRegisterCustomSlotPeriodFragment]);Dd(s.organization?.form.name??"");const r=qn(Ba),a=qn(QV),{mutate:l,isLoading:d}=function(e={}){return Xn("mutation FormParametersAvailabilitiesUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersAvailabilitiesInput!\n) {\n formParametersAvailabilitiesUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=(0,L.useMemo)(()=>(s.organization?.formCustomFields.nodes??[]).filter(e=>[Ve.Checkbox,Ve.Country,Ve.Language,Ve.Nationality,Ve.Select].includes(e.fieldType)),[s.organization]),u=(0,L.useMemo)(()=>({form:a.formParametersAvailabilitiesInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:u,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(iU,{conditionCustomFields:c,event:s.event,form:e,handleSubmit:t,initialValues:u,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",values:n}),validate:r.validateForForm(a.updateFormParametersAvailabilitiesSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})};let oU=class extends Ul{constructor(e){super(e)}formParametersMissionsInputDefault(e){return{positionDisplay:e?.positionDisplay||pt.None,positionFilter:e?.positionFilter||ft.FilterWithSlots,positionRanking:e?.positionRanking||He.Unranked,positionLimit:e?.positionLimit||3,hiddenPositionsCategoriesIds:e?.hiddenPositionsCategoriesIds||[],hiddenPositionsIds:e?.hiddenPositionsIds||[],hiddenPositionsSlotsIds:e?.hiddenPositionsSlotsIds||[],hiddenPositionsTagsIds:e?.hiddenPositionsTagsIds||[],displayedPositionsCategoriesIds:e?.displayedPositionsCategoriesIds||[],displayedPositionsIds:e?.displayedPositionsIds||[],displayedPositionsSlotsIds:e?.displayedPositionsSlotsIds||[],displayedPositionsTagsIds:e?.displayedPositionsTagsIds||[],showFullPosition:e?.showFullPosition??!0,showPositionCategoryDescription:e?.showPositionCategoryDescription??!1,showPositionDescription:e?.showPositionDescription??!1,positionTitle:e?.positionTitle||"",positionSubtitle:e?.positionSubtitle||"",willAutoAssign:e?.willAutoAssign??!1}}formParametersMissionsInputSchema(){return d.Ik().shape({positionDisplay:d.Yj().required(this.t("la_strat_gie_d_44170")).oneOf(An,this.t("la_strat_gie_d_44170")),positionFilter:d.Yj().required(this.t("la_strat_gie_de_13294")).oneOf(wn,this.t("la_strat_gie_de_13294")),positionRanking:d.Yj().required(this.t("le_type_de_clas_66819")).oneOf(mn,this.t("le_type_de_clas_66819")),positionLimit:d.ai().required(this.t("le_nombre_maxim_38249")).min(1,this.t("le_nombre_de_ch_27910")),hiddenPositionsCategoriesIds:d.YO().of(d.ai()),hiddenPositionsIds:d.YO().of(d.ai()),hiddenPositionsSlotsIds:d.YO().of(d.ai()),hiddenPositionsTagsIds:d.YO().of(d.ai()),displayedPositionsCategoriesIds:d.YO().of(d.ai()),displayedPositionsIds:d.YO().of(d.ai()),displayedPositionsSlotsIds:d.YO().of(d.ai()),displayedPositionsTagsIds:d.YO().of(d.ai()),showFullPosition:d.zM().required(),showPositionCategoryDescription:d.zM().required(),showPositionDescription:d.zM().required(),positionTitle:d.Yj(),positionSubtitle:d.Yj(),willAutoAssign:d.zM().required()})}updateFormParametersMissionsSchema(){return d.Ik().shape({form:this.formParametersMissionsInputSchema()})}};oU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],oU);const rU=e=>(0,i.jsxs)(Na,{css:{cursor:"pointer",position:"relative"},direction:"column",gap:"1",onClick:e.onSelect,children:[e.isSelected&&(0,i.jsx)(Na,{align:"center",css:{background:"$primary700",borderRadius:"20px",color:"white",fontSize:"$textMd",position:"absolute",right:"-10px",top:"-10px"},height:20,justify:"center",width:20,children:(0,i.jsx)(el,{icon:"check"})}),(0,i.jsx)(yr,{css:{background:"$gray100",border:e.isSelected?"2px solid $primary700":"2px solid $gray100",borderRadius:"$1",padding:"$6",paddingBottom:"0"},height:135,width:240,children:(0,i.jsx)("img",{height:"107px",src:e.src,width:"188px"})}),(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:e.name})]}),aU=e=>{const t=Yn(),{data:n,loader:s}=Zn("query FormParametersMissionsHiddenDisplayed($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n tags(context: Positions) {\n nodes {\n id\n name\n }\n }\n }\n\n event(id: $eventId) {\n positionsCategories {\n id\n name\n\n positions {\n id\n name\n\n slots {\n id\n name\n range\n }\n }\n }\n }\n}\n",{organizationId:e.organizationId,eventId:e.eventId},[]);const o=qn(hh),[r,a]=(0,L.useState)(no(e.values.form.hiddenPositionsCategoriesIds)||no(e.values.form.hiddenPositionsIds)||no(e.values.form.hiddenPositionsSlotsIds)||no(e.values.form.hiddenPositionsTagsIds)?"hidden":"displayed"),[l,d]=(0,L.useState)(no(e.values.form.hiddenPositionsCategoriesIds)?"checked":"unchecked"),[c,h]=(0,L.useState)(no(e.values.form.hiddenPositionsIds)?"checked":"unchecked"),[g,p]=(0,L.useState)(no(e.values.form.hiddenPositionsSlotsIds)?"checked":"unchecked"),[f,x]=(0,L.useState)(no(e.values.form.hiddenPositionsTagsIds)?"checked":"unchecked"),[_,I]=(0,L.useState)(no(e.values.form.displayedPositionsCategoriesIds)?"checked":"unchecked"),[v,b]=(0,L.useState)(no(e.values.form.displayedPositionsIds)?"checked":"unchecked"),[j,C]=(0,L.useState)(no(e.values.form.displayedPositionsSlotsIds)?"checked":"unchecked"),[y,k]=(0,L.useState)(no(e.values.form.displayedPositionsTagsIds)?"checked":"unchecked"),A=(0,L.useMemo)(()=>(0,lc.A)(n.event?.positionsCategories??[],e=>u(e.name)),[n.event]),w=(0,L.useMemo)(()=>A.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.positions.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[A]),S=(0,L.useMemo)(()=>(0,lc.A)(A.flatMap(e=>e.positions),e=>u(e.name)).map(e=>{const t=(0,lc.A)(e.slots.map(t=>{const n=m(t.name)?`${t.name} - `:"",i=o.toDisplayString(t.range,{formats:{displayWeekday:!0}});return{id:t.id,name:`${n}${i} - ${e.name}`,startTime:t.range.start.toMillis()}}),e=>e.startTime);return(0,i.jsx)("optgroup",{label:e.name,children:t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)}),[A]),E=(0,L.useMemo)(()=>(0,lc.A)(n.organization?.tags.nodes??[],e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[n.organization]);return(0,i.jsx)(Na,{css:{background:"$gray50",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:t("pr_f_rences_d_a_19371")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:"hidden"===r?"checked":"unchecked",onClick:t=>{"checked"===t&&(a("hidden"),e.change("form.displayedPositionsCategoriesIds",[]),e.change("form.displayedPositionsIds",[]),e.change("form.displayedPositionsSlotsIds",[]),e.change("form.displayedPositionsTagsIds",[]))},children:t("cacher_des_cat_31908")}),(0,i.jsx)(qa,{height:"3"}),"hidden"===r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(gc,{state:l,onClick:t=>{d(t),"unchecked"===t&&e.change("form.hiddenPositionsCategoriesIds",[])},children:t("cacher_certaine_12220")}),"checked"===l&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsCategoriesIds",children:A.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{state:c,onClick:t=>{h(t),"unchecked"===t&&e.change("form.hiddenPositionsIds",[])},children:t("cacher_certaine_19933")}),"checked"===c&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsIds",children:w})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{state:g,onClick:t=>{p(t),"unchecked"===t&&e.change("form.hiddenPositionsSlotsIds",[])},children:t("cacher_certains_02997")}),"checked"===g&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsSlotsIds",children:S})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{state:f,onClick:t=>{x(t),"unchecked"===t&&e.change("form.hiddenPositionsTagsIds",[])},children:t("cacher_certains_66424")}),"checked"===f&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.hiddenPositionsTagsIds",children:E})]})]}),(0,i.jsx)(qa,{height:"5"})]}),(0,i.jsx)(xc,{state:"displayed"===r?"checked":"unchecked",onClick:t=>{a("displayed"),"checked"===t&&(e.change("form.hiddenPositionsCategoriesIds",[]),e.change("form.hiddenPositionsIds",[]),e.change("form.hiddenPositionsSlotsIds",[]),e.change("form.hiddenPositionsTagsIds",[]))},children:t("afficher_des_ca_37473")}),(0,i.jsx)(qa,{height:"3"}),"displayed"===r&&(0,i.jsxs)(Na,{css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",boxShadow:"$xs",padding:"$4 $6"},direction:"column",children:[(0,i.jsx)(gc,{state:_,onClick:t=>{I(t),"unchecked"===t&&e.change("form.displayedPositionsCategoriesIds",[])},children:t("afficher_certai_88457")}),"checked"===_&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsCategoriesIds",children:A.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{state:v,onClick:t=>{b(t),"unchecked"===t&&e.change("form.displayedPositionsIds",[])},children:t("affficher_certa_32341")}),"checked"===v&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsIds",children:w})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{state:j,onClick:t=>{C(t),"unchecked"===t&&e.change("form.displayedPositionsSlotsIds",[])},children:t("afficher_certai_38724")}),"checked"===j&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsSlotsIds",children:S})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(gc,{state:y,onClick:t=>{k(t),"unchecked"===t&&e.change("form.displayedPositionsTagsIds",[])},children:t("afficher_certai_47793")}),"checked"===y&&(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},direction:"column",children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Um,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,name:"form.displayedPositionsTagsIds",children:E})]})]})]})})},lU=e=>{const t=Yn(),[n,s]=(0,L.useState)(no(e.values.form.hiddenPositionsCategoriesIds)||no(e.values.form.hiddenPositionsIds)||no(e.values.form.hiddenPositionsSlotsIds)||no(e.values.form.hiddenPositionsTagsIds)||no(e.values.form.displayedPositionsCategoriesIds)||no(e.values.form.displayedPositionsIds)||no(e.values.form.displayedPositionsSlotsIds)||no(e.values.form.displayedPositionsTagsIds));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ju,{value:n,onChange:t=>{s(t),t||(e.change("form.hiddenPositionsCategoriesIds",[]),e.change("form.hiddenPositionsIds",[]),e.change("form.hiddenPositionsSlotsIds",[]),e.change("form.hiddenPositionsTagsIds",[]),e.change("form.displayedPositionsCategoriesIds",[]),e.change("form.displayedPositionsIds",[]),e.change("form.displayedPositionsSlotsIds",[]),e.change("form.displayedPositionsTagsIds",[]))},children:t("afficher_masq_74825")}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(aU,{change:e.change,eventId:e.eventId,organizationId:e.organizationId,values:e.values})]})]})},dU=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{isNotSavedModalOpen:o,onClose:r,onNotSavedClose:a,onSave:l}=jE(e.initialValues,e.values,e.handleSubmit),d=e.slotDisplay!==xt.Hide&&e.values.form.positionDisplay!==pt.None;return(0,i.jsx)(WS,{button:(0,i.jsx)(El,{isLoading:e.isMutateLoading,onClick:l,children:t("enregistrer_06519")}),title:e.name,onClose:r,children:(0,i.jsx)(bE,{isNotSavedOpen:o,onNotSavedClose:a,children:e.loader||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("param_tres_des_93365")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("d_cider_du_type_01830")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{gap:"8",children:[(0,i.jsx)(rU,{isSelected:e.values.form.positionRanking===He.Unranked,name:t("choix_illimit_s_72460"),src:gd.FormPositionUnranked,onSelect:()=>{e.change("form.positionRanking",He.Unranked)}}),(0,i.jsx)(rU,{isSelected:e.values.form.positionRanking===He.Ranked,name:t("classement_des_43897"),src:gd.FormPositionRanked,onSelect:()=>{e.change("form.positionRanking",He.Ranked),e.values.form.positionDisplay!==pt.None&&e.values.form.positionDisplay!==pt.Slot||e.change("form.positionDisplay",pt.Position)}})]}),e.values.form.positionRanking===He.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Ll,{label:t("nombre_de_choix_19811"),name:"form.positionLimit",shouldParseAsInt:!0})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("affichage_des_m_65982")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("personnaliser_l_26207")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("comment_souhait_23788")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(sb,{name:"form.positionDisplay",value:pt.Category,children:t("afficher_les_ca_26287")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"form.positionDisplay",value:pt.Position,children:t("afficher_les_mi_31841")}),e.values.form.positionRanking===He.Unranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"form.positionDisplay",value:pt.Slot,children:t("afficher_les_cr_32311")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"form.positionDisplay",value:pt.None,children:t("ne_rien_affiche_81467")})]}),e.values.form.positionDisplay!==pt.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("personnalisatio_94071")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Hm,{name:"form.showFullPosition",children:t("afficher_les_mi_35510")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(lU,{change:e.change,eventId:s,organizationId:n,values:e.values}),e.values.form.positionRanking!==He.Ranked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:t("affichage_des_d_57491")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Nm,{name:"form.showPositionCategoryDescription",children:t("afficher_la_des_67852")}),e.values.form.positionDisplay!==pt.Category&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Nm,{name:"form.showPositionDescription",children:t("afficher_la_des_21998")})]})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("automatisation_49411")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("d_cider_si_l_af_60345")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Hm,{name:"form.willAutoAssign",children:e.values.form.positionDisplay===pt.Category?t("la_pr_affectat_61978"):e.values.form.positionDisplay===pt.Position?t("la_pr_affectat_20431"):t("l_affectation_s_68435")})]}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("filtrer_les_cat_63783")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("d_cider_si_le_c_98644")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(sb,{name:"form.positionFilter",value:ft.FilterWithSlots,children:t("filtrer_les_cat_52780")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(sb,{name:"form.positionFilter",value:ft.None,children:t("ne_pas_filtrer_73952")})]}),e.values.form.positionDisplay!==pt.None&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textMd",fontWeight:"semiBold",children:t("personnalisatio_15893")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",children:t("personnaliser_l_44808")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{label:t("nom_de_l_tape_85862"),name:"form.positionTitle"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Qv,{label:t("description_58935"),name:"form.positionSubtitle"})]})]})})})},cU=()=>{const{params:{organizationId:e,eventId:t,formId:n}}=_l(),{data:s,loader:o}=Zn("query FormParametersMissions($organizationId: OrganizationId!, $formId: FormId!) {\n organization(id: $organizationId) {\n form(id: $formId) {\n name\n slotDisplay\n positionDisplay\n positionFilter\n positionRanking\n positionLimit\n hiddenPositionsCategoriesIds\n hiddenPositionsIds\n hiddenPositionsSlotsIds\n hiddenPositionsTagsIds\n displayedPositionsCategoriesIds\n displayedPositionsIds\n displayedPositionsSlotsIds\n displayedPositionsTagsIds\n showFullPosition\n showPositionCategoryDescription\n showPositionDescription\n positionTitle\n positionSubtitle\n willAutoAssign\n }\n }\n}\n",{organizationId:e,formId:n},[]);Dd(s.organization?.form.name??"");const r=qn(Ba),a=qn(oU),{mutate:l,isLoading:d}=function(e={}){return Xn("mutation FormParametersMissionsUpdate(\n $organizationId: OrganizationId!\n $eventId: EventId\n $formId: FormId!\n $form: FormParametersMissionsInput!\n) {\n formParametersMissionsUpdate(\n organizationId: $organizationId\n eventId: $eventId\n formId: $formId\n form: $form\n ) {\n id\n }\n}\n",e)}(),c=L.useMemo(()=>({form:a.formParametersMissionsInputDefault(s.organization?.form)}),[s.organization]);return(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:c,render:({form:e,handleSubmit:t,values:n})=>(0,i.jsx)(dU,{change:e.change,handleSubmit:t,initialValues:c,isMutateLoading:d,loader:o,name:s.organization?.form.name??"",slotDisplay:s.organization?.form.slotDisplay??xt.Hide,values:n}),validate:r.validateForForm(a.updateFormParametersMissionsSchema()),width:1,onSubmit:i=>l({organizationId:e,eventId:t,formId:n,form:i.form})})},uU=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{hasFeature:o}=yI(),{user:r}=si(),a=t=>cg({organizationId:n,eventId:s,lang:r?.language,pathComponent:t,key:e.eventKey});return(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",children:t("liste_des_api_d_94349")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(dD,{hint:t("param_tres_disp_37413"),link:a("assignments"),title:t("api_pour_les_af_45788")}),(0,i.jsx)(qa,{height:"6"}),o(Ne.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dD,{hint:t("param_tres_disp_76489"),link:a("accreditations"),title:t("api_pour_les_ac_97802")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(dD,{hint:t("param_tres_disp_49170"),link:a("accreditations-matrix"),title:t("api_pour_les_ac_69006")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(dD,{hint:t("param_tres_disp_45950"),link:a("accreditations-slots"),title:t("api_pour_les_cr_99061")}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(dD,{hint:t("param_tres_disp_45950"),link:a("positions"),title:t("api_pour_la_lis_89027")}),(0,i.jsx)(qa,{height:"6"}),o(Ne.Delegation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dD,{hint:t("param_tres_disp_83198"),link:a("delegations-matrix"),title:t("api_pour_les_d_32713")}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(dD,{link:`=IMPORTDATA("${a("assignments")}")`,title:t("import_des_affe_58949")}),(0,i.jsx)(qa,{height:"6"}),o(Ne.Accreditation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dD,{link:`=IMPORTDATA("${a("accreditations")}")`,title:t("import_des_accr_52173")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(dD,{link:`=IMPORTDATA("${a("accreditations-matrix")}")`,title:t("import_des_accr_49559")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(dD,{link:`=IMPORTDATA("${a("accreditations-slots")}")`,title:t("import_des_cr_n_78532")}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(dD,{link:`=IMPORTDATA("${a("positions")}")`,title:t("import_de_la_li_00747")}),(0,i.jsx)(qa,{height:"6"}),o(Ne.Delegation)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(dD,{link:`=IMPORTDATA("${a("delegations-matrix")}")`,title:t("api_pour_les_d_32713")}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(qa,{height:"1"})]})},hU=()=>{const{translate:e,params:{eventId:t}}=_l(),{event:{name:n}}=vb();Dd(`${n} API`);const{hasFeature:s}=yI(),{data:o,loader:r}=Zn("query EventKey($eventId: EventId!) {\n event(id: $eventId) {\n key\n }\n}\n",{eventId:t},[]);return r||(0,i.jsxs)(nj,{children:[(0,i.jsx)(tj,{children:(0,i.jsx)(yr,{font:"gray900 displayXs medium",children:"API"})}),(0,i.jsxs)(ej,{children:[(0,i.jsx)(sl,{leftIcon:"circle-exclamation",children:e("l_api_permet_de_66672",vd)}),(0,i.jsx)(qa,{height:"7"}),s(Ne.Api)?(0,i.jsx)(uU,{eventKey:o.event.key}):(0,i.jsx)(Na,{align:"center",css:{flex:"1"},height:1,justify:"center",width:1,children:(0,i.jsx)(kI,{icon:"code-branch"})})]})]})},mU=[Le.Eid,Le.FirstName,Le.LastName,Le.Picture,Le.Population],gU=()=>{const{translate:e,params:{organizationId:t,eventId:n}}=_l(),{event:s}=vb();Dd(`${s.name} Weezevent`);const{data:o}=Zn("query WeezeventV2Infos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(privacy: All, variety: UserInfo) {\n nodes {\n slug\n name\n }\n }\n\n weezaccessEvents {\n id\n name\n }\n }\n\n event(id: $eventId) {\n weezevent\n\n accreditationsCategories {\n id\n name\n\n accreditations {\n id\n name\n }\n }\n\n segmentsFolders(segmentType: Volunteers) {\n id\n name\n\n segments {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,eventId:n},[]),{mutate:r}=function(e={}){return Xn("mutation EventWeezeventUpdate($eventId: EventId!, $weezevent: EventWeezeventInput!) {\n eventWeezeventUpdate(eventId: $eventId, weezevent: $weezevent) {\n id\n }\n}\n",e)}(),a=(0,L.useMemo)(()=>(0,lc.A)(o.organization?.customFields.nodes??[],e=>u(e.name)).filter(e=>!mU.includes(e.slug)).map(e=>(0,i.jsx)("option",{value:e.slug,children:e.name},e.slug)),[o]),l=(0,L.useMemo)(()=>(o.event?.segmentsFolders??[]).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o]),d=(0,L.useMemo)(()=>(0,lc.A)(o.event?.accreditationsCategories??[],e=>u(e.name)).map(e=>(0,i.jsx)("optgroup",{label:e.name,children:(0,lc.A)(e.accreditations,e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id)),[o]),c=(0,L.useMemo)(()=>(0,lc.A)(o.organization?.weezaccessEvents??[],e=>u(e.name)).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[o]);return(0,i.jsxs)(nj,{children:[(0,i.jsx)(tj,{children:(0,i.jsx)(yr,{font:"gray900 displayXs medium",children:"Weezevent"})}),(0,i.jsx)(ej,{children:(0,i.jsx)(Cl,{initialValues:{accreditationsIds:o.event?.weezevent?.accreditationsIds||[],customFieldsSlugs:o.event?.weezevent?.customFieldsSlugs||[],segmentsIds:o.event?.weezevent?.segmentsIds||[],weezaccessEventId:o.event?.weezevent?.weezaccessEventId??null},render:({handleSubmit:t,submitting:n})=>(0,i.jsxs)(Na,{direction:"column",gap:"6",width:1,children:[(0,i.jsx)(Um,{isSearchVisible:!0,label:e("liste_des_champ_73852"),multiple:!0,name:"customFieldsSlugs",children:a}),(0,i.jsx)(Um,{isSearchVisible:!0,label:e("liste_des_vues_82829"),multiple:!0,name:"segmentsIds",children:l}),(0,i.jsx)(Um,{hint:e("toutes_les_accr_55233"),isSearchVisible:!0,label:e("liste_des_accr_50214"),multiple:!0,name:"accreditationsIds",children:d}),(0,i.jsx)(Um,{isSearchVisible:!0,label:e("id_de_l_v_neme_87336"),name:"weezaccessEventId",children:c}),(0,i.jsx)(Bb,{rolesTypes:fI,children:(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:n,onClick:t,children:e("enregistrer_06519")})})})]}),onSubmit:e=>r({eventId:n,weezevent:e})})})]})};let pU=class{positionsCustomFieldInputSchema(){return d.Ik().shape({customFieldId:d.ai().required(),conditionValue:d.gl().required()})}};pU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)()],pU);let fU=class extends Ul{constructor(e){super(e)}positionsSlotInputDefault(e,t){return{id:t?.id,name:t?.name??"",startDate:t?.startDate??e,startTime:t?.startTime??e.toFormat("HH:mm"),endDate:t?.endDate??e,endTime:t?.endTime??e.plus({hour:1}).toFormat("HH:mm"),resources:t?.resources??1,assignedResources:t?.assignedResources}}createPositionSlotSchema(){return d.Ik().shape({slot:this.positionsSlotInputSchema()})}positionsSlotInputSchema(){return d.Ik().shape({name:d.Yj(),startDate:qm.required(this.t("la_date_de_d_bu_05030")).typeError(this.t("la_date_de_d_bu_05030")),startTime:d.Yj().required(this.t("heure_de_d_but_90785")),endDate:qm.required(this.t("la_date_de_fin_32246")).typeError(this.t("la_date_de_fin_32246")).test("after-start-date",this.t("la_date_de_fin_00429"),(e,t)=>Us.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid&&Us.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid&&t.parent.endDate>=t.parent.startDate),endTime:d.Yj().required(this.t("l_heure_de_fin_78626")).test("after-start-time",this.t("la_date_de_fin_00429"),(e,t)=>{const n=Us.c9.isDateTime(t.parent.startDate)&&t.parent.startDate.isValid,i=_h(t.parent.startTime),s=Us.c9.isDateTime(t.parent.endDate)&&t.parent.endDate.isValid,o=_h(t.parent.endTime);if(n&&i&&s&&o){const[e,n]=Ih(t.parent.startTime),[i,s]=Ih(t.parent.endTime);return t.parent.startDate.set({hours:e,minutes:n})=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],fU);let xU=class extends Ul{positionsCustomFieldInputService;positionsSlotInputService;constructor(e,t,n){super(n),this.positionsCustomFieldInputService=e,this.positionsSlotInputService=t}positionInputDefault(e,{positionCategoryId:t,layer:n,latitude:i,longitude:s,startAt:o}){let r=e?.category.id??t;return Number.isInteger(r)||(r=null),{name:e?.name??"",positionCategoryId:r,description:e?.description??"",acronym:e?.acronym??"",color:e?.color??fr.colors.primary700.value,icon:e?.icon??Ke.LocationDot,privateNote:e?.privateNote??"",address:e?.address??null,latitude:e?.latitude??i??null,longitude:e?.longitude??s??null,zoom:e?.zoom??Or,layer:e?.layer??n,tracesIds:e?.tracesIds??[],slots:e?.slots??[this.positionsSlotInputService.positionsSlotInputDefault(o)],conditionsOperator:e?.conditionsOperator??pe.And,positionsCustomFields:e?.positionsCustomFields??[],tagsIds:e?.tagsIds??[],fields:e?.fields??{},leadersIds:e?.fields??[]}}createUpdatePositionSchema(){return d.Ik().shape({position:this.positionInputSchema()})}positionInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_de_la_mi_74207")),positionCategoryId:d.ai().required(this.t("la_cat_gorie_es_14008")).typeError(this.t("la_cat_gorie_es_14008")).min(1,this.t("la_cat_gorie_es_14008")),acronym:d.Yj(),color:d.Yj().required(this.t("la_couleur_est_95740")),icon:d.Yj().required(this.t("l_ic_ne_est_req_15843")).oneOf(pn,this.t("l_ic_ne_est_req_15843")),description:d.Yj(),privateNote:d.Yj(),address:d.Yj().nullable(),latitude:d.ai().nullable().typeError(this.t("la_latitude_doi_43118")),longitude:d.ai().nullable().typeError(this.t("la_longitude_do_35170")),traces:d.YO().of(d.ai()),slots:d.YO().of(this.positionsSlotInputService.positionsSlotInputSchema()).required(this.t("vous_devez_avoi_26563")).min(1,this.t("vous_devez_avoi_26563")),positionsCustomFields:d.YO().of(this.positionsCustomFieldInputService.positionsCustomFieldInputSchema()),tagsIds:d.YO().of(d.ai())})}};xU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[pU,fU,Wn])],xU);const _U=e=>{const{mutate:t}=function(e={}){return Xn("mutation PositionCategoryCreate($eventId: EventId!, $positionCategory: PositionsCategoryInput!) {\n positionCategoryCreate(eventId: $eventId, positionCategory: $positionCategory) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(KC,{initialName:"",isEdit:!1,mutate:async n=>{const{positionCategoryCreate:i}=await t({eventId:e.eventId,positionCategory:{name:n}});return i},onClose:e.onClose,onSuccess:e.onSuccess})},IU=e=>{const{mutate:t}=function(e={}){return Xn("mutation PositionCategoryUpdate(\n $eventId: EventId!\n $positionCategoryId: PositionsCategoryId!\n $positionCategory: PositionsCategoryInput!\n) {\n positionCategoryUpdate(\n eventId: $eventId\n positionCategoryId: $positionCategoryId\n positionCategory: $positionCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(KC,{initialName:e.positionCategoryName,isEdit:!0,mutate:async n=>{const{positionCategoryUpdate:i}=await t({eventId:e.eventId,positionCategoryId:e.positionCategoryId,positionCategory:{name:n}});return i},onClose:e.onClose,onSuccess:e.onSuccess})},vU=(0,L.memo)(function(e){const{params:{eventId:t},translate:n}=_l(),[s,o]=(0,L.useState)(YC(e.event.positionsCategories)),{isEventAdmin:r}=vb(),[a,l]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ll,{label:n("nom_de_la_missi_64605"),name:"position.name"}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Um,{createText:n("cr_er_une_nouve_72722"),isCreateVisible:r,isSearchVisible:!0,label:n("cat_gorie_00291"),name:"position.positionCategoryId",placeholder:n("rechercher_ou_c_16469"),onCreateClick:()=>{l(!0)},children:s.map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Ll,{label:(0,i.jsx)(Uv,{children:n("Acronym")}),name:"position.acronym"})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Lj,{label:n("Color"),name:"position.color"}),(0,i.jsx)(Gj,{label:n("ic_ne_55554"),name:"position.icon"})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Qv,{label:(0,i.jsx)(Uv,{children:n("description_58935")}),name:"position.description"}),a&&(0,i.jsx)(_U,{eventId:t,onClose:()=>{l(!1)},onSuccess:t=>{o(YC([...s,t])),e.change("position.positionCategoryId",t.id)}})]})}),bU=()=>{const e=Yn();return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(Qv,{label:(0,i.jsx)(Uv,{children:e("note_priv_e_06303")}),name:"position.privateNote"})})},jU=e=>{const t=Yn(),n=qn(fU);return(0,i.jsx)(Jj,{buttonText:t("mettre_jour_l_76289"),icon:"sliders",initialValues:{slot:e.slot},schema:n.createPositionSlotSchema(),size:"md",subtitle:t("param_trer_les_00874"),title:t("mise_jour_d_u_86656"),onClose:e.onClose,onSubmit:async t=>{await e.onSuccess((0,wr.A)(t.slot,["id","name","startDate","startTime","endDate","endTime","resources"])),e.onClose()},children:({form:n,values:s})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Fr.Yr,{name:"slot.startDate",children:e=>{e>s.slot.endDate&&n.change("slot.endDate",e)}}),(0,i.jsxs)(Na,{css:{flex:"1",overflowY:"auto"},direction:"column",width:1,children:[(0,i.jsx)(Ll,{hint:t("vous_pouvez_per_94218"),label:(0,i.jsx)(Uv,{children:t("nom_du_cr_neau_54351")}),name:"slot.name"}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Lm,{label:t("date_de_d_but_43380"),max:e.event.endAt,min:e.event.startAt,name:"slot.startDate"}),(0,i.jsx)(tb,{label:t("horaire_de_d_bu_02380"),name:"slot.startTime"})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Lm,{label:t("date_de_fin_86920"),max:e.event.endAt,min:e.event.startAt,name:"slot.endDate"}),(0,i.jsx)(tb,{label:t("horaire_de_fin_10624"),name:"slot.endTime"})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Ll,{label:t("nombre_de_membr_08851"),name:"slot.resources",shouldParseAsInt:!0})]})]})})},CU=e=>{const t=Yn(),n=qn(Kc),s=(0,L.useMemo)(()=>m(e.slot.name)?e.slot.name:t("cr_neau_n_1_80362",e.index+1),[e.slot.name,e.index]),o=(0,L.useMemo)(()=>{const i=n.toLocaleString(e.slot.startDate,Js.DateOnly.WeekdayLongMonthLong),s=n.toLocaleString(e.slot.endDate,Js.DateOnly.WeekdayLongMonthLong);return`${i} ${e.slot.startTime.substring(0,5)} - ${s} ${e.slot.endTime.substring(0,5)} - ${t("_1_membre_49737",e.slot.resources)}`},[e.slot.startDate,e.slot.startTime,e.slot.endDate,e.slot.endTime,e.slot.resources]),[r,a]=(0,L.useState)(e.initialIsEditOpen),[l,d]=(0,L.useState)(!1),c=(e.slot.assignedResources??0)>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$3 $4"},gap:"2",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textSm semiBold",children:s}),(0,i.jsx)(yr,{color:"gray500",children:o})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"pen",size:"sm",onClick:()=>{a(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"arrows-repeat",size:"sm",onClick:()=>{d(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("r_p_ter_le_cr_n_68038")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",disabled:c,leftIcon:"trash-can",size:"sm",onClick:()=>{e.remove(e.index)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t(c?"des_membres_son_92320":"supprimer_43083")})]})]}),r&&(0,i.jsx)(jU,{event:e.event,slot:e.slot,onClose:()=>{a(!1)},onSuccess:async t=>{e.updateSlots(t,e.index)}}),l&&(0,i.jsx)(GP,{showHours:!0,onClose:()=>{d(!1)},onSubmit:(t,n)=>{e.onRepeat(e.slot,t,n)}})]})},yU=e=>{const t=qn(fU),[n,s]=(0,L.useState)(-1),o=(0,L.useCallback)((t,n)=>{const i=[...e.values.position.slots];i[n]=t,e.change("position.slots",i)},[e.values.position.slots,e.change]),r=(0,L.useCallback)((e,t,n)=>Ys(e).overlaps(n),[]),a=(0,L.useCallback)(()=>{e.change("position.slots",e.values.position.slots.concat([t.positionsSlotInputDefault(e.event.startAt)])),s(e.values.position.slots.length)},[e.values.position.slots,e.change]),l=(0,L.useCallback)((t,n,i)=>{const s=function(e,t,n){const i=Ih(e.startTime);let s=e.startDate;i&&(s=s.set({hour:i[0],minute:i[1]}));const o=Ih(e.endTime);let r=e.endDate;return o&&(r=r.set({hour:o[0],minute:o[1]})),(0,Oc.A)(1,t+1).map(t=>{if("hour"===n){const n=s.plus({hour:t}),i=r.plus({hour:t});return{name:e.name,startDate:n,startTime:n.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}if("day"===n){const n=s.plus({day:t}),i=r.plus({day:t});return{name:e.name,startDate:n,startTime:n.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}if("week"===n){const n=s.plus({week:t}),i=r.plus({week:t});return{name:e.name,startDate:n,startTime:n.toFormat("HH:mm"),endDate:i,endTime:i.toFormat("HH:mm"),resources:e.resources}}throw new Error("Wrong unit")})}(t,n,i);e.change("position.slots",e.values.position.slots.concat(s))},[e.values.position.slots,e.change]),d=(0,L.useCallback)(t=>{e.change("position.slots",ao(e.values.position.slots,t))},[e.values.position.slots,e.change]);return(0,i.jsx)(WP,{event:e.event,matchDateFilter:r,renderSlot:t=>(0,i.jsx)(CU,{event:e.event,index:t.index,initialIsEditOpen:t.index===n,remove:d,slot:t,updateSlots:o,onRepeat:l},t.index),slots:e.values.position.slots,onNewSlot:a})},kU=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),{showNotification:r}=kb(),a=qn(xU),l=qn(Ba),d=(0,L.useRef)(null),c=(0,L.useMemo)(()=>e.isEdit?n("mise_jour_de_17055",e.initialValues.position.name):n("cr_ation_d_une_10675"),[e.isEdit,e.initialValues]);Dd(c);const u=(0,L.useMemo)(()=>no(e.initialValues.position.tracesIds)||m(e.initialValues.position.address)||"number"==typeof e.initialValues.position.latitude||"number"==typeof e.initialValues.position.longitude,[e.isEdit,e.initialValues]),h=(0,L.useMemo)(()=>!!e.isEdit&&no(e.initialValues.position.positionsCustomFields),[e.isEdit,e.initialValues]),g=(0,L.useMemo)(()=>!!e.isEdit&&no(Object.keys(e.initialValues.position.fields)),[e.isEdit,e.initialValues]),p=(0,L.useMemo)(()=>!!e.isEdit&&m(e.initialValues.position.privateNote),[e.isEdit,e.initialValues]),f=(0,L.useMemo)(()=>!!e.isEdit&&no(e.initialValues.position.tagsIds),[e.isEdit,e.initialValues]);return(0,i.jsx)(Cl,{customErrorRef:d,height:1,initialValues:e.initialValues,render:({form:t,handleSubmit:r,submitting:a,values:l})=>(0,i.jsx)(Pm,{button:e.isEdit&&(0,i.jsx)(El,{isLoading:a,onClick:r,children:n("mettre_jour_l_19061")}),category:c,color:"dark",fallbackClosePath:ps.POSITIONS({organizationId:s,eventId:o}),heading:e.isEdit?e.initialValues.position.name:n("nouvelle_missio_60727"),children:(0,i.jsxs)($m,{ref:d,children:[(0,i.jsx)(vl,{}),(0,i.jsx)(Mm,{hideToggle:!0,initialIsOpen:!0,heading:n("informations_su_61022"),children:(0,i.jsx)(vU,{change:t.change,event:e.event})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{hideToggle:!0,initialIsOpen:!0,subtitle:n("ajouter_les_dif_22779"),heading:n("cr_neaux_horair_62996"),children:(0,i.jsx)(yU,{change:t.change,event:e.event,values:l})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{initialIsOpen:u,subtitle:n("localiser_le_li_46319"),heading:n("localisation_38416"),onToggle:n=>{n||(t.change("position.layer",e.event.layer),t.change("position.zoom",Or),t.change("position.tracesIds",[]),t.change("position.address",null),t.change("position.latitude",null),t.change("position.longitude",null))},children:(0,i.jsx)(ZP,{center:e.event,layer:l.position.layer,name:"position.",point:l.position,traces:e.event.traces,tracesIds:l.position.tracesIds})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{initialIsOpen:h,subtitle:n("ajouter_des_con_75357"),heading:n("conditions_77756"),onToggle:e=>{e||t.change("position.positionsCustomFields",[])},children:(0,i.jsx)(NP,{change:t.change,conditionsOperator:l.position.conditionsOperator,customFields:e.conditionsCustomFields,customFieldsValues:l.position.positionsCustomFields,name:"position.positionsCustomFields",prefix:"position."})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{initialIsOpen:g,subtitle:n("ajouter_des_inf_14340"),heading:n("champs_de_formu_64126"),onToggle:e=>{e||t.change("position.fields",{})},children:(0,i.jsx)(eP,{change:t.change,customFields:e.positionCustomFields,formCustomFields:[],formCustomFieldsValues:[],prefix:"position.",showFormCustomFields:!1})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{initialIsOpen:p,subtitle:n("ajouter_une_not_81707"),heading:n("note_priv_e_06303"),onToggle:e=>{e||t.change("position.privateNote","")},children:(0,i.jsx)(bU,{})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Mm,{initialIsOpen:f,subtitle:n("ajouter_des_tag_64526"),heading:n("tags_79499"),onToggle:e=>{e||t.change("position.tagsIds",[])},children:(0,i.jsx)(eC,{change:t.change,name:"position.",organizationId:s,tags:e.tags,tagsIds:l.position.tagsIds})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Fm,{children:(0,i.jsx)(El,{isLoading:a,textAlign:"center",onClick:r,children:e.isEdit?n("mettre_jour_l_19061"):n("cr_er_la_missio_82644")})})]})}),validate:l.validateForForm(a.createUpdatePositionSchema()),width:1,onSubmit:async i=>{const a=await e.mutate({eventId:o,position:{...i.position,slots:i.position.slots.map(e=>(0,dr.A)(e,["index"]))}});r(e.isEdit?n("la_mission_a_t_79916"):n("la_mission_a_t_14808")),e.isEdit?t.goBack(ps.POSITION({organizationId:s,eventId:o,positionId:a})):t.replace(ps.POSITION({organizationId:s,eventId:o,positionId:a}))}})},AU=()=>{const e=qn(xU),{organizationId:t,eventId:n,options:s}=Jn(),{data:o,loader:r}=Zn("query PositionEventInfos($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(variety: Position, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreatePositionEvent\n }\n}\n",{organizationId:t,eventId:n},[Ls.ConditionsCustomFieldsFragment,Ls.CreatePositionTagsFragment,Ls.AttachCustomFieldFragment,Ls.CreatePositionEventFragment]),{mutate:a}=function(e={}){return Xn("mutation PositionCreate($eventId: EventId!, $position: PositionInput!) {\n positionCreate(eventId: $eventId, position: $position) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0}),{positionCategoryId:l,latitude:d,longitude:c}=(e=>{const[t,n]=(e??"").split(",");return m(t)&&m(n)?{latitude:parseFloat(t),longitude:parseFloat(n)}:m(e)?{positionCategoryId:parseInt(e,10)}:{}})(s);return r||(0,i.jsx)(kU,{conditionsCustomFields:o.organization.conditionsCustomFields.nodes,event:o.event,initialValues:{position:e.positionInputDefault(null,{layer:o.event.layer,startAt:o.event.startAt,positionCategoryId:l,latitude:d,longitude:c})},isEdit:!1,mutate:async e=>{const{positionCreate:{id:t}}=await a(e);return t},positionCustomFields:o.organization.positionCustomFields.nodes,tags:o.organization.tags.nodes})},wU=()=>{const{organizationId:e,eventId:t,positionId:n}=Jn(),{data:s,loader:o}=Zn("query PositionToEdit(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $positionId: PositionId!\n) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n ...CreatePositionTags\n\n positionCustomFields: customFields(variety: Position, privacy: All) {\n nodes {\n ...AttachCustomField\n }\n }\n }\n\n event(id: $eventId) {\n ...CreatePositionEvent\n\n position(id: $positionId) {\n name\n description\n acronym\n color\n icon\n privateNote\n address\n latitude\n longitude\n layer\n zoom\n tracesIds\n tagsIds\n fields\n conditionsOperator\n\n category {\n id\n }\n\n slots {\n id\n name\n startDate\n startTime\n endDate\n endTime\n resources\n assignedResources\n }\n\n positionsCustomFields {\n customFieldId\n conditionValue\n }\n }\n }\n}\n",{organizationId:e,eventId:t,positionId:n},[Ls.ConditionsCustomFieldsFragment,Ls.CreatePositionTagsFragment,Ls.AttachCustomFieldFragment,Ls.CreatePositionEventFragment]),r=qn(xU),{mutate:a}=function(e={}){return Xn("mutation PositionUpdate($eventId: EventId!, $positionId: PositionId!, $position: PositionInput!) {\n positionUpdate(eventId: $eventId, positionId: $positionId, position: $position) {\n id\n }\n}\n",e)}({redirectOnSuccess:!0});return o||(0,i.jsx)(kU,{conditionsCustomFields:s.organization.conditionsCustomFields.nodes,event:s.event,initialValues:{position:r.positionInputDefault(s.event.position,{layer:s.event.layer,startAt:s.event.startAt})},isEdit:!0,mutate:async e=>{const{positionUpdate:{id:t}}=await a({...e,positionId:n});return t},positionCustomFields:s.organization.positionCustomFields.nodes,tags:s.organization.tags.nodes})};var SU;let EU=class extends OO{static{SU=this}csvInputService;static IMPORT_COLUMNS_DEFAULT={...OO.IMPORT_COLUMNS_DEFAULT,PositionName:"positionName",PositionCategoryName:"positionCategoryName",SlotStart:"slotStart",SlotEnd:"slotEnd",MaxResources:"slotMaxResources",SlotName:"slotName",Acronym:"acronym",Color:"color",Icon:"icon",Description:"description",Address:"address",Latitude:"latitude",Longitude:"longitude",MapLayer:"mapLayer",MapZoom:"mapZoom",LeadersEmails:"leadersEmails",LeadersFirstNames:"leadersFirstnames",LeadersLastNames:"leadersLastnames",PrivateNote:"privateNote",Tags:"tags"};static IMPORT_COLUMNS_REQUIRED=e=>[...e===Ze.Update?[SU.IMPORT_COLUMNS_DEFAULT.Id]:[],SU.IMPORT_COLUMNS_DEFAULT.SlotStart,SU.IMPORT_COLUMNS_DEFAULT.SlotEnd,SU.IMPORT_COLUMNS_DEFAULT.MaxResources,SU.IMPORT_COLUMNS_DEFAULT.PositionName,SU.IMPORT_COLUMNS_DEFAULT.PositionCategoryName];constructor(e,t){super(e,t),this.csvInputService=e}};EU=SU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Ov,Wn])],EU);const TU=()=>{const{params:{organizationId:e,eventId:t},translate:n}=_l(),{mutate:s}=function(e={}){return Xn("mutation PositionsImport(\n $eventId: EventId!\n $organizationId: OrganizationId!\n $input: MappableImportInput!\n) {\n jobId: positionsImport(eventId: $eventId, organizationId: $organizationId, input: $input)\n}\n",e)}(),{checkPositionsImport:o}=kb(),{data:r,loader:a}=Kr({organizationId:e,variety:ve.Position});return a||(0,i.jsx)(QO,{ImportInputService:EU,checkImport:o,closePath:ps.POSITIONS({organizationId:e,eventId:t}),customFields:r.organization.customFields.nodes,heading:n("importing_tasks_31757"),importTagPrefix:"positions",itemName:{singular:n("task_24074"),plural:n("tasks_06050")},localStorageKeyPrefix:"POSITIONS_IMPORT",mutate:s,returnLink:(0,i.jsx)(qc,{to:ps.POSITIONS({organizationId:e,eventId:t}),children:n("revenir_aux_mis_73428")}),showModeSelection:!1})};var zU;!function(e){e.Acronym="acronym",e.Address="address",e.Category="category",e.CategoryLeaders="categoryLeaders",e.CheckedInRate="checkedInRate",e.Color="color",e.Conditions="conditions",e.CreatedAt="createdAt",e.CreatedBy="createdBy",e.Description="description",e.FillingRate="fillingRate",e.Icon="icon",e.IconColor="iconColor",e.Id="id",e.Latitude="latitude",e.Leaders="leaders",e.Longitude="longitude",e.Name="name",e.PrivateNote="privateNote",e.Resources="resources",e.Slot="slot",e.SlotName="slotName",e.State="state",e.Tags="tags"}(zU||(zU={}));let OU=class extends gu{constructor(e,t,n){super(e,t,n)}getPositionsFilters(e,t){return(0,Ya.A)([{slug:zU.Name,name:this.t("nom_de_la_missi_64605"),category:this.t("missions_63972"),fieldType:We.Text,hideEmpty:!0},{slug:"position",name:this.t("Position"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,eventId:e.id},{slug:zU.Description,name:this.t("Description"),category:this.t("missions_63972"),fieldType:We.Text},{slug:zU.PrivateNote,name:this.t("note_priv_e_06303"),category:this.t("missions_63972"),fieldType:We.Text},no(e.positionsCategories)?{slug:"positionCategory",name:this.t("cat_gorie_00291"),category:this.t("missions_63972"),fieldType:We.Select,values:e.positionsCategories,hideEmpty:!0}:null,{slug:"positionSlot",name:this.t("cr_neau_11117"),category:this.t("missions_63972"),fieldType:We.DateTimeRange,startAt:e.startAt,endAt:e.endAt},{slug:"positionSlotName",name:this.t("nom_du_cr_neau_54351"),category:this.t("missions_63972"),fieldType:We.Text},{slug:"tag",name:this.t("Tag"),category:this.t("missions_63972"),fieldType:We.Select,needLoading:!0,organizationId:e.organizationId,eventId:e.id,tagContext:kt.Positions},{slug:"positionCustomField",name:this.t("condition_61066"),category:this.t("missions_63972"),fieldType:We.Select,needLoading:!0,organizationId:e.organizationId},{slug:"acronym",name:this.t("Acronym"),category:this.t("missions_63972"),fieldType:We.Text},{slug:"color",name:this.t("Color"),category:this.t("missions_63972"),fieldType:We.Text,hideEmpty:!0},{slug:"icon",name:this.t("ic_ne_55554"),category:this.t("missions_63972"),fieldType:We.Select,values:pn.map(e=>({id:e,name:this.t(e)})),hideEmpty:!0},{slug:"address",name:this.t("Address"),category:this.t("missions_63972"),fieldType:We.Text},{slug:"latitude",name:this.t("Latitude"),category:this.t("missions_63972"),fieldType:We.Number},{slug:"longitude",name:this.t("Longitude"),category:this.t("missions_63972"),fieldType:We.Number},{slug:"state",name:this.t("statut_des_ress_73550"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,values:Cn.map(e=>({id:e,name:this.t(e)}))},{slug:"fillingRate",name:this.t("taux_de_remplis_11913"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0},{slug:"checkedInRate",name:this.t("taux_de_pointag_87285"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0},{slug:zU.Leaders,name:this.t("nombre_de_respo_19772"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0},{slug:zU.CategoryLeaders,name:this.t("nombre_de_respo_01994"),category:this.t("missions_63972"),fieldType:We.Number,hideEmpty:!0},{slug:zU.CreatedBy,name:this.t("cr_e_par_30622"),category:this.t("missions_63972"),fieldType:We.Select,hideEmpty:!0,needLoading:!0,organizationId:e.organizationId,eventId:e.id},{slug:zU.CreatedAt,name:this.t("cr_e_le_02658"),category:this.t("missions_63972"),fieldType:We.Datetime,hideEmpty:!0},...this.customFieldsToFilters(t)])}getPositionsPossibleColumns(e){return[{slug:zU.Id,name:this.t("id_51738"),isSearchable:!0,isSortable:!0,sortAttribute:ct.Id,width:100},{slug:zU.Name,name:this.t("nom_de_la_missi_64605"),isSearchable:!0,isSortable:!0,sortAttribute:ct.Name,minWidth:120},{slug:zU.Category,name:this.t("cat_gorie_00291"),isSearchable:!0,isSortable:!0,sortAttribute:ct.Category,minWidth:240},{slug:zU.SlotName,name:this.t("nom_du_cr_neau_54351"),isSearchable:!0,minWidth:180},{slug:zU.Slot,name:this.t("cr_neau_11117"),isSortable:!0,sortAttribute:ct.Slot,minWidth:240},{slug:zU.Resources,name:this.t("membres_11310"),minWidth:320},{slug:zU.Tags,name:this.t("tags_79499"),isSearchable:!0,minWidth:320},{slug:zU.Conditions,name:this.t("conditions_77756"),minWidth:320},{slug:zU.Address,name:this.t("Address"),isSearchable:!0,minWidth:240},{slug:zU.Latitude,name:this.t("latitude_46176"),isSearchable:!0,minWidth:180},{slug:zU.Longitude,name:this.t("longitude_01695"),isSearchable:!0,minWidth:180},{slug:zU.Acronym,name:this.t("Acronym"),isSearchable:!0,minWidth:180},{slug:zU.Color,name:this.t("Color"),isSearchable:!0,width:80},{slug:zU.Icon,name:this.t("ic_ne_55554"),width:80},{slug:zU.IconColor,name:this.t("ic_ne_et_couleu_54485"),width:80},{slug:zU.State,name:this.t("statut_des_ress_73550"),minWidth:240},{slug:zU.FillingRate,name:this.t("taux_de_remplis_11913"),minWidth:240},{slug:zU.CheckedInRate,name:this.t("taux_de_pointag_87285"),minWidth:240},{slug:zU.CreatedBy,name:this.t("cr_e_par_30622"),isSearchable:!0,minWidth:180},{slug:zU.CreatedAt,name:this.t("cr_e_le_02658"),isSortable:!0,sortAttribute:ct.CreatedAt,minWidth:180},{slug:zU.Leaders,name:this.t("responsables_de_54941"),isSearchable:!0,minWidth:320},{slug:zU.CategoryLeaders,name:this.t("responsables_de_22220"),isSearchable:!0,minWidth:320}].concat(this.customFieldsToPossibleColumns(e))}};OU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[du,Kc,Wn])],OU);const RU=e=>{const{params:{eventId:t}}=_l(),{mutate:n}=Ro(),s=L.useCallback(async i=>{const s=to(e.property);for(const o of s){const r=1===s.length?i:i[o];await n({eventId:t,massEdit:{reset:!1,selecteds:{ids:[e.positionId]},slug:o,strategy:tt.Replace,value:r}})}},[e.positionId,e.property,n]);return(0,i.jsx)(_y,{column:e.column,initialValue:e.initialValue,mutate:s,reload:e.reload,renderInput:e.renderInput,renderValue:e.renderValue,updatable:e.updatable})},$U=e=>{const{translate:t}=_l();return(0,i.jsx)(RU,{column:e.column,initialValue:e.position.acronym||"",positionId:e.position.id,property:rt.Acronym,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{label:t("Acronym"),value:e,onChange:n}),renderValue:e.position.acronym||"",updatable:e.updatable})},DU=L.createContext({}),PU=e=>{const[t,n]=L.useState(),s=j$(pa,{eventId:e.eventId},e=>e.event.positionsCategories),o=j$(Bo,{organizationId:e.organizationId},e=>e.organization.tags.nodes);return(0,i.jsx)(DU.Provider,{value:{newPositionLatLng:t,getPositionsCategories:s,getTags:o,setNewPositionLatLng:n},children:e.children})};function FU(){return L.useContext(DU)}const MU=e=>{const t=Yn(),{getPositionsCategories:n}=FU(),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("Category")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(zu,{label:t("Category"),shouldParseAsInt:!0,value:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},NU=e=>{const{params:{organizationId:t,eventId:n}}=_l(),{isEditMode:s}=gy();return(0,i.jsx)(RU,{column:e.column,initialValue:e.positionCategory.id,positionId:e.positionId,property:rt.Category,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(MU,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(N$,{isEditMode:s,title:e.positionCategory.name,updatable:e.updatable,children:(0,i.jsx)(qc,{to:ps.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.positionCategory.id}),children:e.positionCategory.name})}),updatable:e.updatable})},LU=e=>{const{translate:t}=_l();return(0,i.jsx)(RU,{column:e.column,initialValue:e.position.color,positionId:e.position.id,property:rt.Color,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nj,{label:t("Color"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(Na,{align:"center",gap:"3",width:1,children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{css:{background:e.position.color,borderRadius:"2px",height:"24px",width:"24px"},onClick:()=>{PS(e.position.color)}})}),(0,i.jsx)(Cm,{placement:"top",children:e.position.color})]})}),updatable:e.updatable})},BU=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>e.position.positionsCustomFields||[],[e.position]),s=(0,L.useMemo)(()=>n.map((e,n)=>({id:n,color:"gray",icon:null,text:`${e.customField.name} : ${cF(t,e.customField,e.conditionValue)}`})),[n]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:s})})},VU=e=>{const{translate:t}=_l();return(0,i.jsx)(RU,{column:e.column,initialValue:e.position.icon,positionId:e.position.id,property:rt.Icon,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Wj,{label:t("Icon"),renderOnPortal:!0,value:e,onChange:n}),renderValue:()=>(0,i.jsx)(el,{icon:Qa(e.position.icon)}),updatable:e.updatable})},UU=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>({[rt.Color]:e.position.color,[rt.Icon]:e.position.icon}),[e.position]);return(0,i.jsx)(RU,{column:e.column,initialValue:n,positionId:e.position.id,property:[rt.Color,rt.Icon],reload:e.reload,renderInput:(e,n)=>(0,i.jsxs)(Na,{direction:"column",gap:"2",width:1,children:[(0,i.jsx)(Nj,{label:t("Color"),value:e[se.Color],onChange:t=>{n({...e,[se.Color]:t})}}),(0,i.jsx)(Wj,{label:t("Icon"),renderOnPortal:!0,value:e[se.Icon],onChange:t=>{n({...e,[se.Icon]:t})}})]}),renderValue:()=>(0,i.jsx)(FC,{color:e.position.color,icon:e.position.icon}),updatable:e.updatable})},WU=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{isEditMode:o}=gy();return(0,i.jsx)(RU,{column:e.column,initialValue:e.position.name,positionId:e.position.id,property:rt.Name,reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{label:t("nom_de_la_missi_64605"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(N$,{isEditMode:o,title:e.position.name,updatable:e.updatable,children:(0,i.jsx)(qc,{to:ps.POSITION({organizationId:n,eventId:s,positionId:e.position.id}),children:e.position.name})}),updatable:e.updatable})},GU=e=>{const{translate:t}=_l(),{getTags:n}=FU(),{result:s,isLoading:o}=D$(n);return o?(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[(0,i.jsx)(Pl,{children:t("tags_79499")}),(0,i.jsx)(oc,{borderRadius:"$1",height:38,width:1})]}):(0,i.jsx)(bc,{isSearchVisible:!0,label:t("tags_79499"),multiple:!0,renderOnPortal:!0,values:e.value,onChange:e.setValue,children:s.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})},HU=e=>{const t=(0,L.useMemo)(()=>e.position.tags||[],[e.position]),n=(0,L.useMemo)(()=>t.map(e=>({id:e.id,color:"gray",icon:null,text:e.name})),[t]);return(0,i.jsx)(RU,{column:e.column,initialValue:t.map(e=>e.id),positionId:e.position.id,property:rt.Tag,reload:e.reload,renderInput:(e,t)=>(0,i.jsx)(GU,{setValue:t,value:e}),renderValue:()=>(0,i.jsx)(Ty,{badges:n}),updatable:e.updatable})},qU=e=>{const{translate:t,params:{eventId:n}}=_l(),{mutate:s}=ja(),o=(0,L.useMemo)(()=>m(e.positionSlot.name)?e.positionSlot.name:"-",[e.positionSlot]);return(0,i.jsx)(_y,{column:e.column,initialValue:e.positionSlot.name,mutate:async t=>s({eventId:n,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:{...(0,wr.A)(e.positionSlot,["id","startDate","startTime","endDate","endTime","resources"]),name:t}}),reload:e.reload,renderInput:(e,n)=>(0,i.jsx)(Nl,{label:t("nom_du_cr_neau_54351"),value:e,onChange:n}),renderValue:()=>(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray900 textSm medium",title:o,width:1,children:o}),updatable:e.updatable})},YU=e=>{const{translate:t,params:{eventId:n}}=_l(),{isEventAdmin:s}=vb(),o=qn(hh),r=qn(rC),{mutate:a}=ja(),l=uy(e.customFields),d=(0,L.useCallback)(()=>{e.reloadPositionSlot(e.positionSlot.id)},[e.positionSlot,e.reloadPositionSlot]),[c,u]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Dc,{css:{"&:hover":{background:"$gray100"}},children:[e.columns.map(n=>{const a=l.get(n.slug);return n.slug===zU.Id?(0,i.jsx)(Ec,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.id},n.slug):n.slug===zU.Category?(0,i.jsx)(NU,{column:n,positionCategory:e.positionSlot.positionCategory,positionId:e.positionSlot.position.id,reload:d,updatable:s},n.slug):n.slug===zU.Name?(0,i.jsx)(WU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===zU.Slot?(0,i.jsx)(Ec,{minWidth:n.minWidth,width:n.width,children:o.toDisplayString(e.positionSlot.range)},n.slug):n.slug===zU.SlotName?(0,i.jsx)(qU,{column:n,positionSlot:e.positionSlot,reload:d,updatable:s},n.slug):n.slug===zU.Resources?(0,i.jsx)(Ec,{minWidth:n.minWidth,width:n.width,children:(0,i.jsx)(O$,{assignedResources:e.positionSlot.assignedResources,resources:e.positionSlot.resources})},n.slug):n.slug===zU.Tags?(0,i.jsx)(HU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===zU.Conditions?(0,i.jsx)(BU,{column:n,position:e.positionSlot.position},n.slug):n.slug===zU.Address?(0,i.jsx)(Ec,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.address},n.slug):n.slug===zU.Latitude?(0,i.jsx)(Ec,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.latitude},n.slug):n.slug===zU.Longitude?(0,i.jsx)(Ec,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.position.longitude},n.slug):n.slug===zU.Acronym?(0,i.jsx)($U,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===zU.Color?(0,i.jsx)(LU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===zU.Icon?(0,i.jsx)(VU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===zU.IconColor?(0,i.jsx)(UU,{column:n,position:e.positionSlot.position,reload:d,updatable:s},n.slug):n.slug===zU.State?(0,i.jsx)(Ec,{minWidth:n.minWidth,width:n.width,children:e.positionSlot.state===ut.Full?(0,i.jsx)(ic,{color:"success",children:t(e.positionSlot.state)}):(0,i.jsx)(ic,{color:"warning",children:t(e.positionSlot.state)})},n.slug):n.slug===zU.FillingRate?(0,i.jsxs)(Ec,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.fillingRate,"%"]},n.slug):n.slug==zU.CheckedInRate?(0,i.jsxs)(Ec,{minWidth:n.minWidth,width:n.width,children:[e.positionSlot.checkedInRate||0,"%"]},n.slug):n.slug===zU.CreatedAt?(0,i.jsx)(TR,{column:n,insertedAt:e.positionSlot.insertedAt}):n.slug===zU.CreatedBy?(0,i.jsx)(zR,{column:n,createdBy:e.positionSlot.position.createdBy},n.slug):(0,i.jsx)(Ec,{minWidth:n.minWidth,width:n.width,children:a?r.getValueString(a,e.positionSlot.position.fields,{fileReturnValue:"name"}):""},n.slug)}),(0,i.jsx)(Bb,{permissions:Nb.POSITION_EDIT,children:(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",onClick:()=>{u(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]})})})]}),c&&(0,i.jsx)(jU,{event:e.event,slot:e.positionSlot,onClose:()=>{u(!1)},onSuccess:async t=>{await a({eventId:n,positionId:e.positionSlot.position.id,positionSlotId:e.positionSlot.id,positionSlot:t}),d()}})]})},KU=e=>{const{params:{eventId:t}}=_l(),{columns:n,columnsSearch:s,limit:o,nameDebounced:r,offset:a,possibleColumns:l,predicates:d,reloadKey:c,setLimit:u,setOffset:h,setSort:g,sort:p}=gy(),f=(0,L.useMemo)(()=>({includeCheckedInRate:n.includes(zU.CheckedInRate),includeConditions:n.includes(zU.Conditions),includeCreatedBy:n.includes(zU.CreatedBy),includeTags:n.includes(zU.Tags)}),[n]),{data:x,isLoading:_,reload:I}=Zn("query PositionsSlots(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $columnsSearch: [String!]\n $limit: Int\n $offset: Int\n $sort: PositionsSlotsSort\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positionsSlots(\n name: $name\n predicates: $predicates\n columnsSearch: $columnsSearch\n limit: $limit\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PositionsPositionSlot\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{...f,eventId:t,name:m(r)?r:null,columnsSearch:no(s)?s:null,predicates:d,limit:o,offset:a,sort:p},[Ls.PositionsPositionSlotFragment]);const v=(0,L.useMemo)(()=>n.flatMap(e=>(0,Ya.A)([l.find(t=>t.slug===e)])),[l,n]),{numberOfPages:b,totalCount:j}=ku(x.event?.positionsSlots),[C,y]=(0,L.useState)([]),[k,A]=(0,L.useState)({}),w=(0,L.useCallback)(async e=>{A(t=>({...t,[e]:!0}));const{event:{positionSlot:n}}=await function(e,t){return ho("query PositionsPositionSlot(\n $eventId: EventId!\n $id: PositionsSlotId!\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeTags: Boolean!\n) {\n event(id: $eventId) {\n positionSlot(id: $id) {\n ...PositionsPositionSlot\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.PositionsPositionSlotFragment]})}({...f,eventId:t,id:e},await K());y(t=>t.map(t=>t.id===e?n:t)),A(t=>({...t,[e]:!1}))},[f,A,y]);return(0,L.useEffect)(()=>{y(x.event?.positionsSlots.nodes??[])},[x.event]),(0,L.useEffect)(()=>{c>1&&I()},[c]),(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":_,headerRow:(0,i.jsxs)(jc,{children:[v.map(e=>e.isSortable?(0,i.jsx)(_m,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:g,sort:p,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Vc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(0,i.jsx)(Bb,{permissions:Nb.POSITION_EDIT,children:(0,i.jsx)(Vc,{width:100})})]}),paginationRow:(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:o,numberOfPages:b,offset:a,setLimit:u,setOffset:h,showLimits:!0,totalCount:j})}),children:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):C.map(t=>k[t.id]?(0,i.jsx)(Uc,{},t.id):(0,i.jsx)(YU,{columns:v,customFields:e.customFields,event:x.event,positionSlot:t,reloadPositionSlot:w},t.id))})})};let ZU=class extends Ul{translationService;constructor(e){super(e),this.translationService=e}massConditionsStep1Schema(){return d.Ik().shape({massConditions:d.Ik().shape({...this.massConditionsStep1Fields()})})}massConditionsStep2Schema(){return d.Ik().shape({massConditions:d.Ik().shape({...this.massConditionsStep2Fields()})})}massConditionsSchema(){return d.Ik().shape({...this.massConditionsStep1Fields(),...this.massConditionsStep2Fields()})}massConditionsStep1Fields(){return{strategy:d.Yj().required(this.t("la_strat_gie_es_82287")).oneOf(vn,this.t("la_strat_gie_es_82287"))}}massConditionsStep2Fields(){return{customFieldId:d.ai().required(this.t("le_champ_person_80074")),value:d.gl().required(this.t("la_valeur_est_r_70136"))}}};ZU=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],ZU);const XU=()=>{const e=Yn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray900",fontWeight:"medium",children:e("que_souhaitez_v_87607")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(GR,{label:e("ajouter_des_con_91773"),name:"massConditions.strategy",value:tt.Add}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(GR,{label:e("remplacer_les_c_29446"),name:"massConditions.strategy",value:tt.Replace})]})},JU=e=>{const t=Yn(),{data:n,loader:s}=Zn("query MassConditionsCustomFields($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n ...ConditionsCustomFields\n }\n}\n",{organizationId:e.organizationId},[Ls.ConditionsCustomFieldsFragment]);const o=(0,L.useMemo)(()=>n.organization&&e.values.massConditions.customFieldId?n.organization.conditionsCustomFields.nodes.find(t=>t.id===e.values.massConditions.customFieldId):void 0,[n.organization,e.values.massConditions.customFieldId]);return(0,L.useEffect)(()=>{o?.fieldType===Ve.Checkbox?e.change("massConditions.value",!0):o?.fieldType===Ve.Select&&e.change("massConditions.value",[])},[o]),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hj,{label:t("CustomField"),name:"massConditions.customFieldId",shouldParseAsInt:!0,children:[(0,i.jsx)("option",{value:-1,children:t("s_lectionner_un_01451")}),n.organization.conditionsCustomFields.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),o?.fieldType===Ve.Select&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Um,{isSearchVisible:!0,label:t("mission_accessi_77261"),multiple:!0,name:"massConditions.value",children:o.values.map(({id:e,value:t})=>(0,i.jsx)("option",{value:e,children:t},e))})]}),o?.fieldType===Ve.Checkbox&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Hj,{label:t("mission_accessi_77261"),name:"massConditions.value",shouldParseAsBoolean:!0,children:[(0,i.jsx)("option",{value:"true",children:t("true")}),(0,i.jsx)("option",{value:"false",children:t("false")})]})]})]})},QU=e=>{const t=Yn(),n=qn(ZU),s=qn(Ba),{mutate:o}=function(e={}){return Xn("mutation PositionsMassConditions($eventId: EventId!, $massConditions: MassConditionsInput!) {\n numberOfPositions: positionsMassConditions(eventId: $eventId, massConditions: $massConditions)\n}\n",e)}(),[r,a]=(0,L.useState)(0);return(0,i.jsx)(su,{size:"md",onClose:e.onClose,children:(0,i.jsx)(Ua.lV,{initialValues:{massConditions:{customFieldId:-1,selecteds:e.selecteds,strategy:tt.Add,value:""}},initialValuesEqual:Pr.A,render:({form:n,handleSubmit:s,values:o})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(Xj,{color:"primary",icon:"lock"})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("_diter_les_cond_95618")}),(0,i.jsx)(qa,{height:"7"}),0===r?(0,i.jsx)(XU,{}):(0,i.jsx)(JU,{change:n.change,organizationId:e.organizationId,values:o}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",children:[0!==r&&(0,i.jsx)(El,{color:"white",leftIcon:"arrow-left",onClick:()=>{a(Math.max(0,r-1))},children:t("retour_92202")}),(0,i.jsx)(yr,{css:{flex:"1"}}),0===r?(0,i.jsx)(El,{rightIcon:"arrow-right",onClick:s,children:t("suivant_1_2_16815")}):(0,i.jsx)(El,{onClick:s,children:t("mettre_jour_l_67209")})]})]}),validate:e=>0===r?s.validateForForm(n.massConditionsStep1Schema())(e):s.validateForForm(n.massConditionsStep2Schema())(e),onSubmit:async n=>{if(1===r){const i=(await o({eventId:e.eventId,massConditions:n.massConditions})).numberOfPositions;e.onSuccess(t("les_conditions_78548",i)),e.onClose()}else a(r+1)}})})},eW=()=>{const e=Yn(),{roles:t}=yI(),{eventId:n,massActions:s,onMassEditSuccess:o,organizationId:r,predicates:a,segment:l}=gy(),{showNotification:d}=kb(),{mutate:c}=Ro(),{mutate:u}=la(),{mutate:h}=fa(),[g,p]=(0,L.useState)(!1),[f,x]=(0,L.useState)(!1),[_,I]=(0,L.useState)(!1),[v,b]=(0,L.useState)(!1),j=s.getSelectedsInput(a,null),C=s.isAllSelected?l.count:s.numberOfSelected,y=(0,L.useCallback)(e=>{m(e)&&d(e),o()},[o]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(El,{onClick:()=>{p(!0)},children:e("_diter_une_prop_26724")}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"lock",onClick:()=>{x(!0)},children:e("_diter_les_cond_95618")}),(0,i.jsx)(Gd,{icon:"user-gear",onClick:()=>I(!0),children:e("_diter_les_resp_29588")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{b(!0)},children:e("supprimer_43083")})]})]}),g&&(0,i.jsx)(cA,{eventId:n,mutate:e=>c({eventId:n,massEdit:e}),organizationId:r,selecteds:j,onClose:()=>{p(!1)},onSuccess:t=>{y(e("_1_missions_on_96803",t))}}),f&&(0,i.jsx)(QU,{eventId:n,organizationId:r,selecteds:j,onClose:()=>{x(!1)},onSuccess:y}),_&&(0,i.jsx)(w$,{roles:t.positionRoles,showRoleSelect:!0,onClose:()=>I(!1),onSuccess:async(t,i)=>{const s=(await u({eventId:n,massLeaders:{leaders:i,strategy:t,selecteds:j}})).numberOfPositions;y(e("les_responsable_23291",s))}}),v&&(0,i.jsx)(sA,{buttonText:e("supprimer_43083"),subtext:[e("_tes_vous_s_r_d_65487")],text:e("suppression_de_81835",C),onClose:()=>{b(!1)},onDelete:async()=>{const t=(await h({eventId:n,selecteds:j})).numberOfPositions;y(e("_1_missions_on_56713",t))}})]})};function tW(){const{history:e,params:{organizationId:t,eventId:n}}=_l(),{mutate:i}=function(e={}){return Xn("mutation PositionDuplicate($eventId: EventId!, $positionId: PositionId!) {\n positionDuplicate(eventId: $eventId, positionId: $positionId) {\n id\n }\n}\n",e)}();return(0,L.useCallback)(async s=>{const{positionDuplicate:o}=await i({eventId:n,positionId:s});e.push($s.EDIT_POSITION(t,n,o.id))},[t,n,i])}const nW=e=>{const{translate:t,params:{eventId:n}}=_l(),{showNotification:s}=kb(),{mutate:o}=fa(),r=[];return e.position.assignedResources>0&&r.push(t("_1_membre_est_66702",e.position.assignedResources)),(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_01544"),t("cela_supprimera_15744"),...r],text:t("suppression_de_73669",e.position.name),onClose:e.onClose,onDelete:async()=>{await o({eventId:n,selecteds:{ids:[e.position.id]}}),s(t("la_mission_1_45985",e.position.name)),e.onSuccess()}})},iW=e=>{const{params:{organizationId:t,eventId:n},translate:s}=_l(),o=tW(),{isEventAdmin:r}=vb(),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"pen",to:$s.EDIT_POSITION(t,n,e.position.id),children:s("_diter_62574")}),(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>{await o(e.position.id)},children:s("dupliquer_28256")}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:e=>{l(!0),Nd(e.target)},children:s("supprimer_43083")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{icon:"plus",to:$s.CREATE_POSITION(t,n,e.position.category.id),children:s("ajouter_une_mis_99800")}),(0,i.jsx)(Gd,{icon:"eye",to:ps.POSITION_CATEGORY({organizationId:t,eventId:n,positionCategoryId:e.position.category.id}),children:s("voir_1_90465",e.position.category.name)}),r&&(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{c(!0)},children:s("renommer_1_40542",e.position.category.name)})]}),a&&(0,i.jsx)(nW,{position:e.position,onClose:()=>{l(!1)},onSuccess:e.reload}),d&&(0,i.jsx)(IU,{eventId:n,positionCategoryId:e.position.category.id,positionCategoryName:e.position.category.name,onClose:()=>{c(!1)},onSuccess:e.reload})]})},sW=e=>{const t=(0,L.useMemo)(()=>(e.position.category?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},oW=e=>{const t=(0,L.useMemo)(()=>(e.position?.leaders??[]).map(e=>({id:e.userInfo.id,color:"gray",icon:null,text:e.userInfo.nameOrEmail})),[e.position]);return(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Ty,{badges:t})})},rW=e=>{const{translate:t}=_l(),n=qn(Kc),{mutate:s}=Ro(),o=(0,L.useCallback)((t,n)=>s({eventId:e.eventId,massEdit:{reset:!1,selecteds:{ids:[e.row.id]},slug:n,strategy:tt.Replace,value:t}}),[e.row,s]),r=(0,L.useMemo)(()=>{if(e.row.range){const t=e.row.range.start,i=e.row.range.end;return t.startOf("day").equals(i.startOf("day"))?n.toLocaleString(t,Js.DateOnly.MonthShort):`${n.toLocaleString(t,Js.DateOnly.MonthShort)} → ${n.toLocaleString(i,Js.DateOnly.MonthShort)}`}return"-"},[e.row]),{isEventAdmin:a}=vb();return e.column.slug==zU.Id?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.id}):e.column.slug===zU.Category?(0,i.jsx)(NU,{column:e.column,positionCategory:e.row.category,positionId:e.row.id,reload:e.reloadRow,updatable:a}):e.column.slug===zU.Name?(0,i.jsx)(WU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===zU.Slot?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsxs)(Na,{css:{overflow:"hidden"},direction:"column",width:1,children:[(0,i.jsx)(yr,{font:"gray900 textSm medium",children:r}),(0,i.jsx)(yr,{color:"gray500",children:t("creneau",e.row.numberOfSlots)})]})}):e.column.slug===zU.SlotName?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:"-"}):e.column.slug===zU.Resources?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(O$,{assignedResources:e.row.assignedResources,resources:e.row.resources})}):e.column.slug===zU.Tags?(0,i.jsx)(HU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===zU.Conditions?(0,i.jsx)(BU,{column:e.column,position:e.row}):e.column.slug===zU.Address?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.address}):e.column.slug===zU.Latitude?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.latitude}):e.column.slug===zU.Longitude?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.longitude}):"isVisible"===e.column.slug?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:(0,i.jsx)(Na,{align:"center",gap:"3",width:1,children:e.row.isVisible?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"square-check"})}),(0,i.jsx)(yr,{children:t("visible_27909")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"square"})}),(0,i.jsx)(yr,{children:t("non_visible_30040")})]})})}):e.column.slug===zU.Acronym?(0,i.jsx)($U,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===zU.Color?(0,i.jsx)(LU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===zU.Icon?(0,i.jsx)(VU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===zU.IconColor?(0,i.jsx)(UU,{column:e.column,position:e.row,reload:e.reloadRow,updatable:a}):e.column.slug===zU.State?(0,i.jsx)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:e.row.state===ut.Full?(0,i.jsx)(ic,{color:"success",children:t(e.row.state)}):(0,i.jsx)(ic,{color:"warning",children:t(e.row.state)})}):e.column.slug===zU.FillingRate?(0,i.jsxs)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.fillingRate,"%"]}):e.column.slug===zU.CheckedInRate?(0,i.jsxs)(Ec,{minWidth:e.column.minWidth,width:e.column.width,children:[e.row.checkedInRate||0,"%"]}):e.column.slug===zU.CreatedAt?(0,i.jsx)(TR,{column:e.column,insertedAt:e.row.insertedAt}):e.column.slug===zU.CreatedBy?(0,i.jsx)(zR,{column:e.column,createdBy:e.row.createdBy}):e.column.slug===zU.Leaders?(0,i.jsx)(oW,{column:e.column,position:e.row}):e.column.slug===zU.CategoryLeaders?(0,i.jsx)(sW,{column:e.column,position:e.row}):(0,i.jsx)(Dy,{column:e.column,customField:e.customField,fields:e.row.fields,mutate:o,reload:e.reloadRow,updatable:a})},aW=e=>{const{params:{organizationId:t,eventId:n},translate:s}=_l(),{hasPermission:o}=vb(),r=o(Nb.POSITION_EDIT,{eventId:"ANY"}),a=uy(e.customFields),l=(0,L.useCallback)(()=>{e.reloadPosition(e.position.id)},[e.position,e.reloadPosition]);return(0,i.jsxs)(Dc,{css:{background:"checked"===e.state?"$primary100":"white","&:hover":{background:"checked"===e.state?"$primary100":"$gray100"}},onMouseLeave:e=>{Nd(e.target)},children:[r&&(0,i.jsx)(Ec,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:e.state,onClick:(t,n)=>{Rl(n),e.toggleRow(`p${e.position.id}`,t)}})}),e.columns.map(t=>{const s=a.get(t.slug);return(0,i.jsx)(rW,{column:t,customField:s,eventId:n,reloadRow:l,row:e.position},t.slug)}),(0,i.jsx)(Bb,{permissions:Nb.POSITION_EDIT,children:(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsxs)(Bb,{permissions:Nb.POSITION_EDIT,scope:{positionCategoryId:e.position.category.id},children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",to:$s.EDIT_POSITION(t,n,e.position.id)})})}),(0,i.jsx)(Cm,{placement:"top",children:s("_diter_62574")})]}),(0,i.jsx)(iW,{position:e.position,reload:e.reload})]})})})]})},lW=e=>{const{params:{eventId:t}}=_l(),{hasPermission:n}=vb(),s=n(Nb.POSITION_EDIT,{eventId:"ANY"}),{columns:o,columnsSearch:r,limit:a,massActions:l,nameDebounced:d,offset:c,possibleColumns:u,predicates:h,reloadKey:g,setLimit:p,setOffset:f,setSort:x,sort:_}=gy(),I=(0,L.useMemo)(()=>({includeCheckedInRate:o.includes(zU.CheckedInRate),includeConditions:o.includes(zU.Conditions),includeCreatedBy:o.includes(zU.CreatedBy),includeLeaders:o.includes(zU.Leaders)||o.includes(zU.CategoryLeaders),includeTags:o.includes(zU.Tags),includeTraces:!1}),[o]),{data:v,isLoading:b,reload:j}=xa({...I,eventId:t,name:m(d)?d:null,columnsSearch:no(r)?r:null,predicates:h,limit:a,offset:c,sort:_}),C=(0,L.useMemo)(()=>o.flatMap(e=>(0,Ya.A)([u.find(t=>t.slug===e)])),[u,o]),{numberOfPages:y,totalCount:k}=ku(v.data?.rows),[A,w]=(0,L.useState)([]),[S,E]=(0,L.useState)({}),T=(0,L.useCallback)(async e=>{E(t=>({...t,[e]:!0}));const{data:{row:n}}=await(i={...I,eventId:t,id:e},s=await K(),ho("query PositionsPosition(\n $eventId: EventId!\n $id: PositionId!\n $includeCheckedInRate: Boolean!\n $includeConditions: Boolean!\n $includeCreatedBy: Boolean!\n $includeLeaders: Boolean!\n $includeTags: Boolean!\n) {\n data: event(id: $eventId) {\n row: position(id: $id) {\n ...PositionsPosition\n }\n }\n}\n",{variables:i,token:s||void 0,fragments:[Ls.PositionsPositionFragment]}));var i,s;w(t=>t.map(t=>t.id===e?n:t)),E(t=>({...t,[e]:!1}))},[I,E,w]);return(0,L.useEffect)(()=>{w(v.data?.rows.nodes??[])},[v.data]),(0,L.useEffect)(()=>{g>1&&j()},[g]),(0,L.useEffect)(()=>{l.setStates(Object.fromEntries((v.data?.rows.nodes??[]).map(e=>[`p${e.id}`,{id:e.id,state:"unchecked"}])))},[v.data,l.setStates]),(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":b,headerRow:(0,i.jsxs)(jc,{children:[s&&(0,i.jsx)(Vc,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:l.selectAllState,onClick:l.toggleSelectAll})}),C.map(e=>e.isSortable?(0,i.jsx)(_m,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:x,sort:_,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Vc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),(0,i.jsx)(Bb,{permissions:Nb.POSITION_EDIT,children:(0,i.jsx)(Vc,{width:100})})]}),paginationRow:(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:a,numberOfPages:y,offset:c,setLimit:p,setOffset:f,showLimits:!0,totalCount:k})}),children:b?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):A.map(t=>S[t.id]?(0,i.jsx)(Uc,{},t.id):(0,i.jsx)(aW,{columns:C,customFields:e.customFields,position:t,reload:j,reloadPosition:T,state:l.states[`p${t.id}`]?.state??"unchecked",toggleRow:l.toggleRow},t.id))})})};function dW(e,t,n,i){n.current.forEach(e=>e.setMap(null)),n.current=e.map(e=>{const n=e.points.map(([e,t])=>({lat:e,lng:t})),s=e.direction===St.None?[]:[{icon:{path:e.direction===St.Backward?google.maps.SymbolPath.BACKWARD_OPEN_ARROW:google.maps.SymbolPath.FORWARD_OPEN_ARROW,scale:4,strokeColor:e.color},offset:"0%",repeat:"200px"}],o=new google.maps.Polyline({path:n,geodesic:!0,strokeColor:e.color,strokeOpacity:1,strokeWeight:4,visible:!t.includes(e.id),icons:s});return o.setMap(i.current),o})}const cW=(0,L.memo)(e=>{const t=(0,L.useCallback)(t=>{t&&(n.current&&(s.current?.setMap(null),o.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{...e.mapOptions??{},...Rr(e.initialCenter,e.initialZoom,e.layer)}),n.current.mapTypes.set(et.IgnPlan,Mr()),s.current=new google.maps.OverlayView,s.current.draw=Ql.A,s.current.setMap(n.current),n.current.addListener("drag",()=>{e.onMapDrag?.()}),n.current.addListener("center_changed",()=>{e.onMapCenterChanged?.({lat:n.current.getCenter().lat(),lng:n.current.getCenter().lng()})}),n.current.addListener("zoom_changed",()=>{e.onMapZoomchanged?.(n.current.getZoom())}),n.current.addListener("click",t=>{e.showMarker&&(o.current?.setMap(null),o.current=new google.maps.Marker({position:t.latLng,map:n.current,draggable:!0}),e.onMarkerDragEnd?.(t.latLng.lat(),t.latLng.lng()),o.current.addListener("dragend",()=>{const t=o.current.getPosition();e.onMarkerDragEnd?.(t.lat(),t.lng())}))}),n.current.addListener("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),l(),dW(e.traces,e.hiddenTracesIds,a,n))},[]),n=(0,L.useRef)(null),s=(0,L.useRef)(null),o=(0,L.useRef)(null),r=(0,L.useRef)([]),a=(0,L.useRef)([]),l=()=>{r.current.forEach(e=>e.setMap(null)),r.current=e.positions.map(t=>{const i=Tr($r(t)),o=new google.maps.Marker({position:i,map:n.current,icon:"acronym"===e.acronymIcon?`${P.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent(t.color)}&text=${t.acronym}`:`${P.HEAVENT_API_URL}/icons/${Qa(t.icon)}.svg?color=${encodeURIComponent(t.color)}`});return o.addListener("click",()=>{const n=s.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));n&&e.onPositionClick?.(t,n)}),o})};return(0,L.useEffect)(()=>{l()},[JSON.stringify(e.positions),e.acronymIcon]),(0,L.useEffect)(()=>{n.current?.setMapTypeId(Dr(e.layer))},[e.layer]),(0,L.useEffect)(()=>{dW(e.traces,e.hiddenTracesIds,a,n)},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(yr,{ref:t,height:1,width:1})},Pr.A);cW.displayName="PositionsMap";const uW=e=>{const t=Yn();return Fd(e.onClose),Pd(e.onClose),(0,i.jsxs)(Na,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsxs)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("acronym")},children:[(0,i.jsx)(yr,{fontSize:"textMd",children:(0,i.jsx)(el,{icon:"text"})}),(0,i.jsx)(yr,{color:"gray800",css:{flex:"1"},children:t("acronymes_11499")}),"acronym"===e.selectedAcronymIcon&&(0,i.jsx)(Na,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(el,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:fr.colors.primary600.value})})]}),(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onChange("icon")},children:[(0,i.jsx)(yr,{fontSize:"textMd",children:(0,i.jsx)(el,{icon:"location-dot"})}),(0,i.jsx)(yr,{color:"gray800",css:{flex:"1"},children:t("ic_nes_16022")}),"icon"===e.selectedAcronymIcon&&(0,i.jsx)(Na,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(el,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:fr.colors.primary600.value})})]})]})},hW=e=>(Fd(e.onClose),Pd(e.onClose),(0,i.jsxs)(Na,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a3")},children:(0,i.jsx)(yr,{color:"gray800",css:{flex:"1"},children:"A3 (420 x 297 mm)"})}),(0,i.jsx)(Na,{align:"center",css:{cursor:"pointer",py:"$2"},gap:"2",onClick:()=>{e.onExport("a4")},children:(0,i.jsx)(yr,{color:"gray800",css:{flex:"1"},children:"A4 (297 x 210 mm)"})})]})),mW=e=>(0,i.jsxs)(Na,{align:"center",css:{cursor:"pointer",py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",onClick:e.onClick,children:[(0,i.jsx)(yr,{css:{borderRadius:"$1",height:"32px",overflow:"hidden",width:"32"},children:(0,i.jsx)("img",{alt:"Layer",height:"32px",src:e.imageSrc,width:"32px"})}),(0,i.jsx)(yr,{css:{flex:"1"},children:e.name}),e.isSelected&&(0,i.jsx)(Na,{align:"center",css:{fontSize:"$textMd"},justify:"center",children:(0,i.jsx)(el,{icon:"circle-check",iconStyle:"duotone",primaryColor:"white",secondaryColor:fr.colors.primary600.value})})]}),gW=e=>{const t=Yn();return Fd(e.onClose),Pd(e.onClose),(0,i.jsxs)(Na,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"180px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[(0,i.jsx)(mW,{imageSrc:gd.Maps.GooglePlan,isSelected:e.selectedLayer===et.Google,name:"Plan",onClick:()=>{e.onChange(et.Google)}}),(0,i.jsx)(mW,{imageSrc:gd.Maps.GoogleSatellite,isSelected:e.selectedLayer===et.GoogleSatellite,name:t("satellite_82253"),onClick:()=>{e.onChange(et.GoogleSatellite)}}),(0,i.jsx)(mW,{imageSrc:gd.Maps.IgnPlan,isSelected:e.selectedLayer===et.IgnPlan,name:"IGN Plan",onClick:()=>{e.onChange(et.IgnPlan)}})]})},pW=e=>(0,i.jsxs)(Na,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",height:"48px",minWidth:"180px",padding:"$2 $3",userSelect:"none"},gap:"3",onClick:t=>{Rl(t),e.onClick()},children:[e.children,(0,i.jsx)(yr,{color:"gray700",children:e.isOpen?(0,i.jsx)(el,{icon:"chevron-up"}):(0,i.jsx)(el,{icon:"chevron-down"})})]});let fW=class extends Ul{constructor(e){super(e)}traceInputDefault(e){return{name:e?.name??"",color:e?.color??fr.colors.primary700.value,points:e?.points??[],direction:e?.direction??St.None}}traceInputSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_trac_39859")),color:d.Yj().required(this.t("la_couleur_du_t_36646")),points:d.YO().required(this.t("le_trac_doit_c_20895")).min(2,this.t("le_trac_doit_c_20895"))})}createTraceSchema(){return d.Ik().shape({trace:this.traceInputSchema()})}updateNameSchema(){return d.Ik().shape({name:d.Yj().required(this.t("le_nom_du_trac_39859"))})}};function xW(e){const t=e.replace(/<\?xml(.*)\?>/,""),n=(new DOMParser).parseFromString(t,"text/xml");if(0!==n.querySelectorAll("parsererror").length)throw new Error("Could not parse: "+e);return n}fW=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],fW);const _W=e=>{const t=parseFloat(e.getAttribute("lat")),n=parseFloat(e.getAttribute("lon"));return isNaN(t)||isNaN(n)?[]:[[t,n]]},IW=e=>{const t=Yn(),n=qn(fW),s=qn(Ba),[o,r]=(0,L.useState)({name:e.trace?`${h(e.trace.name)}.gpx`:"",content:""}),{mutate:a,isLoading:l}=function(e={}){return Xn("mutation TraceCreate($eventId: EventId!, $trace: TraceInput!) {\n traceCreate(eventId: $eventId, trace: $trace) {\n id\n }\n}\n",e)}(),{mutate:d,isLoading:c}=function(e={}){return Xn("mutation TraceUpdate($eventId: EventId!, $traceId: TraceId!, $trace: TraceInput!) {\n traceUpdate(eventId: $eventId, traceId: $traceId, trace: $trace) {\n id\n }\n}\n",e)}();return(0,i.jsx)(Cl,{hideDefaultErrors:!0,initialValues:{trace:n.traceInputDefault(e.trace)},render:({form:n,handleSubmit:s})=>(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yr,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(el,{icon:"route"})}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("ajouter_un_trac_05425")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(vl,{}),(0,i.jsx)(Ll,{label:t("nom_du_trac_16379"),name:"trace.name",placeholder:t("nom_du_trac_16379")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(WB,{accept:Rv.Gpx,format:"string",label:t("fichier_gpx_55484"),placeholder:t("s_lectionnez_un_17918"),value:o,onChange:e=>{r(e),n.change("trace.points",function(e){const t=xW(e),n=Array.from(t.querySelectorAll("trk trkseg trkpt")),i=Array.from(t.querySelectorAll("wpt")),s=Array.from(t.querySelectorAll("rte rtept"));return n.length>0?n.flatMap(_W):i.length>0?i.flatMap(_W):s.flatMap(_W)}(e.content))}}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(Lj,{label:t("couleur_du_trac_28854"),name:"trace.color"}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Hj,{label:t("sens_du_trac_49290"),name:"trace.direction",children:[(0,i.jsx)("option",{value:St.None,children:t("aucun_93456")}),(0,i.jsx)("option",{value:St.Forward,children:t("en_avant_17614")}),(0,i.jsx)("option",{value:St.Backward,children:t("en_arri_re_24636")})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{isLoading:l||c,onClick:s,children:e.traceId?t("mettre_jour_85141"):t("ajouter_97327")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]}),validate:s.validateForForm(n.createTraceSchema()),onSubmit:async t=>{e.traceId?await d({eventId:e.eventId,traceId:e.traceId,trace:t.trace}):await a({eventId:e.eventId,trace:t.trace}),e.onClose(),e.reload()}})},vW=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation TraceDelete($eventId: EventId!, $traceId: TraceId!) {\n traceDelete(eventId: $eventId, traceId: $traceId) {\n id\n }\n}\n",e)}(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(!1);return(0,i.jsxs)(Na,{align:"center",css:{py:"$2","&:not(:last-child)":{borderBottom:"1px solid $gray200"}},gap:"2",children:[(0,i.jsx)(yr,{css:{background:e.trace.color,borderRadius:"$1",height:"16px",width:"16px"}}),(0,i.jsx)(yr,{color:"gray900",css:{flex:"1",ellipsis:!0},children:e.trace.name}),(0,i.jsx)(yr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{e.toggleVisible(e.trace.id)},children:(0,i.jsx)(el,{icon:e.isHidden?"eye-slash":"eye"})}),(0,i.jsx)(yr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{a(!0)},children:(0,i.jsx)(el,{icon:"pen"})}),(0,i.jsx)(yr,{color:"gray700",css:{cursor:"pointer"},onClick:()=>{o(!0)},children:(0,i.jsx)(el,{icon:"xmark"})}),s&&(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_34035"),text:t("suppression_de_73669",e.trace.name),onClose:()=>{o(!1)},onDelete:async()=>{await n({eventId:e.eventId,traceId:e.trace.id}),e.reload()}}),r&&(0,i.jsx)(IW,{eventId:e.eventId,reload:e.reload,trace:e.trace,traceId:e.trace.id,onClose:()=>{a(!1)}})]})},bW=e=>{const t=Yn();return Fd(e.onClose),Pd(e.onClose),(0,i.jsxs)(Na,{css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$1 $3",width:"240px"},direction:"column",onClick:e=>{e.nativeEvent.stopImmediatePropagation()},children:[e.traces.map(t=>(0,i.jsx)(vW,{eventId:e.eventId,isHidden:e.hiddenTracesIds.includes(t.id),reload:e.reload,toggleVisible:e.toggleVisible,trace:t},t.id)),(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer",py:"$2"},onClick:()=>{e.onAddTrace(),e.onClose()},children:t("ajouter_un_trac_05425")})]})},jW=e=>{const{translate:t,params:{eventId:n}}=_l(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(!1),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1),[h,m]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{bottom:"12px",left:"12px",position:"absolute",zIndex:10},gap:"2",children:[(0,i.jsx)(Na,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$md",cursor:"pointer",fontSize:"$textLg"},height:48,justify:"center",width:48,onClick:()=>{e.onFullscreen()},children:(0,i.jsx)(el,{icon:"expand"})}),(0,i.jsxs)(pW,{isOpen:s,onClick:()=>{o(e=>!e),a(()=>!1),d(()=>!1),u(()=>!1)},children:[(0,i.jsx)(yr,{css:{borderRadius:"$1",height:"32px",overflow:"hidden",width:"32px"},children:(0,i.jsx)("img",{alt:"Layer",height:"32px",src:e.layer===et.Google?gd.Maps.GooglePlan:e.layer===et.GoogleSatellite?gd.Maps.GoogleSatellite:gd.Maps.IgnPlan,width:"32px"})}),(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},children:e.layer===et.Google?"Plan":e.layer===et.GoogleSatellite?t("satellite_82253"):"IGN Plan"})]}),(0,i.jsx)(pW,{isOpen:r,onClick:()=>{o(()=>!1),a(e=>!e),d(()=>!1),u(()=>!1)},children:(0,i.jsxs)(Na,{align:"center",css:{flex:"1"},gap:"1",children:[(0,i.jsx)(yr,{color:"gray900",children:t("trac_s_41454")}),(0,i.jsx)(qa,{width:"1"}),e.traces.map(e=>(0,i.jsx)(yr,{css:{background:e.color,borderRadius:"$1",height:"16px",width:"16px"}},e.id))]})}),e.showAcronymIcon&&(0,i.jsx)(pW,{isOpen:l,onClick:()=>{o(()=>!1),a(()=>!1),d(e=>!e),u(()=>!1)},children:(0,i.jsxs)(Na,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(yr,{fontSize:"textMd",children:(0,i.jsx)(el,{icon:"acronym"===e.acronymIcon?"text":"location-dot"})}),(0,i.jsx)(yr,{color:"gray900",children:"acronym"===e.acronymIcon?t("acronymes_11499"):t("ic_nes_16022")})]})}),e.showExport&&(0,i.jsx)(pW,{isOpen:c,onClick:()=>{o(()=>!1),a(()=>!1),d(()=>!1),u(e=>!e)},children:(0,i.jsxs)(Na,{align:"center",css:{flex:"1"},gap:"2",children:[(0,i.jsx)(yr,{fontSize:"textMd",children:(0,i.jsx)(el,{icon:"file-export"})}),(0,i.jsx)(yr,{color:"gray900",children:t("exporter_59120")})]})})]}),s&&(0,i.jsx)(yr,{css:{bottom:"64px",left:"68px",position:"absolute",zIndex:10},children:(0,i.jsx)(gW,{selectedLayer:e.layer,onChange:e.setLayer,onClose:()=>o(!1)})}),r&&(0,i.jsx)(yr,{css:{bottom:"64px",left:"256px",position:"absolute",zIndex:10},children:(0,i.jsx)(bW,{eventId:n,hiddenTracesIds:e.hiddenTracesIds,reload:e.reload,toggleVisible:t=>{e.setHiddenTracesIds(oo(e.hiddenTracesIds,t))},traces:e.traces,onAddTrace:()=>{m(!0)},onClose:()=>{a(!1)}})}),h&&(0,i.jsx)(IW,{eventId:n,reload:e.reload,onClose:()=>{m(!1)}}),l&&(0,i.jsx)(yr,{css:{bottom:"64px",left:"444px",position:"absolute",zIndex:10},children:(0,i.jsx)(uW,{selectedAcronymIcon:e.acronymIcon,onChange:e.setAcronymIcon,onClose:()=>d(!1)})}),c&&(0,i.jsx)(yr,{css:{bottom:"64px",left:"632px",position:"absolute",zIndex:10},children:(0,i.jsx)(hW,{onClose:()=>u(!1),onExport:e.onExport})})]})},CW=e=>{const{organizationId:t,eventId:n}=Jn(),s=qn(hh);return(0,i.jsx)(Na,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:70,children:(0,i.jsxs)(Ja,{to:ps.POSITION({organizationId:t,eventId:n,positionId:e.position.id}),children:[(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{color:"gray800",children:e.position.name}),(0,i.jsx)(yr,{color:"gray500",fontSize:"textXs",children:e.position.range?s.toDisplayString(e.position.range):"-"})]}),(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"chevron-right"})})]})})},yW=e=>{const{translate:t,params:{eventId:n,segmentId:s}}=_l(),{isEventAdmin:o,localEvent:r,updateLocalEvent:a}=vb(),{mutate:l}=Ao(),{setNewPositionLatLng:d}=FU(),[c,u]=(0,L.useState)(e.layer),[h,m]=(0,L.useState)([]),[g,p]=(0,L.useState)(null),[f,x]=xz("positionsMap.center",e.center),[_,I]=xz("positionsMap.zoom",Or),[v,b]=xz("positionsMap.acronymIcon","icon"),[j,C]=(0,L.useState)(r?.isPositionsMapAlertVisible??!0),y=(0,L.useRef)(null),k=(0,L.useCallback)(e=>{const t=f?`${f.lat},${f.lng}`:"",i=new URLSearchParams;i.set("format",e),i.set("hiddenTracesIds",h.join(",")),i.set("center",t),i.set("acronymIcon",v),i.set("zoom",_.toString(10)),window.open(`${P.HEAVENT_API_URL}/image/event/${n}/positions/${s}/map.png?${i.toString()}`)},[f,_,h,v]);return(0,i.jsxs)(Na,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[o&&j&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sl,{leftIcon:"circle-exclamation",rightIcon:"xmark",rightIconClick:async()=>{await a({isPositionsMapAlertVisible:!1}),C(!1)},children:t("pour_cr_er_une_11133")}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(yr,{ref:y,css:{flex:"1",borderRadius:"$1"},width:1,children:(0,i.jsx)(cW,{acronymIcon:v,hiddenTracesIds:h,initialCenter:f,initialZoom:_,layer:c,positions:e.positions,showMarker:o,traces:e.traces,onMapCenterChanged:x,onMapDrag:()=>p(null),onMapZoomchanged:e=>{p(null),I(e)},onMarkerDragEnd:(e,t)=>d({latitude:e,longitude:t}),onPositionClick:(e,t)=>p({position:e,left:t.x,top:t.y})})}),o&&(0,i.jsx)(jW,{acronymIcon:v,hiddenTracesIds:h,layer:c,reload:e.reload,setAcronymIcon:b,setHiddenTracesIds:m,setLayer:async e=>{u(e),await l({eventId:n,layer:e})},showAcronymIcon:!0,showExport:!0,traces:e.traces,onExport:k,onFullscreen:()=>{y.current?.requestFullscreen()}}),y.current&&g&&(0,Ht.createPortal)((0,i.jsx)(yr,{css:{left:`${g.left+32}px`,position:"absolute",top:g.top-35-16+"px",zIndex:10},children:(0,i.jsx)(CW,{position:g.position})}),y.current)]})},kW=e=>{const{eventId:t}=Jn(),{data:n,loader:s,reload:o}=xa({eventId:t,includeCheckedInRate:!1,includeConditions:!1,includeCreatedBy:!1,includeLeaders:!1,includeTags:!1,includeTraces:!0,name:m(e.name)?e.name:null,predicates:e.predicates,hasCoordinates:!0});return s?(0,i.jsx)(Na,{css:{flex:"1"},children:s}):(0,i.jsx)(yW,{center:F_(n.data),layer:n.data.layer,positions:n.data.rows.nodes,reload:o,traces:n.data.traces||[]})};var AW=n(6965);const wW=e=>{const t=L.useMemo(()=>e.startOfDay.plus({day:1}).minus({second:1}),[e.startOfDay]),n=L.useMemo(()=>Us.IX.fromDateTimes(e.startOfDay,t).overlaps(e.slot.range),[e.startOfDay,t,e.slot]),s=L.useMemo(()=>n?Us.IX.fromDateTimes(Us.c9.max(e.startOfDay,e.slot.range.start),Us.c9.min(t,e.slot.range.end)):e.slot.range,[n,e.startOfDay,t,e.slot]),o=L.useMemo(()=>{const t=s.start.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.startOfDay,s]),r=L.useMemo(()=>{const t=s.end.diff(e.startOfDay).shiftTo("hours","minutes");return Math.floor(1+60*t.hours+t.minutes)},[e.startOfDay,s]);return n?(0,i.jsx)(Na,{css:{gridColumnStart:o,gridColumnEnd:r},height:32,children:e.renderSlot(e.slot,e.row)},s.toISO()):null},SW=e=>{const[t,n]=L.useState(null),s=L.useCallback(e=>{e&&n(e.getBoundingClientRect())},[]),[o,r]=L.useState(!1),[a,l]=L.useState(1),d=L.useMemo(()=>e.date.startOf("day").set({hour:e.startHour}),[e.date,e.startHour]),c=L.useCallback(e=>{const n=Math.floor(1440*(e.clientX-(t?.left??0))/(t?.width??0)),i=n-n%60+1;i!==a&&l(i)},[t,a,l]),u=L.useCallback(n=>{const i=Math.floor(1440*(n.clientX-(t?.left??0))/(t?.width??0)),s=i-i%60,o=d.plus({minute:s});e.onPlus?.(o,e.row)},[d,e.row,e.onPlus,t]);return(0,i.jsxs)(Na,{className:"h-planning-data-row",css:{borderBottom:"1px solid $gray200"},width:1,children:[(0,i.jsx)(Na,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"},children:e.renderLeftCell(e.row)}),(0,i.jsxs)(Na,{css:{flex:"1",py:"$3",position:"relative"},children:[(0,i.jsx)(cd,{ref:s,css:{cursor:e.showPlus?"pointer":"inherit",gridAutoFlow:"column",overflow:"hidden",rowGap:"$2",zIndex:10},gridtemplatecolumns:"repeat(1440, 1fr)",width:1,onClick:e.showPlus?u:void 0,onMouseMove:e.showPlus?c:void 0,onMouseOut:()=>{r(!1)},onMouseOver:()=>{r(!0)},children:e.row.slots.map((t,n)=>(0,i.jsx)(wW,{renderSlot:e.renderSlot,row:e.row,slot:t,startOfDay:d},n))}),e.showPlus&&(0,i.jsx)(cd,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:5},gridtemplatecolumns:"repeat(1440, 1fr)",children:o&&(0,i.jsx)(Na,{align:"center",css:{gridColumn:`${a} / span 60`,padding:"$1"},height:1,justify:"center",children:(0,i.jsx)(Na,{align:"center",css:{background:"$gray100",borderRadius:"$1",color:"$gray800",cursor:"pointer",fontSize:"$textMd"},height:1,justify:"center",width:1,children:(0,i.jsx)(el,{icon:"plus"})})})}),(0,i.jsx)(cd,{css:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1},gridtemplatecolumns:"repeat(1440, 1fr)",children:(0,Oc.A)(0,23).map(e=>(0,i.jsx)(yr,{css:{borderRightColor:"$gray200",borderRightStyle:"dashed",borderRightWidth:"1px",gridColumn:`${60*e+1} / ${60*e+61}`}},e))})]})]})},EW=e=>{const t=qn(Kc),n=e.date.startOf("day").equals(e.minDate.startOf("day")),s=e.date.endOf("day").equals(e.maxDate.endOf("day"));return(0,i.jsxs)(Na,{css:{border:"1px solid $gray200",...e.css},direction:"column",width:1,children:[(0,i.jsxs)(Na,{css:{borderBottom:"1px solid $gray200"},height:52,width:1,children:[(0,i.jsxs)(Na,{align:"center",css:{borderRight:"1px solid $gray200",px:"$4",width:"calc(2 * $cellWidth)"},gap:"3",height:1,children:[(0,i.jsx)(Du,{max:e.maxDate,min:e.minDate,value:e.date,onChange:e.onChange}),e.renderFilters?.()]}),(0,i.jsxs)(Na,{align:"center",css:{flex:"1",px:"$2"},gap:"3",children:[(0,i.jsx)(El,{color:"white",disabled:n,leftIcon:"chevron-left",onClick:()=>{e.onChange(e.date.minus({day:1}))}}),(0,i.jsx)(yr,{css:{flex:"1",textTransform:"capitalize"},font:"gray800 textSm medium",textAlign:"center",children:t.toLocaleString(e.date,Js.DateOnly.WeekdayLongMonthLong)}),(0,i.jsx)(El,{color:"white",disabled:s,leftIcon:"chevron-right",onClick:()=>{e.onChange(e.date.plus({day:1}))}})]})]}),(0,i.jsxs)(Na,{css:{background:"$gray50",borderBottom:"1px solid $gray200"},height:24,width:1,children:[(0,i.jsx)(Na,{css:{borderRight:"1px solid $gray200",width:"calc(2 * $cellWidth)"}}),(0,i.jsx)(Na,{css:{flex:"1"},children:(0,i.jsxs)(cd,{gridtemplatecolumns:"repeat(1440, 1fr)",height:1,width:1,children:[(0,i.jsx)(yr,{css:{gridColumn:"span 60"}}),(0,Oc.A)(e.startHour+2,e.startHour+24,2).map(e=>(0,i.jsxs)(Na,{align:"center",css:{fontSize:"$textXs",gridColumn:"span 120"},justify:"center",children:[(0,AW.A)((e>=24?e-24:e).toString(10),2,"0"),":00"]},e))]})})]}),e.data.map(t=>(0,i.jsx)(SW,{date:e.date,renderLeftCell:e.renderLeftCell,renderSlot:e.renderSlot,row:t,showPlus:e.showPlus,startHour:e.startHour,onPlus:e.onPlus},t.id.toString(10)))]})},TW=e=>{const{params:{organizationId:t,eventId:n}}=_l();return(0,i.jsxs)(Na,{css:{padding:"$1 $4"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(qc,{css:{overflow:"hidden",width:"100%"},to:ps.POSITION({organizationId:t,eventId:n,positionId:e.position.id}),children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.position.name,width:1,children:e.position.name})}),(0,i.jsx)(yr,{color:"gray500",css:{ellipsis:!0},title:e.position.category.name,width:1,children:e.position.category.name})]})},zW=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),o=qn(hh),r="number"==typeof e.slot.assignedResources&&"number"==typeof e.slot.fillingRate&&"number"==typeof e.slot.resources;return(0,i.jsxs)(Na,{direction:"column",width:1,children:[(0,i.jsxs)(Na,{css:{borderBottom:"1px solid $gray200",padding:"$4 $3 $3 $6"},gap:"4",children:[(0,i.jsx)(FC,{color:e.position.color,icon:e.position.icon}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(qc,{to:ps.POSITION({organizationId:n,eventId:s,positionId:e.position.id}),children:(0,i.jsx)(yr,{css:{ellipsis:!0},width:1,children:e.position.name})}),(0,i.jsx)(yr,{color:"gray500",children:e.category.name})]})]}),(0,i.jsxs)(Na,{css:{padding:"$5 $6 $4 $6"},direction:"column",gap:"6",children:[(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray500",children:t("nom_du_cr_neau_54351")}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:m(e.slot.name)?e.slot.name:"-"})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsx)(yr,{color:"gray500",children:t("cr_neau_horaire_28150")}),(0,i.jsx)(yr,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:o.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}})})]}),r&&(0,i.jsxs)(Na,{direction:"column",gap:"1",children:[(0,i.jsxs)(Na,{justify:"between",children:[(0,i.jsx)(yr,{color:"gray500",children:t("membres_11310")}),(0,i.jsxs)(yr,{color:"gray500",children:[e.slot.assignedResources,"/",e.slot.resources]})]}),(0,i.jsx)(yr,{css:{textTransform:"capitalize"},font:"gray800 textSm medium",children:(0,i.jsx)(Aw,{percent:e.slot.fillingRate/100})})]})]}),(0,i.jsx)(Na,{css:{padding:"$4"},gap:"4",justify:"end",children:(0,i.jsx)(El,{to:$s.POSITION_SLOT_ASSIGN_VOLUNTEERS(n,s,e.position.id,e.slot.id),children:t("affecter_sur_le_19590")})})]})},OW=e=>{const t=vh(qn(hh),e.slot,"",{interval:{options:{hideDate:!0}},slot:{includeRange:!0}});return(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(Na,{align:"center",css:{background:kw(e.slot.fillingRate/100),borderRadius:"$1",cursor:"pointer",px:"$2",userSelect:"none"},height:1,width:1,children:(0,i.jsx)(yr,{css:{ellipsis:!0},font:"white textXs medium",title:t,width:1,children:t})})}),(0,i.jsx)(qd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(zW,{category:e.position.category,position:e.position,slot:e.slot})})]})},RW=e=>{const{params:{eventId:t}}=_l(),n=qn(fU),{infos:s,isEditMode:o,limit:r,nameDebounced:a,offset:l,predicates:d,setInfos:c,setLimit:u,setOffset:h}=gy(),{mutate:g}=function(e={}){return Xn("mutation PositionSlotCreate(\n $eventId: EventId!\n $positionId: PositionId!\n $positionSlot: PositionsSlotInput!\n) {\n positionSlotCreate(eventId: $eventId, positionId: $positionId, positionSlot: $positionSlot) {\n id\n }\n}\n",e)}(),{data:p,loader:f}=Zn("query PositionsPlanning(\n $eventId: EventId!\n $name: String\n $predicates: [Predicate!]\n $limit: Int\n $offset: Int\n) {\n data: event(id: $eventId) {\n rows: positions(name: $name, predicates: $predicates, limit: $limit, offset: $offset) {\n nodes {\n ...PositionPlanning\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,name:m(a)?a:void 0,predicates:d,limit:r,offset:l},[Ls.PositionPlanningFragment]);const{numberOfPages:x,totalCount:_}=ku(p.data?.rows),[I,v]=(0,L.useState)([]),b=(0,L.useMemo)(()=>Us.c9.isDateTime(s.positionsPlanningStartAt)&&s.positionsPlanningStartAt?.isValid?s.positionsPlanningStartAt:Us.c9.fromISO(s.positionsPlanningStartAt)?.isValid?Us.c9.fromISO(s.positionsPlanningStartAt,{zone:"utc"}):Us.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Us.c9.utc())?Us.c9.utc():e.startAt,[e.startAt,e.endAt,s]),j=(0,L.useCallback)(t=>{c({...s,positionsPlanningStartAt:t?.toISO()??e.startAt.toISO()})},[e.startAt,s,c]),[C,y]=(0,L.useState)(!1),[k,A]=(0,L.useState)(e.startAt),[w,S]=(0,L.useState)(-1),E=(0,L.useMemo)(()=>{const t=Ih(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]),T=(0,L.useCallback)(async e=>{const{data:{row:n}}=await function(e,t){return ho("query PositionsPlanningPosition($eventId: EventId!, $positionId: PositionId!) {\n data: event(id: $eventId) {\n row: position(id: $positionId) {\n ...PositionPlanning\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.PositionPlanningFragment]})}({eventId:t,positionId:e},await K());v(t=>t.map(t=>t.id===e?n:t))},[t]);return(0,L.useEffect)(()=>{v(p.data?.rows.nodes??[])},[p.data]),f||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Na,{css:{background:"white",flex:"1"},children:(0,i.jsx)(EW,{data:I,date:b,maxDate:e.endAt,minDate:e.startAt,renderLeftCell:e=>(0,i.jsx)(TW,{position:e}),renderSlot:(e,t)=>(0,i.jsx)(OW,{position:t,slot:e}),showPlus:o,startHour:E,onChange:j,onPlus:(e,t)=>{A(e),y(!0),S(t.id)}})}),(0,i.jsx)(Pc,{children:(0,i.jsx)($c,{limit:r,numberOfPages:x,offset:l,setLimit:u,setOffset:h,showLimits:!0,totalCount:_})})]}),C&&(0,i.jsx)(jU,{event:{endAt:e.endAt,startAt:e.startAt},slot:n.positionsSlotInputDefault(k),onClose:()=>{y(!1)},onSuccess:async e=>(await g({eventId:t,positionId:w,positionSlot:e}),T(w))})]})};function $W(e,t,n,i){const s=xW(e),o=(e=>Object.fromEntries(Array.from(e.querySelectorAll("Style")).map(e=>{const t=e.getAttribute("id"),[,,n,i,s,o,r,a]=(e.querySelector("color")?.textContent||"").trim().split("");return[`#${t}`,`#${r}${a}${s}${o}${n}${i}`]})))(s);return Array.from(s.querySelectorAll("Placemark")).map(e=>((e,t,n,i,s)=>{const[o,r]=(e.querySelector("Point coordinates")?.textContent||"").trim().split(",");return{positionCategoryId:t,name:(e.querySelector("name")?.textContent||"").trim(),description:(e.querySelector("description")?.textContent||"").trim(),color:s[`${e.querySelector("styleUrl")?.textContent||""}-normal`]||fr.colors.primary700.value,icon:Ke.LocationDot,layer:n,latitude:parseFloat(r),longitude:parseFloat(o),tracesIds:[],slots:[{startDate:i,startTime:"08:00",endDate:i,endTime:"09:00",resources:1}],conditionsOperator:pe.And,positionsCustomFields:[],tagsIds:[],fields:{},leadersIds:[]}})(e,t,n,i,o))}const DW=e=>{const t=Yn(),{data:n,loader:s}=Zn("query KmlEventInfos($eventId: EventId!) {\n event(id: $eventId) {\n layer\n startAt\n\n positionsCategories {\n id\n name\n }\n }\n}\n",{eventId:e.eventId},[]);const{mutate:o,isLoading:r}=function(e={}){return Xn("mutation PositionsCreate($eventId: EventId!, $positions: [PositionInput!]!) {\n positionsCreate(eventId: $eventId, positions: $positions) {\n id\n }\n}\n",e)}(),[a,l]=(0,L.useState)(),[d,c]=(0,L.useState)(-1),u=m(a?.content)&&-1!==d;return(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yr,{color:"primary600",fontSize:"displayXs",textAlign:"center",children:(0,i.jsx)(el,{icon:"cloud-arrow-up"})}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",textAlign:"center",children:t("importer_des_mi_32264")}),(0,i.jsx)(qa,{height:"7"}),s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(WB,{accept:Rv.Kml,format:"string",label:t("fichier_kml_55657"),placeholder:t("s_lectionnez_un_75984"),value:a,onChange:e=>{l(e)}}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(zu,{label:t("cat_gorie_00291"),shouldParseAsInt:!0,value:d??-1,onChange:e=>{c(e)},children:[(0,i.jsx)("option",{disabled:!0,value:"-1",children:t("choisissez_la_c_72356")}),n.event.positionsCategories.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[(0,i.jsx)(El,{disabled:!u,isLoading:r,onClick:async()=>{a&&(await o({eventId:e.eventId,positions:$W(a.content,d,n.event.layer,n.event.startAt)}),window.location.reload())},children:t("importer_90688")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]})},PW=({name:e,numberOfCategories:t,segment:n})=>{const{history:s,params:{organizationId:o,eventId:r},translate:a}=_l(),{user:l}=si(),{hasFeature:d}=yI(),{hasPermission:c}=vb(),{newPositionLatLng:u}=FU(),{data:h,isLoading:m}=Zn("query PositionsHeader($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n key\n\n segment(id: $segmentId) {\n count\n\n links {\n positionsPlanningLink\n positionsVolunteersPlanningLink\n }\n\n stats {\n ... on PositionsSegmentStats {\n assignedResources\n resources\n }\n }\n }\n }\n}\n",{eventId:r,segmentId:n.id},[]);const[g,p]=(0,L.useState)(!1),[f,x]=(0,L.useState)(!1),[_,I]=(0,L.useState)(!1),[v,b]=(0,L.useState)(!1),j=c(Nb.POSITION_EDIT,{eventId:"ANY"}),C=c(Nb.POSITION_EDIT,{positionCategoryId:"ANY"}),y=(0,L.useMemo)(()=>{let e;return u&&(e=`${u.latitude},${u.longitude}`),$s.CREATE_POSITION(o,r,e)},[u]);return(0,i.jsxs)(r$,{name:(0,i.jsxs)(Na,{align:"center",css:{flex:"1",overflow:"hidden",position:"relative"},gap:"2",children:[(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray900 displaySm semiBold",title:e,children:e}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"gray500",children:(0,i.jsx)(el,{icon:"circle-exclamation"})})}),(0,i.jsxs)(Cm,{placement:"bottom-start",renderOnPortal:!0,children:[a("nombre_de_missi_06171",h.event?.segment.count??0),(0,i.jsx)("br",{}),a("nombre_de_membr_16367",h.event?.segment.stats?.assignedResources??0),(0,i.jsx)("br",{}),a("nombre_de_membr_29724",h.event?.segment.stats?.resources??0)]})]})]}),children:[j?(0,i.jsx)(KS,{menu:(0,i.jsxs)(i.Fragment,{children:[d(Ne.KmlImport)&&(0,i.jsx)(Gd,{color:0===t?"disabled":"default",icon:"file-import",onClick:()=>{p(!1),b(!0)},children:a("importer_des_mi_32264")}),(0,i.jsx)(Gd,{icon:"file-import",to:ps.POSITION_IMPORT_CSV({organizationId:o,eventId:r}),children:a("import_tasks_fr_52548")})]}),path:y,children:a("cr_er_une_missi_66818")}):C?(0,i.jsx)(El,{onClick:()=>{s.push(y)},children:a("cr_er_une_missi_66818")}):null,j&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Bd,{isOpen:g,onStateChange:p,children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"plus",onClick:()=>{p(!1),I(!0)},children:a("cr_er_une_cat_g_20051")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{icon:"calendar",to:ug(h.event?.segment.links.positionsPlanningLink,"html"),children:a("voir_le_plannin_85187")}),(0,i.jsx)(Gd,{icon:"calendar",to:ug(h.event?.segment.links.positionsVolunteersPlanningLink,"html"),children:a("voir_le_plannin_47650")}),(0,i.jsx)(Bb,{permissions:Nb.POSITION_EDIT,children:(0,i.jsx)(Gd,{icon:"plug-circle-bolt",onClick:e=>{Nd(e.target),x(!0)},children:a("exporter_via_l_09843")})}),(0,i.jsx)(Gd,{download:`${n.name}-positions-planning`,icon:"arrow-down-to-bracket",to:ug(h.event?.segment.links.positionsPlanningLink,"pdf"),children:a("t_l_charger_le_06050")}),(0,i.jsx)(Gd,{download:`${n.name}-positions-volunteers-planning`,icon:"arrow-down-to-bracket",to:ug(h.event?.segment.links.positionsVolunteersPlanningLink,"pdf"),children:a("t_l_charger_le_02952")})]})]}),_&&(0,i.jsx)(_U,{eventId:r,onClose:()=>{I(!1)},onSuccess:({id:e})=>{s.push(ps.POSITION_CATEGORY({organizationId:o,eventId:r,positionCategoryId:e}))}}),v&&(0,i.jsx)(DW,{eventId:r,onClose:()=>{b(!1)}}),!m&&(0,i.jsx)(uD,{isOpen:f,link:cg({organizationId:o,eventId:r,lang:l?.language,pathComponent:"positions",key:h.event.key}),onClose:()=>{x(!1)}})]})]})},FW=e=>{const t=Yn(),n=ei(),{hasPermission:s,updateLocalEvent:o}=vb(),{limit:r,nameDebounced:a,predicates:l,rendering:d,segment:c}=gy(),u=s(Nb.SEGMENT_EDIT)&&(d===Lh.List||d===Lh.SlotsList),h=s(Nb.POSITION_EDIT,{eventId:"ANY"})&&(d===Lh.Calendar||d===Lh.List||d===Lh.SlotsList);return(0,L.useEffect)(()=>{o({positionBackPath:n.pathname,positionCategoryBackPath:n.pathname})},[c]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(PW,{name:c.name,numberOfCategories:e.event.positionsCategories.length,segment:c}),0===e.event.numberOfPositions&&d!==Lh.Map?(0,i.jsx)(ej,{css:{overflow:"hidden"},children:(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(Nk,{subtitle:t("plus_besoin_de_08254"),title:t("vous_n_avez_pas_08610")})})}):(0,i.jsxs)(ej,{children:[(0,i.jsx)(o$,{searchRow:(0,i.jsx)(i$,{actions:(0,i.jsx)(eW,{}),searchPlaceholder:t("rechercher_une_69998"),showActions:s(Nb.POSITION_EDIT),showEditColumns:u,showEditMode:h,showSearchColumns:s(Nb.SEGMENT_EDIT)}),selectSegment:(0,i.jsx)(A$,{pageSelectedText:t("les_1_mission_95719",r),segmentSelectedText:t("les_1_mission_38484",c.count,c.name)})}),d===Lh.List?(0,i.jsx)(lW,{customFields:e.customFields}):d===Lh.Map?(0,i.jsx)(kW,{name:a,predicates:l}):d==Lh.SlotsList?(0,i.jsx)(KU,{customFields:e.customFields}):(0,i.jsx)(RW,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt})]})]})},MW=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=_l(),{hasPermission:a,localEvent:l,updateLocalEvent:d}=vb(),c=qn(OU),u=(0,L.useMemo)(()=>c.getPositionsFilters(e.event,e.customFields),[e.event,e.customFields]),h=(0,L.useMemo)(()=>c.getPositionsPossibleColumns(e.customFields),[e.customFields]);return(0,i.jsx)(PU,{eventId:o,organizationId:s,children:(0,i.jsx)(e$,{canEditSegments:a(Nb.SEGMENT_EDIT),eventId:o,filters:u,filtersButtonText:n("filtrer_les_mis_43681"),filtersSubtitle:n("appliquer_des_f_16037"),getSegmentPath:e=>$s.POSITIONS_SEGMENT(s,o,e),hideSegments:0===e.event.numberOfPositions,initialLimit:l?.positionsLimit??Tc,initialSegmentsOpen:l?.arePositionsSegmentsOpen??!0,organizationId:s,possibleColumns:h,possibleRenderings:[Lh.List,Lh.Calendar,Lh.Map,Lh.SlotsList],reload:e.reload,segmentId:r,segmentType:vt.Positions,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{d({positionsLimit:e})},onSegmentClick:e=>{d({positionsSegmentId:e})},onSegmentDelete:async()=>{await d({positionsSegmentId:null}),t.push(ps.POSITIONS({organizationId:s,eventId:o}))},onSegmentsToggle:async e=>{await d({arePositionsSegmentsOpen:e})},children:(0,i.jsx)(FW,{customFields:e.customFields,event:e.event})})})},NW=(0,L.memo)(function(){const{params:{organizationId:e,eventId:t},translate:n}=_l(),{event:{name:s},localEvent:o}=vb();Dd(`${s} ${n("missions_63972")}`);const{data:r,loader:a,reload:l}=Zn("query PositionsSegments($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n customFields(variety: Position) {\n nodes {\n ...SegmentCustomField\n }\n }\n }\n\n event(id: $eventId) {\n id\n organizationId\n startAt\n endAt\n numberOfPositions\n dayStartTime\n\n positionsCategories {\n id\n name\n\n leaders {\n ...LeaderInfos\n }\n }\n\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{organizationId:e,eventId:t},[Ls.SegmentCustomFieldFragment,Ls.LeaderInfosFragment,Ls.SegmentsFoldersSegmentsFragment]),d=(0,L.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(MW,{customFields:r.organization.customFields.nodes,event:r.event,reload:l})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.POSITIONS_SEGMENT(e,t,o?.positionsSegmentId&&d.includes(o.positionsSegmentId)?o?.positionsSegmentId:d[0]),replace:!0})})]})}),LW=e=>{const{translate:t}=_l(),n=wc();return(0,i.jsx)(jw,{title:e.title,children:(0,i.jsxs)(Na,{align:"center",direction:"column",...n?{gap:"9"}:{gap:"7"},gap:"4",width:1,children:[(0,i.jsx)(ww,{count:e.category.assignedResources,total:e.category.resources}),(0,i.jsx)(ic,{leftIcon:"user",children:t("_1_membre_pr_32812",e.category.preassignedResources)})]})})},BW=({position:e})=>(0,i.jsx)(yr,{color:"gray800",css:{background:e.color,borderRadius:"20px",height:"20px",width:"20px"}}),VW=e=>{const{eventId:t,positionId:n}=Jn(),{mutate:s}=Ro(),o=(0,L.useRef)(null),[r,a]=(0,L.useState)(e.position.color),l=Lc(e=>s({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:rt.Color,strategy:tt.Replace,value:e}})),{hasPermission:d}=vb(),c=d(Nb.POSITION_EDIT,{positionCategoryId:e.position.positionCategoryId,positionId:e.position.id});return(0,i.jsx)(yr,{color:"gray800",css:{background:r,borderRadius:"20px",cursor:"pointer",height:"20px",width:"20px","& input":{background:"transparent",border:"none",borderRadius:"20px",cursor:"pointer",height:"20px",width:"20px","&::-webkit-color-swatch-wrapper":{padding:0},"&::-webkit-color-swatch":{borderRadius:"20px",border:"none"},"&::-moz-color-swatch":{border:"none"}}},onClick:()=>{c&&o.current?.click()},children:c&&(0,i.jsx)("input",{ref:o,type:"color",value:r,onChange:e=>{a(e.target.value),l(e.target.value)}})})},UW=({customFields:e,position:t})=>{const n=wc(),{params:{organizationId:s,eventId:o},translate:r}=_l(),a=qn(hh);return(0,i.jsx)(jw,{title:r("param_tres_78420"),children:(0,i.jsx)(Na,{direction:"column",gap:"4",width:1,children:(0,i.jsxs)(HF,{children:[(0,i.jsxs)(WF,{children:[(0,i.jsx)(LF,{children:r("cat_gorie_00291")}),(0,i.jsx)(VF,{children:n?(0,i.jsx)(i.Fragment,{children:t.positionCategoryName}):(0,i.jsx)(qc,{to:ps.POSITION_CATEGORY({organizationId:s,eventId:o,positionCategoryId:t.positionCategoryId}),children:t.positionCategoryName})})]}),(0,i.jsx)(MF,{direction:"horizontal"}),(0,i.jsxs)(WF,{children:[(0,i.jsx)(LF,{children:r("Color")}),(0,i.jsx)(VF,{children:n?(0,i.jsx)(BW,{position:t}):(0,i.jsx)(VW,{position:t})})]}),(0,i.jsx)(MF,{direction:"horizontal"}),(0,i.jsxs)(WF,{children:[(0,i.jsx)(LF,{children:r("ic_ne_55554")}),(0,i.jsx)(VF,{children:(0,i.jsx)(el,{icon:Qa(t.icon)})})]}),(0,i.jsx)(MF,{direction:"horizontal"}),(0,i.jsxs)(WF,{children:[(0,i.jsx)(LF,{children:r("Date")}),(0,i.jsx)(VF,{children:t.range?n?a.toLocaleString(t.range,void 0,{year:"numeric",month:"long",day:"numeric"}):a.toDisplayString(t.range):"-"})]}),e.map(e=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsxs)(Na,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(yr,{color:"gray500",css:{flex:"1"},children:e.name}),(0,i.jsx)(Na,{justify:"end",width:300,children:(0,i.jsx)(Iw,{field:e,fields:t.fields})})]})]},e.slug))]})})})},WW=e=>{const t=Yn(),{hasPermission:n}=vb(),s=n(Nb.MEMBER_ASSIGN,{positionCategoryId:e.positionSlot.positionCategoryId,positionId:e.positionSlot.positionId}),{mutate:o}=No(),{mutate:r}=Xo(),a=e.volunteerRegistration.positionSlotUserInfo;return(0,i.jsxs)(Hc,{children:[a.state===me.Waiting&&(0,i.jsx)(Gd,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:ge.CheckIn,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("pointer_1_57919",e.volunteerRegistration.userInfo.name)}),a.state===me.CheckedIn&&(0,i.jsx)(Gd,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:ge.CheckOut,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("d_pointer_1_08337",e.volunteerRegistration.userInfo.name)}),a.state===me.CheckedOut&&(0,i.jsx)(Gd,{icon:"clock",onClick:async()=>{await o({eventId:e.eventId,checkIn:{strategy:ge.Reset,positionsSlotsUsersInfosIds:[a.id]}}),e.reload()},children:t("remettre_z_ro_11572")}),s&&(0,i.jsx)(Gd,{color:"red",icon:"user-xmark",onClick:async()=>{await r({eventId:e.eventId,massAssign:{positionsSlotsIds:[e.positionSlot.id],selecteds:{ids:[e.volunteerRegistration.userInfo.id]},strategy:tt.Delete}}),e.reload()},children:t("d_saffecter_du_47122")})]})},GW=e=>{const{translate:t,params:{eventId:n}}=_l(),s=qn(Kc),o=qn(ep);return(0,i.jsxs)(Dc,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(uj,{userInfo:e.volunteerRegistration.userInfo})}),(0,i.jsx)(Ec,{children:e.volunteerRegistration.positionSlotUserInfo.state===me.CheckedOut?(0,i.jsx)(ic,{leftIcon:"clock",children:t("temps_total_79448",o.minutesToHoursMinutesString(e.volunteerRegistration.positionSlotUserInfo.timeDifferenceMinutes))}):e.volunteerRegistration.positionSlotUserInfo.state===me.CheckedIn?(0,i.jsx)(ic,{color:"success",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:t("point_le_1_63576",s.toLocaleString(e.volunteerRegistration.positionSlotUserInfo.checkInAt.toLocal(),Js.DateTime))}):(0,i.jsx)(ic,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",size:"sm",children:t("non_point_42145")})}),(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsx)(WW,{eventId:n,positionSlot:e.positionSlot,reload:e.reload,volunteerRegistration:e.volunteerRegistration})})]})},HW=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,positionId:o,positionSlotId:r}}=_l(),a=qn(hh),[l,d]=(0,L.useState)(0),[c,u]=(0,L.useState)({direction:jt.Asc,attribute:Pt.Name}),{data:h,isLoading:m,reload:g}=Zn("query PositionSlotVolunteers(\n $eventId: EventId!\n $positionSlotId: PositionsSlotId!\n $offset: Int\n $sort: VolunteersRegistrationsSort\n) {\n event(id: $eventId) {\n positionSlot(id: $positionSlotId) {\n id\n positionId\n positionCategoryId\n name\n range\n assignedResources\n resources\n }\n\n volunteersRegistrations(\n positionSlotId: $positionSlotId\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n id\n\n userInfo {\n id\n name\n email\n picture {\n url\n }\n }\n\n positionSlotUserInfo(positionSlotId: $positionSlotId) {\n id\n checkInAt\n checkOutAt\n state\n timeDifferenceMinutes\n }\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:s,positionSlotId:r,offset:l,sort:c},[]),{numberOfPages:p,totalCount:f}=ku(h.event?.volunteersRegistrations),x=(0,L.useMemo)(()=>h.event?.positionSlot?h.event.positionSlot.resources-h.event.positionSlot.assignedResources:0,[h.event?.positionSlot]),{hasPermissions:_}=vb(),[I]=m?[!1]:_([Nb.MEMBER_ASSIGN],{positionCategoryId:h.event.positionSlot.positionCategoryId,positionId:o});return(0,i.jsxs)(xu,{returnToFallback:ps.POSITION({organizationId:n,eventId:s,positionId:o}),size:"md",children:[(0,i.jsx)(yj,{children:(0,i.jsx)(Na,{direction:"column",gap:"1",width:1,children:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oc,{borderRadius:"$1",height:28,width:1}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{children:h.event.positionSlot.name||"-"}),(0,i.jsx)(yr,{font:"gray500 textSm regular",children:a.toDisplayString(h.event.positionSlot.range)})]})})}),(0,i.jsxs)(_u,{children:[(0,i.jsx)(qa,{height:"5"}),(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{children:t("liste_des_membr_89037")}),h.event?x>0?(0,i.jsx)(ic,{color:"warning",children:t("_1_membre_manq_31014",x)}):(0,i.jsx)(ic,{color:"success",children:t("complet_51600")}):null]}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsxs)(kc,{children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(_m,{attribute:Pt.Name,setSort:e=>{d(0),u(e)},sort:c,children:t("nom_08311")}),(0,i.jsx)(Vc,{children:t("status_06428")}),(0,i.jsx)(Vc,{width:100})]}),m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):h.event.volunteersRegistrations.nodes.map(e=>(0,i.jsx)(GW,{positionSlot:h.event.positionSlot,reload:g,volunteerRegistration:e},e.id)),(0,i.jsx)(Pc,{children:(0,i.jsx)($c,{numberOfPages:p,offset:l,setOffset:d,totalCount:f})})]}),(0,i.jsx)(qa,{height:"5"})]}),(0,i.jsx)(Iu,{children:(0,i.jsxs)(Na,{gap:"3",justify:"end",children:[I&&(0,i.jsx)(El,{onClick:()=>{e.push($s.POSITION_SLOT_ASSIGN_VOLUNTEERS(n,s,o,r))},children:t("affecter_des_me_30349")}),(0,i.jsx)(El,{color:"white",onClick:()=>e.goBack(ps.POSITION_SLOT({organizationId:n,eventId:s,positionId:o,positionSlotId:r})),children:t("fermer_62479")})]})})]})},qW=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),r=qn(hh),{hasPermissions:a}=vb(),l=qn(fU),{mutate:d}=ja(),{mutate:c}=No(),{mutate:u}=function(e={}){return Xn("mutation PositionSlotDelete(\n $eventId: EventId!\n $positionId: PositionId!\n $positionSlotId: PositionsSlotId!\n) {\n positionSlotDelete(\n eventId: $eventId\n positionId: $positionId\n positionSlotId: $positionSlotId\n ) {\n id\n }\n}\n",e)}(),[h,g]=(0,L.useState)(!1),[p,f]=(0,L.useState)(!1),x=(0,L.useMemo)(()=>r.toDisplayString(e.slot.range,{formats:{displayWeekday:!0}}),[e.slot]),[_,I]=a([Nb.POSITION_EDIT,Nb.MEMBER_ASSIGN],{positionCategoryId:e.slot.positionCategoryId,positionId:e.slot.positionId});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Dc,{css:{cursor:"pointer"},onClick:()=>{t.push($s.POSITION_SLOT_MEMBERS(s,o,e.slot.positionId,e.slot.id))},children:[(0,i.jsx)(Ec,{align:"start",direction:"column",justify:"center",children:(0,i.jsx)(yr,{font:"gray900 textSm medium",children:m(e.slot.name)?e.slot.name:"-"})}),(0,i.jsx)(Ec,{css:{textTransform:"capitalize"},children:x}),(0,i.jsx)(Ec,{children:(0,i.jsx)(O$,{assignedResources:e.slot.assignedResources,resources:e.slot.resources})}),(0,i.jsx)(Yc,{justify:"end",children:(0,i.jsxs)(Hc,{children:[I&&(0,i.jsx)(Gd,{icon:"wand-magic-sparkles",to:$s.POSITION_SLOT_ASSIGN_VOLUNTEERS(s,o,e.slot.positionId,e.slot.id),children:n("affecter_des_me_30349")}),_&&(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{g(!0)},children:n("_diter_62574")}),_&&(0,i.jsx)(Gd,{color:e.slot.assignedResources>0?"disabled":"red",icon:"trash-can",onClick:()=>{f(!0)},children:n("supprimer_43083")}),(0,i.jsx)(Gd,{icon:"clock",onClick:async()=>{await c({eventId:o,checkIn:{strategy:ge.CheckIn,positionsSlotsIds:[e.slot.id]}})},children:n("pointer_les_mem_50347")}),(0,i.jsx)(Gd,{icon:"clock",onClick:async()=>{await c({eventId:o,checkIn:{strategy:ge.CheckOut,positionsSlotsIds:[e.slot.id]}})},children:n("d_pointer_les_m_17150")})]})})]}),h&&(0,i.jsx)(jU,{event:e.event,slot:l.positionsSlotInputDefault(e.event.startAt,e.slot),onClose:()=>{g(!1)},onSuccess:async t=>{await d({eventId:o,positionId:e.slot.positionId,positionSlotId:e.slot.id,positionSlot:t}),e.reload()}}),p&&(0,i.jsx)(sA,{buttonText:n("supprimer_43083"),subtext:[n("_tes_vous_s_r_d_48876")],text:n("suppression_de_73669",x),onClose:()=>{f(!1)},onDelete:async()=>{await u({eventId:o,positionId:e.slot.positionId,positionSlotId:e.slot.id}),e.reload()}})]})},YW=()=>{const{translate:e,params:{eventId:t,positionId:n}}=_l(),[s,o,r]=Bc(""),[a,l]=xz("position.slots.date",Us.c9.invalid("Invalid"),fm),[d,c]=(0,L.useState)(0),[u,h]=xz("position.slots.sort",null),{data:g,isLoading:p,reload:f}=Zn("query PositionSlots(\n $eventId: EventId!\n $positionId: PositionId!\n $name: String\n $date: Date\n $offset: Int\n $sort: PositionsSlotsSort\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positionsSlots(\n positionsIds: [$positionId]\n name: $name\n date: $date\n limit: 25\n offset: $offset\n sort: $sort\n ) {\n nodes {\n ...PositionPositionSlot\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,positionId:n,name:m(o)?o:void 0,date:a.isValid?a:void 0,offset:d,sort:u},[Ls.PositionPositionSlotFragment]);const{numberOfPages:x,totalCount:_}=ku(g.event?.positionsSlots),I=(0,L.useCallback)(e=>{h(e),c(0)},[h,c]);return(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:r})}),(0,i.jsx)(yr,{width:200,children:(0,i.jsx)(Du,{max:g.event?.endAt,min:g.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_m,{attribute:dt.Name,setSort:I,sort:u,children:e("nom_du_cr_neau_54351")}),(0,i.jsx)(_m,{attribute:dt.Range,setSort:I,sort:u,children:e("cr_neau_11117")}),(0,i.jsx)(Vc,{children:e("remplissage_75916")}),(0,i.jsx)(Vc,{width:100})]}),numberOfPages:x,offset:d,rows:p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:g.event.positionsSlots.nodes.map(e=>(0,i.jsx)(qW,{event:g.event,reload:f,slot:e},e.id))}),setOffset:c,title:e("liste_des_cr_ne_86148"),totalCount:_})},KW=()=>{const{params:{organizationId:e,eventId:t,positionId:n},translate:s}=_l(),{roles:o}=yI(),{hasPermission:r}=vb(),{data:a,loader:l,reload:d}=ba({organizationId:e,eventId:t,positionId:n}),{mutate:c}=la(),{mutate:u}=Ro(),h=r(Nb.POSITION_EDIT,{positionCategoryId:a.event?.position.positionCategoryId,positionId:n});return l||(0,i.jsxs)(ej,{children:[(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsx)(LW,{category:a.event.position,title:s("remplissage_de_52564")}),(0,i.jsx)(UW,{customFields:a.organization.customFields.nodes,position:a.event.position})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(YW,{}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsxs)(Na,{gap:"6",children:[(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(cS,{leaders:a.event.position.leaders,reload:d,roles:o.positionRoles,onSave:e=>c({eventId:t,massLeaders:{leaders:e,selecteds:{ids:[n]},strategy:tt.Replace}})}),(0,i.jsx)(ZF,{customFields:a.event.position.customFields}),(0,i.jsx)(Pw,{modalSubtitle:s("ajouter_des_tag_64526"),reload:d,tags:a.event.position.tags,...h?{associateTags:e=>u({eventId:t,massEdit:{reset:!1,selecteds:{ids:[n]},slug:rt.Tag,strategy:tt.Replace,value:e}})}:{}})]}),(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(zw,{description:a.event.position.description}),(0,i.jsx)(JF,{location:a.event.position}),(0,i.jsx)(Ow,{privateNote:a.event.position.privateNote})]})]}),(0,i.jsx)(Ar.qh,{path:$s.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(HW,{})})]})},ZW=e=>{const{params:{organizationId:t,eventId:n}}=_l(),s=qn(Hh),{isEventAdmin:o}=vb(),[r,a]=xz("positionMembers.columns",[Wh.Name,Wh.Positions]),[l,d]=xz("positionMembers.limit",Tc),[c,u]=xz("positionMembers.predicates",[]),[h,m]=xz("positionMembers.sort",null),{data:g}=er({organizationId:t,eventId:n,privacy:o?xe.All:xe.Public,loadForms:!1,loadSegments:!1}),p=(0,L.useMemo)(()=>g.organization?.customFields.nodes??[],[g.organization]),f=uy(p),x=(0,L.useMemo)(()=>g.event?s.getPositionMembersFilters(t,n,p,g.event):[],[n,p,g.event]),_=(0,L.useMemo)(()=>s.getPositionMembersPossibleColumns(p),[p]);return(0,i.jsx)(ej,{children:(0,i.jsx)(mm,{columns:r,columnsSearch:[],columnsToIncludes:Gh,eventId:n,filters:x,getMassActionId:e=>e.userInfo.id,limit:l,loadDataList:or,loadDataListParams:{includeCanRegistrationStateUpdate:!o,includeIsEditable:!o,positionCategoryId:e.positionCategoryId,positionId:e.positionId,preassignedPositionCategoryId:e.preassignedPositionCategoryId,preassignedPositionId:e.preassignedPositionId},loadRow:ir,loadRowParams:{includeCanRegistrationStateUpdate:!o,includeIsEditable:!o},organizationId:t,possibleColumns:_,predicates:c,renderActions:(e,t,n)=>(0,i.jsx)(wM,{massActions:e,predicates:null,showOnlyMassEdit:!0,totalNumberOfMembers:t,onMassEditSuccess:n}),rendering:Bh.List,setColumns:a,setLimit:d,setPredicates:u,setSort:m,showEditColumns:o,showEditMode:o,showFilters:o,showMassActions:o,showRowDropdown:!1,showRowEdit:!1,showSearchColumns:!1,sort:h,children:(0,i.jsx)(Am,{renderCell:(e,t,s)=>(0,i.jsx)(bk,{canAccredit:o,canAssign:o,canChangeDelegation:o,canClickMemberName:!0,column:e,customField:f.get(e.slug),eventId:n,reloadRow:s,row:t})})})})},XW=({position:e})=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),{user:r}=si(),{hasPermission:a}=vb(),l=a(Nb.POSITION_EDIT,{positionCategoryId:e.positionCategoryId}),d=tW(),[c,u]=(0,L.useState)(!1);return(0,i.jsxs)(tj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(bj,{returnPathFallback:ps.POSITIONS({organizationId:s,eventId:o})}),(0,i.jsxs)(yr,{css:{flex:"1"},font:"gray900 displayXs medium",children:[e.name," ",m(e.acronym)?`(${e.acronym})`:""]}),(0,i.jsx)(El,{color:"white",download:`${e.name}-position-sheet`,to:ug(e.links.positionSheetLink,"pdf",{lang:r?.language}),children:n("t_l_charger_la_16259")}),(0,i.jsx)(Bb,{permissions:Nb.POSITION_EDIT,scope:{positionCategoryId:e.positionCategoryId,positionId:e.id},children:(0,i.jsx)(El,{to:$s.EDIT_POSITION(s,o,e.id),children:n("_diter_la_missi_90442")})}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[l&&(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>await d(e.id),children:n("dupliquer_28256")}),(0,i.jsx)(Gd,{download:`${e.name}-position-planning`,icon:"arrow-down-to-bracket",target:"_blank",to:ug(e.links.positionPlanningLink,"pdf",{lang:r?.language}),children:n("t_l_charger_le_06050")}),l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:async()=>u(!0),children:n("supprimer_43083")})]})]})]}),c&&(0,i.jsx)(nW,{position:e,onClose:()=>u(!1),onSuccess:()=>t.replace(ps.POSITIONS({organizationId:s,eventId:o}))})]})},JW=e=>{const{params:{organizationId:t,eventId:n,positionId:s},translate:o}=_l();Dd(e.event.position.name);const r=e=>({organizationId:e?":organizationId":t,eventId:e?":eventId":n,positionId:e?":positionId":s});return(0,i.jsxs)(nj,{children:[(0,i.jsx)(XW,{position:e.event.position}),(0,i.jsxs)(rj,{css:{flex:"1"},children:[(0,i.jsxs)(sj,{css:{px:"$7"},children:[(0,i.jsx)(ij,{path:ps.POSITION_DASHBOARD(r(!1)),children:o("tableau_de_bord_24627")}),(0,i.jsx)(ij,{path:ps.POSITION_MEMBERS(r(!1)),children:o("membres_125561",e.event.volunteersRegistrations.totalCount)}),(0,i.jsx)(ij,{path:ps.POSITION_PREASSIGNED_MEMBERS(r(!1)),children:o("membres_pr_aff_93093",e.event.position.preassignedResources)})]}),(0,i.jsx)(oj,{path:[ps.POSITION_DASHBOARD(r(!0)),$s.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId")],children:(0,i.jsx)(KW,{})}),(0,i.jsx)(oj,{path:ps.POSITION_MEMBERS(r(!0)),children:(0,i.jsx)(ZW,{positionId:s})}),(0,i.jsx)(oj,{path:ps.POSITION_PREASSIGNED_MEMBERS(r(!0)),children:(0,i.jsx)(ZW,{preassignedPositionId:s})})]})]})},QW=()=>{const{params:{organizationId:e,eventId:t,positionId:n}}=_l(),{data:s,loader:o}=Zn("query Position($eventId: EventId!, $positionId: PositionId!) {\n event(id: $eventId) {\n position(id: $positionId) {\n id\n name\n acronym\n positionCategoryId\n assignedResources\n preassignedResources\n\n links {\n positionPlanningLink\n positionSheetLink\n }\n }\n\n volunteersRegistrations(positionId: $positionId) {\n totalCount\n }\n }\n}\n",{eventId:t,positionId:n},[]);return o||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:ps.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(ni,{path:ps.POSITION_DASHBOARD({organizationId:e,eventId:t,positionId:n}),replace:!0})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(JW,{event:s.event})})]})},eG=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation PositionCategoryDescriptionUpdate(\n $eventId: EventId!\n $positionCategoryId: PositionsCategoryId!\n $description: String!\n) {\n positionCategoryDescriptionUpdate(\n eventId: $eventId\n positionCategoryId: $positionCategoryId\n description: $description\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(Jj,{buttonText:t("mettre_jour_l_18158"),icon:"text",initialValues:{positionCategory:{description:e.positionCategory.description}},size:"md",subtitle:t("la_description_98866"),title:t("ajouter_une_des_10769"),onClose:e.onClose,onSubmit:async t=>{await n({eventId:e.eventId,positionCategoryId:e.positionCategory.id,description:t.positionCategory?.description??""}),e.reload(),e.onClose()},children:(0,i.jsx)(yr,{css:{overflow:"hidden auto"},width:1,children:(0,i.jsx)(Qv,{label:t("description_58935"),name:"positionCategory.description"})})})},tG=e=>{const t=Yn(),{hasPermission:n}=vb(),s=n(Nb.POSITION_EDIT,{positionCategoryId:e.category.id}),[o,r]=(0,L.useState)(!1),a=m(e.category.description);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(jw,{rightIcon:s?a?"pen":"plus":void 0,rightIconClick:()=>{r(!0)},title:t("description_58935"),children:a?(0,i.jsx)(xg,{text:e.category.description}):(0,i.jsx)(yr,{color:"gray500",textAlign:"center",width:1,children:t("aucune_descript_25737")})}),s&&o&&(0,i.jsx)(eG,{eventId:e.eventId,positionCategory:e.category,reload:e.reload,onClose:()=>{r(!1)}})]})},nG=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o}}=_l(),r=qn(hh),a=(0,L.useMemo)(()=>e.position.resources-e.position.assignedResources,[e.position]);return(0,i.jsxs)(Dc,{css:{cursor:"pointer"},onClick:()=>{t.push(ps.POSITION({organizationId:s,eventId:o,positionId:e.position.id}))},children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{font:"gray900 textSm medium",children:e.position.name})}),(0,i.jsx)(Ec,{children:(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{font:"gray900 textSm medium",children:e.position.range?r.toLocaleString(e.position.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"}),(0,i.jsx)(yr,{font:"gray500 textSm regular",children:n("creneau",e.position.numberOfSlots)})]})}),(0,i.jsx)(Ec,{children:a>0?(0,i.jsx)(ic,{color:"warning",children:n("_1_membre_manq_31014",a)}):(0,i.jsx)(ic,{color:"success",children:n("complet_51600")})}),(0,i.jsx)(Yc,{justify:"end",children:(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"eye",to:ps.POSITION({organizationId:s,eventId:o,positionId:e.position.id}),children:n("voir_la_mission_68087")}),(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{t.push($s.EDIT_POSITION(s,o,e.position.id))},children:n("_diter_la_missi_90442")})]})})]})},iG=()=>{const{translate:e,params:{eventId:t,positionCategoryId:n}}=_l(),[s,o,r]=Bc(""),[a,l]=(0,L.useState)(Us.c9.invalid("Invalid")),[d,c]=(0,L.useState)(0),{data:u,isLoading:h}=Zn("query PositionCategoryPositions(\n $eventId: EventId!\n $positionCategoryId: PositionsCategoryId!\n $name: String\n $date: Date\n $offset: Int\n) {\n event(id: $eventId) {\n startAt\n endAt\n\n positions(\n positionCategoriesIds: [$positionCategoryId]\n name: $name\n date: $date\n limit: 25\n offset: $offset\n ) {\n nodes {\n ...PositionCategoryPosition\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:t,positionCategoryId:n,name:m(o)?o:void 0,date:a.isValid?a:void 0,offset:d},[Ls.PositionCategoryPositionFragment]);const{numberOfPages:g,totalCount:p}=ku(u.event?.positions);return(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e("rechercher_un_c_70424"),value:s,onChange:r})}),(0,i.jsx)(yr,{width:200,children:(0,i.jsx)(Du,{max:u.event?.endAt,min:u.event?.startAt,value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("nom_de_la_missi_64605")}),(0,i.jsx)(Vc,{children:e("Date")}),(0,i.jsx)(Vc,{children:e("status_06428")})]}),numberOfPages:g,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:u.event.positions.nodes.map(e=>(0,i.jsx)(nG,{position:e},e.id))}),setOffset:c,title:e("liste_des_missi_40241"),totalCount:p})},sG=e=>{const{translate:t,params:{eventId:n,positionCategoryId:s}}=_l(),{roles:o}=yI(),r=qn(hh),{mutate:a}=function(e={}){return Xn("mutation PositionsCategoriesMassLeadersEdit($eventId: EventId!, $massLeaders: MassLeadersInput!) {\n positionsCategoriesMassLeadersAssign(eventId: $eventId, massLeaders: $massLeaders)\n}\n",e)}();return(0,i.jsx)(ej,{children:(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[(0,i.jsxs)(Na,{gap:"6",width:1,children:[(0,i.jsx)(sS,{iconColor:"primary",text:t("nombre_de_missi_56719"),value:e.positionCategory.numberOfPositions}),(0,i.jsx)(sS,{iconColor:"primary",text:t("number_of_membe_24698"),value:e.positionCategory.assignedResources}),(0,i.jsx)(sS,{iconColor:"primary",text:t("nombre_de_membr_74699"),value:e.positionCategory.preassignedResources}),(0,i.jsx)(sS,{iconColor:"primary",text:t("Date"),value:e.positionCategory.range?r.toLocaleString(e.positionCategory.range,void 0,{day:"numeric",month:"short",year:"numeric"}):"-"})]}),(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsxs)(Na,{direction:"column",gap:"6",width:470,children:[(0,i.jsx)(cS,{leaders:e.positionCategory.leaders,reload:e.reload,roles:o.positionRoles,onSave:e=>a({eventId:n,massLeaders:{leaders:e,selecteds:{ids:[s]},strategy:tt.Replace}})}),(0,i.jsx)(tG,{category:e.positionCategory,eventId:n,reload:e.reload})]}),(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(iG,{})})]})]})})},oG=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation PositionCategoryDelete($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDelete(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954"),t("cela_supprimera_30946")],text:t("suppression_de_73669",e.positionCategory.name),onClose:e.onClose,onDelete:async()=>{await n({eventId:e.eventId,positionCategoryId:e.positionCategory.id}),e.onSuccess()}})},rG=({category:e,reload:t})=>{const{translate:n,history:s,params:{organizationId:o,eventId:r}}=_l(),{isEventAdmin:a}=vb(),{mutate:l}=function(e={}){return Xn("mutation PositionCategoryDuplicate($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n positionCategoryDuplicate(eventId: $eventId, positionCategoryId: $positionCategoryId) {\n id\n }\n}\n",e)}(),[d,c]=(0,L.useState)(!1),[u,h]=(0,L.useState)(!1);return(0,i.jsxs)(tj,{align:"center",gap:"3",hideBorder:!0,children:[(0,i.jsx)(bj,{returnPathFallback:ps.POSITIONS({organizationId:o,eventId:r})}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 displayXs medium",children:e.name}),(0,i.jsxs)(Bb,{permissions:Nb.POSITION_EDIT,scope:{positionCategoryId:e.id},children:[(0,i.jsx)(El,{color:"white",onClick:()=>h(!0),children:n("_diter_62574")}),(0,i.jsx)(El,{onClick:()=>{s.push($s.CREATE_POSITION(o,r,e.id))},children:n("ajouter_une_mis_99800")})]}),a&&(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsx)(Gd,{icon:"copy",onClick:async()=>{const{positionCategoryDuplicate:{id:t}}=await l({eventId:r,positionCategoryId:e.id});s.push(ps.POSITION_CATEGORY({organizationId:o,eventId:r,positionCategoryId:t}))},children:n("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{c(!0)},children:n("supprimer_43083")})]})]}),u&&(0,i.jsx)(IU,{eventId:r,positionCategoryId:e.id,positionCategoryName:e.name,onClose:()=>{h(!1)},onSuccess:t}),d&&(0,i.jsx)(oG,{eventId:r,positionCategory:e,onClose:()=>{c(!1)},onSuccess:()=>{s.replace(ps.POSITIONS({organizationId:o,eventId:r}))}})]})},aG=({event:e,reload:t})=>{const{translate:n,params:{organizationId:s,eventId:o,positionCategoryId:r}}=_l(),a=ei(),{updateLocalEvent:l}=vb();Dd(e.positionCategory.name),(0,L.useEffect)(()=>{l({positionBackPath:a.pathname})},[]);const d=e=>({organizationId:e?":organizationId":s,eventId:e?":eventId":o,positionCategoryId:e?":positionCategoryId":r});return(0,i.jsxs)(nj,{children:[(0,i.jsx)(rG,{category:e.positionCategory,reload:t}),(0,i.jsxs)(rj,{css:{flex:"1"},children:[(0,i.jsxs)(sj,{css:{px:"$7"},children:[(0,i.jsx)(ij,{path:ps.POSITION_CATEGORY_DASHBOARD(d(!1)),children:n("tableau_de_bord_24627")}),(0,i.jsx)(ij,{path:ps.POSITION_CATEGORY_MEMBERS(d(!1)),children:n("membres_125561",e.volunteersRegistrations.totalCount)}),(0,i.jsx)(ij,{path:ps.POSITION_CATEGORY_PREASSIGNED_MEMBERS(d(!1)),children:n("membres_pr_aff_93093",e.positionCategory.preassignedResources)})]}),(0,i.jsx)(oj,{path:ps.POSITION_CATEGORY_DASHBOARD(d(!0)),children:(0,i.jsx)(sG,{positionCategory:e.positionCategory,reload:t})}),(0,i.jsx)(oj,{path:ps.POSITION_CATEGORY_MEMBERS(d(!0)),children:(0,i.jsx)(ZW,{positionCategoryId:r})}),(0,i.jsx)(oj,{path:ps.POSITION_CATEGORY_PREASSIGNED_MEMBERS(d(!0)),children:(0,i.jsx)(ZW,{preassignedPositionCategoryId:r})})]})]})},lG=()=>{const{params:{organizationId:e,eventId:t,positionCategoryId:n}}=_l(),{data:s,loader:o,reload:r}=Zn("query PositionCategory($eventId: EventId!, $positionCategoryId: PositionsCategoryId!) {\n event(id: $eventId) {\n positionCategory(id: $positionCategoryId) {\n id\n name\n description\n assignedResources\n preassignedResources\n numberOfPositions\n resources\n range\n\n leaders {\n ...LeaderInfos\n }\n }\n\n volunteersRegistrations(positionCategoryId: $positionCategoryId) {\n totalCount\n }\n }\n}\n",{eventId:t,positionCategoryId:n},[Ls.LeaderInfosFragment]);return o||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:ps.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(ni,{path:ps.POSITION_CATEGORY_DASHBOARD({organizationId:e,eventId:t,positionCategoryId:n}),replace:!0})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(aG,{event:s.event,reload:r})})]})},dG=e=>(0,i.jsx)(Pm,{category:e.popup.category,fallbackClosePath:e.closePath,heading:e.popup.title,children:(0,i.jsxs)(Na,{css:{overflow:"hidden"},direction:"column",height:1,width:1,children:[(0,i.jsx)(Na,{css:{background:"$gray50",flex:"1",overflow:"auto",py:"$9"},justify:"center",children:(0,i.jsx)(Na,{css:{height:"fit-content",overflow:"hidden"},direction:"column",width:1170,children:e.children})}),(0,i.jsx)(Na,{align:"center",css:{boxShadow:"0px -4px 8px -2px rgba(16, 24, 40, 0.1), 0px -2px 4px -2px rgba(16, 24, 40, 0.06)"},height:72,justify:"center",width:1,children:e.button})]})}),cG=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,positionId:o,positionSlotId:r}}=_l(),a=qn(Kc),[l,d]=xz("positionsSlotsAssignVolunteers.filterAvailabilities",!0),[c,u]=xz("positionsSlotsAssignVolunteers.filterPositions",!1),[h,g]=xz("positionsSlotsAssignVolunteers.applyConditions",!0),[p,f]=(0,L.useState)(null),{data:x,isLoading:_}=Zn("query AvailableVolunteersRegistrations(\n $eventId: EventId!\n $positionSlotId: PositionsSlotId!\n $filterAvailabilities: Boolean!\n $filterPositions: Boolean!\n $applyConditions: Boolean!\n $sort: VolunteersRegistrationsSort\n) {\n event(id: $eventId) {\n positionSlot(id: $positionSlotId) {\n positionName\n positionCategoryId\n nameOrRange\n\n availableVolunteersRegistrations(\n filterAvailabilities: $filterAvailabilities\n filterPositions: $filterPositions\n applyConditions: $applyConditions\n sort: $sort\n ) {\n id\n positionsCategoriesIds\n positionsSlotsIds\n positionsIds\n numberOfAssignments\n isAssignedTo(positionSlotId: $positionSlotId)\n insertedAt\n\n userInfo {\n id\n email\n name\n picture {\n url\n }\n }\n }\n }\n }\n}\n",{eventId:s,positionSlotId:r,filterAvailabilities:l,filterPositions:c,applyConditions:h,sort:p},[]),{mutate:I,isLoading:v}=Xo(),[b,j]=(0,L.useState)(""),C=(0,L.useMemo)(()=>{const e=x.event?.positionSlot.availableVolunteersRegistrations??[];return m(b)?e.filter(e=>e.userInfo.name.toLowerCase().includes(b.toLowerCase())||e.userInfo.email.includes(b.toLowerCase())):e},[x.event,b]),{numberOfSelected:y,selectAllState:k,states:A,setStates:w,toggleRow:S,toggleSelectAll:E}=yu({}),T=(0,L.useMemo)(()=>(h?1:0)+(l?1:0)+(c?1:0),[h,l,c]);return(0,L.useEffect)(()=>{w(Object.fromEntries((x.event?.positionSlot.availableVolunteersRegistrations??[]).map(e=>[`ui${e.userInfo.id}`,{id:e.userInfo.id,state:e.isAssignedTo?"checked":"unchecked"}])))},[x.event]),(0,i.jsx)(dG,{button:(0,i.jsx)(El,{isLoading:v,to:ps.POSITION({organizationId:n,eventId:s,positionId:o}),onClick:async()=>{const e=(x.event?.positionSlot.availableVolunteersRegistrations??[]).flatMap(e=>e.isAssignedTo?[e.userInfo.id]:[]),t=Object.values(A).filter(({state:e})=>"checked"===e).map(({id:e})=>e),n=(0,cc.A)(t,e),i=(0,cc.A)(e,t);no(n)&&await I({eventId:s,massAssign:{positionsSlotsIds:[r],selecteds:{ids:n},strategy:tt.Add}}),no(i)&&await I({eventId:s,massAssign:{positionsSlotsIds:[r],selecteds:{ids:i},strategy:tt.Delete}})},children:0===y?t("ne_pas_affecter_05756"):t("affecter_1_me_46721",y)}),closePath:ps.POSITION({organizationId:n,eventId:s,positionId:o}),popup:{category:t("affectation_u_96975",x.event?.positionSlot.positionName??""),title:x.event?.positionSlot.nameOrRange??""},children:(0,i.jsx)(Fc,{filters:(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),value:b,onChange:j})}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"gray",leftIcon:"sliders",children:t("filtres_1_41774",T)})}),(0,i.jsx)(qd,{css:{padding:"0"},placement:"bottom-end",children:(0,i.jsxs)(Na,{css:{padding:"$4 $6"},direction:"column",width:440,children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("liste_des_filtr_75605")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("disponibilit_s_49923")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(xc,{state:l?"unchecked":"checked",onClick:e=>{d("checked"!==e)},children:t("afficher_tous_l_44338")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:l?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:t("filtrer_selon_l_35857")}),(0,i.jsx)(Ku,{height:"4"}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("missions_63972")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(xc,{state:c?"unchecked":"checked",onClick:e=>{u("checked"!==e)},children:t("afficher_tous_l_44338")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:c?"checked":"unchecked",onClick:e=>{u("checked"===e)},children:t("filtrer_selon_l_42798")}),(0,i.jsx)(Ku,{height:"4"}),(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("conditions_77756")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(xc,{state:h?"unchecked":"checked",onClick:e=>{g("checked"!==e)},children:t("afficher_tous_l_44338")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:h?"checked":"unchecked",onClick:e=>{g("checked"===e)},children:t("filtrer_selon_l_59697")})]})})]})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{css:{paddingRight:0},width:48,children:(0,i.jsx)(mc,{state:k,onClick:E})}),(0,i.jsx)(_m,{attribute:Pt.Name,css:{paddingLeft:"$2",flexGrow:2},setSort:f,sort:p,children:t("nom_du_membre_69353")}),(0,i.jsx)(Vc,{children:t("nombre_d_affect_31455")}),(0,i.jsx)(_m,{attribute:Pt.InsertedAt,setSort:f,sort:p,children:t("date_d_inscript_31369")})]}),limit:C.length,numberOfPages:1,offset:0,rows:_?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):C.map(t=>(0,i.jsxs)(Dc,{css:{cursor:"pointer",userSelect:"none"},onClick:()=>{e.push($s.POSITION_SLOT_ASSIGN_VOLUNTEERS_USER_INFORMATIONS(n,s,o,r,t.userInfo.id))},children:[(0,i.jsx)(Ec,{css:{paddingRight:0},width:48,children:(0,i.jsx)(mc,{state:A[`ui${t.userInfo.id}`]?.state??"unchecked",onClick:(e,n)=>{Rl(n),S(`ui${t.userInfo.id}`,e)}})}),(0,i.jsx)(Ec,{css:{paddingLeft:"$2",flexGrow:2},children:(0,i.jsx)(uj,{userInfo:t.userInfo})}),(0,i.jsx)(Ec,{children:t.numberOfAssignments}),(0,i.jsx)(Ec,{children:a.toLocaleString(t.insertedAt.toLocal(),Js.DateTime)})]},t.id)),setOffset:Ql.A,title:t("liste_des_membr_42505"),totalCount:C.length})})},uG=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=_l(),r=e.userInfo.volunteerRegistration?.delegation;return(0,i.jsx)(CO,{forms:e.forms,getTabPath:e=>$s.EDIT_USER_ACCREDITATIONS_FORM(t,n,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:$s.VOLUNTEERS(t,n),title:o("mise_jour_des_60902",e.userInfo.nameOrEmail),children:e.forms.map((o,a)=>(0,i.jsxs)(oj,{path:$s.EDIT_USER_ACCREDITATIONS_FORM(t,n,s,o.id),children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(wT,{accreditationsSlotsIds:e.values.userInfo.accreditations[a].accreditationsSlotsIds,change:e.change,delegationAccreditations:r?.formId===o.id?r.accreditationsSlots:[],displayFormCustomFields:!1,event:e.event,options:{...o,showFullAccreditation:!0,slotDisplay:xt.Hide,accreditationFilter:ft.None},prefix:`userInfo.accreditations[${a}].`,showAutoAccredit:!1,slots:[],userInfosFields:e.userInfo.fields})]},o.id))})},hG=e=>{const{history:t,params:{organizationId:n,eventId:s,userInfoId:o}}=_l(),r=qn(xT),{mutate:a,isLoading:l}=function(e={}){return Xn("mutation UserInfoAccreditationsUpdate(\n $eventId: EventId!\n $userId: UserId\n $delegationId: DelegationId\n $userInfoId: UsersInfoId!\n $userInfoAccreditations: [UserInfoAccreditationsInput!]!\n) {\n userInfoAccreditationsUpdate(\n eventId: $eventId\n userId: $userId\n delegationId: $delegationId\n userInfoId: $userInfoId\n userInfoAccreditations: $userInfoAccreditations\n )\n}\n",e)}(),d=(0,L.useMemo)(()=>e.forms.map(t=>{const n=e.userInfo.formsUsersInfos.find(e=>e.formId===t.id);return{formId:t.id,...r.volunteersRegistrationsWishedAccreditationsUpdateInputDefault(n)}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:{userInfo:{accreditations:d}},render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(uG,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await a({eventId:s,userInfoId:o,userInfoAccreditations:e.userInfo.accreditations}),t.goBack($s.VOLUNTEERS(n,s))}})},mG=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Jn(),{data:s,loader:o}=Zn("query UserUpdateAccreditationsInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n $loadDelegation: Boolean!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...MemberRegistrationUserInfo\n ...FormsUsersInfosWished\n\n volunteerRegistration(eventId: $eventId) @include(if: $loadDelegation) {\n delegation {\n formId\n\n accreditationsSlots {\n ...DelegationAccreditationSlot\n }\n }\n }\n }\n }\n\n event(id: $eventId) {\n forms {\n nodes {\n ...FormMemberRegistration\n }\n }\n\n accreditationsCategories {\n ...FormRegisterAccreditationCategory\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n,loadDelegation:!0},[Ls.MemberRegistrationUserInfoFragment,Ls.FormsUsersInfosWishedFragment,Ls.DelegationAccreditationSlotFragment,Ls.FormMemberRegistrationFragment,Ls.FormRegisterAccreditationCategoryFragment]),r=(0,L.useMemo)(()=>{if(s.organization&&s.event){const e=s.organization.userInfo.volunteerRegistration;return s.event.forms.nodes.filter(t=>t.accreditationDisplay!==mt.None||e.delegation?.formId===t.id&&no(e.delegation.accreditationsSlots))}return[]},[s.organization,s.event]);return o||(no(r)?(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.EDIT_USER_ACCREDITATIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(hG,{event:s.event,forms:r,userInfo:s.organization.userInfo})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.EDIT_USER_ACCREDITATIONS_FORM(e,t,n,r[0].id),replace:!0})})]}):(0,i.jsx)(ni,{}))},gG=e=>{const{params:{organizationId:t,eventId:n,userInfoId:s},translate:o}=_l();return(0,i.jsx)(CO,{forms:e.forms,getTabPath:e=>$s.EDIT_USER_MISSIONS_FORM(t,n,s,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:$s.VOLUNTEERS(t,n),title:o("mise_jour_des_02859",e.userInfo.nameOrEmail),children:e.forms.map((o,r)=>(0,i.jsxs)(oj,{path:$s.EDIT_USER_MISSIONS_FORM(t,n,s,o.id),children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(BT,{change:e.change,event:e.event,options:{...o,showFullPosition:!0,slotDisplay:xt.Hide,positionFilter:ft.None},positionsCategoriesIds:e.values.userInfo.missions[r].positionsCategoriesIds,positionsIds:e.values.userInfo.missions[r].positionsIds,positionsSlotsIds:e.values.userInfo.missions[r].positionsSlotsIds,prefix:`userInfo.missions[${r}].`,slots:[],userInfoFields:e.userInfo.fields})]},o.id))})},pG=e=>{const{history:t,params:{organizationId:n,eventId:s,userInfoId:o}}=_l(),r=qn(xT),{mutate:a,isLoading:l}=function(e={}){return Xn("mutation UserInfoPositionsUpdate(\n $eventId: EventId!\n $userId: UserId\n $delegationId: DelegationId\n $userInfoId: UsersInfoId!\n $userInfoPositions: [UserInfoPositionsInput!]!\n) {\n userInfoPositionsUpdate(\n eventId: $eventId\n userId: $userId\n delegationId: $delegationId\n userInfoId: $userInfoId\n userInfoPositions: $userInfoPositions\n )\n}\n",e)}(),d=(0,L.useMemo)(()=>e.forms.map(t=>{const n=e.userInfo.formsUsersInfos.find(e=>e.formId===t.id);return{formId:t.id,...r.volunteersRegistrationsWishedPositionsUpdateInputDefault(n)}}),[e.forms,e.userInfo.formsUsersInfos]);return(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:{userInfo:{missions:d}},render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(gG,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await a({eventId:s,userInfoId:o,userInfoPositions:e.userInfo.missions}),t.goBack($s.VOLUNTEERS(n,s))}})},fG=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Jn(),{data:s,loader:o}=Zn("query UserUpdateMissionsInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...MemberRegistrationUserInfo\n\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n forms {\n nodes {\n ...FormMemberRegistration\n }\n }\n\n positionsCategories {\n ...FormRegisterCategory\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Ls.MemberRegistrationUserInfoFragment,Ls.FormsUsersInfosWishedFragment,Ls.FormMemberRegistrationFragment,Ls.FormRegisterCategoryFragment]),r=(0,L.useMemo)(()=>(s.event?.forms.nodes??[]).filter(e=>e.positionDisplay!==pt.None),[s.event]);return o||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.EDIT_USER_MISSIONS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(pG,{event:s.event,forms:r,userInfo:s.organization.userInfo})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.EDIT_USER_MISSIONS_FORM(e,t,n,r[0].id),replace:!0})})]})},xG=e=>{const{translate:t,params:{organizationId:n,eventId:s,userInfoId:o}}=_l();return(0,i.jsx)(CO,{forms:e.forms,getTabPath:e=>$s.EDIT_USER_SLOTS_FORM(n,s,o,e),handleSubmit:e.handleSubmit,isLoading:e.isLoading,returnPathFallback:$s.VOLUNTEERS(n,s),title:t("mise_jour_des_28904",e.userInfo.nameOrEmail),children:e.forms.map((t,r)=>(0,i.jsxs)(oj,{path:$s.EDIT_USER_SLOTS_FORM(n,s,o,t.id),children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(JT,{change:e.change,currentSlots:e.values.userInfo.slots[r].slots,customSlotsPeriods:t.customSlotsPeriods,daysDisplay:t.daysDisplay,event:e.event,prefix:`userInfo.slots[${r}].`,slotDisplay:t.slotDisplay,userInfoFields:e.userInfo.fields})]},t.id))})},_G=e=>{const{history:t,params:{organizationId:n,eventId:s,userInfoId:o}}=_l(),r=qn(xT),{mutate:a,isLoading:l}=function(e={}){return Xn("mutation UserInfoSlotsUpdate(\n $eventId: EventId!\n $userId: UserId\n $delegationId: DelegationId\n $userInfoId: UsersInfoId!\n $userInfoSlots: [UserInfoSlotsInput!]!\n) {\n userInfoSlotsUpdate(\n eventId: $eventId\n userId: $userId\n delegationId: $delegationId\n userInfoId: $userInfoId\n userInfoSlots: $userInfoSlots\n )\n}\n",e)}(),d=(0,L.useMemo)(()=>e.forms.map(t=>{const n=e.userInfo.formsUsersInfos.find(e=>e.formId===t.id);return{formId:t.id,slots:r.volunteersRegistrationsSlotsUpdateInputDefault(n?.slots)}}),[e.forms,e.userInfo]);return(0,i.jsx)(Cl,{direction:"column",height:1,initialValues:{userInfo:{slots:d}},render:({form:t,handleSubmit:n,values:s})=>(0,i.jsx)(xG,{change:t.change,event:e.event,forms:e.forms,handleSubmit:n,isLoading:l,userInfo:e.userInfo,values:s}),width:1,onSubmit:async e=>{await a({eventId:s,userInfoId:o,userInfoSlots:e.userInfo.slots}),t.goBack($s.VOLUNTEERS(n,s))}})},IG=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Jn(),{data:s,loader:o}=Zn("query UserUpdateSlotsInfos(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...MemberRegistrationUserInfo\n\n ...FormsUsersInfosWished\n }\n }\n\n event(id: $eventId) {\n startAt\n endAt\n dayStartTime\n ranges\n\n forms {\n nodes {\n ...FormMemberRegistration\n }\n }\n }\n}\n",{organizationId:e,eventId:t,userInfoId:n},[Ls.MemberRegistrationUserInfoFragment,Ls.FormsUsersInfosWishedFragment,Ls.FormMemberRegistrationFragment]),r=(0,L.useMemo)(()=>(s.event?.forms.nodes??[]).filter(e=>e.slotDisplay!==xt.Hide),[s.organization,s.event]),{permissions:[a],isLoading:l}=ck(ok({eventId:t,userInfoId:n})),d=Qn();return l||a||d.push($s.DASHBOARD(e,t)),o||l?o:(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.EDIT_USER_SLOTS_FORM(":organizationId",":eventId",":userInfoId",":formId"),children:(0,i.jsx)(_G,{event:s.event,forms:r,userInfo:s.organization.userInfo})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.EDIT_USER_SLOTS_FORM(e,t,n,r[0].id),replace:!0})})]})},vG=()=>{const{params:{eventId:e}}=_l(),{columns:t,columnsSearch:n,infos:s,isEditMode:o,limit:r,nameDebounced:a,offset:l,predicates:d,rendering:c,setInfos:u,setLimit:h,setOffset:g}=gy(),p=(0,L.useMemo)(()=>({...Gh(t,c),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1}),[t,c]),{mutate:f}=jo(),{data:x,isLoading:_}=Zn("query VolunteersAccreditationsMatrix($eventId: EventId!) {\n event(id: $eventId) {\n accreditationsSlots(includeHidden: true) {\n nodes {\n ...AccreditationSlotMatrix\n }\n }\n }\n}\n",{eventId:e},[Ls.AccreditationSlotMatrixFragment]),{data:I,isLoading:v}=sr({...p,eventId:e,predicates:d,name:m(a)?a:null,columnsSearch:no(n)?n:void 0,limit:r,offset:l}),{numberOfPages:b,totalCount:j}=ku(I.data?.rows),[C,y]=(0,L.useState)([]),[k,A]=(0,L.useState)({}),w=(0,L.useMemo)(()=>s.volunteersMatrixSelectedSlotsIds||[],[s]),S=(0,L.useCallback)(e=>u({...s,volunteersMatrixSelectedSlotsIds:e}),[s,u]),E=(0,L.useCallback)(async t=>{A(e=>({...e,[t]:!0}));const{data:{row:n}}=await ir({...p,eventId:e,id:t},await K());y(e=>e.map(e=>e.id===t?n:e)),A(e=>({...e,[t]:!1}))},[p,A,y]),T=(0,L.useCallback)(e=>k[e]??!1,[k]),z=(0,L.useCallback)((t,n)=>f({eventId:e,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[t]},strategy:tt.Add}}),[e,f]),O=(0,L.useCallback)((t,n)=>f({eventId:e,massAccredit:{accreditationsSlotsIds:[n],selecteds:{ids:[t]},strategy:tt.Delete}}),[e,f]);return(0,L.useEffect)(()=>{y(I.data?.rows.nodes??[])},[I.data]),(0,i.jsx)(BA,{addAccreditationSlot:z,allAccreditationsSlots:x.event?.accreditationsSlots.nodes??[],deleteAccreditationSlot:O,editMode:"assigned",isEditMode:o,isLoading:v||_,isRowLoading:T,limit:r,members:C,numberOfPages:b,offset:l,reloadRow:E,selectedSlotsIds:w,setLimit:h,setOffset:g,setSelectedSlotsIds:S,totalCount:j})},bG=e=>{const{translate:t,params:{eventId:n}}=_l(),{mutate:s}=function(e={}){return Xn("mutation VolunteerRegistrationDuplicate(\n $eventId: EventId!\n $volunteerRegistrationId: VolunteersRegistrationId!\n $numberOfCopies: Int!\n) {\n volunteerRegistrationDuplicate(\n eventId: $eventId\n volunteerRegistrationId: $volunteerRegistrationId\n numberOfCopies: $numberOfCopies\n )\n}\n",e)}(),[o,r]=(0,L.useState)(1),[a,l]=(0,L.useState)(!1);return(0,i.jsx)(Rb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"clone",children:t("dupliquer_un_me_90016")}),(0,i.jsx)(Tb,{children:(0,i.jsx)(Nl,{label:t("nombre_de_copie_37518"),min:1,shouldParseAsInt:!0,value:o,onChange:r})}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{isLoading:a,onClick:async()=>{l(!0),await s({eventId:n,volunteerRegistrationId:e.volunteerRegistrationId,numberOfCopies:o}),e.onClose(),e.reload()},children:t("dupliquer_1_94438",e.name)})})]})})},jG=({eventId:e,organizationId:t,reload:n,reloadRow:s,volunteerRegistration:o})=>{const{history:r,translate:a}=_l(),{hasFeature:l}=yI(),{event:d,isEventAdmin:c}=vb(),{canMemberAssign:u,canMemberAssignmentStateEdit:h,canMemberAccredit:m,canMemberCreate:g,canMemberDelete:p}=wS(),{showNotification:f}=kb(),x=o.state,_=o.accreditationState,{mutate:I,isLoading:v}=Qo(),{mutate:b,isLoading:j}=Zo(),{mutate:C}=Fo(),{mutate:y}=Vo(),k=h&&x!==$t.WaitingAssignment,A=h&&x!==$t.Refused,w=h&&(x===$t.WaitingAssignment||x===$t.Assigned),S=u&&x===$t.Assigned,E=u&&x===$t.PreAssigned,T=u&&x===$t.WaitingAssignment,z=m&&_!==le.WaitingAccreditation,O=m&&_!==le.Refused,R=m&&(_===le.WaitingAccreditation||_===le.Accredited||_===le.AutoAccredited),$=m&&(_===le.Accredited||_===le.AutoAccredited),D=m&&_===le.WaitingAccreditation,[P,F]=(0,L.useState)(!1),[M,N]=(0,L.useState)(!1),[B,V]=(0,L.useState)(!1),U=c&&d.useDelegations&&l(Ne.Delegation)&&o.delegation,W=g,G=p&&o.canDelete,H=(u||h)&&m&&(U||W||G);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(u||h)&&(0,i.jsxs)(i.Fragment,{children:[k&&(0,i.jsx)(Gd,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await I({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:$t.WaitingAssignment}}),s())},children:a("changer_le_stat_90266")}),A&&(0,i.jsx)(Gd,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await I({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:$t.Refused}}),s())},children:a("changer_le_stat_68392")}),w&&(0,i.jsx)(Gd,{icon:"arrow-right-arrow-left",onClick:async()=>{v||(await I({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:$t.NotApplicable}}),s())},children:a("changer_le_stat_62507")}),S&&(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{v||r.push($s.EDIT_ASSIGNMENT(t,e,o.userInfo.id))},children:a("_diter_les_affe_42283")}),E&&(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{v||r.push($s.PRE_ASSIGNMENT(t,e,o.userInfo.id))},children:a("_diter_les_pr_10213")}),T&&(0,i.jsx)(Gd,{icon:"wand-magic-sparkles",onClick:()=>{v||r.push($s.ASSIGNMENT(t,e,o.userInfo.id))},children:a("affecter_94255")})]}),(u||h)&&m&&(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),m&&(0,i.jsxs)(i.Fragment,{children:[z&&(0,i.jsx)(Gd,{icon:"arrow-right-arrow-left",onClick:async()=>{j||(await b({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:le.WaitingAccreditation}}),s())},children:a("change_le_statu_93385")}),O&&(0,i.jsx)(Gd,{icon:"arrow-right-arrow-left",onClick:async()=>{j||(await b({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:le.Refused}}),s())},children:a("changer_le_stat_68392")}),R&&(0,i.jsx)(Gd,{icon:"arrow-right-arrow-left",onClick:async()=>{j||(await b({eventId:e,massStateUpdate:{selecteds:{ids:[o.userInfo.id]},state:le.NotApplicable}}),s())},children:a("changer_le_stat_62507")}),$&&(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{j||r.push($s.EDIT_ACCREDIT(t,e,o.userInfo.id))},children:a("_diter_les_accr_86042")}),D&&(0,i.jsx)(Gd,{icon:"badge-check",onClick:()=>{j||r.push($s.ACCREDIT(t,e,o.userInfo.id))},children:a("accr_diter_70543")})]}),H&&(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),W&&(0,i.jsx)(Gd,{icon:"clone",onClick:()=>F(!0),children:a("dupliquer_28256")}),U&&(0,i.jsx)(Gd,{color:"red",icon:"minus",onClick:()=>{N(!0)},children:a("retirer_de_la_d_64963")}),G&&(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{V(!0)},children:a("d_sinscrire_de_06416")})]}),W&&P&&(0,i.jsx)(bG,{name:o.userInfo.nameOrEmail,reload:n,volunteerRegistrationId:o.id,onClose:()=>F(!1)}),U&&M&&(0,i.jsx)(sA,{buttonText:a("retirer_de_la_d_64963"),subtext:[a("_tes_vous_sur_d_34901",o.delegation.name)],text:a("suppression_de_73669",o.userInfo.name),onClose:()=>{N(!1)},onDelete:async()=>{await C({organizationId:t,eventId:e,delegationId:o.delegation.id,selecteds:{ids:[o.userInfo.id]}}),f(a("_1_a_t_retir_36729",o.userInfo.name,o.delegation.name)),s()}}),p&&B&&(0,i.jsx)(sA,{buttonText:a("d_sinscrire_de_06416"),subtext:[a("_tes_vous_sur_d_79932")],text:a("suppression_de_73669",o.userInfo.name),onClose:()=>{V(!1)},onDelete:async()=>{await y({eventId:e,selecteds:{ids:[o.userInfo.id]}}),f(a("_1_a_t_d_sin_66177",o.userInfo.name)),n()}})]})},CG=({columns:e,customFields:t,eventId:n,organizationId:s,reload:o,reloadVolunteer:r,segmentId:a,state:l,toggleRow:d,volunteerRegistration:c})=>{const{translate:u}=_l(),{isEventAdmin:h,hasPermission:m}=vb(),{canMemberAccredit:g,canMemberAssign:p,canMemberAssignmentStateEdit:f,canMemberCreate:x,canMemberDelete:_,canMemberEdit:I}=wS(),v=uy(t),b=(0,L.useCallback)(()=>{r(c.id)},[c,r]),j=I||p||g,C=x||_||g||p||f,y=c.userInfo,k=$s.VOLUNTEERS_LIST_USER_PANEL_ACCREDITATIONS(s,n,a,y.id),A=$s.VOLUNTEERS_LIST_USER_PANEL_AVAILABILITIES(s,n,a,y.id),w=$s.VOLUNTEERS_LIST_USER_PANEL_POSITIONS(s,n,a,y.id),S=(c.teams||[]).map(e=>$s.VOLUNTEERS_LIST_USER_PANEL_TEAM(s,n,a,y.id,e.teamCode));return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Dc,{css:{background:"checked"===l?"$primary100":"white","&:hover":{background:"checked"===l?"$primary100":"$gray100"}},onMouseLeave:e=>Nd(e.target),children:[j&&(0,i.jsx)(Ec,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:l,onClick:(e,t)=>{Rl(t),d(`ui${y.id}`,e)}})}),e.map(e=>{const t=v.get(e.slug);return(0,i.jsx)(bk,{accreditationsPanelPath:k,availabilitiesPanelPath:A,canAccredit:h,canAssign:h,canChangeDelegation:h,canClickMemberName:!0,column:e,customField:t,eventId:n,positionsPanelPath:w,reloadRow:b,row:c},e.slug)}),C&&(0,i.jsxs)(Yc,{justify:"center",children:[(y.isEditable??!0)&&(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",to:$s.EDIT_USER(s,n,c.userInfo.id)})})}),(0,i.jsx)(Cm,{placement:"top",children:u("_diter_62574")})]}),(0,i.jsx)(jG,{eventId:n,organizationId:s,reload:o,reloadRow:b,volunteerRegistration:c})]})]}),(0,i.jsx)(nA,{accreditationsPanelPath:k,availabilitiesPanelPath:A,canAccredit:h,canCheckIn:(e,t)=>m(Nb.POSITION_READ,{positionCategoryId:e,positionId:t}),canDeletePosition:(e,t)=>m(Nb.MEMBER_ASSIGN,{positionCategoryId:e,positionId:t}),canEditWishedAccreditations:!1,defaultHiddenAccreditationsSlotsIds:[],eventId:n,organizationId:s,positionsPanelPath:w,reloadRow:b,returnPathFallback:$s.VOLUNTEERS(s,n),teamsPanelsPath:S,volunteerRegistration:c})]})},yG=(0,L.memo)(function(e){const{params:{organizationId:t,eventId:n,segmentId:s}}=_l(),{isEventAdmin:o}=vb(),{canMemberAccredit:r,canMemberAssign:a,canMemberAssignmentStateEdit:l,canMemberCreate:d,canMemberDelete:c,canMemberEdit:u}=wS(),{columns:h,columnsSearch:g,limit:p,massActions:f,nameDebounced:x,offset:_,possibleColumns:I,predicates:v,reloadKey:b,rendering:j,setLimit:C,setOffset:y,setSort:k,sort:A}=gy(),w=(0,L.useMemo)(()=>({...Gh(h,j,{includeWeezeventUrls:!0}),includeCanRegistrationStateUpdate:!o,includeIsEditable:!o}),[h,j]),{data:S,isLoading:E,reload:T}=sr({...w,eventId:n,predicates:v,name:m(x)?x:null,columnsSearch:no(g)?g:null,limit:p,offset:_,sort:A}),{numberOfPages:z,totalCount:O}=ku(S.data?.rows);(0,L.useEffect)(()=>{b>1&&T()},[b]);const R=(0,L.useMemo)(()=>h.flatMap(e=>(0,Ya.A)([I.find(t=>t.slug===e)])),[I,h]),[$,D]=(0,L.useState)([]),[P,F]=(0,L.useState)({}),M=(0,L.useCallback)(async e=>{F(t=>({...t,[e]:!0}));const{data:{row:t}}=await ir({...w,eventId:n,id:e},await K());D(n=>n.map(n=>n.id===e?t:n)),F(t=>({...t,[e]:!1}))},[w,F,D]),N=u||a||r,B=d||c||r||a||l;return(0,L.useEffect)(()=>{D(S.data?.rows.nodes??[])},[S.data]),(0,L.useEffect)(()=>{f.setStates(Object.fromEntries((S.data?.rows.nodes??[]).map(({userInfo:e})=>[`ui${e.id}`,{id:e.id,state:"unchecked"}])))},[S.data,f.setStates]),(0,i.jsx)(Na,{css:{flex:"1",overflow:"hidden"},width:1,children:(0,i.jsx)(Im,{"aria-busy":E,headerRow:(0,i.jsxs)(jc,{children:[N&&(0,i.jsx)(Vc,{justify:"center",width:48,children:(0,i.jsx)(mc,{state:f.selectAllState,onClick:f.toggleSelectAll})}),R.map(e=>e.isSortable?(0,i.jsx)(_m,{attribute:e.sortAttribute||e.slug,minWidth:e.minWidth,setSort:k,sort:A,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug):(0,i.jsx)(Vc,{minWidth:e.minWidth,width:e.width,children:(0,i.jsx)(yr,{css:{ellipsis:!0},title:e.name,children:e.name})},e.slug)),B&&(0,i.jsx)(Vc,{width:100})]}),paginationRow:(0,i.jsx)(Pc,{css:{borderTop:"1px solid $gray200"},children:(0,i.jsx)($c,{limit:p,numberOfPages:z,offset:_,setLimit:C,setOffset:y,showLimits:!0,totalCount:O})}),children:E?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{})]}):$.map(o=>P[o.id]?(0,i.jsx)(Uc,{},o.id):(0,i.jsx)(CG,{columns:R,customFields:e.customFields,eventId:n,organizationId:t,reload:T,reloadVolunteer:M,segmentId:s,state:f.states[`ui${o.userInfo.id}`]?.state??"unchecked",toggleRow:f.toggleRow,volunteerRegistration:o},o.id))})})}),kG=(0,L.memo)(e=>{const t=(0,L.useCallback)(t=>{t&&(n.current&&(s.current?.setMap(null),n.current=null),n.current=new google.maps.Map(t,{...Rr(e.initialCenter,e.initialZoom,e.layer)}),n.current.mapTypes.set(et.IgnPlan,Mr()),s.current=new google.maps.OverlayView,s.current.draw=Ql.A,s.current.setMap(n.current),n.current.addListener("drag",()=>{e.onMapDrag?.()}),n.current.addListener("center_changed",()=>{e.onMapCenterChanged?.({lat:n.current.getCenter().lat(),lng:n.current.getCenter().lng()})}),n.current.addListener("zoom_changed",()=>{e.onMapZoomchanged?.(n.current.getZoom())}),n.current.addListener("tilesloaded",()=>{setTimeout(()=>{e.onMapTilesloaded?.()},1e3)}),a(),dW(e.traces,e.hiddenTracesIds,r,n))},[]),n=(0,L.useRef)(null),s=(0,L.useRef)(null),o=(0,L.useRef)([]),r=(0,L.useRef)([]),a=(0,L.useCallback)(()=>{o.current.forEach(e=>e.setMap(null)),o.current=e.users.map(t=>{const i=Tr(t),o=Eg(t.name,t.email),r=new google.maps.Marker({position:i,map:n.current,icon:`${P.HEAVENT_API_URL}/icons/acronym.svg?color=${encodeURIComponent("#0284fe")}&text=${o}`});return r.addListener("click",()=>{const n=s.current?.getProjection()?.fromLatLngToContainerPixel(new google.maps.LatLng(i.lat,i.lng));n&&e.onUserClick?.(t,n)}),r})},[e.users]);return(0,L.useEffect)(()=>{a()},[JSON.stringify(e.users)]),(0,L.useEffect)(()=>{n.current?.setMapTypeId(Dr(e.layer))},[e.layer]),(0,L.useEffect)(()=>{dW(e.traces,e.hiddenTracesIds,r,n)},[JSON.stringify(e.traces),e.hiddenTracesIds]),(0,i.jsx)(yr,{ref:t,height:1,width:1})},Pr.A);kG.displayName="UsersMap";const AG=e=>{const{params:{organizationId:t,eventId:n}}=_l();return(0,i.jsx)(Na,{align:"center",css:{background:"white",borderRadius:"$1",boxShadow:"$xs",padding:"$4"},gap:"4",height:50,children:(0,i.jsxs)(Ja,{to:qI.MEMBER_INFORMATION({organizationId:t,eventId:n,userInfoId:e.user.id}),children:[(0,i.jsx)(yr,{color:"gray800",children:e.user.name}),(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"chevron-right"})})]})})},wG=e=>{const{params:{eventId:t}}=_l(),{isEventAdmin:n}=vb(),{mutate:s}=Ao(),[o,r]=(0,L.useState)(e.layer),[a,l]=(0,L.useState)(null),[d,c]=(0,L.useState)([]),[u,h]=xz("volunteerssMap.center",e.center),[m,g]=xz("volunteerssMap.zoom",Or),p=(0,L.useRef)(null);return(0,i.jsxs)(Na,{css:{flex:"1",position:"relative"},direction:"column",width:1,children:[(0,i.jsx)(yr,{ref:p,css:{flex:"1"},width:1,children:(0,i.jsx)(kG,{hiddenTracesIds:d,initialCenter:u,initialZoom:m,layer:o,traces:e.traces,users:e.users,onMapCenterChanged:h,onMapDrag:()=>l(null),onMapZoomchanged:g,onUserClick:(e,t)=>l({user:e,left:t.x,top:t.y})})}),n&&(0,i.jsx)(jW,{acronymIcon:"icon",hiddenTracesIds:d,layer:o,reload:e.reload,setAcronymIcon:Ql.A,setHiddenTracesIds:c,setLayer:async e=>{r(e),await s({eventId:t,layer:e})},showAcronymIcon:!1,showExport:!1,traces:e.traces,onExport:Ql.A,onFullscreen:()=>{p.current?.requestFullscreen()}}),p.current&&a&&(0,Ht.createPortal)((0,i.jsx)(yr,{css:{left:`${a.left+32}px`,position:"absolute",top:a.top-25-16+"px",zIndex:10},children:(0,i.jsx)(AG,{user:a.user})}),p.current)]})},SG=()=>{const{params:{eventId:e}}=_l(),{columns:t,columnsSearch:n,nameDebounced:s,predicates:o,rendering:r}=gy(),a=(0,L.useMemo)(()=>({...Gh(t,r),includeCanRegistrationStateUpdate:!1,includeIsEditable:!1}),[t,r]),{data:l,loader:d,reload:c}=sr({...a,eventId:e,predicates:o,hasCoordinates:!0,name:m(s)?s:null,columnsSearch:no(n)?n:void 0,limit:250}),u=(0,L.useMemo)(()=>(l.data?.rows.nodes??[]).flatMap(e=>"number"==typeof e.userInfo.fields.latitude&&"number"==typeof e.userInfo.fields.longitude?[{id:e.userInfo.id,email:e.userInfo.email,latitude:e.userInfo.fields.latitude,longitude:e.userInfo.fields.longitude,name:e.userInfo.name}]:[]),[l.data]);return d||(0,i.jsx)(wG,{center:F_(l.data),layer:l.data.layer,reload:c,traces:l.data.traces||[],users:u})},EG=e=>(0,i.jsx)(Na,{align:"center",css:{padding:"$2 $4"},direction:"column",height:1,justify:"center",width:1,children:(0,i.jsx)(uj,{size:32,userInfo:e.vr.userInfo})}),TG=()=>{const{translate:e}=_l();return(0,i.jsx)(Na,{align:"center",css:{background:"white",border:"1px solid $gray200",borderRadius:"$1",px:"$2"},height:1,width:1,children:(0,i.jsx)(yr,{css:{ellipsis:!0},font:"gray800 textXs medium",textAlign:"center",width:1,children:e("disponible_69523")})})},zG=e=>{const t=qn(hh),n=(0,L.useMemo)(()=>ec(e.slot.position.color),[e.slot]),s=(0,L.useMemo)(()=>vh(t,e.slot.positionSlot,e.slot.position.name,{position:{includeName:!0},slot:{includeRange:!0}}),[e.slot]);return(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(Na,{align:"center",css:{background:n[50],borderRadius:"$1",color:n[700],cursor:"pointer",px:"$2"},height:1,width:1,children:(0,i.jsx)(yr,{css:{ellipsis:!0},fontSize:"textXs",fontWeight:"medium",textAlign:"center",title:s,width:1,children:s})})}),(0,i.jsx)(qd,{css:{padding:"0"},placement:"bottom-start",renderOnPortal:!0,width:460,children:(0,i.jsx)(zW,{category:e.slot.positionCategory,position:e.slot.position,slot:e.slot.positionSlot})})]})},OG=e=>"assignment"===e.slot.type?(0,i.jsx)(zG,{slot:e.slot}):(0,i.jsx)(TG,{}),RG=e=>{const{translate:t,params:{eventId:n}}=_l(),{infos:s,limit:o,nameDebounced:r,offset:a,predicates:l,setInfos:d,setLimit:c,setOffset:u}=gy(),{data:h,loader:g}=Zn("query VolunteersPlanning(\n $eventId: EventId!\n $predicates: [Predicate!]!\n $name: String\n $limit: Int\n $offset: Int\n) {\n data: event(id: $eventId) {\n rows: volunteersRegistrations(\n predicates: $predicates\n name: $name\n limit: $limit\n offset: $offset\n ) {\n nodes {\n ...DocumentUsersPlanning\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{eventId:n,predicates:l,name:m(r)?r:void 0,limit:o,offset:a},[Ls.DocumentUsersPlanningFragment]);const{numberOfPages:p,totalCount:f}=ku(h.data?.rows),x=(0,L.useMemo)(()=>s?.volunteersPlanningshowAvailabilities??!0,[s]),_=(0,L.useCallback)(e=>{d({...s,volunteersPlanningshowAvailabilities:e})},[s,d]),I=(0,L.useMemo)(()=>(h.data?.rows.nodes??[]).map(e=>({...e,slots:e.slots.flatMap(e=>x?[{type:"availability",range:e.range}]:[]).concat(e.positionsSlotsUsersInfos.map(e=>({type:"assignment",range:e.positionSlot.range,positionCategory:e.positionCategory,position:e.position,positionSlot:e.positionSlot})))})),[h.data,x]),v=(0,L.useMemo)(()=>Us.c9.isDateTime(s.volunteersPlanningStartAt)&&s.volunteersPlanningStartAt?.isValid?s.volunteersPlanningStartAt:Us.c9.fromISO(s.volunteersPlanningStartAt)?.isValid?Us.c9.fromISO(s.volunteersPlanningStartAt,{zone:"utc"}):Us.IX.fromDateTimes(e.startAt.startOf("day"),e.endAt.endOf("day")).contains(Us.c9.utc())?Us.c9.utc():e.startAt,[e.startAt,e.endAt,s]),b=(0,L.useCallback)(t=>{d({...s,volunteersPlanningStartAt:t?.toISO()??e.startAt.toISO()})},[e.startAt,s,d]),j=(0,L.useMemo)(()=>{const t=Ih(e.dayStartTime);return t?.[0]??0},[e.dayStartTime]);return g||(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",width:1,children:[(0,i.jsx)(Na,{css:{background:"white",flex:"1"},children:(0,i.jsx)(EW,{data:I,date:v,maxDate:e.endAt,minDate:e.startAt,renderFilters:()=>(0,i.jsx)(yr,{width:40,children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:"white",leftIcon:x?"eye":"eye-slash",onClick:()=>_(!x)})}),(0,i.jsx)(Cm,{placement:"top",children:t(x?"masquer_les_dis_82263":"afficher_les_di_01534")})]})}),renderLeftCell:e=>(0,i.jsx)(EG,{vr:e}),renderSlot:e=>(0,i.jsx)(OG,{slot:e}),showPlus:!1,startHour:j,onChange:b})}),(0,i.jsx)(Pc,{children:(0,i.jsx)($c,{limit:o,numberOfPages:p,offset:a,setLimit:c,setOffset:u,showLimits:!0,totalCount:f})})]})},$G=()=>(0,i.jsxs)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",cursor:"pointer",py:"$3",userSelect:"none",width:"100%","&:last-child":{border:"none"}},children:[(0,i.jsx)(mc,{shouldPreventDefault:!1,state:"unchecked",onClick:Ql.A}),(0,i.jsx)(qa,{width:"3"}),(0,i.jsx)(oc,{size:40,variant:"circular"}),(0,i.jsx)(qa,{width:"4"}),(0,i.jsxs)(Na,{css:{flex:"1",overflow:"hidden"},direction:"column",gap:"1",children:[(0,i.jsx)(oc,{borderRadius:"$1",height:12,width:1}),(0,i.jsx)(oc,{borderRadius:"$1",height:12,width:1})]})]}),DG=e=>{const{data:t,isLoading:n}=wa({organizationId:e.organizationId,excludedEventId:e.eventId,name:m(e.nameOrEmail)?e.nameOrEmail:null});return n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)($G,{}),(0,i.jsx)($G,{}),(0,i.jsx)($G,{})]}):(0,i.jsx)(i.Fragment,{children:t.organization.usersInfos.nodes.map(t=>{const n=e.usersInfosIds.includes(t.id)?"checked":"unchecked";return(0,i.jsx)(Bw,{state:n,userInfo:t,onClick:()=>{e.select(t.id)}},t.id)})})},PG=e=>{const t=Yn(),n=qn(xT),s=qn(Ba),[o,r,a]=Bc(""),{mutate:l,isLoading:d}=Sa();return(0,i.jsx)(Cl,{hideDefaultErrors:!0,initialValues:{usersInfosIds:[],sendVolunteerRegistrationEmail:!1},render:({form:n,handleSubmit:s,values:l})=>(0,i.jsxs)(su,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yr,{color:"gray800",css:{height:"56px",textAlign:"center"},children:(0,i.jsx)("img",{alt:"Avatars",height:"100%",src:gd.AvatarGroup})}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textLg",fontWeight:"medium",textAlign:"center",children:t("ajouter_un_memb_33261")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:t("ajouter_un_ou_d_44771")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_un_m_05904"),value:o,onChange:a}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(vl,{}),(0,i.jsx)(Na,{css:{flex:"1",overflowY:"auto"},direction:"column",children:(0,i.jsx)(DG,{eventId:e.eventId,nameOrEmail:r,organizationId:e.organizationId,select:e=>{n.change("usersInfosIds",oo(l.usersInfosIds,e))},usersInfosIds:l.usersInfosIds})}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{align:"center",gap:"3",justify:"end",children:[(0,i.jsx)(Nm,{name:"sendVolunteerRegistrationEmail",children:t("envoyer_l_e_mai_35622")}),(0,i.jsx)(El,{isLoading:d,onClick:s,children:t("ajouter_97327")}),(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("annuler_48254")})]})]}),validate:s.validateForForm(n.adminAddSchema()),onSubmit:async t=>{await l({eventId:e.eventId,usersInfosIds:t.usersInfosIds,sendVolunteerRegistrationEmail:t.sendVolunteerRegistrationEmail}),e.reload(),e.onClose()}})},FG=({reload:e})=>{const{params:{organizationId:t,eventId:n,segmentId:s},translate:o}=_l(),{user:r}=si(),{canMemberCreate:a}=SS(),{canMemberCreate:l}=wS(),{segment:d,columns:c}=gy(),{mutate:u}=function(e={}){return Xn("mutation VolunteersExport(\n $eventId: EventId!\n $segmentId: SegmentId!\n $format: ExportFormat!\n $includeFiles: Boolean!\n $columns: [String!]!\n) {\n jobId: volunteersExport(\n eventId: $eventId\n segmentId: $segmentId\n format: $format\n includeFiles: $includeFiles\n columns: $columns\n )\n}\n",e)}(),{data:h,isLoading:m}=Zn("query VolunteersHeader($eventId: EventId!, $segmentId: SegmentId!) {\n event(id: $eventId) {\n key\n\n segment(id: $segmentId) {\n links {\n usersListingLink\n }\n }\n }\n}\n",{eventId:n,segmentId:s},[]),[g,p]=(0,L.useState)(!1),[f,x]=(0,L.useState)(!1),[_,I]=(0,L.useState)(!1),{checkExport:v}=kb();return(0,i.jsxs)(r$,{children:[l&&(0,i.jsx)(KS,{menu:(0,i.jsxs)(i.Fragment,{children:[a&&(0,i.jsx)(Gd,{icon:"user-group",onClick:e=>{Nd(e.target),p(!0)},children:o("ajouter_des_mem_06922")}),(0,i.jsx)(Gd,{icon:"file-import",to:$s.EVENT_VOLUNTEERS_IMPORT(t,n),onClick:e=>Nd(e.target),children:o("importer_via_un_61623")})]}),path:qI.CREATE({organizationId:t,eventId:n}),children:o("ajouter_un_memb_33261")}),(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[(0,i.jsxs)(Bb,{permissions:Nb.POSITION_EDIT,children:[(0,i.jsx)(Gd,{icon:"plug-circle-bolt",onClick:e=>{Nd(e.target),x(!0)},children:o("exporter_via_l_09843")}),(0,i.jsx)(Gd,{icon:"file-xls",onClick:e=>{Nd(e.target),I(!0)},children:o("exporter_en_exc_51862")})]}),(0,i.jsx)(Gd,{download:`${d.name}-users-listing`,icon:"arrow-down-to-bracket",to:ug(h.event?.segment.links.usersListingLink,"pdf",{lang:r?.language}),children:o("t_l_charger_en_59616")}),(0,i.jsx)(Bb,{rolesTypes:fI,children:(0,i.jsx)(Gd,{icon:"file-import",to:$s.EVENT_FILES_IMPORT(t,n),children:o("importer_des_do_55420")})})]})]}),g&&(0,i.jsx)(PG,{eventId:n,organizationId:t,reload:e,onClose:()=>{p(!1)}}),!m&&(0,i.jsx)(uD,{isOpen:f,link:cg({organizationId:t,eventId:n,lang:r?.language,pathComponent:`volunteers/${s}`,key:h.event.key}),onClose:()=>{x(!1)}}),(0,i.jsx)(hD,{isOpen:_,requestExport:async(e,i)=>{const{jobId:s}=await u({eventId:n,segmentId:d.id,format:e,includeFiles:i,columns:c});v(s,t,n)},showIncludeFiles:!0,onClose:()=>{I(!1)}})]})},MG=(0,L.memo)(function(e){const t=Yn(),{hasPermission:n}=vb(),{limit:s,massActions:o,onMassEditSuccess:r,predicates:a,reloadKey:l,rendering:d,segment:c,setReloadKey:u}=gy(),h=n(Nb.SEGMENT_EDIT)&&d===Bh.List,m=n(Nb.MEMBER_EDIT)&&d===Bh.List||n(Nb.MEMBER_ACCREDIT)&&d===Bh.AccreditationsMatrix;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(FG,{reload:()=>{u(l+1)}}),(0,i.jsxs)(ej,{children:[(0,i.jsx)(o$,{searchRow:(0,i.jsx)(i$,{actions:(0,i.jsx)(wM,{massActions:o,predicates:a,showOnlyMassEdit:!1,totalNumberOfMembers:c.count,onMassEditSuccess:r}),searchPlaceholder:t("rechercher_un_m_05904"),showActions:n(Nb.MEMBER_EDIT),showEditColumns:h,showEditMode:m,showSearchColumns:n(Nb.SEGMENT_EDIT)}),selectSegment:(0,i.jsx)(A$,{pageSelectedText:t("les_1_membres_00895",s),segmentSelectedText:t("les_1_membres_56748",c.count,c.name)})}),n(Nb.ACCREDITATION_READ)&&d===Bh.AccreditationsMatrix?(0,i.jsx)(vG,{}):d===Bh.Calendar?(0,i.jsx)(RG,{dayStartTime:e.event.dayStartTime,endAt:e.event.endAt,startAt:e.event.startAt}):d===Bh.Map?(0,i.jsx)(SG,{}):(0,i.jsx)(yG,{customFields:e.customFields})]})]})}),NG=e=>{const{history:t,translate:n,params:{organizationId:s,eventId:o,segmentId:r}}=_l(),{hasFeature:a}=yI(),{event:l,hasPermission:d,isEventReader:c,localEvent:u,updateLocalEvent:h}=vb(),m=qn(Hh),g=(0,L.useMemo)(()=>m.getVolunteersFilters(s,o,r,e.organization.customFields.nodes,e.event,{hasAccreditations:l.useAccreditations&&a(Ne.Accreditation),hasCampaigns:l.useCampaigns,hasDelegations:l.useDelegations&&a(Ne.Delegation),hasForms:l.useForms,hasPositions:l.usePositions,isWeezeventConnected:e.event.isWeezeventConnected}),[o,r,e.organization,e.event]),p=(0,L.useMemo)(()=>m.getVolunteersPossibleColumns(e.organization.customFields.nodes,e.event.forms.nodes,{hasAccreditations:l.useAccreditations&&a(Ne.Accreditation),hasCampaigns:l.useCampaigns,hasDelegations:l.useDelegations&&a(Ne.Delegation),hasForms:l.useForms,hasPositions:l.usePositions,isWeezeventConnected:e.event.isWeezeventConnected}),[l,e.organization,e.event]);return(0,i.jsx)(e$,{canEditSegments:d(Nb.SEGMENT_EDIT),eventId:o,filters:g,filtersButtonText:n("filtrer_les_mem_47149"),filtersSubtitle:n("appliquer_des_f_48814"),getSegmentPath:e=>$s.VOLUNTEERS_SEGMENT(s,o,e),initialLimit:u?.volunteersLimit??Tc,initialSegmentsOpen:u?.areVolunteersSegmentsOpen??!0,organizationId:s,possibleColumns:p,possibleRenderings:c?[Bh.List,Bh.Calendar,Bh.AccreditationsMatrix,Bh.Map]:[Bh.List,Bh.Calendar],reload:e.reload,segmentId:r,segmentType:vt.Volunteers,segmentsFolders:e.event.segmentsFolders,setLimit:e=>{h({volunteersLimit:e})},onSegmentClick:e=>{h({volunteersSegmentId:e})},onSegmentDelete:async()=>{await h({volunteersSegmentId:null}),t.replace($s.VOLUNTEERS(s,o))},onSegmentsToggle:async e=>{await h({areVolunteersSegmentsOpen:e})},children:(0,i.jsx)(MG,{customFields:e.organization.customFields.nodes,event:e.event})})},LG=(0,L.memo)(function(){const{params:{organizationId:e,eventId:t},translate:n}=_l(),{event:{name:s},localEvent:o}=vb();Dd(`${s} ${n("membres_11310")}`);const{data:r,loader:a,reload:l}=er({organizationId:e,eventId:t,privacy:xe.All,loadForms:!0,loadSegments:!0}),d=(0,L.useMemo)(()=>(r.event?.segmentsFolders??[]).flatMap(e=>e.segments).map(e=>e.id),[r.event]);return a||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(NG,{event:r.event,organization:r.organization,reload:l})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.VOLUNTEERS_SEGMENT(e,t,o?.volunteersSegmentId&&d.includes(o?.volunteersSegmentId)?o.volunteersSegmentId:d[0]),replace:!0})})]})}),BG=pr(Na,{variants:{active:{true:{color:"$blue600"}}}}),VG=({children:e,path:t,text:n,eventId:s})=>{const o=ei(),r=null!==(0,Ar.B6)(o.pathname,{path:t}),a=Jn(),l=Qn();return(0,i.jsxs)(BG,{active:r,align:"center",direction:"column",onClick:()=>{!1===r&&l.push((0,Ar.tW)(t,{...a,eventId:a.eventId||s}))},children:[(0,i.jsx)(yr,{children:e(r)}),(0,i.jsx)(yr,{fontSize:"textXs",children:n})]})},UG=pr("i",{fontSize:"18px"}),WG=({active:e,className:t})=>(0,i.jsx)(UG,{className:`${e?"fa-solid":"fa-regular"} ${t}`}),GG=pr(Na,{color:"$gray500",padding:"10px 0",boxShadow:"0px -2px 8px -2px rgba(16, 24, 40, 0.04), 0px -4px 12px -2px rgba(16, 24, 40, 0.05)"}),HG=({user:e,eventId:t})=>{const n=Yn();return(0,i.jsxs)(GG,{justify:"evenly",children:[(0,i.jsx)(VG,{eventId:t,path:$s.DASHBOARD(":organizationId",":eventId"),text:n("accueil_70474"),children:e=>(0,i.jsx)(WG,{active:e,className:"fa-house"})}),(0,i.jsx)(VG,{eventId:t,path:$s.VOLUNTEERS(":organizationId",":eventId"),text:n("membres_11310"),children:e=>(0,i.jsx)(WG,{active:e,className:"fa-user-group"})}),(0,i.jsx)(VG,{eventId:t,path:ps.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),text:n("missions_63972"),children:e=>(0,i.jsx)(WG,{active:e,className:"fa-sitemap"})}),(0,i.jsx)(VG,{eventId:t,path:$s.ORGANIZATION_PARAMETERS(":organizationId"),text:n("profil_14444"),children:()=>(0,i.jsx)(Jg,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:24})})]})},qG=({children:e,user:t,eventId:n})=>(0,i.jsxs)(Na,{css:{height:"100%"},direction:"column",children:[(0,i.jsx)(yr,{css:{flex:1,overflow:"auto"},children:e}),(0,i.jsx)(HG,{eventId:n,user:t})]}),YG=({header:e,value:t})=>(0,i.jsxs)(Na,{css:{bd:!0,padding:"$5 $4"},direction:"column",gap:"2",children:[(0,i.jsx)(yr,{color:"gray500",fontSize:"textSm",fontWeight:"medium",children:e}),(0,i.jsx)(yr,{color:"gray900",fontSize:"displaySm",fontWeight:"semiBold",children:t})]}),KG=({position:e})=>{const{history:t,params:{organizationId:n,eventId:s},translate:o}=_l();return(0,i.jsx)(Dc,{css:{cursor:"pointer"},onClick:()=>{t.push(ps.POSITION({organizationId:n,eventId:s,positionId:e.id}))},children:(0,i.jsx)(Ec,{children:(0,i.jsxs)(Na,{direction:"column",gap:"2",width:1,children:[(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(yr,{color:"gray700",css:{flex:"1"},children:e.name}),(0,i.jsx)(yr,{color:"gray700",children:o("_1_2_membres_04485",e.assignedResources,e.resources)})]}),(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(Aw,{percent:e.assignedResources/e.resources})})]})})},e.id)},ZG=pr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),XG=pr(el,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),JG=pr("h2",{fontSize:"$textMd",fontWeight:"$semiBold",margin:0}),QG=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s}}=_l(),o=qn(ep),{isEventAdmin:r,hasPermission:a}=vb(),{data:l,loader:d}=Zn("query DashboardMobile($eventId: EventId!) {\n event(id: $eventId) {\n assignedResources\n name\n resources\n volunteerMinutesAssigned\n volunteerMinutesNeeded\n\n positions {\n nodes {\n id\n name\n resources\n assignedResources\n }\n totalCount\n }\n\n waitingAssignment: volunteersRegistrations(states: [WaitingAssignment], limit: 1) {\n totalCount\n }\n\n assigned: volunteersRegistrations(states: [Assigned], limit: 1) {\n totalCount\n }\n\n positionsCategories {\n id\n name\n resources\n assignedResources\n }\n }\n}\n",{eventId:s},[]),c=(0,L.useMemo)(()=>l.event?(0,lc.A)(l.event.positionsCategories,e=>e.name.toLowerCase()):[],[l.event]),u=()=>{e.push($s.DASHBOARD_EVENT_SWITCH(n,s))};if(d)return d;{const e=r||c.some(e=>a(Nb.POSITION_READ,{positionCategoryId:e.id}));return(0,i.jsxs)(Na,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Na,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(ZG,{children:t("accueil_70474")}),(0,i.jsx)(XG,{icon:"arrow-down-arrow-up",onClick:u})]}),(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(JG,{children:l.event.name}),(0,i.jsx)(YG,{header:t("nombre_de_membr_60320",l.event.resources),value:l.event.resources}),(0,i.jsx)(YG,{header:t("nombre_de_missi_67304",l.event.positions.totalCount),value:l.event.positions.totalCount}),(0,i.jsx)(YG,{header:t("nombre_de_membr_87779",l.event.assigned.totalCount),value:l.event.assigned.totalCount}),(0,i.jsx)(YG,{header:t("nombre_de_membr_63555",l.event.waitingAssignment.totalCount),value:l.event.waitingAssignment.totalCount}),(0,i.jsx)(YG,{header:t("taux_de_remplis_11913"),value:`${0===l.event.resources?"0":Math.round(l.event.assignedResources/l.event.resources*100)}%`}),(0,i.jsx)(YG,{header:t("temps_de_b_n_vo_87924"),value:o.minutesToHoursMinutesString(l.event.volunteerMinutesNeeded)}),(0,i.jsx)(YG,{header:t("temps_de_b_n_vo_60725"),value:o.minutesToHoursMinutesString(l.event.volunteerMinutesAssigned)}),(0,i.jsx)(yr,{css:{boxShadow:"$xs"},children:e?(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Vc,{children:t("cat_gories_24533")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:c.length>0?c.map(e=>(0,i.jsx)(eL,{category:e,clickable:!1,eventId:s,organizationId:n},e.id)):(0,i.jsx)(jk,{subtitle:t("vous_n_avez_pas_59681"),title:t("aucune_cat_gori_21347")})}),setOffset:Ql.A,title:t("liste_des_membr_59735"),totalCount:0}):(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsx)(Vc,{children:t("missions_63972")}),numberOfPages:0,offset:0,rows:(0,i.jsx)(i.Fragment,{children:l.event.positions.nodes.map(e=>(0,i.jsx)(KG,{position:e},e.id))}),setOffset:Ql.A,title:t("liste_des_membr_57353"),totalCount:0})})]})]})}},eH=pr("div",{alignSelf:"flex-end",cursor:"pointer",padding:"$4 $6 $3 $6",i:{color:"$gray500"}}),tH=({onClose:e})=>(0,i.jsx)(eH,{onClick:e,children:(0,i.jsx)("i",{className:"fa-regular fa-xmark"})}),nH=pr(Na,{overflowX:"hidden",overflowY:"auto"}),iH=pr(Na,{background:"rgba(0, 0, 0, 0.7)",position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}),sH=pr(Na,{background:"white",borderRadius:"20px 20px 0 0",marginTop:"44px",flex:"1",overflow:"auto"}),oH=({children:e,onClose:t})=>{const n=(0,Ar.W6)(),s=t??n.goBack;return Fd(s),(0,i.jsx)(iH,{"data-testid":"overlay-backdrop",direction:"column",onClick:s,children:(0,i.jsxs)(sH,{"data-testid":"overlay-body",direction:"column",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(tH,{onClose:s}),(0,i.jsx)(nH,{direction:"column",children:e})]})})},rH=({event:e})=>{const t=qn(Kc);return(0,i.jsx)(yr,{children:(0,i.jsxs)(Na,{align:"center",css:{color:"$gray500"},children:[(0,i.jsx)(yr,{width:25,children:(0,i.jsx)(el,{icon:"calendar"})}),(0,i.jsx)(yr,{css:{flex:"1",ellipsis:!0},children:M_(t,e.startAt,e.endAt)})]})})},aH=({event:e})=>{const t=Yn();return(0,i.jsxs)(Na,{align:"start",direction:"column",gap:"2",children:[(0,i.jsx)(ic,{color:e.state===Pe.Ongoing?"success":"error",children:t(e.state)}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textLg",fontWeight:"medium",width:1,children:e.name}),(0,i.jsx)(rH,{event:e})]})},lH=({events:e})=>{const{organizationId:t,eventId:n}=Jn(),[s,o]=(0,L.useState)(n),r=Qn(),a=Yn();return(0,i.jsxs)(Na,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Na,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(WR,{state:e.id===s?"checked":"unchecked",onClick:()=>o(e.id),children:(0,i.jsx)(aH,{event:e})},e.id))}),(0,i.jsx)(qa,{height:7}),(0,i.jsx)(El,{onClick:()=>{r.push($s.DASHBOARD(t,s))},children:a("s_lectionner_l_77300")})]})},dH=pr("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),cH=()=>{const{organizationId:e,eventId:t}=Jn(),{loader:n,data:s}=sa({organizationId:e,includeCreatedBy:!1,includeNumberOfMembers:!1}),o=Qn(),r=Yn();return(0,i.jsxs)(oH,{onClose:()=>{o.push($s.DASHBOARD(e,t))},children:[(0,i.jsx)(dH,{children:r("liste_de_vos_v_44993")}),n||(0,i.jsx)(lH,{events:s.data.rows.nodes})]})},uH=pr("div",{display:"flex",flex:1,flexDirection:"column",margin:"0 $3"}),hH=pr(Na,{margin:"0 $3",padding:"$3 $4"}),mH=({back:e,children:t})=>(0,i.jsxs)(Na,{align:"center",css:{padding:"10px 0",borderBottom:"1px solid $gray100"},children:[(0,i.jsx)(hH,{color:"gray700",onClick:e,children:(0,i.jsx)(el,{icon:"chevron-left"})}),t]}),gH=pr("div",{display:"flex",flexDirection:"column",height:"100%",overflow:"auto"}),pH=pr("i",{fontSize:"$textXl"}),fH=({replaySearch:e})=>{const{eventId:t}=Jn(),{data:n,loader:s}=Zn("query RecentPositionsSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentPositionsRegistrationsSearches\n }\n}\n",{eventId:t},[]),o=Yn();if(s)return s;{const t=n.event.recentPositionsRegistrationsSearches;return(0,i.jsxs)(Na,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(yr,{fontSize:"textMd",fontWeight:"semiBold",children:o("recherches_r_ce_82891",t.length)}),t.map((t,n)=>(0,i.jsxs)(Na,{align:"center",gap:"2",onClick:()=>{e(t)},children:[(0,i.jsx)(pH,{className:"fa-regular fa-clock"}),(0,i.jsx)(yr,{children:t})]},n))]})}},xH=e=>{const t=Yn(),n=m(e.content?.[0])?t(e.content[0]):t("ooops_on_a_un_p_56888"),s=((e,t)=>"accreditation_limit_reached"===t?.[0]?e("_ditez_l_accr_d_66820"):"delegation_limit_reached"===t?.[0]?e("_diter_la_d_l_g_14763"):"can_not_delete_paired"===t?.[0]?e("ce_membre_est_d_53903"):no(t)?t:[e("une_erreur_est_92333")])(t,e.content);return(0,i.jsx)(Rb,{isOpen:!0,onClose:e.onClose,children:(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"triangle-exclamation",iconColor:"$error700",children:n}),(0,i.jsx)(Tb,{css:{color:"$gray500"},hideBorder:!0,children:e.content?s:e.children}),(0,i.jsx)(Eb,{hideBorder:!0,hideCancelButton:!0,children:(0,i.jsx)(El,{color:"error",onClick:e.onClose,children:t("fermer_62479")})})]})})},_H=L.createContext({}),IH=e=>{const[t,n]=L.useState(!1),[s,o]=L.useState([]),r=L.useCallback((e,t)=>{n(e),o((t||[]).flatMap(e=>e.isHeaventError?e.message.split("\n"):e.message?.startsWith("db::")?[e.message.substring(4).split(" ")[0]]:[]))},[n,o]),a=L.useCallback(()=>{n(!1),o([])},[n,o]);return(0,i.jsxs)(_H.Provider,{value:{isError:t,setIsError:r},children:[e.children,t&&(0,i.jsx)(xH,{content:s,onClose:a})]})},vH=(e,t)=>{switch(t.type){case"FIRST_PAGE_INIT":return{...e,isLoading:!0,data:void 0,xs:void 0};case"LOAD_MORE_INIT":return{...e,isLoading:!0};case"FIRST_PAGE_SUCCESS":case"LOAD_MORE_SUCCESS":return{...e,isLoading:!1,data:t.data,xs:t.xs,offset:t.offset}}};function bH(e,t,n){const[s,o]=(0,L.useReducer)(vH,{isLoading:!0,data:void 0,xs:void 0,offset:t.offset}),{setIsError:r}=(0,L.useContext)(_H);(0,L.useEffect)(()=>{let i=!1;return o({type:"FIRST_PAGE_INIT"}),K().then(n=>e(t,n||null)).then(e=>{!1===i&&o({type:"FIRST_PAGE_SUCCESS",data:e,xs:n(e),offset:t.offset})},()=>{!1===i&&r(!0)}),()=>{i=!0}},[e,JSON.stringify(t),n]);const a=()=>{o({type:"LOAD_MORE_INIT"});const i=s.offset+t.limit;K().then(n=>e({...t,offset:i},n||null)).then(e=>{const t=[...s.xs||[]];t.splice(i,0,...n(e)),o({type:"LOAD_MORE_SUCCESS",data:e,xs:t,offset:i})},()=>{r(!0)})};return(e=>e.isLoading&&void 0===e.data)(s)?{data:s.data,loader:(0,i.jsx)(kl,{}),loadMore:a,xs:s.xs}:{data:s.data,loader:s.isLoading?(0,i.jsx)(kl,{}):void 0,loadMore:a,xs:s.xs}}const jH=pr(yr,{display:"flex",flexDirection:"column",[`${El} + .load-more-status`]:{paddingTop:"12px"}}),CH=({loadMore:e,pageInfo:t,isLoading:n,buttonText:s,statusText:o})=>!1===t.hasNextPage&&!1===t.hasPreviousPage?null:(0,i.jsxs)(jH,{children:[t.hasNextPage&&(0,i.jsx)(El,{isLoading:n,textAlign:"center",onClick:e,children:s}),(0,i.jsx)(yr,{className:"load-more-status",fontSize:"textSm",textAlign:"center",children:o})]});var yH=n(2872);const kH=pr(Na,{bd:!0,padding:"$4 $3"}),AH=({children:e,...t})=>(0,i.jsxs)(kH,{align:"center",...t,children:[(0,i.jsx)(yr,{css:{flex:1},children:e}),(0,i.jsx)(yr,{color:"gray700",css:{padding:"0 10px 0 $4"},children:(0,i.jsx)(el,{icon:"chevron-right"})})]}),wH=({open:e,position:t})=>{const n=Yn(),s=qn(hh);return(0,i.jsxs)(AH,{onClick:()=>{e(t.id)},children:[(0,i.jsxs)(Na,{gap:"2",children:[t.assignedResources>=t.resources?(0,i.jsx)(ic,{color:"success",children:n("complet_51600")}):(0,i.jsx)(ic,{color:"warning",children:n("incomplet_45915")}),!t.isVisible&&(0,i.jsx)(ic,{color:"gray",children:n("Private")})]}),(0,i.jsx)(yr,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:t.name}),(0,i.jsx)(yr,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:`${n("creneau",t.slots.length)} · ${t.range?s.toLocaleString(t.range,void 0,{year:"numeric",month:"long",day:"numeric"}):"-"}`}),(0,i.jsx)(yr,{css:{marginTop:"$3"},children:(0,i.jsx)(Aw,{percent:t.assignedResources/t.resources})})]})},SH=pr("div",{color:"$gray800",fontWeight:"$semiBold",lineHeight:"24px"}),EH=pr("div",{color:"$gray400",fontSize:"$textSm"}),TH=pr("span",{color:"$gray800"}),zH=({category:e})=>{const t=Yn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(SH,{children:e.name}),no(e.leaders)&&(0,i.jsxs)(EH,{children:[`${t("responsable_category",e.leaders.length)} `,(0,i.jsx)(TH,{children:e.leaders.map(({userInfo:e})=>e.name).join(", ")})]})]})},OH=({open:e,positions:t})=>{const n=(0,L.useMemo)(()=>(0,lc.A)((0,yH.A)((0,ac.A)(t,e=>e.category.id)),e=>e[0].category.name),[t]);return(0,i.jsx)(i.Fragment,{children:n.map((t,n)=>(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(zH,{category:t[0].category}),t.map((t,n)=>(0,i.jsx)(wH,{open:e,position:t},n))]},n))})},RH=()=>{const e=Yn();return(0,i.jsx)(Nk,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},$H=e=>e.event.positions.nodes,DH=({search:e})=>{const t=Yn(),{organizationId:n,eventId:s}=Jn(),o={eventId:s,predicates:[],limit:Tc,offset:0,name:e},{data:r,loader:a,loadMore:l,xs:d}=bH(_a,o,$H),c=Qn();return a&&void 0===r?a:0===d.length?(0,i.jsx)(RH,{}):(0,i.jsxs)(Na,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(yr,{fontSize:"textMd",fontWeight:"semiBold",children:t("r_sultat_de_la_64686",d.length)}),(0,i.jsx)(OH,{open:t=>{c.push($s.POSITION_SETTINGS(n,s,t),{from:"SEARCH_MOBILE",search:e})},positions:d}),(0,i.jsx)(CH,{buttonText:t("afficher_plus_d_49529"),isLoading:void 0!==a,loadMore:l,pageInfo:r.event.positions.pageInfo,statusText:t("_1_sur_2_mis_94157",d.length,r.event.positions.totalCount)})]})},PH=pr(Na,{color:"$blue600"}),FH=()=>{const{organizationId:e,eventId:t}=Jn(),n=Qn(),s=Yn(),o=ei(),[r,a]=(0,L.useState)(o.state?.search||""),[l,d]=(0,L.useState)(o.state?.search||"");return(0,i.jsxs)(gH,{children:[(0,i.jsx)(mH,{back:()=>{n.push(ps.POSITIONS({organizationId:e,eventId:t}))},children:(0,i.jsxs)(Na,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(Nl,{icon:"search",placeholder:s("rechercher_une_69998"),value:r,onChange:e=>{a(e),e||d(e)},onKeyDown:e=>{"Enter"===e.key&&d(r)}}),l&&(0,i.jsx)(PH,{onClick:()=>{a(""),d("")},children:s("annuler_48254")})]})}),(0,i.jsx)(uH,{children:l?(0,i.jsx)(DH,{search:l}):(0,i.jsx)(fH,{replaySearch:e=>{a(e),d(e)}})})]})},MH=({folders:e,segmentId:t,...n})=>(0,i.jsx)(zu,{shouldParseAsInt:!0,value:t,...n,children:e.map((e,t)=>(0,i.jsx)("optgroup",{label:e.name,children:e.segments.map((e,t)=>(0,i.jsxs)("option",{value:e.id,children:[e.name," (",e.count,")"]},t))},t))});var NH=n(473);const LH=()=>{const e=Yn();return(0,i.jsx)(Nk,{css:{flex:1,padding:"0 $4"},subtitle:e("cr_ez_de_nouvel_87003"),title:e("il_n_y_a_pas_de_55837")})},BH=e=>e.event.positions.nodes,VH=({segment:e})=>{const t=Yn(),{organizationId:n,eventId:s}=Jn(),o={eventId:s,predicates:e.predicates,limit:Tc,offset:0},{data:r,loader:a,loadMore:l,xs:d}=bH(_a,o,BH),c=Qn();return a&&void 0===r?a:0===d.length?(0,i.jsx)(LH,{}):(0,i.jsxs)(Na,{direction:"column",gap:"7",children:[(0,i.jsx)(OH,{open:e=>{c.push($s.POSITION_SETTINGS(n,s,e))},positions:d}),(0,i.jsx)(CH,{buttonText:t("afficher_plus_d_49529"),isLoading:void 0!==a,loadMore:l,pageInfo:r.event.positions.pageInfo,statusText:t("_1_sur_2_mis_94157",d.length,r.event.positions.totalCount)})]})},UH=pr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),WH=pr(el,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),GH=({event:e})=>{const{organizationId:t,eventId:n,segmentId:s}=Jn(),o=Qn(),r=Yn(),a=(0,NH.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:s});return(0,i.jsxs)(Na,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Na,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(UH,{children:r("missions_63972")}),(0,i.jsx)(WH,{icon:"search",onClick:()=>{o.push($s.POSITIONS_SEARCH(t,n))}})]}),(0,i.jsx)(yr,{children:(0,i.jsx)(MH,{folders:e.segmentsFolders,segmentId:s,onChange:e=>o.push($s.POSITIONS_SEGMENT(t,n,e))})}),(0,i.jsx)(Na,{css:{flex:1},direction:"column",children:(0,i.jsx)(VH,{segment:a})})]})},HH=()=>{const{organizationId:e,eventId:t}=Jn(),{data:n,loader:s}=Zn("query PositionsSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Positions) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:t},[Ls.SegmentsFoldersSegmentsFragment]);return s||(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.POSITIONS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(FH,{})}),(0,i.jsx)(Ar.qh,{path:$s.POSITIONS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(GH,{event:n.event})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.POSITIONS_SEGMENT(e,t,n.event.segmentsFolders[0].segments[0].id)})})]})},qH=pr(Na,{backgroundColor:"$gray100",borderRadius:"$1",padding:"2px"}),YH=({children:e,...t})=>(0,i.jsx)(qH,{...t,children:e}),KH=pr(Na,{color:"$gray400",flex:1,fontSize:"$textSm",fontWeight:"$medium",padding:"6px 8px",variants:{isSelected:{true:{backgroundColor:"white",border:"0.5px solid $gray200",borderRadius:"$1",color:"$gray800",fontWeight:"$semiBold"}}}}),ZH=({children:e,path:t})=>{const n=Qn(),s=ei().pathname===t;return(0,i.jsx)(KH,{isSelected:s,justify:"center",onClick:()=>{n.push(t)},children:e})},XH=({children:e,css:t,...n})=>(0,i.jsx)(Na,{align:"center",css:{flex:1,marginRight:"66px",...t},direction:"column",...n,children:e}),JH=({back:e,position:t})=>(0,i.jsx)(mH,{back:e,children:(0,i.jsxs)(XH,{css:{minHeight:"40px"},children:[(0,i.jsx)(yr,{color:"gray900",fontWeight:"medium",textAlign:"center",children:t.name}),(0,i.jsx)(yr,{color:"gray500",fontSize:"textXs",textAlign:"center",children:t.positionCategoryName})]})}),QH=({customFields:e,position:t})=>{const n=Yn(),{roles:s}=yI();return(0,i.jsxs)(Na,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(LW,{category:t,title:n("remplissage_des_84383")}),(0,i.jsx)(cS,{leaders:t.leaders,roles:s.positionRoles}),(0,i.jsx)(UW,{customFields:e,position:t}),(0,i.jsx)(zw,{description:t.description}),(0,i.jsx)(JF,{location:t}),(0,i.jsx)(ZF,{customFields:t.customFields}),(0,i.jsx)(Pw,{modalSubtitle:n("ajouter_des_tag_64526"),tags:t.tags}),(0,i.jsx)(Ow,{privateNote:t.privateNote})]})},eq=(e,t)=>e.name||t.toLocaleString(e.range,void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}),tq=({open:e,slot:t})=>{const n=Yn(),s=qn(hh);return(0,i.jsxs)(AH,{onClick:()=>{e(t.id)},children:[(0,i.jsx)(Na,{gap:"2",children:t.assignedResources>=t.resources?(0,i.jsx)(ic,{color:"success",children:n("complet_51600")}):(0,i.jsx)(ic,{color:"warning",children:n("_1_membre_manq_31014",t.resources-t.assignedResources)})}),(0,i.jsx)(yr,{color:"gray800",css:{marginTop:"$2"},fontWeight:"semiBold",children:t.name}),(0,i.jsx)(yr,{color:"gray500",css:{marginTop:"$1"},fontSize:"textSm",children:eq(t,s)}),(0,i.jsx)(yr,{css:{marginTop:"$3"},children:(0,i.jsx)(Aw,{percent:t.assignedResources/t.resources})})]})},nq=({open:e,slots:t})=>{const n=Yn();return(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"textLg",fontWeight:"semiBold",children:n("liste_des_cr_ne_94056")}),t.map((t,n)=>(0,i.jsx)(tq,{open:e,slot:t},n))]})},iq=e=>e.event.positionsSlots.nodes,sq=({open:e,eventId:t,positionId:n})=>{const s={eventId:t,positionId:n,limit:Tc,offset:0},{data:o,loader:r,loadMore:a,xs:l}=bH(va,s,iq);return r&&void 0===o?r:(0,i.jsxs)(Na,{css:{marginBottom:"$7"},direction:"column",gap:"7",children:[(0,i.jsx)(nq,{open:e,slots:l}),(0,i.jsx)(CH,{buttonText:"Afficher plus de créneaux",isLoading:void 0!==r,loadMore:a,pageInfo:o.event.positionsSlots.pageInfo,statusText:`${l.length} sur ${o.event.positionsSlots.totalCount} créneaux`})]})},oq=()=>{const{history:e,translate:t,params:{organizationId:n,eventId:s,positionId:o}}=_l(),{data:r,loader:a}=ba({organizationId:n,eventId:s,positionId:o}),l=ei(),[d]=(0,L.useState)(l.state);if(l.pathname===ps.POSITION({organizationId:n,eventId:s,positionId:o}))return(0,i.jsx)(ni,{path:$s.POSITION_SETTINGS(n,s,o)});const c={settings:$s.POSITION_SETTINGS(n,s,o),slots:ps.POSITION_SLOTS({organizationId:n,eventId:s,positionId:o})};return a||(0,i.jsxs)(gH,{children:[(0,i.jsx)(JH,{back:()=>{"SEARCH_MOBILE"===d?.from?e.push($s.POSITIONS_SEARCH(n,s),{search:d?.search}):e.push(ps.POSITIONS({organizationId:n,eventId:s}))},position:r.event.position}),(0,i.jsx)(uH,{children:(0,i.jsxs)(rj,{children:[(0,i.jsxs)(YH,{css:{margin:"$6 0"},children:[(0,i.jsx)(ZH,{path:c.settings,children:t("param_tres_78420")}),(0,i.jsx)(ZH,{path:c.slots,children:t("cr_neaux_33401")})]}),(0,i.jsx)(oj,{path:c.settings,children:(0,i.jsx)(QH,{customFields:r.organization.customFields.nodes,position:r.event.position})}),(0,i.jsx)(oj,{path:c.slots,children:(0,i.jsx)(sq,{eventId:s,open:t=>{e.push($s.POSITION_SLOT_MEMBERS(n,s,o,t))},positionId:r.event.position.id})})]})})]})},rq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=Jn(),o=Qn(),r=Yn();return(0,i.jsx)(oH,{onClose:()=>{o.push($s.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsxs)(Na,{css:{margin:"$3"},direction:"column",gap:"3",children:[(0,i.jsx)(El,{onClick:()=>{o.push($s.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(e,t,n,s))},children:r("pointer_des_mem_09244")}),(0,i.jsx)(El,{onClick:()=>{o.push($s.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(e,t,n,s))},children:r("d_pointer_des_m_31557")}),(0,i.jsx)(El,{onClick:()=>{o.push($s.POSITION_SLOT_CHECK_MEMBERS_RESET(e,t,n,s))},children:r("remettre_z_ro_65589")})]})})},aq=pr(Na,{fontSize:"$textSm",color:"$blue600"}),lq=({onSubmit:e,children:t,data:n,loader:s,loadMore:o,xs:r,disabled:a})=>{const l=Yn(),[d,c]=(0,L.useState)(r);(0,L.useEffect)(()=>{c(r.toSpliced(0,d.length,...d))},[r]);const u=d.filter(e=>"checked"===e.state&&!a.includes(e.positionSlotUserInfo.id)).map(e=>e.positionSlotUserInfo.id);return(0,i.jsxs)(Na,{direction:"column",height:"100%",width:"100%",children:[(0,i.jsxs)(Na,{css:{flex:1,overflow:"auto",padding:"$6 $4 $3 $4"},direction:"column",gap:"5",children:[(0,i.jsxs)(Na,{justify:"between",children:[(0,i.jsx)(yr,{fontSize:"textMd",fontWeight:"semiBold",children:l("liste_des_membr_86405",r.length)}),(0,i.jsx)(aq,{onClick:()=>{c(d.map(e=>({...e,state:"checked"})))},children:l("tout_s_l_ctionn_18234")})]}),(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[d.map((e,t)=>(0,i.jsx)(gc,{disabled:a.includes(e.positionSlotUserInfo.id),state:e.state,onClick:e=>((e,t)=>{c(d.toSpliced(e,1,{...d[e],state:t}))})(t,e),children:e.userInfo.name},t)),(0,i.jsx)(CH,{buttonText:l("afficher_plus_d_41906"),isLoading:void 0!==s,loadMore:o,pageInfo:n.event.volunteersRegistrations.pageInfo,statusText:l("_1_sur_2_mem_14323",r.length,n.event.volunteersRegistrations.totalCount)})]})]}),(0,i.jsx)(Na,{css:{boxShadow:"$mdReverse",padding:"$6 $4"},direction:"column",children:(0,L.isValidElement)(t)?(0,L.cloneElement)(t,{onClick:()=>e(u),disabled:0===u.length}):t})]})},dq=e=>e.event.volunteersRegistrations.nodes,cq=()=>{const{eventId:e,positionSlotId:t}=Jn(),n=Yn(),s={eventId:e,positionSlotId:t,predicates:[{operator:ht.IsNot,value:[me.CheckedIn],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:o,loader:r,loadMore:a,xs:l}=bH(Ia,s,dq),{isLoading:d,mutate:c}=No(),[u,h]=(0,L.useState)([]);if(r&&void 0===o)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:ge.CheckIn,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(lq,{data:o,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(El,{isLoading:d,textAlign:"center",children:n("pointer_80927")})})}},uq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=Jn(),o=Qn(),r=Yn();return(0,i.jsxs)(gH,{children:[(0,i.jsx)(mH,{back:()=>{o.push($s.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsx)(XH,{children:r("pointer_des_mem_09244")})}),(0,i.jsx)(uH,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(cq,{})})]})},hq=e=>e.event.volunteersRegistrations.nodes,mq=()=>{const{eventId:e,positionSlotId:t}=Jn(),n=Yn(),s={eventId:e,positionSlotId:t,predicates:[{operator:ht.IsNot,value:[me.CheckedOut],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:o,loader:r,loadMore:a,xs:l}=bH(Ia,s,hq),{isLoading:d,mutate:c}=No(),[u,h]=(0,L.useState)([]);if(r&&void 0===o)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:ge.CheckOut,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(lq,{data:o,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(El,{isLoading:d,textAlign:"center",children:n("d_pointer_25328")})})}},gq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=Jn(),o=Qn(),r=Yn();return(0,i.jsxs)(gH,{children:[(0,i.jsx)(mH,{back:()=>{o.push($s.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsx)(XH,{children:r("d_pointer_des_m_31557")})}),(0,i.jsx)(uH,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(mq,{})})]})},pq=e=>e.event.volunteersRegistrations.nodes,fq=()=>{const{eventId:e,positionSlotId:t}=Jn(),n=Yn(),s={eventId:e,positionSlotId:t,predicates:[{operator:ht.IsNot,value:[me.Waiting],value2:[t],slug:"checkInStatePositionSlot"}],limit:50,offset:0},{data:o,loader:r,loadMore:a,xs:l}=bH(Ia,s,pq),{isLoading:d,mutate:c}=No(),[u,h]=(0,L.useState)([]);if(r&&void 0===o)return r;{const t=async t=>{await c({eventId:e,checkIn:{strategy:ge.Reset,positionsSlotsUsersInfosIds:t}}),h([...u,...t])};return(0,i.jsx)(lq,{data:o,disabled:u,loadMore:a,loader:r,xs:l,onSubmit:t,children:(0,i.jsx)(El,{isLoading:d,textAlign:"center",children:n("remettre_z_ro_82376")})})}},xq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=Jn(),o=Qn(),r=Yn();return(0,i.jsxs)(gH,{children:[(0,i.jsx)(mH,{back:()=>{o.push($s.POSITION_SLOT_MEMBERS(e,t,n,s))},children:(0,i.jsx)(XH,{children:r("remettre_z_ro_11572")})}),(0,i.jsx)(uH,{css:{margin:"0",overflow:"auto"},children:(0,i.jsx)(fq,{})})]})},_q=e=>{let t,n,s;return"registrationState"in e?(({color:t,leftIcon:s}=fj(e.registrationState)),n=`${t}100`):(t=function(e){switch(e){case me.CheckedIn:case me.CheckedOut:return"success";case me.Waiting:return"warning"}}(e.checkInState),n=`${t}500`),(0,i.jsx)(Na,{align:"center",css:{background:fr.colors[n].value,border:"2px solid white",borderRadius:`${e.size}px`,bottom:"0",color:fr.colors[`${t}700`].value,fontSize:`${Math.round(.45*e.size)}px`,right:"0",position:"absolute"},height:e.size,justify:"center",width:e.size,children:s&&(0,i.jsx)(el,{icon:s})})},Iq=e=>{switch(e){case 16:return 8;case 24:return 10;case 32:return 12;case 40:return 14;case 48:return 16;case 56:return 18;case 64:return 20;case 88:return 22;case 96:return 24;case 110:return 30;case 160:return 40;case 310:return 80}},vq=pr("div",{position:"relative"}),bq=e=>{let t,n;if("registrationState"in e){t={registrationState:e.registrationState,size:Iq(e.size)};const{registrationState:i,...s}=e;n=s}else{t={checkInState:e.checkInState,size:Iq(e.size)};const{checkInState:i,...s}=e;n=s}return(0,i.jsxs)(vq,{children:[(0,i.jsx)(Jg,{...n}),(0,i.jsx)(_q,{...t})]})},jq=pr(Na,{overflow:"hidden"}),Cq=pr("div",{color:"$gray500",fontSize:"$textSm",ellipsis:"",variants:{size:{40:{"&:first-child":{color:"$gray800",fontSize:"$textMd",fontWeight:"$medium"}},64:{"&:first-child":{color:"$gray900",fontSize:"$textXl",fontWeight:"$semiBold"}}}}}),yq=({userInfo:e,size:t,...n})=>(0,i.jsxs)(jq,{direction:"column",...n,children:[m(e.name)&&(0,i.jsx)(Cq,{size:t,children:e.name}),(0,i.jsx)(Cq,{size:t,children:e.email})]}),kq=e=>{const t={name:e.userInfo.name,email:e.userInfo.email,image:e.userInfo.picture?.url};return(0,i.jsxs)(Na,{align:"center",onClick:e.openVolunteer,children:["registrationState"in e?(0,i.jsx)(bq,{...t,registrationState:e.registrationState,size:40}):"checkInState"in e?(0,i.jsx)(bq,{...t,checkInState:e.checkInState,size:40}):(0,i.jsx)(Jg,{...t,size:40}),(0,i.jsx)(yq,{css:{marginLeft:"$3"},size:40,userInfo:e.userInfo})]})},Aq=()=>{const e=Yn();return(0,i.jsxs)(Na,{align:"center",css:{flex:1},direction:"column",gap:"4",justify:"center",children:[(0,i.jsx)(Xj,{color:"primary",icon:"user-group"}),(0,i.jsx)(yr,{color:"gray500",children:e("aucun_b_n_vole_19616")})]})},wq=pr("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),Sq=pr(el,{color:"$gray800",margin:"0 $3",padding:"$3 $4"}),Eq=({back:e,slot:t})=>{const{organizationId:n,eventId:s,positionId:o,positionSlotId:r}=Jn(),a=qn(hh),l=Qn(),{hasPermission:d}=vb(),c=d(Nb.POSITION_READ,{positionCategoryId:t.positionCategoryId,positionId:o});return(0,i.jsxs)(mH,{back:e,children:[(0,i.jsx)(XH,{css:{minHeight:"40px",marginRight:"0"},children:(0,i.jsx)(wq,{children:eq(t,a)})}),c&&(0,i.jsx)(Sq,{icon:"list-check",onClick:()=>{l.push($s.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(n,s,o,r))}})]})},Tq=e=>e.event.volunteersRegistrations.nodes,zq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s}=Jn(),o=Yn(),r=Qn(),a={eventId:t,positionSlotId:s,predicates:[],limit:Tc,offset:0},{data:l,loader:d,loadMore:c,xs:u}=bH(Ia,a,Tq);return d&&void 0===l?d:(0,i.jsxs)(gH,{children:[(0,i.jsx)(Eq,{back:()=>{r.push(ps.POSITION_SLOTS({organizationId:e,eventId:t,positionId:n}))},slot:l.event.positionSlot}),(0,i.jsx)(uH,{children:(0,i.jsx)(Na,{css:{flex:1,margin:"$7 0"},direction:"column",gap:"7",children:0===u.length?(0,i.jsx)(Aq,{}):(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[u.map(o=>(0,i.jsx)(kq,{checkInState:o.positionSlotUserInfo.state,openVolunteer:()=>{r.push($s.POSITION_SLOT_MEMBERS_USER_INFORMATIONS(e,t,n,s,o.userInfo.id))},userInfo:o.userInfo},o.id)),(0,i.jsx)(CH,{buttonText:o("afficher_plus_d_41906"),isLoading:void 0!==d,loadMore:c,pageInfo:l.event.volunteersRegistrations.pageInfo,statusText:o("_1_sur_2_mem_14323",u.length,l.event.volunteersRegistrations.totalCount)})]})})})]})},Oq=pr("div",{minHeight:"$space$5","@tablet":{minHeight:"$space$6"}}),Rq=e=>(0,i.jsx)(yr,{color:"gray800",css:{fontSize:"$textLg","@tablet":{fontSize:"$textMd"},...e.css},fontWeight:"semiBold",children:e.children}),$q=e=>{const t=wc(),n=Yn(),s=e.fieldsToDisplay.filter(e=>!["picture","firstName","lastName"].includes(e.fieldProperty)),o=s.length,r=e.privateCustomFields.length;return(0,i.jsxs)(Na,{direction:"column",children:[o>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Rq,{children:n("informations_pe_37892")}),(0,i.jsx)(qa,{height:"3"}),s.map(t=>lC(t,e.userInfo.fields,s)&&(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Nz,{field:t,fields:e.userInfo.fields}),(0,i.jsx)(Oq,{})]},t.id)),!1===t&&(0,i.jsx)(yr,{css:{borderBottom:"1px solid $gray200"},width:1})]}),r>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:t?5:6}),(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(Rq,{children:(0,i.jsx)(el,{icon:"lock"})}),(0,i.jsx)(Rq,{children:n("informations_pr_15873")})]}),(0,i.jsx)(qa,{height:"3"}),e.privateCustomFields.map(t=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(Nz,{field:t,fields:e.userInfo.fields}),(0,i.jsx)(Oq,{})]},t.id)),!1===t&&(0,i.jsx)(yr,{css:{borderBottom:"1px solid $gray200"},width:1})]}),!1===t&&e.editButton,!1===t&&(0,i.jsx)(qa,{height:"6"})]})},Dq=e=>{const t=Qn(),n=wc(),s=m(e.path);return(0,i.jsxs)(Na,{css:{cursor:s?"pointer":"initial"},direction:"column",onClick:()=>{s&&t.push(e.path)},children:[(0,i.jsx)(yr,{color:"gray800",css:{fontSize:"$textSm",overflow:"hidden",textOverflow:"ellipsis"},fontWeight:"medium",children:e.text}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",css:{fontSize:"$textMd","@tablet":{fontSize:"$textSm"}},children:e.subtext}),(0,i.jsx)(qa,{height:n?5:6})]})},Pq=e=>{const t=Yn(),{hasPermission:n}=vb(),s=qn(Kc),o=qn(ep),r=qn(hh),a=wc(),l=n(Nb.MEMBER_ASSIGN),d=(0,lc.A)(e.volunteerRegistration.positionsSlotsUsersInfos,e=>e.positionSlot.range.start.toMillis()),c=(0,lc.A)(e.volunteerRegistration.preassignPositions.map(({id:e,name:t,range:n})=>({id:e,name:t,range:n,isPosition:!0})).concat(e.volunteerRegistration.preassignPositionsCategories.map(({id:e,name:t,range:n})=>({id:e,name:t,range:n,isPosition:!1}))),e=>e.range?.start.toMillis()??0);return(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(qa,{height:"6"}),no(d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rq,{children:t("affectation_plural")}),(0,i.jsx)(qa,{height:"3"}),d.map((t,s)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)($k,{canCheckIn:n(Nb.POSITION_READ,{positionCategoryId:t.positionCategoryId,positionId:t.position.id}),canDelete:l,positionSlotUserInfo:t,reloadCheckIn:e.reload,onDelete:e.reload}),(0,i.jsx)(qa,{height:a?2:3})]},s)),(0,i.jsx)(qa,{height:"3"}),!1===a&&(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(qa,{height:a?5:6})]}),no(c)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rq,{children:t("missions_et_cat_88954")}),(0,i.jsx)(qa,{height:"3"}),c.map((t,n)=>(0,i.jsx)(Dq,{path:t.isPosition?ps.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.id}):ps.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),!1===a&&(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(qa,{height:a?5:6})]}),(no(e.volunteerRegistration.positionsCategories)||no(e.volunteerRegistration.positions)||no(e.volunteerRegistration.positionsSlots))&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rq,{children:t("missions_souhai_23225")}),(0,i.jsx)(qa,{height:"3"}),(0,lc.A)(e.volunteerRegistration.positionsCategories,e=>e.range?.start?.toMillis()??0).map((t,n)=>(0,i.jsx)(Dq,{path:ps.POSITION_CATEGORY({organizationId:e.organizationId,eventId:e.eventId,positionCategoryId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),(0,lc.A)(e.volunteerRegistration.positions,e=>e.range?.start?.toMillis()??0).map((t,n)=>(0,i.jsx)(Dq,{path:ps.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.id}),subtext:t.range?r.toDisplayString(t.range):"-",text:t.name},n)),(0,lc.A)(e.volunteerRegistration.positionsSlots,e=>e.range.start.toMillis()).map((t,n)=>(0,i.jsx)(Dq,{path:ps.POSITION({organizationId:e.organizationId,eventId:e.eventId,positionId:t.position.id}),subtext:t.nameOrRange,text:t.position.name},n)),!1===a&&(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(qa,{height:a?5:6})]}),no(e.volunteerRegistration.slots)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rq,{children:t("disponibilit_s_49923")}),(0,i.jsx)(qa,{height:"3"}),e.volunteerRegistration.slots.map((e,n)=>(0,i.jsx)(Dq,{subtext:r.toDisplayString(e.range),text:t("disponibilit_n_50484",n+1)},n)),!1===a&&(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(qa,{height:a?5:6})]}),e.volunteerRegistration.state===$t.Assigned&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Rq,{children:t("statistiques_98073")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Dq,{subtext:o.minutesToHoursMinutesString(e.volunteerRegistration.volunteerMinutes),text:t("nombre_d_heures_36999")}),!1===a&&(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(qa,{height:a?5:6})]}),(0,i.jsx)(Rq,{children:t("inscription_48144")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Dq,{subtext:s.toLocaleString(e.volunteerRegistration.insertedAt.toLocal(),Js.DateTime),text:t("date_d_inscript_31369")})]})},Fq=pr(yr,{lineHeight:"28px",marginTop:"$3",maxWidth:"100%",ellipsis:""}),Mq=pr(yr,{lineHeight:"20px",maxWidth:"100%",ellipsis:""}),Nq=({registration:e})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(bq,{email:e.userInfo.email,image:e.userInfo.picture?.url,name:e.userInfo.name,registrationState:e.state,size:64}),(0,i.jsx)(Fq,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e.userInfo.name}),(0,i.jsx)(Mq,{color:"gray500",fontSize:"textSm",children:e.userInfo.email})]}),Lq=({basePath:e,data:t,reload:n})=>{const s=Yn(),{organizationId:o,eventId:r}=Jn(),a=t.event.volunteerRegistration,l={informations:`${e}/${ui.INFORMATION}`,registration:`${e}/${ui.REGISTRATION}`};return(0,i.jsxs)(Na,{align:"center",css:{alignSelf:"center",padding:"0 $4"},direction:"column",width:1,children:[(0,i.jsx)(Nq,{registration:a}),(0,i.jsxs)(rj,{css:{marginTop:"$5"},children:[(0,i.jsxs)(YH,{children:[(0,i.jsx)(ZH,{path:l.informations,children:s("informations_22954")}),(0,i.jsx)(ZH,{path:l.registration,children:s("missions_63972")})]}),(0,i.jsx)(oj,{path:l.informations,children:(0,i.jsx)($q,{fieldsToDisplay:t.event.formsCustomsFields,privateCustomFields:t.organization.customFields.nodes,userInfo:a.userInfo})}),(0,i.jsx)(oj,{path:l.registration,children:(0,i.jsx)(Pq,{eventId:r,organizationId:o,reload:n,volunteerRegistration:a})})]})]})},Bq=({basePath:e,onClose:t})=>{const{organizationId:n,eventId:s,userInfoId:o}=Jn(),{data:r,loader:a,reload:l}=Zn("query UserInfoMobile(\n $organizationId: OrganizationId!\n $eventId: EventId!\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n customFields(variety: UserInfo, privacy: Private) {\n nodes {\n ...CustomFieldWithCondition\n }\n }\n }\n\n event(id: $eventId) {\n formsCustomsFields {\n ...CustomFieldWithCondition\n }\n\n volunteerRegistration: volunteerRegistrationByUserInfoId(userInfoId: $userInfoId) {\n id\n state\n volunteerMinutes\n insertedAt\n\n slots {\n range\n }\n\n positionsSlots {\n nameOrRange\n range\n\n position {\n id\n name\n }\n }\n\n positions {\n id\n name\n range\n }\n\n positionsCategories {\n id\n name\n range\n }\n\n userInfo {\n ...UserInfoOverlay\n }\n\n positionsSlotsUsersInfos {\n ...UserPositionSlotUserInfo\n }\n\n preassignPositions {\n id\n name\n range\n }\n\n preassignPositionsCategories {\n id\n name\n range\n }\n }\n }\n}\n",{organizationId:n,eventId:s,userInfoId:o},[Ls.CustomFieldWithConditionFragment,Ls.UserInfoOverlayFragment,Ls.UserPositionSlotUserInfoFragment]);return(0,i.jsx)(oH,{onClose:t,children:a||(0,i.jsx)(Lq,{basePath:e,data:r,reload:l})})},Vq=()=>{const{organizationId:e,eventId:t,positionId:n,positionSlotId:s,userInfoId:o}=Jn(),r=Qn(),a=$s.POSITION_SLOT_MEMBERS_USER(e,t,n,s,o);return(0,i.jsx)(Bq,{basePath:a,onClose:()=>{r.push($s.POSITION_SLOT_MEMBERS(e,t,n,s))}})},Uq=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.POSITION_SLOT_CHECK_MEMBERS_CHECK_IN(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(uq,{})}),(0,i.jsx)(Ar.qh,{path:$s.POSITION_SLOT_CHECK_MEMBERS_CHECK_OUT(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(gq,{})}),(0,i.jsx)(Ar.qh,{path:$s.POSITION_SLOT_CHECK_MEMBERS_RESET(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(xq,{})}),(0,i.jsx)(Ar.qh,{path:$s.POSITION_SLOT_MEMBERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(zq,{})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(oq,{})})]}),(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.POSITION_SLOT_MEMBERS_CHECK_OPTIONS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(rq,{})}),(0,i.jsx)(Ar.qh,{path:$s.POSITION_SLOT_MEMBERS_USER(":organizationId",":eventId",":positionId",":positionSlotId",":userInfoId"),children:(0,i.jsx)(Vq,{})})]})]}),Wq=pr("i",{fontSize:"$textXl"}),Gq=({replaySearch:e})=>{const{eventId:t}=Jn(),{data:n,loader:s}=Zn("query RecentVolunteersSearchesMobile($eventId: EventId!) {\n event(id: $eventId) {\n recentVolunteersRegistrationsSearches\n }\n}\n",{eventId:t},[]),o=Yn();if(s)return s;{const t=n.event.recentVolunteersRegistrationsSearches;return(0,i.jsxs)(Na,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(yr,{fontSize:"textMd",fontWeight:"semiBold",children:o("recherches_r_ce_82891",t.length)}),t.map((t,n)=>(0,i.jsxs)(Na,{align:"center",gap:"2",onClick:()=>{e(t)},children:[(0,i.jsx)(Wq,{className:"fa-regular fa-clock"}),(0,i.jsx)(yr,{children:t})]},n))]})}},Hq=()=>{const e=Yn();return(0,i.jsx)(Nk,{css:{flex:1,padding:"0 $4"},title:e("d_sol_il_n_y_46236")})},qq=e=>e.event.volunteersRegistrations.nodes,Yq=({search:e})=>{const t=Yn(),{organizationId:n,eventId:s}=Jn(),o={eventId:s,predicates:[],limit:Tc,offset:0,name:e},{data:r,loader:a,loadMore:l,xs:d}=bH(za,o,qq),c=Qn();return a&&void 0===r?a:0===d.length?(0,i.jsx)(Hq,{}):(0,i.jsxs)(Na,{css:{padding:"$6 0"},direction:"column",gap:"6",children:[(0,i.jsx)(yr,{fontSize:"textMd",fontWeight:"semiBold",children:t("r_sultat_de_la_64686",d.length)}),d.map((e,t)=>(0,i.jsx)(kq,{openVolunteer:()=>{c.push($s.VOLUNTEERS_SEARCH_USER_INFORMATIONS(n,s,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},t)),(0,i.jsx)(CH,{buttonText:t("afficher_plus_d_41906"),isLoading:void 0!==a,loadMore:l,pageInfo:r.event.volunteersRegistrations.pageInfo,statusText:t("_1_sur_2_mem_14323",d.length,r.event.volunteersRegistrations.totalCount)})]})},Kq=pr(Na,{color:"$blue600"}),Zq=()=>{const{organizationId:e,eventId:t}=Jn(),n=Qn(),s=Yn(),[o,r]=(0,L.useState)(""),[a,l]=(0,L.useState)("");return(0,i.jsxs)(gH,{children:[(0,i.jsx)(mH,{back:()=>{n.push($s.VOLUNTEERS(e,t))},children:(0,i.jsxs)(Na,{align:"center",css:{marginRight:"$4",flexGrow:1},gap:"3",children:[(0,i.jsx)(Nl,{icon:"search",placeholder:s("rechercher_un_m_05904"),value:o,onChange:e=>{r(e),e||l(e)},onKeyDown:e=>{"Enter"===e.key&&l(o)}}),a&&(0,i.jsx)(Kq,{onClick:()=>{r(""),l("")},children:s("annuler_48254")})]})}),(0,i.jsx)(uH,{children:a?(0,i.jsx)(Yq,{search:a}):(0,i.jsx)(Gq,{replaySearch:e=>{r(e),l(e)}})})]})},Xq=()=>{const{organizationId:e,eventId:t,userInfoId:n}=Jn(),s=Qn(),o=$s.VOLUNTEERS_SEARCH_USER(e,t,n);return(0,i.jsx)(Bq,{basePath:o,onClose:()=>{s.push($s.VOLUNTEERS_SEARCH(e,t))}})},Jq=()=>{const e=Yn();return(0,i.jsx)(Nk,{css:{flex:1,padding:"0 $4"},subtitle:e("diffusez_le_for_36054"),title:e("il_n_y_a_pas_de_22623")})},Qq=e=>e.event.volunteersRegistrations.nodes,eY=({segment:e})=>{const t=Yn(),{organizationId:n,eventId:s,segmentId:o}=Jn(),r={eventId:s,predicates:e.predicates,limit:Tc,offset:0},{data:a,loader:l,loadMore:d,xs:c}=bH(za,r,Qq),u=Qn();return l&&void 0===a?l:0===c.length?(0,i.jsx)(Jq,{}):(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[c.map((e,t)=>(0,i.jsx)(kq,{openVolunteer:()=>{u.push($s.VOLUNTEERS_LIST_USER_INFORMATIONS(n,s,o,e.userInfo.id))},registrationState:e.state,userInfo:e.userInfo},t)),(0,i.jsx)(CH,{buttonText:t("afficher_plus_d_41906"),isLoading:void 0!==l,loadMore:d,pageInfo:a.event.volunteersRegistrations.pageInfo,statusText:t("_1_sur_2_mem_14323",c.length,a.event.volunteersRegistrations.totalCount)})]})},tY=pr("h1",{fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),nY=pr(el,{color:"$gray800",fontSize:"$textLg",padding:"$2"}),iY=({event:e})=>{const{organizationId:t,eventId:n,segmentId:s}=Jn(),o=Qn(),r=Yn(),a=(0,NH.A)(e.segmentsFolders.flatMap(e=>e.segments),{id:s});return(0,i.jsxs)(Na,{css:{flex:1,minHeight:"100%",padding:"$6 $3"},direction:"column",gap:"6",children:[(0,i.jsxs)(Na,{align:"center",gap:"4",justify:"between",children:[(0,i.jsx)(tY,{children:r("membres_11310")}),(0,i.jsx)(nY,{icon:"search",onClick:()=>{o.push($s.VOLUNTEERS_SEARCH(t,n))}})]}),(0,i.jsx)(yr,{children:(0,i.jsx)(MH,{folders:e.segmentsFolders,segmentId:s,onChange:e=>o.push($s.VOLUNTEERS_SEGMENT(t,n,e))})}),(0,i.jsx)(Na,{css:{flex:1},direction:"column",children:(0,i.jsx)(eY,{segment:a})})]})},sY=()=>{const{organizationId:e,eventId:t,segmentId:n,userInfoId:s}=Jn(),o=Qn(),r=$s.VOLUNTEERS_LIST_USER(e,t,n,s);return(0,i.jsx)(Bq,{basePath:r,onClose:()=>{o.push($s.VOLUNTEERS_SEGMENT(e,t,n))}})},oY=()=>{const{organizationId:e,eventId:t}=Jn(),{data:n,loader:s}=Zn("query VolunteersSegmentsMobile($eventId: EventId!) {\n event(id: $eventId) {\n segmentsFolders(segmentType: Volunteers) {\n ...SegmentsFoldersSegments\n }\n }\n}\n",{eventId:t},[Ls.SegmentsFoldersSegmentsFragment]);return s||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.VOLUNTEERS_SEARCH(":organizationId",":eventId"),children:(0,i.jsx)(Zq,{})}),(0,i.jsx)(Ar.qh,{path:$s.VOLUNTEERS_SEGMENT(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(iY,{event:n.event})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.VOLUNTEERS_SEGMENT(e,t,n.event.segmentsFolders[0].segments[0].id)})})]}),(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.VOLUNTEERS_SEARCH_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(Xq,{})}),(0,i.jsx)(Ar.qh,{path:$s.VOLUNTEERS_LIST_USER(":organizationId",":eventId",":segmentId",":userInfoId"),children:(0,i.jsx)(sY,{})})]})]})},rY=()=>{const{organizationId:e,eventId:t}=Jn(),{user:n}=yI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(qG,{eventId:t,user:n,children:(0,i.jsx)(QG,{})})}),(0,i.jsx)(Ar.qh,{path:$s.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(qG,{eventId:t,user:n,children:(0,i.jsx)(oY,{})})}),(0,i.jsx)(Ar.qh,{path:ps.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(qG,{eventId:t,user:n,children:(0,i.jsx)(HH,{})})}),(0,i.jsx)(Ar.qh,{path:ps.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(Uq,{})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.DASHBOARD(e,t)})})]}),(0,i.jsx)(Ar.dO,{children:(0,i.jsx)(Ar.qh,{path:$s.DASHBOARD_EVENT_SWITCH(":organizationId",":eventId"),children:(0,i.jsx)(cH,{})})})]})},aY=e=>{const t=e.isActive?e.isActive(location.pathname):location.pathname===e.to,[n,s]=L.useState(t),o=!!e.children&&(!e.isMenuOpen||n),r=()=>(0,i.jsxs)(Na,{align:"center",className:t?"h-event-menu-group-active":"",css:{color:"$gray700",cursor:"pointer",padding:"$2 $3","&:hover, &.h-event-menu-group-active":{background:"$primary50",borderRadius:"6px",color:"$primary700"}},gap:"3",height:e.isMenuOpen?void 0:40,width:1,onClick:()=>{e.isMenuOpen&&s(!n)},children:[(0,i.jsx)(el,{icon:e.icon}),e.isMenuOpen&&(0,i.jsx)(yr,{css:{flex:"1"},fontWeight:"medium",children:e.title}),e.isMenuOpen&&e.children&&(0,i.jsx)(yr,{fontSize:"textXs",children:(0,i.jsx)(el,{icon:n?"chevron-up":"chevron-down"})})]});return(0,i.jsxs)(Na,{className:e.isMenuOpen?"h-event-menu-open":"h-event-menu-collapsed",css:{position:"relative",userSelect:"none","&.h-event-menu-collapsed > .h-event-menu-group":{display:"none"},"&.h-event-menu-collapsed:hover > .h-event-menu-group":{display:"flex"}},direction:"column",gap:"2",width:1,children:[e.isMenuOpen&&e.children||!e.to?r():(0,i.jsx)(Ja,{to:e.to,children:r()}),o&&(0,i.jsx)(Na,{className:"h-event-menu-group",css:e.isMenuOpen?{paddingLeft:"36px"}:{left:"28px",position:"absolute",paddingLeft:"12px",top:"-8px",width:"192px",zIndex:"10"},children:(0,i.jsxs)(Na,{css:e.isMenuOpen?{}:{background:"white",bd:"gray200 2 md",py:"$2",width:"100%"},direction:"column",children:[!e.isMenuOpen&&(0,i.jsx)(yr,{css:{padding:"$2 $3"},font:"gray900 textSm semiBold",children:e.title}),e.children]})})]})},lY=e=>{const t=e.isActive(location.pathname);return(0,i.jsx)(Ja,{"aria-label":e.children,"aria-selected":t,role:"menuitem",to:e.to,onClick:async()=>await(e.onClick?.()),children:(0,i.jsx)(Na,{className:t?"h-event-menu-item-active":"",css:{color:"$gray800",cursor:"pointer",padding:"6px $3","&:hover, &.h-event-menu-item-active":{color:"$primary700"}},children:e.children})})},dY=e=>{const{translate:t,params:{organizationId:n,eventId:s}}=_l(),{hasFeature:o,organization:r}=yI(),{event:a,isEventReader:l,numberOfWaitingAccreditations:d,numberOfWaitingAssigments:c,updateLocalEvent:u}=vb(),{canAccreditationRead:h,canCampaignRead:m,canDelegationRead:g,canDocumentRead:p,canEmailEdit:f,canFormRead:x,canMemberAccredit:_,canMemberAssign:I,canPositionRead:v,canWorkflowRead:b}=wS(),j=lm(),C=(0,L.useCallback)(e=>e.endsWith("/volunteers")||null!==e.match(/\/volunteers\/\d+/)||null!==e.match(/\/member\/\d+/)&&(e.endsWith("informations")||e.endsWith("availabilities")||e.endsWith("positions")||e.endsWith("accreditations")||e.endsWith("actions")||e.endsWith("comments")||e.includes("history")),[]),y=(0,L.useCallback)(e=>null!==e.match(/\/delegations\/\d+/)||null!==e.match(/\/delegation\/\d+/)||null!==e.match(/\/delegation-category\/\d+/),[]),k=(0,L.useCallback)(e=>C(e)||y(e),[C,y]),A=(0,L.useCallback)(e=>(null!==e.match(/\/positions\/\d+/)||null!==e.match(/\/position\/\d+/)||null!==e.match(/\/position-category\/\d+/))&&!e.includes("documents"),[]),w=(0,L.useCallback)(e=>e.endsWith("/assignments")||e.endsWith("/assignments/blank")||null!==e.match(/\/assignment\/\d+/)||null!==e.match(/\/pre-assignment\/\d+/)||null!==e.match(/\/team-assignment\/\w+/),[]),S=(0,L.useCallback)(e=>A(e)||w(e),[A,w]),E=(0,L.useCallback)(e=>null!==e.match(/\/accreditations\/\d+/)||null!==e.match(/\/accreditation\/\d+/)||null!==e.match(/\/accreditation-category\/\d+/),[]),T=(0,L.useCallback)(e=>e.endsWith("/accreditations-assignments")||null!==e.match(/\/edit-accredit\/\d+/),[]),z=(0,L.useCallback)(e=>E(e)||T(e),[E,T]),O=(0,L.useCallback)(e=>e.endsWith("/forms")||e.endsWith("/forms/create"),[]),R=(0,L.useCallback)(e=>e.endsWith("/campaigns")&&!e.endsWith("/history/campaigns")||null!==e.match(/\/campaign\/\d+/),[]),$=(0,L.useCallback)(e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),[]),D=(0,L.useCallback)(e=>e.endsWith("/documents")||null!==e.match(/\/documents\//),[]),P=(0,L.useCallback)(e=>O(e)||R(e)||$(e)||D(e),[O,R,$,D]),F=(0,L.useCallback)(e=>e.endsWith("/options/api"),[]),M=(0,L.useCallback)(e=>e.endsWith("options/weezevent-v2"),[]),N=(0,L.useCallback)(e=>e.endsWith("/workflows"),[]),B=(0,L.useCallback)(e=>F(e)||M(e)||N(e),[F,M,N]),V=l,U=o(Ne.Api)&&l,W="number"==typeof r.weezeventOrganizationId&&a.isWeezeventSynchronized&&l,G=U||W||b,H=x||m||f||p;return(0,i.jsxs)(Na,{css:{overflowY:e.isOpen?"auto":void 0,paddingTop:"$5",px:"$3"},direction:"column",gap:"5",width:1,children:[(0,i.jsxs)(Na,{align:"center",css:{bd:"gray300 1",cursor:"pointer",padding:"$2 $3"},gap:"2",onClick:e=>{Rl(e),e.target.dispatchEvent(new CustomEvent(KE,{bubbles:!0}))},children:[(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"sparkles"})}),e.isOpen&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray800",css:{flex:"1"},children:t("action_rapide_97952")}),(0,i.jsxs)(Na,{align:"center",css:{background:"$gray50",bd:"gray200 1",padding:"2px $1"},justify:"center",children:[j?"⌘":"Ctrl","+k"]})]})]}),(0,i.jsxs)(Na,{direction:"column",gap:"1",width:1,children:[V&&(0,i.jsx)(aY,{icon:"objects-column",isMenuOpen:e.isOpen,title:t("tableau_de_bord_24627"),to:$s.DASHBOARD(n,s)}),(0,i.jsxs)(aY,{icon:"user-group",isActive:k,isMenuOpen:e.isOpen,title:t("population_38615"),to:$s.VOLUNTEERS(n,s),children:[(0,i.jsx)(lY,{isActive:C,to:$s.VOLUNTEERS(n,s),onClick:()=>u({volunteersSegmentId:null}),children:t("membres_11310")}),g&&(0,i.jsx)(lY,{isActive:y,to:ds.DELEGATIONS({organizationId:n,eventId:s}),onClick:()=>u({delegationsSegmentId:null}),children:t("d_l_gations_78318")})]}),v&&(0,i.jsxs)(aY,{icon:"sitemap",isActive:S,isMenuOpen:e.isOpen,title:t("missions_63972"),to:ps.POSITIONS({organizationId:n,eventId:s}),children:[(0,i.jsx)(lY,{isActive:A,to:ps.POSITIONS({organizationId:n,eventId:s}),onClick:()=>u({positionsSegmentId:null}),children:t("missions_63972")}),I&&(0,i.jsx)(lY,{isActive:w,to:$s.ASSIGNMENTS(n,s),children:`${t("affectation_plural")} (${c})`})]}),h&&(0,i.jsxs)(aY,{icon:"badge-check",isActive:z,isMenuOpen:e.isOpen,title:t("accr_ditations_39450"),to:es.ACCREDITATIONS({organizationId:n,eventId:s}),children:[(0,i.jsx)(lY,{isActive:E,to:es.ACCREDITATIONS({organizationId:n,eventId:s}),onClick:()=>u({accreditationsSegmentId:null}),children:t("accr_ditations_39450")}),_&&(0,i.jsx)(lY,{isActive:T,to:$s.ACCREDITATIONS_ASSIGNMENTS(n,s),children:`${t("mod_ration_09947")} (${d})`})]}),H&&(0,i.jsxs)(aY,{icon:"message",isActive:P,isMenuOpen:e.isOpen,title:t("communication_05277"),to:Ni.FORMS({organizationId:n,eventId:s}),children:[x&&(0,i.jsx)(lY,{isActive:O,to:Ni.FORMS({organizationId:n,eventId:s}),children:t("Form_plural")}),m&&(0,i.jsx)(lY,{isActive:R,to:SI.CAMPAIGNS({organizationId:n,eventId:s}),children:t("Campaigns")}),f&&(0,i.jsx)(lY,{isActive:e=>e.endsWith("/emails/parameters")||e.endsWith("/emails/templates")||e.endsWith("/emails/dns"),to:$s.EVENT_EMAILS_PARAMETERS(n,s),children:t("e_mails_09850")}),p&&(0,i.jsx)(lY,{isActive:D,to:$s.DOCUMENTS(n,s),children:t("Documents")})]}),G&&(0,i.jsxs)(aY,{icon:"sliders-up",isActive:B,isMenuOpen:e.isOpen,title:t("options_53186"),to:$s.OPTIONS_API(n,s),children:[U&&(0,i.jsx)(lY,{isActive:F,to:$s.OPTIONS_API(n,s),children:"API"}),W&&(0,i.jsx)(lY,{isActive:M,to:$s.OPTIONS_WEEZEVENT_V2(n,s),children:"Weezevent"}),b&&(0,i.jsx)(lY,{isActive:N,to:ZI.WORKFLOWS({organizationId:n,eventId:s}),children:t("automatisations_60045")})]})]})]})},cY=e=>{const{translate:t}=_l();return(0,i.jsx)(Na,{align:"center",css:{px:"$4"},height:48,justify:"end",children:(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(El,{color:"white",css:{border:"none"},leftIcon:"sidebar",size:"sm",onClick:e.onToggle})}),(0,i.jsx)(Cm,{placement:"top",children:e.isOpen?t("masquer_le_menu_29008"):t("afficher_le_men_91936")})]})})},uY=()=>{const{params:{organizationId:e,eventId:t},translate:n}=_l(),{event:s,isEventAdmin:o,isEventReader:r}=vb(),{canAccreditationRead:a,canCampaignRead:l,canDelegationRead:d,canDocumentRead:c,canEmailEdit:u,canFormEdit:h,canFormRead:m,canMemberAccredit:g,canMemberAssign:p,canMemberEdit:f,canPositionRead:x,canWorkflowRead:_}=wS();Dd(s.name);const[I,v]=cy(e,"isEventMenuOpen",!1);return(0,i.jsxs)(Na,{height:1,width:1,children:[(0,i.jsxs)(Na,{"aria-label":n("menu_de_l_v_ne_05526"),as:Pa.Nav,css:{borderRight:"1px solid $gray200"},direction:"column",width:I?240:64,children:[(0,i.jsx)(Na,{css:{flex:"1",overflowY:I?"hidden":void 0},width:1,children:(0,i.jsx)(dY,{isOpen:I})}),(0,i.jsx)(cY,{isOpen:I,onToggle:()=>{v(!I)}})]}),(0,i.jsx)(yr,{css:{flex:"1",height:"100%",overflowX:"hidden"},tabIndex:-1,children:(0,i.jsxs)(Ar.dO,{children:[r&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DASHBOARD(":organizationId",":eventId"),children:(0,i.jsx)(nL,{})}),x&&(0,i.jsx)(Ar.qh,{path:ps.POSITIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(NW,{})}),x&&(0,i.jsx)(Ar.qh,{path:ps.POSITION_CATEGORY({organizationId:":organizationId",eventId:":eventId",positionCategoryId:":positionCategoryId"}),children:(0,i.jsx)(lG,{})}),x&&(0,i.jsx)(Ar.qh,{path:ps.POSITION({organizationId:":organizationId",eventId:":eventId",positionId:":positionId"}),children:(0,i.jsx)(QW,{})}),(0,i.jsx)(Ar.qh,{path:$s.VOLUNTEERS(":organizationId",":eventId"),children:(0,i.jsx)(LG,{})}),f&&(0,i.jsx)(Ar.qh,{path:$s.EDIT_USER(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(SO,{})}),o&&(0,i.jsx)(Ar.qh,{path:$s.EDIT_USER_DELEGATION(":organizationId",":eventId",":delegationId",":userInfoId"),children:(0,i.jsx)(SO,{})}),g&&(0,i.jsx)(Ar.qh,{path:$s.EDIT_USER_ACCREDITATIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(mG,{})}),p&&(0,i.jsx)(Ar.qh,{path:$s.EDIT_USER_MISSIONS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(fG,{})}),(0,i.jsx)(Ar.qh,{path:$s.EDIT_USER_SLOTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(IG,{})}),d&&(0,i.jsx)(Ar.qh,{path:ds.DELEGATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(fL,{})}),(0,i.jsx)(Ar.qh,{path:qI.MEMBER({organizationId:":organizationId",eventId:":eventId",userInfoId:":userInfoId"}),children:(0,i.jsx)(gO,{})}),d&&(0,i.jsx)(Ar.qh,{path:ds.DELEGATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",delegationCategoryId:":delegationCategoryId"}),children:(0,i.jsx)(xS,{isEvent:!0})}),d&&(0,i.jsx)(Ar.qh,{path:ds.DELEGATION({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),children:(0,i.jsx)(iS,{})}),(r||p)&&(0,i.jsx)(Ar.qh,{path:$s.ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(GN,{})}),p&&(0,i.jsx)(Ar.qh,{path:$s.ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(LN,{isEdit:!1})}),o&&(0,i.jsx)(Ar.qh,{path:$s.EDIT_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(LN,{isEdit:!0})}),o&&(0,i.jsx)(Ar.qh,{path:$s.TEAM_ASSIGNMENT(":organizationId",":eventId",":teamCode"),children:(0,i.jsx)(JN,{})}),p&&(0,i.jsx)(Ar.qh,{path:$s.PRE_ASSIGNMENT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(LN,{isEdit:!1})}),g&&(0,i.jsx)(Ar.qh,{path:$s.ACCREDITATIONS_ASSIGNMENTS(":organizationId",":eventId"),children:(0,i.jsx)(hN,{})}),g&&(0,i.jsx)(Ar.qh,{path:$s.ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(oN,{isEdit:!1})}),g&&(0,i.jsx)(Ar.qh,{path:$s.EDIT_ACCREDIT(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(oN,{isEdit:!0})}),h&&(0,i.jsx)(Ar.qh,{path:Ni.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)($S,{isCreateOpen:!0})}),m&&(0,i.jsx)(Ar.qh,{path:Ni.FORMS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)($S,{isCreateOpen:!1})}),l&&(0,i.jsx)(Ar.qh,{path:SI.CAMPAIGNS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(QN,{})}),l&&(0,i.jsx)(Ar.qh,{path:SI.CAMPAIGN({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(Oj,{})}),(r||u)&&(0,i.jsx)(Ar.qh,{path:$s.EVENT_EMAILS(":organizationId",":eventId"),children:(0,i.jsx)(GV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_USER_PLANNING(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(zV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_USER_PLANNING_LIST(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(PV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_USER_PLANNING_DAYS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(CV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_ASSIGNMENTS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(QB,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_VOLUNTEERS_LISTING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(NV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_BADGE(":organizationId",":eventId",":userInfoId","generic"),children:(0,i.jsx)(nV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_BADGE(":organizationId",":eventId",":userInfoId",":badgeType"),children:(0,i.jsx)(aV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_CERTIFICATE(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(oV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_HOURS(":organizationId",":eventId",":userInfoId"),children:(0,i.jsx)(IV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_POSITION_PLANNING(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(bB,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_POSITIONS_VOLUNTEERS_PLANNING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(LB,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(zB,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_PLANNING(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(PB,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_USERS_PICTURES(":organizationId",":eventId",":segmentId"),children:(0,i.jsx)(UV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS_USER_CUSTOM_DOCUMENT(":organizationId",":eventId",":userInfoId",":customDocumentId"),children:(0,i.jsx)(gV,{})}),c&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.DOCUMENTS(":organizationId",":eventId"),children:(0,i.jsx)(oB,{})}),r&&(0,i.jsx)(Ar.qh,{path:$s.OPTIONS_WEEZEVENT_V2(":organizationId",":eventId"),children:(0,i.jsx)(gU,{})}),_&&(0,i.jsx)(Ar.qh,{path:ZI.WORKFLOWS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(PR,{})}),r&&(0,i.jsx)(Ar.qh,{path:$s.OPTIONS_API(":organizationId",":eventId"),children:(0,i.jsx)(hU,{})}),a&&(0,i.jsx)(Ar.qh,{path:es.ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(PF,{})}),a&&(0,i.jsx)(Ar.qh,{path:es.ACCREDITATION_SLOT({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId",accreditationSlotId:":accreditationSlotId"}),children:(0,i.jsx)(CN,{})}),a&&(0,i.jsx)(Ar.qh,{path:es.ACCREDITATION({organizationId:":organizationId",eventId:":eventId",accreditationId:":accreditationId"}),children:(0,i.jsx)(TM,{})}),a&&(0,i.jsx)(Ar.qh,{path:es.ACCREDITATION_CATEGORY({organizationId:":organizationId",eventId:":eventId",accreditationCategoryId:":accreditationCategoryId"}),children:(0,i.jsx)(vN,{})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.VOLUNTEERS(e,t),replace:!0})})]})}),(0,i.jsx)(ZE,{level:"event"})]})},hY=()=>{const{hasFeature:e}=yI(),{event:t,isEventAdmin:n}=vb(),{canAccreditationEdit:s,canCampaignSend:o,canDelegationEdit:r,canDocumentEdit:a,canFormRead:l,canMemberAssign:d,canMemberCreate:c,canMemberEdit:u,canPositionEdit:h,canWorkflowEdit:m}=wS();return(0,i.jsxs)(Ar.dO,{children:[t.usePositions&&h&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.CREATE_POSITION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(AU,{})}),t.usePositions&&h&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.EDIT_POSITION(":organizationId",":eventId",":positionId"),children:(0,i.jsx)(wU,{})}),t.usePositions&&d&&(0,i.jsx)(Ar.qh,{path:$s.POSITION_SLOT_ASSIGN_VOLUNTEERS(":organizationId",":eventId",":positionId",":positionSlotId"),children:(0,i.jsx)(cG,{})}),n&&(0,i.jsx)(Ar.qh,{exact:!0,path:SI.CREATE_TEMPLATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(Xb,{isTemplate:!0})}),o&&(0,i.jsx)(Ar.qh,{exact:!0,path:SI.CREATE({organizationId:":organizationId",eventId:":eventId",options:":options?"}),children:(0,i.jsx)(Xb,{isTemplate:!1})}),o&&(0,i.jsx)(Ar.qh,{exact:!0,path:SI.UPDATE({organizationId:":organizationId",eventId:":eventId",campaignId:":campaignId"}),children:(0,i.jsx)(Jb,{})}),s&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.CREATE_ACCREDITATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(JP,{})}),s&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.EDIT_ACCREDITATION(":organizationId",":eventId",":accreditationId"),children:(0,i.jsx)(QP,{})}),a&&(0,i.jsx)(Ar.qh,{path:$s.EDIT_CUSTOM_DOCUMENT(":organizationId",":eventId",":customDocumentId"),children:(0,i.jsx)(YL,{})}),r&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.CREATE_DELEGATION(":organizationId",":eventId",":options?"),children:(0,i.jsx)(ry,{})}),r&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.EDIT_DELEGATION(":organizationId",":eventId",":delegationId"),children:(0,i.jsx)(ly,{})}),l&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_ELEMENTS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(mE,{})}),l&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_GENERAL({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(NE,{})}),l&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_DESIGN({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(DE,{})}),l&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_AVAILABILITIES({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(sU,{})}),t.usePositions&&l&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_MISSIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(cU,{})}),t.useAccreditations&&l&&e(Ne.Accreditation)&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_ACCREDITATIONS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(ZV,{})}),l&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_BROADCAST({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(AE,{})}),l&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PARAMETERS_STATE({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(VE,{})}),l&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_INTEGRATION({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(GS,{})}),l&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_EMAILS({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(xE,{})}),l&&(0,i.jsx)(Ar.qh,{path:Ni.FORM_PREVIEW({organizationId:":organizationId",eventId:":eventId",formId:":formId"}),children:(0,i.jsx)(HS,{})}),r&&(0,i.jsx)(Ar.qh,{path:$s.EVENT_DELEGATIONS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(oL,{})}),u&&(0,i.jsx)(Ar.qh,{path:$s.EVENT_VOLUNTEERS_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(sR,{})}),h&&(0,i.jsx)(Ar.qh,{path:ps.POSITION_IMPORT_CSV({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(TU,{})}),c&&(0,i.jsx)(Ar.qh,{path:$s.EVENT_FILES_IMPORT(":organizationId",":eventId"),children:(0,i.jsx)(yS,{})}),c&&(0,i.jsx)(Ar.qh,{path:[qI.CREATE({organizationId:":organizationId",eventId:":eventId",delegationId:":delegationId"}),qI.CREATE({organizationId:":organizationId",eventId:":eventId"})],children:(0,i.jsx)(sz,{})}),m&&(0,i.jsx)(Ar.qh,{path:ZI.CREATE({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(CR,{})}),m&&(0,i.jsx)(Ar.qh,{path:ZI.UPDATE({organizationId:":organizationId",eventId:":eventId",workflowId:":workflowId"}),children:(0,i.jsx)(yR,{})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(gT,{children:(0,i.jsx)(uY,{})})})]})},mY=()=>{const{organizationId:e,eventId:t}=Jn(),{data:n,loader:s}=Zn("query Event($organizationId: OrganizationId!, $eventId: EventId!) {\n event(id: $eventId) {\n id\n organizationId\n name\n languages\n usePositions\n useAccreditations\n useDelegations\n useForms\n useCampaigns\n useDocuments\n useWorkflows\n isWeezeventSynchronized\n\n accreditationsStats {\n numberOfWaitingAccreditation\n }\n\n assignmentsStats {\n numberOfWaitingAssignment\n numberOfPreAssigned\n }\n }\n\n user {\n ...UserPermissions\n }\n}\n",{organizationId:e,eventId:t},[Ls.UserPermissionsFragment]),{setSelectedEventId:o}=yI(),r=wc(),a=(0,L.useMemo)(()=>n.user?function(e){return e.roles.some(e=>fI.includes(e.type))}(n.user):void 0,[n.user]);if((0,L.useEffect)(()=>(o(t),()=>{o()}),[t]),s)return s;{const e=n.event.assignmentsStats;return(0,i.jsx)(pb,{isEventAdmin:a,userPermissions:n.user,children:(0,i.jsx)(Ib,{event:n.event,numberOfWaitingAccreditations:n.event.accreditationsStats.numberOfWaitingAccreditation,numberOfWaitingAssigments:a?e.numberOfWaitingAssignment+e.numberOfPreAssigned:e.numberOfPreAssigned,children:r?(0,i.jsx)(rY,{}):(0,i.jsx)(hY,{})})})}};let gY=class extends Ul{documentInputService;constructor(e,t){super(e),this.documentInputService=t}emailSenderInputDefault(e){return{header:e?.header??this.documentInputService.documentInputDefault(),picture:e?.picture??this.documentInputService.documentInputDefault(),footer:e?.footer??this.documentInputService.documentInputDefault(),signature:e?.signature??"",name:e?.name??"",fromEmail:e?.fromEmail??"",fromName:e?.fromName??"",replyTo:e?.replyTo??"",eventsIds:e?.eventsIds??[],isOrganizationDefault:e?.isOrganizationDefault??!1}}emailSenderInputSchema(){return d.Ik().shape({header:this.documentInputService.documentInputSchemaNotRequired(),picture:this.documentInputService.documentInputSchemaNotRequired(),signature:d.Yj(),name:d.Yj().required(this.t("le_label_est_re_86986")),fromEmail:d.Yj().required(this.t("l_e_mail_de_l_56279")),fromName:d.Yj().required(this.t("le_nom_de_l_me_01331")),replyTo:d.Yj()})}createUpdateEmailSenderSchema(){return d.Ik().shape({emailSender:this.emailSenderInputSchema()})}};gY=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn,Mj])],gY);const pY=e=>{const{history:t,translate:n,params:{organizationId:s}}=_l(),{showNotification:o}=kb(),r=qn(gY),a=(0,L.useRef)(null),[l,d]=(0,L.useState)(e.initialValues.emailSender.isOrganizationDefault||no(e.initialValues.emailSender.eventsIds)),[c,u]=(0,L.useState)(e.initialValues.emailSender.eventsIds.concat(e.initialValues.emailSender.isOrganizationDefault?["community"]:[]));return(0,i.jsx)(Cl,{customErrorRef:a,height:1,initialValues:e.initialValues,render:({handleSubmit:t,submitting:o,values:r})=>{return(0,i.jsx)(Pm,{button:e.isEdit&&(0,i.jsx)(El,{isLoading:o,onClick:t,children:n("mettre_jour_l_14264")}),category:n("_metteur_d_e_ma_51878"),fallbackClosePath:$s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s),heading:e.isEdit?(h=e.initialValues.emailSender,m(h.fromName)?`${h.fromName} (${h.fromEmail})`:h.fromEmail):n("nouvel_metteur_58381"),children:(0,i.jsxs)($m,{ref:a,children:[(0,i.jsx)(vl,{}),(0,i.jsx)(Mm,{hideToggle:!0,initialIsOpen:!0,heading:n("informations_su_10889"),children:(0,i.jsxs)(Na,{direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Ll,{label:"Label",name:"emailSender.name"}),(0,i.jsx)(Ll,{hint:n("les_e_mails_ser_70662"),label:n("nom_de_l_mette_49412"),name:"emailSender.fromName"}),(0,i.jsx)(Ll,{hint:n("les_e_mails_ser_62925"),isEmail:!0,label:n("e_mail_de_l_me_98374"),name:"emailSender.fromEmail"}),(0,i.jsx)(Ll,{hint:n("cette_adresse_r_36038",r.emailSender.fromEmail),isEmail:!0,label:(0,i.jsx)(Uv,{children:n("adresse_de_r_po_86181")}),name:"emailSender.replyTo"}),(0,i.jsx)(Vj,{accept:Rv.Images,acl:"public-read",hint:n("chaque_e_mail_c_30386"),label:n("en_t_te_11987"),organizationId:s,prefix:"emailSender.header."}),(0,i.jsx)(fC,{label:n("photo_de_profil_08618"),organizationId:s,prefix:"emailSender.picture."}),(0,i.jsx)(Qv,{label:n("signature_67521"),name:"emailSender.signature"}),(0,i.jsx)(Vj,{accept:Rv.Images,acl:"public-read",hint:n("chaque_e_mail_c_65078"),label:n("bas_de_page_86491"),organizationId:s,prefix:"emailSender.footer."}),(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(gc,{state:l?"checked":"unchecked",onClick:e=>{d("checked"===e)},children:n("utiliser_cet_m_47949")}),l&&(0,i.jsxs)(Na,{children:[(0,i.jsx)(qa,{width:"6"}),(0,i.jsxs)(bc,{isSearchVisible:!0,isSelectAllVisible:!0,multiple:!0,values:c,onChange:u,children:[(0,i.jsx)("option",{value:"community",children:n("communaut_20896")}),e.events.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]})]})}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Fm,{children:(0,i.jsx)(El,{isLoading:o,textAlign:"center",onClick:t,children:e.isEdit?n("mettre_jour_l_14264"):n("cr_er_l_metteu_36451")})})]})});var h},schema:r.createUpdateEmailSenderSchema(),width:1,onSubmit:async i=>{const r={...i.emailSender,eventsIds:c.filter(e=>"community"!==e),isOrganizationDefault:c.includes("community")};await e.mutate(r),o(e.isEdit?n("l_metteur_a_t_48335"):n("l_metteur_a_t_67653")),t.push($s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))}})},fY=()=>{const{params:{organizationId:e}}=_l(),{data:t,loader:n}=ia({organizationId:e}),s=qn(gY),{mutate:o}=function(e={}){return Xn("mutation EmailSenderCreate($organizationId: OrganizationId!, $emailSender: EmailsSenderInput!) {\n emailSenderCreate(organizationId: $organizationId, emailSender: $emailSender) {\n id\n }\n}\n",e)}();return n||(0,i.jsx)(pY,{events:t.organization.events.nodes,initialValues:{emailSender:s.emailSenderInputDefault()},isEdit:!1,mutate:t=>o({organizationId:e,emailSender:t})})},xY=()=>{const{params:{organizationId:e,emailSenderId:t}}=_l(),n=qn(gY),{data:s,loader:o}=Zn("query EmailSenderToEdit($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n organization(id: $organizationId) {\n emailSender(id: $emailSenderId) {\n id\n name\n signature\n fromEmail\n fromName\n replyTo\n eventsIds\n isOrganizationDefault\n isValidToSendEmail\n\n header {\n acl\n name\n key\n }\n\n picture {\n acl\n name\n key\n }\n\n footer {\n acl\n name\n key\n }\n }\n\n events {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:e,emailSenderId:t},[]),{mutate:r}=function(e={}){return Xn("mutation EmailSenderUpdate(\n $organizationId: OrganizationId!\n $emailSenderId: EmailsSenderId!\n $emailSender: EmailsSenderInput!\n) {\n emailSenderUpdate(\n organizationId: $organizationId\n emailSenderId: $emailSenderId\n emailSender: $emailSender\n ) {\n id\n }\n}\n",e)}();return o||(0,i.jsx)(pY,{events:s.organization.events.nodes,initialValues:{emailSender:n.emailSenderInputDefault(s.organization.emailSender)},isEdit:!0,mutate:n=>r({organizationId:e,emailSenderId:t,emailSender:n})})},_Y=()=>{const{translate:e,params:{organizationId:t,emailSenderId:n}}=_l(),{data:s,loader:o}=Zn("query EmailSenderPreview($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n organization(id: $organizationId) {\n emailSender(id: $emailSenderId) {\n name\n from\n preview\n }\n }\n}\n",{organizationId:t,emailSenderId:n},[]),r=(0,L.useMemo)(()=>s.organization?s.organization.emailSender.from:"-",[s.organization]);return(0,i.jsx)(Pm,{category:e("aper_u_d_un_me_46930"),fallbackClosePath:$s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),heading:r,children:o||(0,i.jsx)(yr,{css:{overflowY:"auto"},height:1,width:1,children:(0,i.jsx)(Ij,{content:s.organization.emailSender.preview,from:s.organization.emailSender.from,subject:e("e_mail_test_me_23293")})})})},IY=pr("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),vY=pr("button",{background:"none",border:"none",color:"$error700",fontWeight:"$semiBold"}),bY=()=>{const{organizationId:e}=Jn(),t=Qn(),{mutate:n}=ha(),s=Yn(),o=()=>{t.push($s.ORGANIZATION_PARAMETERS(e))};return(0,i.jsx)(oH,{onClose:o,children:(0,i.jsxs)(Na,{align:"center",direction:"column",children:[(0,i.jsx)(Xj,{color:"error",icon:"user-slash"}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(IY,{children:s("suppression_de_67160")}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:s("souhaitez_vous_30775")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(El,{onClick:o,children:s("non_je_ne_souh_99960")}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(vY,{onClick:async()=>{await n({}),X()},children:s("oui_je_souhait_87268")})]})})},jY=({icon:e,children:t,onClick:n})=>(0,i.jsxs)(Na,{align:"center",css:{color:"$gray800",fontWeight:"$medium"},gap:"5",onClick:n,children:[(0,i.jsx)(el,{icon:e}),(0,i.jsx)("span",{children:t})]}),CY=pr(Na,{background:"$white",borderRadius:"$2",boxShadow:"$sm",gap:"$6",padding:"$4 $3"}),yY=pr("h3",{color:"$gray500",fontSize:"$textSm",margin:0}),kY=pr(Na,{backgroundColor:"$gray50",padding:"$6 $3",height:"100%"}),AY=pr("h1",{color:"$gray800",fontSize:"$displaySm",fontWeight:"$semiBold",margin:0}),wY=({organization:e,user:t})=>{const{history:n,translate:s}=_l();return(0,i.jsxs)(kY,{direction:"column",gap:"6",children:[(0,i.jsx)(AY,{children:s("profil_14444")}),(0,i.jsxs)(Na,{align:"center",gap:"4",children:[(0,i.jsx)(Jg,{email:t.email,image:t.userInfo.picture?.url,name:t.userInfo.name,size:64}),(0,i.jsx)(yq,{size:64,userInfo:{email:t.email,...t.userInfo}})]}),(0,i.jsx)(CY,{direction:"column",children:(0,i.jsxs)(Na,{align:"center",gap:"3",justify:"between",children:[(0,i.jsx)(yr,{css:{color:"$gray800",fontWeight:"$medium"},children:e.name}),(0,i.jsx)(El,{onClick:()=>{n.push($s.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(e.id))},children:s("changer_74000")})]})}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yY,{children:s("profil_14444")}),(0,i.jsx)(CY,{direction:"column",children:(0,i.jsx)(jY,{icon:"user-gear",onClick:()=>{n.push($s.ORGANIZATION_PARAMETERS_PROFILE(e.id))},children:s("informations_pe_37892")})})]}),(0,i.jsxs)(Na,{direction:"column",gap:"2",children:[(0,i.jsx)(yY,{children:s("g_n_ral_64953")}),(0,i.jsxs)(CY,{direction:"column",children:[(0,i.jsx)(jY,{icon:"shield",onClick:()=>{window.open(jd(Id(t?.language,new URL(location.href).searchParams)),"_blank")},children:s("cgu_51460")}),(0,i.jsx)(jY,{icon:"circle-question",onClick:()=>{window.open("https://support.weezevent.com/fr/weezcrew","_blank")},children:s("aide_et_support_49790")})]})]}),(0,i.jsxs)(CY,{direction:"column",children:[(0,i.jsx)(jY,{icon:"arrow-left-from-line",onClick:X,children:s("se_d_connecter_74151")}),(0,i.jsx)(jY,{icon:"user-xmark",onClick:()=>{n.push($s.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(e.id))},children:s("supprimer_mon_c_07051")})]})]})},SY=({organizations:e})=>{const{organizationId:t}=Jn(),[n,s]=(0,L.useState)(t),o=Yn(),r=Qn();return(0,i.jsxs)(Na,{css:{margin:"0 $4 $7 $4"},direction:"column",children:[(0,i.jsx)(Na,{direction:"column",gap:"4",children:e.map(e=>(0,i.jsx)(WR,{state:e.id===n?"checked":"unchecked",onClick:()=>s(e.id),children:e.name},e.id))}),(0,i.jsx)(qa,{height:7}),(0,i.jsx)(El,{onClick:()=>{r.push($s.ORGANIZATION_PARAMETERS(n))},children:o("s_lectionner_l_18914")})]})},EY=pr("h3",{color:"$gray800",fontWeight:"$bold",margin:"$3 $4"}),TY=()=>{const{loader:e,data:t}=da({}),{organization:n}=yI(),s=Yn(),o=Qn();return(0,i.jsxs)(oH,{onClose:()=>{o.push($s.ORGANIZATION_PARAMETERS(n.id))},children:[(0,i.jsx)(EY,{children:s("liste_de_vos_or_87919")}),e||(0,i.jsx)(SY,{organizations:t.organizations})]})},zY=({inputName:e})=>{const t=Yn(),n=Mc();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{gap:"$6","@tablet":{gap:"$4","> *":{flexGrow:1,width:"auto"}}},wrap:"wrap",children:[(0,i.jsx)(Ll,{autoComplete:"given-name",label:t("pr_nom_66988"),name:`${e}fields.firstName`}),(0,i.jsx)(Ll,{autoComplete:"family-name",label:t("last_name"),name:`${e}fields.lastName`})]}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Ll,{autoComplete:"email",isEmail:!0,label:t("e_mail_13869"),name:`${e}email`}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Hj,{autoComplete:"language",label:t("Language"),name:`${e}fields.language`,children:n(xd)}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(nI,{label:t("Phone"),prefix:`${e}fields.phone.`})]})},OY=pr(Na,{backgroundColor:"$gray900",height:"110px",marginBottom:"$11","> *":{transform:"translateY(50%)",boxShadow:"$md"}}),RY=()=>{const{user:e}=yI();return(0,i.jsx)(OY,{align:"end",justify:"center",children:(0,i.jsx)(Jg,{email:e.email,image:e.userInfo.picture?.url,name:e.userInfo.name,size:96})})},$Y=()=>{const{organizationId:e}=Jn(),{data:t,loader:n}=Go({organizationId:e}),s=qn(pT),o=qn(Ba),{user:r}=si(),{mutate:a,isLoading:l}=Ho(),d=Yn();return n||(0,i.jsx)(Cl,{initialValues:{userInfo:s.userInfoProfileInputDefault(t.user)},render:({handleSubmit:e})=>(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(RY,{}),(0,i.jsxs)(uH,{children:[(0,i.jsx)(zY,{inputName:"userInfo."}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(El,{isLoading:l,textAlign:"center",onClick:e,children:d("enregistrer_06519")})]})]}),validate:o.validateForForm(s.updateProfileSchema()),onSubmit:async e=>{const{userProfileUpdate:{email:n,language:i}}=await a({userId:r.id,userInfoId:t.user.userInfo.id,userInfo:e.userInfo});r.email!==n?X():r.language!==i&&location.reload()}})},DY=pr("h1",{color:"$gray900",fontSize:"$textMd",fontWeight:"$medium"}),PY=()=>{const{organizationId:e}=Jn(),t=Qn(),n=Yn();return(0,i.jsxs)(gH,{children:[(0,i.jsx)(mH,{back:()=>{t.push($s.ORGANIZATION_PARAMETERS(e))},children:(0,i.jsx)(XH,{children:(0,i.jsx)(DY,{children:n("informations_pe_37892")})})}),(0,i.jsx)($Y,{})]})},FY=()=>{const{organization:e,user:t}=yI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:$s.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(PY,{})}),no(e.events.nodes)&&(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(qG,{eventId:e.events.nodes[0].id,user:t,children:(0,i.jsx)(wY,{organization:e,user:t})})})]}),(0,i.jsx)(Ar.dO,{children:(0,i.jsx)(Ar.qh,{path:$s.ORGANIZATION_PARAMETERS_ORGANIZATION_SWITCH(":organizationId"),children:(0,i.jsx)(TY,{})})}),(0,i.jsx)(Ar.dO,{children:(0,i.jsx)(Ar.qh,{path:$s.ORGANIZATION_PARAMETERS_DELETE_ACCOUNT(":organizationId"),children:(0,i.jsx)(bY,{})})})]})};var MY,NY;!function(e){e.AccreditationCategoryCreate="AccreditationCategoryCreate",e.AccreditationCategoryDelete="AccreditationCategoryDelete",e.AccreditationCategoryDuplicate="AccreditationCategoryDuplicate",e.AccreditationCategoryUpdate="AccreditationCategoryUpdate",e.AccreditationCreate="AccreditationCreate",e.AccreditationDuplicate="AccreditationDuplicate",e.AccreditationSlotDelete="AccreditationSlotDelete",e.AccreditationSlotUpdate="AccreditationSlotUpdate",e.AccreditationUpdate="AccreditationUpdate",e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AccreditationsMassDelete="AccreditationsMassDelete",e.AccreditationsMassEdit="AccreditationsMassEdit",e.AccreditationsSlotsUsersInfosCheckIn="AccreditationsSlotsUsersInfosCheckIn",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",e.BackofficeOrganizationUpdate="BackofficeOrganizationUpdate",e.BackofficeOrganizationUserAdd="BackofficeOrganizationUserAdd",e.BackofficeOrganizationUserRemove="BackofficeOrganizationUserRemove",e.CampaignCreate="CampaignCreate",e.CampaignDelete="CampaignDelete",e.CampaignDuplicate="CampaignDuplicate",e.CampaignEstimate="CampaignEstimate",e.CampaignSend="CampaignSend",e.CampaignUpdate="CampaignUpdate",e.CommentCreate="CommentCreate",e.CommentDelete="CommentDelete",e.CommentUpdate="CommentUpdate",e.CreateEvent="CreateEvent",e.CustomDocumentCreate="CustomDocumentCreate",e.CustomDocumentDelete="CustomDocumentDelete",e.CustomDocumentDuplicate="CustomDocumentDuplicate",e.CustomDocumentUpdate="CustomDocumentUpdate",e.CustomFieldCategoryCreate="CustomFieldCategoryCreate",e.CustomFieldCategoryDelete="CustomFieldCategoryDelete",e.CustomFieldCategoryUpdate="CustomFieldCategoryUpdate",e.CustomFieldCreate="CustomFieldCreate",e.CustomFieldDuplicate="CustomFieldDuplicate",e.CustomFieldUpdate="CustomFieldUpdate",e.CustomFieldsMassDelete="CustomFieldsMassDelete",e.CustomFieldsMassEdit="CustomFieldsMassEdit",e.DelegationCategoryCreate="DelegationCategoryCreate",e.DelegationCategoryDelete="DelegationCategoryDelete",e.DelegationCategoryDuplicate="DelegationCategoryDuplicate",e.DelegationCategoryUpdate="DelegationCategoryUpdate",e.DelegationCreate="DelegationCreate",e.DelegationDuplicate="DelegationDuplicate",e.DelegationFormInvite="DelegationFormInvite",e.DelegationUpdate="DelegationUpdate",e.DelegationUpdateFields="DelegationUpdateFields",e.DelegationsCategoriesMassLeadersEdit="DelegationsCategoriesMassLeadersEdit",e.DelegationsExport="DelegationsExport",e.DelegationsImport="DelegationsImport",e.DelegationsImportResult="DelegationsImportResult",e.DelegationsMassDelete="DelegationsMassDelete",e.DelegationsMassEdit="DelegationsMassEdit",e.DelegationsMassLeadersEdit="DelegationsMassLeadersEdit",e.DelegationsMassMove="DelegationsMassMove",e.DomainDkimVerificationRetry="DomainDkimVerificationRetry",e.EmailFormInviteSend="EmailFormInviteSend",e.EmailResend="EmailResend",e.EmailSenderCreate="EmailSenderCreate",e.EmailSenderDelete="EmailSenderDelete",e.EmailSenderDuplicate="EmailSenderDuplicate",e.EmailSenderUpdate="EmailSenderUpdate",e.EmailSenderVerificationResend="EmailSenderVerificationResend",e.EmailTemplateUpdate="EmailTemplateUpdate",e.EmailUpdate="EmailUpdate",e.EventDocumentUpdate="EventDocumentUpdate",e.EventDocumentsExport="EventDocumentsExport",e.EventDocumentsExportResult="EventDocumentsExportResult",e.EventDuplicate="EventDuplicate",e.EventInvite="EventInvite",e.EventLayerUpdate="EventLayerUpdate",e.EventOrganizationCreate="EventOrganizationCreate",e.EventProfilePrivateFieldsUpdate="EventProfilePrivateFieldsUpdate",e.EventUpdate="EventUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.EventsImport="EventsImport",e.EventsImportResult="EventsImportResult",e.EventsMassArchive="EventsMassArchive",e.EventsMassEdit="EventsMassEdit",e.ExportResult="ExportResult",e.FilesImport="FilesImport",e.FilesImportResult="FilesImportResult",e.FormCreate="FormCreate",e.FormDelete="FormDelete",e.FormDuplicate="FormDuplicate",e.FormElementsUpdate="FormElementsUpdate",e.FormParametersAccreditationsUpdate="FormParametersAccreditationsUpdate",e.FormParametersAvailabilitiesUpdate="FormParametersAvailabilitiesUpdate",e.FormParametersBroadcastUpdate="FormParametersBroadcastUpdate",e.FormParametersDesignUpdate="FormParametersDesignUpdate",e.FormParametersGeneralUpdate="FormParametersGeneralUpdate",e.FormParametersMissionsUpdate="FormParametersMissionsUpdate",e.FormParametersStateUpdate="FormParametersStateUpdate",e.FormRegister="FormRegister",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationCreate="OrganizationCreate",e.OrganizationDelegationSpaceSettingsUpdate="OrganizationDelegationSpaceSettingsUpdate",e.OrganizationEventsShowcaseSettingsUpdate="OrganizationEventsShowcaseSettingsUpdate",e.OrganizationInvite="OrganizationInvite",e.OrganizationMembersSpaceSettingsUpdate="OrganizationMembersSpaceSettingsUpdate",e.OrganizationProfilePrivateFieldsUpdate="OrganizationProfilePrivateFieldsUpdate",e.OrganizationSpaceDesignUpdate="OrganizationSpaceDesignUpdate",e.OrganizationUpdateInfos="OrganizationUpdateInfos",e.PositionCategoryCreate="PositionCategoryCreate",e.PositionCategoryDelete="PositionCategoryDelete",e.PositionCategoryDescriptionUpdate="PositionCategoryDescriptionUpdate",e.PositionCategoryDuplicate="PositionCategoryDuplicate",e.PositionCategoryUpdate="PositionCategoryUpdate",e.PositionCreate="PositionCreate",e.PositionDuplicate="PositionDuplicate",e.PositionSlotCreate="PositionSlotCreate",e.PositionSlotDelete="PositionSlotDelete",e.PositionSlotUpdate="PositionSlotUpdate",e.PositionUpdate="PositionUpdate",e.PositionsCategoriesMassLeadersEdit="PositionsCategoriesMassLeadersEdit",e.PositionsCreate="PositionsCreate",e.PositionsImport="PositionsImport",e.PositionsImportResult="PositionsImportResult",e.PositionsMassConditions="PositionsMassConditions",e.PositionsMassDelete="PositionsMassDelete",e.PositionsMassEdit="PositionsMassEdit",e.PositionsMassLeadersEdit="PositionsMassLeadersEdit",e.PositionsSlotsUsersInfosCheckIn="PositionsSlotsUsersInfosCheckIn",e.RoleCreate="RoleCreate",e.RoleDelete="RoleDelete",e.RoleDuplicate="RoleDuplicate",e.RoleUpdate="RoleUpdate",e.SegmentCreate="SegmentCreate",e.SegmentDelete="SegmentDelete",e.SegmentDuplicate="SegmentDuplicate",e.SegmentFolderCreate="SegmentFolderCreate",e.SegmentFolderDelete="SegmentFolderDelete",e.SegmentFolderMoveDown="SegmentFolderMoveDown",e.SegmentFolderMoveUp="SegmentFolderMoveUp",e.SegmentFolderUpdateName="SegmentFolderUpdateName",e.SegmentMoveDown="SegmentMoveDown",e.SegmentMoveFolder="SegmentMoveFolder",e.SegmentMoveUp="SegmentMoveUp",e.SegmentUpdate="SegmentUpdate",e.SegmentUpdateMetadata="SegmentUpdateMetadata",e.SegmentsFoldersReorder="SegmentsFoldersReorder",e.SendAccreditationsEmails="SendAccreditationsEmails",e.SendAssignmentsEmails="SendAssignmentsEmails",e.SkidataConnectionInfoSeaonEventAdd="SkidataConnectionInfoSeaonEventAdd",e.SkidataConnectionInfoSeaonEventDelete="SkidataConnectionInfoSeaonEventDelete",e.SkidataConnectionInfoSynchronizedEventAdd="SkidataConnectionInfoSynchronizedEventAdd",e.SkidataConnectionInfoSynchronizedEventDelete="SkidataConnectionInfoSynchronizedEventDelete",e.SkidataConnectionInfosDelete="SkidataConnectionInfosDelete",e.SkidataConnectionInfosUpsert="SkidataConnectionInfosUpsert",e.SkidataSynchronize="SkidataSynchronize",e.TagCreate="TagCreate",e.TagDelete="TagDelete",e.TagUpdateName="TagUpdateName",e.TeamAssign="TeamAssign",e.TeamAssignmentRefuse="TeamAssignmentRefuse",e.TextMessageRepliesRead="TextMessageRepliesRead",e.TextMessageSend="TextMessageSend",e.TraceCreate="TraceCreate",e.TraceDelete="TraceDelete",e.TraceUpdate="TraceUpdate",e.TranslationUpdate="TranslationUpdate",e.UserAccessCreate="UserAccessCreate",e.UserAccessDelete="UserAccessDelete",e.UserAccessUpdate="UserAccessUpdate",e.UserCreate="UserCreate",e.UserDelete="UserDelete",e.UserInfoAccreditationsUpdate="UserInfoAccreditationsUpdate",e.UserInfoAdminCreate="UserInfoAdminCreate",e.UserInfoAdminDelete="UserInfoAdminDelete",e.UserInfoAndTermsUpdate="UserInfoAndTermsUpdate",e.UserInfoPositionsUpdate="UserInfoPositionsUpdate",e.UserInfoSlotsUpdate="UserInfoSlotsUpdate",e.UserInfoUpdate="UserInfoUpdate",e.UserInfoUpdateField="UserInfoUpdateField",e.UserProfileUpdate="UserProfileUpdate",e.UserRolesDelete="UserRolesDelete",e.UsersInfosExport="UsersInfosExport",e.UsersInfosMassAddEvent="UsersInfosMassAddEvent",e.UsersInfosMassCampaignSend="UsersInfosMassCampaignSend",e.UsersInfosMassDelegationAdd="UsersInfosMassDelegationAdd",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.UsersInfosMassDelete="UsersInfosMassDelete",e.UsersInfosMassEdit="UsersInfosMassEdit",e.UsersInfosMassFormAdd="UsersInfosMassFormAdd",e.UsersInfosMassFormRemove="UsersInfosMassFormRemove",e.UsersInfosMerge="UsersInfosMerge",e.VolunteerRegistrationAssignmentRefuse="VolunteerRegistrationAssignmentRefuse",e.VolunteerRegistrationDuplicate="VolunteerRegistrationDuplicate",e.VolunteerRegistrationTicketIdRegenerate="VolunteerRegistrationTicketIdRegenerate",e.VolunteerRegistrationUpdate="VolunteerRegistrationUpdate",e.VolunteerRegistrationUpdateField="VolunteerRegistrationUpdateField",e.VolunteersExport="VolunteersExport",e.VolunteersImport="VolunteersImport",e.VolunteersImportResult="VolunteersImportResult",e.VolunteersRegistrationsAccreditationsValidate="VolunteersRegistrationsAccreditationsValidate",e.VolunteersRegistrationsAdminAdd="VolunteersRegistrationsAdminAdd",e.VolunteersRegistrationsMassAccredit="VolunteersRegistrationsMassAccredit",e.VolunteersRegistrationsMassAccreditationStateUpdate="VolunteersRegistrationsMassAccreditationStateUpdate",e.VolunteersRegistrationsMassAssign="VolunteersRegistrationsMassAssign",e.VolunteersRegistrationsMassDelegationAdd="VolunteersRegistrationsMassDelegationAdd",e.VolunteersRegistrationsMassDelete="VolunteersRegistrationsMassDelete",e.VolunteersRegistrationsMassFormAdd="VolunteersRegistrationsMassFormAdd",e.VolunteersRegistrationsMassFormRemove="VolunteersRegistrationsMassFormRemove",e.VolunteersRegistrationsMassPreAssign="VolunteersRegistrationsMassPreAssign",e.VolunteersRegistrationsMassStateUpdate="VolunteersRegistrationsMassStateUpdate",e.VolunteersRegistrationsMassWishedAccreditationsUpdate="VolunteersRegistrationsMassWishedAccreditationsUpdate",e.WorkflowCreate="WorkflowCreate",e.WorkflowDuplicate="WorkflowDuplicate",e.WorkflowExecute="WorkflowExecute",e.WorkflowUpdate="WorkflowUpdate",e.WorkflowssMassDelete="WorkflowssMassDelete"}(MY||(MY={})),function(e){e.AccreditationsEmailsEstimate="AccreditationsEmailsEstimate",e.AssignmentsEmailsEstimate="AssignmentsEmailsEstimate",e.BackofficeEventUnarchive="BackofficeEventUnarchive",e.BackofficeInvoiceMarkAsPaid="BackofficeInvoiceMarkAsPaid",e.BackofficeInvoiceMarkAsRefunded="BackofficeInvoiceMarkAsRefunded",e.BackofficeOrganizationUpdate="BackofficeOrganizationUpdate",e.BackofficeOrganizationUserAdd="BackofficeOrganizationUserAdd",e.BackofficeOrganizationUserRemove="BackofficeOrganizationUserRemove",e.CampaignEstimate="CampaignEstimate",e.DelegationsExport="DelegationsExport",e.DelegationsImportResult="DelegationsImportResult",e.DomainDkimVerificationRetry="DomainDkimVerificationRetry",e.EmailFormInviteSend="EmailFormInviteSend",e.EmailResend="EmailResend",e.EmailSenderVerificationResend="EmailSenderVerificationResend",e.EventDocumentsExport="EventDocumentsExport",e.EventDocumentsExportResult="EventDocumentsExportResult",e.EventLayerUpdate="EventLayerUpdate",e.EventProfilePrivateFieldsUpdate="EventProfilePrivateFieldsUpdate",e.EventWeezeventUpdate="EventWeezeventUpdate",e.ExportResult="ExportResult",e.FormRegister="FormRegister",e.LoginCodeEmailCreate="LoginCodeEmailCreate",e.OrganizationProfilePrivateFieldsUpdate="OrganizationProfilePrivateFieldsUpdate",e.PositionsImportResult="PositionsImportResult",e.SegmentFolderMoveDown="SegmentFolderMoveDown",e.SegmentFolderMoveUp="SegmentFolderMoveUp",e.SegmentMoveDown="SegmentMoveDown",e.SegmentMoveUp="SegmentMoveUp",e.SegmentsFoldersReorder="SegmentsFoldersReorder",e.SkidataConnectionInfoSeaonEventAdd="SkidataConnectionInfoSeaonEventAdd",e.SkidataConnectionInfoSeaonEventDelete="SkidataConnectionInfoSeaonEventDelete",e.SkidataConnectionInfoSynchronizedEventAdd="SkidataConnectionInfoSynchronizedEventAdd",e.SkidataConnectionInfoSynchronizedEventDelete="SkidataConnectionInfoSynchronizedEventDelete",e.SkidataSynchronize="SkidataSynchronize",e.TextMessageRepliesRead="TextMessageRepliesRead",e.TranslationUpdate="TranslationUpdate",e.UserCreate="UserCreate",e.UserDelete="UserDelete",e.UserInfoAdminDelete="UserInfoAdminDelete",e.UserInfoAndTermsUpdate="UserInfoAndTermsUpdate",e.UsersInfosMassDelegationDelete="UsersInfosMassDelegationDelete",e.UserProfileUpdate="UserProfileUpdate",e.UsersInfosExport="UsersInfosExport",e.VolunteersExport="VolunteersExport",e.VolunteersImportResult="VolunteersImportResult"}(NY||(NY={}));const LY=e=>{const t=qn(Kc);return(0,i.jsxs)(Dc,{children:[(0,i.jsxs)(Ec,{align:"center",gap:"3",children:[(0,i.jsx)(Na,{align:"center",css:{background:"$primary300",borderRadius:"32px",color:"$primary600",height:"32px",width:"32px"},justify:"center",children:(0,i.jsx)(el,{icon:e.activity.icon})}),(0,i.jsx)(yr,{font:"gray900 textSm medium",children:e.activity.text})]}),(0,i.jsx)(Ec,{children:t.toLocaleString(e.activity.date.toLocal(),Js.DateTime)})]})},BY=()=>{const{translate:e,params:{organizationId:t}}=_l(),[n,s]=(0,L.useState)([]),[o,r]=(0,L.useState)([]),[a,l]=(0,L.useState)(Us.c9.invalid("Invalid")),[d,c]=(0,L.useState)(0),{data:u,isLoading:h}=Zn("query Activities(\n $organizationId: OrganizationId!\n $operations: [String!]\n $eventsIds: [EventId!]\n $date: Date\n $offset: Int\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n activities(\n operations: $operations\n eventsIds: $eventsIds\n date: $date\n limit: 25\n offset: $offset\n ) {\n nodes {\n date\n icon\n text\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,operations:n,eventsIds:o,date:a,offset:d},[]),{numberOfPages:m,totalCount:g}=ku(u.organization?.activities),p=(0,L.useMemo)(()=>{const t=Object.keys(NY);return Object.keys(MY).filter(e=>!t.includes(e)).map(t=>(0,i.jsx)("option",{value:t,children:e(t)},t))},[]);return(0,i.jsxs)(nj,{css:{overflowY:"auto"},children:[(0,i.jsx)(tj,{children:(0,i.jsx)(yr,{font:"gray900 displayXs semiBold",children:e("activit_95747")})}),(0,i.jsx)(ej,{children:(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,placeholder:e("op_ration_25453"),values:n,onChange:s,children:p})}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(bc,{isSearchVisible:!0,multiple:!0,placeholder:e("_v_nement_22345"),values:o,onChange:r,children:(u.organization?.events.nodes??[]).map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(yr,{width:200,children:(0,i.jsx)(Du,{value:a,onChange:l})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("Description")}),(0,i.jsx)(Vc,{children:e("Date")})]}),numberOfPages:m,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):u.organization.activities.nodes.map((e,t)=>(0,i.jsx)(LY,{activity:e},t)),setOffset:c,totalCount:g})})]})},VY=e=>{const{translate:t}=_l(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(VP,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(mN,{accreditationCategory:e.accreditationCategory,eventId:e.accreditationCategory.eventId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},UY=()=>{const{translate:e,params:{organizationId:t}}=_l(),{canOrganizationParamEdit:n}=SS(),[s,o,r]=Bc(""),[a,l]=(0,L.useState)(-1),[d,c]=(0,L.useState)(0),{data:u,isLoading:h,reload:g}=Zn("query OrganizationCategoriesAccreditations(\n $organizationId: OrganizationId!\n $name: String\n $eventId: EventId\n $offset: Int\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n accreditationsCategories(name: $name, eventId: $eventId, offset: $offset, limit: 25) {\n nodes {\n id\n eventId\n name\n numberOfAccreditations\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:m(o)?o:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=ku(u.organization?.accreditationsCategories),x=(0,L.useMemo)(()=>(0,lc.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),_=(0,L.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Vc,{children:e("_v_nement_22345")}),(0,i.jsx)(Vc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Vc,{width:100})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):u.organization.accreditationsCategories.nodes.map(e=>(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(qc,{to:es.ACCREDITATION_CATEGORY({organizationId:t,eventId:e.eventId,accreditationCategoryId:e.id}),children:e.name})}),(0,i.jsx)(Ec,{children:_[e.eventId]??""}),(0,i.jsx)(Ec,{children:e.numberOfAccreditations}),n&&(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsx)(VY,{accreditationCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},WY=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation CustomFieldCategoryDelete(\n $organizationId: OrganizationId!\n $customFieldCategoryId: CustomFieldsCategoryId!\n) {\n customFieldCategoryDelete(\n organizationId: $organizationId\n customFieldCategoryId: $customFieldCategoryId\n ) {\n id\n }\n}\n",e)}();return(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:[t("_tes_vous_s_r_d_50954")],text:t("suppression_de_73669",e.customFieldCategory.name),onClose:e.onClose,onDelete:async()=>{await n({organizationId:e.organizationId,customFieldCategoryId:e.customFieldCategory.id}),e.onSuccess()}})},GY=e=>{const{mutate:t}=function(e={}){return Xn("mutation CustomFieldCategoryUpdate(\n $organizationId: OrganizationId!\n $customFieldCategoryId: CustomFieldsCategoryId!\n $customFieldCategory: CustomFieldsCategoryInput!\n) {\n customFieldCategoryUpdate(\n organizationId: $organizationId\n customFieldCategoryId: $customFieldCategoryId\n customFieldCategory: $customFieldCategory\n ) {\n id\n name\n }\n}\n",e)}();return(0,i.jsx)(KC,{initialName:e.customFieldCategory.name,isEdit:!0,mutate:async n=>(await t({organizationId:e.organizationId,customFieldCategoryId:e.customFieldCategory.id,customFieldCategory:{name:n}})).customFieldCategoryUpdate,onClose:e.onClose,onSuccess:e.onSuccess})},HY=e=>{const{translate:t}=_l(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Gd,{color:0===e.customFieldCategory.numberOfCustomFields?"red":"disabled",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(GY,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(WY,{customFieldCategory:e.customFieldCategory,organizationId:e.organizationId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},qY=()=>{const{translate:e,params:{organizationId:t}}=_l(),{canOrganizationParamEdit:n}=SS(),[s,o,r]=Bc(""),[a,l]=(0,L.useState)(0),{data:d,isLoading:c,reload:u}=Zn("query OrganizationCategoriesCustomFields(\n $organizationId: OrganizationId!\n $name: String\n $offset: Int\n) {\n organization(id: $organizationId) {\n customFieldsCategories(name: $name, offset: $offset, limit: 25) {\n nodes {\n id\n name\n numberOfCustomFields\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:m(o)?o:void 0,offset:a},[]);const{numberOfPages:h,totalCount:g}=ku(d.organization?.customFieldsCategories);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Vc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Vc,{width:100})]}),numberOfPages:h,offset:a,rows:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):d.organization.customFieldsCategories.nodes.map(e=>(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:e.name}),(0,i.jsx)(Ec,{children:e.numberOfCustomFields}),n&&(0,i.jsx)(Yc,{justify:"end",children:(0,i.jsx)(HY,{customFieldCategory:e,organizationId:t,reload:u})})]},e.id)),setOffset:l,title:e("liste_des_cat_g_39450"),totalCount:g})]})},YY=e=>{const{translate:t}=_l(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(XC,{delegationCategory:e.delegationCategory,eventId:e.delegationCategory.eventId,organizationId:e.delegationCategory.organizationId,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(mS,{delegationCategory:e.delegationCategory,eventId:e.delegationCategory.eventId,organizationId:e.delegationCategory.organizationId,onClose:()=>{r(!1)},onSuccess:e.reload})]})},KY=()=>{const{translate:e,params:{organizationId:t}}=_l(),{canOrganizationParamEdit:n}=SS(),[s,o,r]=Bc(""),[a,l]=(0,L.useState)(-1),[d,c]=(0,L.useState)(0),{data:u,isLoading:h,reload:g}=Zn("query OrganizationCategoriesDelegations(\n $organizationId: OrganizationId!\n $name: String\n $eventId: EventId\n $offset: Int\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n delegationsCategories(\n level: Both\n name: $name\n eventId: $eventId\n offset: $offset\n limit: 25\n ) {\n nodes {\n id\n organizationId\n eventId\n name\n numberOfDelegations\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:m(o)?o:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=ku(u.organization?.delegationsCategories),x=(0,L.useMemo)(()=>(0,lc.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),_=(0,L.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Vc,{children:e("_v_nement_22345")}),(0,i.jsx)(Vc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Vc,{width:100})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):u.organization.delegationsCategories.nodes.map(s=>(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(qc,{to:ds.DELEGATION_CATEGORY({organizationId:t,eventId:s.eventId,delegationCategoryId:s.id}),children:s.name})}),(0,i.jsx)(Ec,{children:s.eventId?_[s.eventId]??"":e("communaut_20896")}),(0,i.jsx)(Ec,{children:s.numberOfDelegations}),n&&(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsx)(YY,{delegationCategory:s,reload:g})})]},s.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},ZY=e=>{const{translate:t}=_l(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{s(!0)},children:t("renommer_42135")}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{r(!0)},children:t("supprimer_43083")})]}),n&&(0,i.jsx)(IU,{eventId:e.positionCategory.eventId,positionCategoryId:e.positionCategory.id,positionCategoryName:e.positionCategory.name,onClose:()=>{s(!1)},onSuccess:e.reload}),o&&(0,i.jsx)(oG,{eventId:e.positionCategory.eventId,positionCategory:e.positionCategory,onClose:()=>{r(!1)},onSuccess:e.reload})]})},XY=()=>{const{translate:e,params:{organizationId:t}}=_l(),{canOrganizationParamEdit:n}=SS(),[s,o,r]=Bc(""),[a,l]=(0,L.useState)(-1),[d,c]=(0,L.useState)(0),{data:u,isLoading:h,reload:g}=Zn("query OrganizationCategoriesPositions(\n $organizationId: OrganizationId!\n $name: String\n $eventId: EventId\n $offset: Int\n) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n positionsCategories(name: $name, eventId: $eventId, offset: $offset, limit: 25) {\n nodes {\n id\n eventId\n name\n numberOfPositions\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:m(o)?o:void 0,eventId:-1!==a?a:void 0,offset:d},[]);const{numberOfPages:p,totalCount:f}=ku(u.organization?.positionsCategories),x=(0,L.useMemo)(()=>(0,lc.A)(u.organization?.events.nodes??[],e=>e.name.toLowerCase()),[u.organization]),_=(0,L.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.name])),[x]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Fc,{filters:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{width:200,children:(0,i.jsxs)(zu,{shouldParseAsInt:!0,value:a,onChange:e=>{l(e)},children:[(0,i.jsx)("option",{value:"-1",children:e("tous_les_v_nem_16033")}),x.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})}),(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e("rechercher_une_66722"),value:s,onChange:r})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("nom_de_la_cat_g_03860")}),(0,i.jsx)(Vc,{children:e("_v_nement_22345")}),(0,i.jsx)(Vc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Vc,{width:100})]}),numberOfPages:p,offset:d,rows:h?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):u.organization.positionsCategories.nodes.map(e=>(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(qc,{to:ps.POSITION_CATEGORY({organizationId:t,eventId:e.eventId,positionCategoryId:e.id}),children:e.name})}),(0,i.jsx)(Ec,{children:_[e.eventId]??""}),(0,i.jsx)(Ec,{children:e.numberOfPositions}),n&&(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsx)(ZY,{positionCategory:e,reload:g})})]},e.id)),setOffset:c,title:e("liste_des_cat_g_39450"),totalCount:f})]})},JY=()=>{const{translate:e,params:{organizationId:t}}=_l();return(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsx)(yr,{font:"gray900 displayXs semiBold",children:e("cat_gories_24533")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(rj,{children:[(0,i.jsxs)(sj,{children:[(0,i.jsx)(ij,{path:$s.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(t),children:e("champs_de_formu_64126")}),(0,i.jsx)(ij,{path:$s.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(t),children:e("missions_63972")}),(0,i.jsx)(ij,{path:$s.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(t),children:e("accr_ditations_39450")}),(0,i.jsx)(ij,{path:$s.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(t),children:e("d_l_gations_78318")})]}),(0,i.jsx)(oj,{path:$s.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(qY,{})}),(0,i.jsx)(oj,{path:$s.ORGANIZATION_PARAMETERS_CATEGORIES_POSITIONS(":organizationId"),children:(0,i.jsx)(XY,{})}),(0,i.jsx)(oj,{path:$s.ORGANIZATION_PARAMETERS_CATEGORIES_ACCREDITATIONS(":organizationId"),children:(0,i.jsx)(UY,{})}),(0,i.jsx)(oj,{path:$s.ORGANIZATION_PARAMETERS_CATEGORIES_DELEGATIONS(":organizationId"),children:(0,i.jsx)(KY,{})})]})]})},QY=e=>{const{params:{organizationId:t},translate:n}=_l(),s=rg(t,e.linkPath);return(0,i.jsxs)(Na,{align:"start",gap:"6",children:[(0,i.jsx)(ab,{heading:n("DelegationSpaceLink"),children:(0,i.jsx)(LS,{heading:n("lien_de_l_espac_85081"),link:s,qrCodeDescription:n("facilitez_la_co_59826")})}),(0,i.jsx)(ab,{heading:n("iframe_27513"),children:(0,i.jsx)(NS,{alert:e.alert,heading:e.iframeLabel,iframeLabel:e.iframeLabel,link:s})})]})},eK=e=>{const{params:{organizationId:t},translate:n}=_l();return(0,i.jsxs)(TE,{heading:e.heading,children:[e.showLogo&&(0,i.jsx)(zE,{heading:n("logo_18191"),children:(0,i.jsx)(fC,{hint:n("nous_recommando_20904"),label:n("s_lectionnez_un_82734"),organizationId:t,prefix:"design.logo."})}),(0,i.jsx)(zE,{heading:n("banni_re_86634"),children:(0,i.jsx)(fC,{hint:n("taille_de_l_ima_84109"),label:n("s_lectionnez_un_82734"),organizationId:t,prefix:"design.banner."})})]})},tK=()=>{const{params:{organizationId:e},translate:t}=_l(),{data:n,loader:s}=ca({organizationId:e,includeIntro:!1,spaceType:Ct.DelegationSpace}),{mutate:o}=ua(),r=qn(SE);return s||(0,i.jsx)(Cl,{direction:"column",initialValues:{design:r.organizationDesignInputDefault(n.organization.spaceDesign)},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(cb,{footerActions:(0,i.jsx)(Bb,{rolesTypes:pI,children:(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:n,onClick:e,children:t("enregistrer_06519")})})}),heading:t("design_15043"),hideHeader:!0,children:[(0,i.jsx)(eK,{heading:t("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(OE,{})]}),onSubmit:async t=>await o({organizationId:e,spaceDesign:t.design,spaceType:Ct.DelegationSpace})})},nK=()=>{const{params:{organizationId:e},translate:t}=_l(),[n,s]=(0,L.useState)(Oe.Code);return(0,i.jsx)(ab,{children:(0,i.jsx)(Na,{direction:"column",children:(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"6",children:[(0,i.jsx)(ul,{children:t("liste_des_e_mai_73508")}),(0,i.jsxs)(kc,{children:[(0,i.jsx)(jc,{children:(0,i.jsx)(Vc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(gE,{isSelected:n===Oe.Code,subtitle:t("cet_e_mail_est_80490"),title:t("code_20843"),onClick:()=>s(Oe.Code)})]})]}),(0,i.jsx)(yr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Na,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(fE,{emailType:n,eventId:null,formId:null,organizationId:e,source:Qe.DelegationsSpace})})]})})})},iK=e=>{const t=Yn(),n="badge"===e.type?e.badge:e.customDocument.slug,s=qn(Kc);return(0,i.jsxs)(Na,{align:"center",css:{borderBottom:"1px solid $gray200",padding:"$4 $6","&:last-child":{borderBottom:"none"}},gap:"3",children:[(0,i.jsx)(Na,{align:"center",css:{background:"$blueGray100",borderRadius:"12px",color:"$blueGray700"},height:40,justify:"center",width:40,children:(0,i.jsx)(el,{icon:"file-lines"})}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",children:[(0,i.jsx)(cl,{textStyle:"heading",children:"badge"===e.type?P_(e.badge):`${e.customDocument.event.name} - ${e.customDocument.name}`}),(0,i.jsx)(cl,{textStyle:"subtitle",children:t("ajout_par_1_48224",e.customDocument.createdBy.name,s.toLocaleString(e.customDocument.insertedAt.toLocal(),Js.DateTime))})]}),(0,i.jsx)(ju,{value:e.delegationsSpaceCustomBadges.includes(n),onChange:t=>{e.change("delegationsSpaceCustomBadges",so(e.delegationsSpaceCustomBadges,n,t))},children:t("document_t_l_ch_56704")})]})},sK=()=>{const{params:{organizationId:e},translate:t}=_l(),{data:n,loader:s}=Zn("query OrganizationDelegationSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n customBadges\n allowDelegationSpaceDownload\n delegationsSpaceCustomBadges\n\n customDocuments {\n id\n slug\n name\n\n event {\n id\n name\n }\n\n insertedAt\n createdBy {\n ...CreatedBy\n }\n }\n }\n}\n",{organizationId:e},[Ls.CreatedByFragment]),{mutate:o}=function(e={}){return Xn("mutation OrganizationDelegationSpaceSettingsUpdate(\n $organizationId: OrganizationId!\n $delegationSpaceSettings: DelegationSpaceSettingsInput!\n) {\n organizationDelegationSpaceSettingsUpdate(\n organizationId: $organizationId\n delegationSpaceSettings: $delegationSpaceSettings\n ) {\n id\n }\n}\n",e)}(),r=(0,L.useMemo)(()=>(0,lc.A)(n.organization?.customDocuments??[],e=>`${e.event.name} - ${e.name}`.toLowerCase()),[n.organization]);return s||(0,i.jsx)(Cl,{direction:"column",initialValues:{allowDelegationSpaceDownload:n.organization.allowDelegationSpaceDownload,delegationsSpaceCustomBadges:n.organization.delegationsSpaceCustomBadges},render:({form:e,handleSubmit:s,submitting:o,values:a})=>(0,i.jsxs)(cb,{footerActions:(0,i.jsx)(Bb,{rolesTypes:pI,children:(0,i.jsx)(El,{isLoading:o,onClick:s,children:t("enregistrer_06519")})}),heading:t("Documents"),subtitle:t("personnaliser_l_64606"),children:[(0,i.jsx)(zE,{heading:t("allow_documents_96106"),children:(0,i.jsx)(Hm,{name:"allowDelegationSpaceDownload",children:t("allow_delegatio_08622")})}),a.allowDelegationSpaceDownload&&(0,i.jsx)(zE,{heading:t("documents_dispo_46996"),children:(0,i.jsxs)(Na,{css:{border:"1px solid $gray200",borderRadius:"$2",flex:"1",overflow:"hidden"},direction:"column",children:[n.organization.customBadges.map(t=>(0,i.jsx)(iK,{badge:t,change:e.change,delegationsSpaceCustomBadges:a.delegationsSpaceCustomBadges,type:"badge"},t)),r.map(t=>(0,i.jsx)(iK,{change:e.change,customDocument:t,delegationsSpaceCustomBadges:a.delegationsSpaceCustomBadges,type:"customDocument"},t.id))]})})]}),onSubmit:async t=>{await o({organizationId:e,delegationSpaceSettings:t})}})},oK=()=>{const{translate:e,params:{organizationId:t}}=_l();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tj,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(ul,{children:e("espace_d_l_gati_59251")}),(0,i.jsxs)(sj,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:t}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(ej,{css:{overflowY:"auto"},children:(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(oj,{path:bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(tK,{})}),(0,i.jsx)(oj,{path:bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(QY,{alert:(0,i.jsxs)(hl,{alertStyle:"warning",children:[(0,i.jsx)(ml,{children:e("comment_marche_79958")}),(0,i.jsx)(gl,{children:e("ce_code_va_vous_19546")})]}),iframeLabel:e("code_html_pour_86852"),linkPath:hi(bi.ORGANIZATION_DELEGATIONS({organizationId:t}))})}),(0,i.jsx)(oj,{path:bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(nK,{})}),(0,i.jsx)(oj,{path:bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(sK,{})})]})})]})},rK=e=>{const t=Yn(),{isLoading:n,copy:s}=FS(),{isLoading:o,copy:r}=FS();return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsxs)(Na,{align:"center",css:{"& i":{cursor:"pointer"}},children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{width:20,children:n?(0,i.jsx)(el,{icon:"loader"}):(0,i.jsx)(el,{icon:"copy",onClick:()=>s(e.name)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("copier_75889")})]}),e.name]})}),(0,i.jsx)(Ec,{width:100,children:e.type}),(0,i.jsx)(Ec,{children:(0,i.jsxs)(Na,{align:"center",css:{"& i":{cursor:"pointer"}},gap:"1",children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{width:20,children:o?(0,i.jsx)(el,{icon:"loader"}):(0,i.jsx)(el,{icon:"copy",onClick:()=>r(e.value)})})}),(0,i.jsx)(Cm,{placement:"top",children:t("copier_75889")})]}),e.value]})})]})},aK=e=>{const t=Yn(),{mutate:n,isLoading:s}=function(e={}){return Xn("mutation DomainDkimVerificationRetry(\n $organizationId: OrganizationId!\n $eventId: EventId\n $domain: String!\n) {\n domainDkimVerificationRetry(organizationId: $organizationId, eventId: $eventId, domain: $domain)\n}\n",e)}();return(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{children:e.domain.status===Ae.Failed&&(0,i.jsx)(El,{color:"white",isLoading:s,leftIcon:"arrows-rotate",size:"sm",onClick:async()=>{await n({organizationId:e.organizationId,domain:e.domain.name}),e.reload()},children:t("r_essayer_43543")})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:t("nom_08311")}),(0,i.jsx)(Vc,{width:100,children:t("type_35427")}),(0,i.jsx)(Vc,{children:t("valeur_22437")})]}),numberOfPages:0,offset:0,rows:(0,i.jsxs)(i.Fragment,{children:[e.domain.dnsEntries.map((e,t)=>(0,i.jsx)(rK,{name:e.name,type:e.type,value:e.value},t)),(0,i.jsx)(rK,{name:`_dmarc.${e.domain.name}`,type:"TXT",value:"v=DMARC1; p=quarantine; adkim=r;"})]}),setOffset:Ql.A,title:(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{font:"gray900 textMd semiBold",children:t("liste_des_entr_35559",e.domain.name)}),e.domain.status===Ae.Success&&(0,i.jsx)(ic,{color:"success",leftIcon:"circle",leftIconStyle:"solid",children:t("vos_entr_es_dns_05106")}),e.domain.status===Ae.Pending&&(0,i.jsx)(ic,{color:"warning",leftIcon:"circle",leftIconStyle:"solid",children:t("vos_entr_es_dns_31271")}),e.domain.status===Ae.Failed&&(0,i.jsx)(ic,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:t("la_v_rification_65771")})]}),totalCount:0})},lK=e=>{const{history:t,translate:n}=_l(),{data:s,loader:o,reload:r}=Zn("query OrganizationDomains($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n domains {\n name\n status\n\n dnsEntries {\n name\n type\n value\n }\n }\n }\n}\n",{organizationId:e.organizationId},[]);return o||(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),0===s.organization.domains.length?(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{height:250,width:1,children:(0,i.jsx)(Nk,{imageSrc:pd.DnsBlank,subtitle:n("pour_avoir_acc_02742"),title:n("les_entr_es_dns_52899")})}),(0,i.jsxs)(Na,{gap:"3",justify:"center",children:[(0,i.jsx)(El,{color:"white",onClick:()=>{open("https://support.weezevent.com/fr/param%C3%A9trer-ladresse-e-mail-de-lexp%C3%A9diteur")},children:n("lire_la_documen_25597")}),(0,i.jsx)(Bb,{rolesTypes:pI,children:(0,i.jsx)(El,{onClick:()=>{t.push($s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("ajouter_un_met_38216")})})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sl,{color:"gray",leftIcon:"circle-exclamation",children:n("les_entr_es_dns_55177")}),s.organization.domains.map((t,n)=>(0,i.jsxs)(L.Fragment,{children:[(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(aK,{domain:t,organizationId:e.organizationId,reload:r})]},n))]})]})},dK=e=>{const{history:t,translate:n}=_l(),{mutate:s}=function(e={}){return Xn("mutation EmailSenderDuplicate($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDuplicate(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:o}=function(e={}){return Xn("mutation EmailSenderDelete($organizationId: OrganizationId!, $emailSenderId: EmailsSenderId!) {\n emailSenderDelete(organizationId: $organizationId, emailSenderId: $emailSenderId) {\n id\n }\n}\n",e)}(),{mutate:r}=function(e={}){return Xn("mutation EmailSenderVerificationResend(\n $organizationId: OrganizationId!\n $emailSenderId: EmailsSenderId!\n) {\n emailSenderVerificationResend(organizationId: $organizationId, emailSenderId: $emailSenderId)\n}\n",e)}(),[a,l]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{align:"center",css:{padding:"$3 $4"},gap:"3",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsxs)(Na,{align:"center",gap:"2",children:[(0,i.jsx)(yr,{color:"gray800",fontWeight:"medium",children:e.emailSender.name}),!e.emailSender.isValidToSendEmail&&(0,i.jsx)(ic,{color:"error",leftIcon:"circle",leftIconStyle:"solid",children:n("e_mail_non_conf_40343")})]}),(0,i.jsx)(yr,{color:"gray500",children:e.emailSender.from})]}),(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(El,{color:"white",onClick:()=>{t.push($s.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId,e.emailSender.id))},children:n("_diter_62574")})}),(0,i.jsx)(El,{color:"white",onClick:()=>{t.push($s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(e.organizationId,e.emailSender.id))},children:n("aper_u_25595")}),(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsxs)(Bd,{children:[(0,i.jsx)(Yd,{children:(0,i.jsx)(El,{color:"white",leftIcon:"ellipsis-vertical"})}),(0,i.jsxs)(qd,{placement:"bottom-end",children:[!e.emailSender.isValidToSendEmail&&(0,i.jsx)(Gd,{icon:"paper-plane",onClick:async()=>{await r({organizationId:e.organizationId,emailSenderId:e.emailSender.id})},children:n("r_envoyer_l_e_91472")}),(0,i.jsx)(Gd,{icon:"clone",onClick:async()=>{await s({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()},children:n("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:()=>{l(!0)},children:n("supprimer_43083")})]})]})})]}),a&&(0,i.jsx)(sA,{buttonText:n("supprimer_43083"),subtext:n("_tes_vous_s_r_d_90786"),text:n("suppression_de_73669",e.emailSender.from),onClose:()=>{l(!1)},onDelete:async()=>{await o({organizationId:e.organizationId,emailSenderId:e.emailSender.id}),e.reload()}})]})},cK=e=>{const t=Yn();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{font:"gray900 textLg medium",children:t("liste_des_mett_28960")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Na,{css:{border:"1px solid $gray200",borderRadius:"$2","& > div:not(:last-child)":{borderBottom:"1px solid $gray200"}},direction:"column",children:e.emailsSenders.map(t=>(0,i.jsx)(dK,{emailSender:t,organizationId:e.organizationId,reload:e.reload},t.id))})]})},uK=e=>{const{history:t,translate:n}=_l(),{data:s,loader:o,reload:r}=Zn("query EmailsSenders($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n emailsSenders {\n id\n name\n from\n fromEmail\n isValidToSendEmail\n }\n }\n}\n",{organizationId:e.organizationId},[]);const[a,l]=(0,L.useState)(null),d=(0,L.useMemo)(()=>(s.organization?.emailsSenders??[]).filter(e=>!e.isValidToSendEmail),[s.organization]);return(0,L.useEffect)(()=>{!o&&s.organization.emailsSenders.length>0&&null===a&&l(s.organization.emailsSenders[0].id)},[o,a,s.organization?.emailsSenders,l]),o||(0===s.organization.emailsSenders.length?(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{height:250,width:1,children:(0,i.jsx)(Nk,{subtitle:n("cr_er_des_mett_38995"),title:n("aucun_metteur_96777")})}),(0,i.jsx)(Bb,{rolesTypes:pI,children:(0,i.jsx)(Na,{justify:"center",children:(0,i.jsx)(El,{onClick:()=>{t.push($s.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(e.organizationId))},children:n("cr_er_un_mette_14030")})})})]}):(0,i.jsxs)(i.Fragment,{children:[no(d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(sl,{color:"error",leftIcon:"circle-exclamation",children:[n("veuillez_confir_10865"),(0,i.jsx)("ul",{children:d.map(e=>(0,i.jsx)("li",{children:e.fromEmail},e.id))})]})]}),(0,i.jsx)(cK,{emailsSenders:s.organization.emailsSenders,organizationId:e.organizationId,reload:r})]}))},hK=()=>{const{history:e,translate:t,params:{organizationId:n}}=_l(),s=location.pathname.endsWith("emails/senders");return(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,width:1,children:[(0,i.jsxs)(Na,{children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray900 displayXs semiBold",children:t("e_mails_09850")}),(0,i.jsx)(yr,{color:"gray500",children:t("param_trer_les_39470")})]}),s&&(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(El,{onClick:()=>{e.push($s.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n))},children:t("cr_er_une_nouve_77052")})})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(rj,{children:[(0,i.jsxs)(sj,{children:[(0,i.jsx)(ij,{path:$s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),children:t("_metteurs_74545")}),(0,i.jsx)(ij,{path:$s.ORGANIZATION_PARAMETERS_EMAILS_DNS(n),children:t("entr_es_dns_11256")})]}),(0,i.jsx)(oj,{path:$s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(n),children:(0,i.jsx)(uK,{organizationId:n})}),(0,i.jsx)(oj,{path:$s.ORGANIZATION_PARAMETERS_EMAILS_DNS(n),children:(0,i.jsx)(lK,{organizationId:n})})]})]})};let mK=class extends Ul{constructor(e){super(e)}settingsDesignInputSchema(){return d.Ik().shape({title:d.Yj().required(),description:d.Yj()})}settingsInputSchema(){return d.Ik().shape({events:d.YO().of(d.Ik().shape({buttonText:d.Yj().required(),eventId:d.ai().required(),formId:d.ai().nullable()}))})}};mK=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],mK);const gK=()=>{const{translate:e}=_l();return(0,i.jsx)(TE,{heading:e("contenu_persona_18596"),subtitle:e("personnaliser_l_09507"),children:(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[(0,i.jsx)(Ll,{label:e("titre_de_l_intr_54141"),name:"settings.title"}),(0,i.jsx)(Ll,{label:e("contenu_29668"),name:"settings.description"})]})})},pK=()=>{const{params:{organizationId:e},translate:t}=_l(),{data:n,loader:s}=ca({organizationId:e,includeIntro:!0,spaceType:Ct.EventsShowcase}),{mutate:o}=ua(),r=qn(Ba),a=qn(SE),l=qn(mK);return s||(0,i.jsx)(Cl,{direction:"column",initialValues:{design:a.organizationDesignInputDefault(n.organization.spaceDesign),settings:{title:n.organization.eventsShowcaseSettings.title??t("liste_des_v_ne_29929"),description:n.organization.eventsShowcaseSettings.description??t("visualiser_tous_33187")}},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(cb,{footerActions:(0,i.jsx)(Bb,{rolesTypes:pI,children:(0,i.jsx)(El,{isLoading:n,onClick:e,children:t("enregistrer_06519")})}),heading:t("design_15043"),hideHeader:!0,children:[(0,i.jsx)(gK,{}),(0,i.jsx)(eK,{heading:t("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(OE,{})]}),validate:r.validateForForm(l.settingsInputSchema()),onSubmit:async t=>await o({organizationId:e,settings:t.settings,spaceDesign:t.design,spaceType:Ct.EventsShowcase})})},fK=L.forwardRef(({shouldLightDismiss:e=!0,initialOpen:t=!1,isOpen:n,setIsOpen:s,onClose:o,children:r,...a},l)=>{const[d,c]=L.useState(t),u=L.useRef(null),h=n??d,m=s??c;return L.useEffect(()=>{const e=u.current;return h?function(e){e&&!e.open&&e.showModal()}(e):e?.close(),()=>{e?.close()}},[h]),L.useEffect(()=>{const t=u.current;function n(e){e.preventDefault(),e.stopPropagation(),a.onClose?.(),m(!1)}function i(e){const{target:t}=e;t instanceof Element&&"DIALOG"===t.nodeName&&n(e)}function s(e){"Escape"===e.code&&n(e)}return e&&t?.addEventListener("click",i),t?.addEventListener("keydown",s),()=>{e&&t?.removeEventListener("click",i),t?.removeEventListener("keydown",s)}},[e,m]),L.useImperativeHandle(l,()=>({close(){m(!1)},showModal(){m(!0)},isOpen:()=>h,addEventListener(e,t,n){u.current?.addEventListener(e,t,n)},removeEventListener(e,t,n){u.current?.removeEventListener(e,t,n)}}),[h,m]),(0,i.jsxs)(i.Fragment,{children:[false,(0,i.jsx)("dialog",{ref:u,"aria-describedby":a["aria-describedby"],"aria-description":a["aria-description"],"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"],style:a.style,onClose:o,children:r})]})});fK.displayName="Dialog";const xK=({children:e,descId:t,labelId:n,isOpen:s,size:o,setIsOpen:r,...a})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n dialog::backdrop {\n background: rgba(52, 64, 84, 0.7)\n }\n "}}),(0,i.jsx)(fK,{"aria-describedby":t,"aria-labelledby":n,"data-testid":"modal-body",isOpen:s,setIsOpen:r,style:{border:"none",borderRadius:"var(--radii-3)",padding:0,inlineSize:"70vw",blockSize:"fit-content",maxWidth:"688px"},onClose:a.onClose,children:(0,i.jsx)(Na,{align:"center",direction:"column",...a,children:e})})]}),_K=({heading:e,leftIcon:t,leftIconColor:n,leftIconBorder:s,setIsOpen:o,...r})=>{const{translate:a}=_l();return(0,i.jsxs)(Na,{as:"header",css:{alignItems:"flex-start",alignSelf:"stretch",background:"$white",borderBlockEnd:"1px solid $gray200"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(Na,{css:{alignItems:"center",alignSelf:"stretch",padding:"$6 $7 $5 $7"},gap:"4",children:[t&&(0,i.jsx)(Na,{align:"center",css:{padding:"$3",bd:!0,border:s},justify:"center",children:(0,i.jsx)(Na,{align:"center",height:24,justify:"center",width:24,children:(0,i.jsx)(el,{className:"fa-xl",color:n,icon:t})})}),(0,i.jsx)(Na,{css:{alignItems:"flex-start",flex:1},direction:"column",justify:"center",children:e})]}),(0,i.jsx)(Na,{align:"center",css:{padding:"$2",height:"$space$9",width:"$space$9",position:"absolute",right:"$space$4",top:"$space$4"},justify:"center",children:(0,i.jsx)(El,{"aria-label":a("close_dialog_50926"),color:"invisible",css:{color:"$gray500",width:"$space$6",height:"$space$6",padding:0},textAlign:"center",onClick:()=>o(!1),children:(0,i.jsx)("i",{className:"far fa-xmark"})})}),r.children]})},IK=e=>(0,i.jsx)(Na,{css:{alignSelf:"stretch",alignItems:"start",padding:"$6",overflowY:"auto",...e.css},direction:"column",gap:"6",children:e.children}),vK=({handleSubmit:e,isSubmitDisabled:t=!1,setIsOpen:n,submitStyle:s,submitText:o,...r})=>{const{translate:a}=_l();return(0,i.jsxs)(Na,{as:"footer",css:{alignItems:"flex-end",alignSelf:"stretch",background:"$white",borderBlockStart:"1px solid $gray200",padding:"$6"},direction:"column",gap:"4",...r,children:[(0,i.jsxs)(Na,{align:"center",gap:"4",justify:"end",children:[(0,i.jsx)(El,{color:"white",onClick:()=>n(!1),children:a("annuler_48254")}),(0,i.jsx)(El,{color:s,disabled:t,onClick:()=>e(),children:o??a("submit_21373")})]}),r.children]})},bK=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_K,{heading:(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(ul,{id:e.labelId,textStyle:"heading",children:e.heading}),e.subtitle&&(0,i.jsx)(cl,{id:e.descId,textStyle:"subtitle",children:e.subtitle})]}),id:e.labelId,leftIcon:e.leftIcon,leftIconBorder:e.leftIconBorder,leftIconColor:e.leftIconColor,setIsOpen:e.setIsOpen}),(0,i.jsx)(IK,{id:e.descId,children:e.children}),(0,i.jsx)(vK,{handleSubmit:()=>{e.setValue(),e.setIsOpen(!1)},setIsOpen:e.setIsOpen,submitStyle:e.submitStyle,submitText:e.submitText})]}),jK=({role:e,setShowModal:t,showModal:n,...s})=>{const[o,r]=(0,L.useState)(!1),a=Ga();return(0,L.useEffect)(()=>(r(!(!n||o)),()=>{r(!1)}),[n]),(0,i.jsx)(xK,{descId:a.descId,isOpen:o,labelId:a.labelId,role:e,setIsOpen:r,size:"md",onClose:()=>{t(null)},children:(0,i.jsx)(bK,{descId:a.descId,labelId:a.labelId,setIsOpen:r,...s,children:s.children})})},CK=e=>{const{params:{organizationId:t},translate:n}=_l(),{data:s,loader:o}=Zn("query EventModalFormSelector($organizationId: OrganizationId!, $eventId: EventId!) {\n organization(id: $organizationId) {\n forms(level: Event, eventId: $eventId) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,eventId:e.eventId},[]);return o||(no(s.organization.forms.nodes)?(0,i.jsxs)(zu,{label:n("avez_quel_formu_13642"),shouldParseAsInt:!0,value:e.formId??-1,onChange:e.setFormId,children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:n("s_lectionner_un_13356")}),s.organization.forms.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,title:n("you_have_no_for_84347")}))},yK=e=>{const{translate:t}=_l(),[n,s]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{!n&&e.linkedFormId&&e.setLinkedFormId(null)},[n,e.linkedFormId]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ul,{textStyle:"smallcapsheading",children:t("personnalisatio_98369")}),(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(Nl,{label:t("personnalisatio_58948"),value:e.buttonText,onChange:e.setButtonText}),(0,i.jsx)(ju,{value:n,onChange:s,children:(0,i.jsx)(yr,{children:t("l_v_nement_est_24339")})}),n&&(0,i.jsx)(CK,{eventId:e.eventId,formId:e.linkedFormId,setFormId:e.setLinkedFormId})]})]})},kK=e=>{const{params:{organizationId:t},translate:n}=_l(),[s,o]=(0,L.useState)(void 0),[r,a]=(0,L.useState)(n("s_inscrire_20304")),[l,d]=(0,L.useState)(null),{data:c,loader:u}=Zn("query EventsShowcaseAddEventModal($organizationId: OrganizationId!, $existingEventIds: [EventId]!) {\n organization(id: $organizationId) {\n events(excludedEventIds: $existingEventIds) {\n nodes {\n id\n name\n }\n }\n }\n}\n",{organizationId:t,existingEventIds:e.eventIds},[]);return(0,i.jsx)(jK,{heading:n("nouvel_v_nemen_99684"),isSubmitDisabled:!s,leftIcon:"building",leftIconBorder:"gray200",leftIconColor:"gray800",setShowModal:e.setShowModal,setValue:()=>e.setValue({eventId:s,formId:l,buttonText:r}),showModal:e.showModal,submitText:n("ajouter_97327"),subtitle:n("ajouter_et_pers_06084"),children:e.eventIds&&u||(no(c.organization.events.nodes)?(0,i.jsxs)(Na,{css:{inlineSize:"100%"},direction:"column",gap:"4",children:[(0,i.jsxs)(zu,{label:n("quel_v_nement_57240"),shouldParseAsInt:!0,value:s??-1,onChange:o,children:[(0,i.jsx)("option",{disabled:!0,hidden:!0,value:-1,children:n("s_lectionner_un_57793")}),c.organization.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]}),s&&(0,i.jsx)(Na,{css:{bd:!0,borderRadius:"$1",backgroundColor:"$gray50",padding:"$4"},direction:"column",gap:"3",children:(0,i.jsx)(yK,{buttonText:r,eventId:s,linkedFormId:l,setButtonText:a,setLinkedFormId:d})})]}):(0,i.jsx)(Nk,{imageSrc:pd.WeezeventBlankPerson,title:n("you_have_no_oth_58056")}))})},AK=e=>(0,i.jsx)(jK,{...e,leftIcon:"trash-can",leftIconBorder:"gray200",leftIconColor:"gray800",role:"alertdialog",submitStyle:"error"}),wK=e=>{const{translate:t}=_l(),[n,s]=(0,L.useState)(e.event.buttonText),[o,r]=(0,L.useState)(!!e.event.formId),[a,l]=(0,L.useState)(e.event.formId??null);return(0,L.useEffect)(()=>{!o&&a&&l(null)},[o,a]),(0,i.jsx)(jK,{heading:t("mettre_jour_l_28846"),leftIcon:"building",leftIconBorder:"gray800",leftIconColor:"gray200",setShowModal:e.setShowModal,setValue:()=>e.setValue({eventId:e.event.eventId,formId:a,buttonText:n}),showModal:e.showModal,submitText:t("ajouter_97327"),subtitle:t("personalise_the_05652"),children:(0,i.jsxs)(ab,{gap:"3",children:[(0,i.jsx)(ul,{textStyle:"smallcapsheading",children:t("personnalisatio_98369")}),(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(Nl,{label:t("personnalisatio_58948"),value:n,onChange:s}),(0,i.jsx)(ju,{value:o,onChange:r,children:(0,i.jsx)(yr,{children:t("l_v_nement_est_24339")})}),o&&(0,i.jsx)(CK,{eventId:e.event.eventId,formId:a,setFormId:l})]})]})})},SK=e=>{const{translate:t}=_l(),[n,s]=(0,L.useState)(null),[o,r]=(0,L.useState)(null),a=(0,L.useMemo)(()=>e.events?.find(t=>t.id===e.showcaseEvent.eventId)?.name??"",[e.showcaseEvent,e.events]),l=(0,L.useMemo)(()=>e.forms?.find(t=>t.id===e.showcaseEvent.formId)?.name??"",[e.showcaseEvent,e.forms]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{...e.draggableProvided.draggableProps,ref:e.draggableProvided.innerRef,align:"center",css:{padding:"$4 $6",borderBlockStart:"1px solid $gray200"},gap:"2",children:[(0,i.jsx)(yr,{color:"gray300",css:{cursor:"pointer"},...e.draggableProvided.dragHandleProps,children:(0,i.jsx)(el,{icon:"grip-vertical",iconStyle:"solid"})}),(0,i.jsxs)(Na,{css:{alignItems:"center"},gap:"4",children:[(0,i.jsx)(cl,{textStyle:"subheading",children:a}),e.showcaseEvent.formId&&(0,i.jsx)(ic,{leftIcon:"pen",children:t("linked_to_form_64790",l)})]}),(0,i.jsx)(yr,{css:{flex:"1"}}),(0,i.jsxs)(Na,{gap:"2",children:[(0,i.jsx)(El,{color:"white",leftIcon:"pen-line",onClick:()=>r(e.showcaseEvent.eventId)}),(0,i.jsx)(El,{color:"white",leftIcon:"trash-can",onClick:()=>s(e.showcaseEvent.eventId)})]})]}),n&&n===e.showcaseEvent.eventId&&(0,i.jsx)(AK,{heading:t("vous_tes_sur_l_04795"),setShowModal:s,setValue:()=>{e.form.change("events",ao(e.values.events,e.values.events.findIndex(t=>t.eventId===e.showcaseEvent.eventId)))},showModal:!!n,submitText:t("oui_supprimer_57212"),subtitle:t("la_suppression_96669"),children:(0,i.jsx)(cl,{children:t("vous_tes_sur_l_80749",a)})}),o&&o===e.showcaseEvent.eventId&&(0,i.jsx)(wK,{event:e.showcaseEvent,setShowModal:r,setValue:t=>{e.form.change("events",e.values.events.map(n=>n.eventId===e.showcaseEvent.eventId?t:n))},showModal:!!o})]})},EK=e=>{const{translate:t}=_l(),n=(0,L.useCallback)(({reason:t,source:n,destination:i})=>{"DROP"===t&&i&&n.index!==i.index&&e.form.change("events",ro(e.values.events,n.index,i.index))},[e.values.events,e.form]);return(0,i.jsx)(fu.JY,{onDragEnd:n,children:(0,i.jsx)(fu.gL,{droppableId:"main",type:"accreditation",children:n=>(0,i.jsx)(Na,{css:{bd:!0,"& > div:first-child":{borderBlockStart:"none !important"}},direction:"column",...n.droppableProps,ref:n.innerRef,children:no(e.values.events)?(0,i.jsxs)(i.Fragment,{children:[e.values.events.map((t,n)=>(0,i.jsx)(fu.sx,{draggableId:`a-${t.eventId}`,index:n,children:n=>(0,i.jsx)(SK,{draggableProvided:n,showcaseEvent:t,...e},t.eventId)},t.eventId)),n.placeholder]}):(0,i.jsx)(yr,{css:{padding:"$4"},children:(0,i.jsx)(Nk,{title:t("no_events_selec_80121")})})})})})},TK=()=>{const{params:{organizationId:e},translate:t}=_l(),[n,s]=(0,L.useState)(!1),{data:o,loader:r}=Zn("query OrganizationEventsShowcaseSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events {\n nodes {\n id\n name\n }\n }\n\n forms(level: Event) {\n nodes {\n id\n name\n }\n }\n\n eventsShowcaseSettings {\n title\n description\n events {\n eventId\n buttonText\n formId\n }\n }\n }\n}\n",{organizationId:e},[]),{mutate:a}=function(e={}){return Xn("mutation OrganizationEventsShowcaseSettingsUpdate(\n $organizationId: OrganizationId!\n $eventsShowcaseSettings: EventsShowcaseSettingsInput!\n) {\n organizationEventsShowcaseSettingsUpdate(\n organizationId: $organizationId\n eventsShowcaseSettings: $eventsShowcaseSettings\n ) {\n id\n }\n}\n",e)}(),l=qn(Ba),d=qn(mK);return r||(0,i.jsx)(Cl,{direction:"column",initialValues:{events:o.organization.eventsShowcaseSettings.events??[]},mutators:{setValue:([e,t],n,{changeValue:i})=>i(n,e,()=>t)},render:({form:e,handleSubmit:r,submitting:a,values:l})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(cb,{footerActions:(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(El,{isLoading:a,onClick:r,children:t("enregistrer_06519")})}),gap:"7",headerActions:(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(El,{onClick:()=>s(!0),children:t("ajouter_un_v_n_49943")})}),heading:t("difusion_des_v_78418"),subtitle:t("personnaliser_l_19452"),children:(0,i.jsx)(Na,{direction:"column",gap:"6",children:(0,i.jsx)(EK,{events:o.organization.events.nodes,form:e,forms:o.organization.forms.nodes,values:l})})}),n&&(0,i.jsx)(kK,{eventIds:l.events.map(e=>e.eventId),setShowModal:s,setValue:t=>{e.change("events",[...l.events,t])},showModal:n})]}),validate:l.validateForForm(d.settingsInputSchema()),onSubmit:async t=>{await a({organizationId:e,eventsShowcaseSettings:t})}})},zK=()=>{const{translate:e,params:{organizationId:t}}=_l();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tj,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(ul,{children:e("site_vitrine_17673")}),(0,i.jsxs)(sj,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(ej,{css:{overflowY:"auto"},children:(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{path:bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(pK,{})}),(0,i.jsx)(Ar.qh,{path:bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(QY,{alert:(0,i.jsxs)(hl,{alertStyle:"warning",children:[(0,i.jsx)(ml,{children:e("comment_marche_91826")}),(0,i.jsx)(gl,{children:e("ce_code_va_vous_11261")})]}),iframeLabel:e("code_html_pour_31742"),linkPath:Ui.EVENTS({organizationId:t})})}),(0,i.jsx)(Ar.qh,{path:bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(TK,{})})]})})]})},OK=e=>{const{history:t,translate:n,params:{organizationId:s}}=_l(),o=qn(J_),r=qn(du),{mutate:a,isLoading:l}=function(e={}){return Xn("mutation OrganizationUpdateInfos(\n $organizationId: OrganizationId!\n $organization: OrganizationInfosInput!\n) {\n organizationUpdateInfos(organizationId: $organizationId, organization: $organization) {\n id\n }\n}\n",e)}(),d=(0,L.useMemo)(()=>({organization:e.initialValues}),[e.initialValues]),c=(0,L.useMemo)(()=>Y_.map((e,t)=>(0,i.jsx)("option",{value:e,children:e},t)),[]),u=Us.c9.now();return(0,i.jsx)(Cl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:d,render:({form:o,handleSubmit:a,values:d})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(IT,{change:o.change,changeCity:!0,changeCountry:!0,changeLatLng:!1,changePostalCode:!0,name:"place",prefix:"organization."}),(0,i.jsx)(yr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:n("organisation_71863")}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",width:280,children:n("_propos_de_l_o_80406")}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Ll,{label:n("nom_de_l_organi_49583"),name:"organization.name"}),(0,i.jsx)(hC,{addressName:"organization.street",label:n("Address"),placeName:"place"}),(0,i.jsx)(Ll,{label:n("code_postal_40328"),name:"organization.postalCode"}),(0,i.jsx)(Ll,{label:n("ville_67740"),name:"organization.city"}),(0,i.jsx)(Um,{isSearchVisible:!0,label:n("Country"),name:"organization.country",children:r.getCountriesIdName().map(({id:e,name:t})=>(0,i.jsx)("option",{value:e,children:t},e))}),(0,i.jsx)(Um,{isSearchVisible:!0,label:n("fuseau_horaire_14654"),name:"organization.timeZone",children:c})]})]}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",width:280,children:n("responsable_de_20624")}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Ll,{label:n("nom_du_responsa_44907"),name:"organization.adminName"}),(0,i.jsx)(Ll,{isEmail:!0,label:n("e_mail_du_respo_66060"),name:"organization.adminEmail"})]})]}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",width:280,children:n("_metteur_de_e_m_77028")}),(0,i.jsx)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:(0,i.jsx)(Um,{isCreateVisible:!0,isSearchVisible:!0,label:n("_metteur_des_e_27849"),name:"organization.emailSenderId",onCreateClick:()=>{t.push($s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(s))},children:e.emailsSenders.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsx)(yr,{font:"gray700 textSm medium",width:280,children:n("date_time_for_13370")}),(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"4",children:[(0,i.jsx)(Ll,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.dateFormat)),label:n("format_de_date_82059"),name:"organization.dateFormat"}),(0,i.jsx)(Ll,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.datetimeFormat)),label:n("format_de_date_24474"),name:"organization.datetimeFormat"}),(0,i.jsx)(Ll,{hint:n("rendu_avec_la_d_41897",u.toFormat(d.organization.timeFormat)),label:n("format_d_heure_46798"),name:"organization.timeFormat"})]})]}),(0,i.jsxs)(Bb,{rolesTypes:pI,children:[(0,i.jsx)(Ku,{height:"5"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:l,onClick:a,children:n("enregistrer_les_30411")})})]})]}),schema:o.updateOrganizationGeneralSchema(),width:1,onSubmit:async e=>{await a({organizationId:s,organization:e.organization})}})},RK=()=>{const e=qn(J_),{organizationId:t}=Jn(),{data:n,loader:s}=Mo({organizationId:t});return s||(0,i.jsx)(OK,{emailsSenders:n.organization.emailsSenders,initialValues:e.organizationInfosInputDefault(n.organization)})},$K=()=>{const e=Yn(),{organizationId:t}=Jn(),{data:n,loader:s}=Zn("query Invoices($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n invoices {\n id\n invoiceNumber\n amountCents\n smsAmountCents\n currency\n paidAt\n url\n insertedAt\n isRefunded\n }\n }\n}\n",{organizationId:t},[]);return s||(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("factures_03552")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("num_ro_de_factu_68150")}),(0,i.jsx)(Vc,{children:e("Date")}),(0,i.jsx)(Vc,{children:e("montant_55595")}),(0,i.jsx)(Vc,{children:e("status_06428")}),(0,i.jsx)(Vc,{})]}),numberOfPages:1,offset:0,rows:(0,i.jsx)(i.Fragment,{children:n.organization.invoices.map((e,t)=>(0,i.jsx)(eu,{invoice:e,isBackoffice:!1,showColumn:()=>!0},t))}),setOffset:Ql.A,title:e("factures_03552"),totalCount:0})]})},DK=()=>{const{params:{organizationId:e},translate:t}=_l(),{data:n,loader:s}=ca({organizationId:e,includeIntro:!1,spaceType:Ct.MembersSpace}),{mutate:o}=ua(),r=qn(SE);return s||(0,i.jsx)(Cl,{direction:"column",initialValues:{design:r.organizationDesignInputDefault(n.organization.spaceDesign)},render:({handleSubmit:e,submitting:n})=>(0,i.jsxs)(cb,{footerActions:(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:n,onClick:e,children:t("enregistrer_06519")})})}),heading:t("design_15043"),hideHeader:!0,children:[(0,i.jsx)(eK,{heading:t("images_de_votre_51694"),showLogo:!0}),(0,i.jsx)(OE,{})]}),onSubmit:async t=>await o({organizationId:e,spaceDesign:t.design,spaceType:Ct.MembersSpace})})},PK=()=>{const{params:{organizationId:e},translate:t}=_l(),[n,s]=(0,L.useState)(Oe.Code);return(0,i.jsx)(ab,{children:(0,i.jsx)(Na,{direction:"column",children:(0,i.jsxs)(Na,{gap:"7",children:[(0,i.jsxs)(Na,{css:{flex:"1"},direction:"column",gap:"6",children:[(0,i.jsx)(ul,{children:t("liste_des_e_mai_73508")}),(0,i.jsxs)(kc,{children:[(0,i.jsx)(jc,{children:(0,i.jsx)(Vc,{children:t("type_d_e_mail_06577")})}),(0,i.jsx)(gE,{isSelected:n===Oe.Code,subtitle:t("cet_e_mail_est_80490"),title:t("code_20843"),onClick:()=>s(Oe.Code)})]})]}),(0,i.jsx)(yr,{css:{borderRight:"1px solid $gray200",width:"1px"}}),(0,i.jsx)(Na,{css:{flex:"1",py:"$3"},children:(0,i.jsx)(fE,{emailType:n,eventId:null,formId:null,organizationId:e,source:Qe.MembersSpace})})]})})})},FK=()=>{const{params:{organizationId:e},translate:t}=_l(),{data:n,loader:s}=Zn("query OrganizationMembersSpaceSettings($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n hideAssignmentsUntilConfirmationEmailSent\n hideAccreditationsUntilConfirmationEmailSent\n\n membersSpaceExcludeAccreditations\n accreditationsCategories {\n nodes {\n id\n name\n\n accreditations {\n id\n name\n }\n }\n }\n }\n}\n",{organizationId:e},[]),{mutate:o}=function(e={}){return Xn("mutation OrganizationMembersSpaceSettingsUpdate(\n $organizationId: OrganizationId!\n $membersSpaceSettings: MembersSpaceSettingsInput!\n) {\n organizationMembersSpaceSettingsUpdate(\n organizationId: $organizationId\n membersSpaceSettings: $membersSpaceSettings\n ) {\n id\n }\n}\n",e)}();return s||(0,i.jsx)(Cl,{direction:"column",initialValues:{hideAssignmentsUntilConfirmationEmailSent:n.organization.hideAssignmentsUntilConfirmationEmailSent,hideAccreditationsUntilConfirmationEmailSent:n.organization.hideAccreditationsUntilConfirmationEmailSent,membersSpaceExcludeAccreditations:n.organization.membersSpaceExcludeAccreditations},render:({form:e,handleSubmit:s,submitting:o,values:r})=>(0,i.jsxs)(cb,{footerActions:(0,i.jsx)(Bb,{rolesTypes:pI,children:(0,i.jsx)(El,{isLoading:o,onClick:s,children:t("enregistrer_06519")})}),heading:t("param_tres_de_l_83556"),subtitle:t("personnalisez_l_44387"),children:[(0,i.jsx)(zE,{heading:t("diffusion_des_a_83706"),children:(0,i.jsx)(Hm,{name:"hideAssignmentsUntilConfirmationEmailSent",children:t("afficher_les_af_06759")})}),(0,i.jsx)(zE,{heading:t("diffusion_des_a_32535"),children:(0,i.jsx)(Hm,{name:"hideAccreditationsUntilConfirmationEmailSent",children:t("afficher_les_ac_55704")})}),(0,i.jsx)(zE,{heading:t("restriction_de_66151"),children:(0,i.jsxs)(TE,{heading:t("quelle_s_accr_53793"),children:[(0,i.jsx)(xc,{css:{"& label > div > div":{fontWeight:"$regular !important"}},state:r.membersSpaceExcludeAccreditations?"unchecked":"checked",onClick:()=>{e.change("membersSpaceExcludeAccreditations",void 0)},children:t("afficher_toutes_12183")}),(0,i.jsx)(xc,{css:{"& label > div > div":{fontWeight:"$regular !important"}},state:r.membersSpaceExcludeAccreditations?"checked":"unchecked",onClick:()=>{e.change("membersSpaceExcludeAccreditations",[])},children:t("seulement_certa_92801")}),r.membersSpaceExcludeAccreditations&&(0,i.jsx)(Um,{multiple:!0,name:"membersSpaceExcludeAccreditations",placeholder:t("ajouter_des_cat_15537"),children:n.organization.accreditationsCategories.nodes.map(e=>(0,i.jsx)("optgroup",{label:e.name,children:e.accreditations.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},e.id))})]})})]}),onSubmit:async t=>{await o({organizationId:e,membersSpaceSettings:t})}})},MK=()=>{const{translate:e,params:{organizationId:t}}=_l();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tj,{css:{padding:"$6 $7 0 $7",borderBlockEnd:"1px solid $gray200"},children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(ul,{children:e("espace_membres_90896")}),(0,i.jsxs)(sj,{css:{borderBlockEnd:"unset"},children:[(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:t}),children:e("design_15043")}),(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:t}),children:e("int_gration_10662")}),(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:t}),children:e("mod_les_e_mail_91257")}),(0,i.jsx)(ij,{path:bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:t}),children:e("param_tres_78420")})]})]})}),(0,i.jsx)(ej,{css:{overflowY:"auto"},children:(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(oj,{path:bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:":organizationId"}),children:(0,i.jsx)(DK,{})}),(0,i.jsx)(oj,{path:bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_INTEGRATION({organizationId:":organizationId"}),children:(0,i.jsx)(QY,{alert:(0,i.jsxs)(hl,{alertStyle:"warning",children:[(0,i.jsx)(ml,{children:e("comment_marche_87686")}),(0,i.jsx)(gl,{children:e("ce_code_va_vous_50849")})]}),iframeLabel:e("code_html_pour_26450"),linkPath:hi(bi.ORGANIZATION({organizationId:t}))})}),(0,i.jsx)(oj,{path:bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_EMAIL_TEMPLATES({organizationId:":organizationId"}),children:(0,i.jsx)(PK,{})}),(0,i.jsx)(oj,{path:bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_SETTINGS({organizationId:":organizationId"}),children:(0,i.jsx)(FK,{})})]})})]})},NK=e=>{const t=ei(),n=e.isActive?e.isActive(t.pathname):t.pathname===e.path;return(0,i.jsx)(Ja,{to:e.path,children:(0,i.jsxs)(Uj,{active:n,css:{gap:"$3",justifyContent:"flex-start",px:"$3",width:"100%"},children:[(0,i.jsx)(yr,{width:20,children:(0,i.jsx)(el,{icon:e.icon})}),(0,i.jsx)(yr,{children:e.title})]})})},LK=e=>{const{localOrganization:t,updateLocalOrganization:n}=yI(),[s,o]=L.useState(t?.areParametersMenuSectionsOpen?.[e.name]??!0),r=L.useCallback(async i=>{o(i),await n({areParametersMenuSectionsOpen:(0,Ka.A)(t?.areParametersMenuSectionsOpen,{[e.name]:i})})},[t,s,o]);return(0,i.jsxs)(Na,{css:{borderBottom:"1px solid $gray200",paddingBottom:"$1",paddingTop:"$4"},direction:"column",children:[(0,i.jsxs)(Na,{align:"center",css:{color:"$gray800",cursor:"pointer",px:"$5"},gap:"3",onClick:async()=>{await r(!s)},children:[(0,i.jsx)(yr,{css:{textTransform:"uppercase"},fontSize:"textXs",fontWeight:"semiBold",children:e.title}),(0,i.jsx)(yr,{css:{fontSize:"10px"},children:(0,i.jsx)(el,{icon:s?"chevron-down":"chevron-up"})})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(Na,{css:{px:"$3"},direction:"column",children:e.children})]})]})},BK=()=>{const{translate:e,params:{organizationId:t}}=_l();Dd(e("param_tres_78420"));const{isOrganizationAdmin:n,isOrganizationReader:s,hasFeature:o}=yI(),{canOrganizationParamRead:r,canOrganizationUserRead:a}=SS();return(0,i.jsx)(Na,{as:Pa.Nav,css:{background:"$gray100",overflowY:"auto",py:"$2"},height:1,children:(0,i.jsxs)(Na,{"aria-orientation":"vertical",direction:"column",role:"menubar",width:240,children:[(0,i.jsxs)(LK,{name:"general",title:e("g_n_ral_64953"),children:[(0,i.jsx)(NK,{icon:"user",path:$s.ORGANIZATION_PARAMETERS_PROFILE(t),title:e("mon_profil_48224")}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(NK,{icon:"building",path:$s.ORGANIZATION_PARAMETERS_INFOS(t),title:e("organisation_71863")}),(0,i.jsx)(NK,{icon:"wave-pulse",path:$s.ORGANIZATION_PARAMETERS_ACTIVITY(t),title:e("activit_95747")})]})]}),r&&(0,i.jsxs)(LK,{name:"parameters",title:e("param_tres_78420"),children:[(0,i.jsx)(NK,{icon:"star",isActive:e=>e.includes(bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:t})),path:bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE_DESIGN({organizationId:t}),title:e("site_vitrine_17673")}),(0,i.jsx)(NK,{icon:"address-card",isActive:e=>e.includes(bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:t})),path:bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE_DESIGN({organizationId:t}),title:e("espace_membres_90896")}),o(Ne.Delegation)&&(0,i.jsx)(NK,{icon:"users",isActive:e=>e.includes(bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:t})),path:bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE_DESIGN({organizationId:t}),title:e("espace_d_l_gati_59251")}),(0,i.jsx)(NK,{icon:"at",isActive:e=>e.includes($s.ORGANIZATION_PARAMETERS_EMAILS(t)),path:$s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS(t),title:e("e_mails_09850")}),(0,i.jsx)(NK,{icon:"layer-group",isActive:e=>e.includes($s.ORGANIZATION_PARAMETERS_CATEGORIES(t)),path:$s.ORGANIZATION_PARAMETERS_CATEGORIES_CUSTOM_FIELDS(t),title:e("cat_gories_24533")}),(0,i.jsx)(NK,{icon:"tag",path:$s.ORGANIZATION_PARAMETERS_TAGS(t),title:e("tags_79499")}),(0,i.jsx)(NK,{icon:"language",path:$s.ORGANIZATION_PARAMETERS_TRANSLATIONS(t),title:e("traductions_88349")})]}),a&&(0,i.jsxs)(LK,{name:"users",title:e("utilisateurs_04975"),children:[(0,i.jsx)(NK,{icon:"user-group",path:$s.ORGANIZATION_PARAMETERS_TEAM(t),title:e("utilisateurs_04975")}),(0,i.jsx)(NK,{icon:"shield",path:$s.ORGANIZATION_PARAMETERS_ROLES(t),title:e("r_les_et_permis_27853")})]}),n&&(0,i.jsx)(LK,{name:"subscription",title:e("abonnement_98940"),children:(0,i.jsx)(NK,{icon:"receipt",path:$s.ORGANIZATION_PARAMETERS_INVOICES(t),title:e("factures_03552")})}),s&&o(Ne.Skidata)&&(0,i.jsx)(LK,{name:"integrations",title:e("int_grations_88619"),children:(0,i.jsx)(NK,{icon:"person-skiing",path:$s.ORGANIZATION_PARAMETERS_SKIDATA(t),title:"Skidata"})})]})})},VK=()=>{const{translate:e,params:{organizationId:t}}=_l(),{data:n,loader:s}=Go({organizationId:t}),o=qn(pT),r=qn(Ba),{mutate:a,isLoading:l}=Ho(),{mutate:d}=ha(),{user:c}=si(),{reload:u}=yI(),[h,m]=(0,L.useState)(!1);return s||(0,i.jsx)(Cl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:{userInfo:o.userInfoProfileInputDefault(n.user)},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("mon_profil_48224")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e("informations_pe_37892")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Vj,{accept:Rv.Images,acl:"public-read",allowCrop:!0,label:e("photo_de_profil_08618"),organizationId:t,prefix:"userInfo.fields.picture."}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(zY,{inputName:"userInfo."}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"gray800",fontSize:"textLg",fontWeight:"semiBold",children:e("compte_16579")}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(yr,{color:"error700",css:{cursor:"pointer",textDecoration:"underline"},onClick:()=>{m(!0)},children:e("supprimer_mon_c_07051")}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:l,onClick:n,children:e("enregistrer_les_30411")})}),h&&(0,i.jsx)(sA,{buttonText:"Supprimer",subtext:e("_tes_vous_s_r_d_50084"),text:e("supprimer_mon_c_07051"),onClose:()=>{m(!1)},onDelete:async()=>{await d({}),X()}})]}),validate:r.validateForForm(o.updateProfileSchema()),width:1,onSubmit:async e=>{const{userProfileUpdate:{email:t,language:i}}=await a({userId:c.id,userInfoId:n.user.userInfo.id,userInfo:e.userInfo});c.email!==t||c.language!==i?X():u()}})},UK=()=>{const{organizationId:e}=Jn(),t=Yn();return(0,i.jsxs)(Na,{align:"center",gap:"6",children:[(0,i.jsx)(yr,{color:"gray900",css:{flexGrow:1},fontSize:"displayXs",fontWeight:"semiBold",children:t("r_les_et_permis_27853")}),(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(El,{to:$s.CREATE_ORGANIZATION_PARAMETERS_ROLE(e),children:t("cr_er_un_nouvea_53551")})})]})},WK=({role:e})=>{const{organizationId:t}=Jn(),n=Yn(),{data:s,isLoading:o}=Zn("query RoleUses($organizationId: OrganizationId!, $roleId: RoleId!) {\n organization(id: $organizationId) {\n role(id: $roleId) {\n uses {\n __typename\n\n ... on UsersEvent {\n userInfo {\n id\n name\n }\n event {\n id\n name\n }\n }\n\n ... on UsersPosition {\n userInfo {\n id\n name\n }\n position {\n id\n name\n }\n }\n\n ... on UsersPositionsCategory {\n userInfo {\n id\n name\n }\n positionCategory {\n id\n name\n }\n }\n\n ... on UsersDelegationsCategory {\n userInfo {\n id\n name\n }\n delegationCategory {\n id\n name\n }\n }\n }\n }\n }\n}\n",{organizationId:t,roleId:e.id},[]);if(o)return(0,i.jsx)(oc,{borderRadius:"$1",height:18,width:160});{const e=s.organization.role.uses;if(0===e.length)return(0,i.jsx)("div",{children:n("ce_r_le_n_est_p_61959")});{const t=(0,ac.A)(e,e=>e.userInfo.id);return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:n("les_responsable_31151")}),Object.entries(t).map(([e,t])=>(0,i.jsxs)("dl",{children:[(0,i.jsx)("dt",{children:n("_1_sur_84610",t[0].userInfo.name)}),t.map(e=>"UsersEvent"===e.__typename?(0,i.jsx)("dd",{children:n("l_v_nement_1_80078",e.event.name)},e.event.id):"UsersPosition"===e.__typename?(0,i.jsx)("dd",{children:n("la_mission_1_50232",e.position.name)},e.position.id):"UsersPositionsCategory"===e.__typename?(0,i.jsx)("dd",{children:n("la_cat_gorie_1_00613",e.positionCategory.name)},e.positionCategory.id):(0,i.jsx)("dd",{children:n("la_cat_gorie_1_00613",e.delegationCategory.name)},e.delegationCategory.id))]},e))]})}}},GK=({onClose:e,onDelete:t,role:n})=>{const s=Yn(),{organizationId:o}=Jn(),{mutate:r}=function(e={}){return Xn("mutation RoleDelete($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDelete(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}();return(0,i.jsx)(sA,{buttonText:s("supprimer_43083"),text:s("suppression_de_73669",n.name),onClose:e,onDelete:()=>r({organizationId:o,roleId:n.id}).then(e=>(t(),e)),children:(0,i.jsx)(WK,{role:n})})},HK=({onDelete:e,role:t})=>{const{history:n,translate:s,params:{organizationId:o}}=_l(),{mutate:r}=function(e={}){return Xn("mutation RoleDuplicate($organizationId: OrganizationId!, $roleId: RoleId!) {\n roleDuplicate(organizationId: $organizationId, roleId: $roleId) {\n id\n }\n}\n",e)}(),{canOrganizationUserEdit:a}=SS(),[l,d]=(0,L.useState)(!1),c=(0,L.useMemo)(()=>a&&t.type===It.Custom,[a,t]),u=async()=>{const{roleDuplicate:e}=await r({organizationId:o,roleId:t.id});n.push($s.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,e.id))};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gd,{icon:"pen",onClick:()=>{n.push($s.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,t.id))},children:s("_diter_62574")}),(0,i.jsx)(Gd,{icon:"clone",onClick:u,children:s("dupliquer_28256")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:e=>{Nd(e.target),d(!0)},children:s("supprimer_43083")})]}),t.type!==It.Custom&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Gd,{icon:"eye",onClick:()=>{n.push($s.EDIT_ORGANIZATION_PARAMETERS_ROLE(o,t.id))},children:s("voir_36533")}),(0,i.jsx)(Gd,{icon:"clone",onClick:u,children:s("dupliquer_28256")})]})]}),l&&(0,i.jsx)(GK,{role:t,onClose:()=>{d(!1)},onDelete:e})]})},qK=()=>{const{history:e,translate:t,params:{organizationId:n}}=_l(),{canOrganizationUserEdit:s}=SS(),{data:o,isLoading:r,reload:a}=Zn("query Roles($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n roles {\n id\n name\n description\n accessLevel\n type\n }\n }\n}\n",{organizationId:n},[]),{showNotification:l}=kb(),d=(0,L.useMemo)(()=>(0,lc.A)(o.organization?.roles??[],e=>[e.accessLevel===_t.Organization?1:e.accessLevel===_t.Event?2:e.accessLevel===_t.Position?3:4,u(e.name)]),[o.organization]),c=()=>{l({color:"success",text:t("le_r_le_a_bien_53462")}),a()};return(0,i.jsx)(Im,{"aria-busy":r,css:{height:"auto",overflow:"visible","& > div:first-child":{borderRadius:"$2 $2 0 0"},"& > div:last-child":{borderBottom:"1px solid $gray200",borderRadius:"0 0 $2 $2"}},headerRow:(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:t("nom_du_r_le_38492")}),(0,i.jsx)(Vc,{children:t("niveau_d_acc_s_29898")}),(0,i.jsx)(Vc,{css:{flexGrow:2},children:t("description_du_94520")}),s&&(0,i.jsx)(Vc,{width:100})]}),children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{}),(0,i.jsx)(Uc,{css:{borderBottom:"none"}})]}):d.map(o=>(0,i.jsxs)(Dc,{css:{cursor:"pointer","&:hover":{background:"$gray100"},"&:last-child":{borderBottom:"none"}},onClick:()=>{e.push($s.EDIT_ORGANIZATION_PARAMETERS_ROLE(n,o.id))},onMouseLeave:e=>{Nd(e.target)},children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{ellipsis:!0,title:o.name,children:o.name})}),(0,i.jsx)(Ec,{children:o.accessLevel===_t.Organization?t("administrateur_10076"):o.accessLevel===_t.Event?t("administrateur_99393"):o.accessLevel===_t.Position?t("responsable_de_82794"):t("responsable_de_75445")}),(0,i.jsx)(Ec,{css:{flexGrow:2,minWidth:0},children:(0,i.jsx)(yr,{ellipsis:!0,title:o.description,children:o.description})}),s&&(0,i.jsx)(Yc,{justify:"end",children:(0,i.jsx)(HK,{role:o,onDelete:c})})]},o.id))})},YK=()=>{const e=Yn();return(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$6 $7"},direction:"column",gap:"6",height:1,children:[(0,i.jsx)(UK,{}),(0,i.jsx)(ol.Root,{children:(0,i.jsxs)(ol.Titled,{children:[(0,i.jsx)(ol.Title,{icon:"circle-info",children:e("contr_ler_les_p_50104")}),(0,i.jsx)(ol.Text,{children:e("les_r_les_aiden_19371")})]})}),(0,i.jsx)(qK,{})]})};let KK=class extends Ul{constructor(e){super(e)}connectionInfosInputDefault(e){return{url:e?.url??"",issuer:e?.issuer??"",receiver:e?.receiver??"",synchronizedEventsIds:e?.synchronizedEventsIds??[],seasonEventsIds:e?.seasonEventsIds??[],place:e?.place??""}}};KK=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],KK);const ZK=e=>{const t=Yn(),n=qn(Kc),{mutate:s}=function(e={}){return Xn("mutation SkidataConnectionInfoSeaonEventAdd($organizationId: OrganizationId!, $eventId: EventId!) {\n skidataConnectionInfoSeaonEventAdd(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:o}=function(e={}){return Xn("mutation SkidataConnectionInfoSeaonEventDelete(\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n skidataConnectionInfoSeaonEventDelete(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:r}=function(e={}){return Xn("mutation SkidataConnectionInfoSynchronizedEventAdd(\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n skidataConnectionInfoSynchronizedEventAdd(organizationId: $organizationId, eventId: $eventId) {\n organizationId\n }\n}\n",e)}(),{mutate:a}=function(e={}){return Xn("mutation SkidataConnectionInfoSynchronizedEventDelete(\n $organizationId: OrganizationId!\n $eventId: EventId!\n) {\n skidataConnectionInfoSynchronizedEventDelete(\n organizationId: $organizationId\n eventId: $eventId\n ) {\n organizationId\n }\n}\n",e)}();return(0,i.jsxs)(Na,{gap:"3",width:1,children:[(0,i.jsxs)(Na,{direction:"column",gap:"1",width:280,children:[(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",children:e.title}),(0,i.jsx)(yr,{color:"gray500",children:e.subtitle})]}),(0,i.jsx)(yr,{width:1,children:(0,i.jsxs)(kc,{children:[(0,i.jsxs)(jc,{children:[(0,i.jsx)(Vc,{children:t("nom_de_l_v_nem_08711")}),(0,i.jsx)(Vc,{children:t("Date")}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{}),(0,i.jsx)(Vc,{})]}),"synchronized"===e.eventType&&(0,i.jsx)(Vc,{}),"season"===e.eventType&&(0,i.jsx)(Vc,{})]}),no(e.events)?e.events.map(l=>(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(yr,{color:"gray800",width:1,children:l.name})}),(0,i.jsx)(Ec,{children:M_(n,l.startAt,l.endAt)}),"all"===e.eventType&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ec,{onClick:async()=>{await r({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("synchroniser_34754")})}),(0,i.jsx)(Ec,{onClick:async()=>{await s({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(yr,{color:"primary700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("_v_nement_saiso_67885")})})]}),"synchronized"===e.eventType&&(0,i.jsx)(Ec,{onClick:async()=>{await a({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(yr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("supprimer_43083")})}),"season"===e.eventType&&(0,i.jsx)(Ec,{onClick:async()=>{await o({organizationId:e.organizationId,eventId:l.id}),e.reload()},children:(0,i.jsx)(yr,{color:"error700",css:{cursor:"pointer"},fontWeight:"medium",width:1,children:t("supprimer_43083")})})]},l.id)):(0,i.jsx)(Dc,{css:{height:"auto"},children:(0,i.jsx)(Ec,{children:(0,i.jsxs)(Na,{align:"center",css:{padding:"$8"},direction:"column",gap:"4",width:1,children:[(0,i.jsx)(Xj,{color:"primary",icon:"magnifying-glass"}),(0,i.jsx)(yr,{fontSize:"textMd",fontWeight:"medium",children:t("aucun_v_nement_39620")})]})})})]})})]})},XK=()=>{const e=Yn(),{organizationId:t}=Jn(),n=qn(KK),{data:s,loader:o,reload:r}=Zn("query SkidataConnectionInfos($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n events(states: [Ongoing, Upcoming]) {\n nodes {\n id\n name\n startAt\n endAt\n }\n }\n\n skidataConnectionInfos {\n url\n issuer\n receiver\n seasonEventsIds\n synchronizedEventsIds\n place\n }\n }\n}\n",{organizationId:t},[]),{mutate:a}=function(e={}){return Xn("mutation SkidataConnectionInfosDelete($organizationId: OrganizationId!) {\n skidataConnectionInfosDelete(organizationId: $organizationId) {\n organizationId\n }\n}\n",e)}(),{mutate:l,isLoading:d}=function(e={}){return Xn("mutation SkidataConnectionInfosUpsert(\n $organizationId: OrganizationId!\n $connectionInfos: SkidataConnectionInfoInput!\n) {\n skidataConnectionInfosUpsert(\n organizationId: $organizationId\n connectionInfos: $connectionInfos\n ) {\n organizationId\n }\n}\n",e)}(),{mutate:c,isLoading:u}=function(e={}){return Xn("mutation SkidataSynchronize($organizationId: OrganizationId!) {\n skidataSynchronize(organizationId: $organizationId)\n}\n",e)}(),h=(0,L.useMemo)(()=>s.organization?.events.nodes??[],[s.organization]),m=(0,L.useMemo)(()=>h.map(({id:e})=>e),[h]),g=(0,L.useMemo)(()=>s.organization?.skidataConnectionInfos?.synchronizedEventsIds??[],[s.organization]),p=(0,L.useMemo)(()=>s.organization?.skidataConnectionInfos?.seasonEventsIds??[],[s.organization]),f=(0,L.useMemo)(()=>{const e=(0,cc.A)(m,g.concat(p));return h.filter(t=>e.includes(t.id))},[h,g,p]),x=(0,L.useMemo)(()=>h.filter(e=>g.includes(e.id)),[h]),_=(0,L.useMemo)(()=>h.filter(e=>p.includes(e.id)),[h,p]);return o||(0,i.jsx)(Cl,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,initialValues:{connectionInfos:n.connectionInfosInputDefault(s.organization.skidataConnectionInfos)},render:({handleSubmit:n})=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:"Skidata"}),s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(El,{isLoading:d,onClick:n,children:e("enregistrer_06519")}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:u?(0,i.jsx)(El,{color:"white",leftIcon:"loader"}):(0,i.jsx)(El,{color:"white",leftIcon:"arrows-rotate",onClick:async()=>{await c({organizationId:t})}})})}),(0,i.jsx)(Cm,{placement:"top",children:e("synchroniser_34754")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(El,{color:"white",leftIcon:"arrow-right-from-bracket",onClick:async()=>{await a({organizationId:t}),r()}})})}),(0,i.jsx)(Cm,{placement:"top",children:e("se_d_connecter_74151")})]})]})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsxs)(Na,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",width:280,children:e("adresse_du_web_92125")}),(0,i.jsx)(Ll,{name:"connectionInfos.url"})]}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(Na,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",width:280,children:"Issuer"}),(0,i.jsx)(Ll,{name:"connectionInfos.issuer"})]}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(Na,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",width:280,children:"Receiver"}),(0,i.jsx)(Ll,{name:"connectionInfos.receiver"})]}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsxs)(Na,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(yr,{color:"gray700",fontWeight:"medium",width:280,children:e("lieu_20541")}),(0,i.jsx)(Ll,{name:"connectionInfos.place"})]}),s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Yu,{direction:"horizontal"}),(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(ZK,{eventType:"all",events:f,organizationId:t,reload:r,subtitle:"",title:e("liste_des_v_ne_29929")}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsx)(ZK,{eventType:"synchronized",events:x,organizationId:t,reload:r,subtitle:e("ces_v_nements_58722"),title:e("liste_des_v_ne_09741")}),(0,i.jsx)(Ku,{height:"5"}),(0,i.jsx)(ZK,{eventType:"season",events:_,organizationId:t,reload:r,subtitle:e("ces_v_nements_24479"),title:e("liste_des_v_ne_73078")})]}),!s.organization.skidataConnectionInfos&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"5"}),(0,i.jsx)(Na,{justify:"end",children:(0,i.jsx)(El,{isLoading:d,onClick:n,children:e("se_connecter_63820")})})]})]}),width:1,onSubmit:async e=>{await l({organizationId:t,connectionInfos:e.connectionInfos}),r()}})},JK=e=>{const t=Yn(),{mutate:n}=function(e={}){return Xn("mutation TagUpdateName($organizationId: OrganizationId!, $tagId: TagId!, $name: String!) {\n tagUpdateName(organizationId: $organizationId, tagId: $tagId, name: $name) {\n id\n }\n}\n",e)}();return(0,i.jsx)(Jj,{buttonText:t("renommer_42135"),icon:"tag",initialValues:{name:e.name},title:t("renommer_1_40542",e.name),onClose:e.onClose,onSubmit:async t=>{await n({organizationId:e.organizationId,tagId:e.tagId,name:t.name}),e.onSuccess(),e.onClose()},children:(0,i.jsx)(Ll,{label:t("nom_du_tag_95054"),name:"name"})})},QK=e=>{const t=Yn(),{canOrganizationParamEdit:n}=SS(),{mutate:s}=function(e={}){return Xn("mutation TagDelete($organizationId: OrganizationId!, $tagId: TagId!) {\n tagDelete(organizationId: $organizationId, tagId: $tagId) {\n id\n }\n}\n",e)}(),[o,r]=(0,L.useState)(!1),[a,l]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Dc,{css:{"&:hover":{background:"$gray100"}},children:[(0,i.jsx)(Ec,{css:{color:"$gray800"},children:e.tag.name}),(0,i.jsx)(Ec,{children:e.tag.numberOfTimesUsed}),n&&(0,i.jsxs)(Yc,{justify:"center",children:[(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{children:(0,i.jsx)(el,{icon:"pen",onClick:()=>{r(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("_diter_62574")})]}),(0,i.jsxs)(bm,{children:[(0,i.jsx)(ym,{children:(0,i.jsx)(yr,{color:"error700",children:(0,i.jsx)(el,{icon:"trash-can",onClick:()=>{l(!0)}})})}),(0,i.jsx)(Cm,{placement:"top",children:t("supprimer_02105")})]})]})]}),o&&(0,i.jsx)(JK,{name:e.tag.name,organizationId:e.organizationId,tagId:e.tag.id,onClose:()=>{r(!1)},onSuccess:e.reload}),a&&(0,i.jsx)(sA,{buttonText:t("supprimer_43083"),subtext:t("_tes_vous_s_r_d_70200"),text:t("suppression_de_73669",e.tag.name),onClose:()=>{l(!1)},onDelete:async()=>{await s({organizationId:e.organizationId,tagId:e.tag.id}),e.reload()}})]})},eZ=()=>{const{translate:e,params:{organizationId:t}}=_l(),{canOrganizationParamEdit:n}=SS(),[s,o,r]=Bc(""),[a,l]=(0,L.useState)(0),{data:d,isLoading:c,reload:u}=Zn("query OrganizationTags($organizationId: OrganizationId!, $name: String, $offset: Int) {\n organization(id: $organizationId) {\n tags(name: $name, offset: $offset, limit: 25) {\n nodes {\n id\n name\n numberOfTimesUsed\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,name:m(o)?o:void 0,offset:a},[]);const{numberOfPages:h,totalCount:g}=ku(d.organization?.tags),[p,f]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Na,{css:{overflowY:"auto",padding:"$7"},direction:"column",height:1,children:[(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(yr,{color:"gray900",css:{flex:"1"},fontSize:"displayXs",fontWeight:"semiBold",children:e("tags_79499")}),(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(El,{onClick:()=>{f(!0)},children:e("cr_er_un_nouvea_56617")})})]}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Fc,{filters:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(yr,{width:320,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e("rechercher_un_t_34829"),value:s,onChange:r})})}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("nom_08311")}),(0,i.jsx)(Vc,{children:e("nombre_d_utilis_58389")}),n&&(0,i.jsx)(Vc,{width:100})]}),numberOfPages:h,offset:a,rows:c?(0,i.jsx)(i.Fragment,{}):d.organization.tags.nodes.map(e=>(0,i.jsx)(QK,{organizationId:t,reload:u,tag:e},e.id)),setOffset:l,title:e("liste_des_tags_83521"),totalCount:g})]}),p&&(0,i.jsx)(Qj,{organizationId:t,onClose:()=>{f(!1)},onSuccess:u})]})};function tZ(e,t){const n=e[`${t.toLowerCase()}String`];return m(n)?n:m(e.enString)?e.enString:m(e.frString)?e.frString:m(e.esString)?e.esString:m(e.deString)?e.deString:m(e.nlString)?e.nlString:""}const nZ=e=>{const{translate:t,params:{organizationId:n}}=_l(),{user:s}=si(),{mutate:o,isLoading:r}=function(e={}){return Xn("mutation TranslationUpdate(\n $organizationId: OrganizationId!\n $translationId: TranslationId!\n $translation: TranslationInput!\n) {\n translationUpdate(\n organizationId: $organizationId\n translationId: $translationId\n translation: $translation\n ) {\n id\n }\n}\n",e)}(),[a,l]=(0,L.useState)(!1),[d,c]=(0,L.useState)(Object.fromEntries(e.languages.map(t=>[t,e.translation[t.toLowerCase()]||""]))),u=s.language,h=e.languages.every(t=>e.translation[`is${t}Translated`]);return(0,i.jsxs)(Na,{css:{border:"1px solid $gray200",borderBottom:e.isLast?"1px solid $gray200":"none",borderBottomLeftRadius:e.isLast?"$2":"0",borderBottomRightRadius:e.isLast?"$2":"0",borderTopLeftRadius:e.isFirst?"$2":"0",borderTopRightRadius:e.isFirst?"$2":"0",overflow:"hidden"},direction:"column",children:[(0,i.jsxs)(Na,{align:"center",css:{background:"white",cursor:"pointer",padding:"$4",userSelect:"none"},gap:"2",width:1,onClick:()=>{l(!a)},children:[(0,i.jsx)(El,{color:"invisible",css:{color:"$gray700"},leftIcon:a?"chevron-down":"chevron-right"}),(0,i.jsx)(yr,{css:{flex:"1"},font:"gray800 textMd medium",children:tZ(e.translation,u)}),(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(ic,{children:t(e.translation.module)}),h?(0,i.jsx)(ic,{color:"success",children:t("Translated")}):(0,i.jsx)(ic,{color:"warning",children:t("NotTranslated")})]})]}),a&&(0,i.jsxs)(Na,{css:{background:"$gray100",padding:"$6"},direction:"column",gap:"6",children:[e.languages.map(t=>{const n=`Version ${t}`;return e.translation.translationType===zt.RichText?(0,i.jsx)(Jv,{initialValue:d[t],label:n,onChange:e=>{c({...d,[t]:e})}},t):(0,i.jsx)(Nl,{label:n,value:d[t],onChange:e=>{c({...d,[t]:e})}},t)}),(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_PARAM_EDIT,children:(0,i.jsx)(Na,{children:(0,i.jsx)(El,{isLoading:r,onClick:async()=>{await o({organizationId:n,translationId:e.translation.id,translation:Object.fromEntries(Object.entries(d).map(([e,t])=>[e.toLowerCase(),t]))})},children:t("mettre_jour_85141")})})})]})]})},iZ=e=>{const t=Yn(),n=Mc(),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(e.eventsIds),[l,d]=(0,L.useState)(e.modules),[c,u]=(0,L.useState)(e.translationStatus),h=(0,L.useMemo)(()=>(0,lc.A)(e.organization.events.nodes,e=>e.name.toLowerCase()),[e.organization]);return(0,i.jsxs)(Na,{css:{background:"white",bd:!0,padding:"$4"},gap:"3",children:[(0,i.jsx)(Nl,{icon:"search",placeholder:t("rechercher_une_22159"),value:e.content,onChange:e.setContent}),(0,i.jsxs)(jC,{apply:()=>{e.setEventsIds(r),e.setModules(l),e.setTranslationStatus(c),o(!1)},color:"gray",isOpen:s,reinit:()=>{e.setEventsIds([]),a([]),e.setModules([]),d([]),e.setTranslationStatus(Tt.TranslatedAndNotTranslated),u(Tt.TranslatedAndNotTranslated),o(!1)},showButtons:!0,onStateChange:o,children:[(0,i.jsx)(bc,{isSearchVisible:!0,label:t("_v_nements_53672"),multiple:!0,renderOnPortal:!0,values:r,onChange:a,children:h.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)(bc,{isSearchVisible:!0,label:t("module_67984"),multiple:!0,renderOnPortal:!0,values:l,onChange:d,children:n(Rn)}),(0,i.jsx)(zu,{label:t("statut_de_tradu_58384"),value:c,onChange:u,children:n($n)})]})]})},sZ=e=>(0,i.jsx)(Na,{css:{background:"white",border:"1px solid $gray200",borderBottom:e.isLast?"1px solid $gray200":"none",borderBottomLeftRadius:e.isLast?"$2":"0",borderBottomRightRadius:e.isLast?"$2":"0",borderTopLeftRadius:e.isFirst?"$2":"0",borderTopRightRadius:e.isFirst?"$2":"0",padding:"$4"},children:(0,i.jsx)(oc,{borderRadius:"$2",height:32,width:1})}),oZ=e=>{const{translate:t}=_l(),n=e.organization.translations.totalCount-e.organization.translated.totalCount;return(0,i.jsxs)(Na,{css:{height:"fit-content"},gap:"6",width:1,children:[(0,i.jsx)(yr,{width:.3,children:(0,i.jsx)(rN,{css:{height:"100%"},children:(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(yr,{font:"gray500 textSm medium",children:t("nombre_de_langu_75924")}),(0,i.jsx)(yr,{font:"gray900 displayMd medium",children:e.organization.languages.length})]})})}),(0,i.jsx)(yr,{css:{flex:"1"},children:(0,i.jsx)(rN,{children:(0,i.jsxs)(Na,{gap:"6",justify:"between",children:[(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(yr,{font:"gray500 textSm medium",children:t("nombre_de_champ_26560")}),(0,i.jsx)(yr,{font:"gray900 displayMd medium",children:e.organization.translations.totalCount})]}),(0,i.jsxs)(Na,{direction:"column",gap:"3",children:[(0,i.jsx)(yr,{font:"gray700 textXs semiBold",children:t("dont_10477")}),(0,i.jsxs)(Na,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(yr,{font:"gray500 textSm medium",children:t("champs_tradui_47609")}),(0,i.jsx)(yr,{font:"gray900 textMd semiBold",children:n})]}),(0,i.jsxs)(Na,{align:"center",gap:"8",justify:"between",children:[(0,i.jsx)(yr,{font:"gray500 textSm medium",children:t("champs_traduits_03119")}),(0,i.jsx)(yr,{font:"gray900 textMd semiBold",children:e.organization.translated.totalCount})]})]})]})})})]})},rZ=e=>{const{translate:t,params:{organizationId:n}}=_l(),[s,o,r]=Bc(""),[a,l]=(0,L.useState)([]),[d,c]=(0,L.useState)(Tt.TranslatedAndNotTranslated),[u,h]=(0,L.useState)([]),[g,p]=(0,L.useState)(0),{data:f,isLoading:x}=Zn("query OrganizationTranslations(\n $organizationId: OrganizationId!\n $content: String\n $status: TranslationStatus\n $eventsIds: [EventId!]\n $modules: [TranslationModule!]\n $offset: Int\n) {\n organization(id: $organizationId) {\n translations(\n content: $content\n status: $status\n eventsIds: $eventsIds\n modules: $modules\n limit: 25\n offset: $offset\n ) {\n nodes {\n ...Translation\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:n,content:m(o)?o:null,eventsIds:a,modules:u,status:d,offset:g},[Ls.TranslationFragment]);const{numberOfPages:_,totalCount:I}=ku(f.organization?.translations),v=f.organization?.translations.nodes??[];return(0,i.jsxs)(Na,{css:{overflowY:"auto"},direction:"column",height:1,children:[(0,i.jsxs)(Na,{css:{borderBottom:"1px solid $gray200",padding:"$6 $7"},direction:"column",children:[(0,i.jsx)(yr,{font:"gray900 textXl medium",children:t("traductions_88349")}),(0,i.jsx)(yr,{color:"gray500",children:t("g_rer_toutes_le_39107")})]}),(0,i.jsxs)(Na,{css:{background:"$gray50",flex:"1",padding:"$7"},direction:"column",children:[(0,i.jsx)(oZ,{organization:e.organization}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(iZ,{content:s,eventsIds:a,modules:u,organization:e.organization,setContent:r,setEventsIds:l,setModules:h,setTranslationStatus:c,translationStatus:d}),(0,i.jsx)(qa,{height:"4"}),x?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(sZ,{isFirst:!0,isLast:!1}),(0,i.jsx)(sZ,{isFirst:!1,isLast:!1}),(0,i.jsx)(sZ,{isFirst:!1,isLast:!0})]}):v.map((t,n)=>(0,i.jsx)(nZ,{isFirst:0===n,isLast:n===v.length-1,languages:e.organization.languages,translation:t},t.id)),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)($c,{numberOfPages:_,offset:g,setOffset:p,totalCount:I})]})]})},aZ=()=>{const{params:{organizationId:e}}=_l(),{data:t,loader:n}=Zn("query OrganizationTranslationsStats($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n languages\n\n events {\n nodes {\n id\n name\n }\n }\n\n translations {\n totalCount\n }\n\n translated: translations(status: Translated) {\n totalCount\n }\n }\n}\n",{organizationId:e},[]);return n||(0,i.jsx)(rZ,{organization:t.organization})},lZ=e=>{const{translate:t,params:{organizationId:n}}=_l(),{showNotification:s}=kb(),{mutate:o}=function(e={}){return Xn("mutation UserRolesDelete($organizationId: OrganizationId!, $userId: UserId!) {\n userRolesDelete(organizationId: $organizationId, userId: $userId)\n}\n",e)}(),r=function(e,t){const{mutate:n}=qo();return(0,L.useCallback)(()=>Promise.all([Oe.PositionCategoryLeaderAssign,Oe.PositionLeaderAssign,Oe.DelegationCategoryLeaderAssign,Oe.DelegationLeaderAssign,Oe.EventInvite,Oe.OrganizationInvite].map(i=>n({organizationId:e,userInfoId:t,emailType:i}))),[n,e,t])}(n,e.userInfo.id),[a,l]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Hc,{children:[(0,i.jsx)(Gd,{icon:"paper-plane",onClick:async e=>{Nd(e.target),await r()},children:t("r_envoyer_l_e_96215")}),(0,i.jsx)(Yu,{color:"gray100",direction:"horizontal"}),(0,i.jsx)(Gd,{color:"red",icon:"trash-can",onClick:e=>{Nd(e.target),l(!0)},children:t("supprimer_l_acc_85342")})]}),a&&(0,i.jsx)(sA,{buttonText:t("supprimer_les_a_96621"),subtext:t("_tes_vous_s_r_d_35776",e.userInfo.nameOrEmail),text:t("supprimer_l_acc_85342"),onClose:()=>l(!1),onDelete:async()=>{await o({organizationId:n,userId:e.userInfo.userId}),s(t("tous_les_acc_s_26440",e.userInfo.nameOrEmail)),e.reload()}})]})};var dZ;!function(e){e[e.Delegations=0]="Delegations",e[e.DelegationsCategories=1]="DelegationsCategories",e[e.Positions=2]="Positions",e[e.PositionsCategories=3]="PositionsCategories"}(dZ||(dZ={}));const cZ=e=>{const{translate:t}=_l(),n=(0,L.useMemo)(()=>e.level??(e.eventId?it.Event:it.Both),[e.eventId,e.level]),[s,o]=(0,L.useState)(!1),[r,a]=(0,L.useState)(null),[l,d,c]=Bc("");(0,L.useEffect)(()=>{(async()=>{if(o(!0),e.resource===dZ.Delegations){const{organization:s}=await(t={organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:n,name:m(d)?d:void 0,ids:e.ids},i=await K(),ho('query DelegationsSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $level: OrganizationEventLevel!\n $ids: [DelegationId!]!\n $name: String\n) {\n organization(id: $organizationId) {\n name\n\n list: delegations(\n level: $level\n eventId: $eventId\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n\n selected: delegations(level: $level, ids: $ids) @include(if: $hasSelected) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',{variables:t,token:i||void 0,fragments:[]}));a(s)}else if(e.resource===dZ.DelegationsCategories){const{organization:t}=await function(e,t){return ho('query DelegationsCategoriesSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $level: OrganizationEventLevel!\n $ids: [DelegationsCategoryId!]!\n $name: String\n) {\n organization(id: $organizationId) {\n name\n\n list: delegationsCategories(\n level: $level\n eventId: $eventId\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n\n selected: delegationsCategories(level: $level, ids: $ids) @include(if: $hasSelected) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,level:n,name:m(d)?d:void 0,ids:e.ids},await K());a(t)}else if(e.resource===dZ.Positions){const{organization:t}=await function(e,t){return ho(fo,{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:m(d)?d:void 0,ids:e.ids},await K());a(t)}else if(e.resource===dZ.PositionsCategories){const{organization:t}=await function(e,t){return ho('query PositionsCategoriesSearch(\n $organizationId: OrganizationId!\n $eventId: EventId\n $hasSelected: Boolean!\n $ids: [DelegationsCategoryId!]!\n $name: String\n) {\n organization(id: $organizationId) {\n name\n\n list: positionsCategories(\n eventId: $eventId\n name: $name\n limit: 50\n sort: { attribute: "Name", direction: Asc }\n ) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n\n selected: positionsCategories(ids: $ids) @include(if: $hasSelected) {\n nodes {\n id\n name\n\n event {\n id\n name\n }\n }\n }\n }\n}\n',{variables:e,token:t||void 0,fragments:[]})}({organizationId:e.organizationId,eventId:e.eventId,hasSelected:e.hasSelected,name:m(d)?d:void 0,ids:e.ids},await K());a(t)}var t,i;o(!1)})()},[n,d,e.eventId,e.hasSelected,e.organizationId,e.resource]);const u=(0,L.useMemo)(()=>{if(r){const t=(0,lc.A)((0,ph.A)(r.list.nodes.concat(r.selected.nodes),e=>e.id),e=>e.name.toLowerCase());return n!==it.Both&&e.eventId?t.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)):Object.values((0,ac.A)(t,e=>e.event?.id??-1)).map(e=>{const t=e[0];return(0,i.jsx)("optgroup",{label:t.event?.name??r.name,children:e.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))},t.event?.id??-1)})}return(0,i.jsx)(i.Fragment,{})},[e.eventId,n,r]);return(0,i.jsx)(bc,{isSearchLoading:s,isSearchVisible:!0,renderOnPortal:!0,searchElement:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:t("rechercher_50038"),state:"search",value:l,onChange:c}),values:e.ids,onChange:e.onChange,children:u})},uZ=e=>{const{translate:t,params:{organizationId:n}}=_l();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:e.accessScope===ne.DelegationCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(ne.DelegationCategory),children:t("r_le_sur_une_ca_31475")}),e.accessScope===ne.DelegationCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(cZ,{hasSelected:!0,ids:[e.resourceId],level:it.Event,organizationId:n,resource:dZ.DelegationsCategories,onChange:t=>{no(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(zu,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.delegationCategoryRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},hZ=e=>{const{translate:t,params:{organizationId:n}}=_l();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:e.accessScope===ne.Delegation?"checked":"unchecked",onClick:()=>e.setAccessScope(ne.Delegation),children:t("r_le_sur_une_d_10967")}),e.accessScope===ne.Delegation&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Na,{css:{paddingLeft:"$6"},gap:"4",children:(0,i.jsx)(cZ,{hasSelected:!0,ids:[e.resourceId],level:it.Both,organizationId:n,resource:dZ.Delegations,onChange:t=>{no(t)&&e.setResourceId(t[0])}})})]})]})},mZ=e=>{const{translate:t}=_l(),{organization:n}=yI();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:e.accessScope===ne.Event?"checked":"unchecked",onClick:()=>e.setAccessScope(ne.Event),children:t("r_le_sur_un_v_89523")}),e.accessScope===ne.Event&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(zu,{shouldParseAsInt:!0,value:e.resourceId,onChange:e.setResourceId,children:n.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(zu,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.eventRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},gZ=e=>{const{translate:t,params:{organizationId:n}}=_l();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:e.accessScope===ne.PositionCategory?"checked":"unchecked",onClick:()=>e.setAccessScope(ne.PositionCategory),children:t("r_le_sur_une_ca_13181")}),e.accessScope===ne.PositionCategory&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(cZ,{hasSelected:!0,ids:[e.resourceId],organizationId:n,resource:dZ.PositionsCategories,onChange:t=>{no(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(zu,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.positionCategoryRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},pZ=e=>{const{translate:t,params:{organizationId:n}}=_l();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:e.accessScope===ne.Position?"checked":"unchecked",onClick:()=>e.setAccessScope(ne.Position),children:t("r_le_sur_une_mi_92313")}),e.accessScope===ne.Position&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsxs)(Na,{css:{paddingLeft:"$6"},gap:"4",children:[(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(cZ,{hasSelected:!0,ids:[e.resourceId],organizationId:n,resource:dZ.Positions,onChange:t=>{no(t)&&e.setResourceId(t[0])}})}),(0,i.jsx)(yr,{css:{flex:"1",overflow:"hidden"},children:(0,i.jsx)(zu,{shouldParseAsInt:!0,value:e.roleId,onChange:e.setRoleId,children:e.positionRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]})]})]})},fZ=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(oc,{borderRadius:"$1",height:20,width:1})]}),xZ=e=>{const{translate:t,params:{organizationId:n}}=_l(),{organization:s,roles:o}=yI(),{mutate:r}=function(e={}){return Xn("mutation UserAccessCreate(\n $organizationId: OrganizationId!\n $scope: AccessScope!\n $userInfoId: UsersInfoId!\n $resourceId: Int!\n $roleId: RoleId\n) {\n userAccessCreate(\n organizationId: $organizationId\n scope: $scope\n userInfoId: $userInfoId\n resourceId: $resourceId\n roleId: $roleId\n )\n}\n",e)}(),{data:a,isLoading:l}=Zn('query OrganizationUserAddRole($organizationId: OrganizationId!) {\n organization(id: $organizationId) {\n delegations(level: Both, limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n\n delegationsCategories(level: Event, limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n\n positions(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n\n positionsCategories(limit: 1, sort: { attribute: "Name", direction: Asc }) {\n nodes {\n id\n }\n }\n }\n}\n',{organizationId:n},[]),[d,c]=(0,L.useState)(ne.Organization),[u,h]=(0,L.useState)(o.organizationRoles[0].id),[m,g]=(0,L.useState)(-1),p=e=>{e===ne.Organization?h(o.organizationRoles[0].id):e===ne.Event?(h(o.eventRoles[0].id),g(s.events.nodes[0].id)):e===ne.Delegation?(h(-1),g(a.organization.delegations.nodes[0].id)):e===ne.DelegationCategory?(h(o.delegationCategoryRoles[0].id),g(a.organization.delegationsCategories.nodes[0].id)):e===ne.Position?(h(o.positionRoles[0].id),g(a.organization.positions.nodes[0].id)):e===ne.PositionCategory&&(h(o.positionRoles[0].id),g(a.organization.positionsCategories.nodes[0].id)),c(e)};return(0,i.jsxs)(Rb,{children:[(0,i.jsx)($b,{children:(0,i.jsx)(El,{color:"invisible",leftIcon:"plus",children:t("ajouter_un_r_le_19073")})}),(0,i.jsxs)(Ob,{children:[(0,i.jsx)(zb,{icon:"user-lock",children:t("ajouter_un_r_le_19073")}),(0,i.jsx)(Tb,{children:l?(0,i.jsx)(fZ,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xc,{state:d===ne.Organization?"checked":"unchecked",onClick:()=>p(ne.Organization),children:t("r_le_sur_l_orga_15663")}),d===ne.Organization&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Na,{css:{paddingLeft:"$6"},children:(0,i.jsx)(zu,{shouldParseAsInt:!0,value:u,onChange:h,children:o.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})})]}),no(s.events.nodes)&&(0,i.jsx)(mZ,{accessScope:d,eventRoles:o.eventRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),no(a.organization?.delegations.nodes)&&(0,i.jsx)(hZ,{accessScope:d,resourceId:m,setAccessScope:p,setResourceId:g}),no(a.organization?.delegationsCategories.nodes)&&(0,i.jsx)(uZ,{accessScope:d,delegationCategoryRoles:o.delegationCategoryRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),no(a.organization?.positions.nodes)&&(0,i.jsx)(pZ,{accessScope:d,positionRoles:o.positionRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h}),no(a.organization?.positionsCategories.nodes)&&(0,i.jsx)(gZ,{accessScope:d,positionCategoryRoles:o.positionRoles,resourceId:m,roleId:u,setAccessScope:p,setResourceId:g,setRoleId:h})]})}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{onClick:async()=>{await r({organizationId:n,scope:d,resourceId:d===ne.Organization?n:m,roleId:d===ne.Delegation?void 0:u,userInfoId:e.userInfoId}),e.onClose()},children:t("ajouter_97327")})})]})]})},_Z=e=>{const{organization:t}=yI(),{canOrganizationUserEdit:n}=SS(),{mutate:s}=ga(),[o,r]=(0,L.useState)(e.roleId);return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(zu,{shouldParseAsInt:!0,state:n?"active":"disabled",value:o,onChange:n=>(r(n),(n=>s({organizationId:t.id,scope:e.scope,id:e.id,roleId:n}))(n)),children:e.roles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Ec,{children:e.resource}),n&&(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsx)(yr,{color:"error700",onClick:async()=>{e.onDelete(e.scope,e.id)},children:(0,i.jsx)(el,{icon:"trash-can"})})})]})},IZ=e=>{const{translate:t}=_l(),{organization:n,roles:s}=yI(),{canOrganizationUserEdit:o}=SS(),{mutate:r}=ma(),[a,l]=(0,L.useState)(e.userInfo.usersEvents.filter(t=>t.event.id===e.event.id)),[d,c]=(0,L.useState)(e.userInfo.usersDelegations.filter(t=>t.eventId===e.event.id)),[u,h]=(0,L.useState)(e.userInfo.usersDelegationsCategories.filter(t=>t.eventId===e.event.id)),[m,g]=(0,L.useState)(e.userInfo.usersPositions.filter(t=>t.eventId===e.event.id)),[p,f]=(0,L.useState)(e.userInfo.usersPositionsCategories.filter(t=>t.eventId===e.event.id)),x=async(e,t)=>{await r({organizationId:n.id,scope:e,id:t}),l(e=>e.filter(e=>e.id!==t)),c(e=>e.filter(e=>e.id!==t)),h(e=>e.filter(e=>e.id!==t)),g(e=>e.filter(e=>e.id!==t)),f(e=>e.filter(e=>e.id!==t))};return no(a)||no(d)||no(u)||no(m)||no(p)?(0,i.jsx)(Fc,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:t("r_le_59302")}),(0,i.jsx)(Vc,{}),o&&(0,i.jsx)(Vc,{width:100})]}),rows:(0,i.jsxs)(i.Fragment,{children:[a.map(t=>(0,i.jsx)(_Z,{id:t.id,resource:"-",roleId:t.role.id,roles:s.eventRoles,scope:ne.Event,userId:e.userInfo.userId,onDelete:x},t.id)),d.map(e=>(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:t("responsable_de_70462")}),(0,i.jsx)(Ec,{children:e.delegation.name}),o&&(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsx)(yr,{color:"error700",onClick:()=>x(ne.Delegation,e.id),children:(0,i.jsx)(el,{icon:"trash-can"})})})]},e.id)),u.map(t=>(0,i.jsx)(_Z,{id:t.id,resource:t.delegationCategory.name,roleId:t.role.id,roles:s.delegationCategoryRoles,scope:ne.DelegationCategory,userId:e.userInfo.userId,onDelete:x},t.id)),m.map(t=>(0,i.jsx)(_Z,{id:t.id,resource:t.position.name,roleId:t.role.id,roles:s.positionRoles,scope:ne.Position,userId:e.userInfo.userId,onDelete:x},t.id)),p.map(t=>(0,i.jsx)(_Z,{id:t.id,resource:t.positionCategory.name,roleId:t.role.id,roles:s.positionRoles,scope:ne.PositionCategory,userId:e.userInfo.userId,onDelete:x},t.id))]}),title:e.event.name}):null},vZ=e=>{const{translate:t}=_l(),{organization:n,roles:s}=yI(),{canOrganizationUserEdit:o}=SS(),{mutate:r}=ga(),{mutate:a}=ma(),[l,d]=(0,L.useState)(e.userOrganization.role.id),[c,u]=(0,L.useState)(e.userOrganization.sendNotifications),h=(t,i)=>r({organizationId:n.id,scope:ne.Organization,id:e.userOrganization.id,sendNotifications:t,roleId:i});return(0,i.jsxs)(Dc,{children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(zu,{shouldParseAsInt:!0,state:o?"active":"disabled",value:l,onChange:e=>(d(e),h(c,e)),children:s.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})}),(0,i.jsx)(Ec,{children:(0,i.jsx)(ju,{disabled:!o,value:c,onChange:e=>(u(e),h(e,l)),children:t("activer_38612")})}),o&&(0,i.jsx)(Yc,{justify:"center",children:(0,i.jsx)(yr,{color:"error700",onClick:async()=>{await a({organizationId:n.id,scope:ne.Organization,id:e.userOrganization.id}),e.onDelete(e.userOrganization.id)},children:(0,i.jsx)(el,{icon:"trash-can"})})})]})},bZ=e=>{const{translate:t}=_l(),{organization:n}=yI(),{canOrganizationUserEdit:s}=SS(),[o,r]=(0,L.useState)(e.userInfo.usersOrganizations),a=e=>{r(t=>t.filter(t=>t.id!==e))};return(0,i.jsx)(Fc,{headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:t("r_le_59302")}),(0,i.jsx)(Vc,{children:t("notifications_98765")}),s&&(0,i.jsx)(Vc,{width:100})]}),rows:(0,i.jsx)(i.Fragment,{children:o.map((t,n)=>(0,i.jsx)(vZ,{userId:e.userInfo.userId,userOrganization:t,onDelete:a},n))}),title:n.name})},jZ=e=>{const{translate:t}=_l(),{organization:n}=yI(),{canOrganizationUserEdit:s}=SS();return(0,i.jsxs)(xu,{size:"md",onClose:e.onClose,children:[(0,i.jsx)(yj,{children:e.userInfo.nameOrEmail}),(0,i.jsxs)(_u,{css:{gap:"$4",py:"$6"},children:[no(e.userInfo.usersOrganizations)&&(0,i.jsx)(bZ,{userInfo:e.userInfo}),n.events.nodes.map(t=>(0,i.jsx)(IZ,{event:t,userInfo:e.userInfo},t.id)),s&&(0,i.jsx)(xZ,{userInfoId:e.userInfo.id,onClose:e.onClose})]}),(0,i.jsx)(Iu,{children:(0,i.jsx)(Na,{gap:"3",justify:"end",children:(0,i.jsx)(El,{color:"white",onClick:e.onClose,children:t("fermer_62479")})})})]})},CZ=e=>{const[t,n]=(0,L.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Dc,{css:{cursor:"pointer",userSelect:"none","&:hover":{background:"$gray100"}},onClick:()=>n(!0),children:[(0,i.jsx)(Ec,{children:(0,i.jsx)(uj,{isClickDisabled:!0,size:32,userInfo:e.userInfo})}),(0,i.jsx)(My,{userPermissions:e.userInfo}),(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_USER_EDIT,children:(0,i.jsx)(Yc,{justify:"end",children:(0,i.jsx)(lZ,{reload:e.reload,userInfo:e.userInfo})})})]}),t&&(0,i.jsx)(jZ,{userInfo:e.userInfo,onClose:()=>{e.reloadUserInfo(e.userInfo.id),n(!1)}})]})},yZ=e=>{const{translate:t}=_l(),{organization:n}=yI(),{showNotification:s}=kb(),{onClose:o}=wb(),{mutate:r,isLoading:a}=function(e={}){return Xn("mutation OrganizationInvite(\n $organizationId: OrganizationId!\n $email: UserEmail!\n $roleId: RoleId!\n) {\n organizationInvite(organizationId: $organizationId, email: $email, roleId: $roleId) {\n id\n }\n}\n",e)}(),{mutate:l,isLoading:c}=function(e={}){return Xn("mutation EventInvite($eventId: EventId!, $email: UserEmail!, $roleId: RoleId!) {\n eventInvite(eventId: $eventId, email: $email, roleId: $roleId) {\n id\n }\n}\n",e)}(),u=n.roles.find(e=>e.type===It.OrganizationAdmin),h=n.roles.find(e=>e.type===It.OrganizationReader),m=n.roles.find(e=>e.type===It.EventAdmin),g=n.roles.find(e=>e.type===It.EventReader),[p,f]=(0,L.useState)(""),[x,_]=(0,L.useState)(u.id),I=n.events.nodes,[v,b]=(0,L.useState)(I[0]?.id),j=(0,L.useMemo)(()=>I.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id)),[I]),C=function(e){return d.Yj().email().required().isValidSync(e)}(p);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(zb,{icon:"user-plus",children:t("inviter_un_util_06611")}),(0,i.jsxs)(Tb,{gap:"6",children:[(0,i.jsx)(Nl,{isEmail:!0,label:t("Email"),value:p,onChange:f}),(0,i.jsxs)(Na,{direction:"column",children:[(0,i.jsx)(yr,{font:"gray800 textSm medium",children:t("quel_r_le_souha_92592")}),(0,i.jsx)(qa,{height:"2"}),(0,i.jsx)(xc,{state:x===u.id?"checked":"unchecked",onClick:()=>_(u.id),children:u.name}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:x===h.id?"checked":"unchecked",onClick:()=>_(h.id),children:h.name}),no(I)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:x===m.id?"checked":"unchecked",onClick:()=>_(m.id),children:m.name}),x===m.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Na,{css:{paddingLeft:"$6"},children:(0,i.jsx)(zu,{shouldParseAsInt:!0,value:v,onChange:b,children:j})})]}),(0,i.jsx)(qa,{height:"3"}),(0,i.jsx)(xc,{state:x===g.id?"checked":"unchecked",onClick:()=>_(g.id),children:g.name}),x===g.id&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(Na,{css:{paddingLeft:"$6"},children:(0,i.jsx)(zu,{shouldParseAsInt:!0,value:v,onChange:b,children:j})})]})]})]})]}),(0,i.jsx)(Eb,{children:(0,i.jsx)(El,{disabled:!C,isLoading:a||c,onClick:async()=>{const i=n.roles.find(e=>e.id===x);if(x===u.id||x===h.id)await r({organizationId:n.id,email:p,roleId:x}),s(t("_1_a_t_invit_38156",p,i.name));else{const e=I.find(e=>e.id===v);await l({eventId:v,email:p,roleId:x}),s(t("_1_a_t_invit_15646",p,i.name,e.name))}e.reload(),o()},children:t("inviter_35349")})})]})},kZ=e=>{const{translate:t}=_l();return(0,i.jsxs)(tj,{gap:"6",children:[(0,i.jsx)(yr,{css:{flex:"1"},font:"gray900 displayXs medium",children:t("utilisateurs_04975")}),(0,i.jsx)(Bb,{permissions:Nb.ORGANIZATION_USER_EDIT,children:(0,i.jsxs)(Rb,{children:[(0,i.jsx)($b,{children:(0,i.jsx)(El,{children:t("inviter_un_util_06611")})}),(0,i.jsx)(Ob,{children:(0,i.jsx)(yZ,{reload:e.reload})})]})})]})},AZ=()=>{const{translate:e,params:{organizationId:t}}=_l(),{organization:n,roles:s}=yI(),[o,r]=(0,L.useState)(!0),[a,l,d]=Bc(""),[c,u]=(0,L.useState)(-1),[h,g]=(0,L.useState)(-1),[p,f]=(0,L.useState)(Tc),[x,_]=(0,L.useState)(0),{data:I,isLoading:v,reload:b}=Zn("query OrganizationUsers(\n $organizationId: OrganizationId!\n $hasRole: Boolean!\n $name: String\n $roleId: RoleId\n $eventId: EventId\n $limit: Int\n $offset: Int\n) {\n organization(id: $organizationId) {\n usersInfos(\n hasRole: $hasRole\n name: $name\n roleId: $roleId\n eventId: $eventId\n limit: $limit\n offset: $offset\n ) {\n nodes {\n ...UserInfoOrganization\n }\n\n numberOfPages\n totalCount\n }\n }\n}\n",{organizationId:t,hasRole:o,name:m(l)?l:void 0,roleId:-1!==c?c:void 0,eventId:-1!==h?h:void 0,limit:p,offset:x},[Ls.UserInfoOrganizationFragment]);const{numberOfPages:j,totalCount:C}=ku(I.organization?.usersInfos),[y,k]=(0,L.useState)([]),[A,w]=(0,L.useState)({}),S=(0,L.useCallback)(async e=>{w(t=>({...t,[e]:!0}));const{organization:{userInfo:t}}=await function(e,t){return ho("query OrganizationUsersUser(\n $organizationId: OrganizationId!\n $eventId: EventId\n $userInfoId: UsersInfoId!\n) {\n organization(id: $organizationId) {\n userInfo(id: $userInfoId) {\n ...UserInfoOrganization\n }\n }\n}\n",{variables:e,token:t||void 0,fragments:[Ls.UserInfoOrganizationFragment]})}({organizationId:n.id,userInfoId:e},await K());k(n=>n.map(n=>n.id===e?t:n)),w(t=>({...t,[e]:!1}))},[n]);return(0,L.useEffect)(()=>{k(I.organization?.usersInfos.nodes??[])},[I.organization]),(0,i.jsxs)(nj,{css:{overflowY:"auto"},children:[(0,i.jsx)(kZ,{reload:b}),(0,i.jsx)(ej,{children:(0,i.jsx)(Fc,{filters:(0,i.jsxs)(Na,{align:"center",gap:"3",width:1,children:[(0,i.jsx)(yr,{width:300,children:(0,i.jsx)(Nl,{icon:"magnifying-glass",placeholder:e("rechercher_un_m_05904"),value:a,onChange:d})}),(0,i.jsx)(yr,{css:{flex:"1"}}),(0,i.jsx)(gc,{state:o?"checked":"unchecked",onClick:e=>r("checked"===e),children:e("seulement_les_u_63675")}),(0,i.jsx)(yr,{width:240,children:(0,i.jsxs)(bc,{isSearchVisible:!0,menuWidth:320,renderOnPortal:!0,values:[c],onChange:e=>{no(e)&&u(e[0])},children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_r_les_18736")}),(0,i.jsx)("optgroup",{label:e("organisation_71863"),children:s.organizationRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("_v_nement_22345"),children:s.eventRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("Delegation"),children:s.delegationCategoryRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,i.jsx)("optgroup",{label:e("Position"),children:s.positionRoles.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))})]})}),(0,i.jsx)(yr,{width:240,children:(0,i.jsxs)(zu,{shouldParseAsInt:!0,value:h,onChange:g,children:[(0,i.jsx)("option",{value:-1,children:e("tous_les_v_nem_16033")}),n.events.nodes.map(e=>(0,i.jsx)("option",{value:e.id,children:e.name},e.id))]})})]}),headerCells:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Vc,{children:e("full_name")}),(0,i.jsx)(Vc,{children:e("r_les_61679")}),(0,i.jsx)(Bb,{rolesTypes:[It.OrganizationAdmin],children:(0,i.jsx)(Vc,{width:100})})]}),limit:p,numberOfPages:j,offset:x,rows:v?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0}),(0,i.jsx)(Uc,{bx:!0})]}):(0,i.jsx)(i.Fragment,{children:y.map(e=>A[e.id]?(0,i.jsx)(Uc,{bx:!0},e.id):(0,i.jsx)(CZ,{reload:b,reloadUserInfo:S,userInfo:e},e.id))}),setLimit:f,setOffset:_,totalCount:C})})]})},wZ=()=>{const{translate:e,params:{organizationId:t}}=_l();Dd(e("param_tres_78420"));const{isOrganizationAdmin:n,isOrganizationReader:s,hasFeature:o}=yI(),{canOrganizationParamRead:r,canOrganizationUserRead:a}=SS();return(0,i.jsxs)(Na,{height:1,width:1,children:[(0,i.jsx)(BK,{}),(0,i.jsx)(yr,{css:{flex:"1"},height:1,children:(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:$s.ORGANIZATION_PARAMETERS_PROFILE(":organizationId"),children:(0,i.jsx)(VK,{})}),r&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.ORGANIZATION_PARAMETERS_INFOS(":organizationId"),children:(0,i.jsx)(RK,{})}),a&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.ORGANIZATION_PARAMETERS_TEAM(":organizationId"),children:(0,i.jsx)(AZ,{})}),a&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.ORGANIZATION_PARAMETERS_ROLES(":organizationId"),children:(0,i.jsx)(YK,{})}),r&&(0,i.jsx)(Ar.qh,{path:$s.ORGANIZATION_PARAMETERS_EMAILS(":organizationId"),children:(0,i.jsx)(hK,{})}),r&&(0,i.jsx)(Ar.qh,{path:bi.ORGANIZATION_SETTINGS_EVENTS_SHOWCASE({organizationId:":organizationId"}),children:(0,i.jsx)(nj,{children:(0,i.jsx)(zK,{})})}),r&&(0,i.jsx)(Ar.qh,{path:bi.ORGANIZATION_SETTINGS_MEMBERS_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(nj,{children:(0,i.jsx)(MK,{})})}),r&&o(Ne.Delegation)&&(0,i.jsx)(Ar.qh,{path:bi.ORGANIZATION_SETTINGS_DELEGATION_SPACE({organizationId:":organizationId"}),children:(0,i.jsx)(nj,{children:(0,i.jsx)(oK,{})})}),r&&(0,i.jsx)(Ar.qh,{path:$s.ORGANIZATION_PARAMETERS_CATEGORIES(":organizationId"),children:(0,i.jsx)(JY,{})}),r&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.ORGANIZATION_PARAMETERS_TAGS(":organizationId"),children:(0,i.jsx)(eZ,{})}),r&&(0,i.jsx)(Ar.qh,{path:$s.ORGANIZATION_PARAMETERS_TRANSLATIONS(":organizationId"),children:(0,i.jsx)(aZ,{})}),n&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.ORGANIZATION_PARAMETERS_INVOICES(":organizationId"),children:(0,i.jsx)($K,{})}),r&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.ORGANIZATION_PARAMETERS_ACTIVITY(":organizationId"),children:(0,i.jsx)(BY,{})}),s&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.ORGANIZATION_PARAMETERS_SKIDATA(":organizationId"),children:(0,i.jsx)(XK,{})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.ORGANIZATION_PARAMETERS_PROFILE(t)})})]})})]})},SZ=Object.keys(Nb).length/2;function EZ(e){return new Array(SZ).fill("0").map((t,n)=>e.includes(n)?"1":"0").join("")}const TZ=EZ([Nb.POSITION_READ,Nb.POSITION_EDIT,Nb.MEMBER_EDIT,Nb.MEMBER_ASSIGNMENT_STATE_EDIT,Nb.COMMENT_READ,Nb.COMMENT_ADD,Nb.MEMBER_AVAILABILITIES_EDIT,Nb.MEMBER_ASSIGN,Nb.CAMPAIGN_SEND,Nb.ACCREDITATION_READ,Nb.ACCREDITATION_EDIT,Nb.MEMBER_ACCREDIT,Nb.DELEGATION_READ,Nb.DELEGATION_EDIT,Nb.FORM_READ,Nb.FORM_EDIT,Nb.EMAIL_EDIT,Nb.CAMPAIGN_READ,Nb.DOCUMENT_READ,Nb.DOCUMENT_EDIT,Nb.WORKFLOW_READ,Nb.WORKFLOW_EDIT,Nb.CUSTOM_FIELD_READ,Nb.CUSTOM_FIELD_EDIT,Nb.SEGMENT_EDIT,Nb.MEMBER_CREATE,Nb.MEMBER_DELETE,Nb.EVENT_EDIT,Nb.ORGANIZATION_PARAM_READ,Nb.ORGANIZATION_PARAM_EDIT,Nb.ORGANIZATION_USER_READ,Nb.ORGANIZATION_USER_EDIT]),zZ=EZ([Nb.POSITION_READ,Nb.COMMENT_READ,Nb.ACCREDITATION_READ,Nb.DELEGATION_READ,Nb.FORM_READ,Nb.CAMPAIGN_READ,Nb.DOCUMENT_READ,Nb.WORKFLOW_READ,Nb.CUSTOM_FIELD_READ,Nb.ORGANIZATION_PARAM_READ,Nb.ORGANIZATION_USER_READ]),OZ=EZ([Nb.POSITION_READ,Nb.POSITION_EDIT,Nb.MEMBER_EDIT,Nb.MEMBER_ASSIGNMENT_STATE_EDIT,Nb.COMMENT_READ,Nb.COMMENT_ADD,Nb.MEMBER_AVAILABILITIES_EDIT,Nb.MEMBER_ASSIGN,Nb.CAMPAIGN_SEND,Nb.ACCREDITATION_READ,Nb.ACCREDITATION_EDIT,Nb.MEMBER_ACCREDIT,Nb.DELEGATION_READ,Nb.DELEGATION_EDIT,Nb.FORM_READ,Nb.FORM_EDIT,Nb.EMAIL_EDIT,Nb.CAMPAIGN_READ,Nb.DOCUMENT_READ,Nb.DOCUMENT_EDIT,Nb.WORKFLOW_READ,Nb.WORKFLOW_EDIT,Nb.SEGMENT_EDIT,Nb.MEMBER_CREATE,Nb.MEMBER_DELETE]),RZ=EZ([Nb.POSITION_READ,Nb.COMMENT_READ,Nb.ACCREDITATION_READ,Nb.DELEGATION_READ,Nb.FORM_READ,Nb.CAMPAIGN_READ,Nb.DOCUMENT_READ,Nb.WORKFLOW_READ]),$Z=EZ([Nb.POSITION_READ,Nb.POSITION_EDIT,Nb.COMMENT_READ,Nb.MEMBER_ASSIGN,Nb.CAMPAIGN_SEND,Nb.CAMPAIGN_READ]),DZ=EZ([Nb.POSITION_READ,Nb.COMMENT_READ]),PZ=EZ([Nb.DELEGATION_READ,Nb.DELEGATION_EDIT]);let FZ=class extends Ul{constructor(e){super(e)}default(e){return{name:e?.name??"",description:e?.description??"",accessLevel:e?.accessLevel??_t.Position,permissions:e?.permissions??$Z}}schema(){return d.Ik().shape({role:d.Ik().shape({name:d.Yj().required(this.t("le_nom_est_requ_61536")),description:d.Yj().required(this.t("la_description_46559")),accessLevel:d.Yj().required(this.t("le_niveau_d_acc_94726")).oneOf(En,this.t("le_niveau_d_acc_94726")),permissions:d.Yj().matches(new RegExp(`^[01]{${SZ}}$`),this.t("le_format_des_p_68818")).required(this.t("le_format_des_p_68818"))}).required()}).required()}};FZ=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],FZ);const MZ=pr("div",{display:"grid",gap:"$4 $7",gridTemplateColumns:"280px auto"}),NZ=pr("div",{fontWeight:"$medium",gridColumn:1}),LZ=({children:e,disabled:t,permission:n,subtext:s,permissions:o,change:r})=>(0,i.jsx)("div",{style:{gridColumn:2},children:(0,i.jsx)(ju,{css:{alignItems:"start","> *:first-child":{margin:"2px 0"}},disabled:t,subtext:s,value:"1"===o[n],onChange:e=>r("role.permissions",function(e,t,n){return[...e].toSpliced(t,1,n).join("")}(o,n,e?"1":"0")),children:e})}),BZ=({children:e,...t})=>(0,i.jsx)(Mm,{css:{"legend + div":{minHeight:"32px"}},...t,hideToggle:!0,initialIsOpen:!0,children:e}),VZ=e=>{const{translate:t}=_l();return(0,i.jsxs)(BZ,{heading:t("accr_ditations_39450"),children:[(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("accr_ditations_39450")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.ACCREDITATION_READ,permissions:e.permissions,children:t("voir_les_accr_d_34867")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.ACCREDITATION_EDIT,permissions:e.permissions,children:t("_diter_les_accr_86042")})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("mod_ration_09947")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.MEMBER_ACCREDIT,permissions:e.permissions,children:t("accr_diter_les_48281")})]})]})},UZ=e=>{const t=Yn(),n=e.roleInput.accessLevel===_t.Organization||e.roleInput.accessLevel===_t.Event,s=e.roleInput.accessLevel===_t.Organization||e.roleInput.accessLevel===_t.Event,o=e.roleInput.accessLevel===_t.Organization||e.roleInput.accessLevel===_t.Event;return(0,i.jsxs)(BZ,{heading:t("communication_05277"),children:[n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("Form_plural")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.FORM_READ,permissions:e.roleInput.permissions,children:t("voir_les_formul_55824")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.FORM_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_form_10612")})]}),(0,i.jsx)(Ku,{height:"6"})]}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("Campaigns")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.CAMPAIGN_READ,permissions:e.roleInput.permissions,children:t("voir_les_campag_02148")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.CAMPAIGN_SEND,permissions:e.roleInput.permissions,children:t("envoyer_une_cam_35768")})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("e_mails_09850")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.EMAIL_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_e_ma_05609")})]})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("Documents")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.DOCUMENT_READ,permissions:e.roleInput.permissions,children:t("voir_les_docume_33988")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.DOCUMENT_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_docu_87778")})]})]})]})},WZ=()=>{const e=Yn();return(0,i.jsx)(BZ,{heading:e("communication_05277"),children:(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:e("Campaigns")}),(0,i.jsx)(oc,{borderRadius:"$1",css:{gridColumn:2},height:20})]})})},GZ=e=>{const t=Yn();return(0,i.jsx)(BZ,{heading:t("informations_su_20567"),children:(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[(0,i.jsx)(Ll,{disabled:e.disabled,label:t("nom_du_r_le_38492"),name:"role.name"}),(0,i.jsx)(Gm,{disabled:e.disabled,label:t("Description"),name:"role.description"}),(0,i.jsxs)(Hj,{label:t("niveau_d_acc_s_29898"),name:"role.accessLevel",state:e.disabled||e.isEdit?"disabled":"active",children:[(0,i.jsx)("option",{value:_t.Organization,children:t("administrateur_10076")}),(0,i.jsx)("option",{value:_t.Event,children:t("administrateur_99393")}),(0,i.jsx)("option",{value:_t.Position,children:t("responsable_de_82794")}),(0,i.jsx)("option",{disabled:!0,value:_t.DelegationCategory,children:t("responsable_de_75445")})]})]})})},HZ=()=>{const e=Yn();return(0,i.jsx)(BZ,{heading:e("informations_su_20567"),children:(0,i.jsxs)(Na,{direction:"column",gap:"6",children:[(0,i.jsx)(oc,{borderRadius:"$2",height:64,width:"100%"}),(0,i.jsx)(oc,{borderRadius:"$2",height:126,width:"100%"})]})})},qZ=e=>{const t=Yn(),n=e.roleInput.accessLevel===_t.Organization||e.roleInput.accessLevel===_t.Event,s=e.roleInput.accessLevel===_t.Organization||e.roleInput.accessLevel===_t.Event,o=e.roleInput.accessLevel===_t.Organization;return(0,i.jsxs)(BZ,{heading:t("population_38615"),children:[(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("membres_11310")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.MEMBER_CREATE,permissions:e.roleInput.permissions,children:t("cr_er_des_membr_28893")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.MEMBER_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_memb_39894")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.MEMBER_DELETE,permissions:e.roleInput.permissions,children:t("supprimer_les_m_98024")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.MEMBER_AVAILABILITIES_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_disp_75220")})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("commentaires_96492")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.COMMENT_READ,permissions:e.roleInput.permissions,subtext:t("sans_cette_perm_08373",t("Private")),children:t("lire_les_commen_55215")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.COMMENT_ADD,permissions:e.roleInput.permissions,children:t("ajouter_et_supp_32493")})]}),n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("d_l_gations_78318")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.DELEGATION_READ,permissions:e.roleInput.permissions,children:t("voir_les_d_l_ga_71959")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.DELEGATION_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_d_l_60281")})]})]}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("vues_personnali_80652")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.SEGMENT_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_vues_70658")})]})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("champs_de_formu_64126")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.CUSTOM_FIELD_READ,permissions:e.roleInput.permissions,children:t("voir_les_champs_59185")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.CUSTOM_FIELD_EDIT,permissions:e.roleInput.permissions,children:t("_diter_les_cham_47733")})]})]})]})},YZ=()=>{const e=Yn();return(0,i.jsxs)(BZ,{subtitle:e("permissions_rel_37045"),heading:e("membres_11310"),children:[(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:e("profil_du_membr_68116")}),(0,i.jsx)(oc,{borderRadius:"$1",css:{gridColumn:2},height:20})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:e("commentaires_96492")}),(0,i.jsx)(oc,{borderRadius:"$1",css:{gridColumn:2},height:40}),(0,i.jsx)(oc,{borderRadius:"$1",css:{gridColumn:2},height:20})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:e("disponibilit_s_49923")}),(0,i.jsx)(oc,{borderRadius:"$1",css:{gridColumn:2},height:20})]})]})},KZ=e=>{const{translate:t}=_l();return(0,i.jsx)(BZ,{heading:t("options_53186"),children:(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:"Automatisations"}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.WORKFLOW_READ,permissions:e.permissions,children:t("voir_les_automa_58340")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.WORKFLOW_EDIT,permissions:e.permissions,children:t("_diter_les_auto_80436")})]})})},ZZ=e=>{const{translate:t}=_l();return(0,i.jsxs)(BZ,{heading:t("organisation_71863"),children:[(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("_v_nements_53672")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.EVENT_EDIT,permissions:e.permissions,children:t("_diter_les_v_n_84914")})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("param_tres_78420")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.ORGANIZATION_PARAM_READ,permissions:e.permissions,children:t("voir_les_param_41674")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.ORGANIZATION_PARAM_EDIT,permissions:e.permissions,children:t("_diter_les_para_86184")})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("utilisateurs_et_83787")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.ORGANIZATION_USER_READ,permissions:e.permissions,children:t("voir_les_utilis_06462")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.ORGANIZATION_USER_EDIT,permissions:e.permissions,children:t("_diter_les_util_98017")})]})]})},XZ=e=>{const t=Yn();return(0,i.jsxs)(BZ,{heading:t("missions_63972"),children:[(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("missions_63972")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.POSITION_READ,permissions:e.permissions,children:t("voir_les_missio_71964")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.POSITION_EDIT,permissions:e.permissions,subtext:t("si_le_r_le_est_05344"),children:t("_diter_les_miss_75420")})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:t("affectation_plural")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.MEMBER_ASSIGN,permissions:e.permissions,children:t("affecter_des_me_26669")}),(0,i.jsx)(LZ,{change:e.change,disabled:e.disabled,permission:Nb.MEMBER_ASSIGNMENT_STATE_EDIT,permissions:e.permissions,subtext:t("permet_notammen_90746",t("PreAssigned")),children:t("changer_le_stat_34124")})]})]})},JZ=()=>{const e=Yn();return(0,i.jsxs)(BZ,{heading:e("missions_63972"),children:[(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:e("informations_su_61022")}),(0,i.jsx)(oc,{borderRadius:"$1",css:{gridColumn:2},height:60})]}),(0,i.jsx)(Ku,{height:"6"}),(0,i.jsxs)(MZ,{children:[(0,i.jsx)(NZ,{children:e("affectation")}),(0,i.jsx)(oc,{borderRadius:"$1",css:{gridColumn:2},height:20}),(0,i.jsx)(oc,{borderRadius:"$1",css:{gridColumn:2},height:40})]})]})},QZ=e=>{const{translate:t}=_l(),n=e.values.role.accessLevel,s=n===_t.Organization,o=n===_t.Organization||n===_t.Event,r=n===_t.Organization||n===_t.Event;return(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(vl,{}),(0,i.jsx)(Fr.Yr,{name:"role.accessLevel",children:t=>{t===_t.Organization?e.change("role.permissions",TZ):t===_t.Event?e.change("role.permissions",OZ):t===_t.DelegationCategory?e.change("role.permissions",PZ):t===_t.Position&&e.change("role.permissions",$Z)}}),!e.isCustom&&(0,i.jsx)(ol.Root,{color:"warning",children:(0,i.jsxs)(ol.Titled,{children:[(0,i.jsx)(ol.Title,{icon:"circle-exclamation",children:t("impossible_de_m_46897")}),(0,i.jsx)(ol.Text,{children:t("ce_r_le_est_pr_71742")})]})}),(0,i.jsx)(GZ,{disabled:e.disabled,isEdit:e.isEdit}),(0,i.jsx)(qZ,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),s&&(0,i.jsx)(ZZ,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),(0,i.jsx)(XZ,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),o&&(0,i.jsx)(VZ,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),(0,i.jsx)(UZ,{change:e.change,disabled:e.disabled,roleInput:e.values.role}),r&&(0,i.jsx)(KZ,{change:e.change,disabled:e.disabled,permissions:e.values.role.permissions}),e.children]})},eX=({children:e})=>(0,i.jsxs)(Na,{direction:"column",gap:"4",children:[(0,i.jsx)(HZ,{}),(0,i.jsx)(YZ,{}),(0,i.jsx)(JZ,{}),(0,i.jsx)(WZ,{}),e]}),tX=()=>{const{history:e,translate:t,params:{organizationId:n}}=_l(),s=(0,L.useRef)(null),o=qn(FZ),{mutate:r}=function(e={}){return Xn("mutation RoleCreate($organizationId: OrganizationId!, $role: RoleInput!) {\n roleCreate(organizationId: $organizationId, role: $role) {\n id\n }\n}\n",e)}(),{showNotification:a}=kb();return Dd(t("cr_ation_d_un_r_27933")),(0,i.jsx)(Cl,{customErrorRef:s,height:1,initialValues:{role:o.default(null)},render:({form:e,handleSubmit:o,submitting:r,values:a})=>(0,i.jsx)(Pm,{category:t("cr_ation_d_un_r_27933"),color:"dark",fallbackClosePath:$s.ORGANIZATION_PARAMETERS_ROLES(n),heading:t("nouveau_r_le_20981"),children:(0,i.jsx)($m,{ref:s,children:(0,i.jsx)(QZ,{change:e.change,disabled:!1,isCustom:!0,isEdit:!1,values:a,children:(0,i.jsx)(Fm,{children:(0,i.jsx)(El,{isLoading:r,textAlign:"center",onClick:o,children:t("cr_er_le_r_le_55678")})})})})}),schema:o.schema(),onSubmit:async({role:i})=>{await r({organizationId:n,role:i}),a({color:"success",text:t("le_r_le_a_bien_55424")}),e.goBack($s.ORGANIZATION_PARAMETERS_ROLES(n))}})},nX=()=>{const{history:e,translate:t,params:{organizationId:n,roleId:s}}=_l(),o=(0,L.useRef)(null),r=qn(FZ),{mutate:a}=function(e={}){return Xn("mutation RoleUpdate($organizationId: OrganizationId!, $roleId: RoleId!, $role: RoleInput!) {\n roleUpdate(organizationId: $organizationId, roleId: $roleId, role: $role) {\n id\n }\n}\n",e)}(),{data:l,isLoading:d}=Zn("query Role($organizationId: OrganizationId!, $roleId: RoleId!) {\n organization(id: $organizationId) {\n role(id: $roleId) {\n id\n type\n name\n description\n accessLevel\n permissions\n }\n }\n}\n",{organizationId:n,roleId:s},[]),{canOrganizationUserEdit:c}=SS(),{showNotification:u}=kb();Dd(t("mise_jour_de_17055",l.organization?.role.name));const h=(0,L.useMemo)(()=>c&&l.organization?.role.type===It.Custom,[l.organization,c]);return d?(0,i.jsx)(iX,{}):(0,i.jsx)(Cl,{customErrorRef:o,height:1,initialValues:{role:r.default(l.organization.role)},render:({form:e,handleSubmit:s,submitting:r,values:a})=>(0,i.jsx)(Pm,{button:h?(0,i.jsx)(El,{css:{flexShrink:0},isLoading:r,onClick:s,children:t("modifier_le_r_l_58957")}):void 0,category:t("mise_jour_de_17055",l.organization.role.name),color:"dark",fallbackClosePath:$s.ORGANIZATION_PARAMETERS_ROLES(n),heading:l.organization.role.name,children:(0,i.jsx)($m,{ref:o,children:(0,i.jsx)(QZ,{change:e.change,disabled:!h,isCustom:l.organization.role.type===It.Custom,isEdit:!0,values:a,children:h&&(0,i.jsx)(Fm,{children:(0,i.jsx)(El,{isLoading:r,textAlign:"center",onClick:s,children:t("modifier_le_r_l_58957")})})})})}),schema:r.schema(),onSubmit:async({role:i})=>{h&&(await a({organizationId:n,roleId:s,role:i}),u({color:"success",text:t("le_r_le_a_bien_48312")}),e.goBack($s.ORGANIZATION_PARAMETERS_ROLES(n)))}})},iX=()=>{const{organizationId:e}=Jn();return(0,i.jsx)(Pm,{fallbackClosePath:$s.ORGANIZATION_PARAMETERS_ROLES(e),heading:(0,i.jsx)(oc,{borderRadius:"$1",height:39,width:400}),children:(0,i.jsx)($m,{children:(0,i.jsx)(eX,{})})})};var sX,oX,rX,aX,lX,dX,cX,uX,hX,mX,gX,pX,fX,xX,_X,IX,vX,bX,jX,CX,yX,kX,AX,wX,SX,EX,TX,zX,OX,RX,$X,DX,PX,FX,MX,NX,LX,BX,VX,UX,WX,GX,HX,qX,YX,KX,ZX,XX,JX,QX,eJ,tJ,nJ,iJ,sJ,oJ,rJ,aJ,lJ,dJ,cJ,uJ,hJ,mJ,gJ,pJ,fJ,xJ,_J,IJ,vJ,bJ,jJ,CJ,yJ,kJ,AJ,wJ,SJ,EJ,TJ,zJ,OJ,RJ,$J,DJ,PJ,FJ,MJ,NJ,LJ,BJ,VJ,UJ,WJ,GJ,HJ,qJ,YJ,KJ,ZJ,XJ,JJ,QJ,eQ,tQ,nQ,iQ,sQ,oQ,rQ,aQ,lQ,dQ,cQ,uQ,hQ,mQ,gQ,pQ,fQ,xQ,_Q,IQ,vQ,bQ,jQ,CQ,yQ,kQ,AQ,wQ,SQ,EQ,TQ,zQ,OQ,RQ,$Q,DQ,PQ,FQ,MQ,NQ,LQ,BQ,VQ,UQ,WQ,GQ,HQ,qQ,YQ,KQ,ZQ,XQ,JQ,QQ,e0,t0,n0,i0,s0,o0,r0,a0;function l0(){return l0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=Yn();return(0,i.jsx)(Na,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Na,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(yr,{css:{"& svg":{height:"100%",width:"100%"}},height:140,width:180,children:(0,i.jsx)(d0,{})}),(0,i.jsx)(yr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_85226",vd)}),(0,i.jsxs)(yr,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",bd,vd)]})]})})};var u0;function h0(){return h0=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=Yn();return(0,i.jsx)(Na,{align:"center",css:{background:"$gray50"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Na,{align:"center",css:{background:"white",borderRadius:"$2",boxShadow:"$xs",padding:"$9"},direction:"column",gap:"2",justify:"center",width:840,children:[(0,i.jsx)(m0,{}),(0,i.jsx)(yr,{color:"gray900",fontSize:"displayXs",fontWeight:"semiBold",children:e("votre_compte_1_64779",vd)}),(0,i.jsxs)(yr,{color:"gray500",textAlign:"center",children:[e("ne_vous_inqui_t_38880")," ",(0,i.jsx)("br",{}),e("contactez_nous_35526",bd,vd)]})]})})},p0=()=>{const e=Yn(),{user:t}=si();return(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e("accepter_a_hre_50341",jd(Id(t?.language,new URL(location.href).searchParams)),vd)}})},f0=()=>{const{history:e,translate:t,params:{organizationId:n}}=_l(),{data:s,loader:o}=Zn('query UserInfo($organizationId: OrganizationId!) {\n user {\n userInfo(organizationId: $organizationId) {\n id\n firstName: fieldValue(slug: "firstName")\n lastName: fieldValue(slug: "lastName")\n phone: fieldValue(slug: "phone")\n }\n }\n}\n',{organizationId:n},[]),r=qn(pT),a=qn(Ba),{mutate:l}=function(e={}){return Xn("mutation UserInfoAndTermsUpdate(\n $userInfoId: UsersInfoId!\n $userInfoAndTermsInput: UserInfoAndTermsInput!\n) {\n userInfoAndTermsUpdate(userInfoId: $userInfoId, userInfoAndTermsInput: $userInfoAndTermsInput) {\n id\n }\n}\n",e)}(),d=(0,L.useRef)(null),{reload:c}=yI();return o||(0,i.jsx)(Cl,{customErrorRef:d,height:1,initialValues:{userInfoAndTerms:r.userInfoAndTermsInputDefault(s.user)},render:({handleSubmit:e})=>(0,i.jsxs)(q_,{ref:d,onClose:X,children:[(0,i.jsx)(vl,{}),(0,i.jsxs)(Mm,{centerTitleAndSubtitle:!0,hideToggle:!0,initialIsOpen:!0,subtitle:t("accepter_nos_co_49122"),heading:t("conditions_g_n_79662"),children:[(0,i.jsx)(Nm,{name:"userInfoAndTerms.termsAccepted",shouldPreventDefault:!1,children:(0,i.jsx)(p0,{})}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsxs)(Na,{gap:"4",children:[(0,i.jsx)(Ll,{label:(0,i.jsx)(Uv,{children:t("pr_nom_66988")}),name:"userInfoAndTerms.firstName"}),(0,i.jsx)(Ll,{label:(0,i.jsx)(Uv,{children:t("last_name")}),name:"userInfoAndTerms.lastName"})]}),(0,i.jsx)(qa,{height:"4"}),(0,i.jsx)(nI,{label:(0,i.jsx)(Uv,{children:t("Phone")}),prefix:"userInfoAndTerms.phone."})]}),(0,i.jsx)(Fm,{children:(0,i.jsx)(El,{textAlign:"center",onClick:e,children:t("mettre_jour_85141")})})]}),validate:a.validateForForm(r.updateUserInfoAndTermsSchema()),width:1,onSubmit:async t=>{await l({userInfoId:s.user.userInfo.id,userInfoAndTermsInput:t.userInfoAndTerms}),c(),e.location.state?e.push(e.location.state):e.push(bi.ORGANIZATION({organizationId:n}))}})},x0=()=>{const{isOrganizationAdmin:e,isOrganizationReader:t,organization:n}=yI(),{canCustomFieldRead:s,canEventEdit:o,canOrganizationUserEdit:r,canOrganizationUserRead:a}=SS(),l=wc();return(0,i.jsxs)(Ar.dO,{children:[e&&(0,i.jsx)(Ar.qh,{path:Ui.EVENTS_IMPORT({organizationId:":organizationId"}),children:(0,i.jsx)(aP,{})}),o&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.CREATE_EVENT(":organizationId"),children:(0,i.jsx)(iP,{})}),o&&(0,i.jsx)(Ar.qh,{exact:!0,path:$s.EDIT_EVENT(":organizationId",":eventId"),children:(0,i.jsx)(sP,{})}),(0,i.jsx)(Ar.qh,{path:Ui.EVENTS({organizationId:":organizationId"}),children:l?(0,i.jsx)($P,{}):(0,i.jsx)(gT,{children:(0,i.jsx)(RP,{})})}),(0,i.jsx)(Ar.qh,{path:Ui.EVENT({organizationId:":organizationId",eventId:":eventId"}),children:(0,i.jsx)(mY,{})}),s&&(0,i.jsx)(Ar.qh,{path:$s.CUSTOM_FIELDS(":organizationId"),children:(0,i.jsx)(gT,{children:(0,i.jsx)(KD,{})})}),e&&(0,i.jsx)(Ar.qh,{path:$s.CREATE_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId"),children:(0,i.jsx)(fY,{})}),e&&(0,i.jsx)(Ar.qh,{path:$s.EDIT_ORGANIZATION_PARAMETERS_EMAILS_SENDERS(":organizationId",":emailSenderId"),children:(0,i.jsx)(xY,{})}),t&&(0,i.jsx)(Ar.qh,{path:$s.ORGANIZATION_PARAMETERS_EMAILS_SENDERS_PREVIEW(":organizationId",":emailSenderId"),children:(0,i.jsx)(_Y,{})}),r&&(0,i.jsx)(Ar.qh,{path:$s.CREATE_ORGANIZATION_PARAMETERS_ROLE(":organizationId"),children:(0,i.jsx)(tX,{})}),a&&(0,i.jsx)(Ar.qh,{path:$s.EDIT_ORGANIZATION_PARAMETERS_ROLE(":organizationId",":roleId"),children:(0,i.jsx)(nX,{})}),(0,i.jsx)(Ar.qh,{path:$s.ORGANIZATION_PARAMETERS(":organizationId"),children:l?(0,i.jsx)(FY,{}):(0,i.jsx)(gT,{children:(0,i.jsx)(wZ,{})})}),(0,i.jsx)(Ar.qh,{path:yi.COMMUNITY({organizationId:":organizationId"}),children:(0,i.jsx)(TD,{})}),(0,i.jsx)(Ar.qh,{path:bi.IS_EXPIRED(bi.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(gT,{children:(0,i.jsx)(g0,{})})}),(0,i.jsx)(Ar.qh,{path:bi.IS_BLOCKED(bi.ORGANIZATION({organizationId:":organizationId"})),children:(0,i.jsx)(gT,{children:(0,i.jsx)(c0,{})})}),(0,i.jsx)(Ar.qh,{exact:!0,path:$s.ACCEPT_TERMS_AND_CONDITIONS(":organizationId"),children:(0,i.jsx)(f0,{})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:Ui.EVENTS({organizationId:n.id}),replace:!0})})]})},_0=()=>(0,i.jsx)(gI,{children:(0,i.jsx)(CI,{children:(0,i.jsx)(x0,{})})}),I0=()=>{const e=JSON.parse(window.HEAVENT_EXPORT_POSITIONS_MAP_DATA),[t,n]=(0,L.useState)(!1),{searchParams:s}=new URL(location.href),o=function(e){if(m(e)){const[t,n]=e.split(",");if(m(t)&&m(n)){const e=parseFloat(t),i=parseFloat(n);return isNaN(e)||isNaN(i)?null:{lat:e,lng:i}}return null}return null}(s.get("center")),r=s.get("acronymIcon")||"icon",a=s.get("zoom"),l=s.get("hiddenTracesIds")?.split(",").map(e=>parseInt(e,10))??[];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(cW,{acronymIcon:r,hiddenTracesIds:l,initialCenter:o,initialZoom:a?parseInt(a,10):null,layer:e.layer,mapOptions:{zoomControl:!1},positions:e.positions.nodes,showMarker:!1,traces:e.traces,onMapTilesloaded:()=>{n(!0)}})}),t&&(0,i.jsx)(Lr,{})]})},v0=()=>{const{eventId:e,positionId:t}=Jn(),{data:n,loader:s}=Zn("query PositionMap($eventId: EventId!, $positionId: PositionId!) {\n eventPublic(id: $eventId) {\n position(id: $positionId) {\n layer\n latitude\n longitude\n zoom\n\n traces {\n ...Trace\n }\n }\n }\n}\n",{eventId:e,positionId:t},[Ls.TraceFragment]),[o,r]=(0,L.useState)(!1);if(s)return s;{const e=n.eventPublic.position;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(yr,{css:{"& .gm-style-cc":{display:"none"}},height:1,width:1,children:(0,i.jsx)(Nr,{initialZoom:e.zoom,layer:e.layer,mapOptions:{disableDefaultUI:!0,keyboardShortcuts:!1},point:$r(e),traces:e.traces,onTilesloaded:()=>{r(!0)}})}),o&&(0,i.jsx)(Lr,{})]})}},b0=()=>{const e=Yn(),t=new URL(location.href).searchParams,n=t.get("eventName")||t.get("organizationName")||"",s=`${P.HEAVENT_API_URL}/users/${t.get("userId")||""}/`,o=t.get("eventId")?`${s}blacklist-event?eventId=${t.get("eventId")}`:`${s}blacklist-organization?organizationId=${t.get("organizationId")}`;return(0,i.jsx)(Na,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[(0,i.jsx)(yr,{font:"gray900 textXl semiBold",children:e("d_sinscription_61475")}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:e("vous_tes_sur_l_71517",n)}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(yr,{width:1,children:(0,i.jsx)(El,{color:"error",textAlign:"center",onClick:()=>{window.open(o,"_blank")},children:e("oui_je_souhait_20141")})})]})})},j0=()=>{const{translate:e,params:{ticketId:t}}=_l(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1),a=`${P.HEAVENT_API_URL}/users/${t}/check-in`;return(0,i.jsx)(Na,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsx)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:(0,i.jsx)(Na,{justify:"center",width:1,children:o?(0,i.jsx)(ic,{color:"success",leftIcon:"check",children:e("votre_pointage_47695")}):(0,i.jsx)(El,{isLoading:n,leftIcon:"check",textAlign:"center",onClick:async()=>{s(!0),await fetch(a),r(!0),s(!1)},children:e("point_sur_ma_m_52527")})})})})},C0=()=>{const{translate:e,params:{ticketId:t}}=_l(),[n,s]=(0,L.useState)(!1),[o,r]=(0,L.useState)(!1),a=`${P.HEAVENT_API_URL}/users/${t}/check-out`;return(0,i.jsx)(Na,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:(0,i.jsx)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:(0,i.jsx)(Na,{justify:"center",width:1,children:o?(0,i.jsx)(ic,{color:"success",leftIcon:"check",children:e("votre_d_pointag_86150")}):(0,i.jsx)(El,{isLoading:n,leftIcon:"check",textAlign:"center",onClick:async()=>{s(!0),await fetch(a),r(!0),s(!1)},children:e("d_point_sur_ma_60601")})})})})},y0=()=>{const{translate:e,params:{organizationId:t,userInfoId:n,customFieldSlug:s,value:o}}=_l(),{data:r,loader:a}=Ca({organizationId:t,slug:s}),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1),h=r.organization?.customField.name??"",m=r.organization?.customField.description??"",g=`${P.HEAVENT_API_URL}/users/${n}/field/${s}/update/${o}`;return(0,i.jsx)(Na,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:a||(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[(0,i.jsx)(yr,{font:"gray900 textXl semiBold",children:h}),(0,i.jsx)(qa,{height:"1"}),(0,i.jsx)(yr,{color:"gray500",textAlign:"center",children:m}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{justify:"center",width:1,children:c?(0,i.jsx)(ic,{color:"success",leftIcon:"check",children:e("votre_r_ponse_a_83191")}):(0,i.jsx)(El,{isLoading:l,leftIcon:"check",textAlign:"center",onClick:async()=>{d(!0),await fetch(g),u(!0),d(!1)},children:h})})]})})},k0=()=>{const{translate:e,params:{organizationId:t,customFieldSlug:n}}=_l(),{data:s,loader:o}=Ca({organizationId:t,slug:n}),[r,a]=(0,L.useState)(!1),[l,d]=(0,L.useState)(!1),[c,u]=(0,L.useState)(!1),[h,m]=(0,L.useState)(""),[g,p]=(0,L.useState)(""),f=s.organization?.customField.name??"",x=s.organization?.customField.description??"",_=`${P.HEAVENT_API_URL}/users/organization/${t}/update-by-ticket-id`;return(0,i.jsx)(Na,{align:"center",css:{background:"$gray50",overflow:"hidden"},height:1,justify:"center",width:1,children:o||(0,i.jsxs)(Na,{align:"center",css:{background:"white",bd:!0,padding:"$7"},direction:"column",width:640,children:[l&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Na,{width:1,children:(0,i.jsx)(sl,{color:"success",leftIcon:"check",rightIcon:"xmark",rightIconClick:()=>{d(!1)},width:1,children:e("le_champ_1_36490",f)})}),(0,i.jsx)(qa,{height:"6"})]}),c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Na,{width:1,children:(0,i.jsx)(sl,{color:"error",leftIcon:"circle-exclamation",rightIcon:"xmark",rightIconClick:()=>{u(!1)},width:1,children:e("le_champ_1_46567",f)})}),(0,i.jsx)(qa,{height:"6"})]}),(0,i.jsx)(Nl,{label:e("TicketId"),value:h,onChange:m}),(0,i.jsx)(qa,{height:"6"}),(0,i.jsx)(Nl,{hint:x,label:f,value:g,onChange:p}),(0,i.jsx)(qa,{height:"7"}),(0,i.jsx)(Na,{justify:"center",width:1,children:(0,i.jsx)(El,{isLoading:r,textAlign:"center",onClick:async()=>{a(!0),d(!1),u(!1),200===(await fetch(_,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticketId:h,slug:n,value:g})})).status?(d(!0),m(""),p("")):u(!0),a(!1)},children:e("mettre_jour_34131",f)})})]})})},A0=()=>{const{history:e,translate:t,params:{weezeventOrganizationId:n}}=_l(),{data:s,loader:o}=Zn("query WeezeventOrganizatio($id: Int) {\n organization: organizationByWeezeventId(id: $id) {\n id\n }\n}\n",{id:parseInt(n,10)},[]);return o||(s.organization?.id?(0,i.jsx)(Ar.rd,{to:bi.ORGANIZATION({organizationId:s.organization.id})}):(0,i.jsxs)(Na,{align:"center",css:{background:"white"},direction:"column",height:1,justify:"center",width:1,children:[(0,i.jsx)(Na,{align:"center",css:{background:fr.colors.blueGray900.value},height:64,justify:"center",width:1,children:(0,i.jsx)(Na,{align:"center",css:{"& svg":{height:"50%"}},height:1,width:300,children:(0,i.jsx)(td,{})})}),(0,i.jsxs)(Na,{align:"center",css:{background:"white",flex:"1"},direction:"column",gap:"6",justify:"center",width:1,children:[(0,i.jsx)(yr,{height:240,width:240,children:(0,i.jsx)("img",{height:"100%",src:gd.WeezConstruction,width:"100%"})}),(0,i.jsxs)(Na,{align:"center",direction:"column",gap:"1",children:[(0,i.jsx)(yr,{font:"gray800 textMd medium",children:t("aucun_compte_we_48865")}),(0,i.jsx)(yr,{color:"gray500",dangerouslySetInnerHTML:{__html:t("si_vous_d_sirez_19702")}})]}),(0,i.jsxs)(Na,{gap:"3",children:[(0,i.jsx)(El,{onClick:()=>window.open("mailto:benjamin.vuitton@gmail.com","_blank"),children:t("nous_contacter_38070")}),(0,i.jsx)(El,{color:"invisible",onClick:()=>e.push($s.CREATE_EVENT_WITH_ORGANIZATION(n)),children:t("essayer_mainten_36692")})]})]})]}))},w0=e=>(0,i.jsx)(oi,{getRedirectPath:()=>$s.AUTH_SIGN_IN,shouldHaveUser:!0,children:e.children}),S0=e=>(0,i.jsx)(oi,{getRedirectPath:()=>$s.HOME,shouldHaveUser:!1,children:e.children});const E0=async()=>{const{user:e}=await(async()=>{try{const e=await async function(){const e=await K();if(m(e)){const{user:t}=await function(e,t){return ho("query CurrentUser {\n user {\n id\n email\n language\n insertedAt\n hubspotToken\n profile\n termsAcceptedAt\n }\n}\n",{variables:{},token:t||void 0,fragments:[]})}(0,e);return{user:t}}throw new Error("No token")}();return Us.wB.defaultLocale=e.user.language.toLowerCase(),e}catch{return{user:null}}})();return await(e=>{const t=new URL(location.href).searchParams.get("lang");let n=null;e&&(n=e.language.toLowerCase()),m(t)&&(n=t);const i=n?`lang=${n}`:"";return rv(`${P.HEAVENT_API_URL}/translation/language.js?${i}`)})(e),{user:e}},T0=e=>{const[t,n]=(0,L.useState)(null);return(0,L.useEffect)(()=>{let e=!0;return E0().then(t=>{e&&n(t)}).catch(()=>{alert("Could not load application, please try again.")}),()=>{e=!1}},[]),t?e.render(t):(0,i.jsx)(kl,{})},z0=window.matchMedia("(max-width: 1200px)"),O0=L.createContext({isMobile:!1}),R0=e=>{const[t,n]=L.useState(!1);return L.useEffect(()=>{n(z0.matches),z0.addListener(e=>{n(e.matches)})},[]),(0,i.jsx)(O0.Provider,{value:{isMobile:t},children:e.children})},$0=(0,i.jsx)(kl,{});function D0(e,{redirectOnSuccess:t}={}){const[n,i]=(0,L.useState)(!1),{setIsError:s}=(0,L.useContext)(_H);let o=null;return n&&(o=$0),{isLoading:n,loader:o,mutate:async(n,o)=>{i(!0);try{const r=await K(),a=await((e,t,n)=>ho(e,{variables:t,token:n||void 0}))(e,n,o||r);return!0!==t&&(i(!1),s(!1)),a}catch(e){throw s(!0,no(e)?e:[]),e}}}}const P0=(0,i.jsx)(kl,{});function F0(e,t,n){const[i,s]=(0,L.useState)(!0),[o,r]=(0,L.useState)({}),[a,l]=(0,L.useState)(0),{setIsError:d}=(0,L.useContext)(_H),c=Object.keys(t).sort().map(e=>{const n=t[e];return`"${e}":${JSON.stringify(n)}`}).join(",");(0,L.useEffect)(()=>{let i=!1;var o;return s(!0),o=c,K().then(i=>ho(e,{reloadOnNewVersion:!0,variables:t,token:i,fragments:n})).then(e=>{i||o!==c||(r(e),d(!1),s(!1))},()=>{i||o!==c||d(!0)}),()=>{i=!0}},[e,c,a]);let u=null;return i&&(u=P0),{data:o,isLoading:i,loader:u,reload(){l(a+1)}}}function M0(){return function(e,t={}){return Object.fromEntries(Object.entries(e).map(([e,n])=>e.endsWith("Id")||"id"===e?[e,parseInt(n,10)]:t[e]?[e,t[e](n)]:[e,n]))}((0,Ar.g)())}function N0(){const e=(0,Ar.W6)();return{...e,goBack:t=>{"POP"===e.action&&e.length<=2?e.push(t):e.goBack()}}}function L0(){return(0,Ar.zy)()}function B0(){return(0,L.useMemo)(()=>{try{return{clear:window.localStorage.clear.bind(window.localStorage),setItem:window.localStorage.setItem.bind(window.localStorage),getItem:window.localStorage.getItem.bind(window.localStorage),removeItem:window.localStorage.removeItem.bind(window.localStorage),key:window.localStorage.key.bind(window.localStorage),get length(){return window.localStorage.length},getItemInt(e){const t=parseInt(window.window.localStorage.getItem(e),10);return isNaN(t)?null:t}}}catch{return{clear(){},setItem(){},getItem:()=>null,removeItem(){},key:()=>null,get length(){return 0},getItemInt:()=>null}}},[])}let V0=class extends Ul{constructor(e){super(e)}delegationFormInviteValuesDefault(){return{usersInfos:[{email:"",fields:{firstName:"",lastName:""}}]}}delegationFormInviteValuesSchema(){return d.Ik().shape({usersInfos:d.YO().of(d.Ik().shape({email:d.Yj().email(this.t("l_e_mail_est_re_04856")).required(this.t("l_e_mail_est_re_04856")),fields:d.gl()})).min(1,"Vous devez invité au moins une personne.")})}};V0=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],V0);let U0=class extends Ul{translationService;constructor(e){super(e),this.translationService=e}massStateUpdateSchema(){return d.Ik().shape({state:d.Yj().required(this.t("le_statut_est_r_13164")).oneOf([$t.NotApplicable,$t.PreAssigned,$t.Refused,$t.WaitingAssignment],this.t("le_statut_est_r_13164"))})}massAccreditationStateUpdateSchema(){return d.Ik().shape({state:d.Yj().required(this.t("le_statut_est_r_13164")).oneOf([le.NotApplicable,le.Refused,le.WaitingAccreditation],this.t("le_statut_est_r_13164"))})}};U0=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],U0);let W0=class extends Ul{translationService;constructor(e){super(e),this.translationService=e}};W0=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)(),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[Wn])],W0);let G0=class{translationInputDefault(e){return{fr:this.default(e.translationType,e.fr),en:this.default(e.translationType,e.en),es:this.default(e.translationType,e.es),de:this.default(e.translationType,e.de),nl:this.default(e.translationType,e.nl)}}default(e,t){switch(e){case zt.String:return m(t)?t:"";case zt.StringArray:return Array.isArray(t)?t:[];case zt.RichText:return m(t)?t:"";default:return rl()}}};G0=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)()],G0);let H0=class{get(){return{[It.OrganizationAdmin]:{accessLevel:_t.Organization,permissions:TZ,nameKey:"administrateur_11083",descriptionKey:"a_acc_s_toute_73520"},[It.OrganizationReader]:{accessLevel:_t.Organization,permissions:zZ,nameKey:"acc_s_en_lectur_30252",descriptionKey:"a_acc_s_l_org_94388"},[It.EventAdmin]:{accessLevel:_t.Event,permissions:OZ,nameKey:"administrateur_24785",descriptionKey:"a_acc_s_toute_25473"},[It.EventReader]:{accessLevel:_t.Event,permissions:RZ,nameKey:"acc_s_en_lectur_33482",descriptionKey:"a_acc_s_l_v_17476"},[It.PositionEditor]:{accessLevel:_t.Position,permissions:$Z,nameKey:"responsable_de_95683",descriptionKey:"peut_modifier_s_82832"},[It.PositionReader]:{accessLevel:_t.Position,permissions:DZ,nameKey:"responsable_de_72569",descriptionKey:"a_acc_s_ses_m_09741"},[It.DelegationCategoryLeader]:{accessLevel:_t.DelegationCategory,permissions:PZ,nameKey:"responsable_de_32820",descriptionKey:"a_acc_s_aux_d_l_87634"}}}};H0=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}([(0,qt._G)()],H0);const q0=new qt.i0(e=>{e(H0).toSelf().inSingletonScope(),e(du).toSelf().inSingletonScope(),e(Kc).toSelf().inSingletonScope(),e(ep).toSelf().inSingletonScope(),e(hh).toSelf().inSingletonScope(),e(xv).toSelf().inSingletonScope(),e(Tw).toSelf().inSingletonScope(),e(Ba).toSelf().inSingletonScope()}),Y0=new qt.i0(e=>{e(FP).toSelf().inSingletonScope(),e(DP).toSelf().inSingletonScope(),e(PP).toSelf().inSingletonScope(),e(Iv).toSelf().inSingletonScope(),e(Yl).toSelf().inSingletonScope(),e(Ym).toSelf().inSingletonScope(),e(Sv).toSelf().inSingletonScope(),e(oz).toSelf().inSingletonScope(),e(Ov).toSelf().inSingletonScope(),e(xL).toSelf().inSingletonScope(),e(XS).toSelf().inSingletonScope(),e(XV).toSelf().inSingletonScope(),e(JV).toSelf().inSingletonScope(),e(V0).toSelf().inSingletonScope(),e(SE).toSelf().inSingletonScope(),e(sL).toSelf().inSingletonScope(),e(Dj).toSelf().inSingletonScope(),e(Mj).toSelf().inSingletonScope(),e(gY).toSelf().inSingletonScope(),e(pE).toSelf().inSingletonScope(),e(mP).toSelf().inSingletonScope(),e(rP).toSelf().inSingletonScope(),e(Q_).toSelf().inSingletonScope(),e(mK).toSelf().inSingletonScope(),e(cC).toSelf().inSingletonScope(),e(IS).toSelf().inSingletonScope(),e(ld).toSelf().inSingletonScope(),e(ES).toSelf().inSingletonScope(),e(HV).toSelf().inSingletonScope(),e(QV).toSelf().inSingletonScope(),e(_E).toSelf().inSingletonScope(),e(PE).toSelf().inSingletonScope(),e(oU).toSelf().inSingletonScope(),e(LE).toSelf().inSingletonScope(),e(_T).toSelf().inSingletonScope(),e(zO).toSelf().inSingletonScope(),e(OO).toSelf().inSingletonScope(),e(fA).toSelf().inSingletonScope(),e(vD).toSelf().inSingletonScope(),e(uM).toSelf().inSingletonScope(),e(ZU).toSelf().inSingletonScope(),e(IM).toSelf().inSingletonScope(),e(U0).toSelf().inSingletonScope(),e(J_).toSelf().inSingletonScope(),e(X_).toSelf().inSingletonScope(),e(xU).toSelf().inSingletonScope(),e(EU).toSelf().inSingletonScope(),e(pU).toSelf().inSingletonScope(),e(fU).toSelf().inSingletonScope(),e(FZ).toSelf().inSingletonScope(),e(MR).toSelf().inSingletonScope(),e(W0).toSelf().inSingletonScope(),e(Kl).toSelf().inSingletonScope(),e(yd).toSelf().inSingletonScope(),e(KK).toSelf().inSingletonScope(),e(Rw).toSelf().inSingletonScope(),e(fW).toSelf().inSingletonScope(),e(G0).toSelf().inSingletonScope(),e(pT).toSelf().inSingletonScope(),e(xT).toSelf().inSingletonScope(),e(fT).toSelf().inSingletonScope(),e(tR).toSelf().inSingletonScope(),e(oR).toSelf().inSingletonScope()}),K0=new qt.i0(e=>{e(rC).toSelf().inSingletonScope(),e(gu).toSelf().inSingletonScope(),e(tF).toSelf().inSingletonScope(),e(Sm).toSelf().inSingletonScope(),e(t$).toSelf().inSingletonScope(),e(zD).toSelf().inSingletonScope(),e(b$).toSelf().inSingletonScope(),e(dP).toSelf().inSingletonScope(),e(GA).toSelf().inSingletonScope(),e(OU).toSelf().inSingletonScope(),e(Hh).toSelf().inSingletonScope(),e(wR).toSelf().inSingletonScope()});function Z0(){const e=new qt.mc,t=window.HEAVENT_TRANSLATIONS||{},n=window.HEAVENT_LANGUAGE;if(0===Object.keys(t).length)throw new Error("window.HEAVENT_TRANSLATIONS does not exist");if(!_d(n))throw new Error("window.HEAVENT_LANGUAGE is not valid");return e.bind(Wn).toConstantValue(new Wn(_d(n),t)),e.load(q0,Y0,K0),e}const X0=e=>(0,i.jsx)(Gn.Provider,{value:{container:Z0(),useQuery:F0,useMutation:D0,useExecuteQuery:mo,useParams:M0,useHistory:N0,useLocation:L0,useLocalStorage:B0},children:e.children});var J0=n(6751);const Q0=L.createContext({}),e1=e=>{const t=L.useCallback((e,t)=>{P.USE_MIXPANEL&&J0.A.track(e,t)},[]);return L.useEffect(()=>{P.USE_MIXPANEL&&J0.A.init(P.MIXPANEL_TOKEN,{debug:!0})},[]),(0,i.jsx)(Q0.Provider,{value:{track:t},children:e.children})},t1=L.createContext({active:!1,enable:Ql.A,disable:Ql.A}),n1=()=>{const{user:e}=si(),t=wc(),n=ti(),{active:i}=L.useContext(t1);return L.useEffect(()=>{if(P.USE_HUBSPOT&&m(e?.hubspotToken)){window.hsConversationsSettings={identificationEmail:e.email,identificationToken:e.hubspotToken};try{if(t||"true"===n.getItem(Bl.HIDE_HUBSPOT)||!i){const{loaded:e}=window.HubSpotConversations.widget.status();e?window.HubSpotConversations.widget.remove():window.HubSpotConversations.on("widgetLoaded",()=>{window.HubSpotConversations.widget.remove()})}else window.HubSpotConversations.clear({resetWidget:!0})}catch{}}},[t,i]),null};(0,Ht.render)((0,i.jsx)(L.StrictMode,{children:(0,i.jsxs)(({children:e})=>(0,i.jsx)(T0,{render:t=>(0,i.jsx)(ii.Provider,{value:t,children:(0,i.jsx)(X0,{children:(0,i.jsx)(R0,{children:(0,i.jsx)(IH,{children:(0,i.jsx)(yb,{children:(0,i.jsx)(e1,{children:(0,i.jsx)(fl.Provider,{value:{designSystem:"old"},children:(0,i.jsx)(i.Fragment,{children:e})})})})})})})})}),{children:[(0,i.jsx)(()=>((0,L.useEffect)(()=>{K().then(e=>{"true"===P.LOG_TOKEN&&console.log(`"${N}": "${e||""}"`)})},[]),null),{}),(0,i.jsx)(({children:e})=>{const[t,n]=L.useState(!0);return(0,i.jsxs)(t1.Provider,{value:{active:t,enable:()=>{n(!0)},disable:()=>{n(!1)}},children:[(0,i.jsx)(n1,{}),e]})},{children:(0,i.jsx)(()=>(0,i.jsx)(yr,{className:jr,css:{color:"$gray800",height:"100%",overflow:"hidden",position:"relative",width:"100%"},children:(0,i.jsx)(kr.Kd,{basename:P.HEAVENT_APP_URL.pathnameOptional,children:(0,i.jsxs)(Ar.dO,{children:[(0,i.jsx)(Ar.qh,{exact:!0,path:$s.HOME,children:(0,i.jsx)(w0,{children:(0,i.jsx)(aI,{})})}),(0,i.jsx)(Ar.qh,{path:$s.USER_UPDATE_BY_TICKET_ID(":organizationId",":customFieldSlug"),children:(0,i.jsx)(k0,{})}),(0,i.jsx)(Ar.qh,{path:$s.USER_FIELD_UPDATE(":organizationId",":userInfoId",":customFieldSlug",":value"),children:(0,i.jsx)(y0,{})}),(0,i.jsx)(Ar.qh,{path:$s.USER_CHECK_IN(":organizationId",":ticketId"),children:(0,i.jsx)(j0,{})}),(0,i.jsx)(Ar.qh,{path:$s.USER_CHECK_OUT(":organizationId",":ticketId"),children:(0,i.jsx)(C0,{})}),(0,i.jsx)(Ar.qh,{path:$s.BACKOFFICE,children:(0,i.jsx)(w0,{children:(0,i.jsx)(W_,{})})}),(0,i.jsx)(Ar.qh,{path:$s.POSITION_MAP(":eventId",":positionId"),children:(0,i.jsx)(v0,{})}),(0,i.jsx)(Ar.qh,{path:$s.ACCREDITATION_MAP(":eventId",":accreditationId"),children:(0,i.jsx)(Da,{})}),(0,i.jsx)(Ar.qh,{path:$s.EXPORT_POSITIONS_MAP(":eventId",":segmentId"),children:(0,i.jsx)(I0,{})}),(0,i.jsx)(Ar.qh,{path:mi(bi.ORGANIZATIONS),children:(0,i.jsx)(w0,{children:(0,i.jsx)(lI,{})})}),(0,i.jsx)(Ar.qh,{exact:!0,path:$s.CREATE_EVENT_WITH_ORGANIZATION(":weezeventOrganizationId?"),children:(0,i.jsx)(w0,{children:(0,i.jsx)(rI,{})})}),(0,i.jsx)(Ar.qh,{path:bi.ORGANIZATION({organizationId:":organizationId"}),children:(0,i.jsx)(w0,{children:(0,i.jsx)(_0,{})})}),(0,i.jsx)(Ar.qh,{path:$s.AUTH,children:(0,i.jsx)(S0,{children:(0,i.jsx)(Sd,{})})}),(0,i.jsx)(Ar.qh,{path:$s.COGNITO_CALLBACK,children:(0,i.jsx)(S0,{children:(0,i.jsx)(Td,{})})}),(0,i.jsx)(Ar.qh,{path:$s.MAGIC_LINK(":code",":source"),children:(0,i.jsx)(S0,{children:(0,i.jsx)(lr,{})})}),(0,i.jsx)(Ar.qh,{path:$s.UNSUBSCRIBE_EMAIL,children:(0,i.jsx)(b0,{})}),(0,i.jsx)(Ar.qh,{path:"/o:weezeventOrganizationId",children:(0,i.jsx)(A0,{})}),(0,i.jsx)(Ar.qh,{children:(0,i.jsx)(ni,{path:$s.HOME})})]})})}),{})})]})}),document.getElementById("heavent-react-hook"))},3780:(e,t,n)=>{"use strict";e.exports=n.p+"svg/check-b496988ef222b46ee39a.svg"},4025:(e,t,n)=>{"use strict";e.exports=n.p+"img/ignPlan-d4659acd351e7c1a33e4.png"},4236:(e,t,n)=>{"use strict";e.exports=n.p+"img/background404-7cbee4be29173b045b3e.jpg"},4362:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankSwissArmyKnife-1600d89a247ad1dab4a9.svg"},4385:()=>{!function(e){const t=e.de=e.de||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 von %1","Align center":"Zentriert","Align left":"Linksbündig","Align right":"Rechtsbündig",Aquamarine:"Aquamarinblau",Black:"Schwarz","Block quote":"Blockzitat",Blue:"Blau",Bold:"Fett","Break text":"Bild teilt Text","Bulleted List":"Aufzählungsliste",Cancel:"Abbrechen","Centered image":"Zentriertes Bild","Change image text alternative":"Alternativtext ändern","Choose heading":"Überschrift auswählen","Dim grey":"Dunkelgrau","Document colors":"Dokumentfarben",Downloadable:"Herunterladbar","Dropdown toolbar":"Dropdown-Liste Werkzeugleiste","Edit block":"Absatz bearbeiten","Edit link":"Link bearbeiten","Editor toolbar":"Editor Werkzeugleiste","Font Background Color":"Hintergrundfarbe","Font Color":"Schriftfarbe","Full size image":"Bild in voller Größe",Green:"Grün",Grey:"Grau",Heading:"Überschrift","Heading 1":"Überschrift 1","Heading 2":"Überschrift 2","Heading 3":"Überschrift 3","Heading 4":"Überschrift 4","Heading 5":"Überschrift 5","Heading 6":"Überschrift 6","Image resize list":"Bildgrößen-Liste","Image toolbar":"Bild Werkzeugleiste","image widget":"Bild-Steuerelement","In line":"Text in Zeile","Insert image":"Bild einfügen","Insert paragraph after block":"Absatz nach Block einfügen","Insert paragraph before block":"Absatz vor Block einfügen",Italic:"Kursiv",Justify:"Blocksatz","Left aligned image":"Linksbündiges Bild","Light blue":"Hellblau","Light green":"Hellgrün","Light grey":"Hellgrau",Link:"Link","Link URL":"Link Adresse",Next:"Nächste","Numbered List":"Nummerierte Liste","Open in a new tab":"In neuem Tab öffnen","Open link in new tab":"Link im neuen Tab öffnen",Orange:"Orange",Original:"Original",Paragraph:"Absatz",Previous:"vorherige",Purple:"Violett",Red:"Rot",Redo:"Wiederherstellen","Remove color":"Farbe entfernen","Resize image":"Bildgröße ändern","Resize image to %0":"Bildgröße ändern in %0","Resize image to the original size":"Bild in Originalgröße ändern","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich-Text-Editor, %0","Right aligned image":"Rechtsbündiges Bild",Save:"Speichern","Select all":"Alles auswählen","Show more items":"Mehr anzeigen","Side image":"Seitenbild","Text alignment":"Textausrichtung","Text alignment toolbar":"Text-Ausrichtung Toolbar","Text alternative":"Alternativtext","This link has no URL":"Dieser Link hat keine Adresse",Turquoise:"Türkis",Underline:"Unterstrichen",Undo:"Rückgängig",Unlink:"Link entfernen","Upload failed":"Hochladen fehlgeschlagen","Upload in progress":"Upload läuft",White:"Weiß","Widget toolbar":"Widget Werkzeugleiste","Wrap text":"Text umfließt Bild",Yellow:"Gelb"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},4628:(e,t,n)=>{"use strict";e.exports=n.p+"img/formPositionRanked-376168a7e3c71ed7defd.png"},5376:(e,t,n)=>{"use strict";e.exports=n.p+"svg/sad-cbf74279d944b2baac65.svg"},5488:(e,t,n)=>{var i;e=n.nmd(e),function(e){const t=e.fr=e.fr||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 sur %1","Align center":"Centrer","Align left":"Aligner à gauche","Align right":"Aligner à droite",Aquamarine:"Bleu vert",Black:"Noir","Block quote":"Citation",Blue:"Bleu",Bold:"Gras","Bulleted List":"Liste à puces",Cancel:"Annuler","Change image text alternative":"Changer le texte alternatif à l’image","Choose heading":"Choisir l'en-tête","Dim grey":"Gris pâle","Document colors":"Couleurs du document",Downloadable:"Fichier téléchargeable","Dropdown toolbar":"Barre d'outils dans un menu déroulant","Edit block":"Modifier le bloc","Edit link":"Modifier le lien","Editor toolbar":"Barre d'outils de l'éditeur","Font Background Color":"Couleur d'arrière-plan","Font Color":"Couleur de police",Green:"Vert",Grey:"Gris",Heading:"En-tête","Heading 1":"Titre 1","Heading 2":"Titre 2","Heading 3":"Titre 3","Heading 4":"Titre 4","Heading 5":"Titre 5","Heading 6":"Titre 6","Image resize list":"Liste des tailles d'images","image widget":"Objet image","Insert image":"Insérer une image","Insert paragraph after block":"Insérer du texte après ce bloc","Insert paragraph before block":"Insérer du texte avant ce bloc",Italic:"Italique",Justify:"Justifier","Light blue":"Bleu clair","Light green":"Vert clair","Light grey":"Gris clair",Link:"Lien","Link URL":"URL du lien",Next:"Suivant","Numbered List":"Liste numérotée","Open in a new tab":"Ouvrir dans un nouvel onglet","Open link in new tab":"Ouvrir le lien dans un nouvel onglet",Orange:"Orange",Original:"Taille originale",Paragraph:"Paragraphe",Previous:"Précedent",Purple:"Violet",Red:"Rouge",Redo:"Restaurer","Remove color":"Enlever la couleur","Resize image":"Redimensionner l'image","Resize image to %0":"Redimensionner à %0","Resize image to the original size":"Appliquer les dimensions d'origine","Rich Text Editor":"Éditeur de texte enrichi","Rich Text Editor, %0":"Éditeur de texte enrichi, %0",Save:"Enregistrer","Select all":"Sélectionner tout","Show more items":"Montrer plus d'éléments","Text alignment":"Alignement du texte","Text alignment toolbar":"Barre d'outils d'alignement du texte","Text alternative":"Texte alternatif","This link has no URL":"Ce lien n'a pas d'URL",Turquoise:"Turquoise",Underline:"Souligné",Undo:"Annuler",Unlink:"Supprimer le lien","Upload failed":"Échec de l'envoi","Upload in progress":"Téléchargement en cours",White:"Blanc","Widget toolbar":"Barre d'outils du widget",Yellow:"Jaune"}),t.getPluralForm=function(e){return e>1}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),self,i=()=>(()=>{"use strict";var i={636:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css"],names:[],mappings:"AAKA,uBAWC,0BAAsC,CADtC,iBAAkB,CAFlB,aAAc,CACd,cAAe,CAPf,eAAgB,CAIhB,kBAAmB,CADnB,mBAOD,CAEA,gCACC,aAAc,CACd,2BACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content blockquote {\n\t/* See #12 */\n\toverflow: hidden;\n\n\t/* https://github.com/ckeditor/ckeditor5-block-quote/issues/15 */\n\tpadding-right: 1.5em;\n\tpadding-left: 1.5em;\n\n\tmargin-left: 0;\n\tmargin-right: 0;\n\tfont-style: italic;\n\tborder-left: solid 5px hsl(0, 0%, 80%);\n}\n\n.ck-content[dir="rtl"] blockquote {\n\tborder-left: 0;\n\tborder-right: solid 5px hsl(0, 0%, 80%);\n}\n'],sourceRoot:""}]);const a=r},390:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:"";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-clipboard/clipboard.css"],names:[],mappings:"AASC,8DACC,cAAe,CAEf,mBAAoB,CADpB,iBAOD,CAJC,mEACC,iBAAkB,CAClB,OACD,CAWA,qJACC,YACD,CCzBF,MACC,yCAA0C,CAC1C,yCAA0C,CAC1C,6DACD,CAOE,mEAIC,gDAAiD,CADjD,sDAAuD,CAFvD,2DAA8D,CAI9D,gBAAiB,CAHjB,wDAqBD,CAfC,yEAWC,sFAAuF,CAEvF,kBAAmB,CADnB,qKAA0K,CAX1K,UAAW,CAIX,aAAc,CAFd,QAAS,CAIT,QAAS,CADT,iBAAkB,CAElB,wDAA2D,CAE3D,0BAA2B,CAR3B,OAYD,CA2DF,kEACC,gGACD,CAKA,gDACC,OAAS,CACT,sBACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t/*\n\t * Vertical drop target (in text).\n\t */\n\t& .ck.ck-clipboard-drop-target-position {\n\t\tdisplay: inline;\n\t\tposition: relative;\n\t\tpointer-events: none;\n\n\t\t& span {\n\t\t\tposition: absolute;\n\t\t\twidth: 0;\n\t\t}\n\t}\n\n\t/*\n\t * Styles of the widget being dragged (its preview).\n\t */\n\t& .ck-widget:-webkit-drag {\n\t\t& > .ck-widget__selection-handle {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t& > .ck-widget__type-around {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-clipboard-drop-target-dot-width: 12px;\n\t--ck-clipboard-drop-target-dot-height: 8px;\n\t--ck-clipboard-drop-target-color: var(--ck-color-focus-border)\n}\n\n.ck.ck-editor__editable {\n\t/*\n\t * Vertical drop target (in text).\n\t */\n\t& .ck.ck-clipboard-drop-target-position {\n\t\t& span {\n\t\t\tbottom: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\n\t\t\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\n\t\t\tborder: 1px solid var(--ck-clipboard-drop-target-color);\n\t\t\tbackground: var(--ck-clipboard-drop-target-color);\n\t\t\tmargin-left: -1px;\n\n\t\t\t/* The triangle above the marker */\n\t\t\t&::after {\n\t\t\t\tcontent: "";\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 50%;\n\t\t\t\ttop: calc(var(--ck-clipboard-drop-target-dot-height) * -.5);\n\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t\tborder-color: var(--ck-clipboard-drop-target-color) transparent transparent transparent;\n\t\t\t\tborder-width: calc(var(--ck-clipboard-drop-target-dot-height)) calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0 calc(.5 * var(--ck-clipboard-drop-target-dot-width));\n\t\t\t\tborder-style: solid;\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t// Horizontal drop target (between blocks).\n\t& .ck.ck-clipboard-drop-target-position {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\twidth: 100%;\n\t\theight: 0;\n\t\tmargin: 0;\n\t\ttext-align: initial;\n\n\t\t& .ck-clipboard-drop-target__line {\n\t\t\tposition: absolute;\n\t\t\twidth: 100%;\n\t\t\theight: 0;\n\t\t\tborder: 1px solid var(--ck-clipboard-drop-target-color);\n\t\t\tmargin-top: -1px;\n\n\t\t\t&::before {\n\t\t\t\tcontent: "";\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: calc(-1 * var(--ck-clipboard-drop-target-dot-size));\n\t\t\t\ttop: 0;\n\n\t\t\t\ttransform: translateY(-50%);\n\t\t\t\tborder-color: transparent transparent transparent var(--ck-clipboard-drop-target-color);\n\t\t\t\tborder-width: var(--ck-clipboard-drop-target-dot-size) 0 var(--ck-clipboard-drop-target-dot-size) calc(2 * var(--ck-clipboard-drop-target-dot-size));\n\t\t\t\tborder-style: solid;\n\t\t\t}\n\n\t\t\t&::after {\n\t\t\t\tcontent: "";\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tright: calc(-1 * var(--ck-clipboard-drop-target-dot-size));\n\t\t\t\ttop: 0;\n\n\t\t\t\ttransform: translateY(-50%);\n\t\t\t\tborder-color: transparent var(--ck-clipboard-drop-target-color) transparent transparent;\n\t\t\t\tborder-width: var(--ck-clipboard-drop-target-dot-size) calc(2 * var(--ck-clipboard-drop-target-dot-size)) var(--ck-clipboard-drop-target-dot-size) 0;\n\t\t\t\tborder-style: solid;\n\t\t\t}\n\t\t}\n\t}\n\t*/\n\n\t/*\n\t * Styles of the widget that it a drop target.\n\t */\n\t& .ck-widget.ck-clipboard-drop-target-range {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color) !important;\n\t}\n\n\t/*\n\t * Styles of the widget being dragged (its preview).\n\t */\n\t& .ck-widget:-webkit-drag {\n\t\tzoom: 0.6;\n\t\toutline: none !important;\n\t}\n}\n'],sourceRoot:""}]);const a=r},638:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-editor-classic/classiceditor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAKA,cAIC,iBAMD,CAJC,2DAEC,yBACD,CCLC,gDCED,eDKC,CAPA,uICMA,qCAAsC,CDJpC,2BAA4B,CAC5B,4BAIF,CAPA,gDAMC,qBACD,CAEA,iFACC,uBAAwB,CCR1B,eDaC,CANA,yMCHA,qCAAsC,CDOpC,eAEF,CAKF,yCAEC,0CAA2C,CCpB3C,eD8BD,CAZA,yHCdE,qCAAsC,CDmBtC,wBAAyB,CACzB,yBAMF,CAHC,0DACC,wCACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor {\n\t/* All the elements within `.ck-editor` are positioned relatively to it.\n\t If any element needs to be positioned with respect to the , etc.,\n\t it must land outside of the `.ck-editor` in DOM. */\n\tposition: relative;\n\n\t& .ck-editor__top .ck-sticky-panel .ck-toolbar {\n\t\t/* https://github.com/ckeditor/ckeditor5-editor-classic/issues/62 */\n\t\tz-index: var(--ck-z-modal);\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../mixins/_rounded.css";\n\n.ck.ck-editor__top {\n\t& .ck-sticky-panel {\n\t\t& .ck-toolbar {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-bottom-left-radius: 0;\n\t\t\t\tborder-bottom-right-radius: 0;\n\t\t\t}\n\n\t\t\tborder-bottom-width: 0;\n\t\t}\n\n\t\t& .ck-sticky-panel__content_sticky .ck-toolbar {\n\t\t\tborder-bottom-width: 1px;\n\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/* Note: Use ck-editor__main to make sure these styles don\'t apply to other editor types */\n.ck.ck-editor__main > .ck-editor__editable {\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/113 */\n\tbackground: var(--ck-color-base-background);\n\n\t@mixin ck-rounded-corners {\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t&:not(.ck-focused) {\n\t\tborder-color: var(--ck-color-base-border);\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},894:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text);cursor:text}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-engine/placeholder.css"],names:[],mappings:"AAMA,uCAEC,iBAWD,CATC,qDAIC,8BAA+B,CAF/B,MAAO,CAKP,mBAAoB,CANpB,iBAAkB,CAElB,OAKD,CAKA,wCACC,YACD,CAQD,iCACC,iBACD,CC5BC,qDAEC,6CAA8C,CAD9C,WAED",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* See ckeditor/ckeditor5#936. */\n.ck.ck-placeholder,\n.ck .ck-placeholder {\n\tposition: relative;\n\n\t&::before {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tcontent: attr(data-placeholder);\n\n\t\t/* See ckeditor/ckeditor5#469. */\n\t\tpointer-events: none;\n\t}\n}\n\n/* See ckeditor/ckeditor5#1987. */\n.ck.ck-read-only .ck-placeholder {\n\t&::before {\n\t\tdisplay: none;\n\t}\n}\n\n/*\n * Rules for the `ck-placeholder` are loaded before the rules for `ck-reset_all` in the base CKEditor 5 DLL build.\n * This fix overwrites the incorrectly set `position: static` from `ck-reset_all`.\n * See https://github.com/ckeditor/ckeditor5/issues/11418.\n */\n.ck.ck-reset_all .ck-placeholder {\n\tposition: relative;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* See ckeditor/ckeditor5#936. */\n.ck.ck-placeholder, .ck .ck-placeholder {\n\t&::before {\n\t\tcursor: text;\n\t\tcolor: var(--ck-color-engine-placeholder-text);\n\t}\n}\n"],sourceRoot:""}]);const a=r},401:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css"],names:[],mappings:"AAMA,qDACC,YACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Elements marked by the Renderer as hidden should be invisible in the editor. */\n.ck.ck-editor__editable span[data-ck-unsafe-element] {\n\tdisplay: none;\n}\n"],sourceRoot:""}]);const a=r},585:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-button.ck-color-table__remove-color{align-items:center;display:flex;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-font/fontcolor.css"],names:[],mappings:"AAKA,4CAEC,kBAAmB,CADnB,YAAa,CAEb,UACD,CAEA,8BACC,iBACD,CCNA,4CAEC,2BAA4B,CAC5B,4BAA6B,CAF7B,qEAiBD,CAbC,wDACC,mDACD,CAEA,kEAEE,uCAMF,CARA,kEAME,sCAEF",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-button.ck-color-table__remove-color {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 100%;\n}\n\nlabel.ck.ck-color-grid__label {\n\tfont-weight: unset;\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n.ck .ck-button.ck-color-table__remove-color {\n\tpadding: calc(var(--ck-spacing-standard) / 2 ) var(--ck-spacing-standard);\n\tborder-bottom-left-radius: 0;\n\tborder-bottom-right-radius: 0;\n\n\t&:not(:focus) {\n\t\tborder-bottom: 1px solid var(--ck-color-base-border);\n\t}\n\n\t& .ck.ck-icon {\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-right: var(--ck-spacing-standard);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n}\n\n'],sourceRoot:""}]);const a=r},230:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-heading/heading.css"],names:[],mappings:"AAKA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,+BACC,eACD,CCZC,2EACC,SACD,CAEA,uEACC,cACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-heading_heading1 {\n\tfont-size: 20px;\n}\n\n.ck.ck-heading_heading2 {\n\tfont-size: 17px;\n}\n\n.ck.ck-heading_heading3 {\n\tfont-size: 14px;\n}\n\n.ck[class*="ck-heading_heading"] {\n\tfont-weight: bold;\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Resize dropdown's button label. */\n.ck.ck-dropdown.ck-heading-dropdown {\n\t& .ck-dropdown__button .ck-button__label {\n\t\twidth: 8em;\n\t}\n\n\t& .ck-dropdown__panel .ck-list__item {\n\t\tmin-width: 18em;\n\t}\n}\n"],sourceRoot:""}]);const a=r},48:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/image.css"],names:[],mappings:"AAMC,mBAEC,UAAW,CADX,aAAc,CAOd,gBAAkB,CAGlB,cAAe,CARf,iBAuBD,CAbC,uBAEC,aAAc,CAGd,aAAc,CAGd,cAAe,CAGf,cACD,CAGD,0BAYC,sBAAuB,CANvB,mBAAoB,CAGpB,cAoBD,CAdC,kCACC,YACD,CAGA,gEAGC,WAAY,CACZ,aAAc,CAGd,cACD,CAUD,gEASC,eAAgB,CARhB,oBAAqB,CACrB,qBAAsB,CAQtB,sBAAuB,CAFvB,kBAGD,CAWA,2GACC,SAUD,CAHC,qEACC,YACD,CAOA,0FACC,cACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content {\n\t& .image {\n\t\tdisplay: table;\n\t\tclear: both;\n\t\ttext-align: center;\n\n\t\t/* Make sure there is some space between the content and the image. Center image by default. */\n\t\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\t \tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\t\tmargin: 0.9em auto;\n\n\t\t/* Make sure the caption will be displayed properly (See: https://github.com/ckeditor/ckeditor5/issues/1870). */\n\t\tmin-width: 50px;\n\n\t\t& img {\n\t\t\t/* Prevent unnecessary margins caused by line-height (see #44). */\n\t\t\tdisplay: block;\n\n\t\t\t/* Center the image if its width is smaller than the content\'s width. */\n\t\t\tmargin: 0 auto;\n\n\t\t\t/* Make sure the image never exceeds the size of the parent container (ckeditor/ckeditor5-ui#67). */\n\t\t\tmax-width: 100%;\n\n\t\t\t/* Make sure the image is never smaller than the parent container (See: https://github.com/ckeditor/ckeditor5/issues/9300). */\n\t\t\tmin-width: 100%\n\t\t}\n\t}\n\n\t& .image-inline {\n\t\t/*\n\t\t * Normally, the .image-inline would have "display: inline-block" and "img { width: 100% }" (to follow the wrapper while resizing).\n\t\t * Unfortunately, together with "srcset", it gets automatically stretched up to the width of the editing root.\n\t\t * This strange behavior does not happen with inline-flex.\n\t\t */\n\t\tdisplay: inline-flex;\n\n\t\t/* While being resized, don\'t allow the image to exceed the width of the editing root. */\n\t\tmax-width: 100%;\n\n\t\t/* This is required by Safari to resize images in a sensible way. Without this, the browser breaks the ratio. */\n\t\talign-items: flex-start;\n\n\t\t/* When the picture is present it must act as a flex container to let the img resize properly */\n\t\t& picture {\n\t\t\tdisplay: flex;\n\t\t}\n\n\t\t/* When the picture is present, it must act like a resizable img. */\n\t\t& picture,\n\t\t& img {\n\t\t\t/* This is necessary for the img to span the entire .image-inline wrapper and to resize properly. */\n\t\t\tflex-grow: 1;\n\t\t\tflex-shrink: 1;\n\n\t\t\t/* Prevents overflowing the editing root boundaries when an inline image is very wide. */\n\t\t\tmax-width: 100%;\n\t\t}\n\t}\n}\n\n.ck.ck-editor__editable {\n\t/*\n\t * Inhertit the content styles padding of the
in case the integration overrides `text-align: center`\n\t * of `.image` (e.g. to the left/right). This ensures the placeholder stays at the padding just like the native\n\t * caret does, and not at the edge of
.\n\t */\n\t& .image > figcaption.ck-placeholder::before {\n\t\tpadding-left: inherit;\n\t\tpadding-right: inherit;\n\n\t\t/*\n\t\t * Make sure the image caption placeholder doesn\'t overflow the placeholder area.\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\n\t\t */\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\n\t/*\n\t * Make sure the selected inline image always stays on top of its siblings.\n\t * See https://github.com/ckeditor/ckeditor5/issues/9108.\n\t */\n\t& .image.ck-widget_selected {\n\t\tz-index: 1;\n\t}\n\n\t& .image-inline.ck-widget_selected {\n\t\tz-index: 1;\n\n\t\t/*\n\t\t * Make sure the native browser selection style is not displayed.\n\t\t * Inline image widgets have their own styles for the selected state and\n\t\t * leaving this up to the browser is asking for a visual collision.\n\t\t */\n\t\t& ::selection {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t/* The inline image nested in the table should have its original size if not resized.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\n\t& td,\n\t& th {\n\t\t& .image-inline img {\n\t\t\tmax-width: none;\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=r},43:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck-content .image.image_resized{box-sizing:border-box;display:block;max-width:100%}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css"],names:[],mappings:"AAKA,iCAQC,qBAAsB,CADtB,aAAc,CANd,cAkBD,CATC,qCAEC,UACD,CAEA,4CAEC,aACD,CAQC,sHACC,cACD,CAIF,oFACC,uCACD,CAEA,oFACC,sCACD,CAEA,oEACC,SACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content .image.image_resized {\n\tmax-width: 100%;\n\t/*\n\tThe `
` element for resized images must not use `display:table` as browsers do not support `max-width` for it well.\n\tSee https://stackoverflow.com/questions/4019604/chrome-safari-ignoring-max-width-in-table/14420691#14420691 for more.\n\tFortunately, since we control the width, there is no risk that the image will look bad.\n\t*/\n\tdisplay: block;\n\tbox-sizing: border-box;\n\n\t& img {\n\t\t/* For resized images it is the `
` element that determines the image width. */\n\t\twidth: 100%;\n\t}\n\n\t& > figcaption {\n\t\t/* The `
` element uses `display:block`, so `
` also has to. */\n\t\tdisplay: block;\n\t}\n}\n\n.ck.ck-editor__editable {\n\t/* The resized inline image nested in the table should respect its parent size.\n\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\n\t& td,\n\t& th {\n\t\t& .image-inline.image_resized img {\n\t\t\tmax-width: 100%;\n\t\t}\n\t}\n}\n\n[dir="ltr"] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon {\n\tmargin-right: var(--ck-spacing-standard);\n}\n\n[dir="rtl"] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon {\n\tmargin-left: var(--ck-spacing-standard);\n}\n\n.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label {\n\twidth: 4em;\n}\n'],sourceRoot:""}]);const a=r},899:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css"],names:[],mappings:"AAKA,+BAUC,iBAAkB,CATlB,aAAc,CACd,iBAAkB,CAOlB,sCAAwC,CADxC,oCAAsC,CAGtC,SAMD,CAJC,qCACC,UAAW,CACX,iBACD,CChBD,MACC,iCAA8C,CAC9C,+CAA4D,CAG5D,8BAA+B,CAC/B,gCAAiC,CACjC,4DACD,CAEA,+BAWC,sBAA4B,CAN5B,0BAAgC,CADhC,qCAAuC,CADvC,wEAA0E,CAD1E,uDAAwD,CAMxD,oDAAuD,CAWvD,oFAAuF,CAlBvF,SAAU,CAgBV,eAAgB,CAChB,mFA0BD,CAtBC,qCAgBC,mBAAsB,CADtB,sBAAyB,CAEzB,4BAA6B,CAH7B,4CAA6C,CAF7C,sFAAuF,CADvF,oFAAqF,CASrF,qBAAsB,CAdtB,QAAS,CAJT,QAAS,CAGT,SAAU,CADV,OAAQ,CAKR,mCAAoC,CACpC,yBAA0B,CAH1B,OAcD,CAGD,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,yCACC,GAGC,QAAS,CAFT,SAAU,CACV,OAED,CACA,IAEC,QAAS,CADT,UAED,CACA,GAGC,YAAc,CAFd,SAAU,CACV,UAED,CACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-image-upload-complete-icon {\n\tdisplay: block;\n\tposition: absolute;\n\n\t/*\n\t * Smaller images should have the icon closer to the border.\n\t * Match the icon position with the linked image indicator brought by the link image feature.\n\t */\n\ttop: min(var(--ck-spacing-medium), 6%);\n\tright: min(var(--ck-spacing-medium), 6%);\n\tborder-radius: 50%;\n\tz-index: 1;\n\n\t&::after {\n\t\tcontent: "";\n\t\tposition: absolute;\n\t}\n}\n','/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-image-upload-icon: hsl(0, 0%, 100%);\n\t--ck-color-image-upload-icon-background: hsl(120, 100%, 27%);\n\n\t/* Match the icon size with the linked image indicator brought by the link image feature. */\n\t--ck-image-upload-icon-size: 20;\n\t--ck-image-upload-icon-width: 2px;\n\t--ck-image-upload-icon-is-visible: clamp(0px, 100% - 50px, 1px);\n}\n\n.ck-image-upload-complete-icon {\n\topacity: 0;\n\tbackground: var(--ck-color-image-upload-icon-background);\n\tanimation-name: ck-upload-complete-icon-show, ck-upload-complete-icon-hide;\n\tanimation-fill-mode: forwards, forwards;\n\tanimation-duration: 500ms, 500ms;\n\n\t/* To make animation scalable. */\n\tfont-size: calc(1px * var(--ck-image-upload-icon-size));\n\n\t/* Hide completed upload icon after 3 seconds. */\n\tanimation-delay: 0ms, 3000ms;\n\n\t/*\n\t * Use CSS math to simulate container queries.\n\t * https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\n\t */\n\toverflow: hidden;\n\twidth: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\n\theight: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\n\n\t/* This is check icon element made from border-width mixed with animations. */\n\t&::after {\n\t\t/* Because of border transformation we need to "hard code" left position. */\n\t\tleft: 25%;\n\n\t\ttop: 50%;\n\t\topacity: 0;\n\t\theight: 0;\n\t\twidth: 0;\n\n\t\ttransform: scaleX(-1) rotate(135deg);\n\t\ttransform-origin: left top;\n\t\tborder-top: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\n\t\tborder-right: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\n\n\t\tanimation-name: ck-upload-complete-icon-check;\n\t\tanimation-duration: 500ms;\n\t\tanimation-delay: 500ms;\n\t\tanimation-fill-mode: forwards;\n\n\t\t/* #1095. While reset is not providing proper box-sizing for pseudoelements, we need to handle it. */\n\t\tbox-sizing: border-box;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-show {\n\tfrom {\n\t\topacity: 0;\n\t}\n\n\tto {\n\t\topacity: 1;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-hide {\n\tfrom {\n\t\topacity: 1;\n\t}\n\n\tto {\n\t\topacity: 0;\n\t}\n}\n\n@keyframes ck-upload-complete-icon-check {\n\t0% {\n\t\topacity: 1;\n\t\twidth: 0;\n\t\theight: 0;\n\t}\n\t33% {\n\t\twidth: 0.3em;\n\t\theight: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t\twidth: 0.3em;\n\t\theight: 0.45em;\n\t}\n}\n'],sourceRoot:""}]);const a=r},825:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadloader.css"],names:[],mappings:"AAKA,kCAGC,kBAAmB,CADnB,YAAa,CAEb,sBAAuB,CAEvB,MAAO,CALP,iBAAkB,CAIlB,KAOD,CAJC,yCACC,UAAW,CACX,iBACD,CCXD,MACC,4CAAqD,CACrD,wCAAyC,CACzC,8CACD,CAEA,iCAGC,QAAS,CADT,UAgBD,CAbC,8CACC,sGACD,CAEA,qCAOC,4DACD,CAGD,kCAEC,WAAY,CADZ,UAWD,CARC,yCAMC,yDAA0D,CAH1D,iBAAkB,CAElB,kCAAmC,CADnC,8DAA+D,CAF/D,+CAAgD,CADhD,8CAMD,CAGD,wCACC,GACC,uBACD,CACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-upload-placeholder-loader {\n\tposition: absolute;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttop: 0;\n\tleft: 0;\n\n\t&::before {\n\t\tcontent: '';\n\t\tposition: relative;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-upload-placeholder-loader: hsl(0, 0%, 70%);\n\t--ck-upload-placeholder-loader-size: 32px;\n\t--ck-upload-placeholder-image-aspect-ratio: 2.8;\n}\n\n.ck .ck-image-upload-placeholder {\n\t/* We need to control the full width of the SVG gray background. */\n\twidth: 100%;\n\tmargin: 0;\n\n\t&.image-inline {\n\t\twidth: calc( 2 * var(--ck-upload-placeholder-loader-size) * var(--ck-upload-placeholder-image-aspect-ratio) );\n\t}\n\n\t& img {\n\t\t/*\n\t\t * This is an arbitrary aspect for a 1x1 px GIF to display to the user. Not too tall, not too short.\n\t\t * There's nothing special about this number except that it should make the image placeholder look like\n\t\t * a real image during this short period after the upload started and before the image was read from the\n\t\t * file system (and a rich preview was loaded).\n\t\t */\n\t\taspect-ratio: var(--ck-upload-placeholder-image-aspect-ratio);\n\t}\n}\n\n.ck .ck-upload-placeholder-loader {\n\twidth: 100%;\n\theight: 100%;\n\n\t&::before {\n\t\twidth: var(--ck-upload-placeholder-loader-size);\n\t\theight: var(--ck-upload-placeholder-loader-size);\n\t\tborder-radius: 50%;\n\t\tborder-top: 3px solid var(--ck-color-upload-placeholder-loader);\n\t\tborder-right: 2px solid transparent;\n\t\tanimation: ck-upload-placeholder-loader 1s linear infinite;\n\t}\n}\n\n@keyframes ck-upload-placeholder-loader {\n\tto {\n\t\ttransform: rotate( 360deg );\n\t}\n}\n"],sourceRoot:""}]);const a=r},870:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadprogress.css"],names:[],mappings:"AAMC,qEAEC,iBACD,CAGA,uGAIC,MAAO,CAFP,iBAAkB,CAClB,KAED,CCRC,yFACC,oBACD,CAID,uGAIC,gDAAiD,CAFjD,UAAW,CAGX,oBAAuB,CAFvB,OAGD,CAGD,kBACC,GAAO,SAAY,CACnB,GAAO,SAAY,CACpB",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t& .image,\n\t& .image-inline {\n\t\tposition: relative;\n\t}\n\n\t/* Upload progress bar. */\n\t& .image .ck-progress-bar,\n\t& .image-inline .ck-progress-bar {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t& .image,\n\t& .image-inline {\n\t\t/* Showing animation. */\n\t\t&.ck-appear {\n\t\t\tanimation: fadeIn 700ms;\n\t\t}\n\t}\n\n\t/* Upload progress bar. */\n\t& .image .ck-progress-bar,\n\t& .image-inline .ck-progress-bar {\n\t\theight: 2px;\n\t\twidth: 0;\n\t\tbackground: var(--ck-color-upload-bar-background);\n\t\ttransition: width 100ms;\n\t}\n}\n\n@keyframes fadeIn {\n\tfrom { opacity: 0; }\n\tto { opacity: 1; }\n}\n"],sourceRoot:""}]);const a=r},831:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css"],names:[],mappings:"AAOA,6BACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,oDACC,oBACD,CAEA,uCACC,YACD,CCZA,oCDCD,6BAcE,cAUF,CARE,oDACC,eACD,CAEA,wCACC,cACD,CCrBD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-text-alternative-form {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\n\t& .ck-labeled-field-view {\n\t\tdisplay: inline-block;\n\t}\n\n\t& .ck-label {\n\t\tdisplay: none;\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},399:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/link.css"],names:[],mappings:"AAMA,sBACC,mDAMD,CAHC,wCACC,yFACD,CAOD,4BACC,8CACD,CAGA,sCAEC,gDAAiD,CADjD,WAAY,CAEZ,iBAAkB,CAClB,oCACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Class added to span element surrounding currently selected link. */\n.ck .ck-link_selected {\n\tbackground: var(--ck-color-link-selected-background);\n\n\t/* Give linked inline images some outline to let the user know they are also part of the link. */\n\t& span.image-inline {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background);\n\t}\n}\n\n/*\n * Classes used by the "fake visual selection" displayed in the content when an input\n * in the link UI has focus (the browser does not render the native selection in this state).\n */\n.ck .ck-fake-link-selection {\n\tbackground: var(--ck-color-link-fake-selection);\n}\n\n/* A collapsed fake visual selection. */\n.ck .ck-fake-link-selection_collapsed {\n\theight: 100%;\n\tborder-right: 1px solid var(--ck-color-base-text);\n\tmargin-right: -1px;\n\toutline: solid 1px hsla(0, 0%, 100%, .5);\n}\n'],sourceRoot:""}]);const a=r},465:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{color:var(--ck-color-link-default);cursor:pointer;max-width:var(--ck-input-width);min-width:3em;padding:0 var(--ck-spacing-medium);text-align:center;text-overflow:ellipsis}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{max-width:100%;min-width:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkactions.css"],names:[],mappings:"AAOA,oBACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,8CACC,oBAKD,CAHC,gEACC,eACD,CCXD,oCDCD,oBAcE,cAUF,CARE,8CACC,eACD,CAEA,8DACC,cACD,CCrBD,CCKA,wDACC,cAAe,CACf,eAmCD,CAjCC,0EAEC,kCAAmC,CAEnC,cAAe,CAIf,+BAAgC,CAChC,aAAc,CARd,kCAAmC,CASnC,iBAAkB,CAPlB,sBAYD,CAHC,gFACC,yBACD,CAGD,mPAIC,eACD,CAEA,+DACC,eACD,CAGC,gFACC,yBACD,CAWD,qHACC,sCACD,CDvDD,oCC2DC,wDACC,8DAMD,CAJC,0EAEC,cAAe,CADf,WAED,CAGD,gJAME,aAEF,CD1ED",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-link-actions {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\n\t& .ck-link-actions__preview {\n\t\tdisplay: inline-block;\n\n\t\t& .ck-button__label {\n\t\t\toverflow: hidden;\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-link-actions__preview {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button:not(.ck-link-actions__preview) {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n@import "../mixins/_focus.css";\n@import "../mixins/_shadow.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-link-actions {\n\t& .ck-button.ck-link-actions__preview {\n\t\tpadding-left: 0;\n\t\tpadding-right: 0;\n\n\t\t& .ck-button__label {\n\t\t\tpadding: 0 var(--ck-spacing-medium);\n\t\t\tcolor: var(--ck-color-link-default);\n\t\t\ttext-overflow: ellipsis;\n\t\t\tcursor: pointer;\n\n\t\t\t/* Match the box model of the link editor form\'s input so the balloon\n\t\t\tdoes not change width when moving between actions and the form. */\n\t\t\tmax-width: var(--ck-input-width);\n\t\t\tmin-width: 3em;\n\t\t\ttext-align: center;\n\n\t\t\t&:hover {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t}\n\n\t\t&,\n\t\t&:hover,\n\t\t&:focus,\n\t\t&:active {\n\t\t\tbackground: none;\n\t\t}\n\n\t\t&:active {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\t&:focus {\n\t\t\t& .ck-button__label {\n\t\t\t\ttext-decoration: underline;\n\t\t\t}\n\t\t}\n\t}\n\n\t@mixin ck-dir ltr {\n\t\t& .ck-button:not(:first-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-dir rtl {\n\t\t& .ck-button:not(:last-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\t& .ck-button.ck-link-actions__preview {\n\t\t\tmargin: var(--ck-spacing-standard) var(--ck-spacing-standard) 0;\n\n\t\t\t& .ck-button__label {\n\t\t\t\tmin-width: 0;\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\n\t\t& .ck-button:not(.ck-link-actions__preview) {\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=r},827:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{min-width:var(--ck-input-width);padding:0}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{border:0;border-radius:0;border-top:1px solid var(--ck-color-base-border);margin:0;padding:var(--ck-spacing-standard);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkform.css"],names:[],mappings:"AAOA,iBACC,YAiBD,CAfC,2BACC,YACD,CCNA,oCDCD,iBAQE,cAUF,CARE,wCACC,eACD,CAEA,4BACC,cACD,CCfD,CDuBD,iCACC,aAYD,CALE,wHAEC,mCACD,CE/BF,iCAEC,+BAAgC,CADhC,SA+CD,CA5CC,wDACC,8EAMD,CAJC,uEACC,WAAY,CACZ,UACD,CAGD,4CAIC,QAAS,CADT,eAAgB,CAEhB,gDAAiD,CAHjD,QAAS,CADT,kCAAmC,CAKnC,SAaD,CAnBA,4GAaE,aAMF,CAJE,mEACC,kDACD,CAKF,6CACC,yDAWD,CATC,wEACC,QAAS,CACT,SAAU,CACV,UAKD,CAHC,8EACC,eACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck.ck-link-form {\n\tdisplay: flex;\n\n\t& .ck-label {\n\t\tdisplay: none;\n\t}\n\n\t@mixin ck-media-phone {\n\t\tflex-wrap: wrap;\n\n\t\t& .ck-labeled-field-view {\n\t\t\tflex-basis: 100%;\n\t\t}\n\n\t\t& .ck-button {\n\t\t\tflex-basis: 50%;\n\t\t}\n\t}\n}\n\n/*\n * Style link form differently when manual decorators are available.\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\n */\n.ck.ck-link-form_layout-vertical {\n\tdisplay: block;\n\n\t/*\n\t * Whether the form is in the responsive mode or not, if there are decorator buttons\n\t * keep the top margin of action buttons medium.\n\t */\n\t& .ck-button {\n\t\t&.ck-button-save,\n\t\t&.ck-button-cancel {\n\t\t\tmargin-top: var(--ck-spacing-medium);\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n/*\n * Style link form differently when manual decorators are available.\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\n */\n.ck.ck-link-form_layout-vertical {\n\tpadding: 0;\n\tmin-width: var(--ck-input-width);\n\n\t& .ck-labeled-field-view {\n\t\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small);\n\n\t\t& .ck-input-text {\n\t\t\tmin-width: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n\n\t& .ck-button {\n\t\tpadding: var(--ck-spacing-standard);\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tborder: 0;\n\t\tborder-top: 1px solid var(--ck-color-base-border);\n\t\twidth: 50%;\n\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-left: 0;\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-left: 0;\n\n\t\t\t&:last-of-type {\n\t\t\t\tborder-right: 1px solid var(--ck-color-base-border);\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Using additional `.ck` class for stronger CSS specificity than `.ck.ck-link-form > :not(:first-child)`. */\n\t& .ck.ck-list {\n\t\tmargin: var(--ck-spacing-standard) var(--ck-spacing-large);\n\n\t\t& .ck-button.ck-switchbutton {\n\t\t\tborder: 0;\n\t\t\tpadding: 0;\n\t\t\twidth: 100%;\n\n\t\t\t&:hover {\n\t\t\t\tbackground: none;\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=r},499:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;justify-content:left;position:relative}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{opacity:1;visibility:visible}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{-webkit-appearance:none;border:1px solid transparent;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:var(--ck-spacing-small);margin-right:calc(var(--ck-spacing-small)*-1)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/button.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/mixins/_button.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css"],names:[],mappings:"AAQA,6BCCC,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBD6BD,CE/BC,qDACC,aAqBD,CAHC,oBAnBD,qDAoBE,YAEF,CADC,CFvBF,6BAOC,kBAAmB,CADnB,mBAAoB,CAEpB,oBAAqB,CAHrB,iBA4BD,CAvBC,iEACC,YACD,CAGC,yGACC,oBACD,CAID,iFACC,sBACD,CEkBA,iEAEC,SAAU,CADV,kBAED,CAbA,yFACC,YACD,CC7BD,6BCAC,oDD0ID,CCvIE,6EACC,0DACD,CAEA,+EACC,2DAA4C,CAC5C,uEACD,CAID,qDACC,6DACD,CDhBD,6BEDC,eF2ID,CA1IA,wIEGE,qCFuIF,CA1IA,6BA6BC,uBAAwB,CANxB,4BAA6B,CAjB7B,cAAe,CAcf,iBAAkB,CAHlB,aAAc,CAJd,4CAA6C,CAD7C,2CAA4C,CAJ5C,8BAA+B,CAC/B,iBAAkB,CAiBlB,4DAA8D,CAnB9D,qBAAsB,CAFtB,kBAqID,CA3GC,oFGhCA,2BAA2B,CCF3B,2CAA8B,CDC9B,YHqCA,CAIC,kJAEC,aACD,CAGD,iEAIC,aAAc,CACd,cAAe,CAHf,iBAAkB,CAClB,mBAAoB,CAMpB,qBASD,CAlBA,qFAYE,eAMF,CAlBA,qFAgBE,gBAEF,CAEA,yEACC,aAYD,CAbA,6FAIE,mCASF,CAbA,6FAQE,oCAKF,CAbA,yEAWC,eAAiB,CACjB,UACD,CAIC,oIIrFD,oDJyFC,CAEA,uFK3FD,kCL6FC,CAGA,yFKhGD,kCLkGC,CAEA,iGACC,UACD,CAGD,qEACC,yDAcD,CAXC,2HAEE,4CAA+C,CAC/C,oCAOF,CAVA,2HAQE,mCAAoC,CADpC,6CAGF,CAKA,mHACC,WACD,CAID,yCC/HA,+CDiIA,CC9HC,yFACC,qDACD,CAEA,2FACC,sDAA4C,CAC5C,kEACD,CAID,iEACC,wDACD,CDmHA,2DACC,iCACD,CAEA,+DACC,mCACD,CAID,2CC7IC,mDDkJD,CC/IE,2FACC,yDACD,CAEA,6FACC,0DAA4C,CAC5C,sEACD,CAID,mEACC,4DACD,CD6HD,2CAIC,wCACD,CAEA,uCAEC,eACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../mixins/_unselectable.css";\n@import "../tooltip/mixins/_tooltip.css";\n\n.ck.ck-button,\na.ck.ck-button {\n\t@mixin ck-unselectable;\n\t@mixin ck-tooltip_enabled;\n\n\tposition: relative;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: left;\n\n\t& .ck-button__label {\n\t\tdisplay: none;\n\t}\n\n\t&.ck-button_with-text {\n\t\t& .ck-button__label {\n\t\t\tdisplay: inline-block;\n\t\t}\n\t}\n\n\t/* Center the icon horizontally in a button without text. */\n\t&:not(.ck-button_with-text) {\n\t\tjustify-content: center;\n\t}\n\n\t&:hover {\n\t\t@mixin ck-tooltip_visible;\n\t}\n\n\t/* Get rid of the native focus outline around the tooltip when focused (but not :hover). */\n\t&:focus:not(:hover) {\n\t\t@mixin ck-tooltip_disabled;\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Makes element unselectable.\n */\n@define-mixin ck-unselectable {\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n@define-mixin ck-tooltip_enabled {\n\t& .ck-tooltip {\n\t\tdisplay: block;\n\n\t\t/*\n\t\t * Don't display tooltips in devices which don't support :hover.\n\t\t * In fact, it's all about iOS, which forces user to click UI elements twice to execute\n\t\t * the primary action, when tooltips are enabled.\n\t\t *\n\t\t * Q: OK, but why not the following query?\n\t\t *\n\t\t * @media (hover) {\n\t\t * display: block;\n\t\t * }\n\t\t *\n\t\t * A: Because FF does not support it and it would completely disable tooltips\n\t\t * in that browser.\n\t\t *\n\t\t * More in https://github.com/ckeditor/ckeditor5/issues/920.\n\t\t */\n\t\t@media (hover:none) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n@define-mixin ck-tooltip_disabled {\n\t& .ck-tooltip {\n\t\tdisplay: none;\n\t}\n}\n\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n@define-mixin ck-tooltip_visible {\n\t& .ck-tooltip {\n\t\tvisibility: visible;\n\t\topacity: 1;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_focus.css";\n@import "../../../mixins/_shadow.css";\n@import "../../../mixins/_disabled.css";\n@import "../../../mixins/_rounded.css";\n@import "../../mixins/_button.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n.ck.ck-button,\na.ck.ck-button {\n\t@mixin ck-button-colors --ck-color-button-default;\n\t@mixin ck-rounded-corners;\n\n\twhite-space: nowrap;\n\tcursor: default;\n\tvertical-align: middle;\n\tpadding: var(--ck-spacing-tiny);\n\ttext-align: center;\n\n\t/* A very important piece of styling. Go to variable declaration to learn more. */\n\tmin-width: var(--ck-ui-component-min-height);\n\tmin-height: var(--ck-ui-component-min-height);\n\n\t/* Normalize the height of the line. Removing this will break consistent height\n\tamong text and text-less buttons (with icons). */\n\tline-height: 1;\n\n\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\tfont-size: inherit;\n\n\t/* Avoid flickering when the foucs border shows up. */\n\tborder: 1px solid transparent;\n\n\t/* Apply some smooth transition to the box-shadow and border. */\n\ttransition: box-shadow .2s ease-in-out, border .2s ease-in-out;\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/189 */\n\t-webkit-appearance: none;\n\n\t&:active,\n\t&:focus {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\n\t}\n\n\t/* Allow icon coloring using the text "color" property. */\n\t& .ck-button__icon {\n\t\t& use,\n\t\t& use * {\n\t\t\tcolor: inherit;\n\t\t}\n\t}\n\n\t& .ck-button__label {\n\t\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\t\tfont-size: inherit;\n\t\tfont-weight: inherit;\n\t\tcolor: inherit;\n\t\tcursor: inherit;\n\n\t\t/* Must be consistent with .ck-icon\'s vertical align. Otherwise, buttons with and\n\t\twithout labels (but with icons) have different sizes in Chrome */\n\t\tvertical-align: middle;\n\n\t\t@mixin ck-dir ltr {\n\t\t\ttext-align: left;\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\ttext-align: right;\n\t\t}\n\t}\n\n\t& .ck-button__keystroke {\n\t\tcolor: inherit;\n\n\t\t@mixin ck-dir ltr {\n\t\t\tmargin-left: var(--ck-spacing-large);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tmargin-right: var(--ck-spacing-large);\n\t\t}\n\n\t\tfont-weight: bold;\n\t\topacity: .7;\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\n\t&.ck-disabled {\n\t\t&:active,\n\t\t&:focus {\n\t\t\t/* The disabled button should have a slightly less visible shadow when focused. */\n\t\t\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\n\t\t}\n\n\t\t& .ck-button__icon {\n\t\t\t@mixin ck-disabled;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\n\t\t& .ck-button__label {\n\t\t\t@mixin ck-disabled;\n\t\t}\n\n\t\t& .ck-button__keystroke {\n\t\t\topacity: .3;\n\t\t}\n\t}\n\n\t&.ck-button_with-text {\n\t\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-standard);\n\n\t\t/* stylelint-disable-next-line no-descending-specificity */\n\t\t& .ck-button__icon {\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tmargin-left: calc(-1 * var(--ck-spacing-small));\n\t\t\t\tmargin-right: var(--ck-spacing-small);\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tmargin-right: calc(-1 * var(--ck-spacing-small));\n\t\t\t\tmargin-left: var(--ck-spacing-small);\n\t\t\t}\n\t\t}\n\t}\n\n\t&.ck-button_with-keystroke {\n\t\t/* stylelint-disable-next-line no-descending-specificity */\n\t\t& .ck-button__label {\n\t\t\tflex-grow: 1;\n\t\t}\n\t}\n\n\t/* A style of the button which is currently on, e.g. its feature is active. */\n\t&.ck-on {\n\t\t@mixin ck-button-colors --ck-color-button-on;\n\t}\n\n\t&.ck-button-save {\n\t\tcolor: var(--ck-color-button-save);\n\t}\n\n\t&.ck-button-cancel {\n\t\tcolor: var(--ck-color-button-cancel);\n\t}\n}\n\n/* A style of the button which handles the primary action. */\n.ck.ck-button-action,\na.ck.ck-button-action {\n\t@mixin ck-button-colors --ck-color-button-action;\n\n\tcolor: var(--ck-color-button-action-text);\n}\n\n.ck.ck-button-bold,\na.ck.ck-button-bold {\n\tfont-weight: bold;\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements a button of given background color.\n *\n * @param {String} $background - Background color of the button.\n * @param {String} $border - Border color of the button.\n */\n@define-mixin ck-button-colors $prefix {\n\tbackground: var($(prefix)-background);\n\n\t&:not(.ck-disabled) {\n\t\t&:hover {\n\t\t\tbackground: var($(prefix)-hover-background);\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: var($(prefix)-active-background);\n\t\t\tbox-shadow: inset 0 2px 2px var($(prefix)-active-shadow);\n\t\t}\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\n\t&.ck-disabled {\n\t\tbackground: var($(prefix)-disabled-background);\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which indicates that an element holding it is disabled.\n */\n@define-mixin ck-disabled {\n\topacity: var(--ck-disabled-opacity);\n}\n"],sourceRoot:""}]);const a=r},681:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{background:var(--ck-color-switch-button-off-background);transition:background .4s ease;width:var(--ck-switch-button-toggle-width)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);height:var(--ck-switch-button-toggle-inner-size);margin:var(--ck-switch-button-toggle-spacing);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var( --ck-switch-button-translation ))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var( --ck-switch-button-translation )*-1))}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/switchbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css"],names:[],mappings:"AASE,4HACC,aACD,CCCF,MAEC,8CAA+C,CAE/C,mDAAoD,CACpD,qCAAsC,CACtC,gKAKD,CAGC,0DAGE,4CAOF,CAVA,0DAQE,2CAEF,CAEA,iDC3BA,eDoEA,CAzCA,yICvBC,qCDgED,CAzCA,2DAKE,gBAoCF,CAzCA,2DAUE,iBA+BF,CAzCA,iDAiBC,uDAAwD,CAHxD,8BAAiC,CAEjC,0CAyBD,CAtBC,2EC9CD,eD2DC,CAbA,6LC1CA,qCAAsC,CD4CpC,8CAWF,CAbA,2EASC,yDAA0D,CAD1D,gDAAiD,CAFjD,6CAA8C,CAM9C,uBAA0B,CAL1B,+CAMD,CAEA,uDACC,6DAKD,CAHC,iFACC,+DACD,CAIF,6DExEA,kCF0EA,CAEA,uDACC,sDAkBD,CAhBC,6DACC,4DACD,CAEA,2FAKE,2DAMF,CAXA,2FASE,oEAEF",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-button.ck-switchbutton {\n\t& .ck-button__toggle {\n\t\tdisplay: block;\n\n\t\t& .ck-button__toggle__inner {\n\t\t\tdisplay: block;\n\t\t}\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_disabled.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n/* Note: To avoid rendering issues (aliasing) but to preserve the responsive nature\nof the component, floating–point numbers have been used which, for the default font size\n(see: --ck-font-size-base), will generate simple integers. */\n:root {\n\t/* 34px at 13px font-size */\n\t--ck-switch-button-toggle-width: 2.6153846154em;\n\t/* 14px at 13px font-size */\n\t--ck-switch-button-toggle-inner-size: 1.0769230769em;\n\t--ck-switch-button-toggle-spacing: 1px;\n\t--ck-switch-button-translation: calc(\n\t\tvar(--ck-switch-button-toggle-width) -\n\t\tvar(--ck-switch-button-toggle-inner-size) -\n\t\t2 * var(--ck-switch-button-toggle-spacing)\n\t);\n}\n\n.ck.ck-button.ck-switchbutton {\n\t& .ck-button__label {\n\t\t@mixin ck-dir ltr {\n\t\t\t/* Separate the label from the switch */\n\t\t\tmargin-right: calc(2 * var(--ck-spacing-large));\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\t/* Separate the label from the switch */\n\t\t\tmargin-left: calc(2 * var(--ck-spacing-large));\n\t\t}\n\t}\n\n\t& .ck-button__toggle {\n\t\t@mixin ck-rounded-corners;\n\n\t\t@mixin ck-dir ltr {\n\t\t\t/* Make sure the toggle is always to the right as far as possible. */\n\t\t\tmargin-left: auto;\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\t/* Make sure the toggle is always to the left as far as possible. */\n\t\t\tmargin-right: auto;\n\t\t}\n\n\t\t/* Gently animate the background color of the toggle switch */\n\t\ttransition: background 400ms ease;\n\n\t\twidth: var(--ck-switch-button-toggle-width);\n\t\tbackground: var(--ck-color-switch-button-off-background);\n\n\t\t& .ck-button__toggle__inner {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-radius: calc(.5 * var(--ck-border-radius));\n\t\t\t}\n\n\t\t\t/* Leave some tiny bit of space around the inner part of the switch */\n\t\t\tmargin: var(--ck-switch-button-toggle-spacing);\n\t\t\twidth: var(--ck-switch-button-toggle-inner-size);\n\t\t\theight: var(--ck-switch-button-toggle-inner-size);\n\t\t\tbackground: var(--ck-color-switch-button-inner-background);\n\n\t\t\t/* Gently animate the inner part of the toggle switch */\n\t\t\ttransition: all 300ms ease;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground: var(--ck-color-switch-button-off-hover-background);\n\n\t\t\t& .ck-button__toggle__inner {\n\t\t\t\tbox-shadow: 0 0 0 5px var(--ck-color-switch-button-inner-shadow);\n\t\t\t}\n\t\t}\n\t}\n\n\t&.ck-disabled .ck-button__toggle {\n\t\t@mixin ck-disabled;\n\t}\n\n\t&.ck-on .ck-button__toggle {\n\t\tbackground: var(--ck-color-switch-button-on-background);\n\n\t\t&:hover {\n\t\t\tbackground: var(--ck-color-switch-button-on-hover-background);\n\t\t}\n\n\t\t& .ck-button__toggle__inner {\n\t\t\t/*\n\t\t\t * Move the toggle switch to the right. It will be animated.\n\t\t\t */\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\ttransform: translateX( var( --ck-switch-button-translation ) );\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\ttransform: translateX( calc( -1 * var( --ck-switch-button-translation ) ) );\n\t\t\t}\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which indicates that an element holding it is disabled.\n */\n@define-mixin ck-disabled {\n\topacity: var(--ck-disabled-opacity);\n}\n"],sourceRoot:""}]);const a=r},923:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-color-grid-tile-size)}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{color:var(--ck-color-color-grid-check-icon);display:none}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/colorgrid/colorgrid.css"],names:[],mappings:"AAKA,kBACC,YACD,CCAA,MACC,8BAA+B,CAK/B,qCACD,CAEA,kBACC,YAAa,CACb,WACD,CAEA,wBAOC,QAAS,CALT,qCAAsC,CAEtC,yCAA0C,CAD1C,wCAAyC,CAEzC,SAAU,CACV,8BAA+B,CAL/B,oCAyCD,CAjCC,oCACC,YAAa,CACb,gBACD,CAEA,4DACC,gDACD,CAEA,oCAEC,2CAA4C,CAD5C,YAED,CAEA,8BACC,8FAKD,CAHC,0CACC,aACD,CAGD,8HAIC,QACD,CAEA,gGAEC,iGACD,CAGD,yBACC,oCACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-color-grid {\n\tdisplay: grid;\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n\n:root {\n\t--ck-color-grid-tile-size: 24px;\n\n\t/* Not using global colors here because these may change but some colors in a pallette\n\t * require special treatment. For instance, this ensures no matter what the UI text color is,\n\t * the check icon will look good on the black color tile. */\n\t--ck-color-color-grid-check-icon: hsl(0, 0%, 0%);\n}\n\n.ck.ck-color-grid {\n\tgrid-gap: 5px;\n\tpadding: 8px;\n}\n\n.ck.ck-color-grid__tile {\n\twidth: var(--ck-color-grid-tile-size);\n\theight: var(--ck-color-grid-tile-size);\n\tmin-width: var(--ck-color-grid-tile-size);\n\tmin-height: var(--ck-color-grid-tile-size);\n\tpadding: 0;\n\ttransition: .2s ease box-shadow;\n\tborder: 0;\n\n\t&.ck-disabled {\n\t\tcursor: unset;\n\t\ttransition: unset;\n\t}\n\n\t&.ck-color-table__color-tile_bordered {\n\t\tbox-shadow: 0 0 0 1px var(--ck-color-base-border);\n\t}\n\n\t& .ck.ck-icon {\n\t\tdisplay: none;\n\t\tcolor: var(--ck-color-color-grid-check-icon);\n\t}\n\n\t&.ck-on {\n\t\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-base-text);\n\n\t\t& .ck.ck-icon {\n\t\t\tdisplay: block;\n\t\t}\n\t}\n\n\t&.ck-on,\n\t&:focus:not( .ck-disabled ),\n\t&:hover:not( .ck-disabled ) {\n\t\t/* Disable the default .ck-button\'s border ring. */\n\t\tborder: 0;\n\t}\n\n\t&:focus:not( .ck-disabled ),\n\t&:hover:not( .ck-disabled ) {\n\t\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-focus-border);\n\t}\n}\n\n.ck.ck-color-grid__label {\n\tpadding: 0 var(--ck-spacing-standard);\n}\n'],sourceRoot:""}]);const a=r},488:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-modal)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{overflow:hidden;text-overflow:ellipsis;width:7em}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/dropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAOA,MACC,4BACD,CAEA,gBACC,oBAAqB,CACrB,iBAqFD,CAnFC,oCACC,mBAAoB,CACpB,2BACD,CAGA,+CACC,UAOD,CCUA,iEACC,YACD,CDVA,oCAGC,kCAAmC,CAEnC,YAAa,CAEb,sCAAuC,CAEvC,iBAAkB,CAHlB,yBA4DD,CAvDC,+DACC,oBACD,CAEA,mSAKC,WACD,CAEA,mSAUC,WAAY,CADZ,QAED,CAEA,oHAEC,MACD,CAEA,oHAEC,OACD,CAEA,kHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAQF,mCACC,mCACD,CEhGA,MACC,sDACD,CAEA,gBAEC,iBA2ED,CAzEC,oCACC,mCACD,CAGC,8CAIC,sCAAuC,CAHvC,gCAID,CAIA,8CACC,+BAAgC,CAGhC,oCACD,CAGD,gDC/BA,kCDiCA,CAIE,mFAEC,oCACD,CAIA,mFAEC,qCACD,CAID,iEAEC,eAAgB,CAChB,sBAAuB,CAFvB,SAGD,CAGA,6EC1DD,kCD4DC,CAGA,qDACC,2BAA4B,CAC5B,4BACD,CAEA,sGACC,UACD,CAGA,yHAEC,eAKD,CAHC,qIE7EF,2CF+EE,CAKH,uBGlFC,eH8GD,CA5BA,qFG9EE,qCH0GF,CA5BA,uBAIC,oDAAqD,CACrD,sDAAuD,CACvD,QAAS,CE1FT,oCAA8B,CF6F9B,cAmBD,CAfC,6CACC,wBACD,CAEA,6CACC,yBACD,CAEA,6CACC,2BACD,CAEA,6CACC,4BACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"../tooltip/mixins/_tooltip.css\";\n\n:root {\n\t--ck-dropdown-max-width: 75vw;\n}\n\n.ck.ck-dropdown {\n\tdisplay: inline-block;\n\tposition: relative;\n\n\t& .ck-dropdown__arrow {\n\t\tpointer-events: none;\n\t\tz-index: var(--ck-z-default);\n\t}\n\n\t/* Dropdown button should span horizontally, e.g. in vertical toolbars */\n\t& .ck-button.ck-dropdown__button {\n\t\twidth: 100%;\n\n\t\t/* Disable main button's tooltip when the dropdown is open. Otherwise the panel may\n\t\tpartially cover the tooltip */\n\t\t&.ck-on {\n\t\t\t@mixin ck-tooltip_disabled;\n\t\t}\n\t}\n\n\t& .ck-dropdown__panel {\n\t\t/* This is to get rid of flickering when the tooltip is shown under the panel,\n\t\twhich looks like the panel moves vertically a pixel down and up. */\n\t\t-webkit-backface-visibility: hidden;\n\n\t\tdisplay: none;\n\t\tz-index: var(--ck-z-modal);\n\t\tmax-width: var(--ck-dropdown-max-width);\n\n\t\tposition: absolute;\n\n\t\t&.ck-dropdown__panel-visible {\n\t\t\tdisplay: inline-block;\n\t\t}\n\n\t\t&.ck-dropdown__panel_ne,\n\t\t&.ck-dropdown__panel_nw,\n\t\t&.ck-dropdown__panel_n,\n\t\t&.ck-dropdown__panel_nmw,\n\t\t&.ck-dropdown__panel_nme {\n\t\t\tbottom: 100%;\n\t\t}\n\n\t\t&.ck-dropdown__panel_se,\n\t\t&.ck-dropdown__panel_sw,\n\t\t&.ck-dropdown__panel_smw,\n\t\t&.ck-dropdown__panel_sme,\n\t\t&.ck-dropdown__panel_s {\n\t\t\t/*\n\t\t\t * Using transform: translate3d( 0, 100%, 0 ) causes blurry dropdown on Chrome 67-78+ on non-retina displays.\n\t\t\t * See https://github.com/ckeditor/ckeditor5/issues/1053.\n\t\t\t */\n\t\t\ttop: 100%;\n\t\t\tbottom: auto;\n\t\t}\n\n\t\t&.ck-dropdown__panel_ne,\n\t\t&.ck-dropdown__panel_se {\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t&.ck-dropdown__panel_nw,\n\t\t&.ck-dropdown__panel_sw {\n\t\t\tright: 0px;\n\t\t}\n\n\t\t&.ck-dropdown__panel_s,\n\t\t&.ck-dropdown__panel_n {\n\t\t\t/* Positioning panels relative to the center of the button */\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t}\n\n\t\t&.ck-dropdown__panel_nmw,\n\t\t&.ck-dropdown__panel_smw {\n\t\t\t/* Positioning panels relative to the middle-west of the button */\n\t\t\tleft: 75%;\n\t\t\ttransform: translateX(-75%);\n\t\t}\n\n\t\t&.ck-dropdown__panel_nme,\n\t\t&.ck-dropdown__panel_sme {\n\t\t\t/* Positioning panels relative to the middle-east of the button */\n\t\t\tleft: 25%;\n\t\t\ttransform: translateX(-25%);\n\t\t}\n\t}\n}\n\n/*\n * Toolbar dropdown panels should be always above the UI (eg. other dropdown panels) from the editor's content.\n * See https://github.com/ckeditor/ckeditor5/issues/7874\n */\n.ck.ck-toolbar .ck-dropdown__panel {\n\tz-index: calc( var(--ck-z-modal) + 1 );\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n@define-mixin ck-tooltip_enabled {\n\t& .ck-tooltip {\n\t\tdisplay: block;\n\n\t\t/*\n\t\t * Don't display tooltips in devices which don't support :hover.\n\t\t * In fact, it's all about iOS, which forces user to click UI elements twice to execute\n\t\t * the primary action, when tooltips are enabled.\n\t\t *\n\t\t * Q: OK, but why not the following query?\n\t\t *\n\t\t * @media (hover) {\n\t\t * display: block;\n\t\t * }\n\t\t *\n\t\t * A: Because FF does not support it and it would completely disable tooltips\n\t\t * in that browser.\n\t\t *\n\t\t * More in https://github.com/ckeditor/ckeditor5/issues/920.\n\t\t */\n\t\t@media (hover:none) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n@define-mixin ck-tooltip_disabled {\n\t& .ck-tooltip {\n\t\tdisplay: none;\n\t}\n}\n\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n@define-mixin ck-tooltip_visible {\n\t& .ck-tooltip {\n\t\tvisibility: visible;\n\t\topacity: 1;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_disabled.css";\n@import "../../../mixins/_shadow.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n:root {\n\t--ck-dropdown-arrow-size: calc(0.5 * var(--ck-icon-size));\n}\n\n.ck.ck-dropdown {\n\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\tfont-size: inherit;\n\n\t& .ck-dropdown__arrow {\n\t\twidth: var(--ck-dropdown-arrow-size);\n\t}\n\n\t@mixin ck-dir ltr {\n\t\t& .ck-dropdown__arrow {\n\t\t\tright: var(--ck-spacing-standard);\n\n\t\t\t/* A space to accommodate the triangle. */\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-dir rtl {\n\t\t& .ck-dropdown__arrow {\n\t\t\tleft: var(--ck-spacing-standard);\n\n\t\t\t/* A space to accommodate the triangle. */\n\t\t\tmargin-right: var(--ck-spacing-small);\n\t\t}\n\t}\n\n\t&.ck-disabled .ck-dropdown__arrow {\n\t\t@mixin ck-disabled;\n\t}\n\n\t& .ck-button.ck-dropdown__button {\n\t\t@mixin ck-dir ltr {\n\t\t\t&:not(.ck-button_with-text) {\n\t\t\t\t/* Make sure dropdowns with just an icon have the right inner spacing */\n\t\t\t\tpadding-left: var(--ck-spacing-small);\n\t\t\t}\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\t&:not(.ck-button_with-text) {\n\t\t\t\t/* Make sure dropdowns with just an icon have the right inner spacing */\n\t\t\t\tpadding-right: var(--ck-spacing-small);\n\t\t\t}\n\t\t}\n\n\t\t/* #23 */\n\t\t& .ck-button__label {\n\t\t\twidth: 7em;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\n\t\t&.ck-disabled .ck-button__label {\n\t\t\t@mixin ck-disabled;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5/issues/816 */\n\t\t&.ck-on {\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t&.ck-dropdown__button_label-width_auto .ck-button__label {\n\t\t\twidth: auto;\n\t\t}\n\n\t\t/* https://github.com/ckeditor/ckeditor5/issues/8699 */\n\t\t&.ck-off:active,\n\t\t&.ck-on:active {\n\t\t\tbox-shadow: none;\n\t\t\t\n\t\t\t&:focus {\n\t\t\t\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.ck.ck-dropdown__panel {\n\t@mixin ck-rounded-corners;\n\t@mixin ck-drop-shadow;\n\n\tbackground: var(--ck-color-dropdown-panel-background);\n\tborder: 1px solid var(--ck-color-dropdown-panel-border);\n\tbottom: 0;\n\n\t/* Make sure the panel is at least as wide as the drop-down\'s button. */\n\tmin-width: 100%;\n\n\t/* Disabled corner border radius to be consistent with the .dropdown__button\n\thttps://github.com/ckeditor/ckeditor5/issues/816 */\n\t&.ck-dropdown__panel_se {\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t&.ck-dropdown__panel_sw {\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t&.ck-dropdown__panel_ne {\n\t\tborder-bottom-left-radius: 0;\n\t}\n\n\t&.ck-dropdown__panel_nw {\n\t\tborder-bottom-right-radius: 0;\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which indicates that an element holding it is disabled.\n */\n@define-mixin ck-disabled {\n\topacity: var(--ck-disabled-opacity);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},875:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/listdropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAOA,6CCIC,eDqBD,CAzBA,iICQE,qCAAsC,CDJtC,wBAqBF,CAfE,mFCND,eDYC,CANA,6MCFA,qCAAsC,CDKpC,2BAA4B,CAC5B,4BAA6B,CAF7B,wBAIF,CAEA,kFCdD,eDmBC,CALA,2MCVA,qCAAsC,CDYpC,wBAAyB,CACzB,yBAEF",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n\n.ck.ck-dropdown .ck-dropdown__panel .ck-list {\n\t/* Disabled radius of top-left border to be consistent with .dropdown__button\n\thttps://github.com/ckeditor/ckeditor5/issues/816 */\n\t@mixin ck-rounded-corners {\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t/* Make sure the button belonging to the first/last child of the list goes well with the\n\tborder radius of the entire panel. */\n\t& .ck-list__item {\n\t\t&:first-child .ck-button {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-top-left-radius: 0;\n\t\t\t\tborder-bottom-left-radius: 0;\n\t\t\t\tborder-bottom-right-radius: 0;\n\t\t\t}\n\t\t}\n\n\t\t&:last-child .ck-button {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-top-left-radius: 0;\n\t\t\t\tborder-top-right-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},66:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-left-radius:unset;border-top-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-right-radius:unset;border-top-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:"";height:100%;position:absolute;width:1px}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/mixins/_tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/splitbutton.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAOA,mBAEC,iBAUD,CARC,iDACC,qCACD,CC0BA,8DACC,YACD,CClCD,MACC,gDAAyD,CACzD,4CACD,CAMC,oIAKE,gCAAiC,CADjC,6BASF,CAbA,oIAWE,+BAAgC,CADhC,4BAGF,CAEA,0CAGC,eAiBD,CApBA,oDAQE,+BAAgC,CADhC,4BAaF,CApBA,oDAcE,gCAAiC,CADjC,6BAOF,CAHC,8CACC,mCACD,CASA,0KACC,wDACD,CAIA,8JAKC,0DAA2D,CAJ3D,UAAW,CAGX,WAAY,CAFZ,iBAAkB,CAClB,SAGD,CAGC,kLACC,SACD,CAIA,kLACC,UACD,CAMF,uCC7EA,eDuFA,CAVA,qHCzEC,qCDmFD,CARE,qKACC,2BACD,CAEA,mKACC,4BACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../tooltip/mixins/_tooltip.css";\n\n.ck.ck-splitbutton {\n\t/* Enable font size inheritance, which allows fluid UI scaling. */\n\tfont-size: inherit;\n\n\t& .ck-splitbutton__action:focus {\n\t\tz-index: calc(var(--ck-z-default) + 1);\n\t}\n\n\t/* Disable tooltips for the buttons when the button is "open" */\n\t&.ck-splitbutton_open > .ck-button {\n\t\t@mixin ck-tooltip_disabled;\n\t}\n}\n\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Enables the tooltip, which is the tooltip is in DOM but\n * not yet displayed.\n */\n@define-mixin ck-tooltip_enabled {\n\t& .ck-tooltip {\n\t\tdisplay: block;\n\n\t\t/*\n\t\t * Don't display tooltips in devices which don't support :hover.\n\t\t * In fact, it's all about iOS, which forces user to click UI elements twice to execute\n\t\t * the primary action, when tooltips are enabled.\n\t\t *\n\t\t * Q: OK, but why not the following query?\n\t\t *\n\t\t * @media (hover) {\n\t\t * display: block;\n\t\t * }\n\t\t *\n\t\t * A: Because FF does not support it and it would completely disable tooltips\n\t\t * in that browser.\n\t\t *\n\t\t * More in https://github.com/ckeditor/ckeditor5/issues/920.\n\t\t */\n\t\t@media (hover:none) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n/**\n * Disables the tooltip making it disappear from DOM.\n */\n@define-mixin ck-tooltip_disabled {\n\t& .ck-tooltip {\n\t\tdisplay: none;\n\t}\n}\n\n/**\n * Shows the tooltip, which is already in DOM.\n * Requires `ck-tooltip_enabled` first.\n */\n@define-mixin ck-tooltip_visible {\n\t& .ck-tooltip {\n\t\tvisibility: visible;\n\t\topacity: 1;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n\n:root {\n\t--ck-color-split-button-hover-background: hsl(0, 0%, 92%);\n\t--ck-color-split-button-hover-border: hsl(0, 0%, 70%);\n}\n\n.ck.ck-splitbutton {\n\t/*\n\t * Note: ck-rounded and ck-dir mixins don\'t go together (because they both use @nest).\n\t */\n\t&:hover > .ck-splitbutton__action,\n\t&.ck-splitbutton_open > .ck-splitbutton__action {\n\t\t@nest [dir="ltr"] & {\n\t\t\t/* Don\'t round the action button on the right side */\n\t\t\tborder-top-right-radius: unset;\n\t\t\tborder-bottom-right-radius: unset;\n\t\t}\n\n\t\t@nest [dir="rtl"] & {\n\t\t\t/* Don\'t round the action button on the left side */\n\t\t\tborder-top-left-radius: unset;\n\t\t\tborder-bottom-left-radius: unset;\n\t\t}\n\t}\n\n\t& > .ck-splitbutton__arrow {\n\t\t/* It\'s a text-less button and since the icon is positioned absolutely in such situation,\n\t\tit must get some arbitrary min-width. */\n\t\tmin-width: unset;\n\n\t\t@nest [dir="ltr"] & {\n\t\t\t/* Don\'t round the arrow button on the left side */\n\t\t\tborder-top-left-radius: unset;\n\t\t\tborder-bottom-left-radius: unset;\n\t\t}\n\n\t\t@nest [dir="rtl"] & {\n\t\t\t/* Don\'t round the arrow button on the right side */\n\t\t\tborder-top-right-radius: unset;\n\t\t\tborder-bottom-right-radius: unset;\n\t\t}\n\n\t\t& svg {\n\t\t\twidth: var(--ck-dropdown-arrow-size);\n\t\t}\n\t}\n\n\t/* When the split button is "open" (the arrow is on) or being hovered, it should get some styling\n\tas a whole. The background of both buttons should stand out and there should be a visual\n\tseparation between both buttons. */\n\t&.ck-splitbutton_open,\n\t&:hover {\n\t\t/* When the split button hovered as a whole, not as individual buttons. */\n\t\t& > .ck-button:not(.ck-on):not(.ck-disabled):not(:hover) {\n\t\t\tbackground: var(--ck-color-split-button-hover-background);\n\t\t}\n\n\t\t/* Splitbutton separator needs to be set with the ::after pseudoselector\n\t\tto display properly the borders on focus */\n\t\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\n\t\t\tcontent: \'\';\n\t\t\tposition: absolute;\n\t\t\twidth: 1px;\n\t\t\theight: 100%;\n\t\t\tbackground-color: var(--ck-color-split-button-hover-border);\n\t\t}\n\n\t\t@nest [dir="ltr"] & {\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\n\t\t\t\tleft: -1px;\n\t\t\t}\n\t\t}\n\n\t\t@nest [dir="rtl"] & {\n\t\t\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\n\t\t\t\tright: -1px;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Don\'t round the bottom left and right corners of the buttons when "open"\n\thttps://github.com/ckeditor/ckeditor5/issues/816 */\n\t&.ck-splitbutton_open {\n\t\t@mixin ck-rounded-corners {\n\t\t\t& > .ck-splitbutton__action {\n\t\t\t\tborder-bottom-left-radius: 0;\n\t\t\t}\n\n\t\t\t& > .ck-splitbutton__arrow {\n\t\t\t\tborder-bottom-right-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},75:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/toolbardropdown.css"],names:[],mappings:"AAKA,MACC,oCACD,CAEA,4CAGC,8CAA+C,CAD/C,iBAQD,CAJE,6DACC,qCACD,CCZF,oCACC,QACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-toolbar-dropdown-max-width: 60vw;\n}\n\n.ck.ck-toolbar-dropdown > .ck-dropdown__panel {\n\t/* https://github.com/ckeditor/ckeditor5/issues/5586 */\n\twidth: max-content;\n\tmax-width: var(--ck-toolbar-dropdown-max-width);\n\n\t& .ck-button {\n\t\t&:focus {\n\t\t\tz-index: calc(var(--ck-z-default) + 1);\n\t\t}\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-toolbar-dropdown .ck-toolbar {\n\tborder: 0;\n}\n"],sourceRoot:""}]);const a=r},547:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/editorui/editorui.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AAWA,MACC,0CACD,CAEA,yDCJC,eDWD,CAPA,yJCAE,qCDOF,CAJC,oEEPA,2BAA2B,CCF3B,qCAA8B,CDC9B,YFWA,CAGD,+BAGC,4BAA6B,CAF7B,aAAc,CACd,oCA6BD,CA1BC,wCACC,eACD,CAEA,wCACC,gBACD,CAGA,4CACC,kCACD,CAGA,2CAKC,qCACD,CAGA,sDACC,kDACD,CAKA,gEACC,mDACD,CAIA,gEACC,gDACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_disabled.css";\n@import "../../../mixins/_shadow.css";\n@import "../../../mixins/_focus.css";\n@import "../../mixins/_button.css";\n\n:root {\n\t--ck-color-editable-blur-selection: hsl(0, 0%, 85%);\n}\n\n.ck.ck-editor__editable:not(.ck-editor__nested-editable) {\n\t@mixin ck-rounded-corners;\n\n\t&.ck-focused {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-inner-shadow);\n\t}\n}\n\n.ck.ck-editor__editable_inline {\n\toverflow: auto;\n\tpadding: 0 var(--ck-spacing-standard);\n\tborder: 1px solid transparent;\n\n\t&[dir="ltr"] {\n\t\ttext-align: left;\n\t}\n\n\t&[dir="rtl"] {\n\t\ttext-align: right;\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/116 */\n\t& > *:first-child {\n\t\tmargin-top: var(--ck-spacing-large);\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5/issues/847 */\n\t& > *:last-child {\n\t\t/*\n\t\t * This value should match with the default margins of the block elements (like .media or .image)\n\t\t * to avoid a content jumping when the fake selection container shows up (See https://github.com/ckeditor/ckeditor5/issues/9825).\n\t\t */\n\t\tmargin-bottom: var(--ck-spacing-large);\n\t}\n\n\t/* https://github.com/ckeditor/ckeditor5/issues/6517 */\n\t&.ck-blurred ::selection {\n\t\tbackground: var(--ck-color-editable-blur-selection);\n\t}\n}\n\n/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/111 */\n.ck.ck-balloon-panel.ck-toolbar-container[class*="arrow_n"] {\n\t&::after {\n\t\tborder-bottom-color: var(--ck-color-base-foreground);\n\t}\n}\n\n.ck.ck-balloon-panel.ck-toolbar-container[class*="arrow_s"] {\n\t&::after {\n\t\tborder-top-color: var(--ck-color-base-foreground);\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},523:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-form__header .ck-form__header__label{font-weight:700}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/formheader/formheader.css"],names:[],mappings:"AAKA,oBAIC,kBAAmB,CAHnB,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CAEjB,6BACD,CCNA,MACC,4BACD,CAEA,oBAIC,mDAAoD,CAFpD,mCAAoC,CACpC,wCAAyC,CAFzC,uDAQD,CAHC,4CACC,eACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-form__header {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\talign-items: center;\n\tjustify-content: space-between;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-form-header-height: 38px;\n}\n\n.ck.ck-form__header {\n\tpadding: var(--ck-spacing-small) var(--ck-spacing-large);\n\theight: var(--ck-form-header-height);\n\tline-height: var(--ck-form-header-height);\n\tborder-bottom: 1px solid var(--ck-color-base-border);\n\n\t& .ck-form__header__label {\n\t\tfont-weight: bold;\n\t}\n}\n"],sourceRoot:""}]);const a=r},174:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{font-size:.8333350694em;height:var(--ck-icon-size);width:var(--ck-icon-size);will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/icon/icon.css"],names:[],mappings:"AAKA,YACC,qBACD,CCFA,MACC,0EACD,CAEA,YAKC,uBAAwB,CAHxB,0BAA2B,CAD3B,yBAA0B,CAY1B,qBAcD,CAZC,0BARA,aAAc,CAGd,cAgBA,CAJC,yBAEC,iBACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-icon {\n\tvertical-align: middle;\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-icon-size: calc(var(--ck-line-height-base) * var(--ck-font-size-normal));\n}\n\n.ck.ck-icon {\n\twidth: var(--ck-icon-size);\n\theight: var(--ck-icon-size);\n\n\t/* Multiplied by the height of the line in "px" should give SVG "viewport" dimensions */\n\tfont-size: .8333350694em;\n\n\tcolor: inherit;\n\n\t/* Inherit cursor style (#5). */\n\tcursor: inherit;\n\n\t/* This will prevent blurry icons on Firefox. See #340. */\n\twill-change: transform;\n\n\t& * {\n\t\t/* Inherit cursor style (#5). */\n\t\tcursor: inherit;\n\n\t\t/* Allows dynamic coloring of the icons. */\n\t\tcolor: inherit;\n\n\t\t&:not([fill]) {\n\t\t\t/* Needed by FF. */\n\t\t\tfill: currentColor;\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=r},985:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,":root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{border-radius:0}.ck-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/input/input.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AASA,MACC,qBAAsB,CAGtB,2CACD,CAEA,aCLC,eD2CD,CAtCA,iECDE,qCDuCF,CAtCA,aAGC,2CAA4C,CAC5C,6CAA8C,CAK9C,4CAA6C,CAH7C,+BAAgC,CADhC,6DAA8D,CAO9D,4DA0BD,CAxBC,mBEnBA,2BAA2B,CCF3B,2CAA8B,CDC9B,YFuBA,CAEA,uBAEC,oDAAqD,CADrD,sDAAuD,CAEvD,yCAMD,CAJC,6BG/BD,oDHkCC,CAGD,sBAEC,sCAAuC,CADvC,+CAMD,CAHC,4BGzCD,iDH2CC,CAIF,0BACC,IACC,0BACD,CAEA,IACC,yBACD,CAEA,IACC,0BACD,CAEA,IACC,yBACD,CACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_focus.css";\n@import "../../../mixins/_shadow.css";\n\n:root {\n\t--ck-input-width: 18em;\n\n\t/* Backward compatibility. */\n\t--ck-input-text-width: var(--ck-input-width);\n}\n\n.ck.ck-input {\n\t@mixin ck-rounded-corners;\n\n\tbackground: var(--ck-color-input-background);\n\tborder: 1px solid var(--ck-color-input-border);\n\tpadding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);\n\tmin-width: var(--ck-input-width);\n\n\t/* This is important to stay of the same height as surrounding buttons */\n\tmin-height: var(--ck-ui-component-min-height);\n\n\t/* Apply some smooth transition to the box-shadow and border. */\n\ttransition: box-shadow .1s ease-in-out, border .1s ease-in-out;\n\n\t&:focus {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\n\t}\n\n\t&[readonly] {\n\t\tborder: 1px solid var(--ck-color-input-disabled-border);\n\t\tbackground: var(--ck-color-input-disabled-background);\n\t\tcolor: var(--ck-color-input-disabled-text);\n\n\t\t&:focus {\n\t\t\t/* The read-only input should have a slightly less visible shadow when focused. */\n\t\t\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\n\t\t}\n\t}\n\n\t&.ck-error {\n\t\tborder-color: var(--ck-color-input-error-border);\n\t\tanimation: ck-input-shake .3s ease both;\n\n\t\t&:focus {\n\t\t\t@mixin ck-box-shadow var(--ck-focus-error-outer-shadow);\n\t\t}\n\t}\n}\n\n@keyframes ck-input-shake {\n\t20% {\n\t\ttransform: translateX(-2px);\n\t}\n\n\t40% {\n\t\ttransform: translateX(2px);\n\t}\n\n\t60% {\n\t\ttransform: translateX(-1px);\n\t}\n\n\t80% {\n\t\ttransform: translateX(1px);\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},751:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/label/label.css"],names:[],mappings:"AAKA,aACC,aACD,CAEA,mBACC,YACD,CCNA,aACC,eACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-label {\n\tdisplay: block;\n}\n\n.ck.ck-voice-label {\n\tdisplay: none;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-label {\n\tfont-weight: bold;\n}\n"],sourceRoot:""}]);const a=r},111:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/labeledfield/labeledfieldview.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAMC,mEACC,YAAa,CACb,iBACD,CAEA,uCACC,aAAc,CACd,iBACD,CCND,MACC,kEAAsE,CACtE,gFAAiF,CACjF,yEACD,CAEA,0BCHC,eD4GD,CAzGA,2FCCE,qCDwGF,CAtGC,mEACC,UAmCD,CAjCC,gFACC,KA+BD,CAhCA,0FAIE,MA4BF,CAhCA,0FAQE,OAwBF,CAhCA,gFAiBC,yDAA0D,CAG1D,eAAmB,CADnB,kBAAoB,CAOpB,cAAe,CAFf,eAAgB,CANhB,2CAA8C,CAP9C,mBAAoB,CAYpB,sBAAuB,CARvB,6DAA+D,CAH/D,oBAAqB,CAgBrB,+JAID,CAQA,mKACC,gCACD,CAGD,yDACC,mCAAoC,CACpC,kCAAmC,CAInC,kBAKD,CAHC,6FACC,gCACD,CAID,4OAEC,yCACD,CAIA,oUAGE,wFAYF,CAfA,oUAOE,iGAQF,CAfA,gTAaC,sBAAuB,CAFvB,iEAAkE,CAGlE,SACD,CAKA,8FACC,sBACD,CAGA,yIACC,SACD,CAGA,kMACC,8HACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-labeled-field-view {\n\t& > .ck.ck-labeled-field-view__input-wrapper {\n\t\tdisplay: flex;\n\t\tposition: relative;\n\t}\n\n\t& .ck.ck-label {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n@import "../../../mixins/_rounded.css";\n\n:root {\n\t--ck-labeled-field-view-transition: .1s cubic-bezier(0, 0, 0.24, 0.95);\n\t--ck-labeled-field-empty-unfocused-max-width: 100% - 2 * var(--ck-spacing-medium);\n\t--ck-color-labeled-field-label-background: var(--ck-color-base-background);\n}\n\n.ck.ck-labeled-field-view {\n\t@mixin ck-rounded-corners;\n\n\t& > .ck.ck-labeled-field-view__input-wrapper {\n\t\twidth: 100%;\n\n\t\t& > .ck.ck-label {\n\t\t\ttop: 0px;\n\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tleft: 0px;\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tright: 0px;\n\t\t\t}\n\n\t\t\tpointer-events: none;\n\t\t\ttransform-origin: 0 0;\n\n\t\t\t/* By default, display the label scaled down above the field. */\n\t\t\ttransform: translate(var(--ck-spacing-medium), -6px) scale(.75);\n\n\t\t\tbackground: var(--ck-color-labeled-field-label-background);\n\t\t\tpadding: 0 calc(.5 * var(--ck-font-size-tiny));\n\t\t\tline-height: initial;\n\t\t\tfont-weight: normal;\n\n\t\t\t/* Prevent overflow when the label is longer than the input */\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\n\t\t\tmax-width: 100%;\n\n\t\t\ttransition:\n\t\t\t\ttransform var(--ck-labeled-field-view-transition),\n\t\t\t\tpadding var(--ck-labeled-field-view-transition),\n\t\t\t\tbackground var(--ck-labeled-field-view-transition);\n\t\t}\n\t}\n\n\t&.ck-error {\n\t\t& > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\n\t\t\tcolor: var(--ck-color-base-error);\n\t\t}\n\n\t\t& .ck-input:not([readonly]) + .ck.ck-label {\n\t\t\tcolor: var(--ck-color-base-error);\n\t\t}\n\t}\n\n\t& .ck-labeled-field-view__status {\n\t\tfont-size: var(--ck-font-size-small);\n\t\tmargin-top: var(--ck-spacing-small);\n\n\t\t/* Let the info wrap to the next line to avoid stretching the layout horizontally.\n\t\tThe status could be very long. */\n\t\twhite-space: normal;\n\n\t\t&.ck-labeled-field-view__status_error {\n\t\t\tcolor: var(--ck-color-base-error);\n\t\t}\n\t}\n\n\t/* Disabled fields and fields that have no focus should fade out. */\n\t&.ck-disabled > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\n\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\n\t\tcolor: var(--ck-color-input-disabled-text);\n\t}\n\n\t/* Fields that are disabled or not focused and without a placeholder should have full-sized labels. */\n\t/* stylelint-disable-next-line no-descending-specificity */\n\t&.ck-disabled.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\n\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\n\t\t@mixin ck-dir ltr {\n\t\t\ttransform: translate(var(--ck-spacing-medium), calc(0.6 * var(--ck-font-size-base))) scale(1);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\ttransform: translate(calc(-1 * var(--ck-spacing-medium)), calc(0.6 * var(--ck-font-size-base))) scale(1);\n\t\t}\n\n\t\t/* Compensate for the default translate position. */\n\t\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width));\n\n\t\tbackground: transparent;\n\t\tpadding: 0;\n\t}\n\n\t/*------ DropdownView integration ----------------------------------------------------------------------------------- */\n\n\t/* Make sure dropdown\' background color in any of dropdown\'s state does not collide with labeled field. */\n\t& > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck.ck-button {\n\t\tbackground: transparent;\n\t}\n\n\t/* When the dropdown is "empty", the labeled field label replaces its label. */\n\t&.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck-button > .ck-button__label {\n\t\topacity: 0;\n\t}\n\n\t/* Make sure the label of the empty, unfocused input does not cover the dropdown arrow. */\n\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown + .ck-label {\n\t\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard));\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},162:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{background:var(--ck-color-list-background);list-style-type:none}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{border-radius:0;min-height:unset;padding:calc(var(--ck-line-height-base)*.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*.4*var(--ck-font-size-base));text-align:left;width:100%}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{background:var(--ck-color-base-border);height:1px;width:100%}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/list/list.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAOA,YAGC,YAAa,CACb,qBAAsB,CCFtB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBDaD,CAZC,2DAEC,aACD,CAKA,kCACC,iBAAkB,CAClB,2BACD,CEfD,YCEC,eDGD,CALA,+DCME,qCDDF,CALA,YAIC,0CAA2C,CAD3C,oBAED,CAEA,kBACC,cAAe,CACf,cA2DD,CAzDC,6BAIC,eAAgB,CAHhB,gBAAiB,CAQjB,iIAEiE,CARjE,eAAgB,CADhB,UAwCD,CA7BC,+CAEC,yEACD,CAEA,oCACC,eACD,CAEA,mCACC,oDAAqD,CACrD,yCAaD,CAXC,0CACC,eACD,CAEA,2DACC,0DACD,CAEA,2DACC,4CACD,CAGD,qDACC,uDACD,CAMA,yCACC,0CAA2C,CAC3C,aAMD,CAJC,iEACC,uDAAwD,CACxD,aACD,CAKH,uBAGC,sCAAuC,CAFvC,UAAW,CACX,UAED",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../mixins/_unselectable.css";\n\n.ck.ck-list {\n\t@mixin ck-unselectable;\n\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t& .ck-list__item,\n\t& .ck-list__separator {\n\t\tdisplay: block;\n\t}\n\n\t/* Make sure that whatever child of the list item gets focus, it remains on the\n\ttop. Thanks to that, styles like box-shadow, outline, etc. are not masked by\n\tadjacent list items. */\n\t& .ck-list__item > *:focus {\n\t\tposition: relative;\n\t\tz-index: var(--ck-z-default);\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Makes element unselectable.\n */\n@define-mixin ck-unselectable {\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_disabled.css";\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_shadow.css";\n\n.ck.ck-list {\n\t@mixin ck-rounded-corners;\n\n\tlist-style-type: none;\n\tbackground: var(--ck-color-list-background);\n}\n\n.ck.ck-list__item {\n\tcursor: default;\n\tmin-width: 12em;\n\n\t& .ck-button {\n\t\tmin-height: unset;\n\t\twidth: 100%;\n\t\ttext-align: left;\n\t\tborder-radius: 0;\n\n\t\t/* List items should have the same height. Use absolute units to make sure it is so\n\t\t because e.g. different heading styles may have different height\n\t\t https://github.com/ckeditor/ckeditor5-heading/issues/63 */\n\t\tpadding:\n\t\t\tcalc(.2 * var(--ck-line-height-base) * var(--ck-font-size-base))\n\t\t\tcalc(.4 * var(--ck-line-height-base) * var(--ck-font-size-base));\n\n\t\t& .ck-button__label {\n\t\t\t/* https://github.com/ckeditor/ckeditor5-heading/issues/63 */\n\t\t\tline-height: calc(1.2 * var(--ck-line-height-base) * var(--ck-font-size-base));\n\t\t}\n\n\t\t&:active {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\t&.ck-on {\n\t\t\tbackground: var(--ck-color-list-button-on-background);\n\t\t\tcolor: var(--ck-color-list-button-on-text);\n\n\t\t\t&:active {\n\t\t\t\tbox-shadow: none;\n\t\t\t}\n\n\t\t\t&:hover:not(.ck-disabled) {\n\t\t\t\tbackground: var(--ck-color-list-button-on-background-focus);\n\t\t\t}\n\n\t\t\t&:focus:not(.ck-disabled) {\n\t\t\t\tborder-color: var(--ck-color-base-background);\n\t\t\t}\n\t\t}\n\n\t\t&:hover:not(.ck-disabled) {\n\t\t\tbackground: var(--ck-color-list-button-hover-background);\n\t\t}\n\t}\n\n\t/* It\'s unnecessary to change the background/text of a switch toggle; it has different ways\n\tof conveying its state (like the switcher) */\n\t& .ck-switchbutton {\n\t\t&.ck-on {\n\t\t\tbackground: var(--ck-color-list-background);\n\t\t\tcolor: inherit;\n\n\t\t\t&:hover:not(.ck-disabled) {\n\t\t\t\tbackground: var(--ck-color-list-button-hover-background);\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\t\t}\n\t}\n}\n\n.ck.ck-list__separator {\n\theight: 1px;\n\twidth: 100%;\n\tbackground: var(--ck-color-base-border);\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},245:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);box-shadow:var(--ck-drop-shadow),0 0;min-height:15px}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonpanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AAKA,MAEC,8DACD,CAEA,qBACC,YAAa,CACb,iBAAkB,CAElB,yBAyCD,CAtCE,+GAEC,UAAW,CACX,iBACD,CAEA,wDACC,6CACD,CAEA,uDACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAGD,8CACC,aACD,CC9CD,MACC,6BAA8B,CAC9B,8BAA+B,CAC/B,iCAAkC,CAClC,oEACD,CAEA,qBCJC,eD4ID,CAxIA,iFCAE,qCDwIF,CAxIA,qBAMC,2CAA4C,CAC5C,6CAA8C,CEb9C,oCAA8B,CFU9B,eAoID,CA9HE,+GAIC,kBAAmB,CADnB,QAAS,CADT,OAGD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EACD,CAEA,2CACC,iFAAkF,CAClF,yCACD,CAIA,uFAEC,mHACD,CAEA,4CACC,iEAAkE,CAClE,uDACD,CAEA,2CACC,iFAAkF,CAClF,4CACD,CAIA,yGAEC,QAAS,CACT,uDAA0D,CAC1D,2CACD,CAIA,2GAEC,+CAAkD,CAClD,2CACD,CAIA,2GAEC,gDAAmD,CACnD,2CACD,CAIA,yGAIC,8CAAiD,CAFjD,QAAS,CACT,uDAED,CAIA,2GAGC,8CAAiD,CADjD,+CAED,CAIA,2GAGC,8CAAiD,CADjD,gDAED,CAIA,6GAIC,8CAAiD,CADjD,uDAA0D,CAD1D,SAGD,CAIA,6GAIC,8CAAiD,CAFjD,QAAS,CACT,sDAED,CAIA,6GAGC,uDAA0D,CAD1D,SAAU,CAEV,2CACD,CAIA,6GAEC,QAAS,CACT,sDAAyD,CACzD,2CACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/* Make sure the balloon arrow does not float over its children. */\n\t--ck-balloon-panel-arrow-z-index: calc(var(--ck-z-default) - 3);\n}\n\n.ck.ck-balloon-panel {\n\tdisplay: none;\n\tposition: absolute;\n\n\tz-index: var(--ck-z-modal);\n\n\t&.ck-balloon-panel_with-arrow {\n\t\t&::before,\n\t\t&::after {\n\t\t\tcontent: "";\n\t\t\tposition: absolute;\n\t\t}\n\n\t\t&::before {\n\t\t\tz-index: var(--ck-balloon-panel-arrow-z-index);\n\t\t}\n\n\t\t&::after {\n\t\t\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\n\t\t}\n\t}\n\n\t&[class*="arrow_n"] {\n\t\t&::before {\n\t\t\tz-index: var(--ck-balloon-panel-arrow-z-index);\n\t\t}\n\n\t\t&::after {\n\t\t\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\n\t\t}\n\t}\n\n\t&[class*="arrow_s"] {\n\t\t&::before {\n\t\t\tz-index: var(--ck-balloon-panel-arrow-z-index);\n\t\t}\n\n\t\t&::after {\n\t\t\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_visible {\n\t\tdisplay: block;\n\t}\n}\n','/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "../../../mixins/_shadow.css";\n\n:root {\n\t--ck-balloon-arrow-offset: 2px;\n\t--ck-balloon-arrow-height: 10px;\n\t--ck-balloon-arrow-half-width: 8px;\n\t--ck-balloon-arrow-drop-shadow: 0 2px 2px var(--ck-color-shadow-drop);\n}\n\n.ck.ck-balloon-panel {\n\t@mixin ck-rounded-corners;\n\t@mixin ck-drop-shadow;\n\n\tmin-height: 15px;\n\n\tbackground: var(--ck-color-panel-background);\n\tborder: 1px solid var(--ck-color-panel-border);\n\n\t&.ck-balloon-panel_with-arrow {\n\t\t&::before,\n\t\t&::after {\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder-style: solid;\n\t\t}\n\t}\n\n\t&[class*="arrow_n"] {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-width: 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width);\n\t\t}\n\n\t\t&::before {\n\t\t\tborder-color: transparent transparent var(--ck-color-panel-border) transparent;\n\t\t}\n\n\t\t&::after {\n\t\t\tborder-color: transparent transparent var(--ck-color-panel-background) transparent;\n\t\t\tmargin-top: var(--ck-balloon-arrow-offset);\n\t\t}\n\t}\n\n\t&[class*="arrow_s"] {\n\t\t&::before,\n\t\t&::after {\n\t\t\tborder-width: var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width);\n\t\t}\n\n\t\t&::before {\n\t\t\tborder-color: var(--ck-color-panel-border) transparent transparent;\n\t\t\tfilter: drop-shadow(var(--ck-balloon-arrow-drop-shadow));\n\t\t}\n\n\t\t&::after {\n\t\t\tborder-color: var(--ck-color-panel-background) transparent transparent transparent;\n\t\t\tmargin-bottom: var(--ck-balloon-arrow-offset);\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_n {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 50%;\n\t\t\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_nw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_ne {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_s {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 50%;\n\t\t\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_sw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_se {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_sme {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: 25%;\n\t\t\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_smw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 25%;\n\t\t\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_nme {\n\t\t&::before,\n\t\t&::after {\n\t\t\tright: 25%;\n\t\t\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n\n\t&.ck-balloon-panel_arrow_nmw {\n\t\t&::before,\n\t\t&::after {\n\t\t\tleft: 25%;\n\t\t\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\n\t\t\ttop: calc(-1 * var(--ck-balloon-arrow-height));\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},757:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-balloon-rotator__navigation{align-items:center;display:flex;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonrotator.css"],names:[],mappings:"AAKA,oCAEC,kBAAmB,CADnB,YAAa,CAEb,sBACD,CAKA,6CACC,sBACD,CCXA,oCACC,6CAA8C,CAC9C,sDAAuD,CACvD,iCAgBD,CAbC,sCAGC,qCAAsC,CAFtC,oCAAqC,CACrC,kCAED,CAGA,iEAIC,mCAAoC,CAHpC,uCAID,CAMA,2DACC,eACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-balloon-rotator__navigation {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Buttons inside a toolbar should be centered when rotator bar is wider.\n * See: https://github.com/ckeditor/ckeditor5-ui/issues/495\n */\n.ck .ck-balloon-rotator__content .ck-toolbar {\n\tjustify-content: center;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-balloon-rotator__navigation {\n\tbackground: var(--ck-color-toolbar-background);\n\tborder-bottom: 1px solid var(--ck-color-toolbar-border);\n\tpadding: 0 var(--ck-spacing-small);\n\n\t/* Let's keep similar appearance to `ck-toolbar`. */\n\t& > * {\n\t\tmargin-right: var(--ck-spacing-small);\n\t\tmargin-top: var(--ck-spacing-small);\n\t\tmargin-bottom: var(--ck-spacing-small);\n\t}\n\n\t/* Gives counter more breath than buttons. */\n\t& .ck-balloon-rotator__counter {\n\t\tmargin-right: var(--ck-spacing-standard);\n\n\t\t/* We need to use smaller margin because of previous button's right margin. */\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n}\n\n.ck .ck-balloon-rotator__content {\n\n\t/* Disable default annotation shadow inside rotator with fake panels. */\n\t& .ck.ck-annotation-wrapper {\n\t\tbox-shadow: none;\n\t}\n}\n"],sourceRoot:""}]);const a=r},553:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/fakepanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AAKA,mBACC,iBAAkB,CAGlB,mCACD,CAEA,uBACC,iBACD,CAEA,mCACC,SACD,CAEA,oCACC,SACD,CCfA,MACC,6CAA8C,CAC9C,2CACD,CAGA,uBAKC,2CAA4C,CAC5C,6CAA8C,CAC9C,qCAAsC,CCXtC,oCAA8B,CDc9B,WAAY,CAPZ,eAAgB,CAMhB,UAED,CAEA,mCACC,0DAA2D,CAC3D,uDACD,CAEA,oCACC,kEAAqE,CACrE,+DACD,CACA,oCACC,kEAAqE,CACrE,+DACD,CAGA,yIAGC,4CACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-fake-panel {\n\tposition: absolute;\n\n\t/* Fake panels should be placed under main balloon content. */\n\tz-index: calc(var(--ck-z-modal) - 1);\n}\n\n.ck .ck-fake-panel div {\n\tposition: absolute;\n}\n\n.ck .ck-fake-panel div:nth-child( 1 ) {\n\tz-index: 2;\n}\n\n.ck .ck-fake-panel div:nth-child( 2 ) {\n\tz-index: 1;\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_shadow.css";\n\n:root {\n\t--ck-balloon-fake-panel-offset-horizontal: 6px;\n\t--ck-balloon-fake-panel-offset-vertical: 6px;\n}\n\n/* Let\'s use `.ck-balloon-panel` appearance. See: balloonpanel.css. */\n.ck .ck-fake-panel div {\n\t@mixin ck-drop-shadow;\n\n\tmin-height: 15px;\n\n\tbackground: var(--ck-color-panel-background);\n\tborder: 1px solid var(--ck-color-panel-border);\n\tborder-radius: var(--ck-border-radius);\n\n\twidth: 100%;\n\theight: 100%;\n}\n\n.ck .ck-fake-panel div:nth-child( 1 ) {\n\tmargin-left: var(--ck-balloon-fake-panel-offset-horizontal);\n\tmargin-top: var(--ck-balloon-fake-panel-offset-vertical);\n}\n\n.ck .ck-fake-panel div:nth-child( 2 ) {\n\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 2);\n\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 2);\n}\n.ck .ck-fake-panel div:nth-child( 3 ) {\n\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 3);\n\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 3);\n}\n\n/* If balloon is positioned above element, we need to move fake panel to the top. */\n.ck .ck-balloon-panel_arrow_s + .ck-fake-panel,\n.ck .ck-balloon-panel_arrow_se + .ck-fake-panel,\n.ck .ck-balloon-panel_arrow_sw + .ck-fake-panel {\n\t--ck-balloon-fake-panel-offset-vertical: -6px;\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},609:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-modal)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/stickypanel.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AAMC,qDAEC,cAAe,CACf,KAAM,CAFN,yBAGD,CAEA,kEAEC,iBAAkB,CADlB,QAED,CCPA,qDAIC,wBAAyB,CACzB,yBAA0B,CAF1B,sBAAuB,CCFxB,oCDKA",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-sticky-panel {\n\t& .ck-sticky-panel__content_sticky {\n\t\tz-index: var(--ck-z-modal); /* #315 */\n\t\tposition: fixed;\n\t\ttop: 0;\n\t}\n\n\t& .ck-sticky-panel__content_sticky_bottom-limit {\n\t\ttop: auto;\n\t\tposition: absolute;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_shadow.css";\n\n.ck.ck-sticky-panel {\n\t& .ck-sticky-panel__content_sticky {\n\t\t@mixin ck-drop-shadow;\n\n\t\tborder-width: 0 1px 1px;\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},590:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck-vertical-form .ck-button:after{bottom:var(--ck-spacing-small);content:"";position:absolute;right:-1px;top:var(--ck-spacing-small);width:0;z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:var(--ck-spacing-small);content:"";position:absolute;right:-1px;top:var(--ck-spacing-small);width:0;z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border:0;border-radius:0;border-top:1px solid var(--ck-color-base-border);margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/responsive-form/responsiveform.css"],names:[],mappings:"AAOA,mCAMC,8BAA+B,CAL/B,UAAW,CAEX,iBAAkB,CAClB,UAAW,CACX,2BAA4B,CAH5B,OAAQ,CAKR,SACD,CCTC,oCDaC,wCAMC,8BAA+B,CAL/B,UAAW,CAEX,iBAAkB,CAClB,UAAW,CACX,2BAA4B,CAH5B,OAAQ,CAKR,SACD,CCnBD,CCAD,qDACC,kDACD,CAEA,uBACC,+BAkED,CAhEC,6BAEC,YACD,CASC,uGACC,sCACD,CDvBD,oCCMD,uBAqBE,SAAU,CACV,oCA6CF,CA3CE,8CACC,wDAWD,CATC,6DACC,WAAY,CACZ,UACD,CAGA,4EACC,kBACD,CAID,iGAMC,QAAS,CADT,eAAgB,CAEhB,gDAAiD,CAJjD,kCAAmC,CADnC,kCAkBD,CApBA,0OAcE,aAMF,CAGC,yMACC,kDACD,CDpEF",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n\n.ck-vertical-form .ck-button::after {\n\tcontent: "";\n\twidth: 0;\n\tposition: absolute;\n\tright: -1px;\n\ttop: var(--ck-spacing-small);\n\tbottom: var(--ck-spacing-small);\n\tz-index: 1;\n}\n\n.ck.ck-responsive-form {\n\t@mixin ck-media-phone {\n\t\t& .ck-button::after {\n\t\t\tcontent: "";\n\t\t\twidth: 0;\n\t\t\tposition: absolute;\n\t\t\tright: -1px;\n\t\t\ttop: var(--ck-spacing-small);\n\t\t\tbottom: var(--ck-spacing-small);\n\t\t\tz-index: 1;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@define-mixin ck-media-phone {\n\t@media screen and (max-width: 600px) {\n\t\t@mixin-content;\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n.ck-vertical-form > .ck-button:nth-last-child(2)::after {\n\tborder-right: 1px solid var(--ck-color-base-border);\n}\n\n.ck.ck-responsive-form {\n\tpadding: var(--ck-spacing-large);\n\n\t&:focus {\n\t\t/* See: https://github.com/ckeditor/ckeditor5/issues/4773 */\n\t\toutline: none;\n\t}\n\n\t@mixin ck-dir ltr {\n\t\t& > :not(:first-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-dir rtl {\n\t\t& > :not(:last-child) {\n\t\t\tmargin-left: var(--ck-spacing-standard);\n\t\t}\n\t}\n\n\t@mixin ck-media-phone {\n\t\tpadding: 0;\n\t\twidth: calc(.8 * var(--ck-input-width));\n\n\t\t& .ck-labeled-field-view {\n\t\t\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) 0;\n\n\t\t\t& .ck-input-text {\n\t\t\t\tmin-width: 0;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\n\t\t\t/* Let the long error messages wrap in the narrow form. */\n\t\t\t& .ck-labeled-field-view__error {\n\t\t\t\twhite-space: normal;\n\t\t\t}\n\t\t}\n\n\t\t/* Styles for two last buttons in the form (save&cancel, edit&unlink, etc.). */\n\t\t& > .ck-button:nth-last-child(1),\n\t\t& > .ck-button:nth-last-child(2) {\n\t\t\tpadding: var(--ck-spacing-standard);\n\t\t\tmargin-top: var(--ck-spacing-large);\n\n\t\t\tborder-radius: 0;\n\t\t\tborder: 0;\n\t\t\tborder-top: 1px solid var(--ck-color-base-border);\n\n\t\t\t@mixin ck-dir ltr {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t@mixin ck-dir rtl {\n\t\t\t\tmargin-left: 0;\n\n\t\t\t\t&:last-of-type {\n\t\t\t\t\tborder-right: 1px solid var(--ck-color-base-border);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t& > .ck-button:nth-last-child(2) {\n\t\t\t&::after {\n\t\t\t\tborder-right: 1px solid var(--ck-color-base-border);\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const a=r},706:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/blocktoolbar.css"],names:[],mappings:"AAKA,4BACC,iBAAkB,CAClB,2BACD,CCHA,MACC,oDAAqD,CACrD,yDACD,CAEA,4BACC,0CAA2C,CAC3C,sCACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-block-toolbar-button {\n\tposition: absolute;\n\tz-index: var(--ck-z-default);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-block-toolbar-button: var(--ck-color-text);\n\t--ck-block-toolbar-button-size: var(--ck-font-size-normal);\n}\n\n.ck.ck-block-toolbar-button {\n\tcolor: var(--ck-color-block-toolbar-button);\n\tfont-size: var(--ck-block-toolbar-size);\n}\n"],sourceRoot:""}]);const a=r},571:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);border:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;background:var(--ck-color-toolbar-border);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border:0;border-radius:0;margin:0;width:100%}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/toolbar.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAOA,eAKC,kBAAmB,CAFnB,YAAa,CACb,oBAAqB,CCFrB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBD6CD,CA3CC,kCAGC,kBAAmB,CAFnB,YAAa,CACb,kBAAmB,CAEnB,WAED,CAEA,yCACC,oBAWD,CAJC,yGAEC,YACD,CAGD,uCACC,eACD,CAEA,sDACC,gBACD,CAEA,sDACC,qBACD,CAEA,sDACC,gBACD,CAGC,yFACC,YACD,CE/CF,eCGC,eD0FD,CA7FA,qECOE,qCDsFF,CA7FA,eAGC,6CAA8C,CAE9C,+CAAgD,CADhD,iCAyFD,CAtFC,yCACC,kBAAmB,CAGnB,yCAA0C,CAO1C,qCAAsC,CADtC,kCAAmC,CAPnC,aAAc,CADd,SAUD,CAEA,uCACC,QACD,CAGC,gEAEC,oCACD,CAIA,kEACC,YACD,CAGD,gHAIC,qCAAsC,CADtC,kCAED,CAEA,mCAEC,SAgBD,CAbC,0DAWC,QAAS,CAHT,eAAgB,CAHhB,QAAS,CAHT,UAUD,CAGD,kCAEC,SAWD,CATC,uDAEC,QAMD,CAHC,yFACC,eACD,CASD,kFACC,mCACD,CAvFF,qCA2FE,QAEF,CAYC,+FACC,cACD,CAEA,iJAEC,mCACD,CAEA,qHACC,aACD,CAIC,6JAEC,2BAA4B,CAD5B,wBAED,CAGA,2JAEC,4BAA6B,CAD7B,yBAED,CAID,qGACC,mCACD,CAGA,yLACC,mCACD,CAWA,qHACC,cACD,CAIC,6JAEC,4BAA6B,CAD7B,yBAED,CAGA,2JAEC,2BAA4B,CAD5B,wBAED,CAID,qGACC,oCACD,CAGA,yLACC,oCACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../mixins/_unselectable.css";\n\n.ck.ck-toolbar {\n\t@mixin ck-unselectable;\n\n\tdisplay: flex;\n\tflex-flow: row nowrap;\n\talign-items: center;\n\n\t& > .ck-toolbar__items {\n\t\tdisplay: flex;\n\t\tflex-flow: row wrap;\n\t\talign-items: center;\n\t\tflex-grow: 1;\n\n\t}\n\n\t& .ck.ck-toolbar__separator {\n\t\tdisplay: inline-block;\n\n\t\t/*\n\t\t * A leading or trailing separator makes no sense (separates from nothing on one side).\n\t\t * For instance, it can happen when toolbar items (also separators) are getting grouped one by one and\n\t\t * moved to another toolbar in the dropdown.\n\t\t */\n\t\t&:first-child,\n\t\t&:last-child {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t& .ck-toolbar__line-break {\n\t\tflex-basis: 100%;\n\t}\n\n\t&.ck-toolbar_grouping > .ck-toolbar__items {\n\t\tflex-wrap: nowrap;\n\t}\n\n\t&.ck-toolbar_vertical > .ck-toolbar__items {\n\t\tflex-direction: column;\n\t}\n\n\t&.ck-toolbar_floating > .ck-toolbar__items {\n\t\tflex-wrap: nowrap;\n\t}\n\n\t& > .ck.ck-toolbar__grouped-dropdown {\n\t\t& > .ck-dropdown__button .ck-dropdown__arrow {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Makes element unselectable.\n */\n@define-mixin ck-unselectable {\n\t-moz-user-select: none;\n\t-webkit-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n.ck.ck-toolbar {\n\t@mixin ck-rounded-corners;\n\n\tbackground: var(--ck-color-toolbar-background);\n\tpadding: 0 var(--ck-spacing-small);\n\tborder: 1px solid var(--ck-color-toolbar-border);\n\n\t& .ck.ck-toolbar__separator {\n\t\talign-self: stretch;\n\t\twidth: 1px;\n\t\tmin-width: 1px;\n\t\tbackground: var(--ck-color-toolbar-border);\n\n\t\t/*\n\t\t * These margins make the separators look better in balloon toolbars (when aligned with the "tip").\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/7493.\n\t\t */\n\t\tmargin-top: var(--ck-spacing-small);\n\t\tmargin-bottom: var(--ck-spacing-small);\n\t}\n\n\t& .ck-toolbar__line-break {\n\t\theight: 0;\n\t}\n\n\t& > .ck-toolbar__items {\n\t\t& > *:not(.ck-toolbar__line-break) {\n\t\t\t/* (#11) Separate toolbar items. */\n\t\t\tmargin-right: var(--ck-spacing-small);\n\t\t}\n\n\t\t/* Don\'t display a separator after an empty items container, for instance,\n\t\twhen all items were grouped */\n\t\t&:empty + .ck.ck-toolbar__separator {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t& > .ck-toolbar__items > *:not(.ck-toolbar__line-break),\n\t& > .ck.ck-toolbar__grouped-dropdown {\n\t\t/* Make sure items wrapped to the next line have v-spacing */\n\t\tmargin-top: var(--ck-spacing-small);\n\t\tmargin-bottom: var(--ck-spacing-small);\n\t}\n\n\t&.ck-toolbar_vertical {\n\t\t/* Items in a vertical toolbar span the entire width. */\n\t\tpadding: 0;\n\n\t\t/* Specificity matters here. See https://github.com/ckeditor/ckeditor5-theme-lark/issues/168. */\n\t\t& > .ck-toolbar__items > .ck {\n\t\t\t/* Items in a vertical toolbar should span the horizontal space. */\n\t\t\twidth: 100%;\n\n\t\t\t/* Items in a vertical toolbar should have no margin. */\n\t\t\tmargin: 0;\n\n\t\t\t/* Items in a vertical toolbar span the entire width so rounded corners are pointless. */\n\t\t\tborder-radius: 0;\n\n\t\t\t/* Items in a vertical toolbar span the entire width so any border is pointless. */\n\t\t\tborder: 0;\n\t\t}\n\t}\n\n\t&.ck-toolbar_compact {\n\t\t/* No spacing around items. */\n\t\tpadding: 0;\n\n\t\t& > .ck-toolbar__items > * {\n\t\t\t/* Compact toolbar items have no spacing between them. */\n\t\t\tmargin: 0;\n\n\t\t\t/* "Middle" children should have no rounded corners. */\n\t\t\t&:not(:first-child):not(:last-child) {\n\t\t\t\tborder-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t& > .ck.ck-toolbar__grouped-dropdown {\n\t\t/*\n\t\t * Dropdown button has asymmetric padding to fit the arrow.\n\t\t * This button has no arrow so let\'s revert that padding back to normal.\n\t\t */\n\t\t& > .ck.ck-button.ck-dropdown__button {\n\t\t\tpadding-left: var(--ck-spacing-tiny);\n\t\t}\n\t}\n\n\t@nest .ck-toolbar-container & {\n\t\tborder: 0;\n\t}\n}\n\n/* stylelint-disable */\n\n/*\n * Styles for RTL toolbars.\n *\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own "dir"\n * because its parent is not controlled by the editor framework.\n */\n[dir="rtl"] .ck.ck-toolbar,\n.ck.ck-toolbar[dir="rtl"] {\n\t& > .ck-toolbar__items > .ck {\n\t\tmargin-right: 0;\n\t}\n\n\t&:not(.ck-toolbar_compact) > .ck-toolbar__items > .ck {\n\t\t/* (#11) Separate toolbar items. */\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n\n\t& > .ck-toolbar__items > .ck:last-child {\n\t\tmargin-left: 0;\n\t}\n\n\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\n\t\t/* No rounded corners on the right side of the first child. */\n\t\t&:first-child {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\n\t\t/* No rounded corners on the left side of the last child. */\n\t\t&:last-child {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\t}\n\n\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\n\t& > .ck.ck-toolbar__separator {\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n\n\t/* Some spacing between the items and the separator before the grouped items dropdown. */\n\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\n\t\tmargin-left: var(--ck-spacing-small);\n\t}\n}\n\n/*\n * Styles for LTR toolbars.\n *\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own "dir"\n * because its parent is not controlled by the editor framework.\n */\n[dir="ltr"] .ck.ck-toolbar,\n.ck.ck-toolbar[dir="ltr"] {\n\t& > .ck-toolbar__items > .ck:last-child {\n\t\tmargin-right: 0;\n\t}\n\n\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\n\t\t/* No rounded corners on the right side of the first child. */\n\t\t&:first-child {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t/* No rounded corners on the left side of the last child. */\n\t\t&:last-child {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t}\n\t}\n\n\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\n\t& > .ck.ck-toolbar__separator {\n\t\tmargin-right: var(--ck-spacing-small);\n\t}\n\n\t/* Some spacing between the items and the separator before the grouped items dropdown. */\n\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\n\t\tmargin-right: var(--ck-spacing-small);\n\t}\n}\n\n/* stylelint-enable */\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},948:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{-webkit-backface-visibility:hidden;pointer-events:none;position:absolute}.ck.ck-tooltip{display:none;opacity:0;visibility:hidden;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";height:0;width:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{background:var(--ck-color-tooltip-background);color:var(--ck-color-tooltip-text);font-size:.9em;left:-50%;line-height:1.5;padding:var(--ck-spacing-small) var(--ck-spacing-medium);position:relative}.ck.ck-tooltip .ck-tooltip__text:after{border-style:solid;left:50%;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{border-color:transparent transparent var(--ck-color-tooltip-background) transparent;border-width:0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size);top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%)}.ck.ck-tooltip.ck-tooltip_sw{left:auto;right:50%}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{left:calc(var(--ck-tooltip-arrow-size)*-2);right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{left:0;right:auto;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{border-color:var(--ck-color-tooltip-background) transparent transparent transparent;border-width:var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0 var(--ck-tooltip-arrow-size);bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{border-color:transparent var(--ck-color-tooltip-background) transparent transparent;border-width:var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0;left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1)}.ck.ck-tooltip.ck-tooltip_w{left:auto;right:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{border-color:transparent transparent transparent var(--ck-color-tooltip-background);border-width:var(--ck-tooltip-arrow-size) 0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size);left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1)}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/tooltip/tooltip.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAKA,sDASC,kCAAmC,CAJnC,mBAAoB,CAHpB,iBAQD,CAEA,eAIC,YAAa,CADb,SAAU,CADV,iBAAkB,CAGlB,yBAWD,CATC,iCACC,oBAOD,CALC,uCACC,UAAW,CAEX,QAAS,CADT,OAED,CCxBF,MACC,2BACD,CAEA,eACC,QAAS,CAMT,KAAM,CAON,sCAwKD,CAtKC,iCChBA,eDqCA,CArBA,yGCZC,qCDiCD,CArBA,iCAOC,6CAA8C,CAF9C,kCAAmC,CAFnC,cAAe,CAMf,SAAU,CALV,eAAgB,CAEhB,wDAAyD,CAEzD,iBAaD,CAVC,uCAOC,kBAAmB,CACnB,QAAS,CAFT,sCAGD,CAYD,sFAGC,4CAA+C,CAC/C,0BASD,CAPC,8JAIC,mFAAoF,CACpF,qGAAsG,CAHtG,+CAAkD,CAClD,0BAGD,CAaD,6BAEC,SAAU,CADV,SAYD,CATC,+CACC,SAAU,CACV,2CACD,CAEA,qDACC,SAAU,CACV,OACD,CAYD,6BACC,QAAS,CACT,UAYD,CAVC,+CAEC,0CAA8C,CAD9C,UAED,CAEA,qDAEC,MAAO,CADP,UAAW,CAEX,yBACD,CAYD,4BACC,yCAA4C,CAC5C,2BAQD,CANC,oDAGC,mFAAoF,CACpF,qGAAsG,CAHtG,4CAA+C,CAC/C,0BAGD,CAUD,4BACC,8CAA+C,CAC/C,OAaD,CAXC,8CACC,MAAO,CACP,0BAQD,CANC,oDAGC,mFAAoF,CACpF,qGAAsG,CAHtG,0CAA6C,CAC7C,8CAGD,CAWF,4BAEC,SAAU,CADV,+CAAgD,CAEhD,OAaD,CAXC,8CACC,MAAO,CACP,0BAQD,CANC,oDAGC,mFAAoF,CACpF,qGAAsG,CAHtG,SAAU,CACV,8CAGD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-tooltip,\n.ck.ck-tooltip .ck-tooltip__text::after {\n\tposition: absolute;\n\n\t/* Without this, hovering the tooltip could keep it visible. */\n\tpointer-events: none;\n\n\t/* This is to get rid of flickering when transitioning opacity in Chrome.\n\tIt\'s weird but it works. */\n\t-webkit-backface-visibility: hidden;\n}\n\n.ck.ck-tooltip {\n\t/* Tooltip is hidden by default. */\n\tvisibility: hidden;\n\topacity: 0;\n\tdisplay: none;\n\tz-index: var(--ck-z-modal);\n\n\t& .ck-tooltip__text {\n\t\tdisplay: inline-block;\n\n\t\t&::after {\n\t\t\tcontent: "";\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t}\n\t}\n}\n','/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../../../mixins/_rounded.css";\n\n:root {\n\t--ck-tooltip-arrow-size: 5px;\n}\n\n.ck.ck-tooltip {\n\tleft: 50%;\n\n\t/*\n\t * Prevent blurry tooltips in LoDPI environments.\n\t * See https://github.com/ckeditor/ckeditor5/issues/1802.\n\t */\n\ttop: 0;\n\n\t/*\n\t * For the transition to work, the tooltip must be controlled\n\t * using visibility+opacity. A delay prevents a "tooltip avalanche"\n\t * i.e. when scanning the toolbar with mouse cursor.\n\t */\n\ttransition: opacity .2s ease-in-out .2s;\n\n\t& .ck-tooltip__text {\n\t\t@mixin ck-rounded-corners;\n\n\t\tfont-size: .9em;\n\t\tline-height: 1.5;\n\t\tcolor: var(--ck-color-tooltip-text);\n\t\tpadding: var(--ck-spacing-small) var(--ck-spacing-medium);\n\t\tbackground: var(--ck-color-tooltip-background);\n\t\tposition: relative;\n\t\tleft: -50%;\n\n\t\t&::after {\n\t\t\t/*\n\t\t\t * For the transition to work, the tooltip must be controlled\n\t\t\t * using visibility+opacity. A delay prevents a "tooltip avalanche"\n\t\t\t * i.e. when scanning the toolbar with mouse cursor.\n\t\t\t */\n\t\t\ttransition: opacity .2s ease-in-out .2s;\n\t\t\tborder-style: solid;\n\t\t\tleft: 50%;\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip south of the element.\n\t *\n\t * [element]\n\t * ^\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t */\n\t&.ck-tooltip_s,\n\t&.ck-tooltip_sw,\n\t&.ck-tooltip_se {\n\t\tbottom: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\ttransform: translateY( 100% );\n\n\t\t& .ck-tooltip__text::after {\n\t\t\t/* 1px addresses gliches in rendering causing gap between the triangle and the text */\n\t\t\ttop: calc(-1 * var(--ck-tooltip-arrow-size) + 1px);\n\t\t\ttransform: translateX( -50% );\n\t\t\tborder-color: transparent transparent var(--ck-color-tooltip-background) transparent;\n\t\t\tborder-width: 0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size);\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip south-west of the element.\n\t *\n\t * [element]\n\t * ^\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t */\n\n\t&.ck-tooltip_sw {\n\t\tright: 50%;\n\t\tleft: auto;\n\n\t\t& .ck-tooltip__text {\n\t\t\tleft: auto;\n\t\t\tright: calc( -2 * var(--ck-tooltip-arrow-size));\n\t\t}\n\n\t\t& .ck-tooltip__text::after {\n\t\t\tleft: auto;\n\t\t\tright: 0;\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip south-east of the element.\n\t *\n\t * [element]\n\t * ^\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t */\n\t&.ck-tooltip_se {\n\t\tleft: 50%;\n\t\tright: auto;\n\n\t\t& .ck-tooltip__text {\n\t\t\tright: auto;\n\t\t\tleft: calc( -2 * var(--ck-tooltip-arrow-size));\n\t\t}\n\n\t\t& .ck-tooltip__text::after {\n\t\t\tright: auto;\n\t\t\tleft: 0;\n\t\t\ttransform: translateX( 50% );\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip north of the element.\n\t *\n\t * +-----------+\n\t * | Tooltip |\n\t * +-----------+\n\t * V\n\t * [element]\n\t */\n\t&.ck-tooltip_n {\n\t\ttop: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\ttransform: translateY( -100% );\n\n\t\t& .ck-tooltip__text::after {\n\t\t\tbottom: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\t\ttransform: translateX( -50% );\n\t\t\tborder-color: var(--ck-color-tooltip-background) transparent transparent transparent;\n\t\t\tborder-width: var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0 var(--ck-tooltip-arrow-size);\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip east of the element.\n\t *\n\t * +----------+\n\t * [element] < | east |\n\t * +----------+\n\t */\n\t&.ck-tooltip_e {\n\t\tleft: calc(100% + var(--ck-tooltip-arrow-size));\n\t\ttop: 50%;\n\n\t\t& .ck-tooltip__text {\n\t\t\tleft: 0;\n\t\t\ttransform: translateY( -50% );\n\n\t\t\t&::after {\n\t\t\t\tleft: calc(-1 * var(--ck-tooltip-arrow-size));\n\t\t\t\ttop: calc(50% - 1 * var(--ck-tooltip-arrow-size));\n\t\t\t\tborder-color: transparent var(--ck-color-tooltip-background) transparent transparent;\n\t\t\t\tborder-width: var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size) 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * A class that displays the tooltip west of the element.\n\t *\n\t * +----------+\n\t * | west | > [element]\n\t * +----------+\n\t */\n\t&.ck-tooltip_w {\n\t\tright: calc(100% + var(--ck-tooltip-arrow-size));\n\t\tleft: auto;\n\t\ttop: 50%;\n\n\t\t& .ck-tooltip__text {\n\t\t\tleft: 0;\n\t\t\ttransform: translateY( -50% );\n\n\t\t\t&::after {\n\t\t\t\tleft: 100%;\n\t\t\t\ttop: calc(50% - 1 * var(--ck-tooltip-arrow-size));\n\t\t\t\tborder-color: transparent transparent transparent var(--ck-color-tooltip-background);\n\t\t\t\tborder-width: var(--ck-tooltip-arrow-size) 0 var(--ck-tooltip-arrow-size) var(--ck-tooltip-arrow-size);\n\t\t\t}\n\t\t}\n\t}\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const a=r},150:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck-hidden{display:none!important}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{box-sizing:border-box;height:auto;position:static;width:auto}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{word-wrap:break-word;background:transparent;border:0;margin:0;padding:0;text-decoration:none;transition:none;vertical-align:middle}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_hidden.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_reset.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_zindex.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_transition.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_colors.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_disabled.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_fonts.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_reset.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_rounded.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_shadow.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_spacing.css"],names:[],mappings:"AAQA,WAGC,sBACD,CCPA,2EAGC,qBAAsB,CAEtB,WAAY,CACZ,eAAgB,CAFhB,UAGD,CCPA,MACC,gBAAiB,CACjB,4CACD,CCAA,oDAEC,yBACD,CCNA,MACC,kCAAmD,CACnD,+BAAoD,CACpD,8BAAgD,CAChD,8BAAmD,CACnD,6BAAmD,CACnD,yBAA+C,CAC/C,8BAAmD,CACnD,oCAAuD,CACvD,6BAAkD,CAIlD,+CAAwD,CACxD,qEAA+E,CAC/E,qCAAwD,CACxD,qDAA8D,CAC9D,gDAAyD,CACzD,yCAAqD,CACrD,sCAAsD,CACtD,4CAA0D,CAC1D,sCAAsD,CAItD,gDAAuD,CACvD,kDAA+D,CAC/D,mDAAgE,CAChE,+CAA6D,CAC7D,yDAA8D,CAE9D,uCAAuD,CACvD,6CAA4D,CAC5D,8CAA4D,CAC5D,0CAAyD,CACzD,gDAA8D,CAE9D,+DAAsE,CACtE,iDAAkE,CAClE,kDAAkE,CAClE,8CAA+D,CAC/D,oDAAoE,CACpE,6DAAsE,CAEtE,8BAAoD,CACpD,gCAAqD,CAErD,+CAA4D,CAC5D,qDAAiE,CACjE,+EAAqF,CACrF,oDAAmE,CACnE,yEAA8E,CAC9E,oDAAgE,CAIhE,oEAA2E,CAC3E,4DAAoE,CAIpE,2DAAoE,CACpE,+BAAiD,CACjD,wDAAgE,CAChE,+CAA0D,CAC1D,4CAA2D,CAC3D,wCAAwD,CACxD,sCAAsD,CAItD,0DAAmE,CACnE,uFAA6F,CAC7F,gEAAuE,CACvE,4EAAiF,CACjF,8DAAsE,CAItE,2DAAoE,CACpE,mDAA6D,CAI7D,6DAAsE,CACtE,qDAA+D,CAI/D,uDAAgE,CAChE,uDAAiE,CAIjE,0CAAyD,CAIzD,wCAA2D,CAI3D,+BAAoD,CACpD,uDAAmE,CACnE,kDAAgE,CCpGhE,wBAAyB,CCAzB,0CAA2C,CAK3C,gGAAiG,CAKjG,4GAA6G,CAK7G,sGAAuG,CAKvG,sDAAuD,CCvBvD,wBAAyB,CACzB,6BAA8B,CAC9B,wDAA6D,CAE7D,yBAA0B,CAC1B,2BAA4B,CAC5B,yBAA0B,CAC1B,wBAAyB,CACzB,0BAA2B,CCJ3B,kCJoGD,CI9FA,2EAaC,oBAAqB,CANrB,sBAAuB,CADvB,QAAS,CAFT,QAAS,CACT,SAAU,CAGV,oBAAqB,CAErB,eAAgB,CADhB,qBAKD,CAKA,8DAGC,wBAAyB,CAEzB,0BAA2B,CAG3B,WAAY,CACZ,UAAW,CALX,iGAAkG,CAElG,eAAgB,CAChB,kBAGD,CAGC,qDACC,gBACD,CAEA,mDAEC,sBACD,CAEA,qDACC,oBACD,CAEA,mLAGC,WACD,CAEA,iNAGC,cACD,CAEA,qDAEC,yBAAoC,CADpC,YAED,CAEA,qEAGC,QAAQ,CADR,SAED,CAMD,8BAEC,gBACD,CCnFA,MACC,sBAAuB,CCAvB,gEAAiE,CAKjE,0DAA2D,CAK3D,wEAAyE,CCbzE,uBAA8B,CAC9B,mDAA2D,CAC3D,4CAAkD,CAClD,oDAA4D,CAC5D,mDAA2D,CAC3D,kDAA2D,CAC3D,yDFFD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class which hides an element in DOM.\n */\n.ck-hidden {\n\t/* Override selector specificity. Otherwise, all elements with some display\n\tstyle defined will override this one, which is not a desired result. */\n\tdisplay: none !important;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-reset,\n.ck.ck-reset_all,\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\n\tbox-sizing: border-box;\n\twidth: auto;\n\theight: auto;\n\tposition: static;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-z-default: 1;\n\t--ck-z-modal: calc( var(--ck-z-default) + 999 );\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A class that disables all transitions of the element and its children.\n */\n.ck-transitions-disabled,\n.ck-transitions-disabled * {\n\ttransition: none !important;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-base-foreground: \t\t\t\t\t\t\t\thsl(0, 0%, 98%);\n\t--ck-color-base-background: \t\t\t\t\t\t\t\thsl(0, 0%, 100%);\n\t--ck-color-base-border: \t\t\t\t\t\t\t\t\thsl(0, 0%, 77%);\n\t--ck-color-base-action: \t\t\t\t\t\t\t\t\thsl(104, 44%, 48%);\n\t--ck-color-base-focus: \t\t\t\t\t\t\t\t\t\thsl(209, 92%, 70%);\n\t--ck-color-base-text: \t\t\t\t\t\t\t\t\t\thsl(0, 0%, 20%);\n\t--ck-color-base-active: \t\t\t\t\t\t\t\t\thsl(208, 88%, 52%);\n\t--ck-color-base-active-focus:\t\t\t\t\t\t\t\thsl(208, 88%, 47%);\n\t--ck-color-base-error:\t\t\t\t\t\t\t\t\t\thsl(15, 100%, 43%);\n\n\t/* -- Generic colors ------------------------------------------------------------------------ */\n\n\t--ck-color-focus-border-coordinates: \t\t\t\t\t\t208, 79%, 51%;\n\t--ck-color-focus-border: \t\t\t\t\t\t\t\t\thsl(var(--ck-color-focus-border-coordinates));\n\t--ck-color-focus-outer-shadow:\t\t\t\t\t\t\t\thsl(207, 89%, 86%);\n\t--ck-color-focus-disabled-shadow:\t\t\t\t\t\t\thsla(209, 90%, 72%,.3);\n\t--ck-color-focus-error-shadow:\t\t\t\t\t\t\t\thsla(9,100%,56%,.3);\n\t--ck-color-text: \t\t\t\t\t\t\t\t\t\t\tvar(--ck-color-base-text);\n\t--ck-color-shadow-drop: \t\t\t\t\t\t\t\t\thsla(0, 0%, 0%, 0.15);\n\t--ck-color-shadow-drop-active:\t\t\t\t\t\t\t\thsla(0, 0%, 0%, 0.2);\n\t--ck-color-shadow-inner: \t\t\t\t\t\t\t\t\thsla(0, 0%, 0%, 0.1);\n\n\t/* -- Buttons ------------------------------------------------------------------------------- */\n\n\t--ck-color-button-default-background: \t\t\t\t\t\ttransparent;\n\t--ck-color-button-default-hover-background: \t\t\t\thsl(0, 0%, 90%);\n\t--ck-color-button-default-active-background: \t\t\t\thsl(0, 0%, 85%);\n\t--ck-color-button-default-active-shadow: \t\t\t\t\thsl(0, 0%, 75%);\n\t--ck-color-button-default-disabled-background: \t\t\t\ttransparent;\n\n\t--ck-color-button-on-background: \t\t\t\t\t\t\thsl(0, 0%, 87%);\n\t--ck-color-button-on-hover-background: \t\t\t\t\t\thsl(0, 0%, 77%);\n\t--ck-color-button-on-active-background: \t\t\t\t\thsl(0, 0%, 73%);\n\t--ck-color-button-on-active-shadow: \t\t\t\t\t\thsl(0, 0%, 63%);\n\t--ck-color-button-on-disabled-background: \t\t\t\t\thsl(0, 0%, 87%);\n\n\t--ck-color-button-action-background: \t\t\t\t\t\tvar(--ck-color-base-action);\n\t--ck-color-button-action-hover-background: \t\t\t\t\thsl(104, 44%, 43%);\n\t--ck-color-button-action-active-background: \t\t\t\thsl(104, 44%, 41%);\n\t--ck-color-button-action-active-shadow: \t\t\t\t\thsl(104, 44%, 36%);\n\t--ck-color-button-action-disabled-background: \t\t\t\thsl(104, 44%, 58%);\n\t--ck-color-button-action-text: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\n\t--ck-color-button-save: \t\t\t\t\t\t\t\t\thsl(120, 100%, 27%);\n\t--ck-color-button-cancel: \t\t\t\t\t\t\t\t\thsl(15, 100%, 43%);\n\n\t--ck-color-switch-button-off-background:\t\t\t\t\thsl(0, 0%, 69%);\n\t--ck-color-switch-button-off-hover-background:\t\t\t\thsl(0, 0%, 64%);\n\t--ck-color-switch-button-on-background:\t\t\t\t\t\tvar(--ck-color-button-action-background);\n\t--ck-color-switch-button-on-hover-background:\t\t\t\thsl(104, 44%, 43%);\n\t--ck-color-switch-button-inner-background:\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-switch-button-inner-shadow:\t\t\t\t\t\thsla(0, 0%, 0%, 0.1);\n\n\t/* -- Dropdown ------------------------------------------------------------------------------ */\n\n\t--ck-color-dropdown-panel-background: \t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-dropdown-panel-border: \t\t\t\t\t\t\tvar(--ck-color-base-border);\n\n\t/* -- Input --------------------------------------------------------------------------------- */\n\n\t--ck-color-input-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-input-border: \t\t\t\t\t\t\t\t\thsl(0, 0%, 78%);\n\t--ck-color-input-error-border:\t\t\t\t\t\t\t\tvar(--ck-color-base-error);\n\t--ck-color-input-text: \t\t\t\t\t\t\t\t\t\tvar(--ck-color-base-text);\n\t--ck-color-input-disabled-background: \t\t\t\t\t\thsl(0, 0%, 95%);\n\t--ck-color-input-disabled-border: \t\t\t\t\t\t\thsl(0, 0%, 78%);\n\t--ck-color-input-disabled-text: \t\t\t\t\t\t\thsl(0, 0%, 46%);\n\n\t/* -- List ---------------------------------------------------------------------------------- */\n\n\t--ck-color-list-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-list-button-hover-background: \t\t\t\t\tvar(--ck-color-button-default-hover-background);\n\t--ck-color-list-button-on-background: \t\t\t\t\t\tvar(--ck-color-base-active);\n\t--ck-color-list-button-on-background-focus: \t\t\t\tvar(--ck-color-base-active-focus);\n\t--ck-color-list-button-on-text:\t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\n\t/* -- Panel --------------------------------------------------------------------------------- */\n\n\t--ck-color-panel-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\t--ck-color-panel-border: \t\t\t\t\t\t\t\t\tvar(--ck-color-base-border);\n\n\t/* -- Toolbar ------------------------------------------------------------------------------- */\n\n\t--ck-color-toolbar-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-foreground);\n\t--ck-color-toolbar-border: \t\t\t\t\t\t\t\t\tvar(--ck-color-base-border);\n\n\t/* -- Tooltip ------------------------------------------------------------------------------- */\n\n\t--ck-color-tooltip-background: \t\t\t\t\t\t\t\tvar(--ck-color-base-text);\n\t--ck-color-tooltip-text: \t\t\t\t\t\t\t\t\tvar(--ck-color-base-background);\n\n\t/* -- Engine -------------------------------------------------------------------------------- */\n\n\t--ck-color-engine-placeholder-text: \t\t\t\t\t\thsl(0, 0%, 44%);\n\n\t/* -- Upload -------------------------------------------------------------------------------- */\n\n\t--ck-color-upload-bar-background:\t\t \t\t\t\t\thsl(209, 92%, 70%);\n\n\t/* -- Link -------------------------------------------------------------------------------- */\n\n\t--ck-color-link-default:\t\t\t\t\t\t\t\t\thsl(240, 100%, 47%);\n\t--ck-color-link-selected-background:\t\t\t\t\t\thsla(201, 100%, 56%, 0.1);\n\t--ck-color-link-fake-selection:\t\t\t\t\t\t\t\thsla(201, 100%, 56%, 0.3);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/**\n\t * An opacity value of disabled UI item.\n\t */\n\t--ck-disabled-opacity: .5;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/**\n\t * The geometry of the of focused element's outer shadow.\n\t */\n\t--ck-focus-outer-shadow-geometry: 0 0 0 3px;\n\n\t/**\n\t * A visual style of focused element's outer shadow.\n\t */\n\t--ck-focus-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);\n\n\t/**\n\t * A visual style of focused element's outer shadow (when disabled).\n\t */\n\t--ck-focus-disabled-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);\n\n\t/**\n\t * A visual style of focused element's outer shadow (when has errors).\n\t */\n\t--ck-focus-error-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);\n\n\t/**\n\t * A visual style of focused element's border or outline.\n\t */\n\t--ck-focus-ring: 1px solid var(--ck-color-focus-border);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-font-size-base: 13px;\n\t--ck-line-height-base: 1.84615;\n\t--ck-font-face: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\n\n\t--ck-font-size-tiny: 0.7em;\n\t--ck-font-size-small: 0.75em;\n\t--ck-font-size-normal: 1em;\n\t--ck-font-size-big: 1.4em;\n\t--ck-font-size-large: 1.8em;\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/* This is super-important. This is **manually** adjusted so a button without an icon\n\tis never smaller than a button with icon, additionally making sure that text-less buttons\n\tare perfect squares. The value is also shared by other components which should stay "in-line"\n\twith buttons. */\n\t--ck-ui-component-min-height: 2.3em;\n}\n\n/**\n * Resets an element, ignoring its children.\n */\n.ck.ck-reset,\n.ck.ck-reset_all,\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\n\t/* Do not include inheritable rules here. */\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tbackground: transparent;\n\ttext-decoration: none;\n\tvertical-align: middle;\n\ttransition: none;\n\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/105 */\n\tword-wrap: break-word;\n}\n\n/**\n * Resets an element AND its children.\n */\n.ck.ck-reset_all,\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\n\t/* These are rule inherited by all children elements. */\n\tborder-collapse: collapse;\n\tfont: normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);\n\tcolor: var(--ck-color-text);\n\ttext-align: left;\n\twhite-space: nowrap;\n\tcursor: auto;\n\tfloat: none;\n}\n\n.ck-reset_all {\n\t& .ck-rtl *:not(.ck-reset_all-excluded *) {\n\t\ttext-align: right;\n\t}\n\n\t& iframe:not(.ck-reset_all-excluded *) {\n\t\t/* For IE */\n\t\tvertical-align: inherit;\n\t}\n\n\t& textarea:not(.ck-reset_all-excluded *) {\n\t\twhite-space: pre-wrap;\n\t}\n\n\t& textarea:not(.ck-reset_all-excluded *),\n\t& input[type="text"]:not(.ck-reset_all-excluded *),\n\t& input[type="password"]:not(.ck-reset_all-excluded *) {\n\t\tcursor: text;\n\t}\n\n\t& textarea[disabled]:not(.ck-reset_all-excluded *),\n\t& input[type="text"][disabled]:not(.ck-reset_all-excluded *),\n\t& input[type="password"][disabled]:not(.ck-reset_all-excluded *) {\n\t\tcursor: default;\n\t}\n\n\t& fieldset:not(.ck-reset_all-excluded *) {\n\t\tpadding: 10px;\n\t\tborder: 2px groove hsl(255, 7%, 88%);\n\t}\n\n\t& button:not(.ck-reset_all-excluded *)::-moz-focus-inner {\n\t\t/* See http://stackoverflow.com/questions/5517744/remove-extra-button-spacing-padding-in-firefox */\n\t\tpadding: 0;\n\t\tborder: 0\n\t}\n}\n\n/**\n * Default UI rules for RTL languages.\n */\n.ck[dir="rtl"],\n.ck[dir="rtl"] .ck {\n\ttext-align: right;\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Default border-radius value.\n */\n:root{\n\t--ck-border-radius: 2px;\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t/**\n\t * A visual style of element's inner shadow (i.e. input).\n\t */\n\t--ck-inner-shadow: 2px 2px 3px var(--ck-color-shadow-inner) inset;\n\n\t/**\n\t * A visual style of element's drop shadow (i.e. panel).\n\t */\n\t--ck-drop-shadow: 0 1px 2px 1px var(--ck-color-shadow-drop);\n\n\t/**\n\t * A visual style of element's active shadow (i.e. comment or suggestion).\n\t */\n\t--ck-drop-shadow-active: 0 3px 6px 1px var(--ck-color-shadow-drop-active);\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-spacing-unit: \t\t\t\t\t\t0.6em;\n\t--ck-spacing-large: \t\t\t\t\tcalc(var(--ck-spacing-unit) * 1.5);\n\t--ck-spacing-standard: \t\t\t\t\tvar(--ck-spacing-unit);\n\t--ck-spacing-medium: \t\t\t\t\tcalc(var(--ck-spacing-unit) * 0.8);\n\t--ck-spacing-small: \t\t\t\t\tcalc(var(--ck-spacing-unit) * 0.5);\n\t--ck-spacing-tiny: \t\t\t\t\t\tcalc(var(--ck-spacing-unit) * 0.3);\n\t--ck-spacing-extra-tiny: \t\t\t\tcalc(var(--ck-spacing-unit) * 0.16);\n}\n"],sourceRoot:""}]);const a=r},507:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{background-color:var(--ck-color-widget-editable-focus-background);border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widget.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css"],names:[],mappings:"AAKA,MACC,+CAAgD,CAChD,6CAAsD,CACtD,uCAAgD,CAEhD,kDAAmD,CACnD,gCAAiC,CACjC,kEACD,CAOA,8DAEC,iBAqBD,CAnBC,4EACC,iBAOD,CALC,qFAGC,aACD,CASD,iLACC,kBACD,CAGD,kBACC,qDAAsD,CAEtD,qDAAsD,CACtD,6CAA8C,CAF9C,0CAA2C,CAI3C,aAAc,CADd,kCAAmC,CAGnC,uCAAwC,CACxC,4CAA6C,CAF7C,iCAsCD,CAlCC,8NAKC,iBACD,CAEA,0CAEC,qCAAsC,CADtC,oCAED,CAEA,2CAEC,sCAAuC,CADvC,oCAED,CAEA,8CACC,uCAAwC,CACxC,sCACD,CAEA,6CACC,uCAAwC,CACxC,qCACD,CAGA,8CAEC,QAAS,CADT,6CAAgD,CAEhD,yBACD,CCjFD,MACC,iCAAkC,CAClC,kCAAmC,CACnC,4CAA6C,CAC7C,wCAAyC,CAEzC,wCAAiD,CACjD,sCAAkD,CAClD,2EAA4E,CAC5E,yEACD,CAEA,eAGC,yBAA0B,CAD1B,mBAAoB,CADpB,gDAAiD,CAGjD,6GAUD,CARC,0EAEC,6EACD,CAEA,qBACC,iDACD,CAGD,gCACC,4BAWD,CAPC,yGAKC,iEAAkE,CCnCnE,2BAA2B,CCF3B,qCAA8B,CDC9B,YDqCA,CAIA,4EAKC,4BAA6B,CAa7B,iEAAkE,CAhBlE,qBAAsB,CAoBtB,mDAAoD,CAhBpD,SAAU,CALV,WAAY,CAsBZ,KAAM,CAFN,2BAA4B,CAT5B,6SAgCD,CAnBC,qFAIC,oDAAqD,CADrD,yCAA0C,CAD1C,wCAWD,CANC,kHACC,SAAU,CAGV,+DACD,CAID,wHACC,SACD,CAID,kFAEC,oDAAqD,CADrD,SAED,CAKC,oMAEC,6CAA8C,CAD9C,SAOD,CAHC,gRACC,SACD,CAOH,qFACC,SAAU,CACV,oDACD,CAGA,gDAEC,eAkBD,CAhBC,yEAOC,iCACD,CAGC,gOAEC,gDACD,CAOD,wIAEC,mDAQD,CALE,ghBAEC,gDACD,CAKH,yKAOC,yDACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-resizer: var(--ck-color-focus-border);\n\t--ck-color-resizer-tooltip-background: hsl(0, 0%, 15%);\n\t--ck-color-resizer-tooltip-text: hsl(0, 0%, 95%);\n\n\t--ck-resizer-border-radius: var(--ck-border-radius);\n\t--ck-resizer-tooltip-offset: 10px;\n\t--ck-resizer-tooltip-height: calc(var(--ck-spacing-small) * 2 + 10px);\n}\n\n.ck .ck-widget {\n\t/* This is neccessary for type around UI to be positioned properly. */\n\tposition: relative;\n}\n\n.ck .ck-widget.ck-widget_with-selection-handle {\n\t/* Make the widget wrapper a relative positioning container for the drag handle. */\n\tposition: relative;\n\n\t& .ck-widget__selection-handle {\n\t\tposition: absolute;\n\n\t\t& .ck-icon {\n\t\t\t/* Make sure the icon in not a subject to font-size or line-height to avoid\n\t\t\tunnecessary spacing around it. */\n\t\t\tdisplay: block;\n\t\t}\n\t}\n\n\t/* Show the selection handle on mouse hover over the widget, but not for nested widgets. */\n\t&:hover > .ck-widget__selection-handle {\n\t\tvisibility: visible;\n\t}\n\n\t/* Show the selection handle when the widget is selected, but not for nested widgets. */\n\t&.ck-widget_selected > .ck-widget__selection-handle {\n\t\tvisibility: visible;\n\t}\n}\n\n.ck .ck-size-view {\n\tbackground: var(--ck-color-resizer-tooltip-background);\n\tcolor: var(--ck-color-resizer-tooltip-text);\n\tborder: 1px solid var(--ck-color-resizer-tooltip-text);\n\tborder-radius: var(--ck-resizer-border-radius);\n\tfont-size: var(--ck-font-size-tiny);\n\tdisplay: block;\n\tpadding: 0 var(--ck-spacing-small);\n\theight: var(--ck-resizer-tooltip-height);\n\tline-height: var(--ck-resizer-tooltip-height);\n\n\t&.ck-orientation-top-left,\n\t&.ck-orientation-top-right,\n\t&.ck-orientation-bottom-right,\n\t&.ck-orientation-bottom-left,\n\t&.ck-orientation-above-center {\n\t\tposition: absolute;\n\t}\n\n\t&.ck-orientation-top-left {\n\t\ttop: var(--ck-resizer-tooltip-offset);\n\t\tleft: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t&.ck-orientation-top-right {\n\t\ttop: var(--ck-resizer-tooltip-offset);\n\t\tright: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t&.ck-orientation-bottom-right {\n\t\tbottom: var(--ck-resizer-tooltip-offset);\n\t\tright: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t&.ck-orientation-bottom-left {\n\t\tbottom: var(--ck-resizer-tooltip-offset);\n\t\tleft: var(--ck-resizer-tooltip-offset);\n\t}\n\n\t/* Class applied if the widget is too small to contain the size label */\n\t&.ck-orientation-above-center {\n\t\ttop: calc(var(--ck-resizer-tooltip-height) * -1);\n\t\tleft: 50%;\n\t\ttransform: translate(-50%);\n\t}\n}\n",'/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../mixins/_focus.css";\n@import "../mixins/_shadow.css";\n\n:root {\n\t--ck-widget-outline-thickness: 3px;\n\t--ck-widget-handler-icon-size: 16px;\n\t--ck-widget-handler-animation-duration: 200ms;\n\t--ck-widget-handler-animation-curve: ease;\n\n\t--ck-color-widget-blurred-border: hsl(0, 0%, 87%);\n\t--ck-color-widget-hover-border: hsl(43, 100%, 62%);\n\t--ck-color-widget-editable-focus-background: var(--ck-color-base-background);\n\t--ck-color-widget-drag-handler-icon-color: var(--ck-color-base-background);\n}\n\n.ck .ck-widget {\n\toutline-width: var(--ck-widget-outline-thickness);\n\toutline-style: solid;\n\toutline-color: transparent;\n\ttransition: outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\n\t&.ck-widget_selected,\n\t&.ck-widget_selected:hover {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border);\n\t}\n\n\t&:hover {\n\t\toutline-color: var(--ck-color-widget-hover-border);\n\t}\n}\n\n.ck .ck-editor__nested-editable {\n\tborder: 1px solid transparent;\n\n\t/* The :focus style is applied before .ck-editor__nested-editable_focused class is rendered in the view.\n\tThese styles show a different border for a blink of an eye, so `:focus` need to have same styles applied. */\n\t&.ck-editor__nested-editable_focused,\n\t&:focus {\n\t\t@mixin ck-focus-ring;\n\t\t@mixin ck-box-shadow var(--ck-inner-shadow);\n\n\t\tbackground-color: var(--ck-color-widget-editable-focus-background);\n\t}\n}\n\n.ck .ck-widget.ck-widget_with-selection-handle {\n\t& .ck-widget__selection-handle {\n\t\tpadding: 4px;\n\t\tbox-sizing: border-box;\n\n\t\t/* Background and opacity will be animated as the handler shows up or the widget gets selected. */\n\t\tbackground-color: transparent;\n\t\topacity: 0;\n\n\t\t/* Transition:\n\t\t * background-color for the .ck-widget_selected state change,\n\t\t * visibility for hiding the handler,\n\t\t * opacity for the proper look of the icon when the handler disappears. */\n\t\ttransition:\n\t\t\tbackground-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\n\t\t\tvisibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\n\t\t\topacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\n\t\t/* Make only top corners round. */\n\t\tborder-radius: var(--ck-border-radius) var(--ck-border-radius) 0 0;\n\n\t\t/* Place the drag handler outside the widget wrapper. */\n\t\ttransform: translateY(-100%);\n\t\tleft: calc(0px - var(--ck-widget-outline-thickness));\n\t\ttop: 0;\n\n\t\t& .ck-icon {\n\t\t\t/* Make sure the dimensions of the icon are independent of the fon-size of the content. */\n\t\t\twidth: var(--ck-widget-handler-icon-size);\n\t\t\theight: var(--ck-widget-handler-icon-size);\n\t\t\tcolor: var(--ck-color-widget-drag-handler-icon-color);\n\n\t\t\t/* The "selected" part of the icon is invisible by default */\n\t\t\t& .ck-icon__selected-indicator {\n\t\t\t\topacity: 0;\n\n\t\t\t\t/* Note: The animation is longer on purpose. Simply feels better. */\n\t\t\t\ttransition: opacity 300ms var(--ck-widget-handler-animation-curve);\n\t\t\t}\n\t\t}\n\n\t\t/* Advertise using the look of the icon that once clicked the handler, the widget will be selected. */\n\t\t&:hover .ck-icon .ck-icon__selected-indicator {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\t/* Show the selection handler on mouse hover over the widget, but not for nested widgets. */\n\t&:hover > .ck-widget__selection-handle {\n\t\topacity: 1;\n\t\tbackground-color: var(--ck-color-widget-hover-border);\n\t}\n\n\t/* Show the selection handler when the widget is selected, but not for nested widgets. */\n\t&.ck-widget_selected,\n\t&.ck-widget_selected:hover {\n\t\t& > .ck-widget__selection-handle {\n\t\t\topacity: 1;\n\t\t\tbackground-color: var(--ck-color-focus-border);\n\n\t\t\t/* When the widget is selected, notify the user using the proper look of the icon. */\n\t\t\t& .ck-icon .ck-icon__selected-indicator {\n\t\t\t\topacity: 1;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/* In a RTL environment, align the selection handler to the right side of the widget */\n/* stylelint-disable-next-line no-descending-specificity */\n.ck[dir="rtl"] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle {\n\tleft: auto;\n\tright: calc(0px - var(--ck-widget-outline-thickness));\n}\n\n/* https://github.com/ckeditor/ckeditor5/issues/6415 */\n.ck.ck-editor__editable.ck-read-only .ck-widget {\n\t/* Prevent the :hover outline from showing up because of the used outline-color transition. */\n\ttransition: none;\n\n\t&:not(.ck-widget_selected) {\n\t\t/* Disable visual effects of hover/active widget when CKEditor is in readOnly mode.\n\t\t * See: https://github.com/ckeditor/ckeditor5/issues/1261\n\t\t *\n\t\t * Leave the unit because this custom property is used in calc() by other features.\n\t\t * See: https://github.com/ckeditor/ckeditor5/issues/6775\n\t\t */\n\t\t--ck-widget-outline-thickness: 0px;\n\t}\n\n\t&.ck-widget_with-selection-handle {\n\t\t& .ck-widget__selection-handle,\n\t\t& .ck-widget__selection-handle:hover {\n\t\t\tbackground: var(--ck-color-widget-blurred-border);\n\t\t}\n\t}\n}\n\n/* Style the widget when it\'s selected but the editable it belongs to lost focus. */\n/* stylelint-disable-next-line no-descending-specificity */\n.ck.ck-editor__editable.ck-blurred .ck-widget {\n\t&.ck-widget_selected,\n\t&.ck-widget_selected:hover {\n\t\toutline-color: var(--ck-color-widget-blurred-border);\n\n\t\t&.ck-widget_with-selection-handle {\n\t\t\t& > .ck-widget__selection-handle,\n\t\t\t& > .ck-widget__selection-handle:hover {\n\t\t\t\tbackground: var(--ck-color-widget-blurred-border);\n\t\t\t}\n\t\t}\n\t}\n}\n\n.ck.ck-editor__editable > .ck-widget.ck-widget_with-selection-handle:first-child,\n.ck.ck-editor__editable blockquote > .ck-widget.ck-widget_with-selection-handle:first-child {\n\t/* Do not crop selection handler if a widget is a first-child in the blockquote or in the root editable.\n\tIn fact, anything with overflow: hidden.\n\thttps://github.com/ckeditor/ckeditor5-block-quote/issues/28\n\thttps://github.com/ckeditor/ckeditor5-widget/issues/44\n\thttps://github.com/ckeditor/ckeditor5-widget/issues/66 */\n\tmargin-top: calc(1em + var(--ck-widget-handler-icon-size));\n}\n',"/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A visual style of focused element's border.\n */\n@define-mixin ck-focus-ring {\n\t/* Disable native outline. */\n\toutline: none;\n\tborder: var(--ck-focus-ring)\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * A helper to combine multiple shadows.\n */\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\n\tbox-shadow: $shadowA, $shadowB;\n}\n\n/**\n * Gives an element a drop shadow so it looks like a floating panel.\n */\n@define-mixin ck-drop-shadow {\n\t@mixin ck-box-shadow var(--ck-drop-shadow);\n}\n"],sourceRoot:""}]);const a=r},263:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgetresize.css"],names:[],mappings:"AAKA,4BAEC,iBACD,CAEA,wBACC,YAAa,CAMb,MAAO,CAFP,mBAAoB,CAHpB,iBAAkB,CAMlB,KACD,CAGC,2EACC,aACD,CAGD,gCAIC,kBAAmB,CAHnB,iBAcD,CATC,4IAEC,kBACD,CAEA,4IAEC,kBACD,CCpCD,MACC,sBAAuB,CAGvB,yDAAiE,CACjE,6BACD,CAEA,wBACC,yCACD,CAEA,gCAGC,uCAAwC,CACxC,gDAA6D,CAC7D,6CAA8C,CAH9C,6BAA8B,CAD9B,4BAyBD,CAnBC,oEAEC,6BAA8B,CAD9B,4BAED,CAEA,qEAEC,8BAA+B,CAD/B,4BAED,CAEA,wEACC,+BAAgC,CAChC,8BACD,CAEA,uEACC,+BAAgC,CAChC,6BACD",sourcesContent:["/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-widget_with-resizer {\n\t/* Make the widget wrapper a relative positioning container for the drag handle. */\n\tposition: relative;\n}\n\n.ck .ck-widget__resizer {\n\tdisplay: none;\n\tposition: absolute;\n\n\t/* The wrapper itself should not interfere with the pointer device, only the handles should. */\n\tpointer-events: none;\n\n\tleft: 0;\n\ttop: 0;\n}\n\n.ck-focused .ck-widget_with-resizer.ck-widget_selected {\n\t& > .ck-widget__resizer {\n\t\tdisplay: block;\n\t}\n}\n\n.ck .ck-widget__resizer__handle {\n\tposition: absolute;\n\n\t/* Resizers are the only UI elements that should interfere with a pointer device. */\n\tpointer-events: all;\n\n\t&.ck-widget__resizer__handle-top-left,\n\t&.ck-widget__resizer__handle-bottom-right {\n\t\tcursor: nwse-resize;\n\t}\n\n\t&.ck-widget__resizer__handle-top-right,\n\t&.ck-widget__resizer__handle-bottom-left {\n\t\tcursor: nesw-resize;\n\t}\n}\n","/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-resizer-size: 10px;\n\n\t/* Set the resizer with a 50% offset. */\n\t--ck-resizer-offset: calc( ( var(--ck-resizer-size) / -2 ) - 2px);\n\t--ck-resizer-border-width: 1px;\n}\n\n.ck .ck-widget__resizer {\n\toutline: 1px solid var(--ck-color-resizer);\n}\n\n.ck .ck-widget__resizer__handle {\n\twidth: var(--ck-resizer-size);\n\theight: var(--ck-resizer-size);\n\tbackground: var(--ck-color-focus-border);\n\tborder: var(--ck-resizer-border-width) solid hsl(0, 0%, 100%);\n\tborder-radius: var(--ck-resizer-border-radius);\n\n\t&.ck-widget__resizer__handle-top-left {\n\t\ttop: var(--ck-resizer-offset);\n\t\tleft: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-top-right {\n\t\ttop: var(--ck-resizer-offset);\n\t\tright: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-bottom-right {\n\t\tbottom: var(--ck-resizer-offset);\n\t\tright: var(--ck-resizer-offset);\n\t}\n\n\t&.ck-widget__resizer__handle-bottom-left {\n\t\tbottom: var(--ck-resizer-offset);\n\t\tleft: var(--ck-resizer-offset);\n\t}\n}\n"],sourceRoot:""}]);const a=r},137:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(15),s=n.n(i),o=n(645),r=n.n(o)()(s());r.push([e.id,'.ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);width:var(--ck-widget-type-around-button-size)}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgettypearound.css"],names:[],mappings:"AASC,+CACC,aAAc,CAEd,eAAgB,CADhB,iBAAkB,CAElB,2BAwBD,CAtBC,mDAGC,QAAS,CAFT,iBAAkB,CAClB,OAAQ,CAER,qCACD,CAEA,qFAGC,kBAAoB,CADpB,gDAAoD,CAGpD,0BACD,CAEA,oFAEC,mDAAuD,CACvD,mBAAqB,CAErB,yBACD,CAUA,mLACC,UAAW,CACX,aAAc,CAGd,QAAS,CAFT,iBAAkB,CAClB,OAAQ,CAER,qCACD,CAMD,2EACC,YAAa,CAEb,MAAO,CADP,iBAAkB,CAElB,OACD,CAOA,iFACC,gDAAqD,CACrD,iDACD,CAKA,wHAEC,aAAc,CADd,qDAED,CAKA,uHACC,wDAA6D,CAC7D,aACD,CAoBD,mOACC,YACD,CC3GA,MACC,wCAAyC,CACzC,wEAAyE,CACzE,8EAA+E,CAC/E,2FAA4F,CAC5F,wDAAyD,CACzD,uDAAwD,CACxD,yEACD,CAgBC,+CAGC,oDAAqD,CACrD,mBAAoB,CAFpB,+CAAgD,CAVjD,SAAU,CACV,mBAAoB,CAYnB,uMAAyM,CAJzM,8CAkDD,CA1CC,mDAEC,UAAW,CAGX,cAAe,CAFf,8BAA+B,CAC/B,6BAA8B,CAH9B,UAoBD,CAdC,qDACC,mBAAoB,CACpB,mBAAoB,CAEpB,SAAU,CACV,qDAAsD,CACtD,kBAAmB,CACnB,oBAAqB,CACrB,qBACD,CAEA,wDACC,kBACD,CAGD,qDAIC,6DAcD,CARE,kEACC,oDACD,CAEA,8DACC,wDACD,CAUF,uKAvED,SAAU,CACV,mBAwEC,CAOD,gGACC,0DACD,CAOA,uKAEC,2DAQD,CANC,mLAIC,uEAAkF,CADlF,mBAAoB,CADpB,2DAA4D,CAD5D,0DAID,CAOD,8GACC,gBACD,CAKA,mDAGC,mFAAoF,CAOpF,oCAAqC,CARrC,UAAW,CAOX,oCAAwC,CARxC,mBAUD,CAOC,6JAEC,yBACD,CAUA,yKACC,iDACD,CAMA,uOAlJD,SAAU,CACV,mBAmJC,CASE,0jBACC,SACD,CASF,mPACC,SACD,CASF,uHACC,aAAc,CACd,iBACD,CAYG,iRAlMF,SAAU,CACV,mBAmME,CAQH,kIACC,qEAKD,CAHC,wIACC,WACD,CAGD,4CACC,GACC,oBACD,CACA,OACC,mBACD,CACD,CAEA,gDACC,OACC,mBACD,CACA,OACC,mBACD,CACD,CAEA,8CACC,GACC,6HACD,CACA,IACC,6HACD,CACA,GACC,+HACD,CACD,CAEA,kDACC,GACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,GACC,SACD,CACD",sourcesContent:['/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-widget {\n\t/*\n\t * Styles of the type around buttons\n\t */\n\t& .ck-widget__type-around__button {\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\toverflow: hidden;\n\t\tz-index: var(--ck-z-default);\n\n\t\t& svg {\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: 50%;\n\t\t\tz-index: calc(var(--ck-z-default) + 2);\n\t\t}\n\n\t\t&.ck-widget__type-around__button_before {\n\t\t\t/* Place it in the middle of the outline */\n\t\t\ttop: calc(-0.5 * var(--ck-widget-outline-thickness));\n\t\t\tleft: min(10%, 30px);\n\n\t\t\ttransform: translateY(-50%);\n\t\t}\n\n\t\t&.ck-widget__type-around__button_after {\n\t\t\t/* Place it in the middle of the outline */\n\t\t\tbottom: calc(-0.5 * var(--ck-widget-outline-thickness));\n\t\t\tright: min(10%, 30px);\n\n\t\t\ttransform: translateY(50%);\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the buttons when:\n\t * - the widget is selected,\n\t * - or the button is being hovered (regardless of the widget state).\n\t */\n\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\n\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\n\t\t&::after {\n\t\t\tcontent: "";\n\t\t\tdisplay: block;\n\t\t\tposition: absolute;\n\t\t\ttop: 1px;\n\t\t\tleft: 1px;\n\t\t\tz-index: calc(var(--ck-z-default) + 1);\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the horizontal "fake caret" which is displayed when the user navigates using the keyboard.\n\t */\n\t& > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\tdisplay: none;\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t}\n\n\t/*\n\t * When the widget is hovered the "fake caret" would normally be narrower than the\n\t * extra outline displayed around the widget. Let\'s extend the "fake caret" to match\n\t * the full width of the widget.\n\t */\n\t&:hover > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\tleft: calc( -1 * var(--ck-widget-outline-thickness) );\n\t\tright: calc( -1 * var(--ck-widget-outline-thickness) );\n\t}\n\n\t/*\n\t * Styles for the horizontal "fake caret" when it should be displayed before the widget (backward keyboard navigation).\n\t */\n\t&.ck-widget_type-around_show-fake-caret_before > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\ttop: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\n\t\tdisplay: block;\n\t}\n\n\t/*\n\t * Styles for the horizontal "fake caret" when it should be displayed after the widget (forward keyboard navigation).\n\t */\n\t&.ck-widget_type-around_show-fake-caret_after > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\n\t\tbottom: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\n\t\tdisplay: block;\n\t}\n}\n\n/*\n * Integration with the read-only mode of the editor.\n */\n.ck.ck-editor__editable.ck-read-only .ck-widget__type-around {\n\tdisplay: none;\n}\n\n/*\n * Integration with the restricted editing mode (feature) of the editor.\n */\n.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around {\n\tdisplay: none;\n}\n\n/*\n * Integration with the #isEnabled property of the WidgetTypeAround plugin.\n */\n.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around {\n\tdisplay: none;\n}\n','/*\n * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-widget-type-around-button-size: 20px;\n\t--ck-color-widget-type-around-button-active: var(--ck-color-focus-border);\n\t--ck-color-widget-type-around-button-hover: var(--ck-color-widget-hover-border);\n\t--ck-color-widget-type-around-button-blurred-editable: var(--ck-color-widget-blurred-border);\n\t--ck-color-widget-type-around-button-radar-start-alpha: 0;\n\t--ck-color-widget-type-around-button-radar-end-alpha: .3;\n\t--ck-color-widget-type-around-button-icon: var(--ck-color-base-background);\n}\n\n@define-mixin ck-widget-type-around-button-visible {\n\topacity: 1;\n\tpointer-events: auto;\n}\n\n@define-mixin ck-widget-type-around-button-hidden {\n\topacity: 0;\n\tpointer-events: none;\n}\n\n.ck .ck-widget {\n\t/*\n\t * Styles of the type around buttons\n\t */\n\t& .ck-widget__type-around__button {\n\t\twidth: var(--ck-widget-type-around-button-size);\n\t\theight: var(--ck-widget-type-around-button-size);\n\t\tbackground: var(--ck-color-widget-type-around-button);\n\t\tborder-radius: 100px;\n\t\ttransition: opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve), background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\n\n\t\t@mixin ck-widget-type-around-button-hidden;\n\n\t\t& svg {\n\t\t\twidth: 10px;\n\t\t\theight: 8px;\n\t\t\ttransform: translate(-50%,-50%);\n\t\t\ttransition: transform .5s ease;\n\t\t\tmargin-top: 1px;\n\n\t\t\t& * {\n\t\t\t\tstroke-dasharray: 10;\n\t\t\t\tstroke-dashoffset: 0;\n\n\t\t\t\tfill: none;\n\t\t\t\tstroke: var(--ck-color-widget-type-around-button-icon);\n\t\t\t\tstroke-width: 1.5px;\n\t\t\t\tstroke-linecap: round;\n\t\t\t\tstroke-linejoin: round;\n\t\t\t}\n\n\t\t\t& line {\n\t\t\t\tstroke-dasharray: 7;\n\t\t\t}\n\t\t}\n\n\t\t&:hover {\n\t\t\t/*\n\t\t\t * Display the "sonar" around the button when hovered.\n\t\t\t */\n\t\t\tanimation: ck-widget-type-around-button-sonar 1s ease infinite;\n\n\t\t\t/*\n\t\t\t * Animate active button\'s icon.\n\t\t\t */\n\t\t\t& svg {\n\t\t\t\t& polyline {\n\t\t\t\t\tanimation: ck-widget-type-around-arrow-dash 2s linear;\n\t\t\t\t}\n\n\t\t\t\t& line {\n\t\t\t\t\tanimation: ck-widget-type-around-arrow-tip-dash 2s linear;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * Show type around buttons when the widget gets selected or being hovered.\n\t */\n\t&.ck-widget_selected,\n\t&:hover {\n\t\t& > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\t\t@mixin ck-widget-type-around-button-visible;\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the buttons when the widget is NOT selected (but the buttons are visible\n\t * and still can be hovered).\n\t */\n\t&:not(.ck-widget_selected) > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\tbackground: var(--ck-color-widget-type-around-button-hover);\n\t}\n\n\t/*\n\t * Styles for the buttons when:\n\t * - the widget is selected,\n\t * - or the button is being hovered (regardless of the widget state).\n\t */\n\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\n\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\n\t\tbackground: var(--ck-color-widget-type-around-button-active);\n\n\t\t&::after {\n\t\t\twidth: calc(var(--ck-widget-type-around-button-size) - 2px);\n\t\t\theight: calc(var(--ck-widget-type-around-button-size) - 2px);\n\t\t\tborder-radius: 100px;\n\t\t\tbackground: linear-gradient(135deg, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,.3) 100%);\n\t\t}\n\t}\n\n\t/*\n\t * Styles for the "before" button when the widget has a selection handle. Because some space\n\t * is consumed by the handle, the button must be moved slightly to the right to let it breathe.\n\t */\n\t&.ck-widget_with-selection-handle > .ck-widget__type-around > .ck-widget__type-around__button_before {\n\t\tmargin-left: 20px;\n\t}\n\n\t/*\n\t * Styles for the horizontal "fake caret" which is displayed when the user navigates using the keyboard.\n\t */\n\t& .ck-widget__type-around__fake-caret {\n\t\tpointer-events: none;\n\t\theight: 1px;\n\t\tanimation: ck-widget-type-around-fake-caret-pulse linear 1s infinite normal forwards;\n\n\t\t/*\n\t\t * The semi-transparent-outline+background combo improves the contrast\n\t\t * when the background underneath the fake caret is dark.\n\t\t */\n\t\toutline: solid 1px hsla(0, 0%, 100%, .5);\n\t\tbackground: var(--ck-color-base-text);\n\t}\n\n\t/*\n\t * Styles of the widget when the "fake caret" is blinking (e.g. upon keyboard navigation).\n\t * Despite the widget being physically selected in the model, its outline should disappear.\n\t */\n\t&.ck-widget_selected {\n\t\t&.ck-widget_type-around_show-fake-caret_before,\n\t\t&.ck-widget_type-around_show-fake-caret_after {\n\t\t\toutline-color: transparent;\n\t\t}\n\t}\n\n\t&.ck-widget_type-around_show-fake-caret_before,\n\t&.ck-widget_type-around_show-fake-caret_after {\n\t\t/*\n\t\t * When the "fake caret" is visible we simulate that the widget is not selected\n\t\t * (despite being physically selected), so the outline color should be for the\n\t\t * unselected widget.\n\t\t */\n\t\t&.ck-widget_selected:hover {\n\t\t\toutline-color: var(--ck-color-widget-hover-border);\n\t\t}\n\n\t\t/*\n\t\t * Styles of the type around buttons when the "fake caret" is blinking (e.g. upon keyboard navigation).\n\t\t * In this state, the type around buttons would collide with the fake carets so they should disappear.\n\t\t */\n\t\t& > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\t\t@mixin ck-widget-type-around-button-hidden;\n\t\t}\n\n\t\t/*\n\t\t * Fake horizontal caret integration with the selection handle. When the caret is visible, simply\n\t\t * hide the handle because it intersects with the caret (and does not make much sense anyway).\n\t\t */\n\t\t&.ck-widget_with-selection-handle {\n\t\t\t&.ck-widget_selected,\n\t\t\t&.ck-widget_selected:hover {\n\t\t\t\t& > .ck-widget__selection-handle {\n\t\t\t\t\topacity: 0\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Fake horizontal caret integration with the resize UI. When the caret is visible, simply\n\t\t * hide the resize UI because it creates too much noise. It can be visible when the user\n\t\t * hovers the widget, though.\n\t\t */\n\t\t&.ck-widget_selected.ck-widget_with-resizer > .ck-widget__resizer {\n\t\t\topacity: 0\n\t\t}\n\t}\n}\n\n/*\n * Styles for the "before" button when the widget has a selection handle in an RTL environment.\n * The selection handler is aligned to the right side of the widget so there is no need to create\n * additional space for it next to the "before" button.\n */\n.ck[dir="rtl"] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around > .ck-widget__type-around__button_before {\n\tmargin-left: 0;\n\tmargin-right: 20px;\n}\n\n/*\n * Hide type around buttons when the widget is selected as a child of a selected\n * nested editable (e.g. mulit-cell table selection).\n *\n * See https://github.com/ckeditor/ckeditor5/issues/7263.\n */\n.ck-editor__nested-editable.ck-editor__editable_selected {\n\t& .ck-widget {\n\t\t&.ck-widget_selected,\n\t\t&:hover {\n\t\t\t& > .ck-widget__type-around > .ck-widget__type-around__button {\n\t\t\t\t@mixin ck-widget-type-around-button-hidden;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/*\n * Styles for the buttons when the widget is selected but the user clicked outside of the editor (blurred the editor).\n */\n.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button:not(:hover) {\n\tbackground: var(--ck-color-widget-type-around-button-blurred-editable);\n\n\t& svg * {\n\t\tstroke: hsl(0,0%,60%);\n\t}\n}\n\n@keyframes ck-widget-type-around-arrow-dash {\n\t0% {\n\t\tstroke-dashoffset: 10;\n\t}\n\t20%, 100% {\n\t\tstroke-dashoffset: 0;\n\t}\n}\n\n@keyframes ck-widget-type-around-arrow-tip-dash {\n\t0%, 20% {\n\t\tstroke-dashoffset: 7;\n\t}\n\t40%, 100% {\n\t\tstroke-dashoffset: 0;\n\t}\n}\n\n@keyframes ck-widget-type-around-button-sonar {\n\t0% {\n\t\tbox-shadow: 0 0 0 0 hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\n\t}\n\t50% {\n\t\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-end-alpha));\n\t}\n\t100% {\n\t\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\n\t}\n}\n\n@keyframes ck-widget-type-around-fake-caret-pulse {\n\t0% {\n\t\topacity: 1;\n\t}\n\t49% {\n\t\topacity: 1;\n\t}\n\t50% {\n\t\topacity: 0;\n\t}\n\t99% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n'],sourceRoot:""}]);const a=r},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n}).join("")},t.i=function(e,n,i){"string"==typeof e&&(e=[[null,e,""]]);var s={};if(i)for(var o=0;o{function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var i,s,o=[],r=!0,a=!1;try{for(n=n.call(e);!(r=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);r=!0);}catch(e){a=!0,s=e}finally{try{r||null==n.return||n.return()}finally{if(a)throw s}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n{var i=function(){var e;return function(){return void 0===e&&(e=Boolean(window&&document&&document.all&&!window.atob)),e}}(),s=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),o=[];function r(e){for(var t=-1,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{o.d(r,{default:()=>kx});class i{constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}}}const s=new Array(256).fill().map((e,t)=>("0"+t.toString(16)).slice(-2));function a(){const e=4294967296*Math.random()>>>0,t=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0;return"e"+s[255&e]+s[e>>8&255]+s[e>>16&255]+s[e>>24&255]+s[255&t]+s[t>>8&255]+s[t>>16&255]+s[t>>24&255]+s[255&n]+s[n>>8&255]+s[n>>16&255]+s[n>>24&255]+s[255&i]+s[i>>8&255]+s[i>>16&255]+s[i>>24&255]}const l={get(e){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},d=l;function c(e,t){const n=d.get(t.priority);for(let i=0;i{if("object"==typeof t&&null!==t){if(n.has(t))return`[object ${t.constructor.name}]`;n.add(t)}return t})}`:"";return e+i+m(e)}(e,n)),this.name="CKEditorError",this.context=t,this.data=n}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const n=new u(e.message,t);throw n.stack=e.stack,n}}function h(e,t){console.warn(...function(e,t){const n=m(e);return t?[e,t,n]:[e,n]}(e,t))}function m(e){return`\nRead more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-${e}`}const g="object"==typeof window?window:o.g;if(g.CKEDITOR_VERSION)throw new u("ckeditor-duplicated-modules",null);g.CKEDITOR_VERSION="34.0.0";const p=Symbol("listeningTo"),f=Symbol("emitterId"),x={on(e,t,n={}){this.listenTo(this,e,t,n)},once(e,t,n){let i=!1;this.listenTo(this,e,function(e,...n){i||(i=!0,e.off(),t.call(this,e,...n))},n)},off(e,t){this.stopListening(this,e,t)},listenTo(e,t,n,i={}){let s,o;this[p]||(this[p]={});const r=this[p];v(e)||I(e);const a=v(e);(s=r[a])||(s=r[a]={emitter:e,callbacks:{}}),(o=s.callbacks[t])||(o=s.callbacks[t]=[]),o.push(n),function(e,t,n,i,s){t._addEventListener?t._addEventListener(n,i,s):e._addEventListener.call(t,n,i,s)}(this,e,t,n,i)},stopListening(e,t,n){const i=this[p];let s=e&&v(e);const o=i&&s&&i[s],r=o&&t&&o.callbacks[t];if(!(!i||e&&!o||t&&!r))if(n)A(this,e,t,n),-1!==r.indexOf(n)&&(1===r.length?delete o.callbacks[t]:A(this,e,t,n));else if(r){for(;n=r.pop();)A(this,e,t,n);delete o.callbacks[t]}else if(o){for(t in o.callbacks)this.stopListening(e,t);delete i[s]}else{for(s in i)this.stopListening(i[s].emitter);delete this[p]}},fire(e,...t){try{const n=e instanceof i?e:new i(this,e),s=n.name;let o=y(this,s);if(n.path.push(this),o){const e=[n,...t];o=Array.from(o);for(let t=0;t{this._delegations||(this._delegations=new Map),e.forEach(e=>{const i=this._delegations.get(e);i?i.set(t,n):this._delegations.set(e,new Map([[t,n]]))})}}},stopDelegating(e,t){if(this._delegations)if(e)if(t){const n=this._delegations.get(e);n&&n.delete(t)}else this._delegations.delete(e);else this._delegations.clear()},_addEventListener(e,t,n){!function(e,t){const n=b(e);if(n[t])return;let i=t,s=null;const o=[];for(;""!==i&&!n[i];)n[i]=j(),o.push(n[i]),s&&n[i].childEvents.push(s),s=i,i=i.substr(0,i.lastIndexOf(":"));if(""!==i){for(const e of o)e.callbacks=n[i].callbacks.slice();n[i].childEvents.push(s)}}(this,e);const i=C(this,e),s={callback:t,priority:d.get(n.priority)};for(const e of i)c(e,s)},_removeEventListener(e,t){const n=C(this,e);for(const e of n)for(let n=0;n-1?y(e,t.substr(0,t.lastIndexOf(":"))):null}function k(e,t,n){for(let[s,o]of e){o?"function"==typeof o&&(o=o(t.name)):o=t.name;const e=new i(t.source,o);e.path=[...t.path],s.fire(e,...n)}}function A(e,t,n,i){t._removeEventListener?t._removeEventListener(n,i):e._removeEventListener.call(t,n,i)}const w=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},S="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var E="object"==typeof self&&self&&self.Object===Object&&self;const T=S||E||Function("return this")(),z=T.Symbol;var O=Object.prototype,R=O.hasOwnProperty,$=O.toString,D=z?z.toStringTag:void 0;var P=Object.prototype.toString;var F=z?z.toStringTag:void 0;const M=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=R.call(e,D),n=e[D];try{e[D]=void 0;var i=!0}catch(e){}var s=$.call(e);return i&&(t?e[D]=n:delete e[D]),s}(e):function(e){return P.call(e)}(e)},N=function(e){if(!w(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},L=T["__core-js_shared__"];var B=function(){var e=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var V=Function.prototype.toString;const U=function(e){if(null!=e){try{return V.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var W=/^\[object .+?Constructor\]$/,G=Function.prototype,H=Object.prototype,q=G.toString,Y=H.hasOwnProperty,K=RegExp("^"+q.call(Y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Z=function(e){return!(!w(e)||function(e){return!!B&&B in e}(e))&&(N(e)?K:W).test(U(e))},X=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Z(n)?n:void 0};var J=function(){try{var e=X(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const Q=J,ee=function(e,t,n){"__proto__"==t&&Q?Q(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},te=function(e,t){return e===t||e!=e&&t!=t};var ne=Object.prototype.hasOwnProperty;const ie=function(e,t,n){var i=e[t];ne.call(e,t)&&te(i,n)&&(void 0!==n||t in e)||ee(e,t,n)},se=function(e,t,n,i){var s=!n;n||(n={});for(var o=-1,r=t.length;++o0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(de),he=function(e,t){return ue(function(e,t,n){return t=re(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,o=re(i.length-t,0),r=Array(o);++s-1&&e%1==0&&e<=9007199254740991},ge=function(e){return null!=e&&me(e.length)&&!N(e)};var pe=/^(?:0|[1-9]\d*)$/;const fe=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&pe.test(e))&&e>-1&&e%1==0&&e1?n[s-1]:void 0,r=s>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(s--,o):void 0,r&&function(e,t,n){if(!w(n))return!1;var i=typeof t;return!!("number"==i?ge(n)&&fe(t,n.length):"string"==i&&t in n)&&te(n[t],e)}(n[0],n[1],r)&&(o=s<3?void 0:o,s=1),t=Object(t);++i{this.set(t,e[t])},this);et(this);const n=this[qe];if(e in this&&!n.has(e))throw new u("observable-set-cannot-override",this);Object.defineProperty(this,e,{enumerable:!0,configurable:!0,get:()=>n.get(e),set(t){const i=n.get(e);let s=this.fire("set:"+e,e,t,i);void 0===s&&(s=t),i===s&&n.has(e)||(n.set(e,s),this.fire("change:"+e,e,s,i))}}),this[e]=t},bind(...e){if(!e.length||!it(e))throw new u("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new u("observable-bind-duplicate-properties",this);et(this);const t=this[Ke];e.forEach(e=>{if(t.has(e))throw new u("observable-bind-rebind",this)});const n=new Map;return e.forEach(e=>{const i={property:e,to:[]};t.set(e,i),n.set(e,i)}),{to:tt,toMany:nt,_observable:this,_bindProperties:e,_to:[],_bindings:n}},unbind(...e){if(!this[qe])return;const t=this[Ke],n=this[Ye];if(e.length){if(!it(e))throw new u("observable-unbind-wrong-properties",this);e.forEach(e=>{const i=t.get(e);if(!i)return;let s,o,r,a;i.to.forEach(e=>{s=e[0],o=e[1],r=n.get(s),a=r[o],a.delete(i),a.size||delete r[o],Object.keys(r).length||(n.delete(s),this.stopListening(s,"change"))}),t.delete(e)})}else n.forEach((e,t)=>{this.stopListening(t,"change")}),n.clear(),t.clear()},decorate(e){const t=this[e];if(!t)throw new u("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,(e,n)=>{e.return=t.apply(this,n)}),this[e]=function(...t){return this.fire(e,t)},this[e][Xe]=t,this[Ze]||(this[Ze]=[]),this[Ze].push(e)}};He(Je,_),Je.stopListening=function(e,t,n){if(!e&&this[Ze]){for(const e of this[Ze])this[e]=this[e][Xe];delete this[Ze]}_.stopListening.call(this,e,t,n)};const Qe=Je;function et(e){e[qe]||(Object.defineProperty(e,qe,{value:new Map}),Object.defineProperty(e,Ye,{value:new Map}),Object.defineProperty(e,Ke,{value:new Map}))}function tt(...e){const t=function(...e){if(!e.length)throw new u("observable-bind-to-parse-error",null);const t={to:[]};let n;return"function"==typeof e[e.length-1]&&(t.callback=e.pop()),e.forEach(e=>{if("string"==typeof e)n.properties.push(e);else{if("object"!=typeof e)throw new u("observable-bind-to-parse-error",null);n={observable:e,properties:[]},t.to.push(n)}}),t}(...e),n=Array.from(this._bindings.keys()),i=n.length;if(!t.callback&&t.to.length>1)throw new u("observable-bind-to-no-callback",this);if(i>1&&t.callback)throw new u("observable-bind-to-extra-callback",this);t.to.forEach(e=>{if(e.properties.length&&e.properties.length!==i)throw new u("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(n[0]).callback=t.callback),function(e,t){t.forEach(t=>{const n=e[Ye];let i;n.get(t.observable)||e.listenTo(t.observable,"change",(s,o)=>{i=n.get(t.observable)[o],i&&i.forEach(t=>{st(e,t.property)})})})}(this._observable,this._to),function(e){let t;e._bindings.forEach((n,i)=>{e._to.forEach(s=>{t=s.properties[n.callback?0:e._bindProperties.indexOf(i)],n.to.push([s.observable,t]),function(e,t,n,i){const s=e[Ye],o=s.get(n),r=o||{};r[i]||(r[i]=new Set),r[i].add(t),o||s.set(n,r)}(e._observable,n,s.observable,t)})})}(this),this._bindProperties.forEach(e=>{st(this._observable,e)})}function nt(e,t,n){if(this._bindings.size>1)throw new u("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const n=e.map(e=>[e,t]);return Array.prototype.concat.apply([],n)}(e,t),n)}function it(e){return e.every(e=>"string"==typeof e)}function st(e,t){const n=e[Ke].get(t);let i;n.callback?i=n.callback.apply(e,n.to.map(e=>e[0][e[1]])):(i=n.to[0],i=i[0][i[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=i:e.set(t,i)}function ot(e,...t){t.forEach(t=>{Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)).forEach(n=>{if(n in e.prototype)return;const i=Object.getOwnPropertyDescriptor(t,n);i.enumerable=!1,Object.defineProperty(e.prototype,n,i)})})}class rt{constructor(e){this.editor=e,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",at,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",at),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function at(e){e.return=!1,e.stop()}ot(rt,Qe);class lt{constructor(e){this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this.affectsData=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",e=>{this.isEnabled||e.stop()},{priority:"high"}),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n&&this.affectsData?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",dt,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",dt),this.refresh())}execute(){}destroy(){this.stopListening()}}function dt(e){e.return=!1,e.stop()}ot(lt,Qe);const ct=function(e,t){return function(n){return e(t(n))}},ut=ct(Object.getPrototypeOf,Object);var ht=Function.prototype,mt=Object.prototype,gt=ht.toString,pt=mt.hasOwnProperty,ft=gt.call(Object);const xt=function(e){if(!_e(e)||"[object Object]"!=M(e))return!1;var t=ut(e);if(null===t)return!0;var n=pt.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&>.call(n)==ft},_t=function(e,t){for(var n=e.length;n--;)if(te(e[n][0],t))return n;return-1};var It=Array.prototype.splice;function vt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},vt.prototype.set=function(e,t){var n=this.__data__,i=_t(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};const bt=vt,jt=X(T,"Map"),Ct=X(Object,"create");var yt=Object.prototype.hasOwnProperty;var kt=Object.prototype.hasOwnProperty;function At(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{this._setToTarget(e,i,t[i],n)})}}function Ln(e){return Fn(e,Bn)}function Bn(e){return Mn(e)?e:void 0}function Vn(e){return!(!e||!e[Symbol.iterator])}class Un{constructor(e={},t={}){const n=Vn(e);if(n||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],n)for(const t of e)this._items.push(t),this._itemMap.set(this._getItemIdBeforeAdding(t),t)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(void 0===t)t=this._items.length;else if(t>this._items.length||t<0)throw new u("collection-add-item-invalid-index",this);for(let n=0;n{this._setUpBindToBinding(t=>new e(t))},using:e=>{"function"==typeof e?this._setUpBindToBinding(t=>e(t)):this._setUpBindToBinding(t=>t[e])}}}_setUpBindToBinding(e){const t=this._bindToCollection,n=(n,i,s)=>{const o=t._bindToCollection==this,r=t._bindToInternalToExternalMap.get(i);if(o&&r)this._bindToExternalToInternalMap.set(i,r),this._bindToInternalToExternalMap.set(r,i);else{const n=e(i);if(!n)return void this._skippedIndexesFromExternal.push(s);let o=s;for(const e of this._skippedIndexesFromExternal)s>e&&o--;for(const e of t._skippedIndexesFromExternal)o>=e&&o++;this._bindToExternalToInternalMap.set(i,n),this._bindToInternalToExternalMap.set(n,i),this.add(n,o);for(let e=0;e{const i=this._bindToExternalToInternalMap.get(t);i&&this.remove(i),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((e,t)=>(nt&&e.push(t),e),[])})}_getItemIdBeforeAdding(e){const t=this._idProperty;let n;if(t in e){if(n=e[t],"string"!=typeof n)throw new u("collection-add-invalid-id",this);if(this.get(n))throw new u("collection-add-item-already-exists",this)}else e[t]=n=a();return n}_remove(e){let t,n,i,s=!1;const o=this._idProperty;if("string"==typeof e?(n=e,i=this._itemMap.get(n),s=!i,i&&(t=this._items.indexOf(i))):"number"==typeof e?(t=e,i=this._items[t],s=!i,i&&(n=i[o])):(i=e,n=i[o],t=this._items.indexOf(i),s=-1==t||!this._itemMap.get(n)),s)throw new u("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(n);const r=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap.delete(i),this._bindToExternalToInternalMap.delete(r),this.fire("remove",i,t),[i,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}ot(Un,_);class Wn{constructor(e,t=[],n=[]){this._context=e,this._plugins=new Map,this._availablePlugins=new Map;for(const e of t)e.pluginName&&this._availablePlugins.set(e.pluginName,e);this._contextPlugins=new Map;for(const[e,t]of n)this._contextPlugins.set(e,t),this._contextPlugins.set(t,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new u("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}init(e,t=[],n=[]){const i=this,s=this._context;!function e(t,n=new Set){t.forEach(t=>{a(t)&&(n.has(t)||(n.add(t),t.pluginName&&!i._availablePlugins.has(t.pluginName)&&i._availablePlugins.set(t.pluginName,t),t.requires&&e(t.requires,n)))})}(e),h(e);const o=[...function e(t,n=new Set){return t.map(e=>a(e)?e:i._availablePlugins.get(e)).reduce((t,i)=>n.has(i)?t:(n.add(i),i.requires&&(h(i.requires,i),e(i.requires,n).forEach(e=>t.add(e))),t.add(i)),new Set)}(e.filter(e=>!d(e,t)))];!function(e,t){for(const n of t){if("function"!=typeof n)throw new u("plugincollection-replace-plugin-invalid-type",null,{pluginItem:n});const t=n.pluginName;if(!t)throw new u("plugincollection-replace-plugin-missing-name",null,{pluginItem:n});if(n.requires&&n.requires.length)throw new u("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:t});const s=i._availablePlugins.get(t);if(!s)throw new u("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:t});const o=e.indexOf(s);if(-1===o){if(i._contextPlugins.has(s))return;throw new u("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:t})}if(s.requires&&s.requires.length)throw new u("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:t});e.splice(o,1,n),i._availablePlugins.set(t,n)}}(o,n);const r=function(e){return e.map(e=>{const t=i._contextPlugins.get(e)||new e(s);return i._add(e,t),t})}(o);return g(r,"init").then(()=>g(r,"afterInit")).then(()=>r);function a(e){return"function"==typeof e}function l(e){return a(e)&&e.isContextPlugin}function d(e,t){return t.some(t=>t===e||c(e)===t||c(t)===e)}function c(e){return a(e)?e.pluginName||e.name:e}function h(e,t=null){e.map(e=>a(e)?e:i._availablePlugins.get(e)||e).forEach(e=>{!function(e,t){if(!a(e)){if(t)throw new u("plugincollection-soft-required",s,{missingPlugin:e,requiredBy:c(t)});throw new u("plugincollection-plugin-not-found",s,{plugin:e})}}(e,t),function(e,t){if(l(t)&&!l(e))throw new u("plugincollection-context-required",s,{plugin:c(e),requiredBy:c(t)})}(e,t),m(e,t)})}function m(e,n){if(n&&d(e,t))throw new u("plugincollection-required",s,{plugin:c(e),requiredBy:c(n)})}function g(e,t){return e.reduce((e,n)=>n[t]?i._contextPlugins.has(n)?e:e.then(n[t].bind(n)):e,Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const n=e.pluginName;if(n){if(this._plugins.has(n))throw new u("plugincollection-plugin-name-conflict",null,{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:e});this._plugins.set(n,t)}}}function Gn(e){return Array.isArray(e)?e:[e]}ot(Wn,_),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const Hn=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function qn(e){return Hn.includes(e)?"rtl":"ltr"}class Yn{constructor(e={}){this.uiLanguage=e.uiLanguage||"en",this.contentLanguage=e.contentLanguage||this.uiLanguage,this.uiLanguageDirection=qn(this.uiLanguage),this.contentLanguageDirection=qn(this.contentLanguage),this.t=(e,t)=>this._t(e,t)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=Gn(t),"string"==typeof e&&(e={string:e});const n=e.plural?t[0]:1;return function(e,t){return e.replace(/%(\d+)/g,(e,n)=>n1===e?0:1);if("string"==typeof o[s])return o[s];const a=Number(r(n));return o[s][a]}(this.uiLanguage,e,n),t)}}class Kn{constructor(e){this.config=new Nn(e,this.constructor.defaultConfig);const t=this.constructor.builtinPlugins;this.config.define("plugins",t),this.plugins=new Wn(this,t);const n=this.config.get("language")||{};this.locale=new Yn({uiLanguage:"string"==typeof n?n:n.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new Un,this._contextOwner=null}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const n of e.concat(t)){if("function"!=typeof n)throw new u("context-initplugins-constructor-only",null,{Plugin:n});if(!0!==n.isContextPlugin)throw new u("context-initplugins-invalid-plugin",null,{Plugin:n})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new u("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{const n=new this(e);t(n.initPlugins().then(()=>n))})}}class Zn{constructor(e){this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}function Xn(e,t){const n=Math.min(e.length,t.length);for(let i=0;ie.data.length)throw new u("view-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.data.length)throw new u("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this.textNode:this.parent;for(;null!==n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}}function ni(e){return Vn(e)?new Map(e):function(e){const t=new Map;for(const n in e)t.set(n,e[n]);return t}(e)}class ii{constructor(...e){this._patterns=[],this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const n=si(t,e);if(n)return{element:t,pattern:e,match:n}}return null}matchAll(...e){const t=[];for(const n of e)for(const e of this._patterns){const i=si(n,e);i&&t.push({element:n,pattern:e,match:i})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}function si(e,t){if("function"==typeof t)return t(e);const n={};return t.name&&(n.name=function(e,t){return e instanceof RegExp?!!t.match(e):e===t}(t.name,e.name),!n.name)||t.attributes&&(n.attributes=function(e,t){const n=new Set(t.getAttributeKeys());return xt(e)?(void 0!==e.style&&h("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&h("matcher-pattern-deprecated-attributes-class-key",e)):(n.delete("style"),n.delete("class")),oi(e,n,e=>t.getAttribute(e))}(t.attributes,e),!n.attributes)?null:!(t.classes&&(n.classes=function(e,t){return oi(e,t.getClassNames())}(t.classes,e),!n.classes))&&!(t.styles&&(n.styles=function(e,t){return oi(e,t.getStyleNames(!0),e=>t.getStyle(e))}(t.styles,e),!n.styles))&&n}function oi(e,t,n){const i=function(e){return Array.isArray(e)?e.map(e=>xt(e)?(void 0!==e.key&&void 0!==e.value||h("matcher-pattern-missing-key-or-value",e),[e.key,e.value]):[e,!0]):xt(e)?Object.entries(e):[[e,!0]]}(e),s=Array.from(t),o=[];return i.forEach(([e,t])=>{s.forEach(i=>{(function(e,t){return!0===e||e===t||e instanceof RegExp&&t.match(e)})(e,i)&&function(e,t,n){if(!0===e)return!0;const i=n(t);return e===i||e instanceof RegExp&&!!String(i).match(e)}(t,i,n)&&o.push(i)})}),!i.length||o.lengths?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(s);++it===e);return Array.isArray(t)}set(e,t){if(w(e))for(const[t,n]of Object.entries(e))this._styleProcessor.toNormalizedForm(t,n,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){const t=Fi(e);(function(e,t){null==e||ki(e,t)})(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!w(this._styles[e]))return this._styles[e];const t=this._styleProcessor.getReducedForm(e,this._styles).find(([t])=>t===e);return Array.isArray(t)?t[1]:void 0}getStyleNames(e=!1){return this.isEmpty?[]:e?this._styleProcessor.getStyleNames(this._styles):this._getStylesEntries().map(([e])=>e)}clear(){this._styles={}}_getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const n of t)e.push(...this._styleProcessor.getReducedForm(n,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const n=t.splice(0,t.length-1).join("."),i=Ai(this._styles,n);i&&!Array.from(Object.keys(i)).length&&this.remove(n)}}class Pi{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,n){if(w(t))Mi(n,Fi(e),t);else if(this._normalizers.has(e)){const i=this._normalizers.get(e),{path:s,value:o}=i(t);Mi(n,s,o)}else Mi(n,e,t)}getNormalized(e,t){if(!e)return Ri({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const n=this._extractors.get(e);if("string"==typeof n)return Ai(t,n);const i=n(e,t);if(i)return i}return Ai(t,Fi(e))}getReducedForm(e,t){const n=this.getNormalized(e,t);return void 0===n?[]:this._reducers.has(e)?this._reducers.get(e)(n):[[e,n]]}getStyleNames(e){const t=Array.from(this._consumables.keys()).filter(t=>{const n=this.getNormalized(t,e);return n&&"object"==typeof n?Object.keys(n).length:n}),n=new Set([...t,...Object.keys(e)]);return Array.from(n.values())}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const n of t)this._mapStyleNames(n,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function Fi(e){return e.replace("-",".")}function Mi(e,t,n){let i=n;w(n)&&(i=Ri({},Ai(e,t),n)),$i(e,t,i)}class Ni extends Qn{constructor(e,t,n,i){if(super(e),this.name=t,this._attrs=function(e){e=ni(e);for(const[t,n]of e)null===n?e.delete(t):"string"!=typeof n&&e.set(t,String(n));return e}(n),this._children=[],i&&this._insertChild(0,i),this._classes=new Set,this._attrs.has("class")){const e=this._attrs.get("class");Li(this._classes,e),this._attrs.delete("class")}this._styles=new Di(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._unsafeAttributesToRender=[]}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}is(e,t=null){return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if("class"==e)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==e){const e=this._styles.toString();return""==e?void 0:e}return this._attrs.get(e)}hasAttribute(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(e){if(!(e instanceof Ni))return!1;if(this===e)return!0;if(this.name!=e.name)return!1;if(this._attrs.size!==e._attrs.size||this._classes.size!==e._classes.size||this._styles.size!==e._styles.size)return!1;for(const[t,n]of this._attrs)if(!e._attrs.has(t)||e._attrs.get(t)!==n)return!1;for(const t of this._classes)if(!e._classes.has(t))return!1;for(const t of this._styles.getStyleNames())if(!e._styles.has(t)||e._styles.getAsString(t)!==this._styles.getAsString(t))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e=!1){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new ii(...e);let n=this.parent;for(;n;){if(t.match(n))return n;n=n.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),n=Array.from(this._attrs).map(e=>`${e[0]}="${e[1]}"`).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==n?"":` ${n}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}_clone(e=!1){const t=[];if(e)for(const n of this.getChildren())t.push(n._clone(e));const n=new this.constructor(this.document,this.name,this._attrs,t);return n._classes=new Set(this._classes),n._styles.set(this._styles.getNormalized()),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(e,t){return"string"==typeof t?[new ei(e,t)]:(Vn(t)||(t=[t]),Array.from(t).map(t=>"string"==typeof t?new ei(e,t):t instanceof ti?new ei(e,t.data):t))}(this.document,t);for(const t of i)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n0&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of Gn(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Gn(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of Gn(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}}function Li(e,t){const n=t.split(/\s+/);e.clear(),n.forEach(t=>e.add(t))}class Bi extends Ni{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Vi}is(e,t=null){return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}}function Vi(){const e=[...this.getChildren()],t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const t of e)if(!t.is("uiElement"))return null;return this.childCount}class Ui extends Bi{constructor(e,t,n,i){super(e,t,n,i),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",t=>t&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}is(e,t=null){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}destroy(){this.stopListening()}}ot(Ui,Qe);const Wi=Symbol("rootName");class Gi extends Ui{constructor(e,t){super(e,t),this.rootName="main"}is(e,t=null){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}get rootName(){return this.getCustomProperty(Wi)}set rootName(e){this._setCustomProperty(Wi,e)}set _name(e){this.name=e}}class Hi{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new u("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new u("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this.position=qi._createAt(e.startPosition):this.position=qi._createAt(e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(e){let t,n,i;do{i=this.position,({done:t,value:n}=this.next())}while(!t&&e(n));t||(this.position=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,n=e.parent;if(null===n.parent&&e.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};let i;if(n instanceof ei){if(e.isAtEnd)return this.position=qi._createAfter(n),this._next();i=n.data[e.offset]}else i=n.getChild(e.offset);if(i instanceof Ni)return this.shallow?e.offset++:e=new qi(i,0),this.position=e,this._formatReturnValue("elementStart",i,t,e,1);if(i instanceof ei){if(this.singleCharacters)return e=new qi(i,0),this.position=e,this._next();{let n,s=i.data.length;return i==this._boundaryEndParent?(s=this.boundaries.end.offset,n=new ti(i,0,s),e=qi._createAfter(n)):(n=new ti(i,0,i.data.length),e.offset++),this.position=e,this._formatReturnValue("text",n,t,e,s)}}if("string"==typeof i){let i;i=this.singleCharacters?1:(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-e.offset;const s=new ti(n,e.offset,i);return e.offset+=i,this.position=e,this._formatReturnValue("text",s,t,e,i)}return e=qi._createAfter(n),this.position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",n,t,e)}_previous(){let e=this.position.clone();const t=this.position,n=e.parent;if(null===n.parent&&0===e.offset)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};let i;if(n instanceof ei){if(e.isAtStart)return this.position=qi._createBefore(n),this._previous();i=n.data[e.offset-1]}else i=n.getChild(e.offset-1);if(i instanceof Ni)return this.shallow?(e.offset--,this.position=e,this._formatReturnValue("elementStart",i,t,e,1)):(e=new qi(i,i.childCount),this.position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",i,t,e));if(i instanceof ei){if(this.singleCharacters)return e=new qi(i,i.data.length),this.position=e,this._previous();{let n,s=i.data.length;if(i==this._boundaryStartParent){const t=this.boundaries.start.offset;n=new ti(i,t,i.data.length-t),s=n.data.length,e=qi._createBefore(n)}else n=new ti(i,0,i.data.length),e.offset--;return this.position=e,this._formatReturnValue("text",n,t,e,s)}}if("string"==typeof i){let i;if(this.singleCharacters)i=1;else{const t=n===this._boundaryStartParent?this.boundaries.start.offset:0;i=e.offset-t}e.offset-=i;const s=new ti(n,e.offset,i);return this.position=e,this._formatReturnValue("text",s,t,e,i)}return e=qi._createBefore(n),this.position=e,this._formatReturnValue("elementStart",n,t,e,1)}_formatReturnValue(e,t,n,i,s){return t instanceof ti&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=qi._createAfter(t.textNode):(i=qi._createAfter(t.textNode),this.position=i)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=qi._createBefore(t.textNode):(i=qi._createBefore(t.textNode),this.position=i))),{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:s}}}}class qi{constructor(e,t){this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof Ui);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(e){const t=qi._createAt(this),n=t.offset+e;return t.offset=n<0?0:n,t}getLastMatchingPosition(e,t={}){t.startPosition=this;const n=new Hi(t);return n.skip(e),n.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),n=e.getAncestors();let i=0;for(;t[i]==n[i]&&t[i];)i++;return 0===i?null:t[i-1]}is(e){return"position"===e||"view:position"===e}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],n=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),n.push(e.offset);const i=Xn(t,n);switch(i){case"prefix":return"before";case"extension":return"after";default:return t[i]0?new this(n,i):new this(i,n)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(qi._createBefore(e),t)}}function Ki(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}function Zi(e){let t=0;for(const n of e)t++;return t}class Xi{constructor(e=null,t,n){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(e,t,n)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=Zi(this.getRanges());if(t!=Zi(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let n=!1;for(let i of e.getRanges())if(i=i.getTrimmed(),t.start.isEqual(i.start)&&t.end.isEqual(i.end)){n=!0;break}if(!n)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(e,t,n){if(null===e)this._setRanges([]),this._setFakeOptions(t);else if(e instanceof Xi||e instanceof Ji)this._setRanges(e.getRanges(),e.isBackward),this._setFakeOptions({fake:e.isFake,label:e.fakeSelectionLabel});else if(e instanceof Yi)this._setRanges([e],t&&t.backward),this._setFakeOptions(t);else if(e instanceof qi)this._setRanges([new Yi(e)]),this._setFakeOptions(t);else if(e instanceof Qn){const i=!!n&&!!n.backward;let s;if(void 0===t)throw new u("view-selection-setto-required-second-parameter",this);s="in"==t?Yi._createIn(e):"on"==t?Yi._createOn(e):new Yi(qi._createAt(e,t)),this._setRanges([s],i),this._setFakeOptions(n)}else{if(!Vn(e))throw new u("view-selection-setto-not-selectable",this);this._setRanges(e,t&&t.backward),this._setFakeOptions(t)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new u("view-selection-setfocus-no-ranges",this);const n=qi._createAt(e,t);if("same"==n.compareWith(this.focus))return;const i=this.anchor;this._ranges.pop(),"before"==n.compareWith(i)?this._addRange(new Yi(n,i),!0):this._addRange(new Yi(i,n)),this.fire("change")}is(e){return"selection"===e||"view:selection"===e}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const t of e)this._addRange(t);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof Yi))throw new u("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new u("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new Yi(e.start,e.end))}}ot(Xi,_);class Ji{constructor(e=null,t,n){this._selection=new Xi,this._selection.delegate("change").to(this),this._selection.setTo(e,t,n)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}is(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setFocus(e,t){this._selection.setFocus(e,t)}}ot(Ji,_);class Qi extends i{constructor(e,t,n){super(e,t),this.startRange=n,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const es=Symbol("bubbling contexts"),ts={fire(e,...t){try{const n=e instanceof i?e:new i(this,e),s=rs(this);if(!s.size)return;if(is(n,"capturing",this),ss(s,"$capture",n,...t))return n.return;const o=n.startRange||this.selection.getFirstRange(),r=o?o.getContainedElement():null,a=!!r&&Boolean(os(s,r));let l=r||function(e){if(!e)return null;const t=e.start.parent,n=e.end.parent,i=t.getPath(),s=n.getPath();return i.length>s.length?t:n}(o);if(is(n,"atTarget",l),!a){if(ss(s,"$text",n,...t))return n.return;is(n,"bubbling",l)}for(;l;){if(l.is("rootElement")){if(ss(s,"$root",n,...t))return n.return}else if(l.is("element")&&ss(s,l.name,n,...t))return n.return;if(ss(s,l,n,...t))return n.return;l=l.parent,is(n,"bubbling",l)}return is(n,"bubbling",this),ss(s,"$document",n,...t),n.return}catch(e){u.rethrowUnexpectedError(e,this)}},_addEventListener(e,t,n){const i=Gn(n.context||"$document"),s=rs(this);for(const o of i){let i=s.get(o);i||(i=Object.create(_),s.set(o,i)),this.listenTo(i,e,t,n)}},_removeEventListener(e,t){const n=rs(this);for(const i of n.values())this.stopListening(i,e,t)}},ns=ts;function is(e,t,n){e instanceof Qi&&(e._eventPhase=t,e._currentTarget=n)}function ss(e,t,n,...i){const s="string"==typeof t?e.get(t):os(e,t);return!!s&&(s.fire(n,...i),n.stop.called)}function os(e,t){for(const[n,i]of e)if("function"==typeof n&&n(t))return i;return null}function rs(e){return e[es]||(e[es]=new Map),e[es]}class as{constructor(e){this.selection=new Ji,this.roots=new Un({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.map(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const n of this._postFixers)if(t=n(e),t)break}while(t)}}ot(as,ns),ot(as,Qe);class ls extends Ni{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=ds,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new u("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(e,t=null){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function ds(){if(cs(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(cs(e)>1)return null;e=e.parent}return!e||cs(e)>1?null:this.childCount}function cs(e){return Array.from(e.getChildren()).filter(e=>!e.is("uiElement")).length}ls.DEFAULT_PRIORITY=10;class us extends Ni{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=hs}is(e,t=null){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof Qn||Array.from(t).length>0))throw new u("view-emptyelement-cannot-add",[this,t])}}function hs(){return null}const ms=navigator.userAgent.toLowerCase(),gs={isMac:fs(ms),isWindows:function(e){return e.indexOf("windows")>-1}(ms),isGecko:function(e){return!!e.match(/gecko\/\d+/)}(ms),isSafari:function(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}(ms),isiOS:function(e){return!!e.match(/iphone|ipad/i)||fs(e)&&navigator.maxTouchPoints>0}(ms),isAndroid:function(e){return e.indexOf("android")>-1}(ms),isBlink:function(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}(ms),features:{isRegExpUnicodePropertySupported:function(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e}()}},ps=gs;function fs(e){return e.indexOf("macintosh")>-1}const xs={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},_s={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},Is=function(){const e={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++)e[String.fromCharCode(t).toLowerCase()]=t;for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;for(const t of"`-=[];',./\\")e[t]=t.charCodeAt(0);return e}(),vs=Object.fromEntries(Object.entries(Is).map(([e,t])=>[t,e.charAt(0).toUpperCase()+e.slice(1)]));function bs(e){let t;if("string"==typeof e){if(t=Is[e.toLowerCase()],!t)throw new u("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?Is.alt:0)+(e.ctrlKey?Is.ctrl:0)+(e.shiftKey?Is.shift:0)+(e.metaKey?Is.cmd:0);return t}function js(e){return"string"==typeof e&&(e=function(e){return e.split("+").map(e=>e.trim())}(e)),e.map(e=>"string"==typeof e?function(e){if(e.endsWith("!"))return bs(e.slice(0,-1));const t=bs(e);return ps.isMac&&t==Is.ctrl?Is.cmd:t}(e):e).reduce((e,t)=>t+e,0)}function Cs(e){let t=js(e);const n=Object.entries(ps.isMac?xs:_s).reduce((e,[n,i])=>(0!=(t&Is[n])&&(t&=~Is[n],e+=i),e),"");return n+(t?vs[t]:"")}function ys(e,t){const n="ltr"===t;switch(e){case Is.arrowleft:return n?"left":"right";case Is.arrowright:return n?"right":"left";case Is.arrowup:return"up";case Is.arrowdown:return"down"}}class ks extends Ni{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=As}is(e,t=null){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof Qn||Array.from(t).length>0))throw new u("view-uielement-cannot-add",this)}render(e){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys())t.setAttribute(e,this.getAttribute(e));return t}}function As(){return null}class ws extends Ni{constructor(e,t,n,i){super(e,t,n,i),this.getFillerOffset=Ss}is(e,t=null){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e}_insertChild(e,t){if(t&&(t instanceof Qn||Array.from(t).length>0))throw new u("view-rawelement-cannot-add",[this,t])}}function Ss(){return null}class Es{constructor(e,t){this.document=e,this._children=[],t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"===e||"view:documentFragment"===e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let n=0;const i=function(e,t){return"string"==typeof t?[new ei(e,t)]:(Vn(t)||(t=[t]),Array.from(t).map(t=>"string"==typeof t?new ei(e,t):t instanceof ti?new ei(e,t.data):t))}(this.document,t);for(const t of i)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,n++;return n}_removeChildren(e,t=1){this._fireChange("children",this);for(let n=e;n{}),i.renderUnsafeAttributes&&s._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),s}setAttribute(e,t,n){n._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,n){xt(e)&&void 0===n&&(n=t),n._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,n){n._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof qi?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){const t=e.parent;if(!t.is("containerElement"))throw new u("view-writer-break-non-container-element",this.document);if(!t.parent)throw new u("view-writer-break-root",this.document);if(e.isAtStart)return qi._createBefore(t);if(!e.isAtEnd){const n=t._clone(!1);this.insert(qi._createAfter(t),n);const i=new Yi(e,qi._createAt(t,"end")),s=new qi(n,0);this.move(i,s)}return qi._createAfter(t)}mergeAttributes(e){const t=e.offset,n=e.parent;if(n.is("$text"))return e;if(n.is("attributeElement")&&0===n.childCount){const e=n.parent,t=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new qi(e,t))}const i=n.getChild(t-1),s=n.getChild(t);if(!i||!s)return e;if(i.is("$text")&&s.is("$text"))return Ds(i,s);if(i.is("attributeElement")&&s.is("attributeElement")&&i.isSimilar(s)){const e=i.childCount;return i._appendChild(s.getChildren()),s._remove(),this._removeFromClonedElementsGroup(s),this.mergeAttributes(new qi(i,e))}return e}mergeContainers(e){const t=e.nodeBefore,n=e.nodeAfter;if(!(t&&n&&t.is("containerElement")&&n.is("containerElement")))throw new u("view-writer-merge-containers-invalid-position",this.document);const i=t.getChild(t.childCount-1),s=i instanceof ei?qi._createAt(i,"end"):qi._createAt(t,"end");return this.move(Yi._createIn(n),qi._createAt(t,"end")),this.remove(Yi._createOn(n)),s}insert(e,t){Ps(t=Vn(t)?[...t]:[t],this.document);const n=t.reduce((e,t)=>{const n=e[e.length-1],i=!t.is("uiElement");return n&&n.breakAttributes==i?n.nodes.push(t):e.push({breakAttributes:i,nodes:[t]}),e},[]);let i=null,s=e;for(const{nodes:e,breakAttributes:t}of n){const n=this._insertNodes(s,e,t);i||(i=n.start),s=n.end}return i?new Yi(i,s):new Yi(e)}remove(e){const t=e instanceof Yi?e:Yi._createOn(e);if(Ns(t,this.document),t.isCollapsed)return new Es(this.document);const{start:n,end:i}=this._breakAttributesRange(t,!0),s=n.parent,o=i.offset-n.offset,r=s._removeChildren(n.offset,o);for(const e of r)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(n);return t.start=a,t.end=a.clone(),new Es(this.document,r)}clear(e,t){Ns(e,this.document);const n=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const i of n){const n=i.item;let s;if(n.is("element")&&t.isSimilar(n))s=Yi._createOn(n);else if(!i.nextPosition.isAfter(e.start)&&n.is("$textProxy")){const e=n.getAncestors().find(e=>e.is("element")&&t.isSimilar(e));e&&(s=Yi._createIn(e))}s&&(s.end.isAfter(e.end)&&(s.end=e.end),s.start.isBefore(e.start)&&(s.start=e.start),this.remove(s))}}move(e,t){let n;if(t.isAfter(e.end)){const i=(t=this._breakAttributes(t,!0)).parent,s=i.childCount;e=this._breakAttributesRange(e,!0),n=this.remove(e),t.offset+=i.childCount-s}else n=this.remove(e);return this.insert(t,n)}wrap(e,t){if(!(t instanceof ls))throw new u("view-writer-wrap-invalid-attribute",this.document);if(Ns(e,this.document),e.isCollapsed){let n=e.start;n.parent.is("element")&&!function(e){return Array.from(e.getChildren()).some(e=>!e.is("uiElement"))}(n.parent)&&(n=n.getLastMatchingPosition(e=>e.item.is("uiElement"))),n=this._wrapPosition(n,t);const i=this.document.selection;return i.isCollapsed&&i.getFirstPosition().isEqual(e.start)&&this.setSelection(n),new Yi(n)}return this._wrapRange(e,t)}unwrap(e,t){if(!(t instanceof ls))throw new u("view-writer-unwrap-invalid-attribute",this.document);if(Ns(e,this.document),e.isCollapsed)return e;const{start:n,end:i}=this._breakAttributesRange(e,!0),s=n.parent,o=this._unwrapChildren(s,n.offset,i.offset,t),r=this.mergeAttributes(o.start);r.isEqual(o.start)||o.end.offset--;const a=this.mergeAttributes(o.end);return new Yi(r,a)}rename(e,t){const n=new Bi(this.document,e,t.getAttributes());return this.insert(qi._createAfter(t),n),this.move(Yi._createIn(t),qi._createAt(n,0)),this.remove(Yi._createOn(t)),n}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return qi._createAt(e,t)}createPositionAfter(e){return qi._createAfter(e)}createPositionBefore(e){return qi._createBefore(e)}createRange(e,t){return new Yi(e,t)}createRangeOn(e){return Yi._createOn(e)}createRangeIn(e){return Yi._createIn(e)}createSelection(e,t,n){return new Xi(e,t,n)}createSlot(e){if(!this._slotFactory)throw new u("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,n){let i,s;if(i=n?zs(e):e.parent.is("$text")?e.parent.parent:e.parent,!i)throw new u("view-writer-invalid-position-container",this.document);s=n?this._breakAttributes(e,!0):e.parent.is("$text")?$s(e):e;const o=i._insertChild(s.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const r=s.getShiftedBy(o),a=this.mergeAttributes(s);a.isEqual(s)||r.offset--;const l=this.mergeAttributes(r);return new Yi(a,l)}_wrapChildren(e,t,n,i){let s=t;const o=[];for(;s!1,e.parent._insertChild(e.offset,n);const i=new Yi(e,e.getShiftedBy(1));this.wrap(i,t);const s=new qi(n.parent,n.index);n._remove();const o=s.nodeBefore,r=s.nodeAfter;return o instanceof ei&&r instanceof ei?Ds(o,r):Rs(s)}_wrapAttributeElement(e,t){if(!Ls(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if("class"!==n&&"style"!==n&&t.hasAttribute(n)&&t.getAttribute(n)!==e.getAttribute(n))return!1;for(const n of e.getStyleNames())if(t.hasStyle(n)&&t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&(t.hasAttribute(n)||this.setAttribute(n,e.getAttribute(n),t));for(const n of e.getStyleNames())t.hasStyle(n)||this.setStyle(n,e.getStyle(n),t);for(const n of e.getClassNames())t.hasClass(n)||this.addClass(n,t);return!0}_unwrapAttributeElement(e,t){if(!Ls(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const n of e.getAttributeKeys())if("class"!==n&&"style"!==n&&(!t.hasAttribute(n)||t.getAttribute(n)!==e.getAttribute(n)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const n of e.getStyleNames())if(!t.hasStyle(n)||t.getStyle(n)!==e.getStyle(n))return!1;for(const n of e.getAttributeKeys())"class"!==n&&"style"!==n&&this.removeAttribute(n,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const n=e.start,i=e.end;if(Ns(e,this.document),e.isCollapsed){const n=this._breakAttributes(e.start,t);return new Yi(n,n)}const s=this._breakAttributes(i,t),o=s.parent.childCount,r=this._breakAttributes(n,t);return s.offset+=s.parent.childCount-o,new Yi(r,s)}_breakAttributes(e,t=!1){const n=e.offset,i=e.parent;if(e.parent.is("emptyElement"))throw new u("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new u("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new u("view-writer-cannot-break-raw-element",this.document);if(!t&&i.is("$text")&&Ms(i.parent))return e.clone();if(Ms(i))return e.clone();if(i.is("$text"))return this._breakAttributes($s(e),t);if(n==i.childCount){const e=new qi(i.parent,i.index+1);return this._breakAttributes(e,t)}if(0===n){const e=new qi(i.parent,i.index);return this._breakAttributes(e,t)}{const e=i.index+1,s=i._clone();i.parent._insertChild(e,s),this._addToClonedElementsGroup(s);const o=i.childCount-n,r=i._removeChildren(n,o);s._appendChild(r);const a=new qi(i.parent,e);return this._breakAttributes(a,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let n=this._cloneGroups.get(t);n||(n=new Set,this._cloneGroups.set(t,n)),n.add(e),e._clonesGroup=n}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const n=this._cloneGroups.get(t);n&&n.delete(e)}}function zs(e){let t=e.parent;for(;!Ms(t);){if(!t)return;t=t.parent}return t}function Os(e,t){return e.priorityt.priority)&&e.getIdentity()n instanceof e))throw new u("view-writer-insert-invalid-node-type",t);n.is("$text")||Ps(n.getChildren(),t)}}const Fs=[ei,ls,Bi,us,ws,ks];function Ms(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function Ns(e,t){const n=zs(e.start),i=zs(e.end);if(!n||!i||n!==i)throw new u("view-writer-invalid-range-container",t)}function Ls(e,t){return null===e.id&&null===t.id}function Bs(e){return"[object Text]"==Object.prototype.toString.call(e)}const Vs=e=>e.createTextNode(" "),Us=e=>{const t=e.createElement("span");return t.dataset.ckeFiller=!0,t.innerHTML=" ",t},Ws=e=>{const t=e.createElement("br");return t.dataset.ckeFiller=!0,t},Gs="⁠".repeat(7);function Hs(e){return Bs(e)&&e.data.substr(0,7)===Gs}function qs(e){return 7==e.data.length&&Hs(e)}function Ys(e){return Hs(e)?e.data.slice(7):e.data}function Ks(e,t){if(t.keyCode==Is.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,n=e.getRangeAt(0).startOffset;Hs(t)&&n<=7&&e.collapse(t,0)}}}function Zs(e,t,n,i=!1){n=n||function(e,t){return e===t},Array.isArray(e)||(e=Array.prototype.slice.call(e)),Array.isArray(t)||(t=Array.prototype.slice.call(t));const s=function(e,t,n){const i=Xs(e,t,n);if(-1===i)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const s=Xs(Js(e,i),Js(t,i),n);return{firstIndex:i,lastIndexOld:e.length-s,lastIndexNew:t.length-s}}(e,t,n);return i?function(e,t){const{firstIndex:n,lastIndexOld:i,lastIndexNew:s}=e;if(-1===n)return Array(t).fill("equal");let o=[];return n>0&&(o=o.concat(Array(n).fill("equal"))),s-n>0&&(o=o.concat(Array(s-n).fill("insert"))),i-n>0&&(o=o.concat(Array(i-n).fill("delete"))),s0&&n.push({index:i,type:"insert",values:e.slice(i,o)}),s-i>0&&n.push({index:i+(o-i),type:"delete",howMany:s-i}),n}(t,s)}function Xs(e,t,n){for(let i=0;i200||s>200||i+s>300)return Qs.fastDiff(e,t,n,!0);let o,r;if(sd?-1:1;c[i+h]&&(c[i]=c[i+h].slice(0)),c[i]||(c[i]=[]),c[i].push(s>d?o:r);let m=Math.max(s,d),g=m-i;for(;gd;m--)u[m]=h(m);u[d]=h(d),g++}while(u[d]!==l);return c[d].slice(1)}function eo(e,t,n){e.insertBefore(n,e.childNodes[t]||null)}function to(e){const t=e.parentNode;t&&t.removeChild(e)}function no(e){return e&&e.nodeType===Node.COMMENT_NODE}function io(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}Qs.fastDiff=Zs;var so=o(379),oo=o.n(so),ro=o(401);oo()(ro.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ro.Z.locals;class ao{constructor(e,t){this.domDocuments=new Set,this.domConverter=e,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),ps.isBlink&&!ps.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()}),this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new u("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){let e;const t=!(ps.isBlink&&!ps.isAndroid&&this.isSelecting);for(const e of this.markedChildren)this._updateChildrenMappings(e);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller));for(const e of this.markedAttributes)this._updateAttrs(e);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(t)if(e){const t=this.domConverter.viewPositionToDom(e),n=t.parent.ownerDocument;Hs(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=lo(n,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(this.domConverter.mapViewToDom(e).childNodes),i=Array.from(this.domConverter.viewChildrenToDom(e,t.ownerDocument,{withChildren:!1})),s=this._diffNodeLists(n,i),o=this._findReplaceActions(s,n,i);if(-1!==o.indexOf("replace")){const t={equal:0,insert:0,delete:0};for(const s of o)if("replace"===s){const s=t.equal+t.insert,o=t.equal+t.delete,r=e.getChild(s);!r||r.is("uiElement")||r.is("rawElement")||this._updateElementMappings(r,n[o]),to(i[s]),t.equal++}else t[s]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?qi._createBefore(this.selection.getFirstPosition().parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Bs(t.parent)&&Hs(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!Hs(e))throw new u("view-renderer-filler-was-lost",this);qs(e)?e.remove():e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,n=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor(e=>e.hasAttribute("contenteditable"));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;if(n===t.getFillerOffset())return!1;const i=e.nodeBefore,s=e.nodeAfter;return!(i instanceof ei||s instanceof ei)}_updateText(e,t){const n=this.domConverter.findCorrespondingDomText(e),i=this.domConverter.viewToDom(e,n.ownerDocument),s=n.data;let o=i.data;const r=t.inlineFillerPosition;if(r&&r.parent==e.parent&&r.offset==e.index&&(o=Gs+o),s!=o){const e=Zs(s,o);for(const t of e)"insert"===t.type?n.insertData(t.index,t.values.join("")):n.deleteData(t.index,t.howMany)}}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const n=Array.from(t.attributes).map(e=>e.name),i=e.getAttributeKeys();for(const n of i)this.domConverter.setDomElementAttribute(t,n,e.getAttribute(n),e);for(const i of n)e.hasAttribute(i)||this.domConverter.removeDomElementAttribute(t,i)}_updateChildren(e,t){const n=this.domConverter.mapViewToDom(e);if(!n)return;const i=t.inlineFillerPosition,s=this.domConverter.mapViewToDom(e).childNodes,o=Array.from(this.domConverter.viewChildrenToDom(e,n.ownerDocument,{bind:!0}));i&&i.parent===e&&lo(n.ownerDocument,o,i.offset);const r=this._diffNodeLists(s,o);let a=0;const l=new Set;for(const e of r)"delete"===e?(l.add(s[a]),to(s[a])):"equal"===e&&a++;a=0;for(const e of r)"insert"===e?(eo(n,a,o[a]),a++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(o[a])),a++);for(const e of l)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return e=function(e,t){const n=Array.from(e);if(0==n.length||!t)return n;return n[n.length-1]==t&&n.pop(),n}(e,this._fakeSelectionContainer),Qs(e,t,uo.bind(null,this.domConverter))}_findReplaceActions(e,t,n){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let i=[],s=[],o=[];const r={equal:0,insert:0,delete:0};for(const a of e)"insert"===a?o.push(n[r.equal+r.insert]):"delete"===a?s.push(t[r.equal+r.delete]):(i=i.concat(Qs(s,o,co).map(e=>"equal"===e?"replace":e)),i.push("equal"),s=[],o=[]),r[a]++;return i.concat(Qs(s,o,co).map(e=>"equal"===e?"replace":e))}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(ps.isBlink&&!ps.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):(this._removeFakeSelection(),this._updateDomSelection(e)))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const n=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(n,this.selection),!this._fakeSelectionNeedsUpdate(e))return;n.parentElement&&n.parentElement==e||e.appendChild(n),n.textContent=this.selection.fakeSelectionLabel||" ";const i=t.getSelection(),s=t.createRange();i.removeAllRanges(),s.selectNodeContents(n),i.addRange(s)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);t.collapse(n.parent,n.offset),t.extend(i.parent,i.offset),ps.isGecko&&function(e,t){const n=e.parent;if(n.nodeType!=Node.ELEMENT_NODE||e.offset!=n.childNodes.length-1)return;const i=n.childNodes[e.offset];i&&"BR"==i.tagName&&t.addRange(t.getRangeAt(0))}(i,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return!(t&&this.selection.isEqual(t)||!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,n=e.ownerDocument.getSelection();return!t||t.parentElement!==e||n.anchorNode!==t&&!t.contains(n.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(const e of this.domDocuments)if(e.getSelection().rangeCount){const t=e.activeElement,n=this.domConverter.mapDomToView(t);t&&n&&e.getSelection().removeAllRanges()}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function lo(e,t,n){const i=t instanceof Array?t:t.childNodes,s=i[n];if(Bs(s))return s.data=Gs+s.data,s;{const s=e.createTextNode(Gs);return Array.isArray(t)?i.splice(n,0,s):eo(t,n,s),s}}function co(e,t){return io(e)&&io(t)&&!Bs(e)&&!Bs(t)&&!no(e)&&!no(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function uo(e,t,n){return t===n||(Bs(t)&&Bs(n)?t.data===n.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(n)))}ot(ao,Qe);const ho={window,document};function mo(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function go(e){const t=[];for(;e&&e.nodeType!=Node.DOCUMENT_NODE;)t.unshift(e),e=e.parentNode;return t}const po=Ws(document),fo=Vs(document),xo=Us(document),_o="data-ck-unsafe-attribute-",Io="data-ck-unsafe-element",vo=["script","style"];class bo{constructor(e,t={}){this.document=e,this.renderingMode=t.renderingMode||"editing",this.blockFillerMode=t.blockFillerMode||("editing"===this.renderingMode?"br":"nbsp"),this.preElements=["pre"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new ii,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new Xi(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of e.childNodes)this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,n){return"data"===this.renderingMode||!(e=e.toLowerCase()).startsWith("on")&&("srcdoc"!==e||!t.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&("img"===n&&("src"===e||"srcset"===e)||"source"===n&&"srcset"===e||!t.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))}setContentOf(e,t){if("data"===this.renderingMode)return void(e.innerHTML=t);const n=(new DOMParser).parseFromString(t,"text/html"),i=n.createDocumentFragment(),s=n.body.childNodes;for(;s.length>0;)i.appendChild(s[0]);const o=n.createTreeWalker(i,NodeFilter.SHOW_ELEMENT),r=[];let a;for(;a=o.nextNode();)r.push(a);for(const e of r){for(const t of e.getAttributeNames())this.setDomElementAttribute(e,t,e.getAttribute(t));const t=e.tagName.toLowerCase();this._shouldRenameElement(t)&&(yo(t),e.replaceWith(this._createReplacementDomElement(t,e)))}for(;e.firstChild;)e.firstChild.remove();e.append(i)}viewToDom(e,t,n={}){if(e.is("$text")){const n=this._processDataFromViewText(e);return t.createTextNode(n)}{if(this.mapViewToDom(e))return this.mapViewToDom(e);let i;if(e.is("documentFragment"))i=t.createDocumentFragment(),n.bind&&this.bindDocumentFragments(i,e);else{if(e.is("uiElement"))return i="$comment"===e.name?t.createComment(e.getCustomProperty("$rawContent")):e.render(t,this),n.bind&&this.bindElements(i,e),i;this._shouldRenameElement(e.name)?(yo(e.name),i=this._createReplacementDomElement(e.name)):i=e.hasAttribute("xmlns")?t.createElementNS(e.getAttribute("xmlns"),e.name):t.createElement(e.name),e.is("rawElement")&&e.render(i,this),n.bind&&this.bindElements(i,e);for(const t of e.getAttributeKeys())this.setDomElementAttribute(i,t,e.getAttribute(t),e)}if(!1!==n.withChildren)for(const s of this.viewChildrenToDom(e,t,n))i.appendChild(s);return i}}setDomElementAttribute(e,t,n,i=null){const s=this.shouldRenderAttribute(t,n,e.tagName.toLowerCase())||i&&i.shouldRenderUnsafeAttribute(t);s||h("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:n}),e.hasAttribute(t)&&!s?e.removeAttribute(t):e.hasAttribute(_o+t)&&s&&e.removeAttribute(_o+t),e.setAttribute(s?t:_o+t,n)}removeDomElementAttribute(e,t){t!=Io&&(e.removeAttribute(t),e.removeAttribute(_o+t))}*viewChildrenToDom(e,t,n={}){const i=e.getFillerOffset&&e.getFillerOffset();let s=0;for(const o of e.getChildren()){i===s&&(yield this._getBlockFiller(t));const e=o.is("element")&&o.getCustomProperty("dataPipeline:transparentRendering");e&&"data"==this.renderingMode?yield*this.viewChildrenToDom(o,t,n):(e&&h("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:o}),yield this.viewToDom(o,t,n)),s++}i===s&&(yield this._getBlockFiller(t))}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),n=this.viewPositionToDom(e.end),i=document.createRange();return i.setStart(t.parent,t.offset),i.setEnd(n.parent,n.offset),i}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const n=this.findCorrespondingDomText(t);if(!n)return null;let i=e.offset;return Hs(n)&&(i+=7),{parent:n,offset:i}}{let n,i,s;if(0===e.offset){if(n=this.mapViewToDom(t),!n)return null;s=n.childNodes[0]}else{const t=e.nodeBefore;if(i=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(e.nodeBefore),!i)return null;n=i.parentNode,s=i.nextSibling}return Bs(s)&&Hs(s)?{parent:s,offset:7}:{parent:n,offset:i?mo(i)+1:0}}}domToView(e,t={}){if(this.isBlockFiller(e))return null;const n=this.getHostViewElement(e);if(n)return n;if(no(e)&&t.skipComments)return null;if(Bs(e)){if(qs(e))return null;{const t=this._processDataFromDomText(e);return""===t?null:new ei(this.document,t)}}{if(this.mapDomToView(e))return this.mapDomToView(e);let n;if(this.isDocumentFragment(e))n=new Es(this.document),t.bind&&this.bindDocumentFragments(e,n);else{n=this._createViewElement(e,t),t.bind&&this.bindElements(e,n);const i=e.attributes;if(i)for(let e=i.length-1;e>=0;e--)n._setAttribute(i[e].name,i[e].value);if(this._isViewElementWithRawContent(n,t)||no(e)){const t=no(e)?e.data:e.innerHTML;return n._setCustomProperty("$rawContent",t),this._encounteredRawContentDomNodes.add(e),n}}if(!1!==t.withChildren)for(const i of this.domChildrenToView(e,t))n._appendChild(i);return n}}*domChildrenToView(e,t={}){for(let n=0;n{const{scrollLeft:t,scrollTop:n}=e;i.push([t,n])}),t.focus(),jo(t,e=>{const[t,n]=i.shift();e.scrollLeft=t,e.scrollTop=n}),ho.window.scrollTo(e,n)}}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(po):!("BR"!==e.tagName||!Co(e,this.blockElements)||1!==e.parentNode.childNodes.length)||e.isEqualNode(xo)||function(e,t){return e.isEqualNode(fo)&&Co(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements)}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);const n=t.collapsed;return t.detach(),n}getHostViewElement(e){const t=go(e);for(t.pop();t.length;){const e=t.pop(),n=this._domToViewMapping.get(e);if(n&&(n.is("uiElement")||n.is("rawElement")))return n}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}_getBlockFiller(e){switch(this.blockFillerMode){case"nbsp":return Vs(e);case"markedNbsp":return Us(e);case"br":return Ws(e)}}_isDomSelectionPositionCorrect(e,t){if(Bs(e)&&Hs(e)&&t<7)return!1;if(this.isElement(e)&&Hs(e.childNodes[t]))return!1;const n=this.mapDomToView(e);return!n||!n.is("uiElement")&&!n.is("rawElement")}_processDataFromViewText(e){let t=e.data;if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return t;if(" "==t.charAt(0)){const n=this._getTouchingInlineViewNode(e,!1);!(n&&n.is("$textProxy")&&this._nodeEndsWithSpace(n))&&n||(t=" "+t.substr(1))}if(" "==t.charAt(t.length-1)){const n=this._getTouchingInlineViewNode(e,!0),i=n&&n.is("$textProxy")&&" "==n.data.charAt(0);" "!=t.charAt(t.length-2)&&n&&!i||(t=t.substr(0,t.length-1)+" ")}return t.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(e){if(e.getAncestors().some(e=>this.preElements.includes(e.name)))return!1;const t=this._processDataFromViewText(e);return" "==t.charAt(t.length-1)}_processDataFromDomText(e){let t=e.data;if(function(e,t){return go(e).some(e=>e.tagName&&t.includes(e.tagName.toLowerCase()))}(e,this.preElements))return Ys(e);t=t.replace(/[ \n\t\r]{1,}/g," ");const n=this._getTouchingInlineDomNode(e,!1),i=this._getTouchingInlineDomNode(e,!0),s=this._checkShouldLeftTrimDomText(e,n),o=this._checkShouldRightTrimDomText(e,i);s&&(t=t.replace(/^ /,"")),o&&(t=t.replace(/ $/,"")),t=Ys(new Text(t)),t=t.replace(/ \u00A0/g," ");const r=i&&this.isElement(i)&&"BR"!=i.tagName,a=i&&Bs(i)&&" "==i.data.charAt(0);return(/( |\u00A0)\u00A0$/.test(t)||!i||r||a)&&(t=t.replace(/\u00A0$/," ")),(s||n&&this.isElement(n)&&"BR"!=n.tagName)&&(t=t.replace(/^\u00A0/," ")),t}_checkShouldLeftTrimDomText(e,t){return!t||(this.isElement(t)?"BR"===t.tagName:!this._encounteredRawContentDomNodes.has(e.previousSibling)&&/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(e,t){return!t&&!Hs(e)}_getTouchingInlineViewNode(e,t){const n=new Hi({startPosition:t?qi._createAfter(e):qi._createBefore(e),direction:t?"forward":"backward"});for(const e of n){if(e.item.is("element")&&this.inlineObjectElements.includes(e.item.name))return e.item;if(e.item.is("containerElement"))return null;if(e.item.is("element","br"))return null;if(e.item.is("$textProxy"))return e.item}return null}_getTouchingInlineDomNode(e,t){if(!e.parentNode)return null;const n=t?"firstChild":"lastChild",i=t?"nextSibling":"previousSibling";let s=!0;do{if(!s&&e[n]?e=e[n]:e[i]?(e=e[i],s=!1):(e=e.parentNode,s=!0),!e||this._isBlockElement(e))return null}while(!Bs(e)&&"BR"!=e.tagName&&!this._isInlineObjectElement(e));return e}_isBlockElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isInlineObjectElement(e){return this.isElement(e)&&this.inlineObjectElements.includes(e.tagName.toLowerCase())}_createViewElement(e,t){if(no(e))return new ks(this.document,"$comment");const n=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new Ni(this.document,n)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return"editing"===this.renderingMode&&vo.includes(t)}_createReplacementDomElement(e,t=null){const n=document.createElement("span");if(n.setAttribute(Io,e),t){for(;t.firstChild;)n.appendChild(t.firstChild);for(const e of t.getAttributeNames())n.setAttribute(e,t.getAttribute(e))}return n}}function jo(e,t){for(;e&&e!=ho.document;)t(e),e=e.parentNode}function Co(e,t){const n=e.parentNode;return n&&n.tagName&&t.includes(n.tagName.toLowerCase())}function yo(e){"script"===e&&h("domconverter-unsafe-script-element-detected"),"style"===e&&h("domconverter-unsafe-style-element-detected")}function ko(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}const Ao=He({},_,{listenTo(e,t,n,i={}){if(io(e)||ko(e)){const s={capture:!!i.useCapture,passive:!!i.usePassive},o=this._getProxyEmitter(e,s)||new So(e,s);this.listenTo(o,t,n,i)}else _.listenTo.call(this,e,t,n,i)},stopListening(e,t,n){if(io(e)||ko(e)){const i=this._getAllProxyEmitters(e);for(const e of i)this.stopListening(e,t,n)}else _.stopListening.call(this,e,t,n)},_getProxyEmitter(e,t){return function(e,t){return e[p]&&e[p][t]?e[p][t].emitter:null}(this,Eo(e,t))},_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(t=>this._getProxyEmitter(e,t)).filter(e=>!!e)}}),wo=Ao;class So{constructor(e,t){I(this,Eo(e,t)),this._domNode=e,this._options=t}}function Eo(e,t){let n=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=a())}(e);for(const e of Object.keys(t).sort())t[e]&&(n+="-"+e);return n}He(So.prototype,_,{attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t},detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()},_addEventListener(e,t,n){this.attach(e),_._addEventListener.call(this,e,t,n)},_removeEventListener(e,t){_._removeEventListener.call(this,e,t),this.detach(e)},_createDomListener(e){const t=t=>{this.fire(e,t)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}});class To{constructor(e){this.view=e,this.document=e.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&3===e.nodeType&&(e=e.parentNode),!(!e||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}ot(To,wo);function zo(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Tt;++ta))return!1;var d=o.get(e),c=o.get(t);if(d&&c)return d==t&&c==e;var u=-1,h=!0,m=2&n?new Oo:void 0;for(o.set(e,t),o.set(t,e);++u{this.listenTo(e,t,(e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)},{useCapture:this.useCapture})})}fire(e,t,n){this.isEnabled&&this.document.fire(e,new Ko(this.view,t,n))}}class Xo extends Zo{constructor(e){super(e),this.domEventType=["keydown","keyup"]}onDomEvent(e){this.fire(e.type,e,{keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return bs(this)}})}}const Jo=function(){return T.Date.now()};var Qo=/\s/;var er=/^\s+/;const tr=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Qo.test(e.charAt(t)););return t}(e)+1).replace(er,""):e};var nr=/^[-+]0x[0-9a-f]+$/i,ir=/^0b[01]+$/i,sr=/^0o[0-7]+$/i,or=parseInt;const rr=function(e){if("number"==typeof e)return e;if(ri(e))return NaN;if(w(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=w(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tr(e);var n=ir.test(e);return n||sr.test(e)?or(e.slice(2),n?2:8):nr.test(e)?NaN:+e};var ar=Math.max,lr=Math.min;const dr=function(e,t,n){var i,s,o,r,a,l,d=0,c=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=i,o=s;return i=s=void 0,d=t,r=e.apply(o,n)}function g(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-d>=o}function p(){var e=Jo();if(g(e))return f(e);a=setTimeout(p,function(e){var n=t-(e-l);return u?lr(n,o-(e-d)):n}(e))}function f(e){return a=void 0,h&&i?m(e):(i=s=void 0,r)}function x(){var e=Jo(),n=g(e);if(i=arguments,s=this,l=e,n){if(void 0===a)return function(e){return d=e,a=setTimeout(p,t),c?m(e):r}(l);if(u)return clearTimeout(a),a=setTimeout(p,t),m(l)}return void 0===a&&(a=setTimeout(p,t)),r}return t=rr(t)||0,w(n)&&(c=!!n.leading,o=(u="maxWait"in n)?ar(rr(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),x.cancel=function(){void 0!==a&&clearTimeout(a),d=0,i=l=s=a=void 0},x.flush=function(){return void 0===a?r:f(Jo())},x};class cr extends To{constructor(e){super(e),this._fireSelectionChangeDoneDebounced=dr(e=>this.document.fire("selectionChangeDone",e),200)}observe(){const e=this.document;e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&n.preventDefault()},{context:"$capture"}),e.on("arrowKey",(t,n)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(n.keyCode)},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,n=new Xi(t.getRanges(),{backward:t.isBackward,fake:!1});e!=Is.arrowleft&&e!=Is.arrowup||n.setTo(n.getFirstPosition()),e!=Is.arrowright&&e!=Is.arrowdown||n.setTo(n.getLastPosition());const i={oldSelection:t,newSelection:n,domSelection:null};this.document.fire("selectionChange",i),this._fireSelectionChangeDoneDebounced(i)}}class ur extends To{constructor(e){super(e),this.mutationObserver=e.getObserver(Yo),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=dr(e=>this.document.fire("selectionChangeDone",e),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=dr(()=>this.document.isSelecting=!1,5e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument,n=()=>{this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel()};this.listenTo(e,"selectstart",()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},{priority:"highest"}),this.listenTo(e,"keydown",n,{priority:"highest"}),this.listenTo(e,"keyup",n,{priority:"highest"}),this._documents.has(t)||(this.listenTo(t,"mouseup",n,{priority:"highest"}),this.listenTo(t,"selectionchange",(e,n)=>{this._handleSelectionChange(n,t),this._documentIsSelectingInactivityTimeoutDebounced()}),this._documents.add(t))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_handleSelectionChange(e,t){if(!this.isEnabled)return;const n=t.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(n.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(n);if(0!=i.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(n)||++this._loopbackCounter>60))if(this.selection.isSimilar(i))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:i,domSelection:n};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class hr extends Zo{constructor(e){super(e),this.domEventType=["focus","blur"],this.useCapture=!0;const t=this.document;t.on("focus",()=>{t.isFocused=!0,this._renderTimeoutId=setTimeout(()=>e.change(()=>{}),50)}),t.on("blur",(n,i)=>{const s=t.selection.editableElement;null!==s&&s!==i.target||(t.isFocused=!1,e.change(()=>{}))})}onDomEvent(e){this.fire(e.type,e)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class mr extends Zo{constructor(e){super(e),this.domEventType=["compositionstart","compositionupdate","compositionend"];const t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e)}}class gr extends Zo{constructor(e){super(e),this.domEventType=["beforeinput"]}onDomEvent(e){this.fire(e.type,e)}}class pr{constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach(({element:e,newElement:t})=>{e.style.display="",t&&t.remove()}),this._replacedElements=[]}}function fr(e){return"[object Range]"==Object.prototype.toString.apply(e)}function xr(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}const _r=["top","right","bottom","left","width","height"];class Ir{constructor(e){const t=fr(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),Mn(e)||t)if(t){const t=Ir.getDomRangeRects(e);vr(this,Ir.getBoundingRect(t))}else vr(this,e.getBoundingClientRect());else if(ko(e)){const{innerWidth:t,innerHeight:n}=e;vr(this,{top:0,right:t,bottom:n,left:0,width:t,height:n})}else vr(this,e)}clone(){return new Ir(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left)};return t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0?null:new Ir(t)}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(!br(e)){let n=e.parentNode||e.commonAncestorContainer;for(;n&&!br(n);){const e=new Ir(n),i=t.getIntersection(e);if(!i)return null;i.getArea(){for(const t of e){const e=jr._getElementCallbacks(t.target);if(e)for(const n of e)n(t)}})}}jr._observerInstance=null,jr._elementCallbacks=null;class Cr{constructor(e){this._callback=e,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(e){this._elements.add(e),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(e){this._elements.delete(e),this._previousRects.delete(e),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const e=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(e,100)};this.listenTo(ho.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(e,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const e=[];for(const t of this._elements)this._hasRectChanged(t)&&e.push({target:t,contentRect:this._previousRects.get(t)});e.length&&this._callback(e)}_hasRectChanged(e){if(!e.ownerDocument.body.contains(e))return!1;const t=new Ir(e),n=this._previousRects.get(e),i=!n||!n.isEqual(t);return this._previousRects.set(e,t),i}}function yr({target:e,viewportOffset:t=0}){const n=zr(e);let i=n,s=null;for(;i;){let o;o=Or(i==n?e:s),Ar(o,()=>Rr(e,i));const r=Rr(e,i);if(kr(i,r,t),i.parent!=i){if(s=i.frameElement,i=i.parent,!s)return}else i=null}}function kr(e,t,n){const i=t.clone().moveBy(0,n),s=t.clone().moveBy(0,-n),o=new Ir(e).excludeScrollbarsAndBorders();if(![s,i].every(e=>o.contains(e))){let{scrollX:r,scrollY:a}=e;Sr(s,o)?a-=o.top-t.top+n:wr(i,o)&&(a+=t.bottom-o.bottom+n),Er(t,o)?r-=o.left-t.left+n:Tr(t,o)&&(r+=t.right-o.right+n),e.scrollTo(r,a)}}function Ar(e,t){const n=zr(e);let i,s;for(;e!=n.document.body;)s=t(),i=new Ir(e).excludeScrollbarsAndBorders(),i.contains(s)||(Sr(s,i)?e.scrollTop-=i.top-s.top:wr(s,i)&&(e.scrollTop+=s.bottom-i.bottom),Er(s,i)?e.scrollLeft-=i.left-s.left:Tr(s,i)&&(e.scrollLeft+=s.right-i.right)),e=e.parentNode}function wr(e,t){return e.bottom>t.bottom}function Sr(e,t){return e.topt.right}function zr(e){return fr(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Or(e){if(fr(e)){let t=e.commonAncestorContainer;return Bs(t)&&(t=t.parentNode),t}return e.parentNode}function Rr(e,t){const n=zr(e),i=new Ir(e);if(n===t)return i;{let e=n;for(;e!=t;){const t=e.frameElement,n=new Ir(t).excludeScrollbarsAndBorders();i.moveBy(n.left,n.top),e=e.parent}}return i}function $r(e){const t=e.next();return t.done?null:t.value}ot(Cr,wo),Object.assign({},{scrollViewportToShowTarget:yr,scrollAncestorsToShowTarget:function(e){Ar(Or(e),()=>new Ir(e))}});class Dr{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(e){if(this._elements.has(e))throw new u("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>this._focus(e),{useCapture:!0}),this.listenTo(e,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(e)}remove(e){e===this.focusedElement&&this._blur(e),this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e))}destroy(){this.stopListening()}_focus(e){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=e,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}ot(Dr,wo),ot(Dr,Qe);class Pr{constructor(){this._listener=Object.create(wo)}listenTo(e){this._listener.listenTo(e,"keydown",(e,t)=>{this._listener.fire("_keydown:"+bs(t),t)})}set(e,t,n={}){const i=js(e),s=n.priority;this._listener.listenTo(this._listener,"_keydown:"+i,(e,n)=>{t(n,()=>{n.preventDefault(),n.stopPropagation(),e.stop()}),e.return=!0},{priority:s})}press(e){return!!this._listener.fire("_keydown:"+bs(e),e)}destroy(){this._listener.stopListening()}}class Fr extends To{constructor(e){super(e),this.document.on("keydown",(e,t)=>{if(this.isEnabled&&function(e){return e==Is.arrowright||e==Is.arrowleft||e==Is.arrowup||e==Is.arrowdown}(t.keyCode)){const n=new Qi(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(n,t),n.stop.called&&e.stop()}})}observe(){}}class Mr extends To{constructor(e){super(e);const t=this.document;t.on("keydown",(e,n)=>{if(!this.isEnabled||n.keyCode!=Is.tab||n.ctrlKey)return;const i=new Qi(t,"tab",t.selection.getFirstRange());t.fire(i,n),i.stop.called&&e.stop()})}observe(){}}class Nr{constructor(e){this.document=new as(e),this.domConverter=new bo(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new ao(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Ts(this.document),this.addObserver(Yo),this.addObserver(ur),this.addObserver(hr),this.addObserver(Xo),this.addObserver(cr),this.addObserver(mr),this.addObserver(Fr),this.addObserver(Mr),ps.isAndroid&&this.addObserver(gr),function(e){e.document.on("arrowKey",Ks,{priority:"low"})}(this),function(e){e.document.on("arrowKey",(t,n)=>function(e,t,n){if(t.keyCode==Is.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),i=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(i||t.shiftKey){const t=e.focusNode,s=e.focusOffset,o=n.domPositionToView(t,s);if(null===o)return;let r=!1;const a=o.getLastMatchingPosition(e=>(e.item.is("uiElement")&&(r=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement"))));if(r){const t=n.viewPositionToDom(a);i?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,n,e.domConverter),{priority:"low"})}(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(e,t="main"){const n=this.document.getRoot(t);n._name=e.tagName.toLowerCase();const i={};for(const{name:t,value:s}of Array.from(e.attributes))i[t]=s,"class"===t?this._writer.addClass(s.split(" "),n):this._writer.setAttribute(t,s,n);this._initialDomRootAttributes.set(e,i);const s=()=>{this._writer.setAttribute("contenteditable",!n.isReadOnly,n),n.isReadOnly?this._writer.addClass("ck-read-only",n):this._writer.removeClass("ck-read-only",n)};s(),this.domRoots.set(t,e),this.domConverter.bindElements(e,n),this._renderer.markToSync("children",n),this._renderer.markToSync("attributes",n),this._renderer.domDocuments.add(e.ownerDocument),n.on("change:children",(e,t)=>this._renderer.markToSync("children",t)),n.on("change:attributes",(e,t)=>this._renderer.markToSync("attributes",t)),n.on("change:text",(e,t)=>this._renderer.markToSync("text",t)),n.on("change:isReadOnly",()=>this.change(s)),n.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const n of this._observers.values())n.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:e})=>t.removeAttribute(e));const n=this._initialDomRootAttributes.get(t);for(const e in n)t.setAttribute(e,n[e]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[e,n]of this.domRoots)t.observe(n,e);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection(){const e=this.document.selection.getFirstRange();e&&yr({target:this.domConverter.viewRangeToDom(e),viewportOffset:20})}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new u("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){u.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return qi._createAt(e,t)}createPositionAfter(e){return qi._createAfter(e)}createPositionBefore(e){return qi._createBefore(e)}createRange(e,t){return new Yi(e,t)}createRangeOn(e){return Yi._createOn(e)}createRangeIn(e){return Yi._createIn(e)}createSelection(e,t,n){return new Xi(e,t,n)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}ot(Nr,Qe);class Lr{constructor(e){this.parent=null,this._attrs=ni(e)}get index(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildIndex(this)))throw new u("model-node-not-found-in-parent",this);return e}get startOffset(){let e;if(!this.parent)return null;if(null===(e=this.parent.getChildStartOffset(this)))throw new u("model-node-not-found-in-parent",this);return e}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}getCommonAncestor(e,t={}){const n=this.getAncestors(t),i=e.getAncestors(t);let s=0;for(;n[s]==i[s]&&n[s];)s++;return 0===s?null:n[s-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),n=e.getPath(),i=Xn(t,n);switch(i){case"prefix":return!0;case"extension":return!1;default:return t[i](e[t[0]]=t[1],e),{})),e}is(e){return"node"===e||"model:node"===e}_clone(){return new Lr(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=ni(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}}class Br extends Lr{constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}is(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new Br(this.data,this.getAttributes())}static fromJSON(e){return new Br(e.data,e.attributes)}}class Vr{constructor(e,t,n){if(this.textNode=e,t<0||t>e.offsetSize)throw new u("model-textproxy-wrong-offsetintext",this);if(n<0||t+n>e.offsetSize)throw new u("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+n),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={includeSelf:!1,parentFirst:!1}){const t=[];let n=e.includeSelf?this:this.parent;for(;n;)t[e.parentFirst?"push":"unshift"](n),n=n.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class Ur{constructor(e){this._nodes=[],e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((e,t)=>e+t.offsetSize,0)}getNode(e){return this._nodes[e]||null}getNodeIndex(e){const t=this._nodes.indexOf(e);return-1==t?null:t}getNodeStartOffset(e){const t=this.getNodeIndex(e);return null===t?null:this._nodes.slice(0,t).reduce((e,t)=>e+t.offsetSize,0)}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new u("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){let t=0;for(const n of this._nodes){if(e>=t&&ee.toJSON())}}class Wr extends Lr{constructor(e,t,n){super(t),this.name=e,this._children=new Ur,n&&this._insertChild(0,n)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(e,t=null){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}findAncestor(e,t={includeSelf:!1}){let n=t.includeSelf?this:this.parent;for(;n;){if(n.name===e)return n;n=n.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map(e=>e._clone(!0)):null;return new Wr(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(e){return"string"==typeof e?[new Br(e)]:(Vn(e)||(e=[e]),Array.from(e).map(e=>"string"==typeof e?new Br(e):e instanceof Vr?new Br(e.data,e.getAttributes()):e))}(t);for(const e of n)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n)e.parent=null;return n}static fromJSON(e){let t=null;if(e.children){t=[];for(const n of e.children)n.name?t.push(Wr.fromJSON(n)):t.push(Br.fromJSON(n))}return new Wr(e.name,e.attributes,t)}}class Gr{constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new u("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new u("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this.position=e.startPosition.clone():this.position=qr._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(e){let t,n,i,s;do{i=this.position,s=this._visitedParent,({done:t,value:n}=this.next())}while(!t&&e(n));t||(this.position=i,this._visitedParent=s)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),n=this._visitedParent;if(null===n.parent&&t.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};const i=Yr(t,n),s=i||Kr(t,n,i);if(s instanceof Wr)return this.shallow?t.offset++:(t.path.push(0),this._visitedParent=s),this.position=t,Hr("elementStart",s,e,t,1);if(s instanceof Br){let i;if(this.singleCharacters)i=1;else{let e=s.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),i=t.offset-e}const s=t.offset-o.startOffset,r=new Vr(o,s-i,i);return t.offset-=i,this.position=t,Hr("text",r,e,t,i)}return t.path.pop(),this.position=t,this._visitedParent=n.parent,Hr("elementStart",n,e,t,1)}}function Hr(e,t,n,i,s){return{done:!1,value:{type:e,item:t,previousPosition:n,nextPosition:i,length:s}}}class qr{constructor(e,t,n="toNone"){if(!e.is("element")&&!e.is("documentFragment"))throw new u("model-position-root-invalid",e);if(!(t instanceof Array)||0===t.length)throw new u("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=n}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;tn.path.length){if(t.offset!==i.maxOffset)return!1;t.path=t.path.slice(0,-1),i=i.parent,t.offset++}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1)}}}is(e){return"position"===e||"model:position"===e}hasSameParentAs(e){return this.root===e.root&&"same"==Xn(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=qr._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let n;return t.containsPosition(this)||t.start.isEqual(this)?(n=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(n=n._getTransformedByDeletion(e.deletionPosition,1))):n=this.isEqual(e.deletionPosition)?qr._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),n}_getTransformedByDeletion(e,t){const n=qr._createAt(this);if(this.root!=e.root)return n;if("same"==Xn(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;n.offset-=t}}else if("prefix"==Xn(e.getParentPath(),this.getParentPath())){const i=e.path.length-1;if(e.offset<=this.path[i]){if(e.offset+t>this.path[i])return null;n.path[i]-=t}}return n}_getTransformedByInsertion(e,t){const n=qr._createAt(this);if(this.root!=e.root)return n;if("same"==Xn(e.getParentPath(),this.getParentPath()))(e.offsett+1;){const t=i.maxOffset-n.offset;0!==t&&e.push(new Xr(n,n.getShiftedBy(t))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent}for(;n.path.length<=this.end.path.length;){const t=this.end.path[n.path.length-1],i=t-n.offset;0!==i&&e.push(new Xr(n,n.getShiftedBy(i))),n.offset=t,n.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Gr(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Gr(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new Gr(e);yield t.position;for(const e of t)yield e.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new Xr(this.start,this.end)]}getTransformedByOperations(e){const t=[new Xr(this.start,this.end)];for(const n of e)for(let e=0;e0?new this(n,i):new this(i,n)}static _createIn(e){return new this(qr._createAt(e,0),qr._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(qr._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new u("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort((e,t)=>e.start.isAfter(t.start)?1:-1);const n=e.indexOf(t),i=new this(t.start,t.end);if(n>0)for(let t=n-1;e[t].end.isEqual(i.start);t++)i.start=qr._createAt(e[t].start);for(let t=n+1;t{if(t.viewPosition)return;const n=this._modelToViewMapping.get(t.modelPosition.parent);if(!n)throw new u("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(n,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;const n=this.findMappedViewAncestor(t.viewPosition),i=this._viewToModelMapping.get(n),s=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,n);t.modelPosition=qr._createAt(i,s)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const n=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const t of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(t);t.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e),this._modelToViewMapping.get(n)==e&&this._modelToViewMapping.delete(n))}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const n=this._markerNameToElements.get(t)||new Set;n.add(e);const i=this._elementToMarkerNames.get(e)||new Set;i.add(t),this._markerNameToElements.set(t,n),this._elementToMarkerNames.set(e,i)}unbindElementFromMarkerName(e,t){const n=this._markerNameToElements.get(t);n&&(n.delete(e),0==n.size&&this._markerNameToElements.delete(t));const i=this._elementToMarkerNames.get(e);i&&(i.delete(t),0==i.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new Xr(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new Yi(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={isPhantom:!1}){const n={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",n),n.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const n=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())n.add(t);else n.add(e);return n}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,n){if(n!=e)return this._toModelOffset(e.parent,e.index,n)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let i=0;for(let n=0;n1?t[0]+":"+t[1]:t[0]}class ta{constructor(e){this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,n){const i=this._createConversionApi(n,e.getRefreshedItems());for(const t of e.getMarkersToRemove())this._convertMarkerRemove(t.name,t.range,i);const s=this._reduceChanges(e.getChanges());for(const e of s)"insert"===e.type?this._convertInsert(Xr._createFromPositionAndShift(e.position,e.length),i):"reinsert"===e.type?this._convertReinsert(Xr._createFromPositionAndShift(e.position,e.length),i):"remove"===e.type?this._convertRemove(e.position,e.length,e.name,i):this._convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,i);for(const e of i.mapper.flushUnboundMarkerNames()){const n=t.get(e).getRange();this._convertMarkerRemove(e,n,i),this._convertMarkerAdd(e,n,i)}for(const t of e.getMarkersToAdd())this._convertMarkerAdd(t.name,t.range,i);i.mapper.flushDeferredBindings(),i.consumable.verifyAllConsumed("insert")}convert(e,t,n,i={}){const s=this._createConversionApi(n,void 0,i);this._convertInsert(e,s);for(const[e,n]of t)this._convertMarkerAdd(e,n,s);s.consumable.verifyAllConsumed("insert")}convertSelection(e,t,n){const i=Array.from(t.getMarkersAtPosition(e.getFirstPosition())),s=this._createConversionApi(n);if(this._addConsumablesForSelection(s.consumable,e,i),this.fire("selection",{selection:e},s),e.isCollapsed){for(const t of i){const n=t.getRange();if(!na(e.getFirstPosition(),t,s.mapper))continue;const i={item:e,markerName:t.name,markerRange:n};s.consumable.test(e,"addMarker:"+t.name)&&this.fire("addMarker:"+t.name,i,s)}for(const t of e.getAttributeKeys()){const n={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};s.consumable.test(e,"attribute:"+n.attributeKey)&&this.fire("attribute:"+n.attributeKey+":$text",n,s)}}}_convertInsert(e,t,n={}){n.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,Array.from(e));for(const n of Array.from(e.getWalker({shallow:!0})).map(ia))this._testAndFire("insert",n,t)}_convertRemove(e,t,n,i){this.fire("remove:"+n,{position:e,length:t},i)}_convertAttribute(e,t,n,i,s){this._addConsumablesForRange(s.consumable,e,`attribute:${t}`);for(const o of e){const e={item:o.item,range:Xr._createFromPositionAndShift(o.previousPosition,o.length),attributeKey:t,attributeOldValue:n,attributeNewValue:i};this._testAndFire(`attribute:${t}`,e,s)}}_convertReinsert(e,t){const n=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,n);for(const e of n.map(ia))this._testAndFire("insert",{...e,reconversion:!0},t)}_convertMarkerAdd(e,t,n){if("$graveyard"==t.root.rootName)return;const i="addMarker:"+e;if(n.consumable.add(t,i),this.fire(i,{markerName:e,markerRange:t},n),n.consumable.consume(t,i)){this._addConsumablesForRange(n.consumable,t,i);for(const s of t.getItems()){if(!n.consumable.test(s,i))continue;const o={item:s,range:Xr._createOn(s),markerName:e,markerRange:t};this.fire(i,o,n)}}}_convertMarkerRemove(e,t,n){"$graveyard"!=t.root.rootName&&this.fire("removeMarker:"+e,{markerName:e,markerRange:t},n)}_reduceChanges(e){const t={changes:e};return this.fire("reduceChanges",t),t.changes}_addConsumablesForInsert(e,t){for(const n of t){const t=n.item;if(null===e.test(t,"insert")){e.add(t,"insert");for(const n of t.getAttributeKeys())e.add(t,"attribute:"+n)}}return e}_addConsumablesForRange(e,t,n){for(const i of t.getItems())e.add(i,n);return e}_addConsumablesForSelection(e,t,n){e.add(t,"selection");for(const i of n)e.add(t,"addMarker:"+i.name);for(const n of t.getAttributeKeys())e.add(t,"attribute:"+n);return e}_testAndFire(e,t,n){const i=function(e,t){return`${e}:${t.item.name||"$text"}`}(e,t),s=t.item.is("$textProxy")?n.consumable._getSymbolForTextProxy(t.item):t.item,o=this._firedEventsMap.get(n),r=o.get(s);if(r){if(r.has(i))return;r.add(i)}else o.set(s,new Set([i]));this.fire(i,t,n)}_testAndFireAddAttributes(e,t){const n={item:e,range:Xr._createOn(e)};for(const e of n.item.getAttributeKeys())n.attributeKey=e,n.attributeOldValue=null,n.attributeNewValue=n.item.getAttribute(e),this._testAndFire(`attribute:${e}`,n,t)}_createConversionApi(e,t=new Set,n={}){const i={...this._conversionApi,consumable:new Qr,writer:e,options:n,convertItem:e=>this._convertInsert(Xr._createOn(e),i),convertChildren:e=>this._convertInsert(Xr._createIn(e),i,{doNotAddConsumables:!0}),convertAttributes:e=>this._testAndFireAddAttributes(e,i),canReuseView:e=>!t.has(i.mapper.toModelElement(e))};return this._firedEventsMap.set(i,new Map),i}}function na(e,t,n){const i=t.getRange(),s=Array.from(e.getAncestors());s.shift(),s.reverse();const o=s.some(e=>{if(i.containsItem(e))return!!n.toViewElement(e).getCustomProperty("addHighlight")});return!o}function ia(e){return{item:e.item,range:Xr._createFromPositionAndShift(e.previousPosition,e.length)}}ot(ta,_);class sa{constructor(e,t,n){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,e&&this.setTo(e,t,n)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let n=!1;for(const i of e._ranges)if(t.isEqual(i)){n=!0;break}if(!n)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new Xr(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new Xr(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new Xr(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(e,t,n){if(null===e)this._setRanges([]);else if(e instanceof sa)this._setRanges(e.getRanges(),e.isBackward);else if(e&&"function"==typeof e.getRanges)this._setRanges(e.getRanges(),e.isBackward);else if(e instanceof Xr)this._setRanges([e],!!t&&!!t.backward);else if(e instanceof qr)this._setRanges([new Xr(e)]);else if(e instanceof Lr){const i=!!n&&!!n.backward;let s;if("in"==t)s=Xr._createIn(e);else if("on"==t)s=Xr._createOn(e);else{if(void 0===t)throw new u("model-selection-setto-required-second-parameter",[this,e]);s=new Xr(qr._createAt(e,t))}this._setRanges([s],i)}else{if(!Vn(e))throw new u("model-selection-setto-not-selectable",[this,e]);this._setRanges(e,t&&!!t.backward)}}_setRanges(e,t=!1){const n=(e=Array.from(e)).some(t=>{if(!(t instanceof Xr))throw new u("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every(e=>!e.isEqual(t))});if(e.length!==this._ranges.length||n){this._removeAllRanges();for(const t of e)this._pushRange(t);this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0})}}setFocus(e,t){if(null===this.anchor)throw new u("model-selection-setfocus-no-ranges",[this,e]);const n=qr._createAt(e,t);if("same"==n.compareWith(this.focus))return;const i=this.anchor;this._ranges.length&&this._popRange(),"before"==n.compareWith(i)?(this._pushRange(new Xr(n,i)),this._lastRangeBackward=!0):(this._pushRange(new Xr(i,n)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(e){return"selection"===e||"model:selection"===e}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const n=aa(t.start,e);n&&la(n,t)&&(yield n);for(const n of t.getWalker()){const i=n.item;"elementEnd"==n.type&&ra(i,e,t)&&(yield i)}const i=aa(t.end,e);i&&!t.end.isTouching(qr._createAt(i,0))&&la(i,t)&&(yield i)}}containsEntireContent(e=this.anchor.root){const t=qr._createAt(e,0),n=qr._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new Xr(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function oa(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&e.parent)}function ra(e,t,n){return oa(e,t)&&la(e,n)}function aa(e,t){const n=e.parent.root.document.model.schema,i=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let s=!1;const o=i.find(e=>!s&&(s=n.isLimit(e),!s&&oa(e,t)));return i.forEach(e=>t.add(e)),o}function la(e,t){const n=function(e){const t=e.root.document.model.schema;let n=e.parent;for(;n;){if(t.isBlock(n))return n;n=n.parent}}(e);return!n||!t.containsRange(Xr._createOn(n),!0)}ot(sa,_);class da extends Xr{constructor(e,t){super(e,t),ca.call(this)}detach(){this.stopListening()}is(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e}toRange(){return new Xr(this.start,this.end)}static fromRange(e){return new da(e.start,e.end)}}function ca(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&ua.call(this,n)},{priority:"low"})}function ua(e){const t=this.getTransformedByOperation(e),n=Xr._createFromRanges(t),i=!n.isEqual(this),s=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let o=null;if(i){"$graveyard"==n.root.rootName&&(o="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=n.start,this.end=n.end,this.fire("change:range",t,{deletionPosition:o})}else s&&this.fire("change:content",this.toRange(),{deletionPosition:o})}ot(da,_);const ha="selection:";class ma{constructor(e){this._selection=new ga(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}is(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(e,t,n){this._selection.setTo(e,t,n)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return ha+e}static _isStoreAttributeKey(e){return e.startsWith(ha)}}ot(ma,_);class ga extends sa{constructor(e){super(),this.markers=new Un({idProperty:"name"}),this._model=e.model,this._document=e,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&"marker"!=n.type&&"rename"!=n.type&&"noop"!=n.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const e of this.getRanges())if(!this._document._validateSelectionRange(e))throw new u("document-selection-wrong-position",this,{range:e})}),this.listenTo(this._model.markers,"update",(e,t,n,i)=>{this._updateMarker(t,i)}),this.listenTo(this._document,"change",(e,t)=>{!function(e,t){const n=e.document.differ;for(const i of n.getChanges()){if("insert"!=i.type)continue;const n=i.position.parent;i.length===n.maxOffset&&e.enqueueChange(t,e=>{const t=Array.from(n.getAttributeKeys()).filter(e=>e.startsWith(ha));for(const i of t)e.removeAttribute(i,n)})}}(this._model,t)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=i.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}}),t}_updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const t of this._model.markers){const n=t.name.split(":",1)[0];if(!this._observedMarkers.has(n))continue;const i=t.getRange();for(const n of this.getRanges())i.containsRange(n,!n.isCollapsed)&&e.push(t)}const n=Array.from(this.markers);for(const n of e)this.markers.has(n)||(this.markers.add(n),t=!0);for(const n of Array.from(this.markers))e.includes(n)||(this.markers.remove(n),t=!0);t&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateMarker(e,t){const n=e.name.split(":",1)[0];if(!this._observedMarkers.has(n))return;let i=!1;const s=Array.from(this.markers),o=this.markers.has(e);if(t){let n=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){n=!0;break}n&&!o?(this.markers.add(e),i=!0):!n&&o&&(this.markers.remove(e),i=!0)}else o&&(this.markers.remove(e),i=!0);i&&this.fire("change:marker",{oldMarkers:s,directChange:!1})}_updateAttributes(e){const t=ni(this._getSurroundingAttributes()),n=ni(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const i=[];for(const[e,t]of this.getAttributes())n.has(e)&&n.get(e)===t||i.push(e);for(const[e]of n)this.hasAttribute(e)||i.push(e);i.length>0&&this.fire("change:attribute",{attributeKeys:i,directChange:!1})}_setAttribute(e,t,n=!0){const i=n?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(e))&&super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,i),!0)}_removeAttribute(e,t=!0){const n=t?"normal":"low";return!("low"==n&&"normal"==this._attributePriority.get(e)||(this._attributePriority.set(e,n),!super.hasAttribute(e)||(this._attrs.delete(e),0)))}_setAttributesTo(e){const t=new Set;for(const[t,n]of this.getAttributes())e.get(t)!==n&&this._removeAttribute(t,!1);for(const[n,i]of e)this._setAttribute(n,i,!1)&&t.add(n);return t}*_getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(ha)){const n=t.substr(10);yield[n,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;let n=null;if(this.isCollapsed){const i=e.textNode?e.textNode:e.nodeBefore,s=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(n=pa(i)),n||(n=pa(s)),!this.isGravityOverridden&&!n){let e=i;for(;e&&!t.isInline(e)&&!n;)e=e.previousSibling,n=pa(e)}if(!n){let e=s;for(;e&&!t.isInline(e)&&!n;)e=e.nextSibling,n=pa(e)}n||(n=this._getStoredAttributes())}else{const e=this.getFirstRange();for(const i of e){if(i.item.is("element")&&t.isObject(i.item))break;if("text"==i.type){n=i.item.getAttributes();break}}}return n}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function pa(e){return e instanceof Vr||e instanceof Br?e.getAttributes():null}class fa{constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}const xa=function(e){return Pn(e,5)};class _a extends fa{elementToElement(e){return this.add(function(e){return(e=xa(e)).model=ba(e.model),e.view=ja(e.view,"container"),e.model.attributes.length&&(e.model.children=!0),t=>{t.on("insert:"+e.model.name,function(e,t=Ta){return(n,i,s)=>{if(!t(i.item,s.consumable,{preflight:!0}))return;const o=e(i.item,s,i);if(!o)return;t(i.item,s.consumable);const r=s.mapper.toViewPosition(i.range.start);s.mapper.bindElements(i.item,o),s.writer.insert(r,o),s.convertAttributes(i.item),Sa(o,i.item.getChildren(),s,{reconversion:i.reconversion})}}(e.view,wa(e.model)),{priority:e.converterPriority||"normal"}),(e.model.children||e.model.attributes.length)&&t.on("reduceChanges",Aa(e.model),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(e){return(e=xa(e)).model=ba(e.model),e.view=ja(e.view,"container"),e.model.children=!0,t=>{if(t._conversionApi.schema.checkChild(e.model.name,"$text"))throw new u("conversion-element-to-structure-disallowed-text",t,{elementName:e.model.name});t.on("insert:"+e.model.name,function(e,t){return(n,i,s)=>{if(!t(i.item,s.consumable,{preflight:!0}))return;const o=new Map;s.writer._registerSlotFactory(function(e,t,n){return(i,s="children")=>{const o=i.createContainerElement("$slot");let r=null;if("children"===s)r=Array.from(e.getChildren());else{if("function"!=typeof s)throw new u("conversion-slot-mode-unknown",n.dispatcher,{modeOrFilter:s});r=Array.from(e.getChildren()).filter(e=>s(e))}return t.set(o,r),o}}(i.item,o,s));const r=e(i.item,s,i);if(s.writer._clearSlotFactory(),!r)return;!function(e,t,n){const i=Array.from(t.values()).flat(),s=new Set(i);if(s.size!=i.length)throw new u("conversion-slot-filter-overlap",n.dispatcher,{element:e});if(s.size!=e.childCount)throw new u("conversion-slot-filter-incomplete",n.dispatcher,{element:e})}(i.item,o,s),t(i.item,s.consumable);const a=s.mapper.toViewPosition(i.range.start);s.mapper.bindElements(i.item,r),s.writer.insert(a,r),s.convertAttributes(i.item),function(e,t,n,i){n.mapper.on("modelToViewPosition",r,{priority:"highest"});let s=null,o=null;for([s,o]of t)Sa(e,o,n,i),n.writer.move(n.writer.createRangeIn(s),n.writer.createPositionBefore(s)),n.writer.remove(s);function r(e,t){const n=t.modelPosition.nodeAfter,i=o.indexOf(n);i<0||(t.viewPosition=t.mapper.findPositionIn(s,i))}n.mapper.off("modelToViewPosition",r)}(r,o,s,{reconversion:i.reconversion})}}(e.view,wa(e.model)),{priority:e.converterPriority||"normal"}),t.on("reduceChanges",Aa(e.model),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(e){let t="attribute:"+((e=xa(e)).model.key?e.model.key:e.model);if(e.model.name&&(t+=":"+e.model.name),e.model.values)for(const t of e.model.values)e.view[t]=ja(e.view[t],"attribute");else e.view=ja(e.view,"attribute");const n=Ca(e);return i=>{i.on(t,function(e){return(t,n,i)=>{if(!i.consumable.test(n.item,t.name))return;const s=e(n.attributeOldValue,i,n),o=e(n.attributeNewValue,i,n);if(!s&&!o)return;i.consumable.consume(n.item,t.name);const r=i.writer,a=r.document.selection;if(n.item instanceof sa||n.item instanceof ma)r.wrap(a.getFirstRange(),o);else{let e=i.mapper.toViewRange(n.range);null!==n.attributeOldValue&&s&&(e=r.unwrap(e,s)),null!==n.attributeNewValue&&o&&r.wrap(e,o)}}}(n),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t="attribute:"+((e=xa(e)).model.key?e.model.key:e.model);if(e.model.name&&(t+=":"+e.model.name),e.model.values)for(const t of e.model.values)e.view[t]=ya(e.view[t]);else e.view=ya(e.view);const n=Ca(e);return i=>{i.on(t,function(e){return(t,n,i)=>{if(!i.consumable.test(n.item,t.name))return;const s=e(n.attributeOldValue,i,n),o=e(n.attributeNewValue,i,n);if(!s&&!o)return;i.consumable.consume(n.item,t.name);const r=i.mapper.toViewElement(n.item),a=i.writer;if(!r)throw new u("conversion-attribute-to-attribute-on-text",i.dispatcher,n);if(null!==n.attributeOldValue&&s)if("class"==s.key){const e=Gn(s.value);for(const t of e)a.removeClass(t,r)}else if("style"==s.key){const e=Object.keys(s.value);for(const t of e)a.removeStyle(t,r)}else a.removeAttribute(s.key,r);if(null!==n.attributeNewValue&&o)if("class"==o.key){const e=Gn(o.value);for(const t of e)a.addClass(t,r)}else if("style"==o.key){const e=Object.keys(o.value);for(const t of e)a.setStyle(t,o.value[t],r)}else a.setAttribute(o.key,o.value,r)}}(n),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){return(e=xa(e)).view=ja(e.view,"ui"),t=>{t.on("addMarker:"+e.model,function(e){return(t,n,i)=>{n.isOpening=!0;const s=e(n,i);n.isOpening=!1;const o=e(n,i);if(!s||!o)return;const r=n.markerRange;if(r.isCollapsed&&!i.consumable.consume(r,t.name))return;for(const e of r)if(!i.consumable.consume(e.item,t.name))return;const a=i.mapper,l=i.writer;l.insert(a.toViewPosition(r.start),s),i.mapper.bindElementToMarker(s,n.markerName),r.isCollapsed||(l.insert(a.toViewPosition(r.end),o),i.mapper.bindElementToMarker(o,n.markerName)),t.stop()}}(e.view),{priority:e.converterPriority||"normal"}),t.on("removeMarker:"+e.model,(e.view,(e,t,n)=>{const i=n.mapper.markerNameToElements(t.markerName);if(i){for(const e of i)n.mapper.unbindElementFromMarkerName(e,t.markerName),n.writer.clear(n.writer.createRangeOn(e),e);n.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{t.on("addMarker:"+e.model,function(e){return(t,n,i)=>{if(!n.item)return;if(!(n.item instanceof sa||n.item instanceof ma||n.item.is("$textProxy")))return;const s=ka(e,n,i);if(!s)return;if(!i.consumable.consume(n.item,t.name))return;const o=i.writer,r=Ia(o,s),a=o.document.selection;if(n.item instanceof sa||n.item instanceof ma)o.wrap(a.getFirstRange(),r,a);else{const e=i.mapper.toViewRange(n.range),t=o.wrap(e,r);for(const e of t.getItems())if(e.is("attributeElement")&&e.isSimilar(r)){i.mapper.bindElementToMarker(e,n.markerName);break}}}}(e.view),{priority:e.converterPriority||"normal"}),t.on("addMarker:"+e.model,function(e){return(t,n,i)=>{if(!n.item)return;if(!(n.item instanceof Wr))return;const s=ka(e,n,i);if(!s)return;if(!i.consumable.test(n.item,t.name))return;const o=i.mapper.toViewElement(n.item);if(o&&o.getCustomProperty("addHighlight")){i.consumable.consume(n.item,t.name);for(const e of Xr._createIn(n.item))i.consumable.consume(e.item,t.name);o.getCustomProperty("addHighlight")(o,s,i.writer),i.mapper.bindElementToMarker(o,n.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on("removeMarker:"+e.model,function(e){return(t,n,i)=>{if(n.markerRange.isCollapsed)return;const s=ka(e,n,i);if(!s)return;const o=Ia(i.writer,s),r=i.mapper.markerNameToElements(n.markerName);if(r){for(const e of r)i.mapper.unbindElementFromMarkerName(e,n.markerName),e.is("attributeElement")?i.writer.unwrap(i.writer.createRangeOn(e),o):e.getCustomProperty("removeHighlight")(e,s.id,i.writer);i.writer.clearClonedElementsGroup(n.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){const t=(e=xa(e)).model;return e.view||(e.view=n=>({group:t,name:n.substr(e.model.length+1)})),n=>{n.on("addMarker:"+t,function(e){return(t,n,i)=>{const s=e(n.markerName,i);if(!s)return;const o=n.markerRange;i.consumable.consume(o,t.name)&&(va(o,!1,i,n,s),va(o,!0,i,n,s),t.stop())}}(e.view),{priority:e.converterPriority||"normal"}),n.on("removeMarker:"+t,function(e){return(t,n,i)=>{const s=e(n.markerName,i);if(!s)return;const o=i.mapper.markerNameToElements(n.markerName);if(o){for(const e of o)i.mapper.unbindElementFromMarkerName(e,n.markerName),e.is("containerElement")?(r(`data-${s.group}-start-before`,e),r(`data-${s.group}-start-after`,e),r(`data-${s.group}-end-before`,e),r(`data-${s.group}-end-after`,e)):i.writer.clear(i.writer.createRangeOn(e),e);i.writer.clearClonedElementsGroup(n.markerName),t.stop()}function r(e,t){if(t.hasAttribute(e)){const n=new Set(t.getAttribute(e).split(","));n.delete(s.name),0==n.size?i.writer.removeAttribute(e,t):i.writer.setAttribute(e,Array.from(n).join(","),t)}}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}}function Ia(e,t){const n=e.createAttributeElement("span",t.attributes);return t.classes&&n._addClass(t.classes),"number"==typeof t.priority&&(n._priority=t.priority),n._id=t.id,n}function va(e,t,n,i,s){const o=t?e.start:e.end,r=o.nodeAfter&&o.nodeAfter.is("element")?o.nodeAfter:null,a=o.nodeBefore&&o.nodeBefore.is("element")?o.nodeBefore:null;if(r||a){let e,o;t&&r||!t&&!a?(e=r,o=!0):(e=a,o=!1);const l=n.mapper.toViewElement(e);if(l)return void function(e,t,n,i,s,o){const r=`data-${o.group}-${t?"start":"end"}-${n?"before":"after"}`,a=e.hasAttribute(r)?e.getAttribute(r).split(","):[];a.unshift(o.name),i.writer.setAttribute(r,a.join(","),e),i.mapper.bindElementToMarker(e,s.markerName)}(l,t,o,n,i,s)}!function(e,t,n,i,s){const o=`${s.group}-${t?"start":"end"}`,r=s.name?{name:s.name}:null,a=n.writer.createUIElement(o,r);n.writer.insert(e,a),n.mapper.bindElementToMarker(a,i.markerName)}(n.mapper.toViewPosition(o),t,n,i,s)}function ba(e){return"string"==typeof e&&(e={name:e}),e.attributes?Array.isArray(e.attributes)||(e.attributes=[e.attributes]):e.attributes=[],e.children=!!e.children,e}function ja(e,t){return"function"==typeof e?e:(n,i)=>function(e,t,n){let i;"string"==typeof e&&(e={name:e});const s=t.writer,o=Object.assign({},e.attributes);if("container"==n)i=s.createContainerElement(e.name,o);else if("attribute"==n){const t={priority:e.priority||ls.DEFAULT_PRIORITY};i=s.createAttributeElement(e.name,o,t)}else i=s.createUIElement(e.name,o);if(e.styles){const t=Object.keys(e.styles);for(const n of t)s.setStyle(n,e.styles[n],i)}if(e.classes){const t=e.classes;if("string"==typeof t)s.addClass(t,i);else for(const e of t)s.addClass(e,i)}return i}(e,i,t)}function Ca(e){return e.model.values?(t,n)=>{const i=e.view[t];return i?i(t,n):null}:e.view}function ya(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function ka(e,t,n){const i="function"==typeof e?e(t,n):e;return i?(i.priority||(i.priority=10),i.id||(i.id=t.markerName),i):null}function Aa(e){const t=function(e){return(t,n)=>{if(!t.is("element",e.name))return!1;if("attribute"==n.type){if(e.attributes.includes(n.attributeKey))return!0}else if(e.children)return!0;return!1}}(e);return(e,n)=>{const i=[];n.reconvertedElements||(n.reconvertedElements=new Set);for(const e of n.changes){const s=e.position?e.position.parent:e.range.start.nodeAfter;if(s&&t(s,e)){if(!n.reconvertedElements.has(s)){n.reconvertedElements.add(s);const e=qr._createBefore(s);i.push({type:"remove",name:s.name,position:e,length:1},{type:"reinsert",name:s.name,position:e,length:1})}}else i.push(e)}n.changes=i}}function wa(e){return(t,n,i={})=>{const s=["insert"];for(const n of e.attributes)t.hasAttribute(n)&&s.push(`attribute:${n}`);return!!s.every(e=>n.test(t,e))&&(i.preflight||s.forEach(e=>n.consume(t,e)),!0)}}function Sa(e,t,n,i){for(const s of t)Ea(e.root,s,n,i)||n.convertItem(s)}function Ea(e,t,n,i){const{writer:s,mapper:o}=n;if(!i.reconversion)return!1;const r=o.toViewElement(t);return!(!r||r.root==e||!n.canReuseView(r)||(s.move(s.createRangeOn(r),o.toViewPosition(qr._createBefore(t))),0))}function Ta(e,t,{preflight:n}={}){return n?t.test(e,"insert"):t.consume(e,"insert")}function za(e){const{schema:t,document:n}=e.model;for(const i of n.getRootNames()){const s=n.getRoot(i);if(s.isEmpty&&!t.checkChild(s,"$text")&&t.checkChild(s,"paragraph"))return e.insertElement("paragraph",s),!0}return!1}function Oa(e,t,n){const i=n.createContext(e);return!!n.checkChild(i,"paragraph")&&!!n.checkChild(i.push("paragraph"),t)}function Ra(e,t){const n=t.createElement("paragraph");return t.insert(n,e),t.createPositionAt(n,0)}class $a extends fa{elementToElement(e){return this.add(Da(e))}elementToAttribute(e){return this.add(function(e){Ma(e=xa(e));const t=Na(e,!1),n=Pa(e.view),i=n?"element:"+n:"element";return n=>{n.on(i,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){let t=null;("string"==typeof(e=xa(e)).view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key;let n;if("class"==t||"style"==t){const i="class"==t?"classes":"styles";n={[i]:e.view.value}}else{const i=void 0===e.view.value?/[\s\S]*/:e.view.value;n={attributes:{[t]:i}}}return e.view.name&&(n.name=e.view.name),e.view=n,t}(e)),Ma(e,t);const n=Na(e,!0);return t=>{t.on("element",n,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){return function(e){const t=e.model;e.model=(e,n)=>{const i="string"==typeof t?t:t(e,n);return n.writer.createElement("$marker",{"data-name":i})}}(e=xa(e)),Da(e)}(e))}dataToMarker(e){return this.add(function(e){(e=xa(e)).model||(e.model=t=>t?e.view+":"+t:e.view);const t=Fa(La(e,"start")),n=Fa(La(e,"end"));return i=>{i.on("element:"+e.view+"-start",t,{priority:e.converterPriority||"normal"}),i.on("element:"+e.view+"-end",n,{priority:e.converterPriority||"normal"});const s=d.get("low"),o=d.get("highest"),r=d.get(e.converterPriority)/o;i.on("element",function(e){return(t,n,i)=>{const s=`data-${e.view}`;function o(t,s){for(const o of s){const s=e.model(o,i),r=i.writer.createElement("$marker",{"data-name":s});i.writer.insert(r,t),n.modelCursor.isEqual(t)?n.modelCursor=n.modelCursor.getShiftedBy(1):n.modelCursor=n.modelCursor._getTransformedByInsertion(t,1),n.modelRange=n.modelRange._getTransformedByInsertion(t,1)[0]}}(i.consumable.test(n.viewItem,{attributes:s+"-end-after"})||i.consumable.test(n.viewItem,{attributes:s+"-start-after"})||i.consumable.test(n.viewItem,{attributes:s+"-end-before"})||i.consumable.test(n.viewItem,{attributes:s+"-start-before"}))&&(n.modelRange||Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor)),i.consumable.consume(n.viewItem,{attributes:s+"-end-after"})&&o(n.modelRange.end,n.viewItem.getAttribute(s+"-end-after").split(",")),i.consumable.consume(n.viewItem,{attributes:s+"-start-after"})&&o(n.modelRange.end,n.viewItem.getAttribute(s+"-start-after").split(",")),i.consumable.consume(n.viewItem,{attributes:s+"-end-before"})&&o(n.modelRange.start,n.viewItem.getAttribute(s+"-end-before").split(",")),i.consumable.consume(n.viewItem,{attributes:s+"-start-before"})&&o(n.modelRange.start,n.viewItem.getAttribute(s+"-start-before").split(",")))}}(e),{priority:s+r})}}(e))}}function Da(e){const t=Fa(e=xa(e)),n=Pa(e.view),i=n?"element:"+n:"element";return n=>{n.on(i,t,{priority:e.converterPriority||"normal"})}}function Pa(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function Fa(e){const t=new ii(e.view);return(n,i,s)=>{const o=t.match(i.viewItem);if(!o)return;const r=o.match;if(r.name=!0,!s.consumable.test(i.viewItem,r))return;const a=function(e,t,n){return e instanceof Function?e(t,n):n.writer.createElement(e)}(e.model,i.viewItem,s);a&&s.safeInsert(a,i.modelCursor)&&(s.consumable.consume(i.viewItem,r),s.convertChildren(i.viewItem,a),s.updateConversionResult(a,i))}}function Ma(e,t=null){const n=null===t||(e=>e.getAttribute(t)),i="object"!=typeof e.model?e.model:e.model.key,s="object"!=typeof e.model||void 0===e.model.value?n:e.model.value;e.model={key:i,value:s}}function Na(e,t){const n=new ii(e.view);return(i,s,o)=>{const r=n.match(s.viewItem);if(!r)return;if(function(e,t){const n="function"==typeof e?e(t):e;return!("object"==typeof n&&!Pa(n)||n.classes||n.attributes||n.styles)}(e.view,s.viewItem)?r.match.name=!0:delete r.match.name,!o.consumable.test(s.viewItem,r.match))return;const a=e.model.key,l="function"==typeof e.model.value?e.model.value(s.viewItem,o):e.model.value;if(null===l)return;s.modelRange||Object.assign(s,o.convertChildren(s.viewItem,s.modelCursor));const d=function(e,t,n,i){let s=!1;for(const o of Array.from(e.getItems({shallow:n})))i.schema.checkAttribute(o,t.key)&&(s=!0,o.hasAttribute(t.key)||i.writer.setAttribute(t.key,t.value,o));return s}(s.modelRange,{key:a,value:l},t,o);d&&o.consumable.consume(s.viewItem,r.match)}}function La(e,t){const n={};return n.view=e.view+"-"+t,n.model=(t,n)=>{const i=t.getAttribute("name"),s=e.model(i,n);return n.writer.createElement("$marker",{"data-name":s})},n}class Ba{constructor(e,t){this.model=e,this.view=new Nr(t),this.mapper=new Jr,this.downcastDispatcher=new ta({mapper:this.mapper,schema:e.schema});const n=this.model.document,i=n.selection,s=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(n,"change",()=>{this.view.change(e=>{this.downcastDispatcher.convertChanges(n.differ,s,e),this.downcastDispatcher.convertSelection(i,s,e)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(n,i)=>{const s=i.newSelection,o=[];for(const e of s.getRanges())o.push(t.toModelRange(e));const r=e.createSelection(o,{backward:s.isBackward});r.isEqual(e.document.selection)||e.change(e=>{e.setSelection(r)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(e,t,n)=>{if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,s=n.mapper.toViewPosition(t.range.start),o=i.createText(t.item.data);i.insert(s,o)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(e,t,n)=>{n.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||n.convertChildren(t.item)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(e,t,n)=>{const i=n.mapper.toViewPosition(t.position),s=t.position.getShiftedBy(t.length),o=n.mapper.toViewPosition(s,{isPhantom:!0}),r=n.writer.createRange(i,o),a=n.writer.remove(r.getTrimmed());for(const e of n.writer.createRangeIn(a).getItems())n.mapper.unbindViewElement(e,{defer:!0})},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=n.writer,s=i.document.selection;for(const e of s.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&n.writer.mergeAttributes(e.start);i.setSelection(null)},{priority:"high"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=t.selection;if(i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const s=[];for(const e of i.getRanges()){const t=n.mapper.toViewRange(e);s.push(t)}n.writer.setSelection(s,{backward:i.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(e,t,n)=>{const i=t.selection;if(!i.isCollapsed)return;if(!n.consumable.consume(i,"selection"))return;const s=n.writer,o=i.getFirstPosition(),r=n.mapper.toViewPosition(o),a=s.breakAttributes(r);s.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(e=>{if("$graveyard"==e.rootName)return null;const t=new Gi(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t="string"==typeof e?e:e.name,n=this.model.markers.get(t);if(!n)throw new u("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change(()=>{this.model.markers._refresh(n)})}reconvertItem(e){this.model.change(()=>{this.model.document.differ._refreshItem(e)})}}ot(Ba,Qe);class Va{constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const n=this.get(e);if(!n)throw new u("commandcollection-command-not-found",this,{commandName:e});return n.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class Ua{constructor(){this._consumables=new Map}add(e,t){let n;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?n=this._consumables.get(e):(n=new Wa(e),this._consumables.set(e,n)),n.add(t))}test(e,t){const n=this._consumables.get(e);return void 0===n?null:e.is("$text")||e.is("documentFragment")?n:n.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const n=this._consumables.get(e);void 0!==n&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):n.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},n=e.getAttributeKeys();for(const e of n)"style"!=e&&"class"!=e&&t.attributes.push(e);const i=e.getClassNames();for(const e of i)t.classes.push(e);const s=e.getStyleNames();for(const e of s)t.styles.push(e);return t}static createFrom(e,t){if(t||(t=new Ua(e)),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,Ua.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const n of e.getChildren())t=Ua.createFrom(n,t);return t}}class Wa{constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t in this._consumables)if(t in e){const n=this._test(t,e[t]);if(!0!==n)return n}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t in this._consumables)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t in this._consumables)t in e&&this._revert(t,e[t])}_add(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n){if("attributes"===e&&("class"===t||"style"===t))throw new u("viewconsumable-invalid-attribute",this);if(i.set(t,!0),"styles"===e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))i.set(e,!0)}}_test(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t){const e=i.get(t);if(void 0===e)return null;if(!e)return!1}else{const e="class"==t?"classes":"styles",n=this._test(e,[...this._consumables[e].keys()]);if(!0!==n)return n}return!0}_consume(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t){if(i.set(t,!1),"styles"==e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))i.set(e,!1)}else{const e="class"==t?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}}_revert(e,t){const n=ke(t)?t:[t],i=this._consumables[e];for(const t of n)if("attributes"!==e||"class"!==t&&"style"!==t)!1===i.get(t)&&i.set(t,!0);else{const e="class"==t?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}}}class Ga{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new Ha(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new Ha(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new u("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new u("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:e.is&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!(!t||!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!(!t||!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!(!t||!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(t,e)}checkAttribute(e,t){const n=this.getDefinition(e.last);return!!n&&n.allowAttributes.includes(t)}checkMerge(e,t=null){if(e instanceof qr){const t=e.nodeBefore,n=e.nodeAfter;if(!(t instanceof Wr))throw new u("schema-check-merge-no-element-before",this);if(!(n instanceof Wr))throw new u("schema-check-merge-no-element-after",this);return this.checkMerge(t,n)}for(const n of t.getChildren())if(!this.checkChild(e,n))return!1;return!0}addChildCheck(e){this.on("checkChild",(t,[n,i])=>{if(!i)return;const s=e(n,i);"boolean"==typeof s&&(t.stop(),t.return=s)},{priority:"high"})}addAttributeCheck(e){this.on("checkAttribute",(t,[n,i])=>{const s=e(n,i);"boolean"==typeof s&&(t.stop(),t.return=s)},{priority:"high"})}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||{}}getLimitElement(e){let t;for(t=e instanceof qr?e.parent:(e instanceof Xr?[e]:Array.from(e.getRanges())).reduce((e,t)=>{const n=t.getCommonAncestor();return e?e.getCommonAncestor(n,{includeSelf:!0}):n},null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const n=[...e.getFirstPosition().getAncestors(),new Br("",e.getAttributes())];return this.checkAttribute(n,t)}{const n=e.getRanges();for(const e of n)for(const n of e)if(this.checkAttribute(n.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const n of e)yield*this._getValidRangesForRange(n,t)}getNearestSelectionRange(e,t="both"){if(this.checkChild(e,"$text"))return new Xr(e);let n,i;const s=e.getAncestors().reverse().find(e=>this.isLimit(e))||e.root;"both"!=t&&"backward"!=t||(n=new Gr({boundaries:Xr._createIn(s),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(i=new Gr({boundaries:Xr._createIn(s),startPosition:e}));for(const e of function*(e,t){let n=!1;for(;!n;){if(n=!0,e){const t=e.next();t.done||(n=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(n=!1,yield{walker:t,value:e.value})}}}(n,i)){const t=e.walker==n?"elementEnd":"elementStart",i=e.value;if(i.type==t&&this.isObject(i.item))return Xr._createOn(i.item);if(this.checkChild(i.nextPosition,"$text"))return new Xr(i.nextPosition)}return null}findAllowedParent(e,t){let n=e.parent;for(;n;){if(this.checkChild(n,t))return n;if(this.isLimit(n))return null;n=n.parent}return null}setAllowedAttributes(e,t,n){const i=n.model;for(const[s,o]of Object.entries(t))i.schema.checkAttribute(e,s)&&n.setAttribute(s,o,e)}removeDisallowedAttributes(e,t){for(const n of e)if(n.is("$text"))ol(this,n,t);else{const e=Xr._createIn(n).getPositions();for(const n of e)ol(this,n.nodeBefore||n.parent,t)}}getAttributesWithProperty(e,t,n){const i={};for(const[s,o]of e.getAttributes()){const e=this.getAttributeProperties(s);void 0!==e[t]&&(void 0!==n&&n!==e[t]||(i[s]=o))}return i}createContext(e){return new Ha(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,n=Object.keys(t);for(const i of n)e[i]=qa(t[i],i);for(const t of n)Ya(e,t);for(const t of n)Ka(e,t);for(const t of n)Za(e,t);for(const t of n)Xa(e,t),Ja(e,t);for(const t of n)Qa(e,t),el(e,t),tl(e,t);this._compiledDefinitions=e}_checkContextMatch(e,t,n=t.length-1){const i=t.getItem(n);if(e.allowIn.includes(i.name)){if(0==n)return!0;{const e=this.getDefinition(i);return this._checkContextMatch(e,t,n-1)}}return!1}*_getValidRangesForRange(e,t){let n=e.start,i=e.start;for(const s of e.getItems({shallow:!0}))s.is("element")&&(yield*this._getValidRangesForRange(Xr._createIn(s),t)),this.checkAttribute(s,t)||(n.isEqual(i)||(yield new Xr(n,i)),n=qr._createAfter(s)),i=qr._createAfter(s);n.isEqual(i)||(yield new Xr(n,i))}}ot(Ga,Qe);class Ha{constructor(e){if(e instanceof Ha)return e;"string"==typeof e?e=[e]:Array.isArray(e)||(e=e.getAncestors({includeSelf:!0})),this._items=e.map(sl)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new Ha([e]);return t._items=[...this._items,...t._items],t}getItem(e){return this._items[e]}*getNames(){yield*this._items.map(e=>e.name)}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function qa(e,t){const n={name:t,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(e,t){for(const n of e){const e=Object.keys(n).filter(e=>e.startsWith("is"));for(const i of e)t[i]=n[i]}}(e,n),nl(e,n,"allowIn"),nl(e,n,"allowContentOf"),nl(e,n,"allowWhere"),nl(e,n,"allowAttributes"),nl(e,n,"allowAttributesOf"),nl(e,n,"allowChildren"),nl(e,n,"inheritTypesFrom"),function(e,t){for(const n of e){const e=n.inheritAllFrom;e&&(t.allowContentOf.push(e),t.allowWhere.push(e),t.allowAttributesOf.push(e),t.inheritTypesFrom.push(e))}}(e,n),n}function Ya(e,t){const n=e[t];for(const i of n.allowChildren){const n=e[i];n&&n.allowIn.push(t)}n.allowChildren.length=0}function Ka(e,t){for(const n of e[t].allowContentOf)e[n]&&il(e,n).forEach(e=>{e.allowIn.push(t)});delete e[t].allowContentOf}function Za(e,t){for(const n of e[t].allowWhere){const i=e[n];if(i){const n=i.allowIn;e[t].allowIn.push(...n)}}delete e[t].allowWhere}function Xa(e,t){for(const n of e[t].allowAttributesOf){const i=e[n];if(i){const n=i.allowAttributes;e[t].allowAttributes.push(...n)}}delete e[t].allowAttributesOf}function Ja(e,t){const n=e[t];for(const t of n.inheritTypesFrom){const i=e[t];if(i){const e=Object.keys(i).filter(e=>e.startsWith("is"));for(const t of e)t in n||(n[t]=i[t])}}delete n.inheritTypesFrom}function Qa(e,t){const n=e[t],i=n.allowIn.filter(t=>e[t]);n.allowIn=Array.from(new Set(i))}function el(e,t){const n=e[t];for(const i of n.allowIn)e[i].allowChildren.push(t)}function tl(e,t){const n=e[t];n.allowAttributes=Array.from(new Set(n.allowAttributes))}function nl(e,t,n){for(const i of e)"string"==typeof i[n]?t[n].push(i[n]):Array.isArray(i[n])&&t[n].push(...i[n])}function il(e,t){const n=e[t];return function(e){return Object.keys(e).map(t=>e[t])}(e).filter(e=>e.allowIn.includes(n.name))}function sl(e){return"string"==typeof e||e.is("documentFragment")?{name:"string"==typeof e?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function ol(e,t,n){for(const i of t.getAttributeKeys())e.checkAttribute(t,i)||n.removeAttribute(i,t)}class rl{constructor(e={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this._emptyElementsToKeep=new Set,this.conversionApi=Object.assign({},e),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this),this.conversionApi.keepEmptyElement=this._keepEmptyElement.bind(this)}convert(e,t,n=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let n;for(const i of new Ha(e)){const e={};for(const t of i.getAttributeKeys())e[t]=i.getAttribute(t);const s=t.createElement(i.name,e);n&&t.append(s,n),n=qr._createAt(s,0)}return n}(n,t),this.conversionApi.writer=t,this.conversionApi.consumable=Ua.createFrom(e),this.conversionApi.store={};const{modelRange:i}=this._convertItem(e,this._modelCursor),s=t.createDocumentFragment();if(i){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,s);s.markers=function(e,t){const n=new Set,i=new Map,s=Xr._createIn(e).getItems();for(const e of s)"$marker"==e.name&&n.add(e);for(const e of n){const n=e.getAttribute("data-name"),s=t.createPositionBefore(e);i.has(n)?i.get(n).end=s.clone():i.set(n,new Xr(s.clone())),t.remove(e)}return i}(s,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,s}_convertItem(e,t){const n=Object.assign({viewItem:e,modelCursor:t,modelRange:null});if(e.is("element")?this.fire("element:"+e.name,n,this.conversionApi):e.is("$text")?this.fire("text",n,this.conversionApi):this.fire("documentFragment",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof Xr))throw new u("view-conversion-dispatcher-incorrect-result",this);return{modelRange:n.modelRange,modelCursor:n.modelCursor}}_convertChildren(e,t){let n=t.is("position")?t:qr._createAt(t,0);const i=new Xr(n);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,n);e.modelRange instanceof Xr&&(i.end=e.modelRange.end,n=e.modelCursor)}return{modelRange:i,modelCursor:n}}_safeInsert(e,t){const n=this._splitToAllowedParent(e,t);return!!n&&(this.conversionApi.writer.insert(e,n.position),!0)}_updateConversionResult(e,t){const n=this._getSplitParts(e),i=this.conversionApi.writer;t.modelRange||(t.modelRange=i.createRange(i.createPositionBefore(e),i.createPositionAfter(n[n.length-1])));const s=this._cursorParents.get(e);t.modelCursor=s?i.createPositionAt(s,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:n,writer:i}=this.conversionApi;let s=n.findAllowedParent(t,e);if(s){if(s===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(s)&&(s=null)}if(!s)return Oa(t,e,n)?{position:Ra(t,i)}:null;const o=this.conversionApi.writer.split(t,s),r=[];for(const e of o.range.getWalker())if("elementEnd"==e.type)r.push(e.item);else{const t=r.pop(),n=e.item;this._registerSplitPair(t,n)}const a=o.range.end.parent;return this._cursorParents.set(e,a),{position:o.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const n=this._splitParts.get(e);this._splitParts.set(t,n),n.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&!this._emptyElementsToKeep.has(t)&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}ot(rl,_);class al{getHtml(e){const t=document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class ll{constructor(e){this.domParser=new DOMParser,this.domConverter=new bo(e,{renderingMode:"data"}),this.htmlWriter=new al}toData(e){const t=this.domConverter.viewToDom(e,document);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t)}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode="marked"==e?"markedNbsp":"nbsp"}_toDom(e){e.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)||(e=`${e}`);const t=this.domParser.parseFromString(e,"text/html"),n=t.createDocumentFragment(),i=t.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n}}class dl{constructor(e,t){this.model=e,this.mapper=new Jr,this.downcastDispatcher=new ta({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",(e,t,n)=>{if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,s=n.mapper.toViewPosition(t.range.start),o=i.createText(t.item.data);i.insert(s,o)},{priority:"lowest"}),this.downcastDispatcher.on("insert",(e,t,n)=>{n.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||n.convertChildren(t.item)},{priority:"lowest"}),this.upcastDispatcher=new rl({schema:e.schema}),this.viewDocument=new as(t),this.stylesProcessor=t,this.htmlProcessor=new ll(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new Ts(this.viewDocument),this.upcastDispatcher.on("text",(e,t,{schema:n,consumable:i,writer:s})=>{let o=t.modelCursor;if(!i.test(t.viewItem))return;if(!n.checkChild(o,"$text")){if(!Oa(o,"$text",n))return;o=Ra(o,s)}i.consume(t.viewItem);const r=s.createText(t.viewItem.data);s.insert(r,o),t.modelRange=s.createRange(o,o.getShiftedBy(r.offsetSize)),t.modelCursor=t.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:i}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=i}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(e,t,n)=>{if(!t.modelRange&&n.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:i}=n.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=i}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.decorate("get"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},za)},{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:n="empty"}=e;if(!this._checkIfRootsExists([t]))throw new u("datacontroller-get-non-existent-root",this);const i=this.model.document.getRoot(t);return"empty"!==n||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i,e):""}stringify(e,t={}){const n=this.toView(e,t);return this.processor.toData(n)}toView(e,t={}){const n=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const s=Xr._createIn(e),o=new Es(n);this.mapper.bindElements(e,o);const r=e.is("documentFragment")?e.markers:function(e){const t=[],n=e.root.document;if(!n)return new Map;const i=Xr._createIn(e);for(const e of n.model.markers){const n=e.getRange(),s=n.isCollapsed,o=n.start.isEqual(i.start)||n.end.isEqual(i.end);if(s&&o)t.push([e.name,n]);else{const s=i.getIntersection(n);s&&t.push([e.name,s])}}return t.sort(([e,t],[n,i])=>{if("after"!==t.end.compareWith(i.start))return 1;if("before"!==t.start.compareWith(i.end))return-1;switch(t.start.compareWith(i.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(i.end)){case"before":return 1;case"after":return-1;default:return n.localeCompare(e)}}}),new Map(t)}(e);return this.downcastDispatcher.convert(s,r,i,t),o}init(e){if(this.model.document.version)throw new u("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new u("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},e=>{for(const n of Object.keys(t)){const i=this.model.document.getRoot(n);e.insert(this.parse(t[n],i),i,0)}}),Promise.resolve()}set(e,t={}){let n={};if("string"==typeof e?n.main=e:n=e,!this._checkIfRootsExists(Object.keys(n)))throw new u("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const t of Object.keys(n)){const i=this.model.document.getRoot(t);e.remove(e.createRangeIn(i)),e.insert(this.parse(n[t],i),i,0)}})}parse(e,t="$root"){const n=this.processor.toView(e);return this.toModel(n,t)}toModel(e,t="$root"){return this.model.change(n=>this.upcastDispatcher.convert(e,n,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRootNames().includes(t))return!1;return!0}}ot(dl,Qe);class cl{constructor(e,t){this._helpers=new Map,this._downcast=Gn(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Gn(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const n=this._downcast.includes(t);if(!this._upcast.includes(t)&&!n)throw new u("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:n})}for(e){if(!this._helpers.has(e))throw new u("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:n}of ul(e))this.for("upcast").elementToElement({model:t,view:n,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:n}of ul(e))this.for("upcast").elementToAttribute({view:n,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:n}of ul(e))this.for("upcast").attributeToAttribute({view:n,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:n}){if(this._helpers.has(e))throw new u("conversion-group-exists",this);const i=n?new _a(t):new $a(t);this._helpers.set(e,i)}}function*ul(e){if(e.model.values)for(const t of e.model.values){const n={key:e.model.key,value:t},i=e.view[t],s=e.upcastAlso?e.upcastAlso[t]:void 0;yield*hl(n,i,s)}else yield*hl(e.model,e.view,e.upcastAlso)}function*hl(e,t,n){if(yield{model:e,view:t},n)for(const t of Gn(n))yield{model:e,view:t}}class ml{constructor(e={}){"string"==typeof e&&(e="transparent"===e?{isUndoable:!1}:{},h("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:n=!0,isUndo:i=!1,isTyping:s=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=n,this.isUndo=i,this.isTyping=s}get type(){return h("batch-type-deprecated"),"default"}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class gl{constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e){return new this(e.baseVersion)}}class pl{constructor(e){this.markers=new Map,this._children=new Ur,e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(e){return"documentFragment"===e||"model:documentFragment"===e}getChild(e){return this._children.getNode(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const n of e)t=t.getChild(t.offsetToIndex(n));return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const n of e)n.name?t.push(Wr.fromJSON(n)):t.push(Br.fromJSON(n));return new pl(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const n=function(e){return"string"==typeof e?[new Br(e)]:(Vn(e)||(e=[e]),Array.from(e).map(e=>"string"==typeof e?new Br(e):e instanceof Vr?new Br(e.data,e.getAttributes()):e))}(t);for(const e of n)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,n)}_removeChildren(e,t=1){const n=this._children._removeNodes(e,t);for(const e of n)e.parent=null;return n}}function fl(e,t){const n=(t=Il(t)).reduce((e,t)=>e+t.offsetSize,0),i=e.parent;bl(e);const s=e.index;return i._insertChild(s,t),vl(i,s+t.length),vl(i,s),new Xr(e,e.getShiftedBy(n))}function xl(e){if(!e.isFlat)throw new u("operation-utils-remove-range-not-flat",this);const t=e.start.parent;bl(e.start),bl(e.end);const n=t._removeChildren(e.start.index,e.end.index-e.start.index);return vl(t,e.start.index),n}function _l(e,t){if(!e.isFlat)throw new u("operation-utils-move-range-not-flat",this);const n=xl(e);return fl(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),n)}function Il(e){const t=[];e instanceof Array||(e=[e]);for(let n=0;ne.maxOffset)throw new u("move-operation-nodes-do-not-exist",this);if(e===t&&n=n&&this.targetPosition.path[e]e._clone(!0))),t=new wl(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new qr(e,[0]);return new Al(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0))),fl(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const n=[];for(const t of e.nodes)t.name?n.push(Wr.fromJSON(t)):n.push(Br.fromJSON(t));const i=new wl(qr.fromJSON(e.position,t),n,e.baseVersion);return i.shouldReceiveAttributes=e.shouldReceiveAttributes,i}}class Sl extends gl{constructor(e,t,n,i,s,o){super(o),this.name=e,this.oldRange=t?t.clone():null,this.newRange=n?n.clone():null,this.affectsData=s,this._markers=i}get type(){return"marker"}clone(){return new Sl(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Sl(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const e=this.newRange?"_set":"_remove";this._markers[e](this.name,this.newRange,!0,this.affectsData)}toJSON(){const e=super.toJSON();return this.oldRange&&(e.oldRange=this.oldRange.toJSON()),this.newRange&&(e.newRange=this.newRange.toJSON()),delete e._markers,e}static get className(){return"MarkerOperation"}static fromJSON(e,t){return new Sl(e.name,e.oldRange?Xr.fromJSON(e.oldRange,t):null,e.newRange?Xr.fromJSON(e.newRange,t):null,t.model.markers,e.affectsData,e.baseVersion)}}class El extends gl{constructor(e,t,n,i){super(i),this.position=e,this.position.stickiness="toNext",this.oldName=t,this.newName=n}get type(){return"rename"}clone(){return new El(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new El(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const e=this.position.nodeAfter;if(!(e instanceof Wr))throw new u("rename-operation-wrong-position",this);if(e.name!==this.oldName)throw new u("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e}static get className(){return"RenameOperation"}static fromJSON(e,t){return new El(qr.fromJSON(e.position,t),e.oldName,e.newName,e.baseVersion)}}class Tl extends gl{constructor(e,t,n,i,s){super(s),this.root=e,this.key=t,this.oldValue=n,this.newValue=i}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new Tl(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Tl(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new u("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new u("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new u("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const e=super.toJSON();return e.root=this.root.toJSON(),e}static get className(){return"RootAttributeOperation"}static fromJSON(e,t){if(!t.getRoot(e.root))throw new u("rootattribute-operation-fromjson-no-root",this,{rootName:e.root});return new Tl(t.getRoot(e.root),e.key,e.oldValue,e.newValue,e.baseVersion)}}class zl extends gl{constructor(e,t,n,i,s){super(s),this.sourcePosition=e.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=t,this.targetPosition=n.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=i.clone()}get type(){return"merge"}get deletionPosition(){return new qr(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const e=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Xr(this.sourcePosition,e)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.targetPosition._getTransformedByMergeOperation(this),t=this.sourcePosition.path.slice(0,-1),n=new qr(this.sourcePosition.root,t)._getTransformedByMergeOperation(this);return new Ol(e,this.howMany,n,this.graveyardPosition,this.baseVersion+1)}_validate(){const e=this.sourcePosition.parent,t=this.targetPosition.parent;if(!e.parent)throw new u("merge-operation-source-position-invalid",this);if(!t.parent)throw new u("merge-operation-target-position-invalid",this);if(this.howMany!=e.maxOffset)throw new u("merge-operation-how-many-invalid",this)}_execute(){const e=this.sourcePosition.parent;_l(Xr._createIn(e),this.targetPosition),_l(Xr._createOn(e),this.graveyardPosition)}toJSON(){const e=super.toJSON();return e.sourcePosition=e.sourcePosition.toJSON(),e.targetPosition=e.targetPosition.toJSON(),e.graveyardPosition=e.graveyardPosition.toJSON(),e}static get className(){return"MergeOperation"}static fromJSON(e,t){const n=qr.fromJSON(e.sourcePosition,t),i=qr.fromJSON(e.targetPosition,t),s=qr.fromJSON(e.graveyardPosition,t);return new this(n,e.howMany,i,s,e.baseVersion)}}class Ol extends gl{constructor(e,t,n,i,s){super(s),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=n,this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new qr(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Xr(this.splitPosition,e)}clone(){return new this.constructor(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new qr(e,[0]);return new zl(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof Xr)for(const n of e.getItems())t(n);else t(e)}move(e,t,n){if(this._assertWriterUsedCorrectly(),!(e instanceof Xr))throw new u("writer-move-invalid-range",this);if(!e.isFlat)throw new u("writer-move-range-not-flat",this);const i=qr._createAt(t,n);if(i.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!Nl(e.root,i.root))throw new u("writer-move-different-document",this);const s=e.root.document?e.root.document.version:null,o=new Al(e.start,e.end.offset-e.start.offset,i,s);this.batch.addOperation(o),this.model.applyOperation(o)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof Xr?e:Xr._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),Ml(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,n=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Wr))throw new u("writer-merge-no-element-before",this);if(!(n instanceof Wr))throw new u("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,n){return this.model.createPositionFromPath(e,t,n)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(e,t,n){return this.model.createSelection(e,t,n)}_mergeDetached(e){const t=e.nodeBefore,n=e.nodeAfter;this.move(Xr._createIn(n),qr._createAt(t,"end")),this.remove(n)}_merge(e){const t=qr._createAt(e.nodeBefore,"end"),n=qr._createAt(e.nodeAfter,0),i=e.root.document.graveyard,s=new qr(i,[0]),o=e.root.document.version,r=new zl(n,e.nodeAfter.maxOffset,t,s,o);this.batch.addOperation(r),this.model.applyOperation(r)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Wr))throw new u("writer-rename-not-element-instance",this);const n=e.root.document?e.root.document.version:null,i=new El(qr._createBefore(e),e.name,t,n);this.batch.addOperation(i),this.model.applyOperation(i)}split(e,t){this._assertWriterUsedCorrectly();let n,i,s=e.parent;if(!s.parent)throw new u("writer-split-element-no-parent",this);if(t||(t=s.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new u("writer-split-invalid-limit-element",this);do{const t=s.root.document?s.root.document.version:null,o=s.maxOffset-e.offset,r=Ol.getInsertionPosition(e),a=new Ol(e,o,r,null,t);this.batch.addOperation(a),this.model.applyOperation(a),n||i||(n=s,i=e.parent.nextSibling),s=(e=this.createPositionAfter(e.parent)).parent}while(s!==t);return{position:e,range:new Xr(qr._createAt(n,"end"),qr._createAt(i,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new u("writer-wrap-range-not-flat",this);const n=t instanceof Wr?t:new Wr(t);if(n.childCount>0)throw new u("writer-wrap-element-not-empty",this);if(null!==n.parent)throw new u("writer-wrap-element-attached",this);this.insert(n,e.start);const i=new Xr(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(i,qr._createAt(n,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new u("writer-unwrap-element-no-parent",this);this.move(Xr._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new u("writer-addmarker-no-usingoperation",this);const n=t.usingOperation,i=t.range,s=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new u("writer-addmarker-marker-exists",this);if(!i)throw new u("writer-addmarker-no-range",this);return n?(Fl(this,e,null,i,s),this.model.markers.get(e)):this.model.markers._set(e,i,n,s)}updateMarker(e,t){this._assertWriterUsedCorrectly();const n="string"==typeof e?e:e.name,i=this.model.markers.get(n);if(!i)throw new u("writer-updatemarker-marker-not-exists",this);if(!t)return h("writer-updatemarker-reconvert-using-editingcontroller",{markerName:n}),void this.model.markers._refresh(i);const s="boolean"==typeof t.usingOperation,o="boolean"==typeof t.affectsData,r=o?t.affectsData:i.affectsData;if(!s&&!t.range&&!o)throw new u("writer-updatemarker-wrong-options",this);const a=i.getRange(),l=t.range?t.range:a;s&&t.usingOperation!==i.managedUsingOperations?t.usingOperation?Fl(this,n,null,l,r):(Fl(this,n,a,null,r),this.model.markers._set(n,l,void 0,r)):i.managedUsingOperations?Fl(this,n,a,l,r):this.model.markers._set(n,l,void 0,r)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new u("writer-removemarker-no-marker",this);const n=this.model.markers.get(t);n.managedUsingOperations?Fl(this,t,n.getRange(),null,n.affectsData):this.model.markers._remove(t)}setSelection(e,t,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(e,t,n)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,n]of ni(e))this._setSelectionAttribute(t,n)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){const i=ma._getStoreAttributeKey(e);this.setAttribute(i,t,n.anchor.parent)}n._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const n=ma._getStoreAttributeKey(e);this.removeAttribute(n,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new u("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const n of this.model.markers){if(!n.managedUsingOperations)continue;const i=n.getRange();let s=!1;if("move"===e)s=t.containsPosition(i.start)||t.start.isEqual(i.start)||t.containsPosition(i.end)||t.end.isEqual(i.end);else{const e=t.nodeBefore,n=t.nodeAfter,o=i.start.parent==e&&i.start.isAtEnd,r=i.end.parent==n&&0==i.end.offset,a=i.end.nodeAfter==n,l=i.start.nodeAfter==n;s=o||r||a||l}s&&this.updateMarker(n.name,{range:i})}}}function Dl(e,t,n,i){const s=e.model,o=s.document;let r,a,l,d=i.start;for(const e of i.getWalker({shallow:!0}))l=e.item.getAttribute(t),r&&a!=l&&(a!=n&&c(),d=r),r=e.nextPosition,a=l;function c(){const i=new Xr(d,r),l=i.root.document?o.version:null,c=new yl(i,t,a,n,l);e.batch.addOperation(c),s.applyOperation(c)}r instanceof qr&&r!=d&&a!=n&&c()}function Pl(e,t,n,i){const s=e.model,o=s.document,r=i.getAttribute(t);let a,l;if(r!=n){if(i.root===i){const e=i.document?o.version:null;l=new Tl(i,t,r,n,e)}else{a=new Xr(qr._createBefore(i),e.createPositionAfter(i));const s=a.root.document?o.version:null;l=new yl(a,t,r,n,s)}e.batch.addOperation(l),s.applyOperation(l)}}function Fl(e,t,n,i,s){const o=e.model,r=o.document,a=new Sl(t,n,i,o.markers,s,r.version);e.batch.addOperation(a),o.applyOperation(a)}function Ml(e,t,n,i){let s;if(e.root.document){const n=i.document,o=new qr(n.graveyard,[0]);s=new Al(e,t,o,n.version)}else s=new kl(e,t);n.addOperation(s),i.applyOperation(s)}function Nl(e,t){return e===t||e instanceof Rl&&t instanceof Rl}class Ll{constructor(e){this._markerCollection=e,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null,this._refreshedItems=new Set}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}bufferOperation(e){switch(e.type){case"insert":if(this._isInInsertedElement(e.position.parent))return;this._markInsert(e.position.parent,e.position.offset,e.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const t of e.range.getItems({shallow:!0}))this._isInInsertedElement(t.parent)||this._markAttribute(t);break;case"remove":case"move":case"reinsert":{if(e.sourcePosition.isEqual(e.targetPosition)||e.sourcePosition.getShiftedBy(e.howMany).isEqual(e.targetPosition))return;const t=this._isInInsertedElement(e.sourcePosition.parent),n=this._isInInsertedElement(e.targetPosition.parent);t||this._markRemove(e.sourcePosition.parent,e.sourcePosition.offset,e.howMany),n||this._markInsert(e.targetPosition.parent,e.getMovedRangeStart().offset,e.howMany);break}case"rename":{if(this._isInInsertedElement(e.position.parent))return;this._markRemove(e.position.parent,e.position.offset,1),this._markInsert(e.position.parent,e.position.offset,1);const t=Xr._createFromPositionAndShift(e.position,1);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}break}case"split":{const t=e.splitPosition.parent;this._isInInsertedElement(t)||this._markRemove(t,e.splitPosition.offset,e.howMany),this._isInInsertedElement(e.insertionPosition.parent)||this._markInsert(e.insertionPosition.parent,e.insertionPosition.offset,1),e.graveyardPosition&&this._markRemove(e.graveyardPosition.parent,e.graveyardPosition.offset,1);break}case"merge":{const t=e.sourcePosition.parent;this._isInInsertedElement(t.parent)||this._markRemove(t.parent,t.startOffset,1);const n=e.graveyardPosition.parent;this._markInsert(n,e.graveyardPosition.offset,1);const i=e.targetPosition.parent;this._isInInsertedElement(i)||this._markInsert(i,e.targetPosition.offset,t.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(e,t,n){const i=this._changedMarkers.get(e);i?(i.newMarkerData=n,null==i.oldMarkerData.range&&null==n.range&&this._changedMarkers.delete(e)):this._changedMarkers.set(e,{newMarkerData:n,oldMarkerData:t})}getMarkersToRemove(){const e=[];for(const[t,n]of this._changedMarkers)null!=n.oldMarkerData.range&&e.push({name:t,range:n.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,n]of this._changedMarkers)null!=n.newMarkerData.range&&e.push({name:t,range:n.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map(([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}}))}hasDataChanges(){if(this._changesInElement.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const n=e.range&&!t.range,i=!e.range&&t.range,s=e.range&&t.range&&!e.range.isEqual(t.range);if(n||i||s)return!0}}return!1}getChanges(e={includeChangesInGraveyard:!1}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const e of this._changesInElement.keys()){const n=this._changesInElement.get(e).sort((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offsete.position.root!=t.position.root?e.position.root.rootNamee);for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(Ul),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._refreshedItems=new Set,this._cachedChanges=null}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e);const t=Xr._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}this._cachedChanges=null}_markInsert(e,t,n){const i={type:"insert",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i)}_markRemove(e,t,n){const i={type:"remove",offset:t,howMany:n,count:this._changeCount++};this._markChange(e,i),this._removeAllNestedChanges(e,t,n)}_markAttribute(e){const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshot(e);const n=this._getChangesForElement(e);this._handleChange(t,n),n.push(t);for(let e=0;en.offset){if(i>s){const e={type:"attribute",offset:s,howMany:i-s,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=n.offset&&e.offsets?(e.nodesToHandle=i-s,e.offset=s):e.nodesToHandle=0);if("remove"==n.type&&e.offsetn.offset){const s={type:"attribute",offset:n.offset,howMany:i-n.offset,count:this._changeCount++};this._handleChange(s,t),t.push(s),e.nodesToHandle=n.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==n.type&&(e.offset>=n.offset&&i<=s?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=n.offset&&i>=s&&(n.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,n){return{type:"insert",position:qr._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getRemoveDiff(e,t,n){return{type:"remove",position:qr._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,n){const i=[];n=new Map(n);for(const[s,o]of t){const t=n.has(s)?n.get(s):null;t!==o&&i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:s,attributeOldValue:o,attributeNewValue:t,changeCount:this._changeCount++}),n.delete(s)}for(const[t,s]of n)i.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:s,changeCount:this._changeCount++});return i}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const n=this._changesInElement.get(t),i=e.startOffset;if(n)for(const e of n)if("insert"==e.type&&i>=e.offset&&ii){for(let t=0;t=e&&i.baseVersione.source).join("|")+")";return new RegExp(`${e}|${t}(?:‍${t})*`,"ug")}();function Yl(e,t){const n=String(e).matchAll(ql);return Array.from(n).some(e=>e.index{const n=t[0];if(n.isDocumentOperation&&n.baseVersion!==this.version)throw new u("model-document-applyoperation-wrong-version",this,{operation:n})},{priority:"highest"}),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&this.differ.bufferOperation(n)},{priority:"high"}),this.listenTo(e,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&(this.version++,this.history.addOperation(n))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(e,t,n,i,s)=>{const o={...t.getData(),range:i};this.differ.bufferMarkerChange(t.name,s,o),null===n&&t.on("change",(e,n)=>{const i=t.getData();this.differ.bufferMarkerChange(t.name,{...i,range:n},i)})})}get graveyard(){return this.getRoot(Kl)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new u("model-document-createroot-name-exists",this,{name:t});const n=new Rl(this,e,t);return this.roots.add(n),n}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(){return Array.from(this.roots,e=>e.rootName).filter(e=>e!=Kl)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Jn(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const e of this.roots)if(e!==this.graveyard)return e;return this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,n=t.schema,i=t.createPositionFromPath(e,[0]);return n.getNearestSelectionRange(i)||t.createRange(i)}_validateSelectionRange(e){return Xl(e.start)&&Xl(e.end)}_callPostFixers(e){let t=!1;do{for(const n of this._postFixers)if(this.selection.refresh(),t=n(e),t)break}while(t)}}function Xl(e){const t=e.textNode;if(t){const n=t.data,i=e.offset-t.startOffset;return!Gl(n,i)&&!Hl(n,i)}return!0}ot(Zl,_);class Jl{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof Ql?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,n=!1,i=!1){const s=e instanceof Ql?e.name:e;if(s.includes(","))throw new u("markercollection-incorrect-marker-name",this);const o=this._markers.get(s);if(o){const e=o.getData(),r=o.getRange();let a=!1;return r.isEqual(t)||(o._attachLiveRange(da.fromRange(t)),a=!0),n!=o.managedUsingOperations&&(o._managedUsingOperations=n,a=!0),"boolean"==typeof i&&i!=o.affectsData&&(o._affectsData=i,a=!0),a&&this.fire("update:"+s,o,r,t,e),o}const r=da.fromRange(t),a=new Ql(s,r,n,i);return this._markers.set(s,a),this.fire("update:"+s,a,null,t,{...a.getData(),range:null}),a}_remove(e){const t=e instanceof Ql?e.name:e,n=this._markers.get(t);return!!n&&(this._markers.delete(t),this.fire("update:"+t,n,n.getRange(),null,n.getData()),this._destroyMarker(n),!0)}_refresh(e){const t=e instanceof Ql?e.name:e,n=this._markers.get(t);if(!n)throw new u("markercollection-refresh-marker-not-exists",this);const i=n.getRange();this.fire("update:"+t,n,i,i,n.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}ot(Jl,_);class Ql{constructor(e,t,n,i){this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=n,this._affectsData=i}get managedUsingOperations(){if(!this._liveRange)throw new u("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new u("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new u("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new u("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new u("marker-destroyed",this);return this._liveRange.toRange()}is(e){return"marker"===e||"model:marker"===e}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}ot(Ql,_);class ed extends gl{get type(){return"noop"}clone(){return new ed(this.baseVersion)}getReversed(){return new ed(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const td={};td[yl.className]=yl,td[wl.className]=wl,td[Sl.className]=Sl,td[Al.className]=Al,td[ed.className]=ed,td[gl.className]=gl,td[El.className]=El,td[Tl.className]=Tl,td[Ol.className]=Ol,td[zl.className]=zl;class nd{static fromJSON(e,t){return td[e.__className].fromJSON(e,t)}}class id extends qr{constructor(e,t,n="toNone"){if(super(e,t,n),!this.root.is("rootElement"))throw new u("model-liveposition-root-not-rootelement",e);sd.call(this)}detach(){this.stopListening()}is(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e}toPosition(){return new qr(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}}function sd(){this.listenTo(this.root.document.model,"applyOperation",(e,t)=>{const n=t[0];n.isDocumentOperation&&od.call(this,n)},{priority:"low"})}function od(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}ot(id,_);class rd{constructor(e,t,n){this.model=e,this.writer=t,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0),this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),n=this.writer.createPositionAfter(e);if(n.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new u("insertcontent-invalid-insertion-position",this);this.position=n,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this.nodeToSelect?Xr._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Xr(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(this.schema.isObject(e))return void this._handleObject(e);let t=this._checkAndAutoParagraphToAllowedPosition(e);t||(t=this._checkAndSplitToAllowedPosition(e),t)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=id.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleObject(e){this._checkAndSplitToAllowedPosition(e)?this._appendToFragment(e):this._tryAutoparagraphing(e)}_handleDisallowedNode(e){e.is("element")?this.handleNodes(e.getChildren()):this._tryAutoparagraphing(e)}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new u("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=e:this.nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=id.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=id.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof Wr))return;if(!this._canMergeLeft(e))return;const t=id._createBefore(e);t.stickiness="toNext";const n=id.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=id._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=id._createAt(t.nodeBefore,"end","toNext")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof Wr))return;if(!this._canMergeRight(e))return;const t=id._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new u("insertcontent-invalid-insertion-position",this);this.position=qr._createAt(t.nodeBefore,"end");const n=id.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=id._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=id._createAt(t.nodeBefore,0,"toPrevious")),this.position=n.toPosition(),n.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof Wr&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof Wr&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_tryAutoparagraphing(e){const t=this.writer.createElement("paragraph");this._getAllowedIn(this.position.parent,t)&&this.schema.checkChild(t,e)&&(t._appendChild(e),this._handleNode(t))}_checkAndAutoParagraphToAllowedPosition(e){if(this.schema.checkChild(this.position.parent,e))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",e))return!1;this._insertPartialFragment();const t=this.writer.createElement("paragraph");return this.writer.insert(t,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=t,this.position=this.writer.createPositionAt(t,0),!0}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&e.parent===t&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}return!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function ad(e,t,n="auto"){const i=e.getSelectedElement();if(i&&t.schema.isObject(i)&&!t.schema.isInline(i))return["before","after"].includes(n)?t.createRange(t.createPositionAt(i,n)):t.createRangeOn(i);const s=$r(e.getSelectedBlocks());if(!s)return t.createRange(e.focus);if(s.isEmpty)return t.createRange(t.createPositionAt(s,0));const o=t.createPositionAfter(s);return e.focus.isTouching(o)?t.createRange(o):t.createRange(t.createPositionBefore(s))}function ld(e,t,n={}){if(t.isCollapsed)return;const i=t.getFirstRange();if("$graveyard"==i.root.rootName)return;const s=e.schema;e.change(e=>{if(!n.doNotResetEntireContent&&function(e,t){const n=e.getLimitElement(t);if(!t.containsEntireContent(n))return!1;const i=t.getFirstRange();return i.start.parent!=i.end.parent&&e.checkChild(n,"paragraph")}(s,t))return void function(e,t){const n=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(n)),hd(e,e.createPositionAt(n,0),t)}(e,t);const o={};if(!n.doNotAutoparagraph){const e=t.getSelectedElement();e&&Object.assign(o,s.getAttributesWithProperty(e,"copyOnReplace",!0))}const[r,a]=function(e){const t=e.root.document.model,n=e.start;let i=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const n=function(e){const t=e.parent,n=t.root.document.model.schema,i=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of i){if(n.isLimit(e))return null;if(n.isBlock(e))return e}}(i);if(n&&i.isTouching(t.createPositionAt(n,0))){const n=t.createSelection(e);t.modifySelection(n,{direction:"backward"});const s=n.getLastPosition(),o=t.createRange(s,i);t.hasContent(o,{ignoreMarkers:!0})||(i=s)}}return[id.fromPosition(n,"toPrevious"),id.fromPosition(i,"toNext")]}(i);r.isTouching(a)||e.remove(e.createRange(r,a)),n.leaveUnmerged||(function(e,t,n){const i=e.model;if(!ud(e.model.schema,t,n))return;const[s,o]=function(e,t){const n=e.getAncestors(),i=t.getAncestors();let s=0;for(;n[s]&&n[s]==i[s];)s++;return[n[s],i[s]]}(t,n);s&&o&&(!i.hasContent(s,{ignoreMarkers:!0})&&i.hasContent(o,{ignoreMarkers:!0})?cd(e,t,n,s.parent):dd(e,t,n,s.parent))}(e,r,a),s.removeDisallowedAttributes(r.parent.getChildren(),e)),md(e,t,r),!n.doNotAutoparagraph&&function(e,t){const n=e.checkChild(t,"$text"),i=e.checkChild(t,"paragraph");return!n&&i}(s,r)&&hd(e,r,t,o),r.detach(),a.detach()})}function dd(e,t,n,i){const s=t.parent,o=n.parent;if(s!=i&&o!=i){for(t=e.createPositionAfter(s),(n=e.createPositionBefore(o)).isEqual(t)||e.insert(o,t),e.merge(t);n.parent.isEmpty;){const t=n.parent;n=e.createPositionBefore(t),e.remove(t)}ud(e.model.schema,t,n)&&dd(e,t,n,i)}}function cd(e,t,n,i){const s=t.parent,o=n.parent;if(s!=i&&o!=i){for(t=e.createPositionAfter(s),(n=e.createPositionBefore(o)).isEqual(t)||e.insert(s,n);t.parent.isEmpty;){const n=t.parent;t=e.createPositionBefore(n),e.remove(n)}n=e.createPositionBefore(o),function(e,t){const n=t.nodeBefore,i=t.nodeAfter;n.name!=i.name&&e.rename(n,i.name),e.clearAttributes(n),e.setAttributes(Object.fromEntries(i.getAttributes()),n),e.merge(t)}(e,n),ud(e.model.schema,t,n)&&cd(e,t,n,i)}}function ud(e,t,n){const i=t.parent,s=n.parent;return i!=s&&!e.isLimit(i)&&!e.isLimit(s)&&function(e,t,n){const i=new Xr(e,t);for(const e of i.getWalker())if(n.isLimit(e.item))return!1;return!0}(t,n,e)}function hd(e,t,n,i={}){const s=e.createElement("paragraph");e.model.schema.setAllowedAttributes(s,i,e),e.insert(s,t),md(e,n,e.createPositionAt(s,0))}function md(e,t,n){t instanceof ma?e.setSelection(n):t.setTo(n)}const gd=' ,.?!:;"-()';function pd(e,t){const{isForward:n,walker:i,unit:s,schema:o,treatEmojiAsSingleUnit:r}=e,{type:a,item:l,nextPosition:d}=t;if("text"==a)return"word"===e.unit?function(e,t){let n=e.position.textNode;if(n){let i=e.position.offset-n.startOffset;for(;!xd(n.data,i,t)&&!_d(n,i,t);){e.next();const s=t?e.position.nodeAfter:e.position.nodeBefore;if(s&&s.is("$text")){const i=s.data.charAt(t?0:s.data.length-1);gd.includes(i)||(e.next(),n=e.position.textNode)}i=e.position.offset-n.startOffset}}return e.position}(i,n):function(e,t,n){const i=e.position.textNode;if(i){const s=i.data;let o=e.position.offset-i.startOffset;for(;Gl(s,o)||"character"==t&&Hl(s,o)||n&&Yl(s,o);)e.next(),o=e.position.offset-i.startOffset}return e.position}(i,s,r);if(a==(n?"elementStart":"elementEnd")){if(o.isSelectable(l))return qr._createAt(l,n?"after":"before");if(o.checkChild(d,"$text"))return d}else{if(o.isLimit(l))return void i.skip(()=>!0);if(o.checkChild(d,"$text"))return d}}function fd(e,t){const n=e.root,i=qr._createAt(n,t?"end":0);return t?new Xr(e,i):new Xr(i,e)}function xd(e,t,n){const i=t+(n?0:-1);return gd.includes(e.charAt(i))}function _d(e,t,n){return t===(n?e.endOffset:0)}function Id(e,t){const n=[];Array.from(e.getItems({direction:"backward"})).map(e=>t.createRangeOn(e)).filter(t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end))).forEach(e=>{n.push(e.start.parent),t.remove(e)}),n.forEach(e=>{let n=e;for(;n.parent&&n.isEmpty;){const e=t.createRangeOn(n);n=n.parent,t.remove(e)}})}function vd(e,t){return e.isCollapsed?function(e,t){const n=e.start,i=t.getNearestSelectionRange(n);if(!i){const e=n.getAncestors().reverse().find(e=>t.isObject(e));return e?Xr._createOn(e):null}if(!i.isCollapsed)return i;const s=i.start;return n.isEqual(s)?null:new Xr(s)}(e,t):function(e,t){const{start:n,end:i}=e,s=t.checkChild(n,"$text"),o=t.checkChild(i,"$text"),r=t.getLimitElement(n),a=t.getLimitElement(i);if(r===a){if(s&&o)return null;if(function(e,t,n){const i=e.nodeAfter&&!n.isLimit(e.nodeAfter)||n.checkChild(e,"$text"),s=t.nodeBefore&&!n.isLimit(t.nodeBefore)||n.checkChild(t,"$text");return i||s}(n,i,t)){const e=n.nodeAfter&&t.isSelectable(n.nodeAfter)?null:t.getNearestSelectionRange(n,"forward"),s=i.nodeBefore&&t.isSelectable(i.nodeBefore)?null:t.getNearestSelectionRange(i,"backward"),o=e?e.start:n,r=s?s.end:i;return new Xr(o,r)}}const l=r&&!r.is("rootElement"),d=a&&!a.is("rootElement");if(l||d){const e=n.nodeAfter&&i.nodeBefore&&n.nodeAfter.parent===i.nodeBefore.parent,s=l&&(!e||!jd(n.nodeAfter,t)),o=d&&(!e||!jd(i.nodeBefore,t));let c=n,u=i;return s&&(c=qr._createBefore(bd(r,t))),o&&(u=qr._createAfter(bd(a,t))),new Xr(c,u)}return null}(e,t)}function bd(e,t){let n=e,i=n;for(;t.isLimit(i)&&i.parent;)n=i,i=i.parent;return n}function jd(e,t){return e&&t.isSelectable(e)}class Cd{constructor(){this.markers=new Jl,this.document=new Zl(this),this.schema=new Ga,this._pendingChanges=[],this._currentWriter=null,["insertContent","insertObject","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(e=>this.decorate(e)),this.on("applyOperation",(e,t)=>{t[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((e,t)=>{if("$marker"===t.name)return!0}),function(e){e.document.registerPostFixer(t=>function(e,t){const n=t.document.selection,i=t.schema,s=[];let o=!1;for(const e of n.getRanges()){const t=vd(e,i);t&&!t.isEqual(e)?(s.push(t),o=!0):s.push(e)}o&&e.setSelection(function(e){const t=[...e],n=new Set;let i=1;for(;i!n.has(t))}(s),{backward:n.isBackward})}(t,e))}(this),this.document.registerPostFixer(za)}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new ml,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){u.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{e?"function"==typeof e?(t=e,e=new ml):e instanceof ml||(e=new ml(e)):e=new ml,this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){u.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,n){return function(e,t,n,i){return e.change(s=>{let o;o=n?n instanceof sa||n instanceof ma?n:s.createSelection(n,i):e.document.selection,o.isCollapsed||e.deleteContent(o,{doNotAutoparagraph:!0});const r=new rd(e,s,o.anchor);let a;a=t.is("documentFragment")?t.getChildren():[t],r.handleNodes(a);const l=r.getSelectionRange();l&&(o instanceof ma?s.setSelection(l):o.setTo(l));const d=r.getAffectedRange()||e.createRange(o.anchor);return r.destroy(),d})}(this,e,t,n)}insertObject(e,t,n,i){return function(e,t,n,i,s={}){if(!e.schema.isObject(t))throw new u("insertobject-element-not-an-object",e,{object:t});let o;o=n?n.is("selection")?n:e.createSelection(n,i):e.document.selection;let r=o;s.findOptimalPosition&&e.schema.isBlock(t)&&(r=e.createSelection(ad(o,e,s.findOptimalPosition)));const a=$r(o.getSelectedBlocks()),l={};return a&&Object.assign(l,e.schema.getAttributesWithProperty(a,"copyOnReplace",!0)),e.change(n=>{r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});let i=t;const o=r.anchor.parent;!e.schema.checkChild(o,t)&&e.schema.checkChild(o,"paragraph")&&e.schema.checkChild("paragraph",t)&&(i=n.createElement("paragraph"),n.insert(t,i)),e.schema.setAllowedAttributes(i,l,n);const a=e.insertContent(i,r);return a.isCollapsed||s.setSelection&&function(e,t,n,i){const s=e.model;if("after"==n){let n=t.nextSibling;!(n&&s.schema.checkChild(n,"$text"))&&s.schema.checkChild(t.parent,"paragraph")&&(n=e.createElement("paragraph"),s.schema.setAllowedAttributes(n,i,e),s.insertContent(n,e.createPositionAfter(t))),n&&e.setSelection(n,0)}else{if("on"!=n)throw new u("insertobject-invalid-place-parameter-value",s);e.setSelection(t,"on")}}(n,t,s.setSelection,l),a})}(this,e,t,n,i)}deleteContent(e,t){ld(this,e,t)}modifySelection(e,t){!function(e,t,n={}){const i=e.schema,s="backward"!=n.direction,o=n.unit?n.unit:"character",r=!!n.treatEmojiAsSingleUnit,a=t.focus,l=new Gr({boundaries:fd(a,s),singleCharacters:!0,direction:s?"forward":"backward"}),d={walker:l,schema:i,isForward:s,unit:o,treatEmojiAsSingleUnit:r};let c;for(;c=l.next();){if(c.done)return;const n=pd(d,c.value);if(n)return void(t instanceof ma?e.change(e=>{e.setSelectionFocus(n)}):t.setFocus(n))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change(e=>{const n=e.createDocumentFragment(),i=t.getFirstRange();if(!i||i.isCollapsed)return n;const s=i.start.root,o=i.start.getCommonPath(i.end),r=s.getNodeByPath(o);let a;a=i.start.parent==i.end.parent?i:e.createRange(e.createPositionAt(r,i.start.path[o.length]),e.createPositionAt(r,i.end.path[o.length]+1));const l=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),n):e.append(e.cloneElement(t,!0),n);if(a!=i){const t=i._getTransformedByMove(a.start,e.createPositionAt(n,0),l)[0],s=e.createRange(e.createPositionAt(n,0),t.start);Id(e.createRange(t.end,e.createPositionAt(n,"end")),e),Id(s,e)}return n})}(this,e)}hasContent(e,t={}){const n=e instanceof Wr?Xr._createIn(e):e;if(n.isCollapsed)return!1;const{ignoreWhitespaces:i=!1,ignoreMarkers:s=!1}=t;if(!s)for(const e of this.markers.getMarkersIntersectingRange(n))if(e.affectsData)return!0;for(const e of n.getItems())if(this.schema.isContent(e)){if(!e.is("$textProxy"))return!0;if(!i)return!0;if(-1!==e.data.search(/\S/))return!0}return!1}createPositionFromPath(e,t,n){return new qr(e,t,n)}createPositionAt(e,t){return qr._createAt(e,t)}createPositionAfter(e){return qr._createAfter(e)}createPositionBefore(e){return qr._createBefore(e)}createRange(e,t){return new Xr(e,t)}createRangeIn(e){return Xr._createIn(e)}createRangeOn(e){return Xr._createOn(e)}createSelection(e,t,n){return new sa(e,t,n)}createBatch(e){return new ml(e)}createOperationFromJSON(e){return nd.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new $l(this,t);const n=this._pendingChanges[0].callback(this._currentWriter);e.push(n),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),e}}ot(Cd,Qe);class yd extends Pr{constructor(e){super(),this.editor=e}set(e,t,n={}){if("string"==typeof t){const e=t;t=(t,n)=>{this.editor.execute(e),n()}}super.set(e,t,n)}}class kd{constructor(e={}){const t=e.language||this.constructor.defaultConfig&&this.constructor.defaultConfig.language;this._context=e.context||new Kn({language:t}),this._context._addEditor(this,!e.context);const n=Array.from(this.constructor.builtinPlugins||[]);this.config=new Nn(e,this.constructor.defaultConfig),this.config.define("plugins",n),this.config.define(this._context._getEditorConfig()),this.plugins=new Wn(this,n,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new Va,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.model=new Cd;const i=new Pi;this.data=new dl(this.model,i),this.editing=new Ba(this.model,i),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new cl([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new yd(this),this.keystrokes.listenTo(this.editing.view.document)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new u("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new u("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),1===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new u("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),0===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}initPlugins(){const e=this.config,t=e.get("plugins"),n=e.get("removePlugins")||[],i=e.get("extraPlugins")||[],s=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(i),n,s)}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise(e=>this.once("ready",e))),e.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...e){try{return this.commands.execute(...e)}catch(e){u.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}}ot(kd,Qe);class Ad{constructor(e){this.editor=e,this._components=new Map}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(wd(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new u("componentfactory-item-missing",this,{name:e});return this._components.get(wd(e)).callback(this.editor.locale)}has(e){return this._components.has(wd(e))}}function wd(e){return String(e).toLowerCase()}class Sd{constructor(e){this.editor=e,this.componentFactory=new Ad(e),this.focusTracker=new Dr,this.set("viewportOffset",this._readViewportOffsetFromConfig()),this._editableElementsMap=new Map,this.listenTo(e.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const n=e.config.get("toolbar.viewportTopOffset");return n?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:n}):{top:0}}}ot(Sd,Qe);const Ed={setData(e){this.data.set(e)},getData(e){return this.data.get(e)}},Td=Ed,zd={updateSourceElement(){if(!this.sourceElement)throw new u("editor-missing-sourceelement",this);!function(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}(this.sourceElement,this.data.get())}},Od=zd;class Rd extends Zn{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new Un({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new u("pendingactions-add-invalid-message",this);const t=Object.create(Qe);return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const $d='',Dd='';function Pd({emitter:e,activator:t,callback:n,contextElements:i}){e.listenTo(document,"mousedown",(e,s)=>{if(!t())return;const o="function"==typeof s.composedPath?s.composedPath():[];for(const e of i)if(e.contains(s.target)||o.includes(e))return;n()})}function Fd(e){e.set("_isCssTransitionsDisabled",!1),e.disableCssTransitions=()=>{e._isCssTransitionsDisabled=!0},e.enableCssTransitions=()=>{e._isCssTransitionsDisabled=!1},e.extendTemplate({attributes:{class:[e.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function Md({view:e}){e.listenTo(e.element,"submit",(t,n)=>{n.preventDefault(),e.fire("submit")},{useCapture:!0})}class Nd extends Un{constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(e,t,n)=>{this._renderViewIntoCollectionParent(t,n)}),this.on("remove",(e,t)=>{t.element&&this._parentElement&&t.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...e){if(!e.length||!function(e){return e.every(e=>"string"==typeof e)}(e))throw new u("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const n of this)for(const i of e)n.delegate(i).to(t);this.on("add",(n,i)=>{for(const n of e)i.delegate(n).to(t)}),this.on("remove",(n,i)=>{for(const n of e)i.stopDelegating(n,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}}var Ld=o(150);oo()(Ld.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ld.Z.locals;class Bd{constructor(e){this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new Un,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,n)=>{n.locale=e}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Vd.bind(this,this)}createCollection(e){const t=new Nd(e);return this._viewCollections.add(t),t}registerChild(e){Vn(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Vn(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Vd(e)}extendTemplate(e){Vd.extend(this.template,e)}render(){if(this.isRendered)throw new u("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}ot(Bd,wo),ot(Bd,Qe);class Vd{constructor(e){Object.assign(this,Jd(Xd(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new u("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const n of t.children)sc(n)?yield n:oc(n)&&(yield*e(n))}(this)}static bind(e,t){return{to:(n,i)=>new Wd({eventNameOrFunction:n,attribute:n,observable:e,emitter:t,callback:i}),if:(n,i,s)=>new Gd({observable:e,emitter:t,attribute:n,valueIfTrue:i,callback:s})}}static extend(e,t){if(e._isRendered)throw new u("template-extend-render",[this,e]);nc(e,Jd(Xd(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new u("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),Hd(this.text)?this._bindToObservable({schema:this.text,updater:Yd(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){let t,n,i,s;if(!this.attributes)return;const o=e.node,r=e.revertData;for(t in this.attributes)if(i=o.getAttribute(t),n=this.attributes[t],r&&(r.attributes[t]=i),s=w(n[0])&&n[0].ns?n[0].ns:null,Hd(n)){const a=s?n[0].value:n;r&&lc(t)&&a.unshift(i),this._bindToObservable({schema:a,updater:Kd(o,t,s),data:e})}else"style"==t&&"string"!=typeof n[0]?this._renderStyleAttribute(n[0],e):(r&&i&&lc(t)&&n.unshift(i),n=n.map(e=>e&&e.value||e).reduce((e,t)=>e.concat(t),[]).reduce(ec,""),ic(n)||o.setAttributeNS(s,t,n))}_renderStyleAttribute(e,t){const n=t.node;for(const i in e){const s=e[i];Hd(s)?this._bindToObservable({schema:[s],updater:Zd(n,i),data:t}):n.style[i]=s}}_renderElementChildren(e){const t=e.node,n=e.intoFragment?document.createDocumentFragment():t,i=e.isApplying;let s=0;for(const o of this.children)if(rc(o)){if(!i){o.setParent(t);for(const e of o)n.appendChild(e.element)}}else if(sc(o))i||(o.isRendered||o.render(),n.appendChild(o.element));else if(io(o))n.appendChild(o);else if(i){const t=e.revertData,i=ac();t.children.push(i),o._renderNode({node:n.childNodes[s++],isApplying:!0,revertData:i})}else n.appendChild(o.render());e.intoFragment&&t.appendChild(n)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const n=this.eventListeners[t].map(n=>{const[i,s]=t.split("@");return n.activateDomEventListener(i,s,e)});e.revertData&&e.revertData.bindings.push(n)}}_bindToObservable({schema:e,updater:t,data:n}){const i=n.revertData;qd(e,t,n);const s=e.filter(e=>!ic(e)).filter(e=>e.observable).map(i=>i.activateAttributeListener(e,t,n));i&&i.bindings.push(s)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)e.textContent=t.text;else{for(const n in t.attributes){const i=t.attributes[n];null===i?e.removeAttribute(n):e.setAttribute(n,i)}for(let n=0;nqd(e,t,n);return this.emitter.listenTo(this.observable,"change:"+this.attribute,i),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,i)}}}class Wd extends Ud{activateDomEventListener(e,t,n){const i=(e,n)=>{t&&!n.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(n):this.observable.fire(this.eventNameOrFunction,n))};return this.emitter.listenTo(n.node,e,i),()=>{this.emitter.stopListening(n.node,e,i)}}}class Gd extends Ud{getValue(e){return!ic(super.getValue(e))&&(this.valueIfTrue||!0)}}function Hd(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(Hd):e instanceof Ud)}function qd(e,t,{node:n}){let i=function(e,t){return e.map(e=>e instanceof Ud?e.getValue(t):e)}(e,n);i=1==e.length&&e[0]instanceof Gd?i[0]:i.reduce(ec,""),ic(i)?t.remove():t.set(i)}function Yd(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function Kd(e,t,n){return{set(i){e.setAttributeNS(n,t,i)},remove(){e.removeAttributeNS(n,t)}}}function Zd(e,t){return{set(n){e.style[t]=n},remove(){e.style[t]=null}}}function Xd(e){const t=Fn(e,e=>{if(e&&(e instanceof Ud||oc(e)||sc(e)||rc(e)))return e});return t}function Jd(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=Gn(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)Qd(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=Gn(e[t].value)),Qd(e,t)}(e.attributes);const t=[];if(e.children)if(rc(e.children))t.push(e.children);else for(const n of e.children)oc(n)||sc(n)||io(n)?t.push(n):t.push(new Vd(n));e.children=t}return e}function Qd(e,t){e[t]=Gn(e[t])}function ec(e,t){return ic(t)?e:ic(e)?t:`${e} ${t}`}function tc(e,t){for(const n in t)e[n]?e[n].push(...t[n]):e[n]=t[n]}function nc(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),tc(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),tc(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new u("ui-template-extend-children-mismatch",e);let n=0;for(const i of t.children)nc(e.children[n++],i)}}function ic(e){return!e&&0!==e}function sc(e){return e instanceof Bd}function oc(e){return e instanceof Vd}function rc(e){return e instanceof Nd}function ac(){return{children:[],bindings:[],attributes:{}}}function lc(e){return"class"==e||"style"==e}const dc=function(e){return"string"==typeof e||!ke(e)&&_e(e)&&"[object String]"==M(e)};class cc extends Nd{constructor(e,t=[]){super(t),this.locale=e}attachToDom(){this._bodyCollectionContainer=new Vd({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let e=document.querySelector(".ck-body-wrapper");e||(e=function(e,t,n={},i=[]){const s=n&&n.xmlns,o=s?e.createElementNS(s,t):e.createElement(t);for(const e in n)o.setAttribute(e,n[e]);!dc(i)&&Vn(i)||(i=[i]);for(let t of i)dc(t)&&(t=e.createTextNode(t)),o.appendChild(t);return o}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(e)),e.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const e=document.querySelector(".ck-body-wrapper");e&&0==e.childElementCount&&e.remove()}}var uc=o(174);oo()(uc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),uc.Z.locals;class hc extends Bd{constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");for(t&&(this.viewBox=t),this.element.innerHTML="";e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}var mc=o(948);oo()(mc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),mc.Z.locals;class gc extends Bd{constructor(e){super(e),this.set("text",""),this.set("position","s");const t=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",t.to("position",e=>"ck-tooltip_"+e),t.if("text","ck-hidden",e=>!e.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:t.to("text")}]}]})}}var pc=o(499);oo()(pc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),pc.Z.locals;class fc extends Bd{constructor(e){super(e);const t=this.bindTemplate,n=a();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(n),this.iconView=new hc,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",t.to("class"),t.if("isEnabled","ck-disabled",e=>!e),t.if("isVisible","ck-hidden",e=>!e),t.to("isOn",e=>e?"ck-on":"ck-off"),t.if("withText","ck-button_with-text"),t.if("withKeystroke","ck-button_with-keystroke")],type:t.to("type",e=>e||"button"),tabindex:t.to("tabindex"),"aria-labelledby":`ck-editor__aria-label_${n}`,"aria-disabled":t.if("isEnabled",!0,e=>!e),"aria-pressed":t.to("isOn",e=>!!this.isToggleable&&String(e))},children:this.children,on:{mousedown:t.to(e=>{e.preventDefault()}),click:t.to(e=>{this.isEnabled?this.fire("execute"):e.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const e=new gc;return e.bind("text").to(this,"_tooltipString"),e.bind("position").to(this,"tooltipPosition"),e}_createLabelView(e){const t=new Bd,n=this.bindTemplate;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:n.to("labelStyle"),id:`ck-editor__aria-label_${e}`},children:[{text:this.bindTemplate.to("label")}]}),t}_createKeystrokeView(){const e=new Bd;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",e=>Cs(e))}]}),e}_getTooltipString(e,t,n){return e?"string"==typeof e?e:(n&&(n=Cs(n)),e instanceof Function?e(t,n):`${t}${n?` (${n})`:""}`):""}}var xc=o(681);oo()(xc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),xc.Z.locals;class _c extends fc{constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new Bd;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}function Ic(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}class vc extends fc{constructor(e){super(e);const t=this.bindTemplate;this.set("color"),this.set("hasBorder"),this.icon='',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color")},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-table__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}function bc(e){return!!(e&&e.getClientRects&&e.getClientRects().length)}class jc{constructor(e){if(Object.assign(this,e),e.actions&&e.keystrokeHandler)for(const t in e.actions){let n=e.actions[t];"string"==typeof n&&(n=[n]);for(const i of n)e.keystrokeHandler.set(i,(e,n)=>{this[t](),n()})}}get first(){return this.focusables.find(Cc)||null}get last(){return this.focusables.filter(Cc).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((t,n)=>{const i=t.element===this.focusTracker.focusedElement;return i&&(e=n),i}),e)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(e){e&&e.focus()}_getFocusableItem(e){const t=this.current,n=this.focusables.length;if(!n)return null;if(null===t)return this[1===e?"first":"last"];let i=(t+n+e)%n;do{const t=this.focusables.get(i);if(Cc(t))return t;i=(i+n+e)%n}while(i!==t);return null}}function Cc(e){return!(!e.focus||!bc(e.element))}var yc=o(923);oo()(yc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),yc.Z.locals;class kc extends Bd{constructor(e,t){super(e);const n=t&&t.colorDefinitions||[],i={};t&&t.columns&&(i.gridTemplateColumns=`repeat( ${t.columns}, 1fr)`),this.set("selectedColor"),this.items=this.createCollection(),this.focusTracker=new Dr,this.keystrokes=new Pr,this._focusCycler=new jc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focusNext:"arrowright"}}),this.items.on("add",(e,t)=>{t.isOn=t.color===this.selectedColor}),n.forEach(e=>{const t=new vc;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})}),this.items.add(t)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:i}}),this.on("change:selectedColor",(e,t,n)=>{for(const e of this.items)e.isOn=e.color===n})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}class Ac extends fc{constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new hc;return e.content='',e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}var wc=o(66);oo()(wc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),wc.Z.locals;class Sc extends Bd{constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",e=>`ck-dropdown__panel_${e}`),t.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:t.to(e=>e.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}var Ec=o(488);function Tc({element:e,target:t,positions:n,limiter:i,fitInViewport:s,viewportOffsetConfig:o}){N(t)&&(t=t()),N(i)&&(i=i());const r=function(e){return e&&e.parentNode?e.offsetParent===ho.document.body?null:e.offsetParent:null}(e),a=new Ir(e);let l;const d={targetRect:new Ir(t),elementRect:a,positionedElementAncestor:r};if(i||s){const e=i&&new Ir(i).getVisible(),t=s&&function(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const t=new Ir(ho.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t}(o);Object.assign(d,{limiterRect:e,viewportRect:t}),l=function(e,t){const{elementRect:n}=t,i=n.getArea(),s=e.map(e=>new Oc(e,t)).filter(e=>!!e.name);let o=0,r=null;for(const e of s){const{_limiterIntersectionArea:t,_viewportIntersectionArea:n}=e;if(t===i)return e;const s=n**2+t**2;s>o&&(o=s,r=e)}return r}(n,d)||new Oc(n[0],d)}else l=new Oc(n[0],d);return l}function zc(e){const{scrollX:t,scrollY:n}=ho.window;return e.clone().moveBy(t,n)}oo()(Ec.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ec.Z.locals;class Oc{constructor(e,t){const n=e(t.targetRect,t.elementRect,t.viewportRect);if(!n)return;const{left:i,top:s,name:o,config:r}=n;Object.assign(this,{name:o,config:r}),this._positioningFunctionCorrdinates={left:i,top:s},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get _limiterIntersectionArea(){const e=this._options.limiterRect;if(e){const t=this._options.viewportRect;if(!t)return e.getIntersectionArea(this._rect);{const n=e.getIntersection(t);if(n)return n.getIntersectionArea(this._rect)}}return 0}get _viewportIntersectionArea(){const e=this._options.viewportRect;return e?e.getIntersectionArea(this._rect):0}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCorrdinates.left,this._positioningFunctionCorrdinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=zc(this._rect),this._options.positionedElementAncestor&&function(e,t){const n=zc(new Ir(t)),i=xr(t);let s=0,o=0;s-=n.left,o-=n.top,s+=t.scrollLeft,o+=t.scrollTop,s-=i.left,o-=i.top,e.moveBy(s,o)}(this._cachedAbsoluteRect,this._options.positionedElementAncestor)),this._cachedAbsoluteRect}}class Rc extends Bd{constructor(e,t,n){super(e);const i=this.bindTemplate;this.buttonView=t,this.panelView=n,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new Pr,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",i.to("class"),i.if("isEnabled","ck-disabled",e=>!e)],id:i.to("id"),"aria-describedby":i.to("ariaDescribedById")},children:[t,n]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=Rc._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const e=(e,t)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,t())};this.keystrokes.set("arrowdown",(e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())}),this.keystrokes.set("arrowright",(e,t)=>{this.isOpen&&t()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:n,southWest:i,northEast:s,northWest:o,southMiddleEast:r,southMiddleWest:a,northMiddleEast:l,northMiddleWest:d}=Rc.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[n,i,r,a,e,s,o,l,d,t]:[i,n,a,r,e,o,s,d,l,t]}}Rc.defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-3*(t.width-e.width)/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-3*(t.width-e.width)/4,name:"nmw"})},Rc._getOptimalPosition=Tc;class $c extends Bd{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Dc extends Bd{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Pc(e){return e.bindTemplate.to(t=>{t.target===e.element&&t.preventDefault()})}function Fc(e){return Array.isArray(e)?{items:e,removeItems:[]}:e?Object.assign({items:[],removeItems:[]},e):{items:[],removeItems:[]}}var Mc=o(571);oo()(Mc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Mc.Z.locals;class Nc extends Bd{constructor(e,t){super(e);const n=this.bindTemplate,i=this.t;this.options=t||{},this.set("ariaLabel",i("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Dr,this.keystrokes=new Pr,this.set("class"),this.set("isCompact",!1),this.itemsView=new Lc(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const s="rtl"===e.uiLanguageDirection;this._focusCycler=new jc({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[s?"arrowright":"arrowleft","arrowup"],focusNext:[s?"arrowleft":"arrowright","arrowdown"]}});const o=["ck","ck-toolbar",n.to("class"),n.if("isCompact","ck-toolbar_compact")];this.options.shouldGroupWhenFull&&this.options.isFloating&&o.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:o,role:"toolbar","aria-label":n.to("ariaLabel"),style:{maxWidth:n.to("maxWidth")}},children:this.children,on:{mousedown:Pc(this)}}),this._behavior=this.options.shouldGroupWhenFull?new Vc(this):new Bc(this)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t){const n=Fc(e),i=n.items.filter((e,i,s)=>"|"===e||-1===n.removeItems.indexOf(e)&&("-"===e?!this.options.shouldGroupWhenFull||(h("toolbarview-line-break-ignored-when-grouping-items",s),!1):!!t.has(e)||(h("toolbarview-item-unavailable",{name:e}),!1))),s=this._cleanSeparators(i).map(e=>"|"===e?new $c:"-"===e?new Dc:t.create(e));this.items.addMany(s)}_cleanSeparators(e){const t=e=>"-"!==e&&"|"!==e,n=e.length,i=e.findIndex(t),s=n-e.slice().reverse().findIndex(t);return e.slice(i,s).filter((e,n,i)=>!!t(e)||!(n>0&&i[n-1]===e))}}class Lc extends Bd{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Bc{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using(e=>e),e.focusables.bindTo(e.items).using(e=>e),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class Vc{constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,e.itemsView.children.bindTo(this.ungroupedItems).using(e=>e),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),e.children.on("add",this._updateFocusCycleableItems.bind(this)),e.children.on("remove",this._updateFocusCycleableItems.bind(this)),e.items.on("change",(e,t)=>{const n=t.index;for(const e of t.removed)n>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=n;ethis.ungroupedItems.length?this.groupedItems.add(i,e-this.ungroupedItems.length):this.ungroupedItems.add(i,e)}this._updateGrouping()}),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!bc(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,n=new Ir(e.lastChild),i=new Ir(e);if(!this.cachedPadding){const n=ho.window.getComputedStyle(e),i="ltr"===t?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(n[i])}return"ltr"===t?n.right>i.right-this.cachedPadding:n.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new $c),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,n=Kc(e);return n.class="ck-toolbar__grouped-dropdown",n.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",Zc(n,[]),n.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:''}),n.toolbarView.items.bindTo(this.groupedItems).using(e=>e),n}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}var Uc=o(162);oo()(Uc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Uc.Z.locals;class Wc extends Bd{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Dr,this.keystrokes=new Pr,this._focusCycler=new jc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class Gc extends Bd{constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class Hc extends Bd{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}var qc=o(75);oo()(qc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qc.Z.locals;var Yc=o(875);function Kc(e,t=Ac){const n=new t(e),i=new Sc(e),s=new Rc(e,n,i);return n.bind("isEnabled").to(s),n instanceof Ac?n.bind("isOn").to(s,"isOpen"):n.arrowView.bind("isOn").to(s,"isOpen"),function(e){(function(e){e.on("render",()=>{Pd({emitter:e,activator:()=>e.isOpen,callback:()=>{e.isOpen=!1},contextElements:[e.element]})})})(e),function(e){e.on("execute",t=>{t.source instanceof _c||(e.isOpen=!1)})}(e),function(e){e.keystrokes.set("arrowdown",(t,n)=>{e.isOpen&&(e.panelView.focus(),n())}),e.keystrokes.set("arrowup",(t,n)=>{e.isOpen&&(e.panelView.focusLast(),n())})}(e)}(s),s}function Zc(e,t){const n=e.locale,i=n.t,s=e.toolbarView=new Nc(n);s.set("ariaLabel",i("Dropdown toolbar")),e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),t.map(e=>s.items.add(e)),e.panelView.children.add(s),s.items.delegate("execute").to(e)}function Xc(e,t){const n=e.locale,i=e.listView=new Wc(n);i.items.bindTo(t).using(({type:e,model:t})=>{if("separator"===e)return new Hc(n);if("button"===e||"switchbutton"===e){const i=new Gc(n);let s;return s="button"===e?new fc(n):new _c(n),s.bind(...Object.keys(t)).to(t),s.delegate("execute").to(i),i.children.add(s),i}}),e.panelView.children.add(i),i.items.delegate("execute").to(e)}oo()(Yc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Yc.Z.locals;var Jc=o(547);oo()(Jc.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Jc.Z.locals;class Qc extends Bd{constructor(e){super(e),this.body=new cc(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}var eu=o(751);oo()(eu.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),eu.Z.locals;class tu extends Bd{constructor(e){super(e),this.set("text"),this.set("for"),this.id=`ck-editor__label_${a()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class nu extends Qc{constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const e=this.t,t=new tu;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class iu extends Bd{constructor(e,t,n){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=n,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change(n=>{const i=e.document.getRoot(t.name);n.addClass(t.isFocused?"ck-focused":"ck-blurred",i),n.removeClass(t.isFocused?"ck-blurred":"ck-focused",i)})}e.isRenderingInProgress?function n(i){e.once("change:isRenderingInProgress",(e,s,o)=>{o?n(i):t(i)})}(this):t(this)}}class su extends iu{constructor(e,t,n){super(e,t,n),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView,t=this.t;e.change(n=>{const i=e.document.getRoot(this.name);n.setAttribute("aria-label",t("Rich Text Editor, %0",this.name),i)})}}var ou=o(523);oo()(ou.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ou.Z.locals;var ru=o(985);oo()(ru.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ru.Z.locals;class au extends Bd{constructor(e){super(e),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new Dr,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0),this.set("inputMode","text");const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),readonly:t.to("isReadOnly"),inputmode:t.to("inputMode"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById")},on:{input:t.to((...e)=>{this.fire("input",...e),this._updateIsEmpty()}),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,n)=>{this._setDomElementValue(n),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=function(e){return!e.value}(this.element)}_setDomElementValue(e){this.element.value=e||0===e?e:""}}class lu extends au{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}var du=o(111);oo()(du.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),du.Z.locals;class cu extends Bd{constructor(e,t){super(e);const n=`ck-labeled-field-view-${a()}`,i=`ck-labeled-field-view-status-${a()}`;this.fieldView=t(this,n,i),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(n),this.statusView=this._createStatusView(i),this.bind("_statusText").to(this,"errorText",this,"infoText",(e,t)=>e||t);const s=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",s.to("class"),s.if("isEnabled","ck-disabled",e=>!e),s.if("isEmpty","ck-labeled-field-view_empty"),s.if("isFocused","ck-labeled-field-view_focused"),s.if("placeholder","ck-labeled-field-view_placeholder"),s.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(e){const t=new tu(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new Bd(this.locale),n=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",n.if("errorText","ck-labeled-field-view__status_error"),n.if("_statusText","ck-hidden",e=>!e)],id:e,role:n.if("errorText","alert")},children:[{text:n.to("_statusText")}]}),t}focus(){this.fieldView.focus()}}function uu(e,t,n){const i=new lu(e.locale);return i.set({id:t,ariaDescribedById:n}),i.bind("isReadOnly").to(e,"isEnabled",e=>!e),i.bind("hasError").to(e,"errorText",e=>!!e),i.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(i),i}class hu extends Zn{static get pluginName(){return"Notification"}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=`show:${e.type}`+(e.namespace?`:${e.namespace}`:"");this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class mu{constructor(e,t){t&&He(this,t),e&&this.set(e)}}function gu(e){return t=>t+e}ot(mu,Qe);var pu=o(245);oo()(pu.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),pu.Z.locals;const fu=gu("px"),xu=ho.document.body;class _u extends Bd{constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",e=>`ck-balloon-panel_${e}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",fu),left:t.to("left",fu)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){this.show();const t=_u.defaultPositions,n=Object.assign({},{element:this.element,positions:[t.southArrowNorth,t.southArrowNorthMiddleWest,t.southArrowNorthMiddleEast,t.southArrowNorthWest,t.southArrowNorthEast,t.northArrowSouth,t.northArrowSouthMiddleWest,t.northArrowSouthMiddleEast,t.northArrowSouthWest,t.northArrowSouthEast,t.viewportStickyNorth],limiter:xu,fitInViewport:!0},e),i=_u._getOptimalPosition(n),s=parseInt(i.left),o=parseInt(i.top),{name:r,config:a={}}=i,{withArrow:l=!0}=a;Object.assign(this,{top:o,left:s,position:r,withArrow:l})}pin(e){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this._startPinning(e),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){this.attachTo(e);const t=Iu(e.target),n=e.limiter?Iu(e.limiter):xu;this.listenTo(ho.document,"scroll",(i,s)=>{const o=s.target,r=t&&o.contains(t),a=n&&o.contains(n);!r&&!a&&t&&n||this.attachTo(e)},{useCapture:!0}),this.listenTo(ho.window,"resize",()=>{this.attachTo(e)})}_stopPinning(){this.stopListening(ho.document,"scroll"),this.stopListening(ho.window,"resize")}}function Iu(e){return Mn(e)?e:fr(e)?e.commonAncestorContainer:"function"==typeof e?Iu(e()):null}_u.arrowHorizontalOffset=25,_u.arrowVerticalOffset=10,_u.stickyVerticalOffset=20,_u._getOptimalPosition=Tc,_u.defaultPositions=function({horizontalOffset:e=_u.arrowHorizontalOffset,verticalOffset:t=_u.arrowVerticalOffset,stickyVerticalOffset:n=_u.stickyVerticalOffset,config:i}={}){return{northWestArrowSouthWest:(t,n)=>({top:s(t,n),left:t.left-e,name:"arrow_sw",...i&&{config:i}}),northWestArrowSouthMiddleWest:(t,n)=>({top:s(t,n),left:t.left-.25*n.width-e,name:"arrow_smw",...i&&{config:i}}),northWestArrowSouth:(e,t)=>({top:s(e,t),left:e.left-t.width/2,name:"arrow_s",...i&&{config:i}}),northWestArrowSouthMiddleEast:(t,n)=>({top:s(t,n),left:t.left-.75*n.width+e,name:"arrow_sme",...i&&{config:i}}),northWestArrowSouthEast:(t,n)=>({top:s(t,n),left:t.left-n.width+e,name:"arrow_se",...i&&{config:i}}),northArrowSouthWest:(t,n)=>({top:s(t,n),left:t.left+t.width/2-e,name:"arrow_sw",...i&&{config:i}}),northArrowSouthMiddleWest:(t,n)=>({top:s(t,n),left:t.left+t.width/2-.25*n.width-e,name:"arrow_smw",...i&&{config:i}}),northArrowSouth:(e,t)=>({top:s(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...i&&{config:i}}),northArrowSouthMiddleEast:(t,n)=>({top:s(t,n),left:t.left+t.width/2-.75*n.width+e,name:"arrow_sme",...i&&{config:i}}),northArrowSouthEast:(t,n)=>({top:s(t,n),left:t.left+t.width/2-n.width+e,name:"arrow_se",...i&&{config:i}}),northEastArrowSouthWest:(t,n)=>({top:s(t,n),left:t.right-e,name:"arrow_sw",...i&&{config:i}}),northEastArrowSouthMiddleWest:(t,n)=>({top:s(t,n),left:t.right-.25*n.width-e,name:"arrow_smw",...i&&{config:i}}),northEastArrowSouth:(e,t)=>({top:s(e,t),left:e.right-t.width/2,name:"arrow_s",...i&&{config:i}}),northEastArrowSouthMiddleEast:(t,n)=>({top:s(t,n),left:t.right-.75*n.width+e,name:"arrow_sme",...i&&{config:i}}),northEastArrowSouthEast:(t,n)=>({top:s(t,n),left:t.right-n.width+e,name:"arrow_se",...i&&{config:i}}),southWestArrowNorthWest:(t,n)=>({top:o(t),left:t.left-e,name:"arrow_nw",...i&&{config:i}}),southWestArrowNorthMiddleWest:(t,n)=>({top:o(t),left:t.left-.25*n.width-e,name:"arrow_nmw",...i&&{config:i}}),southWestArrowNorth:(e,t)=>({top:o(e),left:e.left-t.width/2,name:"arrow_n",...i&&{config:i}}),southWestArrowNorthMiddleEast:(t,n)=>({top:o(t),left:t.left-.75*n.width+e,name:"arrow_nme",...i&&{config:i}}),southWestArrowNorthEast:(t,n)=>({top:o(t),left:t.left-n.width+e,name:"arrow_ne",...i&&{config:i}}),southArrowNorthWest:(t,n)=>({top:o(t),left:t.left+t.width/2-e,name:"arrow_nw",...i&&{config:i}}),southArrowNorthMiddleWest:(t,n)=>({top:o(t),left:t.left+t.width/2-.25*n.width-e,name:"arrow_nmw",...i&&{config:i}}),southArrowNorth:(e,t)=>({top:o(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...i&&{config:i}}),southArrowNorthMiddleEast:(t,n)=>({top:o(t),left:t.left+t.width/2-.75*n.width+e,name:"arrow_nme",...i&&{config:i}}),southArrowNorthEast:(t,n)=>({top:o(t),left:t.left+t.width/2-n.width+e,name:"arrow_ne",...i&&{config:i}}),southEastArrowNorthWest:(t,n)=>({top:o(t),left:t.right-e,name:"arrow_nw",...i&&{config:i}}),southEastArrowNorthMiddleWest:(t,n)=>({top:o(t),left:t.right-.25*n.width-e,name:"arrow_nmw",...i&&{config:i}}),southEastArrowNorth:(e,t)=>({top:o(e),left:e.right-t.width/2,name:"arrow_n",...i&&{config:i}}),southEastArrowNorthMiddleEast:(t,n)=>({top:o(t),left:t.right-.75*n.width+e,name:"arrow_nme",...i&&{config:i}}),southEastArrowNorthEast:(t,n)=>({top:o(t),left:t.right-n.width+e,name:"arrow_ne",...i&&{config:i}}),viewportStickyNorth:(e,t,s)=>e.getIntersection(s)?{top:s.top+n,left:e.left+e.width/2-t.width/2,name:"arrowless",config:{withArrow:!1,...i}}:null};function s(e,n){return e.top-n.height-t}function o(e){return e.bottom+t}}();var vu=o(757);oo()(vu.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),vu.Z.locals;var bu=o(553);oo()(bu.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),bu.Z.locals;const ju=gu("px");class Cu extends rt{static get pluginName(){return"ContextualBalloon"}constructor(e){super(e),this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.set("visibleView",null),this.view=new _u(e.locale),e.ui.view.body.add(this.view),e.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}destroy(){super.destroy(),this.view.destroy(),this._rotatorView.destroy(),this._fakePanelsView.destroy()}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this.hasView(e.view))throw new u("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const n=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),n.set(e.view,e),this._viewToStack.set(e.view,n),n===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new u("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new u("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new yu(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(e,n)=>{if(n<2)return"";const i=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[i,n])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new ku(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(e,t)=>!t&&e>=2?Math.min(e-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:n=!0,singleViewMode:i=!1}){this.view.class=t,this.view.withArrow=n,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),i&&(this._singleViewMode=!0)}_getBalloonPosition(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:this.editor.ui.viewportOffset})),e}}class yu extends Bd{constructor(e){super(e);const t=e.t,n=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Dr,this.buttonPrevView=this._createButtonView(t("Previous"),''),this.buttonNextView=this._createButtonView(t("Next"),''),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",n.to("isNavigationVisible",e=>e?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:n.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const n=new fc(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n}}class ku extends Bd{constructor(e,t){super(e);const n=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",n.to("numberOfPanels",e=>e?"":"ck-hidden")],style:{top:n.to("top",ju),left:n.to("left",ju),width:n.to("width",ju),height:n.to("height",ju)}},children:this.content}),this.on("change:numberOfPanels",(e,t,n,i)=>{n>i?this._addPanels(n-i):this._removePanels(i-n),this.updatePosition()})}_addPanels(e){for(;e--;){const e=new Bd;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:n,height:i}=new Ir(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:n,height:i})}}}var Au=o(609);oo()(Au.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Au.Z.locals;const wu=gu("px");class Su extends Bd{constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new Vd({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",e=>e?"block":"none"),height:t.to("isSticky",e=>e?wu(this._panelRect.height):null)}}}).render(),this._contentPanel=new Vd({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",e=>e?wu(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_hasViewportTopOffset",e=>e?wu(this.viewportTopOffset):null),bottom:t.to("_isStickyToTheLimiter",e=>e?wu(this.limiterBottomOffset):null),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(ho.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const e=this._panelRect=this._contentPanel.getBoundingClientRect();let t;this.limiterElement?(t=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&t.top!e.is("uiElement"));if(n)return!1;if(t)return!0;const i=e.document;if(!i.isFocused)return!0;const s=i.selection.anchor;return s&&s.parent!==e}(o,n.keepOnFocus)?function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,o)&&(r=!0):function(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}(e,o)&&(r=!0),r}function $u(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}const Du=new Map;function Pu(e,t,n){let i=Du.get(e);i||(i=new Map,Du.set(e,i)),i.set(t,n)}function Fu(e){return[e]}function Mu(e,t,n={}){const i=function(e,t){const n=Du.get(e);return n&&n.has(t)?n.get(t):Fu}(e.constructor,t.constructor);try{return i(e=e.clone(),t,n)}catch(e){throw e}}function Nu(e,t,n){e=e.slice(),t=t.slice();const i=new Lu(n.document,n.useRelations,n.forceWeakRemove);i.setOriginalOperations(e),i.setOriginalOperations(t);const s=i.originalOperations;if(0==e.length||0==t.length)return{operationsA:e,operationsB:t,originalOperations:s};const o=new WeakMap;for(const t of e)o.set(t,0);const r={nextBaseVersionA:e[e.length-1].baseVersion+1,nextBaseVersionB:t[t.length-1].baseVersion+1,originalOperationsACount:e.length,originalOperationsBCount:t.length};let a=0;for(;a{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const i=e.range.getDifference(t.range).map(t=>new yl(t,e.key,e.oldValue,e.newValue,0)),s=e.range.getIntersection(t.range);return s&&n.aIsStrong&&i.push(new yl(s,t.key,t.newValue,e.newValue,0)),0==i.length?[new ed(0)]:i}return[e]}),Pu(yl,wl,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const n=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(t=>new yl(t,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){const i=Uu(t,e.key,e.oldValue);i&&n.unshift(i)}return n}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]}),Pu(yl,zl,(e,t)=>{const n=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&n.push(Xr._createFromPositionAndShift(t.graveyardPosition,1));const i=e.range._getTransformedByMergeOperation(t);return i.isCollapsed||n.push(i),n.map(t=>new yl(t,e.key,e.oldValue,e.newValue,e.baseVersion))}),Pu(yl,Al,(e,t)=>{const n=function(e,t){const n=Xr._createFromPositionAndShift(t.sourcePosition,t.howMany);let i=null,s=[];n.containsRange(e,!0)?i=e:e.start.hasSameParentAs(n.start)?(s=e.getDifference(n),i=e.getIntersection(n)):s=[e];const o=[];for(let e of s){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const n=t.getMovedRangeStart(),i=e.start.hasSameParentAs(n);e=e._getTransformedByInsertion(n,t.howMany,i),o.push(...e)}return i&&o.push(i._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]),o}(e.range,t);return n.map(t=>new yl(t,e.key,e.oldValue,e.newValue,e.baseVersion))}),Pu(yl,Ol,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const n=e.clone();return n.range=new Xr(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,n]}return e.range=e.range._getTransformedBySplitOperation(t),[e]}),Pu(wl,yl,(e,t)=>{const n=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const i=Uu(e,t.key,t.newValue);i&&n.push(i)}return n}),Pu(wl,wl,(e,t,n)=>(e.position.isEqual(t.position)&&n.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e])),Pu(wl,Al,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),Pu(wl,Ol,(e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e])),Pu(wl,zl,(e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e])),Pu(Sl,wl,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e])),Pu(Sl,Sl,(e,t,n)=>{if(e.name==t.name){if(!n.aIsStrong)return[new ed(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]}),Pu(Sl,zl,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e])),Pu(Sl,Al,(e,t,n)=>{if(e.oldRange&&(e.oldRange=Xr._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){if(n.abRelation){const i=Xr._createFromRanges(e.newRange._getTransformedByMoveOperation(t));if("left"==n.abRelation.side&&t.targetPosition.isEqual(e.newRange.start))return e.newRange.start.path=n.abRelation.path,e.newRange.end=i.end,[e];if("right"==n.abRelation.side&&t.targetPosition.isEqual(e.newRange.end))return e.newRange.start=i.start,e.newRange.end.path=n.abRelation.path,[e]}e.newRange=Xr._createFromRanges(e.newRange._getTransformedByMoveOperation(t))}return[e]}),Pu(Sl,Ol,(e,t,n)=>{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(n.abRelation){const i=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&n.abRelation.wasStartBeforeMergedElement?e.newRange.start=qr._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!n.abRelation.wasInLeftElement&&(e.newRange.start=qr._createAt(t.moveTargetPosition)),e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasInRightElement?e.newRange.end=qr._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&n.abRelation.wasEndBeforeMergedElement?e.newRange.end=qr._createAt(t.insertionPosition):e.newRange.end=i.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]}),Pu(zl,wl,(e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e])),Pu(zl,zl,(e,t,n)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(n.bWasUndone){const n=t.graveyardPosition.path.slice();return n.push(0),e.sourcePosition=new qr(t.graveyardPosition.root,n),e.howMany=0,[e]}return[new ed(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!n.bWasUndone&&"splitAtSource"!=n.abRelation){const i="$graveyard"==e.targetPosition.root.rootName,s="$graveyard"==t.targetPosition.root.rootName;if(s&&!i||(!i||s)&&n.aIsStrong){const n=t.targetPosition._getTransformedByMergeOperation(t),i=e.targetPosition._getTransformedByMergeOperation(t);return[new Al(n,e.howMany,i,0)]}return[new ed(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&n.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),Pu(zl,Al,(e,t,n)=>{const i=Xr._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!n.bWasUndone&&!n.forceWeakRemove&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.sourcePosition)?[new ed(0)]:(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])}),Pu(zl,Ol,(e,t,n)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){const i=0!=t.howMany,s=t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition);if(i||s||"mergeTargetNotMoved"==n.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==n.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==n.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}),Pu(Al,wl,(e,t)=>{const n=Xr._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]}),Pu(Al,Al,(e,t,n)=>{const i=Xr._createFromPositionAndShift(e.sourcePosition,e.howMany),s=Xr._createFromPositionAndShift(t.sourcePosition,t.howMany);let o,r=n.aIsStrong,a=!n.aIsStrong;if("insertBefore"==n.abRelation||"insertAfter"==n.baRelation?a=!0:"insertAfter"!=n.abRelation&&"insertBefore"!=n.baRelation||(a=!1),o=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Wu(e,t)&&Wu(t,e))return[t.getReversed()];if(i.containsPosition(t.targetPosition)&&i.containsRange(s,!0))return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Gu([i],o);if(s.containsPosition(e.targetPosition)&&s.containsRange(i,!0))return i.start=i.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),i.end=i.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),Gu([i],o);const l=Xn(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return i.start=i.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),i.end=i.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Gu([i],o);"remove"!=e.type||"remove"==t.type||n.aWasUndone||n.forceWeakRemove?"remove"==e.type||"remove"!=t.type||n.bWasUndone||n.forceWeakRemove||(r=!1):r=!0;const d=[],c=i.getDifference(s);for(const e of c){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const n="same"==Xn(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),i=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,n);d.push(...i)}const u=i.getIntersection(s);return null!==u&&r&&(u.start=u.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),u.end=u.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===d.length?d.push(u):1==d.length?s.start.isBefore(i.start)||s.start.isEqual(i.start)?d.unshift(u):d.push(u):d.splice(1,0,u)),0===d.length?[new ed(e.baseVersion)]:Gu(d,o)}),Pu(Al,Ol,(e,t,n)=>{let i=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=n.abRelation||(i=e.targetPosition._getTransformedBySplitOperation(t));const s=Xr._createFromPositionAndShift(e.sourcePosition,e.howMany);if(s.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=i,[e];if(s.start.hasSameParentAs(t.splitPosition)&&s.containsPosition(t.splitPosition)){let e=new Xr(t.splitPosition,s.end);return e=e._getTransformedBySplitOperation(t),Gu([new Xr(s.start,t.splitPosition),e],i)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==n.abRelation&&(i=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==n.abRelation&&(i=e.targetPosition);const o=[s._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const i=s.start.isEqual(t.graveyardPosition)||s.containsPosition(t.graveyardPosition);e.howMany>1&&i&&!n.aWasUndone&&o.push(Xr._createFromPositionAndShift(t.insertionPosition,1))}return Gu(o,i)}),Pu(Al,zl,(e,t,n)=>{const i=Xr._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.sourcePosition))if("remove"!=e.type||n.forceWeakRemove){if(1==e.howMany)return n.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new ed(0)]}else if(!n.aWasUndone){const n=[];let i=t.graveyardPosition.clone(),s=t.targetPosition._getTransformedByMergeOperation(t);e.howMany>1&&(n.push(new Al(e.sourcePosition,e.howMany-1,e.targetPosition,0)),i=i._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1),s=s._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany-1));const o=t.deletionPosition._getCombined(e.sourcePosition,e.targetPosition),r=new Al(i,1,o,0),a=r.getMovedRangeStart().path.slice();a.push(0);const l=new qr(r.targetPosition.root,a);s=s._getTransformedByMove(i,o,1);const d=new Al(s,t.howMany,l,0);return n.push(r),n.push(d),n}const s=Xr._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=s.start,e.howMany=s.end.offset-s.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]}),Pu(El,wl,(e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e])),Pu(El,zl,(e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e])),Pu(El,Al,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e])),Pu(El,El,(e,t,n)=>{if(e.position.isEqual(t.position)){if(!n.aIsStrong)return[new ed(0)];e.oldName=t.newName}return[e]}),Pu(El,Ol,(e,t)=>{if("same"==Xn(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){const t=new El(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]}),Pu(Tl,Tl,(e,t,n)=>{if(e.root===t.root&&e.key===t.key){if(!n.aIsStrong||e.newValue===t.newValue)return[new ed(0)];e.oldValue=t.newValue}return[e]}),Pu(Ol,wl,(e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!n.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const n=t.graveyardPosition.path.slice();n.push(0);const i=new qr(t.graveyardPosition.root,n),s=Ol.getInsertionPosition(new qr(t.graveyardPosition.root,n)),o=new Ol(i,0,s,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Ol.getInsertionPosition(e.splitPosition),e.graveyardPosition=o.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[o,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=Ol.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]}),Pu(Ol,Al,(e,t,n)=>{const i=Xr._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const s=i.start.isEqual(e.graveyardPosition)||i.containsPosition(e.graveyardPosition);if(!n.bWasUndone&&s){const n=e.splitPosition._getTransformedByMoveOperation(t),i=e.graveyardPosition._getTransformedByMoveOperation(t),s=i.path.slice();s.push(0);const o=new qr(i.root,s);return[new Al(n,e.howMany,o,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}const s=e.splitPosition.isEqual(t.targetPosition);if(s&&("insertAtSource"==n.baRelation||"splitBefore"==n.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=Ol.getInsertionPosition(e.splitPosition),[e];if(s&&n.abRelation&&n.abRelation.howMany){const{howMany:t,offset:i}=n.abRelation;return e.howMany+=t,e.splitPosition=e.splitPosition.getShiftedBy(i),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)){const n=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=n,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new ed(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new ed(0)];if("splitBefore"==n.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const i="$graveyard"==e.splitPosition.root.rootName,s="$graveyard"==t.splitPosition.root.rootName;if(s&&!i||(!i||s)&&n.aIsStrong){const n=[];return t.howMany&&n.push(new Al(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&n.push(new Al(e.splitPosition,e.howMany,e.moveTargetPosition,0)),n}return[new ed(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==n.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==n.baRelation){const n=t.insertionPosition.path.slice();n.push(0);const i=new qr(t.insertionPosition.root,n);return[e,new Al(e.insertionPosition,1,i,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset({path:"background.color",value:e})),e.setReducer("background",e=>{const t=[];return t.push(["background-color",e.color]),t}),e.setStyleRelation("background",["background-color"])}function uh(e){const t={},n=function(e){return e.replace(/, /g,",").split(" ").map(e=>e.replace(/,/g,", "))}(e);for(const e of n)ih(e)?(t.repeat=t.repeat||[],t.repeat.push(e)):oh(e)?(t.position=t.position||[],t.position.push(e)):ah(e)?t.attachment=e:th(e)?t.color=e:dh(e)&&(t.image=e);return{path:"background",value:t}}class hh extends Sd{constructor(e,t){super(e),this.view=t,this._toolbarConfig=Fc(e.config.get("toolbar")),this._elementReplacer=new pr}get element(){return this.view.element}init(e){const t=this.editor,n=this.view,i=t.editing.view,s=n.editable,o=i.document.getRoot();s.name=o.rootName,n.render();const r=s.element;this.setEditableElement(s.name,r),this.focusTracker.add(r),n.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(r),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy(),super.destroy()}_initToolbar(){const e=this.editor,t=this.view,n=e.editing.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",({top:e})=>e),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),function({origin:e,originKeystrokeHandler:t,originFocusTracker:n,toolbar:i,beforeFocus:s,afterBlur:o}){n.add(i.element),t.set("Alt+F10",(e,t)=>{n.isFocused&&!i.focusTracker.isFocused&&(s&&s(),i.focus(),t())}),i.keystrokes.set("Esc",(t,n)=>{i.focusTracker.isFocused&&(e.focus(),o&&o(),n())})}({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:e.keystrokes,toolbar:t.toolbar})}_initPlaceholder(){const e=this.editor,t=e.editing.view,n=t.document.getRoot(),i=e.sourceElement,s=e.config.get("placeholder")||i&&"textarea"===i.tagName.toLowerCase()&&i.getAttribute("placeholder");s&&function(e){const{view:t,element:n,text:i,isDirectHost:s=!0,keepOnFocus:o=!1}=e,r=t.document;zu.has(r)||(zu.set(r,new Map),r.registerPostFixer(e=>Ou(r,e))),zu.get(r).set(n,{text:i,isDirectHost:s,keepOnFocus:o,hostElement:s?n:null}),t.change(e=>Ou(r,e))}({view:t,element:n,text:s,isDirectHost:!1,keepOnFocus:!0})}}var mh=o(638);oo()(mh.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),mh.Z.locals;class gh extends nu{constructor(e,t,n={}){super(e),this.stickyPanel=new Su(e),this.toolbar=new Nc(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),this.editable=new su(e,t)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class ph extends kd{constructor(e,t={}){if(!Mn(e)&&void 0!==t.initialData)throw new u("editor-create-initial-data",null);super(t),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return Mn(e)?function(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}(e):e}(e)),Mn(e)&&(this.sourceElement=e),this.model.document.createRoot();const n=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new gh(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:n});this.ui=new hh(this,i),function(e){if(!N(e.updateSourceElement))throw new u("attachtoform-missing-elementapi-interface",e);const t=e.sourceElement;if(t&&"textarea"===t.tagName.toLowerCase()&&t.form){let n;const i=t.form,s=()=>e.updateSourceElement();N(i.submit)&&(n=i.submit,i.submit=()=>{s(),n.apply(i)}),i.addEventListener("submit",s),e.on("destroy",()=>{i.removeEventListener("submit",s),n&&(i.submit=n)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise(n=>{const i=new this(e,t);n(i.initPlugins().then(()=>i.ui.init(Mn(e)?e:null)).then(()=>i.data.init(i.config.get("initialData"))).then(()=>i.fire("ready")).then(()=>i))})}}ot(ph,Td),ot(ph,Od);const fh=["left","right","center","justify"];function xh(e){return fh.includes(e)}function _h(e,t){return"rtl"==t.contentLanguageDirection?"right"===e:"left"===e}function Ih(e){const t=e.map(e=>{let t;return t="string"==typeof e?{name:e}:e,t}).filter(e=>{const t=!!fh.includes(e.name);return t||h("alignment-config-name-not-recognized",{option:e}),t}),n=t.filter(e=>!!e.className).length;if(n&&n{const s=i.slice(n+1),o=s.some(e=>e.name==t.name);if(o)throw new u("alignment-config-name-already-defined",{option:t,configuredOptions:e});if(t.className){const n=s.some(e=>e.className==t.className);if(n)throw new u("alignment-config-classname-already-defined",{option:t,configuredOptions:e})}}),t}const vh="alignment";class bh extends lt{refresh(){const e=this.editor.locale,t=$r(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!t&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value="rtl"===e.contentLanguageDirection?"right":"left"}execute(e={}){const t=this.editor,n=t.locale,i=t.model,s=i.document,o=e.value;i.change(e=>{const t=Array.from(s.selection.getSelectedBlocks()).filter(e=>this._canBeAligned(e)),i=t[0].getAttribute("alignment");_h(o,n)||i===o||!o?function(e,t){for(const n of e)t.removeAttribute(vh,n)}(t,e):function(e,t,n){for(const i of e)t.setAttribute(vh,n,i)}(t,e,o)})}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,vh)}}class jh extends rt{static get pluginName(){return"AlignmentEditing"}constructor(e){super(e),e.config.define("alignment",{options:[...fh.map(e=>({name:e}))]})}init(){const e=this.editor,t=e.locale,n=e.model.schema,i=Ih(e.config.get("alignment.options")).filter(e=>xh(e.name)&&!_h(e.name,t)),s=i.some(e=>!!e.className);n.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),s?e.conversion.attributeToAttribute(function(e){const t={model:{key:"alignment",values:e.map(e=>e.name)},view:{}};for(const n of e)t.view[n.name]={key:"class",value:n.className};return t}(i)):e.conversion.for("downcast").attributeToAttribute(function(e){const t={model:{key:"alignment",values:e.map(e=>e.name)},view:{}};for(const{name:n}of e)t.view[n]={key:"style",value:{"text-align":n}};return t}(i));const o=function(e){const t=[];for(const{name:n}of e)t.push({view:{key:"style",value:{"text-align":n}},model:{key:"alignment",value:n}});return t}(i);for(const t of o)e.conversion.for("upcast").attributeToAttribute(t);const r=function(e){const t=[];for(const{name:n}of e)t.push({view:{key:"align",value:n},model:{key:"alignment",value:n}});return t}(i);for(const t of r)e.conversion.for("upcast").attributeToAttribute(t);e.commands.add("alignment",new bh(e))}}const Ch=new Map([["left",''],["right",''],["center",''],["justify",'']]);class yh extends rt{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const e=this.editor,t=e.ui.componentFactory,n=e.t,i=Ih(e.config.get("alignment.options"));i.map(e=>e.name).filter(xh).forEach(e=>this._addButton(e)),t.add("alignment",e=>{const s=Kc(e),o=i.map(e=>t.create(`alignment:${e.name}`));Zc(s,o),s.buttonView.set({label:n("Text alignment"),tooltip:!0}),s.toolbarView.isVertical=!0,s.toolbarView.ariaLabel=n("Text alignment toolbar"),s.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const r="rtl"===e.contentLanguageDirection?Ch.get("right"):Ch.get("left");return s.buttonView.bind("icon").toMany(o,"isOn",(...e)=>{const t=e.findIndex(e=>e);return t<0?r:o[t].icon}),s.bind("isEnabled").toMany(o,"isEnabled",(...e)=>e.some(e=>e)),s})}_addButton(e){const t=this.editor;t.ui.componentFactory.add(`alignment:${e}`,n=>{const i=t.commands.get("alignment"),s=new fc(n);return s.set({label:this.localizedOptionTitles[e],icon:Ch.get(e),tooltip:!0,isToggleable:!0}),s.bind("isEnabled").to(i),s.bind("isOn").to(i,"value",t=>t===e),this.listenTo(s,"execute",()=>{t.execute("alignment",{value:e}),t.editing.view.focus()}),s})}}function*kh(e,t){for(const n of t)n&&e.getAttributeProperties(n[0]).copyOnEnter&&(yield n)}class Ah extends lt{execute(){const e=this.editor.model,t=e.document;e.change(n=>{!function(e,t,n,i){const s=n.isCollapsed,o=n.getFirstRange(),r=o.start.parent,a=o.end.parent;if(i.isLimit(r)||i.isLimit(a))s||r!=a||e.deleteContent(n);else if(s){const e=kh(t.model.schema,n.getAttributes());wh(t,o.start),t.setSelectionAttribute(e)}else{const i=!(o.start.isAtStart&&o.end.isAtEnd),s=r==a;e.deleteContent(n,{leaveUnmerged:i}),i&&(s?wh(t,n.focus):t.setSelection(a,0))}}(this.editor.model,n,t.selection,e.schema),this.fire("afterExecute",{writer:n})})}}function wh(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}class Sh extends To{constructor(e){super(e);const t=this.document;t.on("keydown",(e,n)=>{if(this.isEnabled&&n.keyCode==Is.enter){const i=new Qi(t,"enter",t.selection.getFirstRange());t.fire(i,new Ko(t,n.domEvent,{isSoft:n.shiftKey})),i.stop.called&&e.stop()}})}observe(){}}class Eh extends rt{static get pluginName(){return"Enter"}init(){const e=this.editor,t=e.editing.view,n=t.document;t.addObserver(Sh),e.commands.add("enter",new Ah(e)),this.listenTo(n,"enter",(n,i)=>{i.preventDefault(),i.isSoft||(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"})}}class Th extends lt{execute(){const e=this.editor.model,t=e.document;e.change(n=>{!function(e,t,n){const i=n.isCollapsed,s=n.getFirstRange(),o=s.start.parent,r=s.end.parent,a=o==r;if(i){const i=kh(e.schema,n.getAttributes());zh(e,t,s.end),t.removeSelectionAttribute(n.getAttributeKeys()),t.setSelectionAttribute(i)}else{const i=!(s.start.isAtStart&&s.end.isAtEnd);e.deleteContent(n,{leaveUnmerged:i}),a?zh(e,t,n.focus):i&&t.setSelection(r,0)}}(e,n,t.selection),this.fire("afterExecute",{writer:n})})}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const n=t.anchor;if(!n||!e.checkChild(n,"softBreak"))return!1;const i=t.getFirstRange(),s=i.start.parent,o=i.end.parent;return!Oh(s,e)&&!Oh(o,e)||s===o}(e.schema,t.selection)}}function zh(e,t,n){const i=t.createElement("softBreak");e.insertContent(i,n),t.setSelection(i,"after")}function Oh(e,t){return!e.is("rootElement")&&(t.isLimit(e)||Oh(e.parent,t))}class Rh extends rt{static get pluginName(){return"ShiftEnter"}init(){const e=this.editor,t=e.model.schema,n=e.conversion,i=e.editing.view,s=i.document;t.register("softBreak",{allowWhere:"$text",isInline:!0}),n.for("upcast").elementToElement({model:"softBreak",view:"br"}),n.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),i.addObserver(Sh),e.commands.add("shiftEnter",new Th(e)),this.listenTo(s,"enter",(t,n)=>{n.preventDefault(),n.isSoft&&(e.execute("shiftEnter"),i.scrollToTheSelection())},{priority:"low"})}}class $h{constructor(e,t=20){this.model=e,this.size=0,this.limit=t,this.isLocked=!1,this._changeCallback=(e,t)=>{t.isLocal&&t.isUndoable&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}input(e){this.size+=e,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e){this.isLocked&&!e||(this._batch=null,this.size=0)}}class Dh extends lt{constructor(e,t){super(e),this._buffer=new $h(e.model,t)}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,n=t.document,i=e.text||"",s=i.length,o=e.range?t.createSelection(e.range):n.selection,r=e.resultRange;t.enqueueChange(this._buffer.batch,e=>{this._buffer.lock(),t.deleteContent(o),i&&t.insertContent(e.createText(i,n.selection.getAttributes()),o),r?e.setSelection(r):o.is("documentSelection")||e.setSelection(o),this._buffer.unlock(),this._buffer.input(s)})}}function Ph(e){if(e.newChildren.length-e.oldChildren.length!=1)return;const t=function(e,t){const n=[];let i,s=0;return e.forEach(e=>{"equal"==e?(o(),s++):"insert"==e?(r("insert")?i.values.push(t[s]):(o(),i={type:"insert",index:s,values:[t[s]]}),s++):r("delete")?i.howMany++:(o(),i={type:"delete",index:s,howMany:1})}),o(),n;function o(){i&&(n.push(i),i=null)}function r(e){return i&&i.type==e}}(Qs(e.oldChildren,e.newChildren,Fh),e.newChildren);if(t.length>1)return;const n=t[0];return n.values[0]&&n.values[0].is("$text")?n:void 0}function Fh(e,t){return e&&e.is("$text")&&t&&t.is("$text")?e.data===t.data:e===t}function Mh(e,t){const n=t.selection,i=e.shiftKey&&e.keyCode===Is.delete,s=!n.isCollapsed;return i&&s}const Nh=[bs("arrowUp"),bs("arrowRight"),bs("arrowDown"),bs("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let e=112;e<=135;e++)Nh.push(e);function Lh(e){return!(!e.ctrlKey&&!e.metaKey)||Nh.includes(e.keyCode)}class Bh{constructor(e){this.editor=e,this.editing=this.editor.editing}handle(e,t){if(function(e){if(0==e.length)return!1;for(const t of e)if("children"===t.type&&!Ph(t))return!0;return!1}(e))this._handleContainerChildrenMutations(e,t);else for(const n of e)this._handleTextMutation(n,t),this._handleTextNodeInsertion(n)}_handleContainerChildrenMutations(e,t){const n=function(e){const t=e.map(e=>e.node).reduce((e,t)=>e.getCommonAncestor(t,{includeSelf:!0}));if(t)return t.getAncestors({includeSelf:!0,parentFirst:!0}).find(e=>e.is("containerElement")||e.is("rootElement"))}(e);if(!n)return;const i=this.editor.editing.view.domConverter.mapViewToDom(n),s=new bo(this.editor.editing.view.document),o=this.editor.data.toModel(s.domToView(i)).getChild(0),r=this.editor.editing.mapper.toModelElement(n);if(!r)return;const a=Array.from(o.getChildren()),l=Array.from(r.getChildren()),d=a[a.length-1],c=l[l.length-1],u=d&&d.is("element","softBreak"),h=c&&!c.is("element","softBreak");u&&h&&a.pop();const m=this.editor.model.schema;if(!Vh(a,m)||!Vh(l,m))return;const g=a.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," "),p=l.map(e=>e.is("$text")?e.data:"@").join("").replace(/\u00A0/g," ");if(p===g)return;const f=Qs(p,g),{firstChangeAt:x,insertions:_,deletions:I}=Uh(f);let v=null;t&&(v=this.editing.mapper.toModelRange(t.getFirstRange()));const b=g.substr(x,_),j=this.editor.model.createRange(this.editor.model.createPositionAt(r,x),this.editor.model.createPositionAt(r,x+I));this.editor.execute("input",{text:b,range:j,resultRange:v})}_handleTextMutation(e,t){if("text"!=e.type)return;const n=e.newText.replace(/\u00A0/g," "),i=e.oldText.replace(/\u00A0/g," ");if(i===n)return;const s=Qs(i,n),{firstChangeAt:o,insertions:r,deletions:a}=Uh(s);let l=null;t&&(l=this.editing.mapper.toModelRange(t.getFirstRange()));const d=this.editing.view.createPositionAt(e.node,o),c=this.editing.mapper.toModelPosition(d),u=this.editor.model.createRange(c,c.getShiftedBy(a)),h=n.substr(o,r);this.editor.execute("input",{text:h,range:u,resultRange:l})}_handleTextNodeInsertion(e){if("children"!=e.type)return;const t=Ph(e),n=this.editing.view.createPositionAt(e.node,t.index),i=this.editing.mapper.toModelPosition(n),s=t.values[0].data;this.editor.execute("input",{text:s.replace(/\u00A0/g," "),range:this.editor.model.createRange(i)})}}function Vh(e,t){return e.every(e=>t.isInline(e))}function Uh(e){let t=null,n=null;for(let i=0;i{n.deleteContent(n.document.selection)}),e.unlock()}ps.isAndroid?i.document.on("beforeinput",(e,t)=>o(t),{priority:"lowest"}):i.document.on("keydown",(e,t)=>o(t),{priority:"lowest"}),i.document.on("compositionstart",function(){const e=n.document,t=1!==e.selection.rangeCount||e.selection.getFirstRange().isFlat;e.selection.isCollapsed||t||r()},{priority:"lowest"}),i.document.on("compositionend",()=>{t=n.createSelection(n.document.selection)},{priority:"lowest"})}(e),function(e){e.editing.view.document.on("mutations",(t,n,i)=>{new Bh(e).handle(n,i)})}(e)}}class Gh extends lt{constructor(e,t){super(e),this.direction=t,this._buffer=new $h(e.model,e.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,n=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();const s=i.createSelection(e.selection||n.selection),o=e.sequence||1,r=s.isCollapsed;if(s.isCollapsed&&t.modifySelection(s,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(o))return void this._replaceEntireContentWithParagraph(i);if(this._shouldReplaceFirstBlockWithParagraph(s,o))return void this.editor.execute("paragraph",{selection:s});if(s.isCollapsed)return;let a=0;s.getFirstRange().getMinimalFlatRanges().forEach(e=>{a+=Zi(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(s,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(a),i.setSelection(s),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n);if(!n.isCollapsed||!n.containsEntireContent(i))return!1;if(!t.schema.checkChild(i,"paragraph"))return!1;const s=i.getChild(0);return!s||"paragraph"!==s.name}_replaceEntireContentWithParagraph(e){const t=this.editor.model,n=t.document.selection,i=t.schema.getLimitElement(n),s=e.createElement("paragraph");e.remove(e.createRangeIn(i)),e.insert(s,i),e.setSelection(s,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const n=this.editor.model;if(t>1||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;const i=e.getFirstPosition(),s=n.schema.getLimitElement(i),o=s.getChild(0);return i.parent==o&&!!e.containsEntireContent(o)&&!!n.schema.checkChild(s,"paragraph")&&"paragraph"!=o.name}}class Hh extends To{constructor(e){super(e);const t=e.document;let n=0;function i(e,n,i){const s=new Qi(t,"delete",t.selection.getFirstRange());t.fire(s,new Ko(t,n,i)),s.stop.called&&e.stop()}t.on("keyup",(e,t)=>{t.keyCode!=Is.delete&&t.keyCode!=Is.backspace||(n=0)}),t.on("keydown",(e,s)=>{if(ps.isWindows&&Mh(s,t))return;const o={};if(s.keyCode==Is.delete)o.direction="forward",o.unit="character";else{if(s.keyCode!=Is.backspace)return;o.direction="backward",o.unit="codePoint"}const r=ps.isMac?s.altKey:s.ctrlKey;o.unit=r?"word":o.unit,o.sequence=++n,i(e,s.domEvent,o)}),ps.isAndroid&&t.on("beforeinput",(t,n)=>{if("deleteContentBackward"!=n.domEvent.inputType)return;const s={unit:"codepoint",direction:"backward",sequence:1},o=n.domTarget.ownerDocument.defaultView.getSelection();o.anchorNode==o.focusNode&&o.anchorOffset+1!=o.focusOffset&&(s.selectionToRemove=e.domConverter.domSelectionToView(o)),i(t,n.domEvent,s)})}observe(){}}class qh extends rt{static get pluginName(){return"Delete"}init(){const e=this.editor,t=e.editing.view,n=t.document,i=e.model.document;t.addObserver(Hh),this._undoOnBackspace=!1;const s=new Gh(e,"forward");if(e.commands.add("deleteForward",s),e.commands.add("forwardDelete",s),e.commands.add("delete",new Gh(e,"backward")),this.listenTo(n,"delete",(n,i)=>{const s={unit:i.unit,sequence:i.sequence};if(i.selectionToRemove){const t=e.model.createSelection(),n=[];for(const t of i.selectionToRemove.getRanges())n.push(e.editing.mapper.toModelRange(t));t.setTo(n),s.selection=t}e.execute("forward"==i.direction?"deleteForward":"delete",s),i.preventDefault(),t.scrollToTheSelection()},{priority:"low"}),ps.isAndroid){let e=null;this.listenTo(n,"delete",(t,n)=>{const i=n.domTarget.ownerDocument.defaultView.getSelection();e={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}},{priority:"lowest"}),this.listenTo(n,"keyup",(t,n)=>{if(e){const t=n.domTarget.ownerDocument.defaultView.getSelection();t.collapse(e.anchorNode,e.anchorOffset),t.extend(e.focusNode,e.focusOffset),e=null}})}this.editor.plugins.has("UndoEditing")&&(this.listenTo(n,"delete",(t,n)=>{this._undoOnBackspace&&"backward"==n.direction&&1==n.sequence&&"codePoint"==n.unit&&(this._undoOnBackspace=!1,e.execute("undo"),n.preventDefault(),t.stop())},{context:"$capture"}),this.listenTo(i,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class Yh extends rt{static get requires(){return[Wh,qh]}static get pluginName(){return"Typing"}}function Kh(e,t){let n=e.start;return{text:Array.from(e.getItems()).reduce((e,i)=>i.is("$text")||i.is("$textProxy")?e+i.data:(n=t.createPositionAfter(i),""),""),range:t.createRange(n,e.end)}}class Zh{constructor(e,t){this.model=e,this.testCallback=t,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:n})=>{n&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(e,"change:data",(e,t)=>{!t.isUndo&&t.isLocal&&this._evaluateTextBeforeSelection("data",{batch:t})})}_evaluateTextBeforeSelection(e,t={}){const n=this.model,i=n.document.selection,s=n.createRange(n.createPositionAt(i.focus.parent,0),i.focus),{text:o,range:r}=Kh(s,n),a=this.testCallback(o);if(!a&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!a,a){const n=Object.assign(t,{text:o,range:r});"object"==typeof a&&Object.assign(n,a),this.fire(`matched:${e}`,n)}}}ot(Zh,Qe);class Xh extends rt{static get pluginName(){return"TwoStepCaretMovement"}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,n=e.editing.view,i=e.locale,s=t.document.selection;this.listenTo(n.document,"arrowKey",(e,t)=>{if(!s.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const n=t.keyCode==Is.arrowright,o=t.keyCode==Is.arrowleft;if(!n&&!o)return;const r=i.contentLanguageDirection;let a=!1;a="ltr"===r&&n||"rtl"===r&&o?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===a&&e.stop()},{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(s,"change:range",(e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&tm(s.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,n=this.editor.model.document.selection,i=n.getFirstPosition();return!this._isGravityOverridden&&(!i.isAtStart||!Jh(n,t))&&(tm(i,t)?(em(e),this._overrideGravity(),!0):void 0)}_handleBackwardMovement(e){const t=this.attributes,n=this.editor.model,i=n.document.selection,s=i.getFirstPosition();return this._isGravityOverridden?(em(e),this._restoreGravity(),Qh(n,t,s),!0):s.isAtStart?!!Jh(i,t)&&(em(e),Qh(n,t,s),!0):function(e,t){return tm(e.getShiftedBy(-1),t)}(s,t)?s.isAtEnd&&!Jh(i,t)&&tm(s,t)?(em(e),Qh(n,t,s),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Jh(e,t){for(const n of t)if(e.hasAttribute(n))return!0;return!1}function Qh(e,t,n){const i=n.nodeBefore;e.change(e=>{i?e.setSelectionAttribute(i.getAttributes()):e.removeSelectionAttribute(t)})}function em(e){e.preventDefault()}function tm(e,t){const{nodeBefore:n,nodeAfter:i}=e;for(const e of t){const t=n?n.getAttribute(e):void 0;if((i?i.getAttribute(e):void 0)!==t)return!0}return!1}function nm(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function im(e,t,n,i){return i.createRange(sm(e,t,n,!0,i),sm(e,t,n,!1,i))}function sm(e,t,n,i,s){let o=e.textNode||(i?e.nodeBefore:e.nodeAfter),r=null;for(;o&&o.getAttribute(t)==n;)r=o,o=i?o.previousSibling:o.nextSibling;return r?s.createPositionAt(r,i?"before":"after"):e}nm('"'),nm("'"),nm("'"),nm('"'),nm('"'),nm("'");class om extends lt{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.schema,i=t.document.selection,s=Array.from(i.getSelectedBlocks()),o=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{if(o){const t=s.filter(e=>rm(e)||lm(n,e));this._applyQuote(e,t)}else this._removeQuote(e,s.filter(rm))})}_getValue(){const e=$r(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!rm(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,n=$r(e.getSelectedBlocks());return!!n&&lm(t,n)}_removeQuote(e,t){am(e,t).reverse().forEach(t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const n=e.createPositionBefore(t.start.parent);return void e.move(t,n)}t.end.isAtEnd||e.split(t.end);const n=e.createPositionAfter(t.end.parent);e.move(t,n)})}_applyQuote(e,t){const n=[];am(e,t).reverse().forEach(t=>{let i=rm(t.start);i||(i=e.createElement("blockQuote"),e.wrap(t,i)),n.push(i)}),n.reverse().reduce((t,n)=>t.nextSibling==n?(e.merge(e.createPositionAfter(t)),t):n)}}function rm(e){return"blockQuote"==e.parent.name?e.parent:null}function am(e,t){let n,i=0;const s=[];for(;i{const i=e.model.document.differ.getChanges();for(const e of i)if("insert"==e.type){const i=e.position.nodeAfter;if(!i)continue;if(i.is("element","blockQuote")&&i.isEmpty)return n.remove(i),!0;if(i.is("element","blockQuote")&&!t.checkChild(e.position,i))return n.unwrap(i),!0;if(i.is("element")){const e=n.createRangeIn(i);for(const i of e.getItems())if(i.is("element","blockQuote")&&!t.checkChild(n.createPositionBefore(i),i))return n.unwrap(i),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty)return n.remove(t),!0}return!1});const n=this.editor.editing.view.document,i=e.model.document.selection,s=e.commands.get("blockQuote");this.listenTo(n,"enter",(t,n)=>{i.isCollapsed&&s.value&&i.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),n.preventDefault(),t.stop())},{context:"blockquote"}),this.listenTo(n,"delete",(t,n)=>{if("backward"!=n.direction||!i.isCollapsed||!s.value)return;const o=i.getLastPosition().parent;o.isEmpty&&!o.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),n.preventDefault(),t.stop())},{context:"blockquote"})}}var cm=o(636);oo()(cm.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),cm.Z.locals;class um extends rt{static get pluginName(){return"BlockQuoteUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("blockQuote",n=>{const i=e.commands.get("blockQuote"),s=new fc(n);return s.set({label:t("Block quote"),icon:'',tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>{e.execute("blockQuote"),e.editing.view.focus()}),s})}}class hm extends lt{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=void 0===e.forceValue?!this.value:e.forceValue;t.change(e=>{if(n.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const s=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of s)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,n=e.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);for(const e of n.getRanges())for(const n of e.getItems())if(t.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}}const mm="bold";class gm extends rt{static get pluginName(){return"BoldEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:mm}),e.model.schema.setAttributeProperties(mm,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:mm,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t?"bold"==t||Number(t)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),e.commands.add(mm,new hm(e,mm)),e.keystrokes.set("CTRL+B",mm)}}const pm="bold";class fm extends rt{static get pluginName(){return"BoldUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(pm,n=>{const i=e.commands.get(pm),s=new fc(n);return s.set({label:t("Bold"),icon:'',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>{e.execute(pm),e.editing.view.focus()}),s})}}class xm{constructor(e){this.files=function(e){const t=Array.from(e.files||[]),n=Array.from(e.items||[]);return t.length?t:n.filter(e=>"file"===e.kind).map(e=>e.getAsFile())}(e),this._native=e}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}class _m extends Zo{constructor(e){super(e);const t=this.document;function n(e){return(n,s)=>{s.preventDefault();const o=s.dropRange?[s.dropRange]:null,r=new i(t,e);t.fire(r,{dataTransfer:s.dataTransfer,method:n.name,targetRanges:o,target:s.target}),r.stop.called&&s.stopPropagation()}}this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(t,"paste",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",n("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",n("dragging"),{priority:"low"})}onDomEvent(e){const t={dataTransfer:new xm(e.clipboardData?e.clipboardData:e.dataTransfer)};"drop"!=e.type&&"dragover"!=e.type||(t.dropRange=function(e,t){const n=t.target.ownerDocument,i=t.clientX,s=t.clientY;let o;return n.caretRangeFromPoint&&n.caretRangeFromPoint(i,s)?o=n.caretRangeFromPoint(i,s):t.rangeParent&&(o=n.createRange(),o.setStart(t.rangeParent,t.rangeOffset),o.collapse(!0)),o?e.domConverter.domRangeToView(o):null}(this.view,e)),this.fire(e.type,e,t)}}const Im=["figcaption","li"];function vm(e){let t="";if(e.is("$text")||e.is("$textProxy"))t=e.data;else if(e.is("element","img")&&e.hasAttribute("alt"))t=e.getAttribute("alt");else if(e.is("element","br"))t="\n";else{let n=null;for(const i of e.getChildren()){const e=vm(i);n&&(n.is("containerElement")||i.is("containerElement"))&&(Im.includes(n.name)||Im.includes(i.name)?t+="\n":t+="\n\n"),t+=e,n=i}}return t}class bm extends rt{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(_m),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const e=this.editor,t=e.model,n=e.editing.view,s=n.document;this.listenTo(s,"clipboardInput",t=>{e.isReadOnly&&t.stop()},{priority:"highest"}),this.listenTo(s,"clipboardInput",(e,t)=>{const s=t.dataTransfer;let o=t.content||"";o||(s.getData("text/html")?o=function(e){return e.replace(/(\s+)<\/span>/g,(e,t)=>1==t.length?" ":t).replace(//g,"")}(s.getData("text/html")):s.getData("text/plain")&&(o=function(e){return((e=e.replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||e.includes("
"))&&(e=`

${e}

`),e}(s.getData("text/plain"))),o=this.editor.data.htmlProcessor.toView(o));const r=new i(this,"inputTransformation");this.fire(r,{content:o,dataTransfer:s,targetRanges:t.targetRanges,method:t.method}),r.stop.called&&e.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(e,n)=>{if(n.content.isEmpty)return;const i=this.editor.data.toModel(n.content,"$clipboardHolder");0!=i.childCount&&(e.stop(),t.change(()=>{this.fire("contentInsertion",{content:i,method:n.method,dataTransfer:n.dataTransfer,targetRanges:n.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(e,n)=>{n.resultRange=t.insertContent(n.content)},{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,n=e.editing.view.document;function i(i,s){const o=s.dataTransfer;s.preventDefault();const r=e.data.toView(e.model.getSelectedContent(t.selection));n.fire("clipboardOutput",{dataTransfer:o,content:r,method:i.name})}this.listenTo(n,"copy",i,{priority:"low"}),this.listenTo(n,"cut",(t,n)=>{e.isReadOnly?n.preventDefault():i(t,n)},{priority:"low"}),this.listenTo(n,"clipboardOutput",(n,i)=>{i.content.isEmpty||(i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content)),i.dataTransfer.setData("text/plain",vm(i.content))),"cut"==i.method&&e.model.deleteContent(t.selection)},{priority:"low"})}}class jm{constructor(){this._stack=[]}add(e,t){const n=this._stack,i=n[0];this._insertDescriptor(e);const s=n[0];i===s||Cm(i,s)||this.fire("change:top",{oldDescriptor:i,newDescriptor:s,writer:t})}remove(e,t){const n=this._stack,i=n[0];this._removeDescriptor(e);const s=n[0];i===s||Cm(i,s)||this.fire("change:top",{oldDescriptor:i,newDescriptor:s,writer:t})}_insertDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e.id);if(Cm(e,t[n]))return;n>-1&&t.splice(n,1);let i=0;for(;t[i]&&ym(t[i],e);)i++;t.splice(i,0,e)}_removeDescriptor(e){const t=this._stack,n=t.findIndex(t=>t.id===e);n>-1&&t.splice(n,1)}}function Cm(e,t){return e&&t&&e.priority==t.priority&&km(e.classes)==km(t.classes)}function ym(e,t){return e.priority>t.priority||!(e.prioritykm(t.classes)}function km(e){return Array.isArray(e)?e.sort().join(","):e}ot(jm,_);const Am="ck-widget_selected";function wm(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function Sm(e,t,n={}){if(!e.is("containerElement"))throw new u("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass("ck-widget",e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=Om,n.label&&function(e,t,n){n.setCustomProperty("widgetLabel",t,e)}(e,n.label,t),n.hasSelectionHandle&&function(e,t){const n=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(e){const t=this.toDomElement(e),n=new hc;return n.set("content",''),n.render(),t.appendChild(n.element),t});t.insert(t.createPositionAt(e,0),n),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),function(e,t,n=Em,i=Tm){const s=new jm;s.on("change:top",(t,s)=>{s.oldDescriptor&&i(e,s.oldDescriptor,s.writer),s.newDescriptor&&n(e,s.newDescriptor,s.writer)}),t.setCustomProperty("addHighlight",(e,t,n)=>s.add(t,n),e),t.setCustomProperty("removeHighlight",(e,t,n)=>s.remove(t,n),e)}(e,t),e}function Em(e,t,n){if(t.classes&&n.addClass(Gn(t.classes),e),t.attributes)for(const i in t.attributes)n.setAttribute(i,t.attributes[i],e)}function Tm(e,t,n){if(t.classes&&n.removeClass(Gn(t.classes),e),t.attributes)for(const i in t.attributes)n.removeAttribute(i,e)}function zm(e){const t=e.getCustomProperty("widgetLabel");return t?"function"==typeof t?t():t:""}function Om(){return null}const Rm="widget-type-around";function $m(e,t,n){return e&&wm(e)&&!n.isInline(t)}function Dm(e){return e.getAttribute(Rm)}var Pm=o(137);oo()(Pm.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Pm.Z.locals;const Fm=["before","after"],Mm=(new DOMParser).parseFromString('',"image/svg+xml").firstChild,Nm="ck-widget__type-around_disabled";class Lm extends rt{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Eh,qh]}constructor(e){super(e),this._currentFakeCaretModelElement=null}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",(n,i,s)=>{t.change(e=>{for(const n of t.document.roots)s?e.removeClass(Nm,n):e.addClass(Nm,n)}),s||e.model.change(e=>{e.removeSelectionAttribute(Rm)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const n=this.editor,i=n.editing.view,s=n.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);n.execute("insertParagraph",{position:n.model.createPositionAt(e,t),attributes:s}),i.focus(),i.scrollToTheSelection()}_listenToIfEnabled(e,t,n,i){this.listenTo(e,t,(...e)=>{this.isEnabled&&n(...e)},i)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=Dm(e);if(!t)return!1;const n=e.getSelectedElement();return this._insertParagraph(n,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,n=e.locale.t,i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(e,n,s)=>{const o=s.mapper.toViewElement(n.item);$m(o,n.item,t)&&function(e,t,n){const i=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(e){const n=this.toDomElement(e);return function(e,t){for(const n of Fm){const i=new Vd({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${n}`],title:t[n]},children:[e.ownerDocument.importNode(Mm,!0)]});e.appendChild(i.render())}}(n,t),function(e){const t=new Vd({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(n),n});e.insert(e.createPositionAt(n,"end"),i)}(s.writer,i,o)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,n=t.document.selection,i=t.schema,s=e.editing.view;function o(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(s.document,"arrowKey",(e,t)=>{this._handleArrowKeyPress(e,t)},{context:[wm,"$text"],priority:"high"}),this._listenToIfEnabled(n,"change:range",(t,n)=>{n.directChange&&e.model.change(e=>{e.removeSelectionAttribute(Rm)})}),this._listenToIfEnabled(t.document,"change:data",()=>{const t=n.getSelectedElement();t&&$m(e.editing.mapper.toViewElement(t),t,i)||e.model.change(e=>{e.removeSelectionAttribute(Rm)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(e,t,n)=>{const s=n.writer;if(this._currentFakeCaretModelElement){const e=n.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(s.removeClass(Fm.map(o),e),this._currentFakeCaretModelElement=null)}const r=t.selection.getSelectedElement();if(!r)return;const a=n.mapper.toViewElement(r);if(!$m(a,r,i))return;const l=Dm(t.selection);l&&(s.addClass(o(l),a),this._currentFakeCaretModelElement=r)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(t,n,i)=>{i||e.model.change(e=>{e.removeSelectionAttribute(Rm)})})}_handleArrowKeyPress(e,t){const n=this.editor,i=n.model,s=i.document.selection,o=i.schema,r=n.editing.view,a=function(e,t){const n=ys(e,t);return"down"===n||"right"===n}(t.keyCode,n.locale.contentLanguageDirection),l=r.document.selection.getSelectedElement();let d;$m(l,n.editing.mapper.toModelElement(l),o)?d=this._handleArrowKeyPressOnSelectedWidget(a):s.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),d&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,n=Dm(t.document.selection);return t.change(t=>n?n!==(e?"after":"before")&&(t.removeSelectionAttribute(Rm),!0):(t.setSelectionAttribute(Rm,e?"after":"before"),!0))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,n=t.model,i=n.schema,s=t.plugins.get("Widget"),o=s._getObjectElementNextToSelection(e);return!!$m(t.editing.mapper.toViewElement(o),o,i)&&(n.change(t=>{s._setSelectionOverElement(o),t.setSelectionAttribute(Rm,e?"before":"after")}),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,n=t.model,i=n.schema,s=t.editing.mapper,o=n.document.selection,r=e?o.getLastPosition().nodeBefore:o.getFirstPosition().nodeAfter;return!!$m(s.toViewElement(r),r,i)&&(n.change(t=>{t.setSelection(r,"on"),t.setSelectionAttribute(Rm,e?"after":"before")}),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(n,i)=>{const s=function(e){return e.closest(".ck-widget__type-around__button")}(i.domTarget);if(!s)return;const o=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(s),r=function(e,t){const n=e.closest(".ck-widget");return t.mapDomToView(n)}(s,t.domConverter),a=e.editing.mapper.toModelElement(r);this._insertParagraph(a,o),i.preventDefault(),n.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,n=e.editing.view;this._listenToIfEnabled(n.document,"enter",(n,i)=>{if("atTarget"!=n.eventPhase)return;const s=t.getSelectedElement(),o=e.editing.mapper.toViewElement(s),r=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:$m(o,s,r)&&(this._insertParagraph(s,i.isSoft?"before":"after"),a=!0),a&&(i.preventDefault(),n.stop())},{context:wm})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view,t=[Is.enter,Is.delete,Is.backspace];this._listenToIfEnabled(e.document,"keydown",(e,n)=>{t.includes(n.keyCode)||Lh(n)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,n=e.model,i=n.schema;this._listenToIfEnabled(t.document,"delete",(t,s)=>{if("atTarget"!=t.eventPhase)return;const o=Dm(n.document.selection);if(!o)return;const r=s.direction,a=n.document.selection.getSelectedElement(),l="forward"==r;if("before"===o===l)e.execute("delete",{selection:n.createSelection(a,"on")});else{const t=i.getNearestSelectionRange(n.createPositionAt(a,o),r);if(t)if(t.isCollapsed){const s=n.createSelection(t.start);if(n.modifySelection(s,{direction:r}),s.focus.isEqual(t.start)){const e=function(e,t){let n=t;for(const i of t.getAncestors({parentFirst:!0})){if(i.childCount>1||e.isLimit(i))break;n=i}return n}(i,t.start.parent);n.deleteContent(n.createSelection(e,"on"),{doNotAutoparagraph:!0})}else n.change(n=>{n.setSelection(t),e.execute(l?"deleteForward":"delete")})}else n.change(n=>{n.setSelection(t),e.execute(l?"deleteForward":"delete")})}s.preventDefault(),t.stop()},{context:wm})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,n=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(e,[i,s])=>{if(s&&!s.is("documentSelection"))return;const o=Dm(n);return o?(e.stop(),t.change(e=>{const s=n.getSelectedElement(),r=t.createPositionAt(s,o),a=e.createSelection(r),l=t.insertContent(i,a);return e.setSelection(a),l})):void 0},{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(e,n)=>{const[,i,,s={}]=n;if(i&&!i.is("documentSelection"))return;const o=Dm(t);o&&(s.findOptimalPosition=o,n[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(e,[n])=>{n&&!n.is("documentSelection")||Dm(t)&&e.stop()},{priority:"high"})}}function Bm(e,t,n){const i=e.schema,s=e.createRangeIn(t.root),o="forward"==n?"elementStart":"elementEnd";for(const{previousPosition:e,item:r,type:a}of s.getWalker({startPosition:t,direction:n})){if(i.isLimit(r)&&!i.isInline(r))return e;if(a==o&&i.isBlock(r))return null}return null}function Vm(e,t,n){const i="backward"==n?t.end:t.start;if(e.checkChild(i,"$text"))return i;for(const{nextPosition:i}of t.getWalker({direction:n}))if(e.checkChild(i,"$text"))return i;return null}var Um=o(507);oo()(Um.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Um.Z.locals;class Wm extends rt{static get pluginName(){return"Widget"}static get requires(){return[Lm,qh]}init(){const e=this.editor,t=e.editing.view,n=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,n,i)=>{const s=i.writer,o=n.selection;if(o.isCollapsed)return;const r=o.getSelectedElement();if(!r)return;const a=e.editing.mapper.toViewElement(r);wm(a)&&i.consumable.consume(o,"selection")&&s.setSelection(s.createRangeOn(a),{fake:!0,label:zm(a)})}),this.editor.editing.downcastDispatcher.on("selection",(e,t,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer,s=i.document.selection;let o=null;for(const e of s.getRanges())for(const t of e){const e=t.item;wm(e)&&!Gm(e,o)&&(i.addClass(Am,e),this._previouslySelected.add(e),o=e)}},{priority:"low"}),t.addObserver(qu),this.listenTo(n,"mousedown",(...e)=>this._onMousedown(...e)),this.listenTo(n,"arrowKey",(...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)},{context:[wm,"$text"]}),this.listenTo(n,"arrowKey",(...e)=>{this._preventDefaultOnArrowKeyPress(...e)},{context:"$root"}),this.listenTo(n,"arrowKey",function(e){const t=e.model;return(n,i)=>{const s=i.keyCode==Is.arrowup,o=i.keyCode==Is.arrowdown,r=i.shiftKey,a=t.document.selection;if(!s&&!o)return;const l=o;if(r&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(a,l))return;const d=function(e,t,n){const i=e.model;if(n){const e=t.isCollapsed?t.focus:t.getLastPosition(),n=Bm(i,e,"forward");if(!n)return null;const s=i.createRange(e,n),o=Vm(i.schema,s,"backward");return o?i.createRange(e,o):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),n=Bm(i,e,"backward");if(!n)return null;const s=i.createRange(n,e),o=Vm(i.schema,s,"forward");return o?i.createRange(o,e):null}}(e,a,l);if(d){if(d.isCollapsed){if(a.isCollapsed)return;if(r)return}(d.isCollapsed||function(e,t,n){const i=e.model,s=e.view.domConverter;if(n){const e=i.createSelection(t.start);i.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=i.createRange(e.focus,t.end))}const o=e.mapper.toViewRange(t),r=s.viewRangeToDom(o),a=Ir.getDomRangeRects(r);let l;for(const e of a)if(void 0!==l){if(Math.round(e.top)>=l)return!1;l=Math.max(l,Math.round(e.bottom))}else l=Math.round(e.bottom);return!0}(e,d,l))&&(t.change(e=>{const n=l?d.end:d.start;if(r){const i=t.createSelection(a.anchor);i.setFocus(n),e.setSelection(i)}else e.setSelection(n)}),n.stop(),i.preventDefault(),i.stopPropagation())}}}(this.editor.editing),{context:"$text"}),this.listenTo(n,"delete",(e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())},{context:"$root"})}_onMousedown(e,t){const n=this.editor,i=n.editing.view,s=i.document;let o=t.target;if(function(e){for(;e;){if(e.is("editableElement")&&!e.is("rootElement"))return!0;if(wm(e))return!1;e=e.parent}return!1}(o)){if((ps.isSafari||ps.isGecko)&&t.domEvent.detail>=3){const e=n.editing.mapper,i=o.is("attributeElement")?o.findAncestor(e=>!e.is("attributeElement")):o,s=e.toModelElement(i);t.preventDefault(),this.editor.model.change(e=>{e.setSelection(s,"in")})}return}if(!wm(o)&&(o=o.findAncestor(wm),!o))return;ps.isAndroid&&t.preventDefault(),s.isFocused||i.focus();const r=n.editing.mapper.toModelElement(o);this._setSelectionOverElement(r)}_handleSelectionChangeOnArrowKeyPress(e,t){const n=t.keyCode,i=this.editor.model,s=i.schema,o=i.document.selection,r=o.getSelectedElement(),a=ys(n,this.editor.locale.contentLanguageDirection),l="down"==a||"right"==a,d="up"==a||"down"==a;if(r&&s.isObject(r)){const n=l?o.getLastPosition():o.getFirstPosition(),r=s.getNearestSelectionRange(n,l?"forward":"backward");return void(r&&(i.change(e=>{e.setSelection(r)}),t.preventDefault(),e.stop()))}if(!o.isCollapsed&&!t.shiftKey){const n=o.getFirstPosition(),r=o.getLastPosition(),a=n.nodeAfter,d=r.nodeBefore;return void((a&&s.isObject(a)||d&&s.isObject(d))&&(i.change(e=>{e.setSelection(l?r:n)}),t.preventDefault(),e.stop()))}if(!o.isCollapsed)return;const c=this._getObjectElementNextToSelection(l);if(c&&s.isObject(c)){if(s.isInline(c)&&d)return;this._setSelectionOverElement(c),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const n=this.editor.model,i=n.schema,s=n.document.selection.getSelectedElement();s&&i.isObject(s)&&(t.preventDefault(),e.stop())}_handleDelete(e){if(this.editor.isReadOnly)return;const t=this.editor.model.document.selection;if(!t.isCollapsed)return;const n=this._getObjectElementNextToSelection(e);return n?(this.editor.model.change(e=>{let i=t.anchor.parent;for(;i.isEmpty;){const t=i;i=t.parent,e.remove(t)}this._setSelectionOverElement(n)}),!0):void 0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){const t=this.editor.model,n=t.schema,i=t.document.selection,s=t.createSelection(i);if(t.modifySelection(s,{direction:e?"forward":"backward"}),s.isEqual(i))return null;const o=e?s.focus.nodeBefore:s.focus.nodeAfter;return o&&n.isObject(o)?o:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass(Am,t);this._previouslySelected.clear()}}function Gm(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}const Hm=function(e,t,n){var i=!0,s=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return w(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),dr(e,t,{leading:i,maxWait:t,trailing:s})};var qm=o(390);oo()(qm.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qm.Z.locals;class Ym extends rt{static get pluginName(){return"DragDrop"}static get requires(){return[bm,Wm]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=Hm(e=>this._updateDropMarker(e),40),this._removeDropMarkerDelayed=Xm(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=Xm(()=>this._clearDraggableAttributes(),40),t.addObserver(_m),t.addObserver(qu),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(e,t,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(e,t,n)=>{n||this._finalizeDragging(!1)}),ps.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,n=t.document,i=e.editing.view,s=i.document;this.listenTo(s,"dragstart",(i,o)=>{const r=n.selection;if(o.target&&o.target.is("editableElement"))return void o.preventDefault();const l=o.target?Jm(o.target):null;if(l){const n=e.editing.mapper.toModelElement(l);this._draggedRange=da.fromRange(t.createRangeOn(n)),e.plugins.has("WidgetToolbarRepository")&&e.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}else if(!s.selection.isCollapsed){const e=s.selection.getSelectedElement();e&&wm(e)||(this._draggedRange=da.fromRange(r.getFirstRange()))}if(!this._draggedRange)return void o.preventDefault();this._draggingUid=a(),o.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",o.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const d=t.createSelection(this._draggedRange.toRange()),c=e.data.toView(t.getSelectedContent(d));s.fire("clipboardOutput",{dataTransfer:o.dataTransfer,content:c,method:i.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(s,"dragend",(e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)},{priority:"low"}),this.listenTo(s,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(s,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(s,"dragging",(t,n)=>{if(!this.isEnabled)return void(n.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const i=Km(e,n.targetRanges,n.target);this._draggedRange||(n.dataTransfer.dropEffect="copy"),ps.isGecko||("copy"==n.dataTransfer.effectAllowed?n.dataTransfer.dropEffect="copy":["all","copyMove"].includes(n.dataTransfer.effectAllowed)&&(n.dataTransfer.dropEffect="move")),i&&this._updateDropMarkerThrottled(i)},{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"clipboardInput",(t,n)=>{if("drop"!=n.method)return;const i=Km(e,n.targetRanges,n.target);return this._removeDropMarker(),i?(this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),"move"==Zm(n.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(i,!0)?(this._finalizeDragging(!1),void t.stop()):void(n.targetRanges=[e.editing.mapper.toViewRange(i)])):(this._finalizeDragging(!1),void t.stop())},{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(bm);e.on("contentInsertion",(e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const n=t.targetRanges.map(e=>this.editor.editing.mapper.toModelRange(e));this.editor.model.change(e=>e.setSelection(n))},{priority:"high"}),e.on("contentInsertion",(e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const n="move"==Zm(t.dataTransfer),i=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(i&&n)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,n=t.document;this.listenTo(n,"mousedown",(i,s)=>{if(ps.isAndroid||!s)return;this._clearDraggableAttributesDelayed.cancel();let o=Jm(s.target);if(ps.isBlink&&!e.isReadOnly&&!o&&!n.selection.isCollapsed){const e=n.selection.getSelectedElement();e&&wm(e)||(o=n.selection.editableElement)}o&&(t.change(e=>{e.setAttribute("draggable","true",o)}),this._draggableElement=e.editing.mapper.toModelElement(o))}),this.listenTo(n,"mouseup",()=>{ps.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change(t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const e=this.editor;e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:n})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return n.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(e){const t=this.toDomElement(e);return t.innerHTML="⁠⁠",t})}})}_updateDropMarker(e){const t=this.editor,n=t.model.markers;t.model.change(t=>{n.has("drop-target")?n.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const e=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),e.markers.has("drop-target")&&e.change(e=>{e.removeMarker("drop-target")})}_finalizeDragging(e){const t=this.editor,n=t.model;this._removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._draggedRange&&(e&&this.isEnabled&&n.deleteContent(n.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function Km(e,t,n){const i=e.model,s=e.editing.mapper;let o=null;const r=t?t[0].start:null;if(n.is("uiElement")&&(n=n.parent),o=function(e,t){const n=e.model,i=e.editing.mapper;if(wm(t))return n.createRangeOn(i.toModelElement(t));if(!t.is("editableElement")){const e=t.findAncestor(e=>wm(e)||e.is("editableElement"));if(wm(e))return n.createRangeOn(i.toModelElement(e))}return null}(e,n),o)return o;const a=function(e,t){const n=e.editing.mapper,i=e.editing.view,s=n.toModelElement(t);if(s)return s;const o=i.createPositionBefore(t),r=n.findMappedViewAncestor(o);return n.toModelElement(r)}(e,n),l=r?s.toModelPosition(r):null;return l?(o=function(e,t,n){const i=e.model;if(!i.schema.checkChild(n,"$block"))return null;const s=i.createPositionAt(n,0),o=t.path.slice(0,s.path.length),r=i.createPositionFromPath(t.root,o).nodeAfter;return r&&i.schema.isObject(r)?i.createRangeOn(r):null}(e,l,a),o||(o=i.schema.getNearestSelectionRange(l,ps.isGecko?"forward":"backward"),o||function(e,t){const n=e.model;for(;t;){if(n.schema.isObject(t))return n.createRangeOn(t);t=t.parent}}(e,l.parent))):function(e,t){const n=e.model,i=n.schema,s=n.createPositionAt(t,0);return i.getNearestSelectionRange(s,"forward")}(e,a)}function Zm(e){return ps.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Xm(e,t){let n;function i(...s){i.cancel(),n=setTimeout(()=>e(...s),t)}return i.cancel=()=>{clearTimeout(n)},i}function Jm(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(wm);if(wm(e))return e;const t=e.findAncestor(e=>wm(e)||e.is("editableElement"));return wm(t)?t:null}class Qm extends rt{static get pluginName(){return"PastePlainText"}static get requires(){return[bm]}init(){const e=this.editor,t=e.model,n=e.editing.view,i=n.document,s=t.document.selection;let o=!1;n.addObserver(_m),this.listenTo(i,"keydown",(e,t)=>{o=t.shiftKey}),e.plugins.get(bm).on("contentInsertion",(e,n)=>{(o||function(e,t){if(e.childCount>1)return!1;const n=e.getChild(0);return!t.isObject(n)&&0==[...n.getAttributeKeys()].length}(n.content,t.schema))&&t.change(e=>{const i=Array.from(s.getAttributes()).filter(([e])=>t.schema.getAttributeProperties(e).isFormatting);s.isCollapsed||t.deleteContent(s,{doNotAutoparagraph:!0}),i.push(...s.getAttributes());const o=e.createRangeIn(n.content);for(const t of o.getItems())t.is("$textProxy")&&e.setAttributes(i,t)})})}}class eg extends rt{static get pluginName(){return"Clipboard"}static get requires(){return[bm,Ym,Qm]}}class tg extends lt{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let n=e.schema.getLimitElement(t);if(t.containsEntireContent(n)||!ng(e.schema,n))do{if(n=n.parent,!n)return}while(!ng(e.schema,n));e.change(e=>{e.setSelection(n,"in")})}}function ng(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const ig=js("Ctrl+A");class sg extends rt{static get pluginName(){return"SelectAllEditing"}init(){const e=this.editor,t=e.editing.view.document;e.commands.add("selectAll",new tg(e)),this.listenTo(t,"keydown",(t,n)=>{bs(n)===ig&&(e.execute("selectAll"),n.preventDefault())})}}class og extends rt{static get pluginName(){return"SelectAllUI"}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",t=>{const n=e.commands.get("selectAll"),i=new fc(t),s=t.t;return i.set({label:s("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),i.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(i,"execute",()=>{e.execute("selectAll"),e.editing.view.focus()}),i})}}class rg extends rt{static get requires(){return[sg,og]}static get pluginName(){return"SelectAll"}}class ag extends lt{constructor(e){super(e),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(e.data,"set",(e,t)=>{t[1]={...t[1]};const n=t[1];n.batchType||(n.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(e,t)=>{t[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}addBatch(e){const t=this.editor.model.document.selection,n={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:n}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,n){const i=this.editor.model,s=i.document,o=[],r=e.map(e=>e.getTransformedByOperations(n)),a=r.flat();for(const e of r){const t=e.filter(e=>e.root!=s.graveyard).filter(e=>!dg(e,a));t.length&&(lg(t),o.push(t[0]))}o.length&&i.change(e=>{e.setSelection(o,{backward:t})})}_undo(e,t){const n=this.editor.model,i=n.document;this._createdBatches.add(t);const s=e.operations.slice().filter(e=>e.isDocumentOperation);s.reverse();for(const e of s){const s=e.baseVersion+1,o=Array.from(i.history.getOperations(s)),r=Nu([e.getReversed()],o,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const s of r)t.addOperation(s),n.applyOperation(s),i.history.setOperationAsUndone(e,s)}}}function lg(e){e.sort((e,t)=>e.start.isBefore(t.start)?-1:1);for(let t=1;tt!==e&&t.containsRange(e,!0))}class cg extends ag{execute(e=null){const t=e?this._stack.findIndex(t=>t.batch==e):this._stack.length-1,n=this._stack.splice(t,1)[0],i=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(i,()=>{this._undo(n.batch,i);const e=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,e),this.fire("revert",n.batch,i)}),this.refresh()}}class ug extends ag{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{const n=e.batch.operations[e.batch.operations.length-1].baseVersion+1,i=this.editor.model.document.history.getOperations(n);this._restoreSelection(e.selection.ranges,e.selection.isBackward,i),this._undo(e.batch,t)}),this.refresh()}}class hg extends rt{static get pluginName(){return"UndoEditing"}constructor(e){super(e),this._batchRegistry=new WeakSet}init(){const e=this.editor;this._undoCommand=new cg(e),this._redoCommand=new ug(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(e,t)=>{const n=t[0];if(!n.isDocumentOperation)return;const i=n.batch,s=this._redoCommand._createdBatches.has(i),o=this._undoCommand._createdBatches.has(i);this._batchRegistry.has(i)||(this._batchRegistry.add(i),i.isUndoable&&(s?this._undoCommand.addBatch(i):o||(this._undoCommand.addBatch(i),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(e,t,n)=>{this._redoCommand.addBatch(n)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo")}}const mg='',gg='';class pg extends rt{static get pluginName(){return"UndoUI"}init(){const e=this.editor,t=e.locale,n=e.t,i="ltr"==t.uiLanguageDirection?mg:gg,s="ltr"==t.uiLanguageDirection?gg:mg;this._addButton("undo",n("Undo"),"CTRL+Z",i),this._addButton("redo",n("Redo"),"CTRL+Y",s)}_addButton(e,t,n,i){const s=this.editor;s.ui.componentFactory.add(e,o=>{const r=s.commands.get(e),a=new fc(o);return a.set({label:t,icon:i,keystroke:n,tooltip:!0}),a.bind("isEnabled").to(r,"isEnabled"),this.listenTo(a,"execute",()=>{s.execute(e),s.editing.view.focus()}),a})}}class fg extends rt{static get requires(){return[hg,pg]}static get pluginName(){return"Undo"}}class xg extends lt{constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,n=t.document.selection,i=e.value;t.change(e=>{if(n.isCollapsed)i?e.setSelectionAttribute(this.attributeKey,i):e.removeSelectionAttribute(this.attributeKey);else{const s=t.schema.getValidRanges(n.getRanges(),this.attributeKey);for(const t of s)i?e.setAttribute(this.attributeKey,i,t):e.removeAttribute(this.attributeKey,t)}})}}class _g extends Un{constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(e,t){this.find(t=>t.color===e.color)||super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}ot(_g,Qe);var Ig=o(585);oo()(Ig.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Ig.Z.locals;class vg extends Bd{constructor(e,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:s,documentColorsCount:o}){super(e),this.items=this.createCollection(),this.colorDefinitions=t,this.focusTracker=new Dr,this.keystrokes=new Pr,this.set("selectedColor"),this.removeButtonLabel=i,this.columns=n,this.documentColors=new _g,this.documentColorsCount=o,this._focusCycler=new jc({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=s,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._removeColorButton())}updateDocumentColors(e,t){const n=e.document,i=this.documentColorsCount;this.documentColors.clear();for(const s of n.getRootNames()){const o=n.getRoot(s),r=e.createRangeIn(o);for(const e of r.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=i))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,n=this.selectedColor;t.selectedColor=n,e&&(e.selectedColor=n)}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const e=Vd.bind(this.documentColors,this.documentColors),t=new tu(this.locale);t.text=this._documentColorsLabel,t.extendTemplate({attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]}}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const e=new fc;return e.set({withText:!0,icon:'',tooltip:!0,label:this.removeButtonLabel}),e.class="ck-color-table__remove-color",e.on("execute",()=>{this.fire("execute",{value:null})}),e}_createStaticColorsGrid(){const e=new kc(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.delegate("execute").to(this),e}_createDocumentColorsGrid(){const e=Vd.bind(this.documentColors,this.documentColors),t=new kc(this.locale,{columns:this.columns});return t.delegate("execute").to(this),t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(e=>{const t=new vc;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",()=>{this.fire("execute",{value:e.color})}),t}),this.documentColors.on("change:isEmpty",(e,n,i)=>{i&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(t=>t.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}const bg="fontColor",jg="fontBackgroundColor";function Cg(e){return t=>function(e){return e.replace(/\s/g,"")}(t.getStyle(e))}function yg(e){return(t,{writer:n})=>n.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class kg extends xg{constructor(e){super(e,jg)}}class Ag extends rt{static get pluginName(){return"FontBackgroundColorEditing"}constructor(e){super(e),e.config.define(jg,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(ch),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:jg,value:Cg("background-color")}}),e.conversion.for("downcast").attributeToElement({model:jg,view:yg("background-color")}),e.commands.add(jg,new kg(e)),e.model.schema.extend("$text",{allowAttributes:jg}),e.model.schema.setAttributeProperties(jg,{isFormatting:!0,copyOnEnter:!0})}}class wg extends rt{constructor(e,{commandName:t,icon:n,componentName:i,dropdownLabel:s}){super(e),this.commandName=t,this.componentName=i,this.icon=n,this.dropdownLabel=s,this.columns=e.config.get(`${this.componentName}.columns`),this.colorTableView=void 0}init(){const e=this.editor,t=e.locale,n=t.t,i=e.commands.get(this.commandName),s=function(e,t){const n=e.t,i={Black:n("Black"),"Dim grey":n("Dim grey"),Grey:n("Grey"),"Light grey":n("Light grey"),White:n("White"),Red:n("Red"),Orange:n("Orange"),Yellow:n("Yellow"),"Light green":n("Light green"),Green:n("Green"),Aquamarine:n("Aquamarine"),Turquoise:n("Turquoise"),"Light blue":n("Light blue"),Blue:n("Blue"),Purple:n("Purple")};return t.map(e=>{const t=i[e.label];return t&&t!=e.label&&(e.label=t),e})}(t,function(e){return e.map(Ic).filter(e=>!!e)}(e.config.get(this.componentName).colors)),o=e.config.get(`${this.componentName}.documentColors`);e.ui.componentFactory.add(this.componentName,t=>{const r=Kc(t);return this.colorTableView=function({dropdownView:e,colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:s,documentColorsCount:o}){const r=e.locale,a=new vg(r,{colors:t,columns:n,removeButtonLabel:i,documentColorsLabel:s,documentColorsCount:o});return e.colorTableView=a,e.panelView.children.add(a),a.delegate("execute").to(e,"execute"),a}({dropdownView:r,colors:s.map(e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}})),columns:this.columns,removeButtonLabel:n("Remove color"),documentColorsLabel:0!==o?n("Document colors"):void 0,documentColorsCount:void 0===o?this.columns:o}),this.colorTableView.bind("selectedColor").to(i,"value"),r.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),r.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),r.bind("isEnabled").to(i),r.on("execute",(t,n)=>{e.execute(this.commandName,n),e.editing.view.focus()}),r.on("change:isOpen",(t,n,i)=>{r.colorTableView.appendGrids(),i&&(0!==o&&this.colorTableView.updateDocumentColors(e.model,this.componentName),this.colorTableView.updateSelectedColors())}),r})}}class Sg extends wg{constructor(e){const t=e.locale.t;super(e,{commandName:jg,componentName:jg,icon:'',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Eg extends xg{constructor(e){super(e,bg)}}class Tg extends rt{static get pluginName(){return"FontColorEditing"}constructor(e){super(e),e.config.define(bg,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:bg,value:Cg("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:bg,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:bg,view:yg("color")}),e.commands.add(bg,new Eg(e)),e.model.schema.extend("$text",{allowAttributes:bg}),e.model.schema.setAttributeProperties(bg,{isFormatting:!0,copyOnEnter:!0})}}class zg extends wg{constructor(e){const t=e.locale.t;super(e,{commandName:bg,componentName:bg,icon:'',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class Og extends lt{refresh(){const e=this.editor.model,t=$r(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Rg(t,e.schema)}execute(e={}){const t=this.editor.model,n=t.document;t.change(i=>{const s=(e.selection||n.selection).getSelectedBlocks();for(const e of s)!e.is("element","paragraph")&&Rg(e,t.schema)&&i.rename(e,"paragraph")})}}function Rg(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class $g extends lt{execute(e){const t=this.editor.model,n=e.attributes;let i=e.position;t.change(e=>{const s=e.createElement("paragraph");if(n&&t.schema.setAllowedAttributes(s,n,e),!t.schema.checkChild(i.parent,s)){const n=t.schema.findAllowedParent(i,s);if(!n)return;i=e.split(i,n).position}t.insertContent(s,i),e.setSelection(s,"in")})}}class Dg extends rt{static get pluginName(){return"Paragraph"}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Og(e)),e.commands.add("insertParagraph",new $g(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>Dg.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}Dg.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Pg extends lt{constructor(e,t){super(e),this.modelElements=t}refresh(){const e=$r(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Fg(e,t,this.editor.model.schema))}execute(e){const t=this.editor.model,n=t.document,i=e.value;t.change(e=>{const s=Array.from(n.selection.getSelectedBlocks()).filter(e=>Fg(e,i,t.schema));for(const t of s)t.is("element",i)||e.rename(t,i)})}}function Fg(e,t,n){return n.checkChild(e.parent,t)&&!n.isObject(e)}const Mg="paragraph";class Ng extends rt{static get pluginName(){return"HeadingEditing"}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Dg]}init(){const e=this.editor,t=e.config.get("heading.options"),n=[];for(const i of t)i.model!==Mg&&(e.model.schema.register(i.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(i),n.push(i.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Pg(e,n))}afterInit(){const e=this.editor,t=e.commands.get("enter"),n=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(t,i)=>{const s=e.model.document.selection.getFirstPosition().parent,o=n.some(e=>s.is("element",e.model));o&&!s.is("element",Mg)&&0===s.childCount&&i.writer.rename(s,Mg)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:d.get("low")+1})}}var Lg=o(230);oo()(Lg.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Lg.Z.locals;class Bg extends rt{static get pluginName(){return"HeadingUI"}init(){const e=this.editor,t=e.t,n=function(e){const t=e.t,n={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map(e=>{const t=n[e.title];return t&&t!=e.title&&(e.title=t),e})}(e),i=t("Choose heading"),s=t("Heading");e.ui.componentFactory.add("heading",t=>{const o={},r=new Un,a=e.commands.get("heading"),l=e.commands.get("paragraph"),d=[a];for(const e of n){const t={type:"button",model:new mu({label:e.title,class:e.class,withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),d.push(l)):(t.model.bind("isOn").to(a,"value",t=>t===e.model),t.model.set({commandName:"heading",commandValue:e.model})),r.add(t),o[e.model]=e.title}const c=Kc(t);return Xc(c,r),c.buttonView.set({isOn:!1,withText:!0,tooltip:s}),c.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),c.bind("isEnabled").toMany(d,"isEnabled",(...e)=>e.some(e=>e)),c.buttonView.bind("label").to(a,"value",l,"value",(e,t)=>{const n=e||t&&"paragraph";return o[n]?o[n]:i}),this.listenTo(c,"execute",t=>{e.execute(t.source.commandName,t.source.commandValue?{value:t.source.commandValue}:void 0),e.editing.view.focus()}),c})}}class Vg{constructor(e){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}begin(e,t,n){const i=new Ir(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const n of t)if(e.classList.contains(Ug(n)))return n}(e),this._referenceCoordinates=function(e,t){const n=new Ir(e),i=t.split("-"),s={x:"right"==i[1]?n.right:n.left,y:"bottom"==i[0]?n.bottom:n.top};return s.x+=e.ownerDocument.defaultView.scrollX,s.y+=e.ownerDocument.defaultView.scrollY,s}(t,function(e){const t=e.split("-"),n={top:"bottom",bottom:"top",left:"right",right:"left"};return`${n[t[0]]}-${n[t[1]]}`}(this.activeHandlePosition)),this.originalWidth=i.width,this.originalHeight=i.height,this.aspectRatio=i.width/i.height;const s=n.style.width;s&&s.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(s):this.originalWidthPercents=function(e,t){const n=e.parentElement,i=parseFloat(n.ownerDocument.defaultView.getComputedStyle(n).width);return t.width/i*100}(n,i)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function Ug(e){return`ck-widget__resizer__handle-${e}`}ot(Vg,Qe);class Wg extends Bd{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",e=>e?`ck-orientation-${e}`:"")],style:{display:e.if("_isVisible","none",e=>!e)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(e,t)=>null!==e&&null!==t),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(t,n,i)=>"px"===e.unit?`${t}×${n}`:`${i}%`),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(e,t,n)=>t<50||n<50?"above-center":e)}_dismiss(){this.unbind(),this._isVisible=!1}}class Gg{constructor(e){this._options=e,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change(n=>{const i=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(t){const n=this.toDomElement(t);return e._appendHandles(n),e._appendSizeUI(n),e.on("change:isEnabled",(e,t,i)=>{n.style.display=i?"":"none"}),n.style.display=e.isEnabled?"":"none",n});n.insert(n.createPositionAt(t,"end"),i),n.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=i})}begin(e){this.state=new Vg(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change(e=>{const n=this._options.unit||"%",i=("%"===n?t.widthPercents:t.width)+n;e.setStyle("width",i,this._options.viewElement)});const n=this._getHandleHost(),i=new Ir(n);t.handleHostWidth=Math.round(i.width),t.handleHostHeight=Math.round(i.height);const s=new Ir(n);t.width=Math.round(s.width),t.height=Math.round(s.height),this.redraw(i),this.state.update(t)}commit(){const e=this._options.unit||"%",t=("%"===e?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!function(e){return e&&e.ownerDocument&&e.ownerDocument.contains(e)}(t))return;const n=t.parentElement,i=this._getHandleHost(),s=this._viewResizerWrapper,o=[s.getStyle("width"),s.getStyle("height"),s.getStyle("left"),s.getStyle("top")];let r;if(n.isSameNode(i)){const t=e||new Ir(i);r=[t.width+"px",t.height+"px",void 0,void 0]}else r=[i.offsetWidth+"px",i.offsetHeight+"px",i.offsetLeft+"px",i.offsetTop+"px"];"same"!==Xn(o,r)&&this._options.editor.editing.view.change(e=>{e.setStyle({width:r[0],height:r[1],left:r[2],top:r[3]},s)})}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){const t=this.state,n=function(e){return{x:e.pageX,y:e.pageY}}(e),i=!this._options.isCentered||this._options.isCentered(this),s={x:t._referenceCoordinates.x-(n.x+t.originalWidth),y:n.y-t.originalHeight-t._referenceCoordinates.y};i&&t.activeHandlePosition.endsWith("-right")&&(s.x=n.x-(t._referenceCoordinates.x+t.originalWidth)),i&&(s.x*=2);const o={width:Math.abs(t.originalWidth+s.x),height:Math.abs(t.originalHeight+s.y)};o.dominant=o.width/t.aspectRatio>o.height?"width":"height",o.max=o[o.dominant];const r={width:o.width,height:o.height};return"width"==o.dominant?r.height=r.width/t.aspectRatio:r.width=r.height*t.aspectRatio,{width:Math.round(r.width),height:Math.round(r.height),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*r.width*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const n of t)e.appendChild(new Vd({tag:"div",attributes:{class:`ck-widget__resizer__handle ${Hg(n)}`}}).render())}_appendSizeUI(e){this._sizeView=new Wg,this._sizeView.render(),e.appendChild(this._sizeView.element)}}function Hg(e){return`ck-widget__resizer__handle-${e}`}ot(Gg,Qe);var qg=o(263);oo()(qg.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),qg.Z.locals;class Yg extends rt{static get pluginName(){return"WidgetResize"}init(){const e=this.editor.editing,t=ho.window.document;this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map,e.view.addObserver(qu),this._observer=Object.create(wo),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this));const n=()=>{this.visibleResizer&&this.visibleResizer.redraw()};this._redrawFocusedResizerThrottled=Hm(n,200),this.on("change:visibleResizer",n),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this.editor.model.document.on("change",()=>{for(const[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())},{priority:"lowest"}),this._observer.listenTo(ho.window,"resize",this._redrawFocusedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",()=>{const e=i.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(e)||null})}destroy(){this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(e){const t=new Gg(e),n=this.editor.plugins;if(t.attach(),n.has("WidgetToolbarRepository")){const e=n.get("WidgetToolbarRepository");t.on("begin",()=>{e.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{e.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{e.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,t);const i=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(i)==t&&(this.visibleResizer=t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const n=t.domTarget;Gg.isResizeHandle(n)&&(this._activeResizer=this._getResizerByHandle(n),this._activeResizer&&(this._activeResizer.begin(n),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}ot(Yg,Qe);class Kg extends lt{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,n=t.plugins.get("ImageUtils"),i=t.model,s=n.getClosestSelectedImageElement(i.document.selection);i.change(t=>{t.setAttribute("alt",e.newValue,s)})}}function Zg(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot()])}function Xg(e,t){const n=e.plugins.get("ImageUtils"),i=e.plugins.has("ImageInlineEditing")&&e.plugins.has("ImageBlockEditing");return e=>n.isInlineImageView(e)?i&&(e.findAncestor(n.isBlockImageView)?"imageBlock":"imageInline")!==t?null:function(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}(e):null}function Jg(e,t){const n=$r(t.getSelectedBlocks());return!n||e.isObject(n)||n.isEmpty&&"listItem"!=n.name?"imageBlock":"imageInline"}class Qg extends rt{static get pluginName(){return"ImageUtils"}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,n=null){const i=this.editor,s=i.model,o=s.document.selection;n=ep(i,t||o,n),e={...Object.fromEntries(o.getAttributes()),...e};for(const t in e)s.schema.checkAttribute(n,t)||delete e[t];return s.change(i=>{const o=i.createElement(n,e);return s.insertObject(o,t,null,{setSelection:"on",findOptimalPosition:!t&&"imageInline"!=n}),o.parent?o:null})}getClosestSelectedImageWidget(e){const t=e.getSelectedElement();if(t&&this.isImageWidget(t))return t;let n=e.getFirstPosition().parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){if("imageBlock"==ep(e,t)){const n=function(e,t){const n=function(e,t){const n=e.getSelectedElement();if(n){const i=Dm(e);if(i)return t.createRange(t.createPositionAt(n,i))}return ad(e,t)}(e,t),i=n.start.parent;return i.isEmpty&&!i.is("element","$root")?i.parent:i}(t,e.model);if(e.model.schema.checkChild(n,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every(e=>!e.is("element","imageBlock"))}(e)}toImageWidget(e,t,n){return t.setCustomProperty("image",!0,e),Sm(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${n}`:n}})}isImageWidget(e){return!!e.getCustomProperty("image")&&wm(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:n}of t.createRangeIn(e))if(this.isInlineImageView(n))return n}}function ep(e,t,n){const i=e.model.schema,s=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?n||("inline"===s?"imageInline":"block"===s?"imageBlock":t.is("selection")?Jg(i,t):i.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}class tp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new Kg(this.editor))}}var np=o(831);oo()(np.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),np.Z.locals;var ip=o(590);oo()(ip.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),ip.Z.locals;class sp extends Bd{constructor(e){super(e);const t=this.locale.t;this.focusTracker=new Dr,this.keystrokes=new Pr,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),Dd,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),$d,"ck-button-cancel","cancel"),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),Fd(this)}render(){super.render(),this.keystrokes.listenTo(this.element),Md({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,n,i){const s=new fc(this.locale);return s.set({label:e,icon:t,tooltip:!0}),s.extendTemplate({attributes:{class:n}}),i&&s.delegate("execute").to(this,i),s}_createLabeledInputView(){const e=this.locale.t,t=new cu(this.locale,uu);return t.label=e("Text alternative"),t}}function op(e){const t=e.editing.view,n=_u.defaultPositions,i=e.plugins.get("ImageUtils");return{target:t.domConverter.viewToDom(i.getClosestSelectedImageWidget(t.document.selection)),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class rp extends rt{static get requires(){return[Cu]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",n=>{const i=e.commands.get("imageTextAlternative"),s=new fc(n);return s.set({label:t("Change image text alternative"),icon:'',tooltip:!0}),s.bind("isEnabled").to(i,"isEnabled"),this.listenTo(s,"execute",()=>{this._showForm()}),s})}_createForm(){const e=this.editor,t=e.editing.view.document,n=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new sp(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(e,t)=>{this._hideForm(!0),t()}),this.listenTo(e.ui,"update",()=>{n.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const n=op(e);t.updatePosition(n)}}(e):this._hideForm(!0)}),Pd({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const e=this.editor,t=e.commands.get("imageTextAlternative"),n=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:op(e)}),n.fieldView.value=n.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class ap extends rt{static get requires(){return[tp,rp]}static get pluginName(){return"ImageTextAlternative"}}function lp(e,t){return e=>{e.on(`attribute:srcset:${t}`,n)};function n(t,n,i){if(!i.consumable.consume(n.item,t.name))return;const s=i.writer,o=i.mapper.toViewElement(n.item),r=e.findViewImgElement(o);if(null===n.attributeNewValue){const e=n.attributeOldValue;e.data&&(s.removeAttribute("srcset",r),s.removeAttribute("sizes",r),e.width&&s.removeAttribute("width",r))}else{const e=n.attributeNewValue;e.data&&(s.setAttribute("srcset",e.data,r),s.setAttribute("sizes","100vw",r),e.width&&s.setAttribute("width",e.width,r))}}}function dp(e,t,n){return e=>{e.on(`attribute:${n}:${t}`,i)};function i(t,n,i){if(!i.consumable.consume(n.item,t.name))return;const s=i.writer,o=i.mapper.toViewElement(n.item),r=e.findViewImgElement(o);s.setAttribute(n.attributeKey,n.attributeNewValue||"",r)}}class cp extends To{observe(e){this.listenTo(e,"load",(e,t)=>{const n=t.target;this.checkShouldIgnoreEventFromTarget(n)||"IMG"==n.tagName&&this._fireEvents(t)},{useCapture:!0})}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class up extends lt{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&h("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&h("image-inline-plugin-required")}refresh(){this.isEnabled=this.editor.plugins.get("ImageUtils").isImageAllowed()}execute(e){const t=Gn(e.source),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),s=Object.fromEntries(n.getAttributes());t.forEach((e,t)=>{const o=n.getSelectedElement();if("string"==typeof e&&(e={src:e}),t&&o&&i.isImage(o)){const t=this.editor.model.createPositionAfter(o);i.insertImage({...e,...s},t)}else i.insertImage({...e,...s})})}}class hp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageEditing"}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(cp),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:e=>{const t={data:e.getAttribute("srcset")};return e.hasAttribute("width")&&(t.width=e.getAttribute("width")),t}}});const n=new up(e);e.commands.add("insertImage",n),e.commands.add("imageInsert",n)}}class mp extends lt{constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(){const e=this.editor,t=this.editor.model,n=e.plugins.get("ImageUtils"),i=n.getClosestSelectedImageElement(t.document.selection),s=Object.fromEntries(i.getAttributes());return s.src||s.uploadId?t.change(e=>{const o=Array.from(t.markers).filter(e=>e.getRange().containsItem(i)),r=n.insertImage(s,t.createSelection(i,"on"),this._modelElementName);if(!r)return null;const a=e.createRangeOn(r);for(const t of o){const n=t.getRange(),i="$graveyard"!=n.root.rootName?n.getJoined(a,!0):a;e.updateMarker(t,{range:i})}return{oldElement:i,newElement:r}}):null}}class gp extends rt{static get requires(){return[hp,Qg,bm]}static get pluginName(){return"ImageBlockEditing"}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new mp(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>Zg(t)}),n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:n})=>i.toImageWidget(Zg(n),n,t("image widget"))}),n.for("downcast").add(dp(i,"imageBlock","src")).add(dp(i,"imageBlock","alt")).add(lp(i,"imageBlock")),n.for("upcast").elementToElement({view:Xg(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)}).add(function(e){return e=>{e.on("element:figure",t)};function t(t,n,i){if(!i.consumable.test(n.viewItem,{name:!0,classes:"image"}))return;const s=e.findViewImgElement(n.viewItem);if(!s||!i.consumable.test(s,{name:!0}))return;i.consumable.consume(n.viewItem,{name:!0,classes:"image"});const o=$r(i.convertItem(s,n.modelCursor).modelRange.getItems());o?(i.convertChildren(n.viewItem,o),i.updateConversionResult(o,n)):i.consumable.revert(n.viewItem,{name:!0,classes:"image"})}}(i))}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(s,o)=>{const r=Array.from(o.content.getChildren());let a;if(!r.every(i.isInlineImageView))return;a=o.targetRanges?e.editing.mapper.toModelRange(o.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageBlock"===Jg(t.schema,l)){const e=new Yu(n.document),t=r.map(t=>e.createElement("figure",{class:"image"},t));o.content=e.createDocumentFragment(t)}})}}var pp=o(48);oo()(pp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),pp.Z.locals;class fp extends rt{static get requires(){return[gp,Wm,ap]}static get pluginName(){return"ImageBlock"}}class xp extends rt{static get requires(){return[hp,Qg,bm]}static get pluginName(){return"ImageInlineEditing"}init(){const e=this.editor,t=e.model.schema;t.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]}),t.addChildCheck((e,t)=>{if(e.endsWith("caption")&&"imageInline"===t.name)return!1}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new mp(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,n=e.conversion,i=e.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),n.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:n})=>i.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(n),n,t("image widget"))}),n.for("downcast").add(dp(i,"imageInline","src")).add(dp(i,"imageInline","alt")).add(lp(i,"imageInline")),n.for("upcast").elementToElement({view:Xg(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:null)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,n=e.editing.view,i=e.plugins.get("ImageUtils");this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(s,o)=>{const r=Array.from(o.content.getChildren());let a;if(!r.every(i.isBlockImageView))return;a=o.targetRanges?e.editing.mapper.toModelRange(o.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageInline"===Jg(t.schema,l)){const e=new Yu(n.document),t=r.map(t=>1===t.childCount?(Array.from(t.getAttributes()).forEach(n=>e.setAttribute(...n,i.findViewImgElement(t))),t.getChild(0)):t);o.content=e.createDocumentFragment(t)}})}}class _p extends rt{static get requires(){return[xp,Wm,ap]}static get pluginName(){return"ImageInline"}}class Ip extends lt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(e){const t=this.editor,n=t.model,i=t.plugins.get("ImageUtils").getClosestSelectedImageElement(n.document.selection);this.value={width:e.width,height:null},i&&n.change(t=>{t.setAttribute("width",e.width,i)})}}class vp extends rt{static get requires(){return[Qg]}static get pluginName(){return"ImageResizeEditing"}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Ip(e);this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:"width"}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:"width"})}_registerConverters(e){const t=this.editor;t.conversion.for("downcast").add(t=>t.on(`attribute:width:${e}`,(e,t,n)=>{if(!n.consumable.consume(t.item,e.name))return;const i=n.writer,s=n.mapper.toViewElement(t.item);null!==t.attributeNewValue?(i.setStyle("width",t.attributeNewValue,s),i.addClass("image_resized",s)):(i.removeStyle("width",s),i.removeClass("image_resized",s))})),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"width",value:e=>e.getStyle("width")}})}}const bp={small:'',medium:'',large:'',original:''};class jp extends rt{static get requires(){return[vp]}static get pluginName(){return"ImageResizeButtons"}constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),n=e.commands.get("resizeImage");this.bind("isEnabled").to(n);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:n,value:i,icon:s}=e,o=i?i+this._resizeUnit:null;t.ui.componentFactory.add(n,n=>{const i=new fc(n),r=t.commands.get("resizeImage"),a=this._getOptionLabelValue(e,!0);if(!bp[s])throw new u("imageresizebuttons-missing-icon",t,e);return i.set({label:a,icon:bp[s],tooltip:a,isToggleable:!0}),i.bind("isEnabled").to(this),i.bind("isOn").to(r,"value",Cp(o)),this.listenTo(i,"execute",()=>{t.execute("resizeImage",{width:o})}),i})}_registerImageResizeDropdown(e){const t=this.editor,n=t.t,i=e.find(e=>!e.value),s=s=>{const o=t.commands.get("resizeImage"),r=Kc(s,Ac),a=r.buttonView;return a.set({tooltip:n("Resize image"),commandValue:i.value,icon:bp.medium,isToggleable:!0,label:this._getOptionLabelValue(i),withText:!0,class:"ck-resize-image-button"}),a.bind("label").to(o,"value",e=>e&&e.width?e.width:this._getOptionLabelValue(i)),r.bind("isOn").to(o),r.bind("isEnabled").to(this),Xc(r,this._getResizeDropdownListItemDefinitions(e,o)),r.listView.ariaLabel=n("Image resize list"),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus()}),r};t.ui.componentFactory.add("resizeImage",s),t.ui.componentFactory.add("imageResize",s)}_getOptionLabelValue(e,t){const n=this.editor.t;return e.label?e.label:t?e.value?n("Resize image to %0",e.value+this._resizeUnit):n("Resize image to the original size"):e.value?e.value+this._resizeUnit:n("Original")}_getResizeDropdownListItemDefinitions(e,t){const n=new Un;return e.map(e=>{const i=e.value?e.value+this._resizeUnit:null,s={type:"button",model:new mu({commandName:"resizeImage",commandValue:i,label:this._getOptionLabelValue(e),withText:!0,icon:null})};s.model.bind("isOn").to(t,"value",Cp(i)),n.add(s)}),n}}function Cp(e){return t=>null===e&&t===e||t&&t.width===e}const yp=/(image|image-inline)/,kp="image_resized";class Ap extends rt{static get requires(){return[Yg]}static get pluginName(){return"ImageResizeHandles"}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view;t.addObserver(cp),this.listenTo(t.document,"imageLoaded",(n,i)=>{if(!i.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const s=e.editing.view.domConverter,o=s.domToView(i.target).findAncestor({classes:yp});let r=this.editor.plugins.get(Yg).getResizerByViewElement(o);if(r)return void r.redraw();const a=e.editing.mapper,l=a.toModelElement(o);r=e.plugins.get(Yg).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:l,viewElement:o,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>s.viewToDom(a.toViewElement(l.parent)),isCentered(){const e=l.getAttribute("imageStyle");return!e||"block"==e||"alignCenter"==e},onCommit(n){t.change(e=>{e.removeClass(kp,o)}),e.execute("resizeImage",{width:n})}}),r.on("updateSize",()=>{o.hasClass(kp)||t.change(e=>{e.addClass(kp,o)})}),r.bind("isEnabled").to(this)})}}var wp=o(43);oo()(wp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),wp.Z.locals;class Sp{constructor(){const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise((n,i)=>{t.onload=()=>{const e=t.result;this._data=e,n(e)},t.onerror=()=>{i("error")},t.onabort=()=>{i("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}}ot(Sp,Qe);class Ep extends rt{static get pluginName(){return"FileRepository"}static get requires(){return[Rd]}init(){this.loaders=new Un,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return h("filerepository-no-upload-adapter"),null;const t=new Tp(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(e=>{this._loadersMap.set(e,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e}),t.on("change:uploadTotal",()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e}),t}destroyLoader(e){const t=e instanceof Tp?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((e,n)=>{e===t&&this._loadersMap.delete(n)})}_updatePendingAction(){const e=this.editor.plugins.get(Rd);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,n=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(n(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else e.remove(this._pendingAction),this._pendingAction=null}}ot(Ep,Qe);class Tp{constructor(e,t){this.id=a(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new Sp,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new u("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e}).catch(e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e})}upload(){if("idle"!=this.status)throw new u("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e})}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise((n,i)=>{t.rejecter=i,t.isFulfilled=!1,e.then(e=>{t.isFulfilled=!0,n(e)}).catch(e=>{t.isFulfilled=!0,i(e)})}),t}}ot(Tp,Qe);class zp extends Bd{constructor(e){super(e),this.buttonView=new fc(e),this._fileInputView=new Op(e),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class Op extends Bd{constructor(e){super(e),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}class Rp{constructor(e,t){this.loader=e,this.options=t}upload(){return this.loader.file.then(e=>new Promise((t,n)=>{this._initRequest(),this._initListeners(t,n,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.options.uploadUrl,!0),e.responseType="json"}_initListeners(e,t,n){const i=this.xhr,s=this.loader,o=`Couldn't upload file: ${n.name}.`;i.addEventListener("error",()=>t(o)),i.addEventListener("abort",()=>t()),i.addEventListener("load",()=>{const n=i.response;if(!n||n.error)return t(n&&n.error&&n.error.message?n.error.message:o);const s=n.url?{default:n.url}:n.urls;e({...n,urls:s})}),i.upload&&i.upload.addEventListener("progress",e=>{e.lengthComputable&&(s.uploadTotal=e.total,s.uploaded=e.loaded)})}_sendRequest(e){const t=this.options.headers||{},n=this.options.withCredentials||!1;for(const e of Object.keys(t))this.xhr.setRequestHeader(e,t[e]);this.xhr.withCredentials=n;const i=new FormData;i.append("upload",e),this.xhr.send(i)}}function $p(e){const t=e.map(e=>e.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function Dp(e){return new Promise((t,n)=>{const i=e.getAttribute("src");fetch(i).then(e=>e.blob()).then(e=>{const n=Pp(e,i),s=n.replace("image/",""),o=new File([e],`image.${s}`,{type:n});t(o)}).catch(e=>e&&"TypeError"===e.name?function(e){return function(e){return new Promise((t,n)=>{const i=ho.document.createElement("img");i.addEventListener("load",()=>{const e=ho.document.createElement("canvas");e.width=i.width,e.height=i.height,e.getContext("2d").drawImage(i,0,0),e.toBlob(e=>e?t(e):n())}),i.addEventListener("error",()=>n()),i.src=e})}(e).then(t=>{const n=Pp(t,e),i=n.replace("image/","");return new File([t],`image.${i}`,{type:n})})}(i).then(t).catch(n):n(e))})}function Pp(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Fp extends rt{static get pluginName(){return"ImageUploadUI"}init(){const e=this.editor,t=e.t,n=n=>{const i=new zp(n),s=e.commands.get("uploadImage"),o=e.config.get("image.upload.types"),r=$p(o);return i.set({acceptedType:o.map(e=>`image/${e}`).join(","),allowMultipleFiles:!0}),i.buttonView.set({label:t("Insert image"),icon:'',tooltip:!0}),i.buttonView.bind("isEnabled").to(s),i.on("done",(t,n)=>{const i=Array.from(n).filter(e=>r.test(e.type));i.length&&e.execute("uploadImage",{file:i})}),i};e.ui.componentFactory.add("uploadImage",n),e.ui.componentFactory.add("imageUpload",n)}}var Mp=o(870);oo()(Mp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Mp.Z.locals;var Np=o(899);oo()(Np.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Np.Z.locals;var Lp=o(825);oo()(Lp.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Lp.Z.locals;class Bp extends rt{static get pluginName(){return"ImageUploadProgress"}constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",(...e)=>this.uploadStatusChange(...e)),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",(...e)=>this.uploadStatusChange(...e))}uploadStatusChange(e,t,n){const i=this.editor,s=t.item,o=s.getAttribute("uploadId");if(!n.consumable.consume(t.item,e.name))return;const r=i.plugins.get("ImageUtils"),a=i.plugins.get(Ep),l=o?t.attributeNewValue:null,d=this.placeholder,c=i.editing.mapper.toViewElement(s),u=n.writer;if("reading"==l)return Vp(c,u),void Up(r,d,c,u);if("uploading"==l){const e=a.loaders.get(o);return Vp(c,u),void(e?(Wp(c,u),function(e,t,n,i){const s=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),s),n.on("change:uploadedPercent",(e,t,n)=>{i.change(e=>{e.setStyle("width",n+"%",s)})})}(c,u,e,i.editing.view),function(e,t,n,i){if(i.data){const s=e.findViewImgElement(t);n.setAttribute("src",i.data,s)}}(r,c,u,e)):Up(r,d,c,u))}"complete"==l&&a.loaders.get(o)&&function(e,t,n){const i=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),i),setTimeout(()=>{n.change(e=>e.remove(e.createRangeOn(i)))},3e3)}(c,u,i.editing.view),function(e,t){Hp(e,t,"progressBar")}(c,u),Wp(c,u),function(e,t){t.removeClass("ck-appear",e)}(c,u)}}function Vp(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function Up(e,t,n,i){n.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",n);const s=e.findViewImgElement(n);s.getAttribute("src")!==t&&i.setAttribute("src",t,s),Gp(n,"placeholder")||i.insert(i.createPositionAfter(s),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(i))}function Wp(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),Hp(e,t,"placeholder")}function Gp(e,t){for(const n of e.getChildren())if(n.getCustomProperty(t))return n}function Hp(e,t,n){const i=Gp(e,n);i&&t.remove(t.createRangeOn(i))}class qp extends lt{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),n=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(n)}execute(e){const t=Gn(e.file),n=this.editor.model.document.selection,i=this.editor.plugins.get("ImageUtils"),s=Object.fromEntries(n.getAttributes());t.forEach((e,t)=>{const o=n.getSelectedElement();if(t&&o&&i.isImage(o)){const t=this.editor.model.createPositionAfter(o);this._uploadImage(e,s,t)}else this._uploadImage(e,s)})}_uploadImage(e,t,n){const i=this.editor,s=i.plugins.get(Ep).createLoader(e),o=i.plugins.get("ImageUtils");s&&o.insertImage({...t,uploadId:s.id},n)}}class Yp extends rt{static get requires(){return[Ep,hu,bm,Qg]}static get pluginName(){return"ImageUploadEditing"}constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,n=e.conversion,i=e.plugins.get(Ep),s=e.plugins.get("ImageUtils"),o=$p(e.config.get("image.upload.types")),r=new qp(e);e.commands.add("uploadImage",r),e.commands.add("imageUpload",r),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",(t,n)=>{if(function(e){return Array.from(e.types).includes("text/html")&&""!==e.getData("text/html")}(n.dataTransfer))return;const i=Array.from(n.dataTransfer.files).filter(e=>!!e&&o.test(e.type));i.length&&(t.stop(),e.model.change(t=>{n.targetRanges&&t.setSelection(n.targetRanges.map(t=>e.editing.mapper.toModelRange(t))),e.model.enqueueChange(()=>{e.execute("uploadImage",{file:i})})}))}),this.listenTo(e.plugins.get("ClipboardPipeline"),"inputTransformation",(t,n)=>{const o=Array.from(e.editing.view.createRangeIn(n.content)).filter(e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src"))&&(t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||t.getAttribute("src").match(/^blob:/g))}(s,e.item)&&!e.item.getAttribute("uploadProcessed")).map(e=>({promise:Dp(e.item),imageElement:e.item}));if(!o.length)return;const r=new Yu(e.editing.view.document);for(const e of o){r.setAttribute("uploadProcessed",!0,e.imageElement);const t=i.createLoader(e.promise);t&&(r.setAttribute("src","",e.imageElement),r.setAttribute("uploadId",t.id,e.imageElement))}}),e.editing.view.document.on("dragover",(e,t)=>{t.preventDefault()}),t.on("change",()=>{const n=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),s=new Set;for(const t of n)if("insert"==t.type&&"$text"!=t.name){const n=t.position.nodeAfter,o="$graveyard"==t.position.root.rootName;for(const t of Kp(e,n)){const e=t.getAttribute("uploadId");if(!e)continue;const n=i.loaders.get(e);n&&(o?s.has(e)||n.abort():(s.add(e),this._uploadImageElements.set(e,t),"idle"==n.status&&this._readAndUpload(n)))}}}),this.on("uploadComplete",(e,{imageElement:t,data:n})=>{const i=n.urls?n.urls:n;this.editor.model.change(e=>{e.setAttribute("src",i.default,t),this._parseAndSetSrcsetAttributeOnImage(i,t,e)})},{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,n=t.model,i=t.locale.t,s=t.plugins.get(Ep),o=t.plugins.get(hu),r=t.plugins.get("ImageUtils"),a=this._uploadImageElements;return n.enqueueChange({isUndoable:!1},t=>{t.setAttribute("uploadStatus","reading",a.get(e.id))}),e.read().then(()=>{const i=e.upload(),s=a.get(e.id);if(ps.isSafari){const e=t.editing.mapper.toViewElement(s),n=r.findViewImgElement(e);t.editing.view.once("render",()=>{if(!n.parent)return;const e=t.editing.view.domConverter.mapViewToDom(n.parent);if(!e)return;const i=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=i})}return n.enqueueChange({isUndoable:!1},e=>{e.setAttribute("uploadStatus","uploading",s)}),i}).then(t=>{n.enqueueChange({isUndoable:!1},n=>{const i=a.get(e.id);n.setAttribute("uploadStatus","complete",i),this.fire("uploadComplete",{data:t,imageElement:i})}),l()}).catch(t=>{if("error"!==e.status&&"aborted"!==e.status)throw t;"error"==e.status&&t&&o.showWarning(t,{title:i("Upload failed"),namespace:"upload"}),n.enqueueChange({isUndoable:!1},t=>{t.remove(a.get(e.id))}),l()});function l(){n.enqueueChange({isUndoable:!1},t=>{const n=a.get(e.id);t.removeAttribute("uploadId",n),t.removeAttribute("uploadStatus",n),a.delete(e.id)}),s.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,n){let i=0;const s=Object.keys(e).filter(e=>{const t=parseInt(e,10);if(!isNaN(t))return i=Math.max(i,t),!0}).map(t=>`${e[t]} ${t}w`).join(", ");""!=s&&n.setAttribute("srcset",{data:s,width:i},t)}}function Kp(e,t){const n=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter(e=>n.isImage(e.item)).map(e=>e.item)}const Zp="italic";class Xp extends rt{static get pluginName(){return"ItalicEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Zp}),e.model.schema.setAttributeProperties(Zp,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Zp,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(Zp,new hm(e,Zp)),e.keystrokes.set("CTRL+I",Zp)}}const Jp="italic";class Qp extends rt{static get pluginName(){return"ItalicUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(Jp,n=>{const i=e.commands.get(Jp),s=new fc(n);return s.set({label:t("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>{e.execute(Jp),e.editing.view.focus()}),s})}}class ef{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach(e=>this._definitions.add(e)):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",(e,t,n)=>{if(!n.consumable.test(t.item,"attribute:linkHref"))return;if(!t.item.is("selection")&&!n.schema.isInline(t.item))return;const i=n.writer,s=i.document.selection;for(const e of this._definitions){const o=i.createAttributeElement("a",e.attributes,{priority:5});e.classes&&i.addClass(e.classes,o);for(const t in e.styles)i.setStyle(t,e.styles[t],o);i.setCustomProperty("link",!0,o),e.callback(t.attributeNewValue)?t.item.is("selection")?i.wrap(s.getFirstRange(),o):i.wrap(n.mapper.toViewRange(t.range),o):i.unwrap(n.mapper.toViewRange(t.range),o)}},{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",(e,t,{writer:n,mapper:i})=>{const s=i.toViewElement(t.item),o=Array.from(s.getChildren()).find(e=>"a"===e.name);for(const e of this._definitions){const i=ni(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of i)"class"===e?n.addClass(t,o):n.setAttribute(e,t,o);e.classes&&n.addClass(e.classes,o);for(const t in e.styles)n.setStyle(t,e.styles[t],o)}else{for(const[e,t]of i)"class"===e?n.removeClass(t,o):n.removeAttribute(e,o);e.classes&&n.removeClass(e.classes,o);for(const t in e.styles)n.removeStyle(t,o)}}})}}}var tf=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const nf=function(e){return tf.test(e)};var sf="\\ud800-\\udfff",of="["+sf+"]",rf="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",af="\\ud83c[\\udffb-\\udfff]",lf="[^"+sf+"]",df="(?:\\ud83c[\\udde6-\\uddff]){2}",cf="[\\ud800-\\udbff][\\udc00-\\udfff]",uf="(?:"+rf+"|"+af+")?",hf="[\\ufe0e\\ufe0f]?",mf=hf+uf+"(?:\\u200d(?:"+[lf,df,cf].join("|")+")"+hf+uf+")*",gf="(?:"+[lf+rf+"?",rf,df,cf,of].join("|")+")",pf=RegExp(af+"(?="+af+")|"+gf+mf,"g");const ff=function(e){return nf(e)?function(e){return e.match(pf)||[]}(e):function(e){return e.split("")}(e)},xf=function(e){return function(t){t=Ii(t);var n=nf(t)?ff(t):void 0,i=n?n[0]:t.charAt(0),s=n?function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:yi(e,t,n)}(n,1).join(""):t.slice(1);return i[e]()+s}}("toUpperCase"),_f=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,If=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,vf=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,bf=/^((\w+:(\/{2,})?)|(\W))/i,jf="Ctrl+K";function Cf(e,{writer:t}){const n=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,n),n}function yf(e){return function(e){return e.replace(_f,"").match(If)}(e=String(e))?e:"#"}function kf(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function Af(e,t){const n=function(e){return vf.test(e)}(e)?"mailto:":t,i=!!n&&!bf.test(e);return e&&i?n+e:e}function wf(e){window.open(e,"_blank","noopener")}class Sf extends lt{constructor(e){super(e),this.manualDecorators=new Un,this.automaticDecorators=new ef}restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement()||$r(t.getSelectedBlocks());kf(n,e.schema)?(this.value=n.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(n,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={}){const n=this.editor.model,i=n.document.selection,s=[],o=[];for(const e in t)t[e]?s.push(e):o.push(e);n.change(t=>{if(i.isCollapsed){const r=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=im(r,"linkHref",i.getAttribute("linkHref"),n);t.setAttribute("linkHref",e,a),s.forEach(e=>{t.setAttribute(e,!0,a)}),o.forEach(e=>{t.removeAttribute(e,a)}),t.setSelection(t.createPositionAfter(a.end.nodeBefore))}else if(""!==e){const o=ni(i.getAttributes());o.set("linkHref",e),s.forEach(e=>{o.set(e,!0)});const{end:a}=n.insertContent(t.createText(e,o),r);t.setSelection(a)}["linkHref",...s,...o].forEach(e=>{t.removeSelectionAttribute(e)})}else{const r=n.schema.getValidRanges(i.getRanges(),"linkHref"),a=[];for(const e of i.getSelectedBlocks())n.schema.checkAttribute(e,"linkHref")&&a.push(t.createRangeOn(e));const l=a.slice();for(const e of r)this._isRangeToUpdate(e,a)&&l.push(e);for(const n of l)t.setAttribute("linkHref",e,n),s.forEach(e=>{t.setAttribute(e,!0,n)}),o.forEach(e=>{t.removeAttribute(e,n)})}})}_getDecoratorStateFromModel(e){const t=this.editor.model,n=t.document.selection,i=n.getSelectedElement();return kf(i,t.schema)?i.getAttribute(e):n.getAttribute(e)}_isRangeToUpdate(e,t){for(const n of t)if(n.containsRange(e))return!1;return!0}}class Ef extends lt{refresh(){const e=this.editor.model,t=e.document.selection,n=t.getSelectedElement();kf(n,e.schema)?this.isEnabled=e.schema.checkAttribute(n,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,n=t.document.selection,i=e.commands.get("link");t.change(e=>{const s=n.isCollapsed?[im(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),t)]:t.schema.getValidRanges(n.getRanges(),"linkHref");for(const t of s)if(e.removeAttribute("linkHref",t),i)for(const n of i.manualDecorators)e.removeAttribute(n.id,t)})}}class Tf{constructor({id:e,label:t,attributes:n,classes:i,styles:s,defaultValue:o}){this.id=e,this.set("value"),this.defaultValue=o,this.label=t,this.attributes=n,this.classes=i,this.styles=s}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}ot(Tf,Qe);var zf=o(399);oo()(zf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),zf.Z.locals;const Of="automatic",Rf=/^(https?:)?\/\//;class $f extends rt{static get pluginName(){return"LinkEditing"}static get requires(){return[Xh,Wh,bm]}constructor(e){super(e),e.config.define("link",{addTargetToExternalLinks:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Cf}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,t)=>Cf(yf(e),t)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new Sf(e)),e.commands.add("unlink",new Ef(e));const t=function(e,t){const n={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach(e=>(e.label&&n[e.label]&&(e.label=n[e.label]),e)),t}(e.t,function(e){const t=[];if(e)for(const[n,i]of Object.entries(e)){const e=Object.assign({},i,{id:`link${xf(n)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(t.filter(e=>e.mode===Of)),this._enableManualDecorators(t.filter(e=>"manual"===e.mode)),e.plugins.get(Xh).registerAttribute("linkHref"),function(e,t,n,i){const s=e.editing.view,o=new Set;s.document.registerPostFixer(n=>{const s=e.model.document.selection;let r=!1;if(s.hasAttribute(t)){const a=im(s.getFirstPosition(),t,s.getAttribute(t),e.model),l=e.editing.mapper.toViewRange(a);for(const e of l.getItems())e.is("element","a")&&!e.hasClass(i)&&(n.addClass(i,e),o.add(e),r=!0)}return r}),e.conversion.for("editingDowncast").add(e=>{function t(){s.change(e=>{for(const t of o.values())e.removeClass(i,t),o.delete(t)})}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})})}(e,"linkHref",0,"ck-link_selected"),this._enableLinkOpen(),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(e){const t=this.editor,n=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&n.add({id:"linkIsExternal",mode:Of,callback:e=>Rf.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),n.add(e),n.length&&t.conversion.for("downcast").add(n.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,n=t.commands.get("link").manualDecorators;e.forEach(e=>{t.model.schema.extend("$text",{allowAttributes:e.id}),e=new Tf(e),n.add(e),t.conversion.for("downcast").attributeToElement({model:e.id,view:(t,{writer:n,schema:i},{item:s})=>{if(i.isInline(s)&&t){const t=n.createAttributeElement("a",e.attributes,{priority:5});e.classes&&n.addClass(e.classes,t);for(const i in e.styles)n.setStyle(i,e.styles[i],t);return n.setCustomProperty("link",!0,t),t}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...e._createPattern()},model:{key:e.id}})})}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document,n=e.model.document;this.listenTo(t,"click",(e,t)=>{if(!(ps.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let n=t.domTarget;if("a"!=n.tagName.toLowerCase()&&(n=n.closest("a")),!n)return;const i=n.getAttribute("href");i&&(e.stop(),t.preventDefault(),wf(i))},{context:"$capture"}),this.listenTo(t,"enter",(e,t)=>{const i=n.selection,s=i.getSelectedElement(),o=s?s.getAttribute("linkHref"):i.getAttribute("linkHref");o&&t.domEvent.altKey&&(e.stop(),wf(o))},{context:"a"})}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(e,"insertContent",()=>{const n=t.anchor.nodeBefore,i=t.anchor.nodeAfter;t.hasAttribute("linkHref")&&n&&n.hasAttribute("linkHref")&&(i&&i.hasAttribute("linkHref")||e.change(t=>{Df(t,Ff(e.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const e=this.editor,t=e.model;e.editing.view.addObserver(qu);let n=!1;this.listenTo(e.editing.view.document,"mousedown",()=>{n=!0}),this.listenTo(e.editing.view.document,"selectionChange",()=>{if(!n)return;n=!1;const e=t.document.selection;if(!e.isCollapsed)return;if(!e.hasAttribute("linkHref"))return;const i=e.getFirstPosition(),s=im(i,"linkHref",e.getAttribute("linkHref"),t);(i.isTouching(s.start)||i.isTouching(s.end))&&t.change(e=>{Df(e,Ff(t.schema))})})}_enableTypingOverLink(){const e=this.editor,t=e.editing.view;let n,i;this.listenTo(t.document,"delete",()=>{i=!0},{priority:"high"}),this.listenTo(e.model,"deleteContent",()=>{const t=e.model.document.selection;t.isCollapsed||(i?i=!1:Pf(e)&&function(e){const t=e.document.selection,n=t.getFirstPosition(),i=t.getLastPosition(),s=n.nodeAfter;if(!s)return!1;if(!s.is("$text"))return!1;if(!s.hasAttribute("linkHref"))return!1;if(s===(i.textNode||i.nodeBefore))return!0;return im(n,"linkHref",s.getAttribute("linkHref"),e).containsRange(e.createRange(n,i),!0)}(e.model)&&(n=t.getAttributes()))},{priority:"high"}),this.listenTo(e.model,"insertContent",(t,[s])=>{i=!1,Pf(e)&&n&&(e.model.change(e=>{for(const[t,i]of n)e.setAttribute(t,i,s)}),n=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const e=this.editor,t=e.model,n=t.document.selection,i=e.editing.view;let s=!1,o=!1;this.listenTo(i.document,"delete",(e,t)=>{o=t.domEvent.keyCode===Is.backspace},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{s=!1;const e=n.getFirstPosition(),i=n.getAttribute("linkHref");if(!i)return;const o=im(e,"linkHref",i,t);s=o.containsPosition(e)||o.end.isEqual(e)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{o&&(o=!1,s||e.model.enqueueChange(e=>{Df(e,Ff(t.schema))}))},{priority:"low"})}}function Df(e,t){e.removeSelectionAttribute("linkHref");for(const n of t)e.removeSelectionAttribute(n)}function Pf(e){return e.model.change(e=>e.batch).isTyping}function Ff(e){return e.getDefinition("$text").allowAttributes.filter(e=>e.startsWith("link"))}var Mf=o(827);oo()(Mf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Mf.Z.locals;class Nf extends Bd{constructor(e,t){super(e);const n=e.t;this.focusTracker=new Dr,this.keystrokes=new Pr,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Dd,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),$d,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&i.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children}),Fd(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((e,t)=>(e[t.name]=t.isOn,e),{})}render(){super.render(),Md({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const e=this.locale.t,t=new cu(this.locale,uu);return t.label=e("Link URL"),t}_createButton(e,t,n,i){const s=new fc(this.locale);return s.set({label:e,icon:t,tooltip:!0}),s.extendTemplate({attributes:{class:n}}),i&&s.delegate("execute").to(this,i),s}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const n of e.manualDecorators){const i=new _c(this.locale);i.set({name:n.id,label:n.label,withText:!0}),i.bind("isOn").toMany([n,e],"value",(e,t)=>void 0===t&&void 0===e?n.defaultValue:e),i.on("execute",()=>{n.set("value",!i.isOn)}),t.add(i)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new Bd;e.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(e)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}}var Lf=o(465);oo()(Lf.Z,{injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0}),Lf.Z.locals;class Bf extends Bd{constructor(e){super(e);const t=e.t;this.focusTracker=new Dr,this.keystrokes=new Pr,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(t("Unlink"),'',"unlink"),this.editButtonView=this._createButton(t("Edit link"),'',"edit"),this.set("href"),this._focusables=new Nd,this._focusCycler=new jc({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,n){const i=new fc(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.delegate("execute").to(this,n),i}_createPreviewButton(){const e=new fc(this.locale),t=this.bindTemplate,n=this.t;return e.set({withText:!0,tooltip:n("Open link in new tab")}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",e=>e&&yf(e)),target:"_blank",rel:"noopener noreferrer"}}),e.bind("label").to(this,"href",e=>e||n("This link has no URL")),e.bind("isEnabled").to(this,"href",e=>!!e),e.template.tag="a",e.template.eventListeners={},e}}const Vf="link-ui";class Uf extends rt{static get requires(){return[Cu]}static get pluginName(){return"LinkUI"}init(){const e=this.editor;e.editing.view.addObserver(Hu),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=e.plugins.get(Cu),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),e.conversion.for("editingDowncast").markerToHighlight({model:Vf,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:Vf,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const e=this.editor,t=new Bf(e.locale),n=e.commands.get("link"),i=e.commands.get("unlink");return t.bind("href").to(n,"value"),t.editButtonView.bind("isEnabled").to(n),t.unlinkButtonView.bind("isEnabled").to(i),this.listenTo(t,"edit",()=>{this._addFormView()}),this.listenTo(t,"unlink",()=>{e.execute("unlink"),this._hideUI()}),t.keystrokes.set("Esc",(e,t)=>{this._hideUI(),t()}),t.keystrokes.set(jf,(e,t)=>{this._addFormView(),t()}),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),n=e.config.get("link.defaultProtocol"),i=new Nf(e.locale,t);return i.urlInputView.fieldView.bind("value").to(t,"value"),i.urlInputView.bind("isReadOnly").to(t,"isEnabled",e=>!e),i.saveButtonView.bind("isEnabled").to(t),this.listenTo(i,"submit",()=>{const{value:t}=i.urlInputView.fieldView.element,s=Af(t,n);e.execute("link",s,i.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(i,"cancel",()=>{this._closeFormView()}),i.keystrokes.set("Esc",(e,t)=>{this._closeFormView(),t()}),i}_createToolbarLinkButton(){const e=this.editor,t=e.commands.get("link"),n=e.t;e.keystrokes.set(jf,(e,n)=>{n(),t.isEnabled&&this._showUI(!0)}),e.ui.componentFactory.add("link",e=>{const i=new fc(e);return i.isEnabled=!0,i.label=n("Link"),i.icon='',i.keystroke=jf,i.tooltip=!0,i.isToggleable=!0,i.bind("isEnabled").to(t,"isEnabled"),i.bind("isOn").to(t,"value",e=>!!e),this.listenTo(i,"execute",()=>this._showUI(!0)),i})}_enableUserBalloonInteractions(){const e=this.editor.editing.view.document;this.listenTo(e,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),Pd({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=e.value||""}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let n=this._getSelectedLinkElement(),i=o();const s=()=>{const e=this._getSelectedLinkElement(),t=o();n&&!e||!n&&t!==i?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),n=e,i=t};function o(){return t.selection.focus.getAncestors().reverse().find(e=>e.is("element"))}this.listenTo(e.ui,"update",s),this.listenTo(this._balloon,"change:visibleView",s)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,n=e.document;let i=null;if(t.markers.has(Vf)){const t=Array.from(this.editor.editing.mapper.markerNameToElements(Vf)),n=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));i=e.domConverter.viewRangeToDom(n)}else i=()=>{const t=this._getSelectedLinkElement();return t?e.domConverter.mapViewToDom(t):e.domConverter.viewRangeToDom(n.selection.getFirstRange())};return{target:i}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,n=t.getSelectedElement();if(t.isCollapsed||n&&wm(n))return Wf(t.getFirstPosition());{const n=t.getFirstRange().getTrimmed(),i=Wf(n.start),s=Wf(n.end);return i&&i==s&&e.createRangeIn(i).getTrimmed().isEqual(n)?i:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change(t=>{const n=e.document.selection.getFirstRange();if(e.markers.has(Vf))t.updateMarker(Vf,{range:n});else if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition(({item:t})=>!e.schema.isContent(t),{boundaries:n});t.addMarker(Vf,{usingOperation:!1,affectsData:!1,range:t.createRange(i,n.end)})}else t.addMarker(Vf,{usingOperation:!1,affectsData:!1,range:n})})}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(Vf)&&e.change(e=>{e.removeMarker(Vf)})}}function Wf(e){return e.getAncestors().find(e=>function(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")}(e))}const Gf=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class Hf extends rt{static get requires(){return[qh]}static get pluginName(){return"AutoLink"}init(){const e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const e=this.editor,t=new Zh(e.model,e=>{if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=qf(e.substr(0,e.length-1));return t?{url:t}:void 0});t.on("matched:data",(t,n)=>{const{batch:i,range:s,url:o}=n;if(!i.isTyping)return;const r=s.end.getShiftedBy(-1),a=r.getShiftedBy(-o.length),l=e.model.createRange(a,r);this._applyAutoLink(o,l)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("enter");n&&n.on("execute",()=>{const e=t.document.selection.getFirstPosition();if(!e.parent.previousSibling)return;const n=t.createRangeIn(e.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(n)})}_enableShiftEnterHandling(){const e=this.editor,t=e.model,n=e.commands.get("shiftEnter");n&&n.on("execute",()=>{const e=t.document.selection.getFirstPosition(),n=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)})}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:n,range:i}=Kh(e,t),s=qf(n);if(s){const e=t.createRange(i.end.getShiftedBy(-s.length),i.end);this._applyAutoLink(s,e)}}_applyAutoLink(e,t){const n=this.editor.model,i=this.editor.plugins.get("Delete");this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,n)&&n.enqueueChange(s=>{const o=this.editor.config.get("link.defaultProtocol"),r=Af(e,o);s.setAttribute("linkHref",r,t),n.enqueueChange(()=>{i.requestUndoOnBackspace()})})}}function qf(e){const t=Gf.exec(e);return t?t[2]:null}class Yf extends lt{constructor(e,t){super(e),this.type=t}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,n=t.document,i=Array.from(n.selection.getSelectedBlocks()).filter(e=>Zf(e,t.schema)),s=void 0!==e.forceValue?!e.forceValue:this.value;t.change(e=>{if(s){let t=i[i.length-1].nextSibling,n=Number.POSITIVE_INFINITY,s=[];for(;t&&"listItem"==t.name&&0!==t.getAttribute("listIndent");){const e=t.getAttribute("listIndent");e=n;)o>s.getAttribute("listIndent")&&(o=s.getAttribute("listIndent")),s.getAttribute("listIndent")==o&&e[t?"unshift":"push"](s),s=s[t?"previousSibling":"nextSibling"]}}function Zf(e,t){return t.checkChild(e.parent,"listItem")&&!t.isObject(e)}class Xf extends lt{constructor(e,t){super(e),this._indentBy="forward"==t?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=e.document;let n=Array.from(t.selection.getSelectedBlocks());e.change(e=>{const t=n[n.length-1];let i=t.nextSibling;for(;i&&"listItem"==i.name&&i.getAttribute("listIndent")>t.getAttribute("listIndent");)n.push(i),i=i.nextSibling;this._indentBy<0&&(n=n.reverse());for(const t of n){const n=t.getAttribute("listIndent")+this._indentBy;n<0?e.rename(t,"paragraph"):e.setAttribute("listIndent",n,t)}this.fire("_executeCleanup",n)})}_checkEnabled(){const e=$r(this.editor.model.document.selection.getSelectedBlocks());if(!e||!e.is("element","listItem"))return!1;if(this._indentBy>0){const t=e.getAttribute("listIndent"),n=e.getAttribute("listType");let i=e.previousSibling;for(;i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=t;){if(i.getAttribute("listIndent")==t)return i.getAttribute("listType")==n;i=i.previousSibling}return!1}return!0}}function Jf(e,t,n,i){const s=t.parent,o=n.mapper,r=n.writer;let a=o.toViewPosition(i.createPositionBefore(e));const l=tx(e.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:e.getAttribute("listIndent")}),d=e.previousSibling;if(l&&l.getAttribute("listIndent")==e.getAttribute("listIndent")){const e=o.toViewElement(l);a=r.breakContainer(r.createPositionAfter(e))}else if(d&&"listItem"==d.name){a=o.toViewPosition(i.createPositionAt(d,"end"));const e=o.findMappedViewAncestor(a),t=function(e){for(const t of e.getChildren())if("ul"==t.name||"ol"==t.name)return t;return null}(e);a=t?r.createPositionBefore(t):r.createPositionAt(e,"end")}else a=o.toViewPosition(i.createPositionBefore(e));if(a=ex(a),r.insert(a,s),d&&"listItem"==d.name){const e=o.toViewElement(d),n=r.createRange(r.createPositionAt(e,0),a).getWalker({ignoreElementEnd:!0});for(const e of n)if(e.item.is("element","li")){const i=r.breakContainer(r.createPositionBefore(e.item)),s=e.item.parent,o=r.createPositionAt(t,"end");Qf(r,o.nodeBefore,o.nodeAfter),r.move(r.createRangeOn(s),o),n.position=i}}else{const n=s.nextSibling;if(n&&(n.is("element","ul")||n.is("element","ol"))){let i=null;for(const t of n.getChildren()){const n=o.toModelElement(t);if(!(n&&n.getAttribute("listIndent")>e.getAttribute("listIndent")))break;i=t}i&&(r.breakContainer(r.createPositionAfter(i)),r.move(r.createRangeOn(i.parent),r.createPositionAt(t,"end")))}}Qf(r,s,s.nextSibling),Qf(r,s.previousSibling,s)}function Qf(e,t,n){return!t||!n||"ul"!=t.name&&"ol"!=t.name||t.name!=n.name||t.getAttribute("class")!==n.getAttribute("class")?null:e.mergeContainers(e.createPositionAfter(t))}function ex(e){return e.getLastMatchingPosition(e=>e.item.is("uiElement"))}function tx(e,t){const n=!!t.sameIndent,i=!!t.smallerIndent,s=t.listIndent;let o=e;for(;o&&"listItem"==o.name;){const e=o.getAttribute("listIndent");if(n&&s==e||i&&s>e)return o;o="forward"===t.direction?o.nextSibling:o.previousSibling}return null}function nx(e,t,n,i){e.ui.componentFactory.add(t,s=>{const o=e.commands.get(t),r=new fc(s);return r.set({label:n,icon:i,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(o,"value","isEnabled"),r.on("execute",()=>{e.execute(t),e.editing.view.focus()}),r})}function ix(){const e=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||e?0:Vi.call(this)}function sx(e){return(t,n,i)=>{const s=i.consumable;if(!s.test(n.item,"insert")||!s.test(n.item,"attribute:listType")||!s.test(n.item,"attribute:listIndent"))return;s.consume(n.item,"insert"),s.consume(n.item,"attribute:listType"),s.consume(n.item,"attribute:listIndent");const o=n.item;Jf(o,function(e,t){const n=t.mapper,i=t.writer,s="numbered"==e.getAttribute("listType")?"ol":"ul",o=function(e){const t=e.createContainerElement("li");return t.getFillerOffset=ix,t}(i),r=i.createContainerElement(s,null);return i.insert(i.createPositionAt(r,0),o),n.bindElements(e,o),o}(o,i),i,e)}}function ox(e,t,n){if(!n.consumable.test(t.item,e.name))return;const i=n.mapper.toViewElement(t.item),s=n.writer;s.breakContainer(s.createPositionBefore(i)),s.breakContainer(s.createPositionAfter(i));const o=i.parent,r="numbered"==t.attributeNewValue?"ol":"ul";s.rename(r,o)}function rx(e,t,n){n.consumable.consume(t.item,e.name);const i=n.mapper.toViewElement(t.item).parent,s=n.writer;Qf(s,i,i.nextSibling),Qf(s,i.previousSibling,i)}function ax(e,t,n){if(n.consumable.test(t.item,e.name)&&"listItem"!=t.item.name){let e=n.mapper.toViewPosition(t.range.start);const i=n.writer,s=[];for(;("ul"==e.parent.name||"ol"==e.parent.name)&&(e=i.breakContainer(e),"li"==e.parent.name);){const t=e,n=i.createPositionAt(e.parent,"end");if(!t.isEqual(n)){const e=i.remove(i.createRange(t,n));s.push(e)}e=i.createPositionAfter(e.parent)}if(s.length>0){for(let t=0;t0){const t=Qf(i,n,n.nextSibling);t&&t.parent==n&&e.offset--}}Qf(i,e.nodeBefore,e.nodeAfter)}}}function lx(e,t,n){const i=n.mapper.toViewPosition(t.position),s=i.nodeBefore,o=i.nodeAfter;Qf(n.writer,s,o)}function dx(e,t,n){if(n.consumable.consume(t.viewItem,{name:!0})){const e=n.writer,i=e.createElement("listItem"),s=function(e){let t=0,n=e.parent;for(;n;){if(n.is("element","li"))t++;else{const e=n.previousSibling;e&&e.is("element","li")&&t++}n=n.parent}return t}(t.viewItem);e.setAttribute("listIndent",s,i);const o=t.viewItem.parent&&"ol"==t.viewItem.parent.name?"numbered":"bulleted";if(e.setAttribute("listType",o,i),!n.safeInsert(i,t.modelCursor))return;const r=function(e,t,n){const{writer:i,schema:s}=n;let o=i.createPositionAfter(e);for(const r of t)if("ul"==r.name||"ol"==r.name)o=n.convertItem(r,o).modelCursor;else{const t=n.convertItem(r,i.createPositionAt(e,"end")),a=t.modelRange.start.nodeAfter;a&&a.is("element")&&!s.checkChild(e,a.name)&&(e=t.modelCursor.parent.is("element","listItem")?t.modelCursor.parent:gx(t.modelCursor),o=i.createPositionAfter(e))}return o}(i,t.viewItem.getChildren(),n);t.modelRange=e.createRange(t.modelCursor,r),n.updateConversionResult(i,t)}}function cx(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){const e=Array.from(t.viewItem.getChildren());for(const t of e)!t.is("element","li")&&!fx(t)&&t._remove()}}function ux(e,t,n){if(n.consumable.test(t.viewItem,{name:!0})){if(0===t.viewItem.childCount)return;const e=[...t.viewItem.getChildren()];let n=!1;for(const t of e)n&&!fx(t)&&t._remove(),fx(t)&&(n=!0)}}function hx(e){return(t,n)=>{if(n.isPhantom)return;const i=n.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){const t=n.mapper.toViewElement(i),s=t.getAncestors().find(fx),o=e.createPositionAt(t,0).getWalker();for(const e of o){if("elementStart"==e.type&&e.item.is("element","li")){n.viewPosition=e.previousPosition;break}if("elementEnd"==e.type&&e.item==s){n.viewPosition=e.nextPosition;break}}}}}function mx(e,[t,n]){let i,s=t.is("documentFragment")?t.getChild(0):t;if(i=n?this.createSelection(n):this.document.selection,s&&s.is("element","listItem")){const e=i.getFirstPosition();let t=null;if(e.parent.is("element","listItem")?t=e.parent:e.nodeBefore&&e.nodeBefore.is("element","listItem")&&(t=e.nodeBefore),t){const e=t.getAttribute("listIndent");if(e>0)for(;s&&s.is("element","listItem");)s._setAttribute("listIndent",s.getAttribute("listIndent")+e),s=s.nextSibling}}}function gx(e){const t=new Gr({startPosition:e});let n;do{n=t.next()}while(!n.value.item.is("element","listItem"));return n.value.item}function px(e,t,n,i,s,o){const r=tx(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:e,foo:"b"}),a=s.mapper,l=s.writer,d=r?r.getAttribute("listIndent"):null;let c;if(r)if(d==e){const e=a.toViewElement(r).parent;c=l.createPositionAfter(e)}else{const e=o.createPositionAt(r,"end");c=a.toViewPosition(e)}else c=n;c=ex(c);for(const e of[...i.getChildren()])fx(e)&&(c=l.move(l.createRangeOn(e),c).end,Qf(l,e,e.nextSibling),Qf(l,e.previousSibling,e))}function fx(e){return e.is("element","ol")||e.is("element","ul")}class xx extends rt{static get pluginName(){return"ListEditing"}static get requires(){return[Eh,qh]}init(){const e=this.editor;e.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const t=e.data,n=e.editing;e.model.document.registerPostFixer(t=>function(e,t){const n=e.document.differ.getChanges(),i=new Map;let s=!1;for(const i of n)if("insert"==i.type&&"listItem"==i.name)o(i.position);else if("insert"==i.type&&"listItem"!=i.name){if("$text"!=i.name){const n=i.position.nodeAfter;n.hasAttribute("listIndent")&&(t.removeAttribute("listIndent",n),s=!0),n.hasAttribute("listType")&&(t.removeAttribute("listType",n),s=!0),n.hasAttribute("listStyle")&&(t.removeAttribute("listStyle",n),s=!0),n.hasAttribute("listReversed")&&(t.removeAttribute("listReversed",n),s=!0),n.hasAttribute("listStart")&&(t.removeAttribute("listStart",n),s=!0);for(const t of Array.from(e.createRangeIn(n)).filter(e=>e.item.is("element","listItem")))o(t.previousPosition)}o(i.position.getShiftedBy(i.length))}else"remove"==i.type&&"listItem"==i.name?o(i.position):("attribute"==i.type&&"listIndent"==i.attributeKey||"attribute"==i.type&&"listType"==i.attributeKey)&&o(i.range.start);for(const e of i.values())r(e),a(e);return s;function o(e){const t=e.nodeBefore;if(t&&t.is("element","listItem")){let e=t;if(i.has(e))return;for(let t=e.previousSibling;t&&t.is("element","listItem");t=e.previousSibling)if(e=t,i.has(e))return;i.set(t,e)}else{const t=e.nodeAfter;t&&t.is("element","listItem")&&i.set(t,t)}}function r(e){let n=0,i=null;for(;e&&e.is("element","listItem");){const o=e.getAttribute("listIndent");if(o>n){let r;null===i?(i=o-n,r=n):(i>o&&(i=o),r=o-i),t.setAttribute("listIndent",r,e),s=!0}else i=null,n=e.getAttribute("listIndent")+1;e=e.nextSibling}}function a(e){let n=[],i=null;for(;e&&e.is("element","listItem");){const o=e.getAttribute("listIndent");if(i&&i.getAttribute("listIndent")>o&&(n=n.slice(0,o+1)),0!=o)if(n[o]){const i=n[o];e.getAttribute("listType")!=i&&(t.setAttribute("listType",i,e),s=!0)}else n[o]=e.getAttribute("listType");i=e,e=e.nextSibling}}}(e.model,t)),n.mapper.registerViewToModelLength("li",_x),t.mapper.registerViewToModelLength("li",_x),n.mapper.on("modelToViewPosition",hx(n.view)),n.mapper.on("viewToModelPosition",function(e){return(t,n)=>{const i=n.viewPosition,s=i.parent,o=n.mapper;if("ul"==s.name||"ol"==s.name){if(i.isAtEnd){const t=o.toModelElement(i.nodeBefore),s=o.getModelLength(i.nodeBefore);n.modelPosition=e.createPositionBefore(t).getShiftedBy(s)}else{const t=o.toModelElement(i.nodeAfter);n.modelPosition=e.createPositionBefore(t)}t.stop()}else if("li"==s.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const r=o.toModelElement(s);let a=1,l=i.nodeBefore;for(;l&&fx(l);)a+=o.getModelLength(l),l=l.previousSibling;n.modelPosition=e.createPositionBefore(r).getShiftedBy(a),t.stop()}}}(e.model)),t.mapper.on("modelToViewPosition",hx(n.view)),e.conversion.for("editingDowncast").add(t=>{t.on("insert",ax,{priority:"high"}),t.on("insert:listItem",sx(e.model)),t.on("attribute:listType:listItem",ox,{priority:"high"}),t.on("attribute:listType:listItem",rx,{priority:"low"}),t.on("attribute:listIndent:listItem",function(e){return(t,n,i)=>{if(!i.consumable.consume(n.item,"attribute:listIndent"))return;const s=i.mapper.toViewElement(n.item),o=i.writer;o.breakContainer(o.createPositionBefore(s)),o.breakContainer(o.createPositionAfter(s));const r=s.parent,a=r.previousSibling,l=o.createRangeOn(r);o.remove(l),a&&a.nextSibling&&Qf(o,a,a.nextSibling),px(n.attributeOldValue+1,n.range.start,l.start,s,i,e),Jf(n.item,s,i,e);for(const e of n.item.getChildren())i.consumable.consume(e,"insert")}}(e.model)),t.on("remove:listItem",function(e){return(t,n,i)=>{const s=i.mapper.toViewPosition(n.position).getLastMatchingPosition(e=>!e.item.is("element","li")),o=s.nodeAfter,r=i.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const a=o.parent,l=a.previousSibling,d=r.createRangeOn(a),c=r.remove(d);l&&l.nextSibling&&Qf(r,l,l.nextSibling),px(i.mapper.toModelElement(o).getAttribute("listIndent")+1,n.position,d.start,o,i,e);for(const e of r.createRangeIn(c).getItems())i.mapper.unbindViewElement(e);t.stop()}}(e.model)),t.on("remove",lx,{priority:"low"})}),e.conversion.for("dataDowncast").add(t=>{t.on("insert",ax,{priority:"high"}),t.on("insert:listItem",sx(e.model))}),e.conversion.for("upcast").add(e=>{e.on("element:ul",cx,{priority:"high"}),e.on("element:ol",cx,{priority:"high"}),e.on("element:li",ux,{priority:"high"}),e.on("element:li",dx)}),e.model.on("insertContent",mx,{priority:"high"}),e.commands.add("numberedList",new Yf(e,"numbered")),e.commands.add("bulletedList",new Yf(e,"bulleted")),e.commands.add("indentList",new Xf(e,"forward")),e.commands.add("outdentList",new Xf(e,"backward"));const i=n.view.document;this.listenTo(i,"enter",(e,t)=>{const n=this.editor.model.document,i=n.selection.getLastPosition().parent;n.selection.isCollapsed&&"listItem"==i.name&&i.isEmpty&&(this.editor.execute("outdentList"),t.preventDefault(),e.stop())},{context:"li"}),this.listenTo(i,"delete",(e,t)=>{if("backward"!==t.direction)return;const n=this.editor.model.document.selection;if(!n.isCollapsed)return;const i=n.getFirstPosition();if(!i.isAtStart)return;const s=i.parent;"listItem"===s.name&&(s.previousSibling&&"listItem"===s.previousSibling.name||(this.editor.execute("outdentList"),t.preventDefault(),e.stop()))},{context:"li"}),this.listenTo(e.editing.view.document,"tab",(t,n)=>{const i=n.shiftKey?"outdentList":"indentList";this.editor.commands.get(i).isEnabled&&(e.execute(i),n.stopPropagation(),n.preventDefault(),t.stop())},{context:"li"})}afterInit(){const e=this.editor.commands,t=e.get("indent"),n=e.get("outdent");t&&t.registerChildCommand(e.get("indentList")),n&&n.registerChildCommand(e.get("outdentList"))}}function _x(e){let t=1;for(const n of e.getChildren())if("ul"==n.name||"ol"==n.name)for(const e of n.getChildren())t+=_x(e);return t}class Ix extends rt{static get pluginName(){return"ListUI"}init(){const e=this.editor.t;nx(this.editor,"numberedList",e("Numbered List"),''),nx(this.editor,"bulletedList",e("Bulleted List"),'')}}const vx="underline";class bx extends rt{static get pluginName(){return"UnderlineEditing"}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:vx}),e.model.schema.setAttributeProperties(vx,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:vx,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(vx,new hm(e,vx)),e.keystrokes.set("CTRL+U","underline")}}const jx="underline";class Cx extends rt{static get pluginName(){return"UnderlineUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add(jx,n=>{const i=e.commands.get(jx),s=new fc(n);return s.set({label:t("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(s,"execute",()=>{e.execute(jx),e.editing.view.focus()}),s})}}class yx extends ph{}yx.builtinPlugins=[class extends rt{static get requires(){return[jh,yh]}static get pluginName(){return"Alignment"}},class extends rt{static get requires(){return[dm,um]}static get pluginName(){return"BlockQuote"}},class extends rt{static get requires(){return[gm,fm]}static get pluginName(){return"Bold"}},class extends rt{static get requires(){return[eg,Eh,rg,Rh,Yh,fg]}static get pluginName(){return"Essentials"}},class extends rt{static get requires(){return[Ag,Sg]}static get pluginName(){return"FontBackgroundColor"}},class extends rt{static get requires(){return[Tg,zg]}static get pluginName(){return"FontColor"}},class extends rt{static get requires(){return[Ng,Bg]}static get pluginName(){return"Heading"}},class extends rt{static get requires(){return[fp,_p]}static get pluginName(){return"Image"}},class extends rt{static get requires(){return[vp,Ap,jp]}static get pluginName(){return"ImageResize"}},class extends rt{static get pluginName(){return"ImageUpload"}static get requires(){return[Yp,Fp,Bp]}},class extends rt{static get requires(){return[Xp,Qp]}static get pluginName(){return"Italic"}},class extends rt{static get requires(){return[$f,Uf,Hf]}static get pluginName(){return"Link"}},class extends rt{static get requires(){return[xx,Ix]}static get pluginName(){return"List"}},Dg,class extends rt{static get requires(){return[Ep]}static get pluginName(){return"SimpleUploadAdapter"}init(){const e=this.editor.config.get("simpleUpload");e&&(e.uploadUrl?this.editor.plugins.get(Ep).createUploadAdapter=t=>new Rp(t,e):h("simple-upload-adapter-missing-uploadurl"))}},class extends rt{static get requires(){return[bx,Cx]}static get pluginName(){return"Underline"}}],yx.defaultConfig={toolbar:{items:["bold","italic","underline","|","heading","fontColor","fontBackgroundColor","alignment","|","blockQuote","bulletedList","numberedList","|","link","imageUpload","|","undo","redo"]},language:"fr"};const kx=yx})(),r.default})(),e.exports=i()},5594:(e,t,n)=>{"use strict";e.exports=n.p+"img/member-7b0dc9a7cc229b5ba65b.png"},5682:()=>{},5833:()=>{!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right",Aquamarine:"Aquamarine",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Break text":"Break text","Bulleted List":"Bulleted List",Cancel:"Cancel","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading","Dim grey":"Dim grey","Document colors":"Document colors",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Font Background Color":"Font Background Color","Font Color":"Font Color","Full size image":"Full size image",Green:"Green",Grey:"Grey",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Insert image":"Insert image","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block",Italic:"Italic",Justify:"Justify","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Paragraph:"Paragraph",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Save:"Save","Select all":"Select all","Show more items":"Show more items","Side image":"Side image","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","This link has no URL":"This link has no URL",Turquoise:"Turquoise",Underline:"Underline",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar","Wrap text":"Wrap text",Yellow:"Yellow"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},6041:(e,t,n)=>{"use strict";e.exports=n.p+"img/logoWeezeventSquare-9184b02c60dbc8695435.png"},6400:(e,t,n)=>{"use strict";e.exports=n.p+"img/weezConstruction-fb73dc7a26ba038c44b3.png"},6687:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankMessages-76d6e6c79babc98388e9.svg"},6871:()=>{!function(e){const t=e.it=e.it||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 di %1","Align center":"Allinea al centro","Align left":"Allinea a sinistra","Align right":"Allinea a destra",Aquamarine:"Aquamarina",Black:"Nero","Block quote":"Blocco citazione",Blue:"Blu",Bold:"Grassetto","Break text":"Interrompi testo","Bulleted List":"Elenco puntato",Cancel:"Annulla","Centered image":"Immagine centrata","Change image text alternative":"Cambia testo alternativo dell'immagine","Choose heading":"Seleziona intestazione","Dim grey":"Grigio tenue","Document colors":"Colori del docmento",Downloadable:"Scaricabile","Dropdown toolbar":"Barra degli strumenti del menu a discesa","Edit block":"Modifica blocco","Edit link":"Modifica collegamento","Editor toolbar":"Barra degli strumenti dell'editor","Font Background Color":"Colore di sfondo caratteri","Font Color":"Colore caratteri","Full size image":"Immagine a dimensione intera",Green:"Verde",Grey:"Grigio",Heading:"Intestazione","Heading 1":"Intestazione 1","Heading 2":"Intestazione 2","Heading 3":"Intestazione 3","Heading 4":"Intestazione 4","Heading 5":"Intestazione 5","Heading 6":"Intestazione 6","Image resize list":"Elenco ridimensionamenti immagine","Image toolbar":"Barra degli strumenti dell'immagine","image widget":"Widget immagine","In line":"In linea","Insert image":"Inserisci immagine","Insert paragraph after block":"Inserisci paragrafo dopo blocco","Insert paragraph before block":"Inserisci paragrafo prima di blocco",Italic:"Corsivo",Justify:"Giustifica","Left aligned image":"Immagine allineata a sinistra","Light blue":"Azzurro","Light green":"Verde chiaro","Light grey":"Grigio chiaro",Link:"Collegamento","Link URL":"URL del collegamento",Next:"Avanti","Numbered List":"Elenco numerato","Open in a new tab":"Apri in una nuova scheda","Open link in new tab":"Apri collegamento in nuova scheda",Orange:"Arancio",Original:"Originale",Paragraph:"Paragrafo",Previous:"Indietro",Purple:"Porpora",Red:"Rosso",Redo:"Ripristina","Remove color":"Rimuovi colore","Resize image":"Ridimensiona immagine","Resize image to %0":"Ridimensiona immagine a %0","Resize image to the original size":"Ridimensiona immagine alle dimensioni originali","Rich Text Editor":"Editor di testo formattato","Rich Text Editor, %0":"Editor di testo formattato, %0","Right aligned image":"Immagine allineata a destra",Save:"Salva","Select all":"Seleziona tutto","Show more items":"Mostra più elementi","Side image":"Immagine laterale","Text alignment":"Allineamento del testo","Text alignment toolbar":"Barra degli strumenti dell'allineamento","Text alternative":"Testo alternativo","This link has no URL":"Questo collegamento non ha un URL",Turquoise:"Turchese",Underline:"Sottolineato",Undo:"Annulla",Unlink:"Elimina collegamento","Upload failed":"Caricamento fallito","Upload in progress":"Caricamento in corso",White:"Bianco","Widget toolbar":"Barra degli strumenti del widget","Wrap text":"Testo a capo",Yellow:"Giallo"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},6954:(e,t,n)=>{"use strict";e.exports=n.p+"img/googleSatellite-0706bcb1678d6e9f219c.png"},7008:(e,t,n)=>{"use strict";e.exports=n.p+"img/accreditation-7f66e46aebab965fa566.png"},7648:(e,t,n)=>{"use strict";e.exports=n.p+"svg/weezeventBlankPerson-e5c7b9cf3fcac68f3df8.svg"},8144:(e,t,n)=>{"use strict";e.exports=n.p+"img/asoHomeBackground-e46035697a28c8d248e6.jpg"},8184:(e,t,n)=>{"use strict";e.exports=n.p+"svg/dnsWrongDomain-3954cd8d9805c779a7bc.svg"},8264:(e,t,n)=>{"use strict";e.exports=n.p+"img/userProfile-37c0493d81fa861def54.png"},8301:(e,t,n)=>{"use strict";e.exports=n.p+"img/aso-897aab2a976d58ba485d.png"},8652:(e,t,n)=>{"use strict";e.exports=n.p+"svg/done-d3eb25606e0846af3988.svg"},8798:(e,t,n)=>{"use strict";e.exports=n.p+"svg/recrewteerMarker-a76de3956f8adec5ded2.svg"},9191:()=>{},9625:(e,t,n)=>{"use strict";e.exports=n.p+"svg/fileCSV-6ea65d2431d3a4293aad.svg"},9844:()=>{!function(e){const t=e.es=e.es||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 de %1","Align center":"Centrar","Align left":"Alinear a la izquierda","Align right":"Alinear a la derecha",Aquamarine:"Aguamarina",Black:"Negro","Block quote":"Cita de bloque",Blue:"Azul",Bold:"Negrita","Break text":"Permitir quebrar texto","Bulleted List":"Lista con viñetas",Cancel:"Cancelar","Centered image":"Imagen centrada","Change image text alternative":"Cambiar el texto alternativo de la imagen","Choose heading":"Elegir Encabezado","Dim grey":"Gris Oscuro","Document colors":"Colores del documento",Downloadable:"Descargable","Dropdown toolbar":"Barra de herramientas desplegable","Edit block":"Cuadro de edición","Edit link":"Editar enlace","Editor toolbar":"Barra de herramientas de edición","Font Background Color":"Color de Fondo","Font Color":"Color de Fuente","Full size image":"Imagen a tamaño completo",Green:"Verde",Grey:"Gris",Heading:"Encabezado","Heading 1":"Encabezado 1","Heading 2":"Encabezado 2","Heading 3":"Encabezado 3","Heading 4":"Encabezado 4","Heading 5":"Encabezado 5","Heading 6":"Encabezado 6","Image resize list":"Listado para redimensionar imagen","Image toolbar":"Barra de herramientas de imagen","image widget":"Widget de imagen","In line":"En línea","Insert image":"Insertar imagen","Insert paragraph after block":"Insertar párrafo después del bloque","Insert paragraph before block":"Insertar párrafo antes del bloque",Italic:"Cursiva",Justify:"Justificar","Left aligned image":"Imagen alineada a la izquierda","Light blue":"Azul Claro","Light green":"Verde Claro","Light grey":"Gris Claro",Link:"Enlace","Link URL":"URL del enlace",Next:"Siguiente","Numbered List":"Lista numerada","Open in a new tab":"Abrir en una pestaña nueva ","Open link in new tab":"Abrir enlace en una pestaña nueva",Orange:"Anaranjado",Original:"Original",Paragraph:"Párrafo",Previous:"Anterior",Purple:"Morado",Red:"Rojo",Redo:"Rehacer","Remove color":"Quitar color","Resize image":"Redimensionar imagen","Resize image to %0":"Redimensionar imagen al %0","Resize image to the original size":"Redimensionar imagen al tamaño original","Rich Text Editor":"Editor de Texto Enriquecido","Rich Text Editor, %0":"Editor de Texto Enriquecido, %0","Right aligned image":"Imagen alineada a la derecha",Save:"Guardar","Select all":"Seleccionar todo","Show more items":"Mostrar más elementos","Side image":"Imagen lateral","Text alignment":"Alineación del texto","Text alignment toolbar":"Barra de herramientas de alineación del texto","Text alternative":"Texto alternativo","This link has no URL":"Este enlace no tiene URL",Turquoise:"Turquesa",Underline:"Subrayado",Undo:"Deshacer",Unlink:"Quitar enlace","Upload failed":"Fallo en la subida","Upload in progress":"Subida en progreso",White:"Blanco","Widget toolbar":"Barra de herramientas del widget","Wrap text":"Mantener texto unido",Yellow:"Amarillo"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}))},9882:(e,t,n)=>{"use strict";e.exports=n.p+"img/ign-3cfd31ba578060a32efa.png"}},e=>{e.O(0,[121],()=>e(e.s=3646)),e.O()}]); //# sourceMappingURL=app-4ae9c440c058bfc43499.cjs.map